1var __BUNDLE_START_TIME__=globalThis.nativePerformanceNow?nativePerformanceNow():Date.now(),__DEV__=false,process=globalThis.process||{},__METRO_GLOBAL_PREFIX__='';process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||"production"; 2!(function(e){'use strict';e[`${__METRO_GLOBAL_PREFIX__}__d`]||(e.__r=i,e[`${__METRO_GLOBAL_PREFIX__}__d`]=function(e,n,o){if(t.has(n))return;const i={dependencyMap:o,factory:e,hasError:!1,importedAll:r,importedDefault:r,isInitialized:!1,publicModule:{exports:{}}};t.set(n,i)},e.__c=o,e.__registerSegment=function(e,r,n){c[e]=r,n&&n.forEach(r=>{t.has(r)||s.has(r)||s.set(r,e)})});var t=o();const r={},{hasOwnProperty:n}={};function o(){return t=new Map}function i(e,r){if(null===e)throw new Error('Cannot find module');const n=t.get(e);return n&&n.isInitialized?n.publicModule.exports:a(e,n,r)}function l(e,n){var o;if(t.has(e)&&(null==(o=t.get(e))?void 0:o.importedDefault)!==r)return t.get(e).importedDefault;const l=i(e,n),u=l&&l.__esModule?l.default:l;return t.get(e).importedDefault=u}function u(e,o){var l;if(t.has(e)&&(null==(l=t.get(e))?void 0:l.importedAll)!==r)return t.get(e).importedAll;const u=i(e,o);let d;if(u&&u.__esModule)d=u;else{if(d={},u)for(const e in u)n.call(u,e)&&(d[e]=u[e]);d.default=u}return t.get(e).importedAll=d}i.importDefault=l,i[Symbol.for('expo.require')]=!0,i.importAll=u,i.context=function(){throw new Error('The experimental Metro feature `require.context` is not enabled in your project.')},i.resolveWeak=function(){throw new Error('require.resolveWeak cannot be called dynamically.')},i.unguarded=function(e,r){const n=t.get(e);return n&&n.isInitialized?n.publicModule.exports:f(e,n,r)};let d=!1;function a(t,r,n){if(!d&&e.ErrorUtils){let o;d=!0;try{o=f(t,r,n)}catch(t){e.ErrorUtils.reportFatalError(t)}return d=!1,o}return f(t,r,n)}i.unpackModuleId=function(e){if('number'!=typeof e)throw new Error('Module ID must be a number in unpackModuleId.');return{segmentId:e>>>16,localId:65535&e}},i.packModuleId=function(e){return(e.segmentId<<16)+e.localId};const c=[],s=new Map;function f(r,n,o){if(!n&&c.length>0){const e=s.get(r)??0,o=c[e];null!=o&&(o(r),n=t.get(r),s.delete(r))}if(!n)throw p(r,o);if(n.hasError)throw n.error;n.isInitialized=!0;const{factory:d,dependencyMap:a}=n;try{const t=n.publicModule;return t.id=r,null==d||d(e,i,l,u,t,t.exports,a),n.factory=void 0,n.dependencyMap=void 0,t.exports}catch(e){throw n.hasError=!0,n.error=e,n.isInitialized=!1,n.publicModule.exports=void 0,e}}function p(e,t){return Error('Requiring unknown module "'+(e??t??"[unknown optional import]")+'".')}})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this); 3!(function(e){e.$$require_external="undefined"!=typeof require?e=>require(e):()=>null})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this); 4'undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window&&window; 5!(function(r){let l=0,n=!0===r.RN$useAlwaysAvailableJSErrorHandling?r.RN$handleException:(r,l)=>{throw r};const t={setGlobalHandler(r){n=r},getGlobalHandler:()=>n,reportError(r){n&&n(r,!1)},reportFatalError(r){n&&n(r,!0)},applyWithGuard(r,n,e,a,o){try{return l++,r.apply(n,e)}catch(r){t.reportError(r)}finally{l--}return null},applyWithGuardIfNeeded:(r,l,n)=>t.inGuard()?r.apply(l,n):(t.applyWithGuard(r,l,n),null),inGuard:()=>!!l,guard(r,l,n){if('function'!=typeof r)return console.warn('A function must be passed to ErrorUtils.guard, got ',r),null;const e=l??r.name??'<generated guard>';return function(...l){return t.applyWithGuard(r,n??this,l,null,e)}}};r.ErrorUtils=t})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this); 6__d(function(g,r,i,a,m,e,d){"use strict";r(d[0])},0,[1]); 7__d(function(g,r,i,a,m,e,d){"use strict";r(d[0]);var n=r(d[1]);(0,r(d[2]).renderRootComponent)(n.App)},1,[2,5,1113]); 8__d(function(g,r,i,a,m,e,d){"use strict";r(d[0]),r(d[1])},2,[3,4]); 9__d(function(g,r,i,a,m,e,d){},3,[]); 10__d(function(g,r,i,a,m,e,d){const _='undefined'==typeof window;globalThis.__webpack_chunk_load__=_=>g[`${__METRO_GLOBAL_PREFIX__}__loadBundleAsync`](_),globalThis.__webpack_require__=o=>{const t=ErrorUtils.reportFatalError;_&&(ErrorUtils.reportFatalError=_=>{throw _});try{return g[`${__METRO_GLOBAL_PREFIX__}__r`](o)}finally{_&&(ErrorUtils.reportFatalError=t)}}},4,[]); 11__d(function(g,r,i,a,m,e,d){"use strict";
vendor: 9,983 bytes, lines 11-38
11Object.defineProperty(e,"__esModule",{value:!0}),e.App=function(){return(0,t.jsx)(c.Head.Provider,{children:(0,t.jsx)(n.ExpoRoot,{context:o.ctx})})};const t=r(d[0]),o=r(d[1]);r(d[2]);const n=r(d[3]),c=r(d[4]);r(d[5])},5,[6,8,11,782,1107,1112]); 12__d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},6,[7]); 13__d(function(g,r,i,a,m,e,d){ 14/** 15 * @license React 16 * react-jsx-runtime.production.js 17 * 18 * Copyright (c) Meta Platforms, Inc. and affiliates. 19 * 20 * This source code is licensed under the MIT license found in the 21 * LICENSE file in the root directory of this source tree. 22 */ 23"use strict";var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(t,o,f){var l=null;if(void 0!==f&&(l=""+f),void 0!==o.key&&(l=""+o.key),"key"in o)for(var y in f={},o)"key"!==y&&(f[y]=o[y]);else f=o;return o=f.ref,{$$typeof:n,type:t,key:l,ref:void 0!==o?o:null,props:f}}e.Fragment=t,e.jsx=o,e.jsxs=o},7,[]); 24__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ctx",{enumerable:!0,get:function(){return t}});const t=r(d[0])},8,[9]); 25__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./_layout.tsx":{enumerable:!0,get:()=>r(d[0])},"./account.tsx":{enumerable:!0,get:()=>r(d[1])},"./activity.tsx":{enumerable:!0,get:()=>r(d[2])},"./admin/index.tsx":{enumerable:!0,get:()=>r(d[3])},"./admin/strategies.tsx":{enumerable:!0,get:()=>r(d[4])},"./agent.tsx":{enumerable:!0,get:()=>r(d[5])},"./autotrade.tsx":{enumerable:!0,get:()=>r(d[6])},"./billing.tsx":{enumerable:!0,get:()=>r(d[7])},"./chart.tsx":{enumerable:!0,get:()=>r(d[8])},"./connect.tsx":{enumerable:!0,get:()=>r(d[9])},"./derivative-studio.tsx":{enumerable:!0,get:()=>r(d[10])},"./derivative.tsx":{enumerable:!0,get:()=>r(d[11])},"./device.tsx":{enumerable:!0,get:()=>r(d[12])},"./discover.tsx":{enumerable:!0,get:()=>r(d[13])},"./index.tsx":{enumerable:!0,get:()=>r(d[14])},"./onboarding.tsx":{enumerable:!0,get:()=>r(d[15])},"./pattern-drawing-review.tsx":{enumerable:!0,get:()=>r(d[16])},"./pattern-history.tsx":{enumerable:!0,get:()=>r(d[17])},"./portfolios.tsx":{enumerable:!0,get:()=>r(d[18])},"./privacy.tsx":{enumerable:!0,get:()=>r(d[19])},"./recover.tsx":{enumerable:!0,get:()=>r(d[20])},"./screener.tsx":{enumerable:!0,get:()=>r(d[21])},"./signin.tsx":{enumerable:!0,get:()=>r(d[22])},"./signup.tsx":{enumerable:!0,get:()=>r(d[23])},"./simulate.tsx":{enumerable:!0,get:()=>r(d[24])},"./strategies.tsx":{enumerable:!0,get:()=>r(d[25])},"./terms.tsx":{enumerable:!0,get:()=>r(d[26])},"./watch.tsx":{enumerable:!0,get:()=>r(d[27])},"./welcome.tsx":{enumerable:!0,get:()=>r(d[28])},"./workspace.tsx":{enumerable:!0,get:()=>r(d[29])}});function n(n){return t[n]}n.keys=function(){return Object.keys(t)},n.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=n},9,[10,903,904,905,908,911,912,913,914,915,918,1000,1002,1003,1030,1032,1033,1036,1038,1039,1040,1041,1047,1048,1049,1050,1057,1058,1059,1064]); 26__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return P}}),r(d[0]);var e,n=r(d[1]),t=(e=n)&&e.__esModule?e:{default:e},o=r(d[2]),l=r(d[3]),u=r(d[4]),c=r(d[5]),s=r(d[6]),f=r(d[7]),_=r(d[8]),j=r(d[9]),S=r(d[10]),M=r(d[11]),h=r(d[12]),x=r(d[13]),I=r(d[14]),y=r(d[15]);function P(){const[e,n]=(0,l.useFonts)({ManropeBold:u.Manrope_700Bold,Inter:c.Inter_400Regular,InterMedium:s.Inter_500Medium,InterSemi:f.Inter_600SemiBold,Serif:_.SourceSerif4_400Regular,KeyMono:j.JetBrainsMono_500Medium});return e||n?(0,y.jsx)(o.SafeAreaProvider,{children:(0,y.jsx)(h.AuthProvider,{children:(0,y.jsx)(S.ProductProvider,{children:(0,y.jsx)(I.ScreenErrorBoundary,{children:(0,y.jsx)(x.PilotShell,{})})})})}):(0,y.jsx)(t.default,{style:{flex:1,backgroundColor:M.C.bg,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(M.T,{style:{fontSize:22,letterSpacing:5},children:"KANIDA"})})}},10,[11,13,105,113,184,186,188,190,192,194,196,821,198,833,900,6]); 27__d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},11,[12]); 28__d(function(g,r,_i,a,m,e,d){ 29/** 30 * @license React 31 * react.production.js 32 * 33 * Copyright (c) Meta Platforms, Inc. and affiliates. 34 * 35 * This source code is licensed under the MIT license found in the 36 * LICENSE file in the root directory of this source tree. 37 */ 38"use strict";var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),_=Symbol.iterator;var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function E(t,n,o){this.props=t,this.context=n,this.refs=S,this.updater=o||v}function w(){}function H(t,n,o){this.props=t,this.context=n,this.refs=S,this.updater=o||v}E.prototype.isReactComponent={},E.prototype.setState=function(t,n){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,n,"setState")},E.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},w.prototype=E.prototype;var j=H.prototype=new w;j.constructor=H,b(j,E.prototype),j.isPureReactComponent=!0;var R=Array.isArray;function k(){}var C={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function T(n,o,u){var c=u.ref;return{$$typeof:t,type:n,key:o,ref:void 0!==c?c:null,props:u}}function A(n){return"object"==typeof n&&null!==n&&n.$$typeof===t}var O=/\/+/g;function x(t,n){return"object"==typeof t&&null!==t&&null!=t.key?(o=""+t.key,u={"=":"=0",":":"=2"},"$"+o.replace(/[=:]/g,function(t){return u[t]})):n.toString(36);var o,u}function I(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch("string"==typeof t.status?t.then(k,k):(t.status="pending",t.then(function(n){"pending"===t.status&&(t.status="fulfilled",t.value=n)},function(n){"pending"===t.status&&(t.status="rejected",t.reason=n)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function P(o,u,c,i,s){var f=typeof o;"undefined"!==f&&"boolean"!==f||(o=null);var l,p,h=!1;if(null===o)h=!0;else switch(f){case"bigint":case"string":case"number":h=!0;break;case"object":switch(o.$$typeof){case t:case n:h=!0;break;case y:return P((h=o._init)(o._payload),u,c,i,s)}}if(h)return s=s(o),h=""===i?"."+x(o,0):i,R(s)?(c="",null!=h&&(c=h.replace(O,"$&/")+"/"),P(s,u,c,"",function(t){return t})):null!=s&&(A(s)&&(l=s,p=c+(null==s.key||o&&o.key===s.key?"":(""+s.key).replace(O,"$&/")+"/")+h,s=T(l.type,p,l.props)),u.push(s)),1;h=0;var v,b=""===i?".":i+":";if(R(o))for(var S=0;S<o.length;S++)h+=P(i=o[S],u,c,f=b+x(i,S),s);else if("function"==typeof(S=null===(v=o)||"object"!=typeof v?null:"function"==typeof(v=_&&v[_]||v["@@iterator"])?v:null))for(o=S.call(o),S=0;!(i=o.next()).done;)h+=P(i=i.value,u,c,f=b+x(i,S++),s);else if("object"===f){if("function"==typeof o.then)return P(I(o),u,c,i,s);throw u=String(o),Error("Objects are not valid as a React child (found: "+("[object Object]"===u?"object with keys {"+Object.keys(o).join(", ")+"}":u)+"). If you meant to render a collection of children, use an array instead.")}return h}function N(t,n,o){if(null==t)return t;var u=[],c=0;return P(t,u,"","",function(t){return n.call(o,t,c++)}),u}function U(t){if(-1===t._status){var n=t._result;(n=n()).then(function(n){0!==t._status&&-1!==t._status||(t._status=1,t._result=n)},function(n){0!==t._status&&-1!==t._status||(t._status=2,t._result=n)}),-1===t._status&&(t._status=0,t._result=n)}if(1===t._status)return t._result.default;throw t._result}var M="function"==typeof reportError?reportError:function(t){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof t&&null!==t&&"string"==typeof t.message?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",t);console.error(t)},V={map:N,forEach:function(t,n,o){N(t,function(){n.apply(this,arguments)},o)},count:function(t){var n=0;return N(t,function(){n++}),n},toArray:function(t){return N(t,function(t){return t})||[]},only:function(t){if(!A(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};e.Activity=h,e.Children=V,e.Component=E,e.Fragment=o,e.Profiler=c,e.PureComponent=H,e.StrictMode=u,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,e.__COMPILER_RUNTIME={__proto__:null,c:function(t){return C.H.useMemoCache(t)}},e.cache=function(t){return function(){return t.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(t,n,o){if(null==t)throw Error("The argument must be a React element, but you passed "+t+".");var u=b({},t.props),c=t.key;if(null!=n)for(i in void 0!==n.key&&(c=""+n.key),n)!$.call(n,i)||"key"===i||"__self"===i||"__source"===i||"ref"===i&&void 0===n.ref||(u[i]=n[i]);var i=arguments.length-2;if(1===i)u.children=o;else if(1<i){for(var s=Array(i),f=0;f<i;f++)s[f]=arguments[f+2];u.children=s}return T(t.type,c,u)},e.createContext=function(t){return(t={$$typeof:s,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider=t,t.Consumer={$$typeof:i,_context:t},t},e.createElement=function(t,n,o){var u,c={},i=null;if(null!=n)for(u in void 0!==n.key&&(i=""+n.key),n)$.call(n,u)&&"key"!==u&&"__self"!==u&&"__source"!==u&&(c[u]=n[u]);var s=arguments.length-2;
38if(1===s)c.children=o;else if(1<s){for(var f=Array(s),l=0;l<s;l++)f[l]=arguments[l+2];c.children=f}if(t&&t.defaultProps)for(u in s=t.defaultProps)void 0===c[u]&&(c[u]=s[u]);return T(t,i,c)},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:f,render:t}},e.isValidElement=A,e.lazy=function(t){return{$$typeof:y,_payload:{_status:-1,_result:t},_init:U}},e.memo=function(t,n){return{$$typeof:p,type:t,compare:void 0===n?null:n}},e.startTransition=function(t){var n=C.T,o={};C.T=o;try{var u=t(),c=C.S;null!==c&&c(o,u),"object"==typeof u&&null!==u&&"function"==typeof u.then&&u.then(k,M)}catch(t){M(t)}finally{null!==n&&null!==o.types&&(n.types=o.types),C.T=n}},e.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},e.use=function(t){return C.H.use(t)},e.useActionState=function(t,n,o){return C.H.useActionState(t,n,o)},e.useCallback=function(t,n){return C.H.useCallback(t,n)},e.useContext=function(t){return C.H.useContext(t)},e.useDebugValue=function(){},e.useDeferredValue=function(t,n){return C.H.useDeferredValue(t,n)},e.useEffect=function(t,n){return C.H.useEffect(t,n)},e.useEffectEvent=function(t){return C.H.useEffectEvent(t)},e.useId=function(){return C.H.useId()},e.useImperativeHandle=function(t,n,o){return C.H.useImperativeHandle(t,n,o)},e.useInsertionEffect=function(t,n){return C.H.useInsertionEffect(t,n)},e.useLayoutEffect=function(t,n){return C.H.useLayoutEffect(t,n)},e.useMemo=function(t,n){return C.H.useMemo(t,n)},e.useOptimistic=function(t,n){return C.H.useOptimistic(t,n)},e.useReducer=function(t,n,o){return C.H.useReducer(t,n,o)},e.useRef=function(t){return C.H.useRef(t)},e.useState=function(t){return C.H.useState(t)},e.useSyncExternalStore=function(t,n,o){return C.H.useSyncExternalStore(t,n,o)},e.useTransition=function(){return C.H.useTransition()},e.version="19.2.3"},12,[]); 39__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var o={};return e&&Object.keys(e).forEach(function(n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}),o.default=e,o}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return M}});var n=e(r(_d[0])),t=o(r(_d[1])),d=e(r(_d[2])),l=o(r(_d[3])),s=e(r(_d[4])),u=e(r(_d[5])),p=e(r(_d[6])),S=e(r(_d[7])),R=e(r(_d[8])),c=e(r(_d[9])),h=e(r(_d[10])),f=r(_d[11]),v=["hrefAttrs","onLayout","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStart
39ShouldSetResponder","onStartShouldSetResponderCapture"],C=Object.assign({},l.defaultProps,l.accessibilityProps,l.clickProps,l.focusProps,l.keyboardProps,l.mouseProps,l.touchProps,l.styleProps,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),y=e=>(0,s.default)(e,C),b=t.forwardRef((e,o)=>{var l=e.hrefAttrs,s=e.onLayout,c=e.onMoveShouldSetResponder,C=e.onMoveShouldSetResponderCapture,b=e.onResponderEnd,M=e.onResponderGrant,P=e.onResponderMove,w=e.onResponderReject,_=e.onResponderRelease,j=e.onResponderStart,O=e.onResponderTerminate,k=e.onResponderTerminationRequest,T=e.onScrollShouldSetResponder,D=e.onScrollShouldSetResponderCapture,E=e.onSelectionChangeShouldSetResponder,L=e.onSelectionChangeShouldSetResponderCapture,q=e.onStartShouldSetResponder,A=e.onStartShouldSetResponderCapture,G=(0,n.default)(e,v),z=t.useContext(h.default),I=t.useRef(null),W=(0,f.useLocaleContext)().direction;(0,u.default)(I,s),(0,R.default)(I,{onMoveShouldSetResponder:c,onMoveShouldSetResponderCapture:C,onResponderEnd:b,onResponderGrant:M,onResponderMove:P,onResponderReject:w,onResponderRelease:_,onResponderStart:j,onResponderTerminate:O,onResponderTerminationRequest:k,onScrollShouldSetResponder:T,onScrollShouldSetResponderCapture:D,onSelectionChangeShouldSetResponder:E,onSelectionChangeShouldSetResponderCapture:L,onStartShouldSetResponder:q,onStartShouldSetResponderCapture:A});var $='div',B=null!=e.lang?(0,f.getLocaleDirection)(e.lang):null,H=e.dir||B,N=H||W,V=y(G);if(V.dir=H,V.style=[x.view$raw,z&&x.inline,e.style],null!=e.href&&($='a',null!=l)){var F=l.download,J=l.rel,K=l.target;null!=F&&(V.download=F),null!=J&&(V.rel=J),'string'==typeof K&&(V.target='_'!==K.charAt(0)?'_'+K:K)}var Q=(0,S.default)(V),U=(0,p.default)(I,Q,o);return V.ref=U,(0,d.default)($,V,{writingDirection:N})});b.displayName='View';var x=c.default.create({view$raw:{alignContent:'flex-start',alignItems:'stretch',backgroundColor:'transparent',border:'0 solid black',boxSizing:'border-box',display:'flex',flexBasis:'auto',flexDirection:'column',flexShrink:0,listStyle:'none',margin:0,minHeight:0,minWidth:0,padding:0,position:'relative',textDecoration:'none',zIndex:0},inline:{display:'inline-flex'}}),M=b},13,[14,11,15,84,85,86,93,95,97,26,104,82]); 40__d(function(g,_r,i,a,m,_e,d){"use strict";function e(e,n){if(null==e)return{};var r={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==n.indexOf(t))continue;r[t]=e[t]}return r}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return e}})},14,[]); 41__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var t=e(r(d[0])),n=e(r(d[1])),l=e(r(d[2])),u=r(d[3]),o=(e,o,c)=>{var f;e&&e.constructor===String&&(f=t.default.propsToAccessibilityComponent(o));var s=f||e,_=(0,n.default)(s,o,c),p=l.default.createElement(s,_);return _.dir?l.default.createElement(u.LocaleProvider,{children:p,direction:_.dir,locale:_.lang}):p}},15,[16,20,11,82]); 42__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var t=e(r(d[0])),u=e(r(d[1])),o=e(r(d[2])),n={isDisabled:t.default,propsToAccessibilityComponent:u.default,propsToAriaRole:o.default}},16,[17,18,19]); 43__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=t=>t.disabled||Array.isArray(t.accessibilityStates)&&t.accessibilityStates.indexOf('disabled')>-1},17,[]); 44__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},o={article:'article',banner:'header',blockquote:'blockquote',button:'button',code:'code',complementary:'aside',contentinfo:'footer',deletion:'del',emphasis:'em',figure:'figure',insertion:'ins',form:'form',list:'ul',listitem:'li',main:'main',navigation:'nav',paragraph:'p',region:'section',strong:'strong'},l={},u=function(e){if(void 0===e&&(e=l),'label'===(e.role||e.accessibilityRole))return'label';var t=(0,n.default)(e);if(t){if('heading'===t){var u=e.accessibilityLevel||e['aria-level'];return null!=u?"h"+u:'h1'}return o[t]}}},18,[19]); 45__d(function(g,r,i,a,m,e,d){"use strict";
45Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var n={adjustable:'slider',button:'button',header:'heading',image:'img',imagebutton:null,keyboardkey:null,label:null,link:'link',none:'presentation',search:'search',summary:'region',text:null},t=t=>{var l=t.accessibilityRole,u=t.role||l;if(u){var o=n[u];if(null!==o)return o||u}}},19,[]); 46__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var l=e(r(d[0])),t=e(r(d[1])),s=e(r(d[2])),n=e(r(d[3])),c=r(d[4]),u=["aria-activedescendant","accessibilityActiveDescendant","aria-atomic","accessibilityAtomic","aria-autocomplete","accessibilityAutoComplete","aria-busy","accessibilityBusy","aria-checked","accessibilityChecked","aria-colcount","accessibilityColumnCount","aria-colindex","accessibilityColumnIndex","aria-colspan","accessibilityColumnSpan","aria-controls","accessibilityControls","aria-current","accessibilityCurrent","aria-describedby","accessibilityDescribedBy","aria-details","accessibilityDetails","aria-disabled","accessibilityDisabled","aria-errormessage","accessibilityErrorMessage","aria-expanded","accessibilityExpanded","aria-flowto","accessibilityFlowTo","aria-haspopup","accessibilityHasPopup","aria-hidden","accessibilityHidden","aria-invalid","accessibilityInvalid","aria-keyshortcuts","accessibilityKeyShortcuts","aria-label","accessibilityLabel","aria-labelledby","accessibilityLabelledBy","aria-level","accessibilityLevel","aria-live","accessibilityLiveRegion","aria-modal","accessibilityModal","aria-multiline","accessibilityMultiline","aria-multiselectable","accessibilityMultiSelectable","aria-orientation","accessibilityOrientation","aria-owns","accessibilityOwns","aria-placeholder","accessibilityPlaceholder","aria-posinset","accessibilityPosInSet","aria-pressed","accessibilityPressed","aria-readonly","accessibilityReadOnly","aria-required","accessibilityRequired","role","accessibilityRole","aria-roledescription","accessibilityRoleDescription","aria-rowcount","accessibilityRowCount","aria-rowindex","accessibilityRowIndex","aria-rowspan","accessibilityRowSpan","aria-selected","accessibilitySelected","aria-setsize","accessibilitySetSize","aria-sort","accessibilitySort","aria-valuemax","accessibilityValueMax","aria-valuemin","accessibilityValueMin","aria-valuenow","accessibilityValueNow","aria-valuetext","accessibilityValueText","dataSet","focusable","id","nativeID","pointerEvents","style","tabIndex","testID"],o={},b=Object.prototype.hasOwnProperty,y=Array.isArray,v=/[A-Z]/g;function p(e){return'-'+e.toLowerCase()}function x(e){return e.replace(v,p)}function w(e){return y(e)?e.join(' '):e}var f=n.default.create({auto:{pointerEvents:'auto'},'box-none':{pointerEvents:'box-none'},'box-only':{pointerEvents:'box-only'},none:{pointerEvents:'none'}}),h=(e,y,v)=>{y||(y=o);var p=y,h=p['aria-activedescendant'],S=p.accessibilityActiveDescendant,C=p['aria-atomic'],I=p.accessibilityAtomic,R=p['aria-autocomplete'],D=p.accessibilityAutoComplete,M=p['aria-busy'],E=p.accessibilityBusy,O=p['aria-checked'],P=p.accessibilityChecked,k=p['aria-colcount'],A=p.accessibilityColumnCount,L=p['aria-colindex'],V=p.accessibilityColumnIndex,q=p['aria-colspan'],B=p.accessibilityColumnSpan,_=p['aria-controls'],z=p.accessibilityControls,T=p['aria-current'],j=p.accessibilityCurrent,H=p['aria-describedby'],N=p.accessibilityDescribedBy,F=p['aria-details'],K=p.accessibilityDetails,U=p['aria-disabled'],Z=p.accessibilityDisabled,G=p['aria-errormessage'],J=p.accessibilityErrorMessage,Q=p['aria-expanded'],W=p.accessibilityExpanded,X=p['aria-flowto'],Y=p.accessibilityFlowTo,$=p['aria-haspopup'],aa=p.accessibilityHasPopup,ia=p['aria-hidden'],ea=p.accessibilityHidden,la=p['aria-invalid'],ra=p.accessibilityInvalid,ta=p['aria-keyshortcuts'],sa=p.accessibilityKeyShortcuts,na=p['aria-label'],ca=p.accessibilityLabel,ua=p['aria-labelledby'],oa=p.accessibilityLabelledBy,ba=p['aria-level'],da=p.accessibilityLevel,y
46a=p['aria-live'],va=p.accessibilityLiveRegion,pa=p['aria-modal'],xa=p.accessibilityModal,ma=p['aria-multiline'],wa=p.accessibilityMultiline,fa=p['aria-multiselectable'],ha=p.accessibilityMultiSelectable,Sa=p['aria-orientation'],Ca=p.accessibilityOrientation,Ia=p['aria-owns'],Ra=p.accessibilityOwns,Da=p['aria-placeholder'],Ma=p.accessibilityPlaceholder,Ea=p['aria-posinset'],Oa=p.accessibilityPosInSet,Pa=p['aria-pressed'],ga=p.accessibilityPressed,ka=p['aria-readonly'],Aa=p.accessibilityReadOnly,La=p['aria-required'],Va=p.accessibilityRequired,qa=(p.role,p.accessibilityRole,p['aria-roledescription']),Ba=p.accessibilityRoleDescription,_a=p['aria-rowcount'],za=p.accessibilityRowCount,Ta=p['aria-rowindex'],ja=p.accessibilityRowIndex,Ha=p['aria-rowspan'],Na=p.accessibilityRowSpan,Fa=p['aria-selected'],Ka=p.accessibilitySelected,Ua=p['aria-setsize'],Za=p.accessibilitySetSize,Ga=p['aria-sort'],Ja=p.accessibilitySort,Qa=p['aria-valuemax'],Wa=p.accessibilityValueMax,Xa=p['aria-valuemin'],Ya=p.accessibilityValueMin,$a=p['aria-valuenow'],ai=p.accessibilityValueNow,ii=p['aria-valuetext'],ei=p.accessibilityValueText,li=p.dataSet,ri=p.focusable,ti=p.id,si=p.nativeID,ni=p.pointerEvents,ci=p.style,ui=p.tabIndex,oi=p.testID,bi=(0,t.default)(p,u),di=U||Z,yi=s.default.propsToAriaRole(y),vi=null!=h?h:S;null!=vi&&(bi['aria-activedescendant']=vi);var pi=null!=C?h:I;null!=pi&&(bi['aria-atomic']=pi);var xi=null!=R?R:D;null!=xi&&(bi['aria-autocomplete']=xi);var mi=null!=M?M:E;null!=mi&&(bi['aria-busy']=mi);var wi=null!=O?O:P;null!=wi&&(bi['aria-checked']=wi);var fi=null!=k?k:A;null!=fi&&(bi['aria-colcount']=fi);var hi=null!=L?L:V;null!=hi&&(bi['aria-colindex']=hi);var Si=null!=q?q:B;null!=Si&&(bi['aria-colspan']=Si);
46var Ci=null!=_?_:z;null!=Ci&&(bi['aria-controls']=w(Ci));var Ii=null!=T?T:j;null!=Ii&&(bi['aria-current']=Ii);var Ri=null!=H?H:N;null!=Ri&&(bi['aria-describedby']=w(Ri));var Di=null!=F?F:K;null!=Di&&(bi['aria-details']=Di),!0===di&&(bi['aria-disabled']=!0,'button'!==e&&'form'!==e&&'input'!==e&&'select'!==e&&'textarea'!==e||(bi.disabled=!0));var Mi=null!=G?G:J;null!=Mi&&(bi['aria-errormessage']=Mi);var Ei=null!=Q?Q:W;null!=Ei&&(bi['aria-expanded']=Ei);var Oi=null!=X?X:Y;null!=Oi&&(bi['aria-flowto']=w(Oi));var Pi=null!=$?$:aa;null!=Pi&&(bi['aria-haspopup']=Pi);var gi=null!=ia?ia:ea;!0===gi&&(bi['aria-hidden']=gi);var ki=null!=la?la:ra;null!=ki&&(bi['aria-invalid']=ki);var Ai=null!=ta?ta:sa;null!=Ai&&(bi['aria-keyshortcuts']=w(Ai));var Li=null!=na?na:ca;null!=Li&&(bi['aria-label']=Li);var Vi=null!=ua?ua:oa;null!=Vi&&(bi['aria-labelledby']=w(Vi));var qi=null!=ba?ba:da;null!=qi&&(bi['aria-level']=qi);var Bi=null!=ya?ya:va;null!=Bi&&(bi['aria-live']='none'===Bi?'off':Bi);var _i=null!=pa?pa:xa;null!=_i&&(bi['aria-modal']=_i);var zi=null!=ma?ma:wa;null!=zi&&(bi['aria-multiline']=zi);var Ti=null!=fa?fa:ha;null!=Ti&&(bi['aria-multiselectable']=Ti);var ji=null!=Sa?Sa:Ca;null!=ji&&(bi['aria-orientation']=ji);var Hi=null!=Ia?Ia:Ra;null!=Hi&&(bi['aria-owns']=w(Hi));var Ni=null!=Da?Da:Ma;null!=Ni&&(bi['aria-placeholder']=Ni);var Fi=null!=Ea?Ea:Oa;null!=Fi&&(bi['aria-posinset']=Fi);var Ki=null!=Pa?Pa:ga;null!=Ki&&(bi['aria-pressed']=Ki);var Ui=null!=ka?ka:Aa;null!=Ui&&(bi['aria-readonly']=Ui,'input'!==e&&'select'!==e&&'textarea'!==e||(bi.readOnly=!0));var Zi=null!=La?La:Va;null!=Zi&&(bi['aria-required']=Zi,'input'!==e&&'select'!==e&&'textarea'!==e||(bi.required=Va)),null!=yi&&(bi.role='none'===yi?'presentation':yi);var Gi=null!=qa?qa:Ba;null!=Gi&&(bi['aria-roledescription']=Gi);var Ji=null!=_a?_a:za;null!=Ji&&(bi['aria-rowcount']=Ji);var Qi=null!=Ta?Ta:ja;null!=Qi&&(bi['aria-rowindex']=Qi);var Wi=null!=Ha?Ha:Na;null!=Wi&&(bi['aria-rowspan']=Wi);var Xi=null!=Fa?Fa:Ka;null!=Xi&&(bi['aria-selected']=Xi);var Yi=null!=Ua?Ua:Za;null!=Yi&&(bi['aria-setsize']=Yi);var $i=null!=Ga?Ga:Ja;null!=$i&&(bi['aria-sort']=$i);var ae=null!=Qa?Qa:Wa;null!=ae&&(bi['aria-valuemax']=ae);var ie=null!=Xa?Xa:Ya;null!=ie&&(bi['aria-valuemin']=ie);var ee=null!=$a?$a:ai;null!=ee&&(bi['aria-valuenow']=ee);var le=null!=ii?ii:ei;if(null!=le&&(bi['aria-valuetext']=le),null!=li)for(var re in li)if(b.call(li,re)){var te=x(re),se=li[re];null!=se&&(bi["data-"+te]=se)}0===ui||'0'===ui||-1===ui||'-1'===ui?bi.tabIndex=ui:(!1===ri&&(bi.tabIndex='-1'),'a'===e||'button'===e||'input'===e||'select'===e||'textarea'===e?!1!==ri&&!0!==Z||(bi.tabIndex='-1'):'button'===yi||'checkbox'===yi||'link'===yi||'radio'===yi||'textbox'===yi||'switch'===yi?!1!==ri&&(bi.tabIndex='0'):!0===ri&&(bi.tabIndex='0')),null!=ni&&(0,c.warnOnce)('pointerEvents',"props.pointerEvents is deprecated. Use style.pointerEvents");var ne=(0,n.default)([ci,ni&&f[ni]],(0,l.default)({writingDirection:'ltr'},v)),ce=ne[0],ue=ne[1];ce&&(bi.className=ce),ue&&(bi.style=ue);var oe=null!=ti?ti:si;return null!=oe&&(bi.id=oe),null!=oi&&(bi['data-testid']=oi),null==bi.type&&'button'===e&&(bi.type='button'),bi}},20,[21,14,16,26,74]); 47__d(function(g,_r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var e,t=_r(d[0]),r=(e=t)&&e.__esModule?e:{default:e};function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach(function(t){(0,r.default)(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}},21,[22]); 48__d(function(g,_r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});
48var e,t=_r(d[0]),r=(e=t)&&e.__esModule?e:{default:e};function u(e,t,u){return(t=(0,r.default)(t))in e?Object.defineProperty(e,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):e[t]=u,e}},22,[23]); 49__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var t=e(r(d[0])),u=e(r(d[1]));function n(e){var n=(0,u.default)(e,"string");return"symbol"==(0,t.default)(n)?n:n+""}},23,[24,25]); 50__d(function(g,r,i,a,m,e,d){"use strict";function t(o){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(o)}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}})},24,[]); 51__d(function(g,_r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return i}});var e,t=_r(d[0]),r=(e=t)&&e.__esModule?e:{default:e};function i(e,t){if("object"!=(0,r.default)(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var u=i.call(e,t||"default");if("object"!=(0,r.default)(u))return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}},25,[24]); 52__d(function(g,r,_i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return S}});var e=t(r(d[0])),n=t(r(d[1])),i=r(d[2]),o=r(d[3]),l=r(d[4]),u=r(d[5]),c=r(d[6]);r(d[7]);var f=t(r(d[8])),s=["writingDirection"],_=new WeakMap,v=(0,o.createSheet)(),O={shadow:!0,textShadow:!0};function w(t,i){void 0===i&&(i={});var o=i,f=o.writingDirection,v=(0,n.default)(o,s),w='rtl'===f;return c.styleq.factory({transform(t){var n=_.get(t);return null!=n?(0,l.localizeStyle)(n,w):(0,u.preprocess)(t,(0,e.default)((0,e.default)({},O),v))}})(t)}function h(t){t.forEach(t=>{var e=t[0],n=t[1];null!=v&&e.forEach(t=>{v.insert(t,n)})})}function p(t,e){var n=(0,i.classic)(t,e),o=n[0];return h(n[1]),o}var b={position:'absolute',left:0,right:0,top:0,bottom:0},y=A({x:(0,e.default)({},b)}).x;function A(t){return Object.keys(t).forEach(e=>{var n,o,l,c,f=t[e];null!=f&&!0!==f.$$css&&(e.indexOf('$raw')>-1?n=p(f,e.split('$raw')[0]):(o=f,l=(0,i.atomic)((0,u.preprocess)(o,O)),c=l[0],h(l[1]),n=c),_.set(f,n))}),t}function E(t,e){void 0===e&&(e={});var n='rtl'===e.writingDirection,o=w(t,e);return Array.isArray(o)&&null!=o[1]&&(o[1]=(0,i.inline)(o[1],n)),o}E.absoluteFill=y,E.absoluteFillObject=b,E.create=A,E.compose=function(t,e){return[t,e]},E.flatten=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var i=e.flat(1/0),o={},l=0;l<i.length;l++){var u=i[l];null!=u&&'object'==typeof u&&Object.assign(o,u)}return o},E.getSheet=function(){return{id:v.id,textContent:v.getTextContent()}},E.hairlineWidth=1,f.default&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle=E.flatten);var S=E},26,[21,14,27,68,71,73,75,76,35]); 53__d(function(g,r,_i,a,m,_e,d){"use strict";function n(n){return n&&n.__esModule?n:{default:n}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.atomic=function(n){var e={$$css:!0},t=[];function i(n,e,i){var o,l=J(i,e),s=e+l,u=p.get(s);if(null!=u)o=u[0],t.push(u[1]);else{o=T('r',n,n!==e?s:l);var f=v[n]||h,c=[K(o,e,i),f];t.push(c),p.set(s,[o,c])}return o}return Object.keys(n).sort().forEach(t=>{var o=n[t];if(null!=o){var l;if(P.indexOf(t)>-1){var s=i(t,t,'left'),u=i(t,t,'right');'start'===o?l=[s,u]:'end'===o&&(l=[u,s])}var f=N[t];if(null!=f){var p=i(t,f,o),c=i(t,_[f],o);l=[p,c]}if('transitionProperty'===t){for(var b=Array.isArray(o)?o:[o],h=[],v=0;v<b.length;v++){var y=b[v];'string'==typeof y&&null!=N[y]&&h.push(v)}if(h.length>0){var S=[...b],E=[...b];h.forEach(n=>{var e=S[n];if('string'==typeof e){var o=N[e],s=_[o];S[n]=o,E[n]=s;var u=i(t,t,S),f=i(t,t,E);l=[u,f]}})}}null==l?l=i(t,t,o):e.$$css$localize=!0,e[t]=l}}),[e,t]},_e.classic=function(n,i){var o,l={$$css:!0},s=[],u=n.animationKeyframes,p=(0,t.default)(n,f),c=T('css',i,JSON.stringify(n)),h="."+c;
53if(null!=u){var v=V(u),y=v[0],S=v[1];o=y.join(','),s.push(...S)}var E=M((0,e.default)((0,e.default)({},p),{},{animationName:o}));return s.push(""+h+E),l[c]=c,[l,[[s,b]]]},_e.inline=function(n,e){var t=n||c,o={},l={},s=function(){var n=t[u],i=u,s=n;if(!Object.prototype.hasOwnProperty.call(t,u)||null==n)return"continue";P.indexOf(u)>-1&&('start'===n?s=e?'right':'left':'end'===n&&(s=e?'left':'right'));var f=N[u];if(null!=f&&(i=e?_[f]:f),'transitionProperty'===u){var p=Array.isArray(n)?n:[n];p.forEach((n,t)=>{if('string'==typeof n){var i=N[n];null!=i&&(p[t]=e?_[i]:i,s=p.join(' '))}})}o[i]||(l[i]=s),i===u&&(o[i]=!0)};for(var u in t)s();return(0,i.default)(l,!0)},_e.stringifyValueWithProperty=J;var e=n(r(d[0])),t=n(r(d[1])),i=n(r(d[2])),o=n(r(d[3])),l=n(r(d[4])),s=n(r(d[5])),u=n(r(d[6])),f=["animationKeyframes"],p=new Map,c={},b=1,h=3,v={borderColor:2,borderRadius:2,borderStyle:2,borderWidth:2,display:2,flex:2,inset:2,margin:2,overflow:2,overscrollBehavior:2,padding:2,insetBlock:2.1,insetInline:2.1,marginInline:2.1,marginBlock:2.1,paddingInline:2.1,paddingBlock:2.1,borderBlockStartColor:2.2,borderBlockStartStyle:2.2,borderBlockStartWidth:2.2,borderBlockEndColor:2.2,borderBlockEndStyle:2.2,borderBlockEndWidth:2.2,borderInlineStartColor:2.2,borderInlineStartStyle:2.2,borderInlineStartWidth:2.2,borderInlineEndColor:2.2,borderInlineEndStyle:2.2,borderInlineEndWidth:2.2,borderEndStartRadius:2.2,borderEndEndRadius:2.2,borderStartStartRadius:2.2,borderStartEndRadius:2.2,insetBlockEnd:2.2,insetBlockStart:2.2,insetInlineEnd:2.2,insetInlineStart:2.2,marginBlockStart:2.2,marginBlockEnd:2.2,marginInlineStart:2.2,marginInlineEnd:2.2,paddingBlockStart:2.2,paddingBlockEnd:2.2,paddingInlineStart:2.2,paddingInlineEnd:2.2},y='borderTopLeftRadius',S='borderTopRightRadius',E='borderBottomLeftRadius',I='borderBottomRightRadius',k='borderLeftColor',R='borderLeftStyle',B='borderLeftWidth',W='borderRightColor',j='borderRightStyle',C='borderRightWidth',O='right',w='marginLeft',A='marginRight',x='paddingLeft',L='paddingRight',$='left',_={[y]:S,[S]:y,[E]:I,[I]:E,[k]:W,[R]:j,[B]:C,[W]:k,[j]:R,[C]:B,[$]:O,[w]:A,[A]:w,[x]:L,[L]:x,[O]:$},N={borderStartStartRadius:y,borderStartEndRadius:S,borderEndStartRadius:E,borderEndEndRadius:I,borderInlineStartColor:k,borderInlineStartStyle:R,borderInlineStartWidth:B,borderInlineEndColor:W,borderInlineEndStyle:j,borderInlineEndWidth:C,insetInlineEnd:O,insetInlineStart:$,marginInlineStart:w,marginInlineEnd:A,paddingInlineStart:x,paddingInlineEnd:L},P=['clear','float','textAlign'];function J(n,e){var t=(0,s.default)(n,e);return'string'!=typeof t?JSON.stringify(t||''):t}function K(n,e,t){var i=[],o="."+n;switch(e){case'animationKeyframes':var l=V(t),s=l[0],u=l[1],f=M({animationName:s.join(',')});i.push(""+o+f,...u);break;
53case'placeholderTextColor':var p=M({color:t,opacity:1});i.push(o+"::-webkit-input-placeholder"+p,o+"::-moz-placeholder"+p,o+":-ms-input-placeholder"+p,o+"::placeholder"+p);break;case'pointerEvents':var c=t;if('auto'===t)c='auto!important';else if('none'===t){c='none!important';var b=M({pointerEvents:'none'});i.push(o+">* "+b)}else if('box-none'===t){c='none!important';var h=M({pointerEvents:'auto'});i.push(o+">* "+h)}else if('box-only'===t){c='auto!important';var v=M({pointerEvents:'none'});i.push(o+">* "+v)}var y=M({pointerEvents:c});i.push(""+o+y);break;case'scrollbarWidth':'none'===t&&i.push(o+"::-webkit-scrollbar{display:none}");var S=M({scrollbarWidth:t});i.push(""+o+S);break;default:var E=M({[e]:t});i.push(""+o+E)}return i}function M(n){var e=(0,u.default)((0,i.default)(n));return"{"+Object.keys(e).map(n=>{var t=e[n],i=(0,l.default)(n);return Array.isArray(t)?t.map(n=>i+":"+n).join(';'):i+":"+t}).sort().join(';')+";}"}function T(n,e,t){return n+"-"+(0,o.default)(e+t)}function z(n){var e=T('r','animation',JSON.stringify(n)),t='{'+Object.keys(n).map(e=>""+e+M(n[e])).join('')+'}',i=['-webkit-',''].map(n=>"@"+n+"keyframes "+e+t);return[e,i]}function V(n){if('number'==typeof n)throw new Error("Invalid CSS keyframes type: "+typeof n);var e=[],t=[];return(Array.isArray(n)?n:[n]).forEach(n=>{if('string'==typeof n)e.push(n);else{var i=z(n),o=i[0],l=i[1];e.push(o),t.push(...l)}}),[e,t]}},27,[21,14,28,36,37,29,38]); 54__d(function(g,r,_i,a,m,_e,d){"use strict";function o(o){return o&&o.__esModule?o:{default:o}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}});var e=o(r(d[0])),t=o(r(d[1])),i={},n=!t.default||null!=window.CSS&&null!=window.CSS.supports&&(window.CSS.supports('text-decoration-line','none')||window.CSS.supports('-webkit-text-decoration-line','none')),l='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',b={borderColor:['borderTopColor','borderRightColor','borderBottomColor','borderLeftColor'],borderBlockColor:['borderTopColor','borderBottomColor'],borderInlineColor:['borderRightColor','borderLeftColor'],borderRadius:['borderTopLeftRadius','borderTopRightRadius','borderBottomRightRadius','borderBottomLeftRadius'],borderStyle:['borderTopStyle','borderRightStyle','borderBottomStyle','borderLeftStyle'],borderBlockStyle:['borderTopStyle','borderBottomStyle'],borderInlineStyle:['borderRightStyle','borderLeftStyle'],borderWidth:['borderTopWidth','borderRightWidth','borderBottomWidth','borderLeftWidth'],borderBlockWidth:['borderTopWidth','borderBottomWidth'],borderInlineWidth:['borderRightWidth','borderLeftWidth'],insetBlock:['top','bottom'],insetInline:['left','right'],marginBlock:['marginTop','marginBottom'],marginInline:['marginRight','marginLeft'],paddingBlock:['paddingTop','paddingBottom'],paddingInline:['paddingRight','paddingLeft'],overflow:['overflowX','overflowY'],overscrollBehavior:['overscrollBehaviorX','overscrollBehaviorY'],borderBlockStartColor:['borderTopColor'],borderBlockStartStyle:['borderTopStyle'],borderBlockStartWidth:['borderTopWidth'],borderBlockEndColor:['borderBottomColor'],borderBlockEndStyle:['borderBottomStyle'],borderBlockEndWidth:['borderBottomWidth'],borderEndStartRadius:['borderBottomLeftRadius'],borderEndEndRadius:['borderBottomRightRadius'],borderStartStartRadius:['borderTopLeftRadius'],borderStartEndRadius:['borderTopRightRadius'],insetBlockEnd:['bottom'],insetBlockStart:['top'],marginBlockStart:['marginTop'],marginBlockEnd:['marginBottom'],paddingBlockStart:['paddingTop'],paddingBlockEnd:['paddingBottom']},p=(o,t)=>{if(!o)return i;var p={},s=function(){var i=o[f];if(null==i)return"continue";if('backgroundClip'===f)'text'===i&&(p.backgroundClip=i,p.WebkitBackgroundClip=i);else if('flex'===f)-1===i?(p.flexGrow=0,p.flexShrink=1,p.flexBasis='auto'):p.flex=i;else if('font'===f)p[f]=i.replace('System',l);else if('fontFamily'===f)if(i.indexOf('System')>-1){var s=i.split(/,\s*/);s[s.indexOf('System')]=l,p[f]=s.join(',')}else p[f]='monospace'===i?"monospace,monospace":i;else if('textDecorationLine'===f)n?p.textDecorationLine=i:p.textDecoration=i;else if('writingDirection'===f)p.direction=i;else{var c=(0,e.default)(o[f],f),u=b[f];t&&'inset'===f?(null==o.insetInline&&(p.left=c,p.right=c),null==o.insetBlock&&(p.top=c,p.bottom=c)):t&&'margin'===f?(null==o.marginInline&&(p.marginLeft=c,p.marginRight=c),null==o.marginBlock&&(p.marginTop=c,p.marginBottom=c)):t&&'padding'===f?(null==o.paddingInline&&(p.paddingLeft=c,p.paddingRight=c),null==o.paddingBlock&&(p.paddingTop=c,p.paddingBottom=c)):u?u.forEach((e,t)=>{null==o[e]&&(p[e]=c)}):p[f]=c}};for(var f in o)s();return p}},28,[29,35]); 55__d(function(g,r,i,a,m,_e,d){"use strict";function o(o){return o&&o.__esModule?o:{default:o}}
55Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e=o(r(d[0])),t=o(r(d[1])),l={backgroundColor:!0,borderColor:!0,borderTopColor:!0,borderRightColor:!0,borderBottomColor:!0,borderLeftColor:!0,color:!0,shadowColor:!0,textDecorationColor:!0,textShadowColor:!0};function u(o,u){var n=o;return null!=u&&e.default[u]||'number'!=typeof o?null!=u&&l[u]&&(n=(0,t.default)(o)):n=o+"px",n}},29,[30,31]); 56__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var t={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},o=['ms','Moz','O','Webkit'],l=(t,o)=>t+o.charAt(0).toUpperCase()+o.substring(1);Object.keys(t).forEach(n=>{o.forEach(o=>{t[l(o,n)]=t[n]})});var n=t},30,[]); 57__d(function(_g,_r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var t=e(_r(d[0])),u=e(_r(d[1])),n=function(e,n){if(void 0===n&&(n=1),null!=e){if('string'==typeof e&&(0,t.default)(e))return e;var r=(0,u.default)(e);if(null!=r)return"rgba("+(r>>16&255)+","+(r>>8&255)+","+(255&r)+","+((r>>24&255)/255*n).toFixed(2)+")"}}},31,[32,33]); 58__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=t=>'currentcolor'===t||'currentColor'===t||'inherit'===t||0===t.indexOf('var(')},32,[]); 59__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e},n=e=>{if(null==e)return e;var t=(0,u.default)(e);return null!=t?t=(t<<24|t>>>8)>>>0:void 0}},33,[34]); 60__d(function(_g,_r,i,a,m,e,d){'use strict';function r(r,n,t){return t<0&&(t+=1),t>1&&(t-=1),t<.16666666666666666?r+6*(n-r)*t:t<.5?n:t<.6666666666666666?r+(n-r)*(.6666666666666666-t)*6:r}function n(n,t,s){const u=s<.5?s*(1+t):s+t-s*t,c=2*s-u,l=r(c,u,n+.3333333333333333),o=r(c,u,n),g=r(c,u,n-.3333333333333333);return Math.round(255*l)<<24|Math.round(255*o)<<16|Math.round(255*g)<<8}function t(n,t,s){if(t+s>=1){const r=Math.round(255*t/(t+s));return r<<24|r<<16|r<<8}const u=r(0,1,n+.3333333333333333)*(1-t-s)+t,c=r(0,1,n)*(1-t-s)+t,l=r(0,1,n-.3333333333333333)*(1-t-s)+t;return Math.round(255*u)<<24|Math.round(255*c)<<16|Math.round(255*l)<<8}const s='[-+]?\\d*\\.?\\d+',u="[-+]?\\d*\\.?\\d+%";function c(...r){return'\\(\\s*('+r.join(')\\s*,?\\s*(')+')\\s*\\)'}function l(...r){return'\\(\\s*('+r.slice(0,r.length-1).join(')\\s*,?\\s*(')+')\\s*/\\s*('+r[r.length-1]+')\\s*\\)'}function o(...r){return'\\(\\s*('+r.join(')\\s*,\\s*(')+')\\s*\\)'}let g;function h(){return void 0===g&&(g={rgb:new RegExp('rgb'+c(s,s,s)),rgba:new RegExp('rgba('+o(s,s,s,s)+'|'+l(s,s,s,s)+')'),hsl:new RegExp('hsl'+c(s,u,u)),hsla:new RegExp('hsla('+o(s,u,u,s)+'|'+l(s,u,u,s)+')'),hwb:new RegExp('hwb'+c(s,u,u)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/}),g}function b(r){const n=parseInt(r,10);return n<0?0:n>255?255:n}function p(r){return(parseFloat(r)%360+360)%360/360}function f(r){const n=parseFloat(r);return n<0?0:n>1?255:Math.round(255*n)}function y(r){const n=parseFloat(r);return n<0?0:n>100?1:n/100}function k(r){switch(r){case'transparent':return 0;case'aliceblue':return 4042850303;case'antiquewhite':return 4209760255;case'aqua':case'cyan':return 16777215;case'aquamarine':return 2147472639;case'azure':return 4043309055;case'beige':return 4126530815;case'bisque':return 4293182719;case'black':return 255;case'blanchedalmond':return 4293643775;case'blue':return 65535;case'blueviolet':return 2318131967;case'brown':return 2771004159;case'burlywood':return 3736635391;case'burntsienna':return 3934150143;case'cadetblue':return 1604231423;case'chartreuse':return 2147418367;case'chocolate':return 3530104575;case'coral':return 4286533887;case'cornflowerblue':return 1687547391;case'cornsilk':return 4294499583;case'crimson':return 3692313855;
60case'darkblue':return 35839;case'darkcyan':return 9145343;case'darkgoldenrod':return 3095792639;case'darkgray':case'darkgrey':return 2846468607;case'darkgreen':return 6553855;case'darkkhaki':return 3182914559;case'darkmagenta':return 2332068863;case'darkolivegreen':return 1433087999;case'darkorange':return 4287365375;case'darkorchid':return 2570243327;case'darkred':return 2332033279;case'darksalmon':return 3918953215;case'darkseagreen':return 2411499519;case'darkslateblue':return 1211993087;case'darkslategray':case'darkslategrey':return 793726975;case'darkturquoise':return 13554175;case'darkviolet':return 2483082239;case'deeppink':return 4279538687;case'deepskyblue':return 12582911;case'dimgray':case'dimgrey':return 1768516095;case'dodgerblue':return 512819199;case'firebrick':return 2988581631;case'floralwhite':return 4294635775;case'forestgreen':return 579543807;case'fuchsia':case'magenta':return 4278255615;case'gainsboro':return 3705462015;case'ghostwhite':return 4177068031;case'gold':return 4292280575;case'goldenrod':return 3668254975;case'gray':case'grey':return 2155905279;case'green':return 8388863;case'greenyellow':return 2919182335;case'honeydew':return 4043305215;case'hotpink':return 4285117695;case'indianred':return 3445382399;case'indigo':return 1258324735;case'ivory':return 4294963455;case'khaki':return 4041641215;case'lavender':return 3873897215;case'lavenderblush':return 4293981695;case'lawngreen':return 2096890111;case'lemonchiffon':return 4294626815;case'lightblue':return 2916673279;case'lightcoral':return 4034953471;case'lightcyan':return 3774873599;case'lightgoldenrodyellow':return 4210742015;case'lightgray':case'lightgrey':return 3553874943;case'lightgreen':return 2431553791;case'lightpink':return 4290167295;case'lightsalmon':return 4288707327;case'lightseagreen':return 548580095;case'lightskyblue':return 2278488831;case'lightslategray':case'lightslategrey':return 2005441023;case'lightsteelblue':return 2965692159;case'lightyellow':return 4294959359;case'lime':return 16711935;case'limegreen':return 852308735;case'linen':return 4210091775;case'maroon':return 2147483903;case'mediumaquamarine':return 1724754687;case'mediumblue':return 52735;case'mediumorchid':return 3126187007;case'mediumpurple':return 2473647103;case'mediumseagreen':return 1018393087;case'mediumslateblue':return 2070474495;case'mediumspringgreen':return 16423679;case'mediumturquoise':return 1221709055;case'mediumvioletred':return 3340076543;case'midnightblue':return 421097727;case'mintcream':return 4127193855;case'mistyrose':return 4293190143;case'moccasin':return 4293178879;case'navajowhite':return 4292783615;case'navy':return 33023;case'oldlace':return 4260751103;case'olive':return 2155872511;case'olivedrab':return 1804477439;case'orange':return 4289003775;case'orangered':return 4282712319;case'orchid':return 3664828159;case'palegoldenrod':return 4008225535;case'palegreen':return 2566625535;case'paleturquoise':return 2951671551;case'palevioletred':return 3681588223;case'papayawhip':return 4293907967;case'peachpuff':return 4292524543;case'peru':return 3448061951;case'pink':return 4290825215;case'plum':return 3718307327;case'powderblue':return 2967529215;case'purple':return 2147516671;case'rebeccapurple':return 1714657791;case'red':return 4278190335;case'rosybrown':return 3163525119;case'royalblue':return 1097458175;case'saddlebrown':return 2336560127;case'salmon':return 4202722047;case'sandybrown':return 4104413439;case'seagreen':return 780883967;case'seashell':return 4294307583;case'sienna':return 2689740287;case'silver':return 3233857791;case'skyblue':return 2278484991;case'slateblue':return 1784335871;case'slategray':case'slategrey':return 1887473919;case'snow':return 4294638335;case'springgreen':return 16744447;case'steelblue':return 1182971135;case'tan':return 3535047935;case'teal':return 8421631;case'thistle':return 3636451583;case'tomato':return 4284696575;case'turquoise':return 1088475391;case'violet':return 4001558271;case'wheat':return 4125012991;case'white':return 4294967295;case'whitesmoke':return 4126537215;case'yellow':return 4294902015;case'yellowgreen':return 2597139199}return null}m.exports=function(r){if('number'==typeof r)return r>>>0===r&&r>=0&&r<=4294967295?r:null;if('string'!=typeof r)return null;const s=h();let u;if(u=s.hex6.exec(r))return parseInt(u[1]+'ff',16)>>>0;const c=k(r);return null!=c?c:(u=s.rgb.exec(r))?(b(u[1])<<24|b(u[2])<<16|b(u[3])<<8|255)>>>0:(u=s.rgba.exec(r))?void 0!==u[6]?(b(u[6])<<24|b(u[7])<<16|b(u[8])<<8|f(u[9]))>>>0:(b(u[2])<<24|b(u[3])<<16|b(u[4])<<8|f(u[5]))>>>0:(u=s.hex3.exec(r))?parseInt(u[1]+u[1]+u[2]+u[2]+u[3]+u[3]+'ff',16)>>>0:(u=s.hex8.exec(r))?parseInt(u[1],16)>>>0:(u=s.hex4.exec(r))?parseInt(u[1]+u[1]+u[2]+u[2]+u[3]+u[3]+u[4]+u[4],16)>>>0:(u=s.hsl.exec(r))?(255|n(p(u[1]),y(u[2]),y(u[3])))>>>0:(u=s.hsla.exec(r))?void 0!==u[6]?(n(p(u[6]),y(u[7]),y(u[8]))|f(u[9]))>>>0:(n(p(u[2]),y(u[3]),y(u[4]))|f(u[5]))>>>0:(u=s.hwb.exec(r))?(255|t(p(u[1]),y(u[2]),y(u[3])))>>>0:null}},34,[]); 61__d(function(g,r,i,a,m,e,d){"use strict";
61Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var n=!('undefined'==typeof window||!window.document||!window.document.createElement)},35,[]); 62__d(function(g,r,_i,a,m,e,d){"use strict";function t(t,c){for(var o,n=t.length,u=c^n,h=0;n>=4;)o=1540483477*(65535&(o=255&t.charCodeAt(h)|(255&t.charCodeAt(++h))<<8|(255&t.charCodeAt(++h))<<16|(255&t.charCodeAt(++h))<<24))+((1540483477*(o>>>16)&65535)<<16),u=1540483477*(65535&u)+((1540483477*(u>>>16)&65535)<<16)^(o=1540483477*(65535&(o^=o>>>24))+((1540483477*(o>>>16)&65535)<<16)),n-=4,++h;switch(n){case 3:u^=(255&t.charCodeAt(h+2))<<16;case 2:u^=(255&t.charCodeAt(h+1))<<8;case 1:u=1540483477*(65535&(u^=255&t.charCodeAt(h)))+((1540483477*(u>>>16)&65535)<<16)}return u=1540483477*(65535&(u^=u>>>13))+((1540483477*(u>>>16)&65535)<<16),(u^=u>>>15)>>>0}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var c=c=>t(c,1).toString(36)},36,[]); 63__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=/[A-Z]/g,n=/^ms-/,u={};function o(t){return'-'+t.toLowerCase()}var c=function(c){if(c in u)return u[c];var f=c.replace(t,o);return u[c]=n.test(f)?'-'+f:f}},37,[]); 64__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var t=e(r(d[0])),u=e(r(d[1])),n=(0,t.default)(u.default)},38,[39,45]); 65__d(function(g,r,_i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(l){var i=l.prefixMap,o=l.plugins;return function l(s){for(var v in s){var c=s[v];if((0,n.default)(c))s[v]=l(c);else if(Array.isArray(c)){for(var _=[],p=0,y=c.length;p<y;++p){var M=(0,u.default)(o,v,c[p],s,i);(0,f.default)(_,M||c[p])}_.length>0&&(s[v]=_)}else{var h=(0,u.default)(o,v,c,s,i);h&&(s[v]=h),s=(0,t.default)(i,v,s)}}return s}};var t=l(r(d[0])),u=l(r(d[1])),f=l(r(d[2])),n=l(r(d[3]));function l(t){return t&&t.__esModule?t:{default:t}}},39,[40,42,43,44]); 66__d(function(g,r,_i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,u,n){var l=t[u];if(l&&n.hasOwnProperty(u))for(var o=(0,f.default)(u),_=0;_<l.length;++_){var i=l[_]+o;n[i]||(n[i]=n[u])}return n};var t,u=r(d[0]),f=(t=u)&&t.__esModule?t:{default:t}},40,[41]); 67__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}},41,[]); 68__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,n,u,f,i){for(var o=0,c=t.length;o<c;++o){var l=t[o](n,u,f,i);if(l)return l}}},42,[]); 69__d(function(g,r,_i,a,m,e,d){"use strict";function n(n,t){-1===n.indexOf(t)&&n.push(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,f){if(Array.isArray(f))for(var i=0,u=f.length;i<u;++i)n(t,f[i]);else n(t,f)}},43,[]); 70__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t instanceof Object&&!Array.isArray(t)}},44,[]); 71__d(function(g,r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return k}});var t=e(r(d[0])),o=e(r(d[1])),n=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),m=e(r(d[5])),u=['Webkit'],c=['Webkit','ms'],k={plugins:[t.default,o.default,n.default,l.default,s.default,m.default],prefixMap:{appearance:['Webkit','Moz','ms'],userSelect:['Webkit','Moz'],textEmphasisPosition:c,textEmphasis:c,textEmphasisStyle:c,textEmphasisColor:c,boxDecorationBreak:c,clipPath:u,maskImage:c,maskMode:c,maskRepeat:c,maskPosition:c,maskClip:c,maskOrigin:c,maskSize:c,maskComposite:c,mask:c,maskBorderSource:c,maskBorderMode:c,maskBorderSlice:c,maskBorderWidth:c,maskBorderOutset:c,maskBorderRepeat:c,maskBorder:c,maskType:c,textDecorationStyle:u,textDecorationSkip:u,textDecorationLine:u,textDecorationColor:u,filter:u,breakAfter:u,breakBefore:u,breakInside:u,columnCount:u,columnFill:u,columnGap:u,columnRule:u,columnRuleColor:u,columnRuleStyle:u,columnRuleWidth:u,columns:u,columnSpan:u,columnWidth:u,backdropFilter:u,hyphens:u,flowInto:u,flowFrom:u,regionFragment:u,textOrientation:u,tabSize:['Moz'],fontKerning:u,textSizeAdjust:u}}},45,[46,61,63,64,65,66]); 72__d(function(g,r,i,a,m,e,d){'use strict';
72Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(s,u){if('string'==typeof u&&!(0,t.isPrefixedValue)(u)&&-1!==u.indexOf('cross-fade('))return n.map(function(t){return u.replace(f,t+'cross-fade(')})};var t=r(d[0]),f=/cross-fade\(/g,n=['-webkit-','']},46,[47]); 73__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"assignStyle",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(_e,"camelCaseProperty",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(_e,"cssifyDeclaration",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(_e,"cssifyObject",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(_e,"hyphenateProperty",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(_e,"isPrefixedProperty",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(_e,"isPrefixedValue",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(_e,"isUnitlessProperty",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(_e,"normalizeProperty",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(_e,"resolveArrayValue",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(_e,"unprefixProperty",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(_e,"unprefixValue",{enumerable:!0,get:function(){return s.default}});var t=e(r(d[0])),n=e(r(d[1])),u=e(r(d[2])),f=e(r(d[3])),o=e(r(d[4])),l=e(r(d[5])),c=e(r(d[6])),b=e(r(d[7])),y=e(r(d[8])),p=e(r(d[9])),P=e(r(d[10])),s=e(r(d[11]))},47,[48,49,50,53,51,54,55,56,57,59,58,60]); 74__d(function(g,r,_i,a,m,e,d){"use strict";function t(n){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(n)}function n(t){return f(t)||u(t)||i(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,n){if(t){if("string"==typeof t)return c(t,n);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(o):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?c(t,n):void 0}}function u(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function f(t){if(Array.isArray(t))return c(t)}function c(t,n){(null==n||n>t.length)&&(n=t.length);for(var o=0,i=new Array(n);o<n;o++)i[o]=t[o];return i}function y(t){return t.filter(function(n,o){return t.lastIndexOf(n)===o})}function l(o){for(var i=0,u=arguments.length<=1?0:arguments.length-1;i<u;++i){var f=i+1<1||arguments.length<=i+1?void 0:arguments[i+1];for(var c in f){var b=f[c],s=o[c];if(s&&b){if(Array.isArray(s)){o[c]=y(s.concat(b));continue}if(Array.isArray(b)){o[c]=y([s].concat(n(b)));continue}if('object'===t(b)){o[c]=l({},s,b);continue}}o[c]=b}}return o}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return l}})},48,[]); 75__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});var t=/-([a-z])/g,n=/^Ms/g,u={};function c(t){return t[1].toUpperCase()}function o(o){if(u.hasOwnProperty(o))return u[o];var f=o.replace(t,c).replace(n,'ms');return u[o]=f,f}},49,[]); 76__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e};function n(e,t){return(0,u.default)(e)+':'+t}},50,[51]); 77__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});
77var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e};function n(e){return(0,u.default)(e)}},51,[52]); 78__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=/[A-Z]/g,n=/^ms-/,u={};function o(t){return'-'+t.toLowerCase()}var c=function(c){if(u.hasOwnProperty(c))return u[c];var f=c.replace(t,o);return u[c]=n.test(f)?'-'+f:f}},52,[]); 79__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};function u(e){var t='';for(var u in e){var f=e[u];'string'!=typeof f&&'number'!=typeof f||(t&&(t+=';'),t+=(0,n.default)(u,f))}return t}},53,[50]); 80__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var t=/^(Webkit|Moz|O|ms)/;function n(n){return t.test(n)}},54,[]); 81__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var t=/-webkit-|-moz-|-ms-/;function n(n){return'string'==typeof n&&t.test(n)}},55,[]); 82__d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var e,t=r(d[0]),o=(e=t)&&e.__esModule?e:{default:e},i={borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},n=['animationIterationCount','boxFlex','boxFlexGroup','boxOrdinalGroup','columnCount','flex','flexGrow','flexPositive','flexShrink','flexNegative','flexOrder','gridColumn','gridColumnEnd','gridColumnStart','gridRow','gridRowEnd','gridRowStart','lineClamp','order'],l=['Webkit','ms','Moz','O'];function u(e,t){return e+t.charAt(0).toUpperCase()+t.slice(1)}for(var f=0,s=n.length;f<s;++f){var c=n[f];i[c]=!0;for(var p=0,h=l.length;p<h;++p)i[u(l[p],c)]=!0}for(var x in i)i[(0,o.default)(x)]=!0;function b(e){return i.hasOwnProperty(e)}},56,[51]); 83__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var t=e(r(d[0])),u=e(r(d[1]));function n(e){return(0,u.default)((0,t.default)(e))}},57,[49,58]); 84__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var t=/^(ms|Webkit|Moz|O)/;function n(n){var u=n.replace(t,'');return u.charAt(0).toLowerCase()+u.slice(1)}},58,[]); 85__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e};function n(e,t){return t.join(';'+(0,u.default)(e)+':')}},59,[51]); 86__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var t=/(-ms-|-webkit-|-moz-|-o-)/g;function n(n){return'string'==typeof n?n.replace(t,''):n}},60,[]); 87__d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,u){if('string'==typeof u&&!(0,n.default)(u)&&u.indexOf('image-set(')>-1)return f.map(function(t){return u.replace(/image-set\(/g,t+'image-set(')})};var t,u=r(d[0]),n=(t=u)&&t.__esModule?t:{default:t};var f=['-webkit-','']},61,[62]); 88__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n){return'string'==typeof n&&t.test(n)};var t=/-webkit-|-moz-|-ms-/},62,[]); 89__d(function(g,r,_i,a,m,e,d){'use strict';
89Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(o,n,i){if(Object.prototype.hasOwnProperty.call(t,o))for(var l=t[o],b=0,B=l.length;b<B;++b)i[l[b]]=n};var t={marginBlockStart:['WebkitMarginBefore'],marginBlockEnd:['WebkitMarginAfter'],marginInlineStart:['WebkitMarginStart','MozMarginStart'],marginInlineEnd:['WebkitMarginEnd','MozMarginEnd'],paddingBlockStart:['WebkitPaddingBefore'],paddingBlockEnd:['WebkitPaddingAfter'],paddingInlineStart:['WebkitPaddingStart','MozPaddingStart'],paddingInlineEnd:['WebkitPaddingEnd','MozPaddingEnd'],borderBlockStart:['WebkitBorderBefore'],borderBlockStartColor:['WebkitBorderBeforeColor'],borderBlockStartStyle:['WebkitBorderBeforeStyle'],borderBlockStartWidth:['WebkitBorderBeforeWidth'],borderBlockEnd:['WebkitBorderAfter'],borderBlockEndColor:['WebkitBorderAfterColor'],borderBlockEndStyle:['WebkitBorderAfterStyle'],borderBlockEndWidth:['WebkitBorderAfterWidth'],borderInlineStart:['WebkitBorderStart','MozBorderStart'],borderInlineStartColor:['WebkitBorderStartColor','MozBorderStartColor'],borderInlineStartStyle:['WebkitBorderStartStyle','MozBorderStartStyle'],borderInlineStartWidth:['WebkitBorderStartWidth','MozBorderStartWidth'],borderInlineEnd:['WebkitBorderEnd','MozBorderEnd'],borderInlineEndColor:['WebkitBorderEndColor','MozBorderEndColor'],borderInlineEndStyle:['WebkitBorderEndStyle','MozBorderEndStyle'],borderInlineEndWidth:['WebkitBorderEndWidth','MozBorderEndWidth']}},63,[]); 90__d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,c){if('position'===t&&'sticky'===c)return['-webkit-sticky','sticky']}},64,[]); 91__d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(c,h){if(n.hasOwnProperty(c)&&o.hasOwnProperty(h))return t.map(function(t){return t+h})};var t=['-webkit-','-moz-',''],n={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},o={'min-content':!0,'max-content':!0,'fill-available':!0,'fit-content':!0,'contain-floats':!0}},65,[]); 92__d(function(g,r,_i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,i,o,u){if('string'==typeof i&&f.hasOwnProperty(t)){var l=s(i,u),p=l.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(t){return!/-moz-|-ms-/.test(t)}).join(',');if(t.indexOf('Webkit')>-1)return p;var v=l.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(t){return!/-webkit-|-ms-/.test(t)}).join(',');return t.indexOf('Moz')>-1?v:(o['Webkit'+(0,n.default)(t)]=p,o['Moz'+(0,n.default)(t)]=v,l)}};var t=o(r(d[0])),i=o(r(d[1])),n=o(r(d[2]));function o(t){return t&&t.__esModule?t:{default:t}}var f={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},u={Webkit:'-webkit-',Moz:'-moz-',ms:'-ms-'};function s(n,o){if((0,i.default)(n))return n;for(var f=n.split(/,(?![^()]*(?:\([^()]*\))?\))/g),s=0,l=f.length;s<l;++s){var p=f[s],v=[p];for(var c in o){var b=(0,t.default)(c);if(p.indexOf(b)>-1&&'order'!==b)for(var k=o[c],z=0,M=k.length;z<M;++z)v.unshift(p.replace(b,u[k[z]]+b))}f[s]=v.join(',')}return f.join(',')}},66,[67,62,41]); 93__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,f.default)(t)};var t,u=r(d[0]),f=(t=u)&&t.__esModule?t:{default:t}},67,[52]); 94__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.createSheet=function(e,f){void 0===f&&(f=s);var h;if(t.default){var b=null!=e?e.getRootNode():document;if(0===l.length)h=(0,u.default)((0,n.default)(f)),c.forEach(e=>{h.insert(e,0)}),o.set(b,l.length),l.push(h);else{var p=o.get(b);if(null==p){var v=l[0],k=null!=v?v.getTextContent():'';h=(0,u.default)((0,n.default)(f,b,k)),o.set(b,l.length),l.push(h)}else h=l[p]}}else 0===l.length?(h=(0,u.default)((0,n.default)(f)),c.forEach(e=>{h.insert(e,0)}),l.push(h)):h=l[0];return{getTextContent:()=>h.getTextContent(),id:f,insert(e,t){l.forEach(n=>{n.insert(e,t)})}}};var t=e(r(d[0])),n=e(r(d[1])),u=e(r(d[2])),s='react-native-stylesheet',o=new WeakMap,l=[],c=['html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}','body{margin:0;}','button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}','input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{dis
94play:none;}']},68,[35,69,70]); 95__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};function u(e,t,u){if(n.default){var l=null!=t?t:document,o=l.getElementById(e);if(null==o)if((o=document.createElement('style')).setAttribute('id',e),'string'==typeof u&&o.appendChild(document.createTextNode(u)),l instanceof ShadowRoot)l.insertBefore(o,l.firstChild);else{var f=l.head;f&&f.insertBefore(o,f.firstChild)}return o.sheet}return null}},69,[35]); 96__d(function(g,r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return e}});var t=Array.prototype.slice;function e(e){var u,a={},c={};null!=e&&t.call(e.cssRules).forEach((t,e)=>{var n=t.cssText;if(n.indexOf('stylesheet-group')>-1)u=l(t),a[u]={start:e,rules:[n]};else{var s=i(n);null!=s&&(c[s]=!0,a[u].rules.push(n))}});function f(t,e,n){var u=s(a),l=u.indexOf(e)+1,i=u[l],c=null!=i&&null!=a[i].start?a[i].start:t.cssRules.length,f=o(t,n,c);if(f){null==a[e].start&&(a[e].start=c);for(var v=l;v<u.length;v+=1){var p=u[v],h=a[p].start||0;a[p].start=h+1}}return f}var v={getTextContent:()=>s(a).map(t=>{var e=a[t].rules,n=e.shift();return e.sort(),e.unshift(n),e.join('\n')}).join('\n'),insert(t,u){var l=Number(u);if(null==a[l]){var s=n(l);a[l]={start:null,rules:[s]},null!=e&&f(e,l,s)}var o=i(t);null!=o&&null==c[o]&&(c[o]=!0,a[l].rules.push(t),null!=e&&(f(e,l,t)||a[l].rules.pop()))}};return v}function n(t){return"[stylesheet-group=\""+t+"\"]{}"}var u=/["']/g;function l(t){return Number(t.selectorText.split(u)[1])}function s(t){return Object.keys(t).map(Number).sort((t,e)=>t>e?1:-1)}var a=/\s*([,])\s*/g;function i(t){var e=t.split('{')[0].trim();return''!==e?e.replace(a,'$1'):null}function o(t,e,n){try{return t.insertRule(e,n),!0}catch(t){return!1}}},70,[]); 97__d(function(g,r,i,a,m,e,d){m.exports=r(d[0])},71,[72]); 98__d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.localizeStyle=function(l,s){if(null!=l[t]){var c=s?1:0;if(n.has(l)){var f=n.get(l),o=f[c];return null==o&&(o=u(l,s),f[c]=o,n.set(l,f)),o}var v=u(l,s),y=new Array(2);return y[c]=v,n.set(l,y),v}return l};var n=new WeakMap,t='$$css$localize';function u(n,u){var l={};for(var s in n)if(s!==t){var c=n[s];Array.isArray(c)?l[s]=u?c[1]:c[0]:l[s]=c}return l}},72,[]); 99__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"createBoxShadowValue",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"createTextShadowValue",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"createBoxShadowArrayValue",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"createTransformValue",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"createTransformOriginValue",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"preprocess",{enumerable:!0,get:function(){return x}});var t=e(r(d[0])),n=e(r(d[1])),o=r(d[2]),l={},u={height:0,width:0},s=e=>{var o=e.shadowColor,l=e.shadowOffset,s=e.shadowOpacity,f=e.shadowRadius,h=l||u,S=h.height,c=h.width,b=(0,n.default)(c),w=(0,n.default)(S),p=(0,n.default)(f||0),y=(0,t.default)(o||'black',s);if(null!=y&&null!=b&&null!=w&&null!=p)return b+" "+w+" "+p+" "+y},f=e=>{var t=e.textShadowColor,o=e.textShadowOffset,l=e.textShadowRadius,s=o||u,f=s.height,h=s.width,S=l||0,c=(0,n.default)(h),b=(0,n.default)(f),w=(0,n.default)(S),p=(0,n.default)(t,'textShadowColor');if(p&&(0!==f||0!==h||0!==S)&&null!=c&&null!=b&&null!=w)return c+" "+b+" "+w+" "+p},h=e=>{if('string'==typeof e)return e;var o=(0,n.default)(e.offsetX)||0,l=(0,n.default)(e.offsetY)||0,u=(0,n.default)(e.blurRadius)||0,s=(0,n.default)(e.spreadDistance)||0,f=(0,t.default)(e.color)||'black';return""+(e.inset?'inset ':'')+o+" "+l+" "+u+" "+s+" "+f},S=e=>e.map(h).join(', '),c=e=>{var t=Object.keys(e)[0],o=e[t];return'matrix'===t||'matrix3d'===t?t+"("+o.join(',')+")":t+"("+(0,n.default)(o,t)+")"},b=e=>e.map(c).join(' '),w=e=>e.map(e=>(0,n.default)(e)).join(' '),p={borderBottomEndRadius:'borderEndEndRadius',borderBottomStartRadius:'borderEndStartRadius',borderTopEndRadius:'borderStartEndRadius',borderTopStartRadius:'borderStartStartRadius',borderEndColor:'borderInlineEndColor',borderEndStyle:'borderInlineEndStyle',borderEndWidth:'borderInlineEndWidth',borderStartColor:'borderInlineStartColor',borderStartStyle:'borderInlineStartStyle',borderStartWidth:'borderInlineStartWidth',end:'insetInlineEnd',marginEnd:'marginInlineEnd',marginHorizontal:'marginInline',marginStart:'marginInlineStart',marginVertical:'marginBlock',paddingEnd:'paddingInlineEnd',paddingHorizontal:'paddingInline',paddingStart:'paddingInlineStart',paddingVertical:'paddingBlock',start:'insetInlineStart'},y={elevation:!0,overlayColor:!0,resizeMode:!0,tintColor:!0},x=function(e,t){void 0===t&&(t={});var n=e||l,u={};
99if(t.shadow,null!=n.shadowColor||null!=n.shadowOffset||null!=n.shadowOpacity||null!=n.shadowRadius){(0,o.warnOnce)('shadowStyles',"\"shadow*\" style props are deprecated. Use \"boxShadow\".");var h=s(n);null!=h&&(u.boxShadow=h)}if(t.textShadow,null!=n.textShadowColor||null!=n.textShadowOffset||null!=n.textShadowRadius){(0,o.warnOnce)('textShadowStyles',"\"textShadow*\" style props are deprecated. Use \"textShadow\".");var c=f(n);if(null!=c&&null==u.textShadow){var x=n.textShadow,O=x?x+", "+c:c;u.textShadow=O}}for(var v in n)if(null==y[v]&&'shadowColor'!==v&&'shadowOffset'!==v&&'shadowOpacity'!==v&&'shadowRadius'!==v&&'textShadowColor'!==v&&'textShadowOffset'!==v&&'textShadowRadius'!==v){var E=n[v],R=p[v]||v,j=E;if(Object.prototype.hasOwnProperty.call(n,v)&&(R===v||null==n[R]))if('aspectRatio'===R&&'number'==typeof j)u[R]=j.toString();else if('boxShadow'===R){Array.isArray(j)&&(j=S(j));var I=u.boxShadow;u.boxShadow=I?j+", "+I:j}else'fontVariant'===R?(Array.isArray(j)&&j.length>0&&(j=j.join(' ')),u[R]=j):'textAlignVertical'===R?null==n.verticalAlign&&(u.verticalAlign='center'===j?'middle':j):'transform'===R?(Array.isArray(j)&&(j=b(j)),u.transform=j):'transformOrigin'===R?(Array.isArray(j)&&(j=w(j)),u.transformOrigin=j):u[R]=j}return u},O=x},73,[31,29,74]); 100__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.warnOnce=function(n,t){}},74,[]); 101__d(function(g,r,_i2,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.styleq=void 0;var l=new WeakMap;function n(n){var s,u,t;return null!=n&&(s=!0===n.disableCache,u=!0===n.disableMix,t=n.transform),function(){for(var n=[],i='',o=null,f=s?null:l,v=new Array(arguments.length),c=0;c<arguments.length;c++)v[c]=arguments[c];for(;v.length>0;){var p=v.pop();if(null!=p&&!1!==p)if(Array.isArray(p))for(var y=0;y<p.length;y++)v.push(p[y]);else{var h=null!=t?t(p):p;if(h.$$css){var b='';if(null!=f&&f.has(h)){var M=f.get(h);null!=M&&(b=M[0],n.push.apply(n,M[1]),f=M[2])}else{var $=[];for(var _ in h){var j=h[_];"$$css"!==_&&('string'==typeof j||null===j?n.includes(_)||(n.push(_),null!=f&&$.push(_),'string'==typeof j&&(b+=b?' '+j:j)):console.error("styleq: ".concat(_," typeof ").concat(String(j)," is not \"string\" or \"null\".")))}if(null!=f){var q=new WeakMap;f.set(h,[b,$,q]),f=q}}b&&(i=i?b+' '+i:b)}else if(u)null==o&&(o={}),o=Object.assign({},h,o);else{var w=null;for(var A in h){var O=h[A];void 0!==O&&(n.includes(A)||(null!=O&&(null==o&&(o={}),null==w&&(w={}),w[A]=O),n.push(A),f=null))}null!=w&&(o=Object.assign(w,o))}}}return[i,o]}}var s=n();e.styleq=s,s.factory=n},75,[]); 102__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.validate=function(e){for(var n in e){var u=n.trim(),c=e[u],f=!1;if(null!==c){if('string'==typeof c&&c.indexOf('!important')>-1)s("Invalid style declaration \""+u+":"+c+"\". Values cannot include \"!important\""),f=!0;else{var p='';'animation'===u||'animationName'===u?(p='Did you mean "animationKeyframes"?',f=!0):'direction'===u?(p='Did you mean "writingDirection"?',f=!0):t[u]?(p='Please use long-form properties.',f=!0):l[u]&&'string'==typeof c&&(0,o.default)(c).nodes.length>1&&(p="Value is \""+c+"\" but only single values are supported.",f=!0),''!==p&&s("Invalid style property of \""+u+"\". "+p)}f&&delete e[n]}}};var e,n=r(d[0]),o=(e=n)&&e.__esModule?e:{default:e},t={background:!0,borderBottom:!0,borderLeft:!0,borderRight:!0,borderTop:!0,font:!0,grid:!0,outline:!0,textDecoration:!0},l={flex:!0,margin:!0,padding:!0,borderColor:!0,borderRadius:!0,borderStyle:!0,borderWidth:!0,inset:!0,insetBlock:!0,insetInline:!0,marginBlock:!0,marginInline:!0,marginHorizontal:!0,marginVertical:!0,paddingBlock:!0,paddingInline:!0,paddingHorizontal:!0,paddingVertical:!0,overflow:!0,overscrollBehavior:!0,backgroundPosition:!0};function s(e){console.error(e)}},76,[77]); 103__d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]),o=r(d[2]);function s(n){return this instanceof s?(this.nodes=t(n),this):new s(n)}s.prototype.toString=function(){return Array.isArray(this.nodes)?o(this.nodes):""},s.prototype.walk=function(t,o){return n(this.nodes,t,o),this},s.unit=r(d[3]),s.walk=n,s.stringify=o,m.exports=s},77,[78,79,80,81]); 104__d(function(g,r,i,a,m,e,d){var o="(".charCodeAt(0),n=")".charCodeAt(0),c="'".charCodeAt(0),t='"'.charCodeAt(0),s="\\".charCodeAt(0),u="/".charCodeAt(0),l=",".charCodeAt(0),h=":".charCodeAt(0),f="*".charCodeAt(0),p="u".charCodeAt(0),x="U".charCodeAt(0),A="+".charCodeAt(0),C=/^[a-f0-9?-]+$/i;m.exports=function(I){for(var v,E,y,w,O,b,_,q,U,$=[],j=I,k=0,z=j.charCodeAt(k),B=j.length,D=[{nodes:$}],F=0,G="",H="",J="";k<B;)if(z<=32){v=k;do{v+=1,z=j.charCodeAt(v)}while(z<=32);w=j.slice(k,v),y=$[$.length-1],z===n&&F?J=w:y&&"div"===y.type?(y.after=w,y.sourceEndIndex+=w.length):z===l||z===h||z===u&&j.charCo
vendor: 4,356 bytes, lines 104-108
104deAt(v+1)!==f&&(!U||U&&"function"===U.type&&"calc"!==U.value)?H=w:$.push({type:"space",sourceIndex:k,sourceEndIndex:v,value:w}),k=v}else if(z===c||z===t){v=k,w={type:"string",sourceIndex:k,quote:E=z===c?"'":'"'};do{if(O=!1,~(v=j.indexOf(E,v+1)))for(b=v;j.charCodeAt(b-1)===s;)b-=1,O=!O;else v=(j+=E).length-1,w.unclosed=!0}while(O);w.value=j.slice(k+1,v),w.sourceEndIndex=w.unclosed?v:v+1,$.push(w),k=v+1,z=j.charCodeAt(k)}else if(z===u&&j.charCodeAt(k+1)===f)w={type:"comment",sourceIndex:k,sourceEndIndex:(v=j.indexOf("*/",k))+2},-1===v&&(w.unclosed=!0,v=j.length,w.sourceEndIndex=v),w.value=j.slice(k+2,v),$.push(w),k=v+2,z=j.charCodeAt(k);else if(z!==u&&z!==f||!U||"function"!==U.type||"calc"!==U.value)if(z===u||z===l||z===h)w=j[k],$.push({type:"div",sourceIndex:k-H.length,sourceEndIndex:k+w.length,value:w,before:H,after:""}),H="",k+=1,z=j.charCodeAt(k);else if(o===z){v=k;do{v+=1,z=j.charCodeAt(v)}while(z<=32);if(q=k,w={type:"function",sourceIndex:k-G.length,value:G,before:j.slice(q+1,v)},k=v,"url"===G&&z!==c&&z!==t){v-=1;do{if(O=!1,~(v=j.indexOf(")",v+1)))for(b=v;j.charCodeAt(b-1)===s;)b-=1,O=!O;else v=(j+=")").length-1,w.unclosed=!0}while(O);_=v;do{_-=1,z=j.charCodeAt(_)}while(z<=32);q<_?(w.nodes=k!==_+1?[{type:"word",sourceIndex:k,sourceEndIndex:_+1,value:j.slice(k,_+1)}]:[],w.unclosed&&_+1!==v?(w.after="",w.nodes.push({type:"space",sourceIndex:_+1,sourceEndIndex:v,value:j.slice(_+1,v)})):(w.after=j.slice(_+1,v),w.sourceEndIndex=v)):(w.after="",w.nodes=[]),k=v+1,w.sourceEndIndex=w.unclosed?v:k,z=j.charCodeAt(k),$.push(w)}else F+=1,w.after="",w.sourceEndIndex=k+1,$.push(w),D.push(w),$=w.nodes=[],U=w;G=""}else if(n===z&&F)k+=1,z=j.charCodeAt(k),U.after=J,U.sourceEndIndex+=J.length,J="",F-=1,D[D.length-1].sourceEndIndex=k,D.pop(),$=(U=D[F]).nodes;else{v=k;do{z===s&&(v+=1),v+=1,z=j.charCodeAt(v)}while(v<B&&!(z<=32||z===c||z===t||z===l||z===h||z===u||z===o||z===f&&U&&"function"===U.type&&"calc"===U.value||z===u&&"function"===U.type&&"calc"===U.value||z===n&&F));w=j.slice(k,v),o===z?G=w:p!==w.charCodeAt(0)&&x!==w.charCodeAt(0)||A!==w.charCodeAt(1)||!C.test(w.slice(2))?$.push({type:"word",sourceIndex:k,sourceEndIndex:v,value:w}):$.push({type:"unicode-range",sourceIndex:k,sourceEndIndex:v,value:w}),k=v}else w=j[k],$.push({type:"word",sourceIndex:k-H.length,sourceEndIndex:k+w.length,value:w}),k+=1,z=j.charCodeAt(k);for(k=D.length-1;k;k-=1)D[k].unclosed=!0,D[k].sourceEndIndex=j.length;return D[0].nodes}},78,[]); 105__d(function(g,r,_i,a,m,e,d){m.exports=function n(o,t,f){var i,s,c,u;for(i=0,s=o.length;i<s;i+=1)c=o[i],f||(u=t(c,i,o)),!1!==u&&"function"===c.type&&Array.isArray(c.nodes)&&n(c.nodes,t,f),f&&t(c,i,o)}},79,[]); 106__d(function(g,r,_i,a,m,e,d){function n(n,t){var u,f,i=n.type,s=n.value;return t&&void 0!==(f=t(n))?f:"word"===i||"space"===i?s:"string"===i?(u=n.quote||"")+s+(n.unclosed?"":u):"comment"===i?"/*"+s+(n.unclosed?"":"*/"):"div"===i?(n.before||"")+s+(n.after||""):Array.isArray(n.nodes)?(u=o(n.nodes,t),"function"!==i?u:s+"("+(n.before||"")+u+(n.after||"")+(n.unclosed?"":")")):s}function o(o,t){var u,f;if(Array.isArray(o)){for(u="",f=o.length-1;~f;f-=1)u=n(o[f],t)+u;return u}return n(o,t)}m.exports=o},80,[]); 107__d(function(g,r,i,a,m,e,d){var t="-".charCodeAt(0),o="+".charCodeAt(0),c=".".charCodeAt(0),h="e".charCodeAt(0),A="E".charCodeAt(0);function C(h){var A,C=h.charCodeAt(0);if(C===o||C===t){if((A=h.charCodeAt(1))>=48&&A<=57)return!0;var n=h.charCodeAt(2);return A===c&&n>=48&&n<=57}return C===c?(A=h.charCodeAt(1))>=48&&A<=57:C>=48&&C<=57}m.exports=function(n){var f,u,v,l=0,s=n.length;if(0===s||!C(n))return!1;for((f=n.charCodeAt(l))!==o&&f!==t||l++;l<s&&!((f=n.charCodeAt(l))<48||f>57);)l+=1;if(f=n.charCodeAt(l),u=n.charCodeAt(l+1),f===c&&u>=48&&u<=57)for(l+=2;l<s&&!((f=n.charCodeAt(l))<48||f>57);)l+=1;if(f=n.charCodeAt(l),u=n.charCodeAt(l+1),v=n.charCodeAt(l+2),(f===h||f===A)&&(u>=48&&u<=57||(u===o||u===t)&&v>=48&&v<=57))for(l+=u===o||u===t?3:2;l<s&&!((f=n.charCodeAt(l))<48||f>57);)l+=1;return{number:n.slice(0,l),unit:n.slice(l)}}},81,[]); 108__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getLocaleDirection=u,_e.LocaleProvider=function(e){var t=e.direction,o=e.locale,l=e.children;return t||o?n.default.createElement(c.Provider,{children:l,value:{direction:o?u(o):t,locale:o}}):l},_e.useLocaleContext=function(){return(0,t.useContext)(c)};
108var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(d[1]),l={direction:'ltr',locale:'en-US'},c=(0,t.createContext)(l);function u(e){return(0,o.isLocaleRTL)(e)?'rtl':'ltr'}},82,[11,83]); 109__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isLocaleRTL=function(s){var l=c.get(s);if(l)return l;var o=!1;if(Intl.Locale)try{var u=new Intl.Locale(s).maximize().script;o=t.has(u)}catch(t){var h=s.split('-')[0];o=n.has(h)}else{var v=s.split('-')[0];o=n.has(v)}return c.set(s,o),o};var t=new Set(['Arab','Syrc','Samr','Mand','Thaa','Mend','Nkoo','Adlm','Rohg','Hebr']),n=new Set(['ae','ar','arc','bcc','bqi','ckb','dv','fa','far','glk','he','iw','khw','ks','ku','mzn','nqo','pnb','ps','sd','ug','ur','yi']),c=new Map},83,[]); 110__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"defaultProps",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"accessibilityProps",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clickProps",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"focusProps",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"keyboardProps",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"mouseProps",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"touchProps",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"styleProps",{enumerable:!0,get:function(){return b}});var t={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},c={'aria-activedescendant':!0,'aria-atomic':!0,'aria-autocomplete':!0,'aria-busy':!0,'aria-checked':!0,'aria-colcount':!0,'aria-colindex':!0,'aria-colspan':!0,'aria-controls':!0,'aria-current':!0,'aria-describedby':!0,'aria-details':!0,'aria-disabled':!0,'aria-errormessage':!0,'aria-expanded':!0,'aria-flowto':!0,'aria-haspopup':!0,'aria-hidden':!0,'aria-invalid':!0,'aria-keyshortcuts':!0,'aria-label':!0,'aria-labelledby':!0,'aria-level':!0,'aria-live':!0,'aria-modal'
110:!0,'aria-multiline':!0,'aria-multiselectable':!0,'aria-orientation':!0,'aria-owns':!0,'aria-placeholder':!0,'aria-posinset':!0,'aria-pressed':!0,'aria-readonly':!0,'aria-required':!0,inert:!0,role:!0,'aria-roledescription':!0,'aria-rowcount':!0,'aria-rowindex':!0,'aria-rowspan':!0,'aria-selected':!0,'aria-setsize':!0,'aria-sort':!0,'aria-valuemax':!0,'aria-valuemin':!0,'aria-valuenow':!0,'aria-valuetext':!0,accessibilityActiveDescendant:!0,accessibilityAtomic:!0,accessibilityAutoComplete:!0,accessibilityBusy:!0,accessibilityChecked:!0,accessibilityColumnCount:!0,accessibilityColumnIndex:!0,accessibilityColumnSpan:!0,accessibilityControls:!0,accessibilityCurrent:!0,accessibilityDescribedBy:!0,accessibilityDetails:!0,accessibilityDisabled:!0,accessibilityErrorMessage:!0,accessibilityExpanded:!0,accessibilityFlowTo:!0,accessibilityHasPopup:!0,accessibilityHidden:!0,accessibilityInvalid:!0,accessibilityKeyShortcuts:!0,accessibilityLabel:!0,accessibilityLabelledBy:!0,accessibilityLevel:!0,accessibilityLiveRegion:!0,accessibilityModal:!0,accessibilityMultiline:!0,accessibilityMultiSelectable:!0,accessibilityOrientation:!0,accessibilityOwns:!0,accessibilityPlaceholder:!0,accessibilityPosInSet:!0,accessibilityPressed:!0,accessibilityReadOnly:!0,accessibilityRequired:!0,accessibilityRole:!0,accessibilityRoleDescription:!0,accessibilityRowCount:!0,accessibilityRowIndex:!0,accessibilityRowSpan:!0,accessibilitySelected:!0,accessibilitySetSize:!0,accessibilitySort:!0,accessibilityValueMax:!0,accessibilityValueMin:!0,accessibilityValueNow:!0,accessibilityValueText:!0},o={onClick:!0,onAuxClick:!0,onContextMenu:!0,onGotPointerCapture:!0,onLostPointerCapture:!0,onPointerCancel:!0,onPointerDown:!0,onPointerEnter:!0,onPointerMove:!0,onPointerLeave:!0,onPointerOut:!0,onPointerOver:!0,onPointerUp:!0},s={onBlur:!0,onFocus:!0},n={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},l={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},u={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},b={style:!0}},84,[]); 111__d(function(g,r,i,a,m,e,d){"use strict";function t(t,n){var u={};for(var o in t)t.hasOwnProperty(o)&&!0===n[o]&&(u[o]=t[o]);return u}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}})},85,[]); 112__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=e(r(d[0])),n=e(r(d[1])),u=e(r(d[2])),l='__reactLayoutHandler',o=(u.default,null);function f(e,f){var v=(u.default&&void 0!==window.ResizeObserver&&null==o&&(o=new window.ResizeObserver(function(e){e.forEach(e=>{var t=e.target,u=t[l];'function'==typeof u&&n.default.measure(t,(t,n,l,o,f,v)=>{var c={nativeEvent:{layout:{x:t,y:n,width:l,height:o,left:f,top:v}},timeStamp:Date.now()};Object.defineProperty(c.nativeEvent,'target',{enumerable:!0,get:()=>e.target}),u(c)})})})),o);(0,t.default)(()=>{var t=e.current;null!=t&&(t[l]=f)},[e,f]),(0,t.default)(()=>{var t=e.current;return null!=t&&null!=v&&('function'==typeof t[l]?v.observe(t):v.unobserve(t)),()=>{null!=t&&null!=v&&v.unobserve(t)}},[e,v])}},86,[87,88,35]); 113__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var e,t=r(d[0]),u=r(d[1]),f=((e=u)&&e.__esModule?e:{default:e}).default?t.useLayoutEffect:t.useEffect},87,[11,35]); 114__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=e(r(d[0])),o=e(r(d[1])),s=e=>{var t=e.offsetHeight,o=e.offsetWidth,s=e.offsetLeft,n=e.offsetTop;for(e=e.offsetParent;e&&1===e.nodeType;)s+=e.offsetLeft+e.clientLeft-e.scrollLeft,n+=e.offsetTop+e.clientTop-e.scrollTop,e=e.offsetParent;return{width:o,height:t,top:n-=window.scrollY,left:s-=window.scrollX}},n=(e,t,o)=>{var n=t||e&&e.parentNode;e&&n&&setTimeout(()=>{if(e.isConnected&&n.isConnected){var t=s(n),l=s(e),f=l.height,u=l.left,c=l.top,b=l.width,p=u-t.left,h=c-t.top;o(p,h,b,f,u,c)}},0)},l={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},f={blur(e){try{e.blur()}catch(e){}},focus(e){try{var t=e.nodeName;null==e.getAttribute('tabIndex')&&!0!==e.isContentEditable&&null==l[t]&&e.setAttribute('tabIndex','-1'),e.focus()}catch(e){}},measure(e,t){n(e,null,t)},measureInWindow(e,o){e&&setTimeout(()=>{var s=(0,t.default)(e),n=s.height,l=s.left,f=s.top,u=s.width;o(l,f,u,n)},0)},measureLayout(e,t,o,s){n(e,t,s)},updateView(e,t){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var n=t[s];switch(s){case'style':(0,o.default)(e,n);break;case'class':case'className':e.setAttribute('class',n);break;case'text':case'value':e.value=n;break;default:e.setAttribute(s,n)}}},configureNextLayoutAnimation(e,t){t()}
114,setLayoutAnimationEnabledExperimental(){}}},88,[89,90]); 115__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=t=>{if(null!=t&&(1===t.nodeType&&'function'==typeof t.getBoundingClientRect))return t.getBoundingClientRect()}},89,[]); 116__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};var f=function(e,t){var f=e.style;for(var o in t)if(t.hasOwnProperty(o)){var u=0===o.indexOf('--'),l=(0,n.default)(o,t[o],u);'float'===o&&(o='cssFloat'),u?f.setProperty(o,l):f[o]=l}}},90,[91]); 117__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e};var n=function(e,t,n){return null==t||'boolean'==typeof t||''===t?'':n||'number'!=typeof t||0===t||u.default.hasOwnProperty(e)&&u.default[e]?(''+t).trim():t+'px'}},91,[92]); 118__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var t={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},o=['ms','Moz','O','Webkit'],l=(t,o)=>t+o.charAt(0).toUpperCase()+o.substring(1);Object.keys(t).forEach(n=>{o.forEach(o=>{t[l(o,n)]=t[n]})});var n=t},92,[]); 119__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var e,t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),n=r(_d[1]),u=(e=n)&&e.__esModule?e:{default:e};function o(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.useMemo(()=>(0,u.default)(...n),[...n])}},93,[11,94]); 120__d(function(g,r,i,a,m,e,d){"use strict";function n(){for(var n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];return function(n){t.forEach(t=>{null!=t&&('function'!=typeof t?'object'!=typeof t?console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref "+String(t)):t.current=n:t(n))})}}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}}),r(d[0])},94,[11]); 121__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var u=e(r(d[0])),t=e(r(d[1]));function n(e){e.pointerEvents,e.style;return(0,t.default)(()=>e=>{null!=e&&(e.measure=t=>u.default.measure(e,t),e.measureLayout=(t,n,l)=>u.default.measureLayout(e,t,l,n),e.measureInWindow=t=>u.default.measureInWindow(e,t))})}},95,[88,96]); 122__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),t='function'==typeof Symbol&&'symbol'==typeof Symbol()?Symbol():Object.freeze({});function n(n){var u=e.useRef(t);return u.current===t&&(u.current=n()),u.current}},96,[11]); 123__d(function(g,r,i,a,m,_e,_d){"use strict";
123function e(e){if(e&&e.__esModule)return e;var n={};return e&&Object.keys(e).forEach(function(t){var u=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,u.get?u:{enumerable:!0,get:function(){return e[t]}})}),n.default=e,n}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var n=e(r(_d[0])),t=e(r(_d[1])),u={},o=0;function l(e,l){void 0===l&&(l=u);var d,c,s=(d=()=>o++,null==(c=n.useRef(null)).current&&(c.current=d()),c.current),S=n.useRef(!1);n.useEffect(()=>(t.attachListeners(),()=>{t.removeNode(s)}),[s]),n.useEffect(()=>{var n=l,u=n.onMoveShouldSetResponder,o=n.onMoveShouldSetResponderCapture,d=n.onScrollShouldSetResponder,c=n.onScrollShouldSetResponderCapture,f=n.onSelectionChangeShouldSetResponder,p=n.onSelectionChangeShouldSetResponderCapture,h=n.onStartShouldSetResponder,R=n.onStartShouldSetResponderCapture,v=null!=u||null!=o||null!=d||null!=c||null!=f||null!=p||null!=h||null!=R,b=e.current;v?(t.addNode(s,b,l),S.current=!0):S.current&&(t.removeNode(s),S.current=!1)},[l,e,s]),n.useDebugValue({isResponder:e.current===t.getResponderNode()}),n.useDebugValue(l)}},97,[11,98]); 124__d(function(g,r,_i2,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.attachListeners=function(){s.default&&null==window.__reactResponderSystemActive&&(window.addEventListener('blur',P),E.forEach(e=>{document.addEventListener(e,P)}),_.forEach(e=>{document.addEventListener(e,P,!0)}),window.__reactResponderSystemActive=!0)},_e.addNode=function(e,n,t){(0,o.setResponderId)(n,e),f.set(e,t)},_e.removeNode=function(e){S.id===e&&M();f.has(e)&&f.delete(e)},_e.terminateResponder=M,_e.getResponderNode=function(){return S.node};var n=e(r(d[0])),t=r(d[1]),o=r(d[2]),i=r(d[3]),s=e(r(d[4])),l={},u=['onStartShouldSetResponderCapture','onStartShouldSetResponder',{bubbles:!0}],c=['onMoveShouldSetResponderCapture','onMoveShouldSetResponder',{bubbles:!0}],p={touchstart:u,mousedown:u,touchmove:c,mousemove:c,scroll:['onScrollShouldSetResponderCapture','onScrollShouldSetResponder',{bubbles:!1}]},h={id:null,idPath:null,node:null},f=new Map,v=!1,R=0,S={id:null,node:null,idPath:null},b=new i.ResponderTouchHistoryStore;function T(e){S=e}function C(e){var n=f.get(e);return null!=n?n:l}function P(e){var i=e.type,s=e.target;if('touchstart'===i&&(v=!0),('touchmove'===i||R>1)&&(v=!1),!('mousedown'===i&&v||'mousemove'===i&&v||'mousemove'===i&&R<1))if(v&&'mouseup'===i)0===R&&(v=!1);else{var l=(0,t.isStartish)(i)&&(0,o.isPrimaryPointerDown)(e),u=(0,t.isMoveish)(i),c=(0,t.isEndish)(i),p=(0,t.isScroll)(i),f=(0,t.isSelectionChange)(i),P=(0,n.default)(e,b);(l||u||c)&&(e.touches?R=e.touches.length:l?R=1:c&&(R=0),b.recordTouchTrack(i,P.nativeEvent));var _,E=(0,o.getResponderPaths)(e),M=!1;if(l||u||p&&R>0){var y=S.idPath,x=E.idPath;if(null!=y&&null!=x){var L=(0,o.getLowestCommonAncestor)(y,x);if(null!=L){var q=x.indexOf(L)+(L===S.id?1:0);E={idPath:x.slice(q),nodePath:E.nodePath.slice(q)}}else E=null}null!=E&&null!=(_=w(E,e,P))&&(N(P,_),M=!0)}if(null!=S.id&&null!=S.node){var j=S,A=j.id,G=j.node,O=C(A),k=O.onResponderStart,D=O.onResponderMove,H=O.onResponderEnd,I=O.onResponderRelease,V=O.onResponderTerminate,z=O.onResponderTerminationRequest;if(P.bubbles=!1,P.cancelable=!1,P.currentTarget=G,l)null!=k&&(P.dispatchConfig.registrationName='onResponderStart',k(P));else if(u)null!=D&&(P.dispatchConfig.registrationName='onResponderMove',D(P));else{var B=(0,t.isCancelish)(i)||'contextmenu'===i||'blur'===i&&s===window||'blur'===i&&s.contains(G)&&e.relatedTarget!==G||p&&0===R||p&&s.contains(G)&&s!==G||f&&(0,o.hasValidSelection)(e),F=c&&!B&&!(0,o.hasTargetTouches)(G,e.touches);if(c&&null!=H&&(P.dispatchConfig.registrationName='onResponderEnd',H(P)),F&&(null!=I&&(P.dispatchConfig.registrationName='onResponderRelease',I(P)),T(h)),B){var J=!0;'contextmenu'!==i&&'scroll'!==i&&'selectionchange'!==i||(M?J=!1:null!=z&&(P.dispatchConfig.registrationName='onResponderTerminationRequest',!1===z(P)&&(J=!1))),J&&(null!=V&&(P.dispatchConfig.registrationName='onResponderTerminate',V(P)),T(h),v=!1,R=0)}}}}}function w(e,n,t){var o=p[n.type];if(null!=o){for(var i=e.idPath,s=e.nodePath,l=o[0],u=o[1],c=o[2].bubbles,h=function(e,n,o){var s=C(e)[o];if(null!=s&&(t.currentTarget=n,!0===s(t)))return{id:e,node:n,idPath:i.slice(i.indexOf(e))}},f=i.length-1;f>=0;f--){var v=h(i[f],s[f],l);if(null!=v)return v;if(!0===t.isPropagationStopped())return}if(c)for(var R=0;R<i.length;R++){var S=h(i[R],s[R],u);if(null!=S)return S;if(!0===t.isPropagationStopped())return}else{var b=i[0],T=s[0];if(n.target===T)return h(b,T,u)}}}function N(e,n){var t=S,o=t.id,i=t.node,s=n.id,l=n.node,u=C(s),c=u.onResponderGrant,p=u.onResponderReject;if(e.bubbles=!1,e.cancelable=!1,e.currentTarget=l,null==o)null!=c&&(e.currentTarget=l,e.dispatchConfig.registrationName='onResponderGrant',c(e)),T(n);else{var h=C(o),f=h.onResponderTerminate,v=h.onResponderTerminationRequest,R=!0;null!=v&&(e.currentTarget=i,e.dispatchConfig.registrationName='onResponderTerminationRequest',!1===v(e)&&(R=!1)),R?(null!=f&&(e.currentTarget=i,e.dispatchConfig.registrationName='onResponderTerminate',f(e)),null!=c&&(e.currentTarget=l,e.dispatchConfig.registrationName='onResponderGrant',c(e)),T(n)):null!=p&&(e.currentTarget=l,e.dispatchConfig.registrationName='onResponderReject',p(e))}}var _=['blur','scroll'],E=['mousedown','mousemove','mouseup','dragstart','touchstart','touchmove','touchend','touchcancel','contextmenu','select','selectionchange'];
124function M(){var e=S,t=e.id,o=e.node;if(null!=t&&null!=o){var i=C(t).onResponderTerminate;if(null!=i){var s=(0,n.default)({},b);s.currentTarget=o,i(s)}T(h)}v=!1,R=0}},98,[99,100,101,103,35]); 125__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},u=()=>{},o={},c=[];function l(e){return e>20?e%20:e}function f(e,t){var f,p,s,v=!1,y=e.changedTouches,h=e.type,X=!0===e.metaKey,Y=!0===e.shiftKey,P=y&&y[0].force||0,b=l(y&&y[0].identifier||0),T=y&&y[0].clientX||e.clientX,K=y&&y[0].clientY||e.clientY,_=y&&y[0].pageX||e.pageX,D=y&&y[0].pageY||e.pageY,S='function'==typeof e.preventDefault?e.preventDefault.bind(e):u,j=e.timeStamp;function H(e){return Array.prototype.slice.call(e).map(e=>({force:e.force,identifier:l(e.identifier),get locationX(){return A(e.clientX)},get locationY(){return C(e.clientY)},pageX:e.pageX,pageY:e.pageY,target:e.target,timestamp:j}))}if(null!=y)p=H(y),s=H(e.touches);else{var M=[{force:P,identifier:b,get locationX(){return A(T)},get locationY(){return C(K)},pageX:_,pageY:D,target:e.target,timestamp:j}];p=M,s='mouseup'===h||'dragstart'===h?c:M}var O={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:e.defaultPrevented,dispatchConfig:o,eventPhase:e.eventPhase,isDefaultPrevented:()=>e.defaultPrevented,isPropagationStopped:()=>v,isTrusted:e.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:X,shiftKey:Y,changedTouches:p,force:P,identifier:b,get locationX(){return A(T)},get locationY(){return C(K)},pageX:_,pageY:D,target:e.target,timestamp:j,touches:s,type:h},persist:u,preventDefault:S,stopPropagation(){v=!0},target:e.target,timeStamp:j,touchHistory:t.touchHistory};function A(e){if(f=f||(0,n.default)(O.currentTarget))return e-f.left}function C(e){if(f=f||(0,n.default)(O.currentTarget))return e-f.top}return O}},99,[89]); 126__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"BLUR",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"CONTEXT_MENU",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"FOCUS_OUT",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"MOUSE_DOWN",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"MOUSE_MOVE",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"MOUSE_UP",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"MOUSE_CANCEL",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"TOUCH_START",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"TOUCH_MOVE",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"TOUCH_END",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"TOUCH_CANCEL",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"SCROLL",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"SELECT",{enumerable:!0,get:function(){return C}}),Object.defineProperty(e,"SELECTION_CHANGE",{enumerable:!0,get:function(){return P}}),e.isStartish=function(t){return t===b||t===o},e.isMoveish=function(t){return t===l||t===c},e.isEndish=function(t){return t===s||t===f||j(t)},e.isCancelish=j,e.isScroll=function(t){return t===p},e.isSelectionChange=function(t){return t===C||t===P};var t='blur',n='contextmenu',u='focusout',o='mousedown',c='mousemove',f='mouseup',O='dragstart',b='touchstart',l='touchmove',s='touchend',E='touchcancel',p='scroll',C='select',P='selectionchange';function j(t){return t===E||t===O}},100,[]); 127__d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.setResponderId=function(e,t){null!=e&&(e[o]=t)},_e.getResponderPaths=function(e){for(var t=[],n=[],o=u(e),l=0;l<o.length;l++){var i=o[l],s=c(i);null!=s&&(t.push(s),n.push(i))}return{idPath:t,nodePath:n}},_e.getLowestCommonAncestor=function(e,t){var n=e.length,o=t.length;if(0===n||0===o||e[n-1]!==t[o-1])return null;var u=e[0],l=0,c=t[0],i=0;n-o>0&&(u=e[l=n-o],n=o);o-n>0&&(c=t[i=o-n],o=n);var s=n;for(;s--;){if(u===c)return u;u=e[l++],c=t[i++]}return null},_e.hasTargetTouches=function(e,t){if(!t||0===t.length)return!1;for(var n=0;n<t.length;n++){var o=t[n].target;if(null!=o&&e.contains(o))return!0}return!1},_e.hasValidSelection=function(e){if('selectionchange'===e.type)return(0,n.default)();return'select'===e.type},_e.isPrimaryPointerDown=function(e){var t=e.altKey,n=e.button,o=e.buttons,u=e.ctrlKey,l=e.type,c='mousedown'===l&&(0===n||1===o),i='mousemove'===l&&1===o,s=!1===t&&!1===u;if('touchstart'===l||'touchmove'===l||c&&s||i&&s)return!0;return!1};
127var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},o='__reactResponderId';function u(e){return'selectionchange'===e.type?l(window.getSelection().anchorNode):null!=e.composedPath?e.composedPath():l(e.target)}function l(e){for(var t=[];null!=e&&e!==document.body;)t.push(e),e=e.parentNode;return t}function c(e){return null!=e?e[o]:null}},101,[102]); 128__d(function(g,r,i,a,m,e,d){"use strict";function n(){var n=window.getSelection(),o=n.toString(),t=n.anchorNode,u=n.focusNode,c=t&&t.nodeType===window.Node.TEXT_NODE||u&&u.nodeType===window.Node.TEXT_NODE;return o.length>=1&&'\n'!==o&&c}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}})},102,[]); 129__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ResponderTouchHistoryStore",{enumerable:!0,get:function(){return T}});var t=r(d[0]);function n(t){return t.timeStamp||t.timestamp}function i(t){return{touchActive:!0,startPageX:t.pageX,startPageY:t.pageY,startTimeStamp:n(t),currentPageX:t.pageX,currentPageY:t.pageY,currentTimeStamp:n(t),previousPageX:t.pageX,previousPageY:t.pageY,previousTimeStamp:n(t)}}function c(t,i){t.touchActive=!0,t.startPageX=i.pageX,t.startPageY=i.pageY,t.startTimeStamp=n(i),t.currentPageX=i.pageX,t.currentPageY=i.pageY,t.currentTimeStamp=n(i),t.previousPageX=i.pageX,t.previousPageY=i.pageY,t.previousTimeStamp=n(i)}function o(t){var n=t.identifier;return null==n&&console.error('Touch object is missing identifier.'),n}function u(t,u){var s=o(t),h=u.touchBank[s];h?c(h,t):u.touchBank[s]=i(t),u.mostRecentTimeStamp=n(t)}function s(t,i){var c=i.touchBank[o(t)];c?(c.touchActive=!0,c.previousPageX=c.currentPageX,c.previousPageY=c.currentPageY,c.previousTimeStamp=c.currentTimeStamp,c.currentPageX=t.pageX,c.currentPageY=t.pageY,c.currentTimeStamp=n(t),i.mostRecentTimeStamp=n(t)):console.warn('Cannot record touch move without a touch start.\n',"Touch Move: "+p(t)+"\n","Touch Bank: "+v(i))}function h(t,i){var c=i.touchBank[o(t)];c?(c.touchActive=!1,c.previousPageX=c.currentPageX,c.previousPageY=c.currentPageY,c.previousTimeStamp=c.currentTimeStamp,c.currentPageX=t.pageX,c.currentPageY=t.pageY,c.currentTimeStamp=n(t),i.mostRecentTimeStamp=n(t)):console.warn('Cannot record touch end without a touch start.\n',"Touch End: "+p(t)+"\n","Touch Bank: "+v(i))}function p(t){return JSON.stringify({identifier:t.identifier,pageX:t.pageX,pageY:t.pageY,timestamp:n(t)})}function v(t){var n=t.touchBank,i=JSON.stringify(n.slice(0,20));return n.length>20&&(i+=' (original size: '+n.length+')'),i}class T{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(n,i){var c=this._touchHistory;if((0,t.isMoveish)(n))i.changedTouches.forEach(t=>s(t,c));else if((0,t.isStartish)(n))i.changedTouches.forEach(t=>u(t,c)),c.numberActiveTouches=i.touches.length,1===c.numberActiveTouches&&(c.indexOfSingleActiveTouch=i.touches[0].identifier);else if((0,t.isEndish)(n)&&(i.changedTouches.forEach(t=>h(t,c)),c.numberActiveTouches=i.touches.length,1===c.numberActiveTouches))for(var o=c.touchBank,p=0;p<o.length;p++){var v=o[p];if(null!=v&&v.touchActive){c.indexOfSingleActiveTouch=p;break}}}get touchHistory(){return this._touchHistory}}},103,[100]); 130__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=(0,r(d[0]).createContext)(!1)},104,[11]); 131__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[1]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var c=r(d[2]);Object.keys(c).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return c[t]}})});var o=r(d[3]);
131Object.keys(o).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})})},105,[106,110,111,112]); 132__d(function(g,_r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SafeAreaInsetsContext",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"SafeAreaFrameContext",{enumerable:!0,get:function(){return l}}),_e.SafeAreaProvider=function({children:e,initialMetrics:r,initialSafeAreaInsets:c,style:d,...h}){const v=t.useContext(f),b=t.useContext(l),[y,p]=t.useState(r?.insets??c??v??null),[w,S]=t.useState(r?.frame??b??{x:0,y:0,width:n.default.get('window').width,height:n.default.get('window').height}),C=t.useCallback(e=>{const{nativeEvent:{frame:t,insets:n}}=e;S(e=>!t||t.height===e.height&&t.width===e.width&&t.x===e.x&&t.y===e.y?e:t),p(e=>e&&n.bottom===e.bottom&&n.left===e.left&&n.right===e.right&&n.top===e.top?e:n)},[]);return t.createElement(o.NativeSafeAreaProvider,u({style:[s.fill,d],onInsetsChange:C},h),null!=y?t.createElement(l.Provider,{value:w},t.createElement(f.Provider,{value:y},e)):null)},_e.SafeAreaListener=function({onChange:e,style:n,children:r,...f}){return t.createElement(o.NativeSafeAreaProvider,u({},f,{style:[s.fill,n],onInsetsChange:t=>{e({insets:t.nativeEvent.insets,frame:t.nativeEvent.frame})}}),r)},_e.useSafeAreaInsets=d,_e.useSafeAreaFrame=function(){const e=t.useContext(l);if(null==e)throw new Error(c);return e},_e.withSafeAreaInsets=function(e){return t.forwardRef((n,r)=>{const o=d();return t.createElement(e,u({},n,{insets:o,ref:r}))})},_e.useSafeArea=function(){return d()},Object.defineProperty(_e,"SafeAreaConsumer",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"SafeAreaContext",{enumerable:!0,get:function(){return v}});var t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(_r(_d[0])),n=e(_r(_d[1])),r=e(_r(_d[2])),o=_r(_d[3]);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(null,arguments)}const f=t.createContext(null),l=t.createContext(null);const s=r.default.create({fill:{flex:1}});const c='No safe area value available. Make sure you are rendering `<SafeAreaProvider>` at the top of your app.';function d(){const e=t.useContext(f);if(null==e)throw new Error(c);return e}const h=f.Consumer,v=f},106,[11,107,26,109]); 133__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return w}});var t=e(r(d[0])),n=e(r(d[1])),s={window:{fontScale:1,height:0,scale:1,width:0},screen:{fontScale:1,height:0,scale:1,width:0}},o={},c=n.default;function l(){if(n.default){var e,t,o=window;if(o.visualViewport){var c=o.visualViewport;e=Math.round(c.height*c.scale),t=Math.round(c.width*c.scale)}else{var l=o.document.documentElement;e=l.clientHeight,t=l.clientWidth}s.window={fontScale:1,height:e,scale:o.devicePixelRatio||1,width:t},s.screen={fontScale:1,height:o.screen.height,scale:o.devicePixelRatio||1,width:o.screen.width}}}function u(){l(),Array.isArray(o.change)&&o.change.forEach(e=>e(s))}class w{static get(e){return c&&(c=!1,l()),(0,t.default)(s[e],"No dimension set for key "+e),s[e]}static set(e){e&&(n.default?(0,t.default)(!1,'Dimensions cannot be set in the browser'):(null!=e.screen&&(s.screen=e.screen),null!=e.window&&(s.window=e.window)))}static addEventListener(e,t){return o[e]=o[e]||[],o[e].push(t),{remove:()=>{this.removeEventListener(e,t)}}}static removeEventListener(e,t){Array.isArray(o[e])&&(o[e]=o[e].filter(e=>e!==t))}}n.default&&(window.visualViewport?window.visualViewport.addEventListener('resize',u,!1):window.addEventListener('resize',u,!1))},107,[108,35]); 134__d(function(g,r,i,a,m,e,d){'use strict';m.exports=function(n,o){for(var t=arguments.length,f=new Array(t>2?t-2:0),s=2;s<t;s++)f[s-2]=arguments[s];if(!n){var l;if(void 0===o)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=0;(l=new Error(o.replace(/%s/g,function(){return String(f[u++])}))).name='Invariant Violation'}throw l.framesToPop=1,l}}},108,[]); 135__d(function(g,r,i,a,m,_e,_d){"use strict";
135Object.defineProperty(_e,'__esModule',{value:!0}),_e.NativeSafeAreaProvider=function({children:t,style:n,onInsetsChange:d}){return e.useEffect(()=>{if('undefined'==typeof document)return;const t=p();document.body.appendChild(t);const e=()=>{const{paddingTop:e,paddingBottom:n,paddingLeft:o,paddingRight:s}=window.getComputedStyle(t),u={top:e?parseInt(e,10):0,bottom:n?parseInt(n,10):0,left:o?parseInt(o,10):0,right:s?parseInt(s,10):0},c={x:0,y:0,width:document.documentElement.offsetWidth,height:document.documentElement.offsetHeight};d({nativeEvent:{insets:u,frame:c}})};return t.addEventListener(u(),e),e(),()=>{document.body.removeChild(t),t.removeEventListener(u(),e)}},[d]),e.createElement(o.default,{style:n},t)};var t,e=(function(t){if(t&&t.__esModule)return t;var e={};return t&&Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),e.default=t,e})(r(_d[0])),n=r(_d[1]),o=(t=n)&&t.__esModule?t:{default:t};const d={WebkitTransition:'webkitTransitionEnd',Transition:'transitionEnd',MozTransition:'transitionend',MSTransition:'msTransitionEnd',OTransition:'oTransitionEnd'};let s=null;function u(){if(null!=s)return s;const t=document.createElement('invalidtype');s=d.Transition;for(const e in d)if(void 0!==t.style[e]){s=d[e];break}return s}let c=null;function f(){if(null!==c)return c;const{CSS:t}=window;return c=t&&t.supports&&t.supports('top: constant(safe-area-inset-top)')?'constant':'env',c}function l(t){return`${f()}(safe-area-inset-${t})`}function p(){const t=document.createElement('div'),{style:e}=t;return e.position='fixed',e.left='0',e.top='0',e.width='0',e.height='0',e.zIndex='-1',e.overflow='hidden',e.visibility='hidden',e.transitionDuration='0.05s',e.transitionProperty='padding',e.transitionDelay='0s',e.paddingTop=l('top'),e.paddingBottom=l('bottom'),e.paddingLeft=l('left'),e.paddingRight=l('right'),t}},109,[11,13]); 136__d(function(g,_r,i,a,m,_e,_d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SafeAreaView",{enumerable:!0,get:function(){return l}});var e=(function(t){if(t&&t.__esModule)return t;var e={};return t&&Object.keys(t).forEach(function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}),e.default=t,e})(_r(_d[0])),r=t(_r(_d[1])),n=t(_r(_d[2])),o=_r(_d[3]);function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},d.apply(null,arguments)}const u={top:'additive',left:'additive',bottom:'additive',right:'additive'};function f(t,e,r){switch(r){case'maximum':return Math.max(e,t);case'additive':return e+t;default:return e}}const l=e.forwardRef(({style:t={},mode:l,edges:c,...p},s)=>{const b=(0,o.useSafeAreaInsets)(),h=e.useMemo(()=>null==c?u:Array.isArray(c)?c.reduce((t,e)=>(t[e]='additive',t),{}):c,[c]),v=e.useMemo(()=>{const e=r.default.flatten(t);if('margin'===l){const{margin:r=0,marginVertical:n=r,marginHorizontal:o=r,marginTop:d=n,marginRight:u=o,marginBottom:l=n,marginLeft:c=o}=e,p={marginTop:f(b.top,d,h.top),marginRight:f(b.right,u,h.right),marginBottom:f(b.bottom,l,h.bottom),marginLeft:f(b.left,c,h.left)};return[t,p]}{const{padding:r=0,paddingVertical:n=r,paddingHorizontal:o=r,paddingTop:d=n,paddingRight:u=o,paddingBottom:l=n,paddingLeft:c=o}=e,p={paddingTop:f(b.top,d,h.top),paddingRight:f(b.right,u,h.right),paddingBottom:f(b.bottom,l,h.bottom),paddingLeft:f(b.left,c,h.left)};return[t,p]}},[h.bottom,h.left,h.right,h.top,b.bottom,b.left,b.right,b.top,l,t]);return e.createElement(n.default,d({style:v},p,{ref:s}))})},110,[11,26,13,106]); 137__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"initialWindowMetrics",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"initialWindowSafeAreaInsets",{enumerable:!0,get:function(){return t}});const n=null,t=null},111,[]); 138__d(function(g,r,i,a,m,e,d){},112,[]); 139__d(function(g,r,i,a,m,e,d){"use strict";
139Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useFonts",{enumerable:!0,get:function(){return o.useFonts}});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[1]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var o=r(d[2])},113,[114,181,183]); 140__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"FontDisplay",{enumerable:!0,get:function(){return f.FontDisplay}}),_e.isLoaded=c,_e.getLoadedFonts=function(){return t.default.getLoadedFonts()},_e.isLoading=function(e){return e in l.loadPromises},_e.loadAsync=function(e,n){const t='undefined'==typeof window;if('object'==typeof e){if(n)return Promise.reject(new o.CodedError("ERR_FONT_API",`No fontFamily can be used for the provided source: ${n}. The second argument of \`loadAsync()\` can only be used with a \`string\` value as the first argument.`));const s=e,l=Object.keys(s);return t?(l.map(e=>(0,u.registerStaticFont)(e,s[e])),Promise.resolve()):Promise.all(l.map(e=>y(e,s[e]))).then(()=>{})}if(t)return(0,u.registerStaticFont)(e,n),Promise.resolve();return y(e,n)},_e.unloadAllAsync=async function(){if(!t.default.unloadAllAsync)throw new o.UnavailabilityError('expo-font','unloadAllAsync');if(Object.keys(l.loadPromises).length)throw new o.CodedError("ERR_UNLOAD",`Cannot unload fonts while they're still loading: ${Object.keys(l.loadPromises).join(', ')}`);(0,l.purgeCache)(),await t.default.unloadAllAsync()},_e.unloadAsync=async function(e,n){if(!t.default.unloadAsync)throw new o.UnavailabilityError('expo-font','unloadAsync');if('object'==typeof e){if(n)throw new o.CodedError("ERR_FONT_API",`No fontFamily can be used for the provided options: ${n}. The second argument of \`unloadAsync()\` can only be used with a \`string\` value as the first argument.`);const t=e,s=Object.keys(t);return void await Promise.all(s.map(e=>w(e,t[e])))}return await w(e,n)};var e,o=r(d[0]),n=r(d[1]),t=(e=n)&&e.__esModule?e:{default:e},s=r(d[2]),l=r(d[3]),u=r(d[4]),f=r(d[5]);function c(e){if('function'!=typeof t.default.isLoaded)throw new Error("expected ExpoFontLoader.isLoaded to be a function, was "+typeof t.default.isLoaded);return(0,l.isLoadedInCache)(e)||t.default.isLoaded(e)}async function y(e,n){if(!n)throw new o.CodedError("ERR_FONT_SOURCE",`Cannot load null or undefined font source: { "${e}": ${n} }. Expected asset of type \`FontSource\` for fontFamily of name: "${e}"`);if(c(e))return;if(l.loadPromises.hasOwnProperty(e))return l.loadPromises[e];const t=(0,s.getAssetForSource)(n);l.loadPromises[e]=(async()=>{try{await(0,s.loadSingleFontAsync)(e,t),(0,l.markLoaded)(e)}finally{delete l.loadPromises[e]}})(),await l.loadPromises[e]}async function w(e,n){if(c(e)){if((0,l.purgeFontFamilyFromCache)(e),!e)throw new o.CodedError("ERR_FONT_FAMILY","Cannot unload an empty name");if(!t.default.unloadAsync)throw new o.UnavailabilityError('expo-font','unloadAsync');await t.default.unloadAsync(e,n)}}},114,[115,158,163,179,180,160]); 141__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"EventEmitter",{enumerable:!0,get:function(){return t.EventEmitter}}),Object.defineProperty(_e,"NativeModule",{enumerable:!0,get:function(){return n.NativeModule}}),Object.defineProperty(_e,"SharedObject",{enumerable:!0,get:function(){return o.SharedObject}}),Object.defineProperty(_e,"SharedRef",{enumerable:!0,get:function(){return u.SharedRef}}),Object.defineProperty(_e,"Platform",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(_e,"uuid",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(_e,"requireNativeViewManager",{enumerable:!0,get:function(){return l.requireNativeViewManager}}),Object.defineProperty(_e,"CodedError",{enumerable:!0,get:function(){return E.CodedError}}),Object.defineProperty(_e,"UnavailabilityError",{enumerable:!0,get:function(){return w.UnavailabilityError}}),Object.defineProperty(_e,"LegacyEventEmitter",{enumerable:!0,get:function(){return k.LegacyEventEmitter}}),Object.defineProperty(_e,"NativeModulesProxy",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(_e,"installOnUIRuntime",{enumerable:!0,get:function(){return _.installOnUIRuntime}}),r(d[0]),r(d[1]),r(d[2]);var t=r(d[3]),n=r(d[4]),o=r(d[5]),u=r(d[6]),c=e(r(d[7])),f=e(r(d[8])),l=r(d[9]),b=r(d[10]);Object.keys(b).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return b[e]}})});var y=r(d[11]);
141Object.keys(y).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return y[e]}})});var O=r(d[12]);Object.keys(O).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return O[e]}})});var p=r(d[13]);Object.keys(p).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return p[e]}})});var j=r(d[14]);Object.keys(j).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return j[e]}})});var P=r(d[15]);Object.keys(P).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return P[e]}})});var s=r(d[16]);Object.keys(s).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return s[e]}})});var h=r(d[17]);Object.keys(h).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return h[e]}})});var v=r(d[18]);Object.keys(v).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return v[e]}})});var E=r(d[19]),w=r(d[20]),k=r(d[21]),M=e(r(d[22])),_=r(d[23])}
141,115,[116,121,122,130,132,133,134,135,125,138,141,142,143,144,145,146,147,148,149,140,139,150,156,157]); 142__d(function(g,r,i,a,m,e,d){"use strict";r(d[0]),r(d[1]),r(d[2]),r(d[3])},116,[117,118,119,120]); 143__d(function(g,r,i,a,m,e,d){},117,[]); 144__d(function(g,r,i,a,m,e,d){},118,[]); 145__d(function(g,r,i,a,m,e,d){},119,[]); 146__d(function(g,r,i,a,m,e,d){},120,[]); 147__d(function(g,r,i,a,m,e,d){},121,[]); 148__d(function(g,r,i,a,m,e,d){"use strict";(0,r(d[0]).installExpoGlobalPolyfill)()},122,[123]); 149__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.installExpoGlobalPolyfill=function(){if(globalThis.expo)return;globalThis.expo={EventEmitter:o.EventEmitter,NativeModule:o.NativeModule,SharedObject:o.SharedObject,SharedRef:o.SharedRef,modules:globalThis.ExpoDomWebView?.expoModulesProxy??{},uuidv4:l.default.v4,uuidv5:l.default.v5,getViewConfig:()=>{throw new Error('Method not implemented.')},reloadAppAsync:async()=>{window.location.reload()},expoModulesCoreVersion:void 0,cacheDir:void 0,documentsDir:void 0,installOnUIRuntime:e=>{throw new Error('Method not implemented.')}}};var e,o=r(d[0]),t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},n=r(d[2]);Object.keys(n).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return n[e]}})})},123,[124,125,116]); 150__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"EventEmitter",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"NativeModule",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"SharedObject",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SharedRef",{enumerable:!0,get:function(){return o}});class t{addListener(t,s){this.listeners||(this.listeners=new Map),this.listeners?.has(t)||this.listeners?.set(t,new Set);const n=this.listenerCount(t);return this.listeners?.get(t)?.add(s),0===n&&1===this.listenerCount(t)&&this.startObserving(t),{remove:()=>{this.removeListener(t,s)}}}removeListener(t,s){const n=this.listeners?.get(t)?.delete(s);0===this.listenerCount(t)&&n&&this.stopObserving(t)}removeAllListeners(t){const s=this.listenerCount(t);this.listeners?.get(t)?.clear(),s>0&&this.stopObserving(t)}emit(t,...s){new Set(this.listeners?.get(t)).forEach(t=>{try{t(...s)}catch(t){console.error(t)}})}listenerCount(t){return this.listeners?.get(t)?.size??0}startObserving(t){}stopObserving(t){}}class s extends t{}class n extends t{release(){}}class o extends n{nativeRefType='unknown'}},124,[]); 151__d(function(g,r,i,a,m,_e,d){"use strict";function _interopDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return _default}});var _libSha=r(d[0]),sha1=_interopDefault(_libSha),_libV=r(d[1]),v35=_interopDefault(_libV),_uuidTypes=r(d[2]);function uuidv4(){return'undefined'==typeof crypto&&'undefined'==typeof window?eval('require')('node:crypto').randomUUID():crypto.randomUUID()}const uuid={v4:uuidv4,v5:(0,v35.default)('v5',80,sha1.default),namespace:_uuidTypes.Uuidv5Namespace};var _default=uuid},125,[126,127,129]); 152__d(function(g,r,_i,_a,m,_e,_d){'use strict';function e(e,t,n,o){switch(e){case 0:return t&n^~t&o;case 1:case 3:return t^n^o;case 2:return t&n^t&o^n&o;default:return 0}}function t(e,t){return e<<t|e>>>32-t}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var n=function(n){const o=[1518500249,1859775393,2400959708,3395469782],c=[1732584193,4023233417,2562383102,271733878,3285377520];if('string'==typeof n){const e=unescape(encodeURIComponent(n));n=new Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t)}n.push(128);const l=n.length/4+2,f=Math.ceil(l/16),u=new Array(f);for(let e=0;e<f;e++){u[e]=new Array(16);for(let t=0;t<16;t++)u[e][t]=n[64*e+4*t]<<24|n[64*e+4*t+1]<<16|n[64*e+4*t+2]<<8|n[64*e+4*t+3]}u[f-1][14]=8*(n.length-1)/Math.pow(2,32),u[f-1][14]=Math.floor(u[f-1][14]),u[f-1][15]=8*(n.length-1)&4294967295;for(let n=0;n<f;n++){const l=new Array(80);for(let e=0;e<16;e++)l[e]=u[n][e];for(let e=16;e<80;e++)l[e]=t(l[e-3]^l[e-8]^l[e-14]^l[e-16],1);let f=c[0],a=c[1],s=c[2],h=c[3],i=c[4];for(let n=0;n<80;n++){const c=Math.floor(n/20),u=t(f,5)+e(c,a,s,h)+i+o[c]+l[n]>>>0;i=h,h=s,s=t(a,30)>>>0,a=f,f=u}c[0]=c[0]+f>>>0,c[1]=c[1]+a>>>0,c[2]=c[2]+s>>>0,c[3]=c[3]+h>>>0,c[4]=c[4]+i>>>0}return[c[0]>>24&255,c[0]>>16&255,c[0]>>8&255,255&c[0],c[1]>>24&255,c[1]>>16&255,c[1]>>8&255,255&c[1],c[2]>>24&255,c[2]>>16&255,c[2]>>8&255,255&c[2],c[3]>>24&255,c[3]>>16&255,c[3]>>8&255,255&c[3],c[4]>>24&255,c[4]>>16&255,c[4]>>8&255,255&c[4]]}},126,[]); 153__d(function(g,r,_i,a,m,_e,d){"use strict";
153Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};function o(e){const t=[];return e.replace(/[a-fA-F0-9]{2}/g,e=>(t.push(parseInt(e,16)),'')),t}function c(e){e=unescape(encodeURIComponent(e));const t=new Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function u(e,t,u){const f=function(e,f,s,i){const y=s&&i||0;if('string'==typeof e&&(e=c(e)),'string'==typeof f&&(f=o(f)),!Array.isArray(e))throw TypeError('value must be an array of bytes');if(!Array.isArray(f)||16!==f.length)throw TypeError('namespace must be uuid string or an Array of 16 byte values');const l=u(f.concat(e));if(l[6]=15&l[6]|t,l[8]=63&l[8]|128,s)for(let e=0;e<16;++e)s[y+e]=l[e];return(0,n.default)(l)};try{f.name=e}catch{}return f.DNS='6ba7b810-9dad-11d1-80b4-00c04fd430c8',f.URL='6ba7b811-9dad-11d1-80b4-00c04fd430c8',f}},127,[128]); 154__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});const t=[];for(let n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);var n=function(n,o){let u=o||0;const c=t;return[c[n[u++]],c[n[u++]],c[n[u++]],c[n[u++]],'-',c[n[u++]],c[n[u++]],'-',c[n[u++]],c[n[u++]],'-',c[n[u++]],c[n[u++]],'-',c[n[u++]],c[n[u++]],c[n[u++]],c[n[u++]],c[n[u++]],c[n[u++]]].join('')}},128,[]); 155__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"Uuidv5Namespace",{enumerable:!0,get:function(){return b}});let b=(function(b){return b.dns="6ba7b810-9dad-11d1-80b4-00c04fd430c8",b.url="6ba7b811-9dad-11d1-80b4-00c04fd430c8",b.oid="6ba7b812-9dad-11d1-80b4-00c04fd430c8",b.x500="6ba7b814-9dad-11d1-80b4-00c04fd430c8",b})({})},129,[]); 156__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"EventEmitter",{enumerable:!0,get:function(){return t}}),(0,r(d[0]).ensureNativeModulesAreInstalled)();const t=globalThis.expo.EventEmitter},130,[131]); 157__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ensureNativeModulesAreInstalled=function(){},r(d[0])},131,[122]); 158__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NativeModule",{enumerable:!0,get:function(){return t}}),(0,r(d[0]).ensureNativeModulesAreInstalled)();const t=globalThis.expo.NativeModule},132,[131]); 159__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SharedObject",{enumerable:!0,get:function(){return t}}),(0,r(d[0]).ensureNativeModulesAreInstalled)();const t=globalThis.expo.SharedObject},133,[131]); 160__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SharedRef",{enumerable:!0,get:function(){return t}}),(0,r(d[0]).ensureNativeModulesAreInstalled)();const t=globalThis.expo.SharedRef},134,[131]); 161__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e},s=r(d[1]);var u={OS:"web",select:'undefined'!=typeof window?t.default.select:function(e){return e.hasOwnProperty("web")?e.web:e.hasOwnProperty('default')?e.default:void 0},isDOMAvailable:s.isDOMAvailable,canUseEventListeners:s.canUseEventListeners,canUseViewport:s.canUseViewport,isAsyncDebugging:s.isAsyncDebugging}},135,[136,137]); 162__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t={OS:'web',select:t=>'web'in t?t.web:t.default,get isTesting(){return!1},get Version(){return'0.0.0'}}},136,[]); 163__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"isDOMAvailable",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"canUseEventListeners",{enumerable:!0,get:function(){return t}}
163),Object.defineProperty(e,"canUseViewport",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"isAsyncDebugging",{enumerable:!0,get:function(){return c}});const n='undefined'!=typeof window&&!!window.document?.createElement,t=n&&!(!window.addEventListener&&!window.attachEvent),o=n&&!!window.screen,c=!1},137,[]); 164__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.requireNativeViewManager=function(n,o){throw new t.UnavailabilityError('expo-modules-core','requireNativeViewManager')};var t=r(d[0])},138,[139]); 165__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"UnavailabilityError",{enumerable:!0,get:function(){return o}});var t=r(d[0]);r(d[1]);class o extends t.CodedError{constructor(t,o){super('ERR_UNAVAILABLE',`The method or property ${t}.${o} is not available on web, are you sure you've linked all the native dependencies properly?`)}}},139,[140,135]); 166__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CodedError",{enumerable:!0,get:function(){return t}});class t extends Error{constructor(t,o){super(o),this.code=t}}},140,[]); 167__d(function(g,r,i,a,m,e,d){"use strict";function o(o){return'object'==typeof globalThis.ExpoDomWebView&&null!=globalThis?.expo?.modules?globalThis.expo?.modules?.[o]??null:null}Object.defineProperty(e,'__esModule',{value:!0}),e.requireNativeModule=function(n){const l=o(n);if(null!=l)return l;if('undefined'==typeof window)return{};throw new Error(`Cannot find native module '${n}'`)},e.requireOptionalNativeModule=o},141,[]); 168__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.registerWebModule=function(s,l){if((0,o.ensureNativeModulesAreInstalled)(),!(l=l??s.name))throw new Error('Web module implementation is missing a name - it is either not a class or has been minified. Pass the name as a second argument to the `registerWebModule` function.');globalThis?.expo?.modules||(globalThis.expo.modules={});if(globalThis.expo.modules[l])return globalThis.expo.modules[l];return globalThis.expo.modules[l]=new s,globalThis.expo.modules[l]};var o=r(d[0])},142,[131]); 169__d(function(g,r,i,a,m,e,d){},143,[]); 170__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PermissionStatus",{enumerable:!0,get:function(){return t}});let t=(function(t){return t.GRANTED="granted",t.UNDETERMINED="undetermined",t.DENIED="denied",t})({})},144,[]); 171__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createPermissionHook=function(t){return n=>u(t,n)};var t=r(d[0]);function u(u,n){const c=(0,t.useRef)(!0),[s,o]=(0,t.useState)(null),{get:l=!0,request:f=!1,...h}=n||{},M=(0,t.useCallback)(async()=>{let t;return t=Object.keys(h).length>0?await u.getMethod(h):await u.getMethod(),c.current&&o(t),t},[u.getMethod]),b=(0,t.useCallback)(async()=>{let t;return t=Object.keys(h).length>0?await u.requestMethod(h):await u.requestMethod(),c.current&&o(t),t},[u.requestMethod]);return(0,t.useEffect)(function(){f&&b(),!f&&l&&M()},[l,f,b,M]),(0,t.useEffect)(function(){return c.current=!0,()=>{c.current=!1}},[]),[s,b,M]}},145,[11]); 172__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createSnapshotFriendlyRef=function(){return(0,t.createRef)()};var t=r(d[0])},146,[11]); 173__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useReleasingSharedObject=function(c,n){return(0,t.useReleasingSharedObjectWithLifecycle)({factory:c},n)};var t=r(d[0])},147,[148]); 174__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useReleasingSharedObjectWithLifecycle=function(u,c){const s=(0,n.useRef)(null),l=(0,n.useRef)(null),o=(0,n.useRef)(null),f=(0,n.useRef)(null),R=(0,n.useRef)(!1),h=(0,n.useRef)(c),p=(0,n.useRef)(u);p.current=u,null==s.current&&(s.current=p.current.factory());const y=(0,n.useMemo)(()=>{let n=s.current;const u={previousDependencies:h.current,dependencies:c};return n&&t(h.current,c)||(!n||(p.current.shouldRecreate?.(n,u)??!0)?(l.current=s.current,n=p.current.factory(),s.current=n):p.current.update&&(o.current={object:n,context:u}),h.current=c),n},c);function b(n){(p.current.release??(n=>
174n.release()))(n)}return(0,n.useEffect)(()=>{if(l.current){const n=l.current;l.current=null;const t=()=>b(n);f.current?f.current.then(t,t):t()}if(o.current){const n=o.current;o.current=null;const t=p.current.update?.(n.object,n.context);t instanceof Promise&&(f.current=t,t.then(()=>{f.current=null},n=>{f.current=null,console.error(n)}))}},c),(0,n.useMemo)(()=>{R.current=!0},[]),(0,n.useEffect)(()=>(R.current=!1,()=>{if(!R.current&&s.current){const n=s.current,t=()=>b(n);f.current?f.current.then(t,t):t()}}),[]),y};var n=r(d[0]);function t(n,t){return n.length===t.length&&t.every((t,u)=>t===n[u])}},148,[11]); 175__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.reloadAppAsync=async function(o="Reloaded from JS call"){await(globalThis.expo?.reloadAppAsync(o))}},149,[]); 176__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"LegacyEventEmitter",{enumerable:!0,get:function(){return o}});var t=e(r(d[0])),n=e(r(d[1]));r(d[2]);const s='@@nativeEmitterSubscription@@';class o{_listenerCount=0;constructor(e){if(e.__expo_module_name__)return e;this._nativeModule=e,this._eventEmitter=new n.default(e)}addListener(e,t){!this._listenerCount&&this._nativeModule.startObserving&&this._nativeModule.startObserving(),this._listenerCount++;const n=this._eventEmitter.addListener(e,t),o={[s]:n,remove:()=>{this.removeSubscription(o)}};return o}removeAllListeners(e){const n=this._eventEmitter.listenerCount?this._eventEmitter.listenerCount(e):this._eventEmitter.listeners(e).length;this._eventEmitter.removeAllListeners(e),this._listenerCount-=n,(0,t.default)(this._listenerCount>=0,"EventEmitter must have a non-negative number of listeners"),!this._listenerCount&&this._nativeModule.stopObserving&&this._nativeModule.stopObserving()}removeSubscription(e){const t=e,n=t[s];n&&('remove'in n&&n.remove?.(),this._listenerCount--,delete t[s],e.remove=()=>{},!this._listenerCount&&this._nativeModule.stopObserving&&this._nativeModule.stopObserving())}emit(e,...t){this._eventEmitter.emit(e,...t)}}},150,[151,152,136]); 177__d(function(g,r,i,_a,m,_e,_d){'use strict';m.exports=function(e,n,o,t,a,f,s,d){if(!e){var u;if(void 0===n)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[o,t,a,f,s,d],l=0;(u=new Error(n.replace(/%s/g,function(){return c[l++]}))).name='Invariant Violation'}throw u.framesToPop=1,u}}},151,[]); 178__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},152,[153]); 179__d(function(g,r,i,a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}}),r(d[0]);var t=e(r(d[1])),n=e(r(d[2]));class l{constructor(e){}addListener(e,n,l){var u;null==(u=this._nativeModule)||u.addListener(e);var s=t.default.addListener(e,n,l);return{remove:()=>{var e;null!=s&&(null==(e=this._nativeModule)||e.removeListeners(1),s.remove(),s=null)}}}removeListener(e,n){var l;null==(l=this._nativeModule)||l.removeListeners(1),t.default.removeListener(e,n)}emit(e){for(var n=arguments.length,l=new Array(n>1?n-1:0),u=1;u<n;u++)l[u-1]=arguments[u];t.default.emit(e,...l)}removeAllListeners(e){var l;(0,n.default)(null!=e,'`NativeEventEmitter.removeAllListener()` requires a non-null argument.'),null==(l=this._nativeModule)||l.removeListeners(this.listenerCount(e)),t.default.removeAllListeners(e)}listenerCount(e){return t.default.listenerCount(e)}}},153,[136,154,108]); 180__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=new((e=t)&&e.__esModule?e:{default:e}).default},154,[155]); 181__d(function(g,r,i,a,m,e,d){"use strict";
181Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});class t{constructor(){this._registry={}}addListener(t,s,l){var u=n(this._registry,t),o={context:l,listener:s,remove(){u.delete(o)}};return u.add(o),o}emit(t){var n=this._registry[t];if(null!=n){for(var s=arguments.length,l=new Array(s>1?s-1:0),u=1;u<s;u++)l[u-1]=arguments[u];for(var o=0,c=[...n];o<c.length;o++){var v=c[o];v.listener.apply(v.context,l)}}}removeAllListeners(t){null==t?this._registry={}:delete this._registry[t]}listenerCount(t){var n=this._registry[t];return null==n?0:n.size}}function n(t,n){var s=t[n];return null==s&&(s=new Set,t[n]=s),s}},155,[]); 182__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t={}},156,[]); 183__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.installOnUIRuntime=function(t){const o=globalThis?.expo?.installOnUIRuntime;if(!o)throw Error("Native method to install Expo Modules on the worklets UI runtime wasn't found in `expo-modules-core`.");o(t)}},157,[]); 184__d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}}),_e._createWebFontTemplate=v;var e,t=r(d[0]),n=r(d[1]),o=(e=n)&&e.__esModule?e:{default:e},s=r(d[2]),i=r(d[3]);function c(){if('undefined'==typeof window)return null;const e=w();return e.sheet?e.sheet:null}function l(){const e=c();if(e){const t=[...e.cssRules],n=[];for(let e=0;e<t.length;e++){const o=t[e];o instanceof CSSFontFaceRule&&n.push({rule:o,index:e})}return n}return[]}function u(e){const t=e?.trim();if(!t)return'';const n=t[0];return t.length>=2&&('"'===n||"'"===n)&&t.endsWith(n)?t.slice(1,-1).replace(/\\(.)/g,'$1'):t}function f(e,t){return l().filter(({rule:n})=>!(u(n.style.fontFamily)!==e||t&&t.display&&t.display!==n.style.fontDisplay))}const y={async unloadAllAsync(){if('undefined'==typeof window)return;const e=document.getElementById(h);e&&e instanceof HTMLStyleElement&&document.removeChild(e)},async unloadAsync(e,t){const n=c();if(!n)return;const o=f(e,t);for(const e of o.reverse())n.deleteRule(e.index)},getServerResources:()=>(0,i.getServerResourceDescriptors)().map(e=>{switch(e.type){case'style':return`<style id="${e.id}">${e.css}</style>`;case'link':return`<link rel="${e.rel}" href="${e.href}" as="${e.as}" crossorigin="${e.crossOrigin}" />`;default:return''}}).filter(Boolean),getServerResourceDescriptors:()=>(0,i.getServerResourceDescriptors)(),getLoadedFonts(){if('undefined'==typeof window)return(0,i.getLoadedServerFonts)();return l().map(({rule:e})=>u(e.style.fontFamily))},isLoaded:(e,t={})=>'undefined'==typeof window?(0,i.isServerFontLoaded)(e):f(e,t)?.length>0,loadAsync(e,n){if('undefined'==typeof window)return(0,i.addServerFont)({name:e,css:v(e,n),resourceId:n.uri}),Promise.resolve();if(!(document.head&&'function'==typeof document.head.appendChild))throw new t.CodedError('ERR_WEB_ENVIRONMENT',"The browser's `document.head` element doesn't support injecting fonts.");const s=w();document.head.appendChild(s);return f(e,n).length||E(e,n),F()?new o.default(e,{display:n.display}).load(n.testString??null,12e3):Promise.resolve()}};var p='undefined'==typeof window?y:(0,t.registerWebModule)(function(){return y},'ExpoFontLoader');const h='expo-generated-fonts';function w(){const e=document.getElementById(h);if(e&&e instanceof HTMLStyleElement)return e;const t=document.createElement('style');return t.id=h,t}const S=/^[a-zA-Z_-][\w-]*$/;function v(e,t){const n='string'==typeof t.display&&S.test(t.display)?t.display:s.FontDisplay.AUTO;return`@font-face{font-family:${JSON.stringify(e)};src:url(${JSON.stringify(t.uri)});font-display:${n}}`}function E(e,t){const n=v(e,t),o=w();if(o.styleSheet){const e=o;e.styleSheet.cssText=e.styleSheet.cssText?e.styleSheet.cssText+n:n}else{const e=document.createTextNode(n);o.appendChild(e)}return o}function F(){const{userAgent:e}=window.navigator,t=!!e.match(/iPad|iPhone/i),n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),o=e.includes('Edge'),s=e.includes('Trident');return!(n||t||o||s)}}
184,158,[115,159,160,161]); 185__d(function(_g,_r,i,_a,_m,_e,_d){!(function(){function e(e,t){document.addEventListener?e.addEventListener("scroll",t,!1):e.attachEvent("scroll",t)}function t(e){document.body?e():document.addEventListener?document.addEventListener("DOMContentLoaded",function t(){document.removeEventListener("DOMContentLoaded",t),e()}):document.attachEvent("onreadystatechange",function t(){"interactive"!=document.readyState&&"complete"!=document.readyState||(document.detachEvent("onreadystatechange",t),e())})}function n(e){this.g=document.createElement("div"),this.g.setAttribute("aria-hidden","true"),this.g.appendChild(document.createTextNode(e)),this.h=document.createElement("span"),this.i=document.createElement("span"),this.m=document.createElement("span"),this.j=document.createElement("span"),this.l=-1,this.h.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.i.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.j.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.m.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;",this.h.appendChild(this.m),this.i.appendChild(this.j),this.g.appendChild(this.h),this.g.appendChild(this.i)}function o(e,t){e.g.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+t+";"}function s(e){var t=e.g.offsetWidth,n=t+100;return e.j.style.width=n+"px",e.i.scrollLeft=n,e.h.scrollLeft=e.h.scrollWidth+100,e.l!==t&&(e.l=t,!0)}function d(t,n){function o(){var e=d;s(e)&&null!==e.g.parentNode&&n(e.l)}var d=t;e(t.h,o),e(t.i,o),s(t)}function a(e,t,n){t=t||{},n=n||window,this.family=e,this.style=t.style||"normal",this.weight=t.weight||"normal",this.stretch=t.stretch||"normal",this.context=n}var l=null,r=null,c=null,h=null;function u(e){return null===r&&(f(e)&&/Apple/.test(window.navigator.vendor)?(e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent),r=!!e&&603>parseInt(e[1],10)):r=!1),r}function f(e){return null===h&&(h=!!e.document.fonts),h}function m(e,t){var n=e.style,o=e.weight;if(null===c){var s=document.createElement("div");try{s.style.font="condensed 100px sans-serif"}catch(e){}c=""!==s.style.font}return[n,o,c?e.stretch:"","100px",t].join(" ")}a.prototype.load=function(e,s){var a=this,r=e||"BESbswy",c=0,h=s||3e3,p=(new Date).getTime();return new Promise(function(e,s){if(f(a.context)&&!u(a.context)){var w=new Promise(function(e,t){!(function n(){(new Date).getTime()-p>=h?t(Error(h+"ms timeout exceeded")):a.context.document.fonts.load(m(a,'"'+a.family+'"'),r).then(function(t){1<=t.length?e():setTimeout(n,25)},t)})()}),g=new Promise(function(e,t){c=setTimeout(function(){t(Error(h+"ms timeout exceeded"))},h)});Promise.race([g,w]).then(function(){clearTimeout(c),e(a)},s)}else t(function(){function t(){var t;(t=-1!=g&&-1!=v||-1!=g&&-1!=y||-1!=v&&-1!=y)&&((t=g!=v&&g!=y&&v!=y)||(null===l&&(t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),l=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))),t=l&&(g==x&&v==x&&y==x||g==E&&v==E&&y==E||g==b&&v==b&&y==b)),t=!t),t&&(null!==T.parentNode&&T.parentNode.removeChild(T),clearTimeout(c),e(a))}var u=new n(r),f=new n(r),w=new n(r),g=-1,v=-1,y=-1,x=-1,E=-1,b=-1,T=document.createElement("div");T.dir="ltr",o(u,m(a,"sans-serif")),o(f,m(a,"serif")),o(w,m(a,"monospace")),T.appendChild(u.g),T.appendChild(f.g),T.appendChild(w.g),a.context.document.body.appendChild(T),x=u.g.offsetWidth,E=f.g.offsetWidth,b=w.g.offsetWidth,(function e(){if((new Date).getTime()-p>=h)null!==T.parentNode&&T.parentNode.removeChild(T),s(Error(h+"ms timeout exceeded"));else{var n=a.context.document.hidden;!0!==n&&void 0!==n||(g=u.g.offsetWidth,v=f.g.offsetWidth,y=w.g.offsetWidth,t()),c=setTimeout(e,50)}})(),d(u,function(e){g=e,t()}),o(u,m(a,'"'+a.family+'",sans-serif')),d(f,function(e){v=e,t()}),o(f,m(a,'"'+a.family+'",serif')),d(w,function(e){y=e,t()}),o(w,m(a,'"'+a.family+'",monospace'))})})},"object"==typeof _m?_m.exports=a:(window.FontFaceObserver=a,window.FontFaceObserver.prototype.load=a.prototype.load)})()},159,[]); 186__d(function(g,r,i,a,m,e,d){"use strict";var t;
186Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"FontDisplay",{enumerable:!0,get:function(){return t}}),(function(t){t.AUTO="auto",t.SWAP="swap",t.BLOCK="block",t.FALLBACK="fallback",t.OPTIONAL="optional"})(t||(t={}))},160,[]); 187__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.withServerContext=function(n){if('undefined'!=typeof window)return n();return s().run(new Map,n)},e.addServerFont=function(n){const t=u();t.has(n.css)||t.set(n.css,n)},e.getServerResourceDescriptors=function(){const n=[...u().values()];if(!n.length)return[];const o=n.map(({css:n})=>n).join('\n'),s=[...new Set(n.map(({resourceId:n})=>n))];return[{css:o,id:t,type:'style'},...s.map(n=>({as:'font',crossOrigin:'',href:n,rel:'preload',type:'link'}))]},e.getLoadedServerFonts=function(){const n=s().getStore();if(!n)return[];return[...n.values()].map(({name:n})=>n)},e.isServerFontLoaded=function(n){const t=s().getStore();if(!t)return!1;for(const o of t.values())if(o.name===n)return!0;return!1};var n=r(d[0]);const t='expo-generated-fonts';let o=null;function s(){if('undefined'!=typeof window)throw new Error('expo-font server context is server-only and cannot be used in the browser.');return o||(o=new n.AsyncLocalStorage),o}function u(){const n=s().getStore();if(!n)throw new Error("expo-font server context accessed outside of withServerContext(). Wrap your server-side font usage in withServerContext(() => /* server code */).");return n}},161,[162]); 188__d(function(g,r,i,a,m,e,d){},162,[]); 189__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getAssetForSource=function(t){const e=f(t),n=l(t),o=c(t);e&&'string'==typeof e||y(e);return{uri:e,display:n,testString:o}},_e.loadSingleFontAsync=function(t,e){('object'!=typeof e||'string'!=typeof e.uri||e.downloadAsync)&&y(e);if('undefined'==typeof window)return u.default.loadAsync(t,e);try{return u.default.loadAsync(t,e)}catch{}return Promise.resolve()};var t,e=r(d[0]),n=r(d[1]),o=r(d[2]),u=(t=o)&&t.__esModule?t:{default:t},s=r(d[3]);function f(t){return'string'==typeof t?t||null:'number'==typeof t?f(e.Asset.fromModule(t)):'object'==typeof t&&'number'==typeof t.uri?f(t.uri):'object'==typeof t&&(t.uri||t.localUri||t.default)||null}function l(t){return'object'==typeof t&&'display'in t&&t.display||s.FontDisplay.AUTO}function c(t){if('object'==typeof t&&'testString'in t)return t.testString??void 0}function y(t){let e=typeof t;throw'object'===e&&(e=JSON.stringify(t,null,2)),new n.CodedError("ERR_FONT_SOURCE",`Expected font asset of type \`string | FontResource | Asset\` instead got: ${e}`)}},163,[164,115,158,160]); 190__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),r(d[0]);var t=r(d[1]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[2]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})},164,[165,166,178]); 191__d(function(g,r,i,a,m,_e,d){"use strict";var e,t=r(d[0]),s=r(d[1]),u=r(d[2]),o=(e=u)&&e.__esModule?e:{default:e};if(s.IS_ENV_WITH_LOCAL_ASSETS){(o.default.setCustomSourceTransformer||u.setCustomSourceTransformer)(function(e){try{if('fileHashes'in e.asset&&e.asset.fileHashes){const s=t.Asset.fromMetadata(e.asset);return s.uri.startsWith(t.ANDROID_EMBEDDED_URL_BASE_RESOURCE)?e.resourceIdentifierWithoutScale():e.fromSource(s.downloaded?s.localUri:s.uri)}return e.defaultAsset()}catch{return e.defaultAsset()}})}},165,[166,172,177]); 192__d(function(g,r,i,a,m,_e,_d){"use strict";function t(t){if(t&&t.__esModule)return t;var e={};return t&&Object.keys(t).forEach(function(s){var n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,n.get?n:{enumerable:!0,get:function(){return t[s]}})}),e.default=t,e}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ANDROID_EMBEDDED_URL_BASE_RESOURCE",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"Asset",{enumerable:!0,get:function(){return w}});var e=r(_d[0]);r(_d[1]);var s,n=r(_d[2]),h=t(r(_d[3])),o=r(_d[4]),l=t(r(_d[5])),u=r(_d[6]),d=r(_d[7]),c=r(_d[8]),f=(s=c)&&s.__esModule?s:{default:s};const y='file:///android_res/';class w{static byHash={};static byUri={};hash=null;localUri=null;width=null;height=null;downloading=!1;downloaded=!1;_downloadCallbacks=[];constructor({name:t,type:e,hash:s=null,uri:n,width:o,height:l}){this.name=t,this.type=e,this.hash=s,this.uri=n,'number'==typeof o&&(this.width=o),'number'==typeof l&&(this.height=l),s&&(this.localUri=(0,u.getLocalAssetUri)(s,e),this.localUri?.startsWith(y)?(this.uri=this.localUri,this.localUri=null):this.localUri&&(this.downloaded=!0)),t||(this.name=h.getFilename(n)),e||(this.t
192ype=h.getFileExtension(n))}static loadAsync(t){const e=Array.isArray(t)?t:[t];return Promise.all(e.map(t=>w.fromModule(t).downloadAsync()))}static fromModule(t){if('string'==typeof t)return w.fromURI(t);if('object'==typeof t&&'uri'in t&&'string'==typeof t.uri){const e=h.getFileExtension(t.uri);return new w({name:'',type:e.startsWith('.')?e.substring(1):e,hash:null,uri:t.uri,width:t.width,height:t.height})}const s=(0,e.getAssetByID)(t);if(!s)throw new Error(`Module "${t}" is missing from the asset registry`);if(!d.IS_ENV_WITH_LOCAL_ASSETS){const{uri:e}=(0,f.default)(t),n=new w({name:s.name,type:s.type,hash:s.hash,uri:e,width:s.width,height:s.height});return w.byHash[s.hash]=n,n}return w.fromMetadata(s)}static fromMetadata(t){const e=t.hash,s=w.byHash[e];if(s)return s;const{uri:h,hash:o}=(0,n.selectAssetSource)(t),l=new w({name:t.name,type:t.type,hash:o,uri:h,width:t.width,height:t.height});return w.byHash[e]=l,l}static fromURI(t){if(w.byUri[t])return w.byUri[t];let e='';if(t.indexOf(';base64')>-1)e=t.split(';')[0]?.split('/')[1]??'';else{const s=h.getFileExtension(t);e=s.startsWith('.')?s.substring(1):s}const s=new w({name:'',type:e,hash:null,uri:t});return w.byUri[t]=s,s}async downloadAsync(){if(this.downloaded)return this;if(this.downloading)return await new Promise((t,e)=>{this._downloadCallbacks.push({resolve:t,reject:e})}),this;this.downloading=!0;try{if(l.isImageType(this.type)){const{width:t,height:e,name:s}=await l.getImageInfoAsync(this.uri);this.width=t,this.height=e,this.name=s}else this.name=h.getFilename(this.uri);this.localUri=await(0,o.downloadAsync)(this.uri,this.hash,this.type),this.downloaded=!0,this._downloadCallbacks.forEach(({resolve:t})=>t())}catch(t){throw this._downloadCallbacks.forEach(({reject:e})=>e(t)),t}finally{this.downloading=!1,this._downloadCallbacks=[]}return this}}},166,[167,115,168,173,174,175,176,172,177]); 193__d(function(g,r,i,a,m,e,d){const s=[];m.exports={registerAsset:t=>s.push(t),getAssetByID:t=>s[t-1]}},167,[]); 194__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.selectAssetSource=function(e){const c=n.default.pickScale(e.scales,t.default.get()),u=e.scales.findIndex(e=>e===c),f=e.fileHashes?.[u]??e.fileHashes?.[0]??e.hash,l=e.fileUris?e.fileUris[u]??e.fileUris[0]:e.uri;if(l)return{uri:h(l),hash:f};const p=1===c?'':`@${c}x`,U=e.type?`.${encodeURIComponent(e.type)}`:'',v=`/${encodeURIComponent(e.name)}${p}${U}`,x=new URLSearchParams({platform:"web",hash:e.hash});if(/^https?:\/\//.test(e.httpServerLocation)){return{uri:e.httpServerLocation+v+'?'+x,hash:f}}const L=(0,o.getManifest2)(),R=o.manifestBaseUrl?.startsWith('https://')?'https://':'http://',S=L?.extra?.expoGo?.developer?R+L.extra.expoGo.debuggerHost:null;if(S){const t=new URL(e.httpServerLocation+v,S);return t.searchParams.set('platform',"web"),t.searchParams.set('hash',e.hash),{uri:t.href,hash:f}}if(s.default.ExponentKernel)return{uri:`https://classic-assets.eascdn.net/~assets/${encodeURIComponent(f)}`,hash:f};return{uri:'',hash:f}},_e.resolveUri=h,r(d[0]);var t=e(r(d[1])),s=e(r(d[2])),n=e(r(d[3])),o=r(d[4]);function h(e){return o.manifestBaseUrl?new URL(e,o.manifestBaseUrl).href:e}},168,[115,169,170,171,172]); 195__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e};class n{static get(){return u.default.get('window').scale}static getFontScale(){return u.default.get('window').fontScale||n.get()}static getPixelSizeForLayoutSize(e){return Math.round(e*n.get())}static roundToNearestPixel(e){var t=n.get();return Math.round(e*t)/t}}},169,[107]); 196__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u={UIManager:((e=t)&&e.__esModule?e:{default:e}).default}},170,[88]); 197__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}}),r(d[0]);
197var e,t=r(d[1]),s=(e=t)&&e.__esModule?e:{default:e};function c(e){const t=n.pickScale(e.scales,s.default.get()),c=1===t?'':'@'+t+'x',o=e.type?`.${e.type}`:'';return e.httpServerLocation.replace(/\.\.\//g,'_')+'/'+e.name+c+o}class n{constructor(e,t,s){this.serverUrl=e||'https://expo.dev',this.jsbundleUrl=null,this.asset=s}isLoadedFromServer(){return!0}isLoadedFromFileSystem(){return!1}defaultAsset(){return this.assetServerURL()}assetServerURL(){const e=new URL(c(this.asset),this.serverUrl);return e.searchParams.set('platform',"web"),e.searchParams.set('hash',this.asset.hash),this.fromSource(e.toString().replace(e.origin,''))}fromSource(e){return{__packager_asset:!0,width:this.asset.width??void 0,height:this.asset.height??void 0,uri:e,scale:n.pickScale(this.asset.scales,s.default.get())}}static pickScale(e,t){for(const s of e)if(s>=t)return s;return e[e.length-1]||1}}},171,[115,169]); 198__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IS_ENV_WITH_LOCAL_ASSETS",{enumerable:!0,get:function(){return t}}),e.getLocalAssets=function(){return{}},e.getManifest2=function(){return{}},Object.defineProperty(e,"manifestBaseUrl",{enumerable:!0,get:function(){return n}});const t=!1;const n=null},172,[]); 199__d(function(g,r,i,a,m,e,d){"use strict";function t(t){const{pathname:s,searchParams:o}=new URL(t,'https://e');return n(s)}function n(t){return t.substring(t.lastIndexOf('/')+1)}Object.defineProperty(e,'__esModule',{value:!0}),e.getFilename=t,e.getFileExtension=function(n){const s=t(n),o=s.lastIndexOf('.');return o>0?s.substring(o):''},e.getManifestBaseUrl=function(t){const n=new URL(t);let s=n.protocol;'exp:'===s?s='http:':'exps:'===s&&(s='https:');n.protocol=s;const o=n.pathname.substring(0,n.pathname.lastIndexOf('/')+1);return n.pathname=o,n.search='',n.hash='',n.protocol!==s?n.href.replace(n.protocol,s):n.href}},173,[]); 200__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.downloadAsync=async function(n,t,c){return n}},174,[]); 201__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isImageType=function(n){return/^(jpeg|jpg|gif|png|bmp|webp|heic)$/i.test(n)},e.getImageInfoAsync=function(t){if('undefined'==typeof window)return Promise.resolve({name:(0,n.getFilename)(t),width:0,height:0});return new Promise((o,u)=>{const s=new Image;s.onerror=u,s.onload=()=>{o({name:(0,n.getFilename)(t),width:s.naturalWidth,height:s.naturalHeight})},s.src=t})};var n=r(d[0])},175,[173]); 202__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getLocalAssetUri=function(t,n){return null}},176,[]); 203__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}}),_e.setCustomSourceTransformer=c,Object.defineProperty(_e,"pickScale",{enumerable:!0,get:function(){return l}});var e,t=r(d[0]),n=r(d[1]),u=(e=n)&&e.__esModule?e:{default:e};let o;function c(e){o=e}function f(e){if('object'==typeof e)return e;const n=(0,t.getAssetByID)(e);if(!n)return null;const c=new u.default('https://expo.dev',null,n);return o?o(c):c.defaultAsset()}Object.defineProperty(f,'setCustomSourceTransformer',{get:()=>c});var s=f;const{pickScale:l}=u.default},177,[167,171]); 204__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useAssets=function(u){const[c,n]=(0,t.useState)(),[o,f]=(0,t.useState)();return(0,t.useEffect)(()=>{s.Asset.loadAsync(u).then(n).catch(f)},[]),[c,o]};var t=r(d[0]),s=r(d[1])},178,[11,166]); 205__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"loadPromises",{enumerable:!0,get:function(){return o}}),_e.markLoaded=function(e){u[e]=!0},_e.isLoadedInCache=c,_e.isLoadedNative=function(e){if(c(e))return!0;{const n=t.default.getLoadedFonts();return!!n?.length&&(n.forEach(e=>{u[e]=!0}),e in u)}},_e.purgeFontFamilyFromCache=function(e){delete u[e]},_e.purgeCache=function(){u={}};
205var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e};const o={};let u={};function c(e){return e in u}},179,[158]); 206__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"withServerContext",{enumerable:!0,get:function(){return u.withServerContext}}),_e.getServerResources=function(){if(!n.default.getServerResources)throw new t.UnavailabilityError('expo-font','getServerResources');return n.default.getServerResources()},_e.getServerResourceDescriptors=function(){if(!n.default.getServerResourceDescriptors)throw new t.UnavailabilityError('expo-font','getServerResourceDescriptors');return n.default.getServerResourceDescriptors()},_e.registerStaticFont=function(e,o){if(!o)throw new t.CodedError("ERR_FONT_SOURCE",`Cannot load null or undefined font source: { "${e}": ${o} }. Expected asset of type \`FontSource\` for fontFamily of name: "${e}"`);const n=(0,s.getAssetForSource)(o);(0,s.loadSingleFontAsync)(e,n)};var e,t=r(d[0]),o=r(d[1]),n=(e=o)&&e.__esModule?e:{default:e},s=r(d[2]),u=r(d[3])},180,[115,158,163,161]); 207__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.renderToImageAsync=async function(e,l){if(!t.default)throw new o.UnavailabilityError('expo-font','ExpoFontUtils.renderToImageAsync');return await t.default.renderToImageAsync(e,{...l,color:l?.color?(0,n.default)(l.color):void 0})};var o=r(d[0]),n=e(r(d[1])),t=e(r(d[2]))},181,[115,33,182]); 208__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});var t=r(d[0]);class n extends t.NativeModule{async renderToImageAsync(n,o){throw new t.UnavailabilityError('expo-font','renderToImageAsync')}}var o=(0,t.registerWebModule)(n,'ExpoFontUtils')},182,[115]); 209__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"useFonts",{enumerable:!0,get:function(){return o}});var t=r(d[0]),n=r(d[1]);function u(t){return'string'==typeof t?(0,n.isLoaded)(t):Object.keys(t).every(t=>(0,n.isLoaded)(t))}const o='undefined'==typeof window?function(t){return(0,n.loadAsync)(t),[!0,null]}:function(o){const[c,s]=(0,t.useState)(u(o)),[f,l]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;return(0,n.loadAsync)(o).then(()=>{t&&s(!0)}).catch(n=>{t&&l(n)}),()=>{t=!1}},[]),[c,f]}},183,[11,114]); 210__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"Manrope_700Bold",{enumerable:!0,get:function(){return t}});const t=r(d[0])},184,[185]); 211__d(function(g,r,i,a,m,e,d){m.exports="/assets/node_modules/@expo-google-fonts/manrope/700Bold/Manrope_700Bold.8e8fe178c0f147b91ed2a2b3097ad8a4.ttf"},185,[]); 212__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"Inter_400Regular",{enumerable:!0,get:function(){return t}});const t=r(d[0])},186,[187]); 213__d(function(e,o,t,d,n,s,a){n.exports="/assets/node_modules/@expo-google-fonts/inter/400Regular/Inter_400Regular.51b6ad87261f18b6433ec52871ddfabc.ttf"},187,[]); 214__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"Inter_500Medium",{enumerable:!0,get:function(){return t}});const t=r(d[0])},188,[189]); 215__d(function(e,d,o,t,b,n,s){b.exports="/assets/node_modules/@expo-google-fonts/inter/500Medium/Inter_500Medium.137ab18bace28dd0bd83eb3b8ed2bc54.ttf"},189,[]); 216__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"Inter_600SemiBold",{enumerable:!0,get:function(){return t}});const t=r(d[0])},190,[191]); 217__d(function(e,o,d,t,f,n,s){f.exports="/assets/node_modules/@expo-google-fonts/inter/600SemiBold/Inter_600SemiBold.a5f35888d2da465de352e0dcfaf33324.ttf"},191,[]); 218__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SourceSerif4_400Regular",{enumerable:!0,get:function(){return t}});const t=r(d[0])},192,[193]); 219__d(function(e,o,a,s,f,r,t){f.exports="/assets/node_modules/@expo-google-fonts/source-serif-4/400Regular/SourceSerif4_400Regular.d73629837cb80aa0a18f9e4706efea3a.ttf"},193,[]); 220__d(function(g,r,i,a,m,e,d){"use strict";
220Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"JetBrainsMono_500Medium",{enumerable:!0,get:function(){return t}});const t=r(d[0])},194,[195]); 221__d(function(g,r,i,a,m,e,d){m.exports="/assets/node_modules/@expo-google-fonts/jetbrains-mono/500Medium/JetBrainsMono_500Medium.9200bf1d80f2f4947b496a2e6ab2e224.ttf"},195,[]); 222__d(function(g,r,i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"initialWorkspace",{enumerable:!0,get:function(){return l}}),_e.useProduct=function(){return(0,e.useContext)(d)},_e.ProductProvider=function({children:t}){const s=(0,e.useRef)(()=>{}),u=(0,e.useCallback)(()=>s.current(),[]);return(0,a.jsx)(n.ActiveSymbolProvider,{onWrite:u,children:(0,a.jsx)(m,{writeRef:s,children:t})})};var e=r(_d[0]),t=r(_d[1]),s=r(_d[2]),u=r(_d[3]),n=r(_d[4]),c=r(_d[5]),a=r(_d[6]);const l={selected:'',tab:'setup',listOffset:0,sort:'return',positive:!0,verdict:'all'},{selected:o,...f}=l,d=(0,e.createContext)(null);function m({children:l,writeRef:o}){const m=(0,s.useAuth)(),p=!!m.user?.onboarded&&!!m.billing?.access?m.user.id:'',y=(0,e.useRef)(0),v=(0,n.useActiveSymbol)(),{active:h,setActive:S,reset:b}=v,P=m.user?.preferences?.timeframes,D=Array.isArray(P)?P.join(','):'',[O,k]=(0,e.useState)(null),[R,_]=(0,e.useState)([]),[E,w]=(0,e.useState)(null),A='research'===O?.pattern_set,C=(0,e.useMemo)(()=>{const e=(0,u.discoverDefaults)(D?D.split(','):[]);return A?{...e,minimum:0}:e},[D,A]),[I,j]=(0,e.useState)({plans:[],events:[]}),[N,x]=(0,e.useState)(''),[M,T]=(0,e.useState)(!0),[F,W]=(0,e.useState)(C),[J,L]=(0,e.useState)(''),Y=(0,e.useRef)(C);(0,e.useEffect)(()=>{const e=Y.current;e!==C&&(Y.current=C,W(t=>JSON.stringify(t)===JSON.stringify(e)?C:t))},[C]);const[q,Q]=(0,e.useState)(null),[U,z]=(0,e.useState)(null),[B,G]=(0,e.useState)(!1),[H,K]=(0,e.useState)(''),V=(0,e.useRef)(!1),[X,Z]=(0,e.useState)(null),[$,ee]=(0,e.useState)(f),[te,re]=(0,e.useState)('');o.current=()=>re('');const[se,ue]=(0,e.useState)(null),ne=te||h?.matchId||'',ce=(0,e.useMemo)(()=>({...$,selected:ne}),[$,ne]),ae=(0,e.useRef)(ce);ae.current=ce;const le=(0,e.useRef)(R);le.current=R;const ie=(0,e.useCallback)(e=>{if(!e){re('');const e=v.active;return void(e?.matchId&&S({symbol:e.symbol,timeframe:e.timeframe,source:e.source},{replace:!0}))}const t=le.current.find(t=>t.id===e),s=t?{symbol:t.symbol,timeframe:t.timeframe}:(0,n.parseMatchId)(e);s&&S({symbol:s.symbol,timeframe:s.timeframe,matchId:e,source:'discover'})?re(''):re(e)},[S,v.active]),oe=(0,e.useCallback)(e=>{const t=ae.current,s={...'function'==typeof e?e(t):e};ae.current=s;const{selected:u,...n}=s;ee(n),(u||'')!==(t.selected||'')&&ie(u||'')},[ie]);(0,e.useEffect)(()=>{if(!te)return;const e=R.find(e=>e.id===te);e&&S({symbol:e.symbol,timeframe:e.timeframe,matchId:e.id,source:'discover'})&&re('')},[te,R,S]);const[fe,de]=(0,e.useState)({}),me=(0,e.useRef)(null),pe=(0,e.useMemo)(()=>(0,c.researchInfo)(O,{error:N}),[O,N]),ye=(0,e.useRef)(null);ye.current=pe.status;const ve=(0,e.useRef)(0),he=(0,e.useCallback)(async()=>{if(!p||V.current)return;const e=y.current;V.current=!0,ve.current=Date.now();try{const s=e=>e.catch(e=>{if(e?.code===c.NOT_DEPLOYED_CODE)return{available:!1,code:c.NOT_DEPLOYED_CODE,message:e.message};throw e}),u=(0,c.shouldPollScanner)(ye.current),[n,a,l,o]=await Promise.all([s((0,t.api)('/api/state')),u?s((0,t.api)('/api/matches?min_trades=0')):Promise.resolve(null),u?s((0,t.api)('/api/filter-options')):Promise.resolve(null),(0,t.api)('/api/product')]);if(e!==y.current)return;k(n);if((0,c.isNotDeployed)(n)||!u)return _([]),w(null),j(o),void x('');_(Array.isArray(a)?a:[]),w((0,c.isNotDeployed)(l)?null:l),j(o),x('')}catch(t){e===y.current&&(x(t.message||'Unable to connect'),[401,402,403].includes(t.status)&&m.refresh())}finally{e===y.current&&(T(!1),V.current=!1)}},[p]),Se=(0,e.useCallback)(async()=>{if(!p)return;const e=y.current,s=await(0,t.api)('/api/product');e===y.current&&j(s)},[p]);return(0,e.useEffect)(()=>{y.current++,V.current=!1,k(null),_([]),w(null),j({plans:[],events:[],watchlist:[]}),Q(null),z(null),Z(null),G(!1),L(''),W(C),ee(f),re(''),ue(null),me.current&&me.current!==p&&b(),me.current=p,de({}),x(''),T(!!p),p&&he();const e=setInterval(()=>{('not_deployed'!==ye.current||(0,c.pollDue)(ye.current,ve.current,Date.now()))&&he()},6e4);return()=>{y.current++,clearInterval(e)}},[p,he]),(0,e.useEffect)(()=>
222{if(H){const e=setTimeout(()=>K(''),5e3);return()=>clearTimeout(e)}},[H]),(0,a.jsx)(d.Provider,{value:{state:O,matches:R,options:E,product:I,error:N,loading:M,research:pe,refresh:he,refreshProduct:Se,filters:F,setFilters:W,defaultFilters:C,query:J,setQuery:L,detail:q,setDetail:Q,plan:U,setPlan:z,filterOpen:B,setFilterOpen:G,toast:H,setToast:K,stock:X,setStock:Z,workspace:ce,setWorkspace:oe,studyDraft:fe,setStudyDraft:de,autoPick:se,setAutoPick:ue},children:l})}},196,[11,197,198,248,251,820,6]); 223__d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"initialFilters",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"sectorName",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"bands",{enumerable:!0,get:function(){return r}}),e.eligible=o,e.histories=s,e.searchText=u,e.filterMatches=function(t,r,o=""){const l=u(o).split(' ').filter(Boolean);return t.filter(t=>('All'===r.timeframe||t.timeframe===r.timeframe)&&('all'===r.direction||t.direction===r.direction)&&(!r.current||t.current)&&(!r.sector||n(t.sector)===n(r.sector))&&(!r.universe||t.universes.includes(r.universe))&&(!r.patterns?.length||r.patterns.includes(t.pattern))&&l.every(n=>u(`${t.symbol} ${t.company} ${t.pattern_name} ${t.timeframe}`).includes(n))&&(s(t,r).length>0||0===r.minimum&&!r.band&&!t.history.length))},e.pct=function(t,n=2){return null!=t&&Number.isFinite(t)?`${t>0?'+':''}${t.toFixed(n)}%`:'\u2014'},e.money=function(t,n=0){return null==t?'\u2014':'\u20b9'+t.toLocaleString('en-IN',{minimumFractionDigits:n,maximumFractionDigits:n})},e.dateText=function(t){if(!t)return'Unavailable';return new Date(t.slice(0,10)+'T12:00:00').toLocaleDateString('en-GB',{day:'numeric',month:'short',year:'numeric'})},e.dateTimeText=function(t){if(null==t||''===t||0===t)return'Unavailable';const n='number'==typeof t?t<1e12?1e3*t:t:Date.parse(t);if(!Number.isFinite(n))return'Unavailable';const r=new Date(n+198e5),o=t=>String(t).padStart(2,'0');return`${r.getUTCDate()} ${l[r.getUTCMonth()]} ${r.getUTCFullYear()} \xb7 ${o(r.getUTCHours())}:${o(r.getUTCMinutes())} IST`},Object.defineProperty(e,"apiBase",{enumerable:!0,get:function(){return c}}),e.setApiSession=function(t="",n=""){m=t,d=n},Object.defineProperty(e,"ApiError",{enumerable:!0,get:function(){return f}}),e.api=async function(t,n,r={},o){const s=new AbortController,u=setTimeout(()=>s.abort(),3e4),l=()=>s.abort();o&&(o.aborted?s.abort():o.addEventListener('abort',l));try{const o=await fetch(c+t,{signal:s.signal,credentials:'include',headers:{...n?{'Content-Type':'application/json'}:{},...m?{Authorization:'Bearer '+m}:{},...d?{'X-Kanida-CSRF':d}:{},...r},...n?{method:'POST',body:JSON.stringify(n)}:{}}),u=await o.json();if(!o.ok)throw new f(u.error||'Unable to load KANIDA',o.status,u.code||'REQUEST_FAILED');return u}finally{clearTimeout(u),o&&o.removeEventListener('abort',l)}},e.apiSend=async function(t,n,r,o={}){const s=new AbortController,u=setTimeout(()=>s.abort(),3e4);try{const u=await fetch(c+t,{method:n,signal:s.signal,credentials:'include',headers:{...void 0!==r?{'Content-Type':'application/json'}:{},...m?{Authorization:'Bearer '+m}:{},...d?{'X-Kanida-CSRF':d}:{},...o},...void 0!==r?{body:JSON.stringify(r)}:{}});let l=null;try{l=await u.json()}catch{l=null}return{ok:u.ok,status:u.status,data:l}}catch{return{ok:!1,status:0,data:null}}finally{clearTimeout(u)}},e.cellQuery=function(t,n){return`symbol=${encodeURIComponent(t.symbol)}&timeframe=${t.timeframe}&pattern=${t.pattern}&side=${n}`},e.sizing=function(t,n,r,o,s,u=.4){if(![t,n,r,o,s].every(Number.isFinite)||Math.min(t,n,r,o,s)<=0)return{shares:0,notional:0,cost:0,loss:0};const l=Math.max(0,Math.min(Math.floor(r/(t*(1+u/100))),Math.floor(n*o/100/(t*(s+u)/100))));return{shares:l,notional:l*t,cost:l*t*u/100,loss:l*t*(s+u)/100}},_r(_d[0]);const t={timeframe:'All',direction:'all',band:'',minimum:10,sector:'',universe:'',current:!1,patterns:[]},n=t=>['it','information technology'].includes((t||'').toLowerCase())?'Information Technology':t,r=[['','Any return'],['0_0.5','0\u20130.5%'],['0.5_1','0.5\u20131%'],['1_2','1\u20132%'],['2_5','2\u20135%'],['5_10','5\u201310%'],['over_10','Over 10%']];function o(t,n){const r=t.reference;return(r.n||0)>=n.minimum&&(!n.band||(r.n||0)>0&&r.return_band===n.band)}function s(t,n){return t.history.filter(t=>o(t,n))}function u(t){return t.toLowerCase().replace(/&/g,' and ').replace(/\b(1|4)\s*(hour|hours|hr)\b/g,'$1h').replace(/\bdaily\b/g,'1d').replace(/\bweekly\b/g,'1w').replace(/[^a-z0-9]+/g,' ').trim()}const l=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];const c='';let m='',d='';
223class f extends Error{constructor(t,n,r){super(t),this.status=n,this.code=r}}},197,[136]); 224__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var c=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,c.get?c:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useAuth",{enumerable:!0,get:function(){return d}}),_e.AuthProvider=function({children:e}){const[n,c]=(0,t.useState)(null),[d,v]=(0,t.useState)(null),[h,w]=(0,t.useState)(null),[y,S]=(0,t.useState)(!1),[b,A]=(0,t.useState)(''),[_,P]=(0,t.useState)(null),E=(0,t.useRef)(''),j=(0,t.useRef)(0),O=(0,t.useCallback)(async()=>{const e=j.current;try{const[t,n]=await Promise.all([(0,l.api)('/api/pilot/config'),(0,l.api)('/api/auth/me')]);if(e!==j.current)return;v(t),c(n.user),w(n.billing),(0,l.setApiSession)(E.current,n.csrf||''),A('')}catch(t){e===j.current&&A('The private pilot service is unavailable. Please reconnect.')}finally{e===j.current&&S(!0)}},[]);async function C(e){j.current++,(0,l.setApiSession)(E.current,e.csrf||''),await O()}return(0,t.useEffect)(()=>{let e=!0;return(async()=>{e&&await O()})().catch(()=>{A('Your secure session could not be opened. Please sign in again.'),S(!0)}),()=>{e=!1}},[]),(0,t.useEffect)(()=>{if(!y)return;const e=setInterval(O,6e4),t=o.default.addEventListener('change',e=>{'active'===e&&O()});return()=>{clearInterval(e),t.remove()}},[y,O]),(0,f.jsx)(p.Provider,{value:{user:n,config:d,billing:h,ready:y,error:b,refresh:O,signIn:async function(e){await C(await(0,l.api)('/api/auth/login',e,{}))},signUp:async function(e){await C(await(0,l.api)('/api/auth/register',e,{}))},signOut:async function(e=!1){await(0,l.api)('/api/auth/logout',{all_devices:e}),j.current++,E.current='',(0,l.setApiSession)(),c(null),w(null)},google:function(e=""){window.location.assign('/api/auth/google/start'+(e?'?invite='+encodeURIComponent(e):''))},device:_,finishDevice:async function(){if(!_)return;const e=await(0,l.api)('/api/auth/device/complete',{code:_.code,verifier:_.verifier});if(e.pending)throw Error('Approve the device in the browser first, then return here.');await C(e),P(null)},connectBrowser:async function(){const e=Array.from(u.getRandomBytes(32)).map(e=>e.toString(16).padStart(2,'0')).join(''),t=await u.digestStringAsync(u.CryptoDigestAlgorithm.SHA256,e,{encoding:u.CryptoEncoding.BASE64}),n=await(0,l.api)('/api/auth/device/start',{challenge:t.replace(/\+/g,'-').replace(/\//g,'_').replace(/=+$/,'')});P({...n,verifier:e}),await s.openBrowserAsync(n.url)}},children:e})},_e.openExternal=function(e){window.location.assign(e)};var t=r(_d[0]);r(_d[1]),r(_d[2]);var n,c=r(_d[3]),o=(n=c)&&n.__esModule?n:{default:n};r(_d[4]);var u=e(r(_d[5])),s=e(r(_d[6])),l=r(_d[7]),f=r(_d[8]);const p=(0,t.createContext)(null),d=()=>(0,t.useContext)(p)},198,[11,136,199,200,201,203,245,197,6]); 225__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}});var t=e(r(d[0])),n=e(r(d[1])),l=n.default?window.location.href:'';var o=(e,t)=>{if(n.default){var l=new URL(e,window.location).toString();0===l.indexOf('tel:')?window.location=l:window.open(l,t,'noopener')}},s=new class{constructor(){this._eventCallbacks={}}_dispatchEvent(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),l=1;l<t;l++)n[l-1]=arguments[l];var o=this._eventCallbacks[e];null!=o&&Array.isArray(o)&&o.map(e=>{e(...n)})}addEventListener(e,t){var n=this;return n._eventCallbacks[e]||(n._eventCallbacks[e]=[t]),n._eventCallbacks[e].push(t),{remove(){var l=n._eventCallbacks[e].filter(e=>e.toString()!==t.toString());n._eventCallbacks[e]=l}}}removeEventListener(e,t){console.error("Linking.removeEventListener('"+e+"', ...): Method has been deprecated. Please instead use `remove()` on the subscription returned by `Linking.addEventListener`.");var n=this._eventCallbacks[e].filter(e=>e.toString()!==t.toString());this._eventCallbacks[e]=n}canOpenURL(){return Promise.resolve(!0)}getInitialURL(){return Promise.resolve(l)}openURL(e,t){1===arguments.length&&(t='_blank');try{return o(e,t),this._dispatchEvent('onOpen',e),Promise.resolve()}catch(e){return Promise.reject(e)}}_validateURL(e){(0,t.default)('string'==typeof e,'Invalid URL: should be a string. Was: '+e),(0,t.default)(e,'Invalid URL: cannot be empty')}}},199,[108,35]); 226__d(function(g,r,i,a,m,_e,d){"use strict";
226function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var t=e(r(d[0])),n=e(r(d[1])),u=e(r(d[2])),c=u.default&&!document.hasOwnProperty('hidden')&&document.hasOwnProperty('webkitHidden'),s=['change','memoryWarning'],l=c?'webkitvisibilitychange':'visibilitychange',o=c?'webkitVisibilityState':'visibilityState',b='background',f='active',v=null;class h{static get currentState(){if(!h.isAvailable)return f;switch(document[o]){case'hidden':case'prerender':case'unloaded':return b;default:return f}}static addEventListener(e,u){if(h.isAvailable&&((0,t.default)(-1!==s.indexOf(e),'Trying to subscribe to unknown event: "%s"',e),'change'===e))return v||(v=new n.default,document.addEventListener(l,()=>{v&&v.emit('change',h.currentState)},!1)),v.addListener(e,u)}}h.isAvailable=u.default&&!!document[o]},200,[108,155,35]); 227__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"AFTER_FIRST_UNLOCK",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"ALWAYS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"WHEN_PASSCODE_SET_THIS_DEVICE_ONLY",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"ALWAYS_THIS_DEVICE_ONLY",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"WHEN_UNLOCKED",{enumerable:!0,get:function(){return _}}),Object.defineProperty(_e,"WHEN_UNLOCKED_THIS_DEVICE_ONLY",{enumerable:!0,get:function(){return s}}),_e.isAvailableAsync=async function(){return!!n.default.getValueWithKeyAsync},_e.deleteItemAsync=async function(e,t={}){y(e),await n.default.deleteValueWithKeyAsync(e,t)},_e.getItemAsync=async function(e,t={}){return y(e),await n.default.getValueWithKeyAsync(e,t)},_e.setItemAsync=async function(e,t,u={}){if(y(e),!S(t))throw new Error("Invalid value provided to SecureStore. Values must be strings; consider JSON-encoding your values if they are serializable.");await n.default.setValueWithKeyAsync(t,e,u)},_e.setItem=function(e,t,u={}){if(y(e),!S(t))throw new Error("Invalid value provided to SecureStore. Values must be strings; consider JSON-encoding your values if they are serializable.");return n.default.setValueWithKeySync(t,e,u)},_e.getItem=function(e,t={}){return y(e),n.default.getValueWithKeySync(e,t)},_e.canUseBiometricAuthentication=function(){return n.default.canUseBiometricAuthentication()};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};const u=n.default.AFTER_FIRST_UNLOCK,c=n.default.AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY,o=n.default.ALWAYS,l=n.default.WHEN_PASSCODE_SET_THIS_DEVICE_ONLY,f=n.default.ALWAYS_THIS_DEVICE_ONLY,_=n.default.WHEN_UNLOCKED,s=n.default.WHEN_UNLOCKED_THIS_DEVICE_ONLY;function y(e){if(!E(e))throw new Error("Invalid key provided to SecureStore. Keys must not be empty and contain only alphanumeric characters, \".\", \"-\", and \"_\".")}function E(e){return'string'==typeof e&&/^[\w.-]+$/.test(e)}function S(e){return'string'==typeof e}},201,[202]); 228__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t={}},202,[]); 229__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getRandomBytes=function(e){y(e,'getRandomBytes');const o=Math.floor(e);if(c.default.getRandomValues){const t=new Uint8Array(o);return c.default.getRandomValues(t),t}throw new t.UnavailabilityError('expo-crypto','getRandomBytes')},_e.getRandomBytesAsync=async function(e){y(e,'getRandomBytesAsync');const o=Math.floor(e);if(c.default.getRandomValues){const t=new Uint8Array(o);return c.default.getRandomValues(t),t}throw new t.UnavailabilityError('expo-crypto','getRandomBytesAsync')},_e.digestStringAsync=async function(o,n,s={encoding:e.CryptoEncoding.HEX}){if(!c.default.digestStringAsync)throw new t.UnavailabilityError('expo-crypto','digestStringAsync');return u(o),f(n),p(s.encoding),await c.default.digestStringAsync(o,n,s)},_e.getRandomValues=function(t){return c.default.getRandomValues(t),t},_e.randomUUID=function(){return c.default.randomUUID()},_e.digest=function(t,e){return new Promise((o,n)=>{try{if('function'==typeof c.default.digestAsync)o(c.default.digestAsync(t,e));else{const n=new Uint8Array(h[t]);c.default.digest(t,n,e),o(n.buffer)}}catch(t){n(t)}})};var t=r(d[0]),e=r(d[1]);Object.keys(e).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(_e,t)||Object.defineProperty(_e,t,{enumerable:!0,get:function(){return e[t]}})});var o,n=r(d[2]),c=(o=n)&&o.__esModule?o:{default:o},s=r(d[3]);
229Object.keys(s).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(_e,t)||Object.defineProperty(_e,t,{enumerable:!0,get:function(){return s[t]}})});class l extends TypeError{code='ERR_CRYPTO';constructor(t){super(`expo-crypto: ${t}`)}}function y(t,e){if('number'!=typeof t||isNaN(t)||Math.floor(t)<0||Math.floor(t)>1024)throw new TypeError(`expo-crypto: ${e}(${t}) expected a valid number from range 0...1024`)}function u(t){if(!Object.values(e.CryptoDigestAlgorithm).includes(t))throw new l(`Invalid algorithm provided. Expected one of: CryptoDigestAlgorithm.${Object.keys(e.CryptoDigestAlgorithm).join(', AlgCryptoDigestAlgorithmorithm.')}`)}function f(t){if('string'!=typeof t)throw new l("Invalid data provided. Expected a string.")}function p(t){if(!Object.values(e.CryptoEncoding).includes(t))throw new l(`Invalid encoding provided. Expected one of: CryptoEncoding.${Object.keys(e.CryptoEncoding).join(', CryptoEncoding.')}`)}const h={[e.CryptoDigestAlgorithm.SHA1]:20,[e.CryptoDigestAlgorithm.SHA256]:32,[e.CryptoDigestAlgorithm.SHA384]:48,[e.CryptoDigestAlgorithm.SHA512]:64,[e.CryptoDigestAlgorithm.MD2]:16,[e.CryptoDigestAlgorithm.MD4]:16,[e.CryptoDigestAlgorithm.MD5]:16}},203,[115,204,205,206]); 230__d(function(g,r,i,a,m,e,d){"use strict";var t,n;Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CryptoDigestAlgorithm",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"CryptoEncoding",{enumerable:!0,get:function(){return n}}),(function(t){t.SHA1="SHA-1",t.SHA256="SHA-256",t.SHA384="SHA-384",t.SHA512="SHA-512",t.MD2="MD2",t.MD4="MD4",t.MD5="MD5"})(t||(t={})),(function(t){t.HEX="hex",t.BASE64="base64"})(n||(n={}))},204,[]); 231__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var t=r(d[0]),n=r(d[1]);const o=()=>void 0!==globalThis.crypto?globalThis.crypto:'undefined'!=typeof window?window.crypto??window.msCrypto:crypto;var s={async digestStringAsync(s,u,y){const l=o();if(!l.subtle)throw new t.CodedError('ERR_CRYPTO_UNAVAILABLE','Access to the WebCrypto API is restricted to secure origins (localhost/https).');const p=(new TextEncoder).encode(u),w=await l.subtle.digest(s,p);if(y.encoding===n.CryptoEncoding.HEX)return c(w);if(y.encoding===n.CryptoEncoding.BASE64)return btoa(String.fromCharCode(...new Uint8Array(w)));throw new t.CodedError('ERR_CRYPTO_DIGEST','Invalid encoding type provided.')},getRandomBytes(t){const n=new Uint8Array(t);return o().getRandomValues(n)},async getRandomBytesAsync(t){const n=new Uint8Array(t);return o().getRandomValues(n)},getRandomValues:t=>o().getRandomValues(t),randomUUID:()=>o().randomUUID(),digestAsync:(t,n)=>o().subtle.digest(t,n)};function c(t){return[...new Uint8Array(t)].map(t=>t.toString(16).padStart(2,'0')).join('')}},205,[115,204]); 232__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"AESEncryptionKey",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"AESSealedData",{enumerable:!0,get:function(){return u}}),_e.aesEncryptAsync=function(e,t,o={}){const{nonce:c,additionalData:s,...u}=o;let l={...u};if(c){const e='bytes'in c?f(c.bytes,!0):c?.length;l={...l,nonce:e}}if(s){const e=f(s,!0);l={...l,additionalData:e}}return n.default.encryptAsync(f(e),t,l)},_e.aesDecryptAsync=function(e,t,o={}){const{additionalData:c,...s}=o,u={...s,additionalData:c?f(c,!0):void 0};return n.default.decryptAsync(e,t,u)};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(d[1]),c=r(d[2]);Object.keys(c).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return c[e]}})});class s extends n.default.EncryptionKey{}class u extends n.default.SealedData{static fromParts(e,t,o){const c=f(e),s=f(t);if(o&&'number'!=typeof o){const e=f(o);return n.default.SealedData.fromParts(c,s,e)}return n.default.SealedData.fromParts(c,s,o)}static fromCombined(e,t){const o=f(e);return n.default.SealedData.fromCombined(o,t)}}function f(e,t=!1){const n=e instanceof ArrayBuffer?new Uint8Array(e):e;return'string'!=typeof n&&t?(0,o.uint8ArrayToBase64)(n):n}},206,[207,244,243]); 233__d(function(g,r,i,a,m,e,d){"use strict";
233Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return l}});var t=r(d[0]),n=r(d[1]),s=r(d[2]),y=r(d[3]);const o=12,c=16,h={ivLength:o,tagLength:c};class u{constructor(t,n){this.key=t,this.keySize=n}static async generate(t){const n=t??s.AESKeySize.AES256,y={name:'AES-GCM',length:n},o=await crypto.subtle.generateKey(y,!0,['encrypt','decrypt']);return new u(o,n)}static async import(t,n){let s;s='string'==typeof t?'base64'===n?(0,y.base64ToUintArray)(t):(0,y.hexToUintArray)(t):t;const o=await crypto.subtle.importKey('raw',s,'AES-GCM',!0,['encrypt','decrypt']);return new u(o,8*s.byteLength)}async bytes(){const t=await crypto.subtle.exportKey('raw',this.key);return new Uint8Array(t)}async encoded(t){const n=await this.bytes();return'base64'===t?(0,y.uint8ArrayToBase64)(n):(0,y.bytesToHex)(n)}get size(){return this.keySize}}class b{constructor(t,n){this.bytes=t,this.config=n}static fromCombined(t,s){const o=(0,y.binaryInputBytes)(t),c=s??h,u=c.ivLength+c.tagLength;if(o.byteLength<u)throw new n.CodedError('ERR_INVALID_SEALED_DATA_CONFIG',`Sealed data is ${o.byteLength} bytes, which is too short to hold a ${c.ivLength}-byte IV and a ${c.tagLength}-byte authentication tag. Pass the whole combined output of encryptAsync, or set ivLength and tagLength in the config to match how the data was sealed.`);return new b(o,c)}static fromParts(t,n,s){const o=(0,y.binaryInputBytes)(n),h=(0,y.binaryInputBytes)(t),u=h.byteLength;if(s||(s=c),'number'==typeof s){const t=u+o.byteLength,n=new Uint8Array(t);n.set(h),n.set(o,u);return new b(n,{ivLength:u,tagLength:s})}const p=(0,y.binaryInputBytes)(s),l=p.byteLength,A=u+o.byteLength+l,L=new Uint8Array(A);return L.set(h),L.set(o,u),L.set(p,A-l),new b(L,{ivLength:u,tagLength:l})}get ivSize(){return this.config.ivLength}get tagSize(){return this.config.tagLength}get combinedSize(){return this.bytes.byteLength}async iv(t){const n='base64'===t,s=this.bytes.subarray(0,this.ivSize);return n?(0,y.uint8ArrayToBase64)(s):s}async tag(t){const n='base64'===t,s=this.combinedSize-this.tagSize,o=this.bytes.subarray(s,s+this.tagSize);return n?(0,y.uint8ArrayToBase64)(o):o}async combined(t){const n='base64'===t,s=this.bytes.subarray();return n?(0,y.uint8ArrayToBase64)(s):s}async ciphertext(t){const n=t?.includeTag??!1,s='base64'===t?.encoding,o=this.combinedSize-this.ivSize,c=n?o:o-this.tagSize,h=this.bytes.subarray(this.ivSize,this.ivSize+c);return s?(0,y.uint8ArrayToBase64)(h):h}}class p extends t.NativeModule{EncryptionKey=u;SealedData=b;async encryptAsync(t,n,s={}){const{nonce:h=o,tagLength:u=c,additionalData:p}=s,l='number'==typeof h?crypto.getRandomValues(new Uint8Array(h)):(0,y.binaryInputBytes)(h),A={name:'AES-GCM',iv:l,tagLength:8*u},L=p?{...A,additionalData:(0,y.binaryInputBytes)(p)}:A,w=await crypto.subtle.encrypt(L,n.key,(0,y.binaryInputBytes)(t));return b.fromParts(l,w,u)}async decryptAsync(t,n,s={}){const{additionalData:o,output:c}=s,h={name:'AES-GCM',iv:await t.iv(),tagLength:8*t.tagSize},u=o?{...h,additionalData:(0,y.binaryInputBytes)(o)}:h,b=await t.ciphertext({includeTag:!0}),p=await crypto.subtle.decrypt(u,n.key,b),l='base64'===c,A=new Uint8Array(p);return l?(0,y.uint8ArrayToBase64)(A):A}}var l=(0,t.registerWebModule)(p,'ExpoCryptoAES')},207,[208,115,243,244]); 234__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"disableErrorHandling",{enumerable:!0,get:function(){return t.disableErrorHandling}}),Object.defineProperty(_e,"registerRootComponent",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(_e,"isRunningInExpoGo",{enumerable:!0,get:function(){return o.isRunningInExpoGo}}),Object.defineProperty(_e,"getExpoGoProjectConfig",{enumerable:!0,get:function(){return o.getExpoGoProjectConfig}}),Object.defineProperty(_e,"EventEmitter",{enumerable:!0,get:function(){return c.EventEmitter}}),Object.defineProperty(_e,"SharedObject",{enumerable:!0,get:function(){return c.SharedObject}}),Object.defineProperty(_e,"SharedRef",{enumerable:!0,get:function(){return c.SharedRef}}),Object.defineProperty(_e,"NativeModule",{enumerable:!0,get:function(){return c.NativeModule}}),Object.defineProperty(_e,"requireNativeModule",{enumerable:!0,get:function(){return c.requireNativeModule}}),Object.defineProperty(_e,"requireOptionalNativeModule",{enumerable:!0,get:function(){return c.requireOptionalNativeModule}}),Object.defineProperty(_e,"requireNativeView",{enumerable:!0,get:function(){return c.requireNativeViewManager}}),Object.defineProperty(_e,"registerWebModule",{enumerable:!0,get:function(){return c.registerWebModule}}),Object.defineProperty(_e,"reloadAppAsync",{enumerable:!0,get:function(){return c.reloadAppAsync}}),Object.defineProperty(_e,"installOnUIRuntime",{enumerable:!0,get:function(){return c.installOnUIRuntime}}),Object.defineProperty(_e,"PermissionStatus",{enumerable:!0,get:function(){return c.PermissionStatus}}),Object.defineProperty(_e,"createPermissionHook",{enumerable:!0,get:function(){return c.createPermissionHook}}),Object.defineProperty(_e,"useEvent",{enumerable:!0,get:function(){return f.useEvent}}),Object.defineProperty(_e,"useEventListener",{enumerable:!0,get:function(){return f.useEventListener}}),r(d[0]);
234var e,t=r(d[1]),n=r(d[2]),u=(e=n)&&e.__esModule?e:{default:e},o=r(d[3]),c=r(d[4]),f=r(d[5])},208,[209,226,227,241,115,242]); 235__d(function(g,r,i,a,m,e,d){"use strict";r(d[0]),r(d[1]),r(d[2])},209,[210,215,225]); 236__d(function(g,r,i,a,m,e,d){"use strict";r(d[0])},210,[211]); 237__d(function(g,r,i,a,m,e,d){"use strict";r(d[0]),Object.defineProperty(globalThis,'__ExpoImportMetaRegistry',{value:r(d[1]).ImportMetaRegistry,enumerable:!1,writable:!0})},211,[212,213]); 238__d(function(g,r,i,a,m,e,d){},212,[]); 239__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ImportMetaRegistry",{enumerable:!0,get:function(){return n}});var t=r(d[0]);const n={get url(){return(0,t.getBundleUrl)()}}},213,[214]); 240__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getBundleUrl=function(){let t=n;'undefined'==typeof window&&(t='file://'+__filename);if(null==t)return null;const o=new URL(t);return`${o.protocol}//${o.host}${o.pathname}`};const n='undefined'!=typeof window?document.currentScript?.src:null},214,[]); 241__d(function(g,r,i,a,m,e,d){"use strict";var _=r(d[0]);globalThis[`${globalThis.__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`]=(0,_.buildAsyncRequire)()},215,[216]); 242__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.buildAsyncRequire=function(){const t=new Map;return async function(c){if(t.has(c))return t.get(c);const u=(0,n.loadBundleAsync)(c).catch(n=>{throw t.delete(c),n});return t.set(c,u),u}};var n=r(d[0])},216,[217]); 243__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.loadBundleAsync=async function(t){const u=(0,n.buildUrlForBundle)(t);return(0,c.fetchThenEvalAsync)(u)};var n=r(d[0]),c=r(d[1])},217,[218,221]); 244__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.buildUrlForBundle=function(e){if(/^https?:\/\//.test(e))return e;const{url:t}=(0,u.default)();return t?new URL(e,t).toString():`//${e.replace(/^\/+/,'')}`};var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},218,[219]); 245__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var l=r(d[0]);var n=()=>'undefined'==typeof window?{bundleLoadedFromServer:!0,fullBundleUrl:'',url:''}:{bundleLoadedFromServer:!0,get fullBundleUrl(){return(0,l.getFullBundlerUrl)()},url:location.origin+location.pathname}},219,[220]); 246__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getFullBundlerUrl=function(){const t=document?.currentScript,n=new URL(t&&'src'in t?t.src:location.href,location.href);n.searchParams.has('platform')||n.searchParams.set('platform',"web");return n.toString()}},220,[]); 247__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fetchThenEvalAsync=function(o,{scriptType:c,nonce:s,crossOrigin:u}={}){if('undefined'==typeof window)return r(d[0]).fetchThenEvalAsync(o);return new Promise((p,l)=>{const f=document.createElement('script');c&&(f.type=c),s&&f.setAttribute('nonce',s),f.src=o,u&&0!==f.src.indexOf(window.location.origin+'/')&&(f.crossOrigin=u),f.onload=()=>{f.parentNode&&f.parentNode.removeChild(f),p()};const y=new t;f.onerror=n=>{let t;t='string'==typeof n?{type:'error',target:{src:t}}:n;const c=t&&('load'===t.type?'missing':t.type),s=t?.target?.src;y.message='Loading module '+o+' failed.\n('+c+': '+s+')',y.type=c,y.request=s,f.parentNode&&f.parentNode.removeChild(f),l(y)},f.src===n?p():document.head.appendChild(f)})};const n='undefined'!=typeof document&&document.currentScript&&'src'in document.currentScript&&document.currentScript.src||null;class t extends Error{name='AsyncRequireError'}},221,[222]); 248__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fetchThenEvalAsync=fetchThenEvalAsync,r(d[0]);var _fetchAsync=r(d[1]);function fetchThenEvalAsync(url){return(0,_fetchAsync.fetchAsync)(url).then(({body:body,status:status,headers:headers})=>{if(null!=headers?.has?.('Content-Type')&&headers.get('Content-Type').includes('application/json'))throw new Error(JSON.parse(body).message||`Unknown error fetching '${url}'`);if(200===status)return eval(body);throw new Error(`Failed to load split bundle from URL: ${url}\n${body}`)})}},222,[223,224]); 249__d(function(g,r,i,a,m,e,d){"use strict";
249Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MetroServerError",{enumerable:!0,get:function(){return t}});class t extends Error{code='METRO_SERVER_ERROR';constructor(t,o){super(t.message),this.name='MetroServerError',this.url=o;for(const o in t)this[o]=t[o]}}},223,[]); 250__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fetchAsync=async function(t){const s=await fetch(t,{method:'GET',headers:{'expo-platform':'web'}});return{body:await s.text(),status:s.status,headers:s.headers}}},224,[]); 251__d(function(g,r,i,a,m,e,d){},225,[]); 252__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createErrorHandler=function(n){return(t,o)=>n(t,o)},e.disableErrorHandling=function(){}},226,[]); 253__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}}),r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e};function o(e){let t=e;if(n.default.registerComponent('main',()=>t),'undefined'!=typeof window){const e=document.getElementById('root');n.default.runApplication('main',{rootTag:e,hydrate:globalThis.__EXPO_ROUTER_HYDRATE__})}}},227,[209,228]); 254__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},228,[229]); 255__d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}}),r(d[0]);var e,n=t(r(d[1])),o=t(r(d[2])),p=r(d[3]),s=t(p),u={},l={},c=t=>t();class f{static getAppKeys(){return Object.keys(l)}static getApplication(t,e){return(0,n.default)(l[t]&&l[t].getApplication,"Application "+t+" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent."),l[t].getApplication(e)}static registerComponent(t,n){return l[t]={getApplication:t=>(0,p.getApplication)(c(n),t?t.initialProps:u,e&&e(t)),run:t=>(0,s.default)(c(n),e&&e(t),t.callback,{hydrate:t.hydrate||!1,initialProps:t.initialProps||u,mode:t.mode||'concurrent',rootTag:t.rootTag})},t}static registerConfig(t){t.forEach(t=>{var e=t.appKey,o=t.component,p=t.run;p?f.registerRunnable(e,p):((0,n.default)(o,'No component provider passed in'),f.registerComponent(e,o))})}static registerRunnable(t,e){return l[t]={run:e},t}static runApplication(t,e){return(0,n.default)(l[t]&&l[t].run,"Application \""+t+"\" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent."),l[t].run(e)}static setComponentProviderInstrumentationHook(t){c=t}static setWrapperComponentProvider(t){e=t}static unmountApplicationComponentAtRootTag(t){(0,o.default)(t)}}},229,[21,108,230,231]); 256__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return t.unmount(),!0}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}})},230,[]); 257__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}}),_e.getApplication=function(e,l,u){return{element:c.default.createElement(n.default,{WrapperComponent:u,rootTag:{}},c.default.createElement(e,l)),getStyleElement:e=>{var n=f.default.getSheet();return c.default.createElement("style",(0,t.default)({},e,{dangerouslySetInnerHTML:{__html:n.textContent},id:n.id}))}}};var t=e(r(d[0])),n=e(r(d[1])),l=e(r(d[2])),u=r(d[3]),o=e(u),f=e(r(d[4])),c=e(r(d[5]));function p(e,t,f,p){var s=p.hydrate,_=p.initialProps,y=p.rootTag,E=s?u.hydrate:o.default;return(0,l.default)(y,'Expect to have a valid rootTag, instead got ',y),E(c.default.createElement(n.default,{WrapperComponent:t,ref:f,rootTag:y},c.default.createElement(e,_)),y)}},231,[232,233,108,234,26,11]); 258__d(function(g,_r,i,a,m,_e,d){"use strict";function e(){return e=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)({}).hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},e.apply(null,arguments)}
vendor: 5,140 bytes, lines 258-272
258Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return e}})},232,[]); 259__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=function({children:t}){return t}},233,[]); 260__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}}),e.hydrate=function(u,o){return(0,n.createSheet)(o),(0,t.hydrateRoot)(o,u)};var t=r(d[0]),n=r(d[1]);function u(u,o){(0,n.createSheet)(o);var c=(0,t.createRoot)(o);return c.render(u),c}},234,[235,68]); 261__d(function(g,r,i,a,m,e,d){'use strict';!(function _(){if('undefined'!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&'function'==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_)}catch(_){console.error(_)}})(),m.exports=r(d[0])},235,[236]); 262__d(function(e,n,t,r,l,a,o){ 263/** 264 * @license React 265 * react-dom-client.production.js 266 * 267 * Copyright (c) Meta Platforms, Inc. and affiliates. 268 * 269 * This source code is licensed under the MIT license found in the 270 * LICENSE file in the root directory of this source tree. 271 */ 272"use strict";var u=n(o[0]),i=n(o[1]),s=n(o[2]);function c(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)n+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function d(e){var n=e,t=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do{!!(4098&(n=e).flags)&&(t=n.return),e=n.return}while(e)}return 3===n.tag?t:null}function p(e){if(13===e.tag){var n=e.memoizedState;if(null===n&&(null!==(e=e.alternate)&&(n=e.memoizedState)),null!==n)return n.dehydrated}return null}function m(e){if(31===e.tag){var n=e.memoizedState;if(null===n&&(null!==(e=e.alternate)&&(n=e.memoizedState)),null!==n)return n.dehydrated}return null}function h(e){if(d(e)!==e)throw Error(c(188))}function g(e){var n=e.alternate;if(!n){if(null===(n=d(e)))throw Error(c(188));return n!==e?null:e}for(var t=e,r=n;;){var l=t.return;if(null===l)break;var a=l.alternate;if(null===a){if(null!==(r=l.return)){t=r;continue}break}if(l.child===a.child){for(a=l.child;a;){if(a===t)return h(l),e;if(a===r)return h(l),n;a=a.sibling}throw Error(c(188))}if(t.return!==r.return)t=l,r=a;else{for(var o=!1,u=l.child;u;){if(u===t){o=!0,t=l,r=a;break}if(u===r){o=!0,r=l,t=a;break}u=u.sibling}if(!o){for(u=a.child;u;){if(u===t){o=!0,t=a,r=l;break}if(u===r){o=!0,r=a,t=l;break}u=u.sibling}if(!o)throw Error(c(189))}}if(t.alternate!==r)throw Error(c(190))}if(3!==t.tag)throw Error(c(188));return t.stateNode.current===t?e:n}function v(e){var n=e.tag;if(5===n||26===n||27===n||6===n)return e;for(e=e.child;null!==e;){if(null!==(n=v(e)))return n;e=e.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),z=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),_=Symbol.for("react.lazy");Symbol.for("react.scope");var F=Symbol.for("react.activity");Symbol.for("react.legacy_hidden"),Symbol.for("react.tracing_marker");var D=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var O=Symbol.iterator;function M(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var A=Symbol.for("react.client.reference");function R(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===A?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case S:return"Fragment";case x:return"Profiler";case E:return"StrictMode";case N:return"Suspense";case L:return"SuspenseList";case F:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case w:return"Portal";case z:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case P:var n=e.render;return(e=e.displayName)||(e=""!==(e=n.displayName||n.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case T:return null!==(n=e.displayName||null)?n:R(e.type)||"Memo";case _:n=e._payload,e=e._init;try{return R(e(n))}catch(e){}}return null}var I=Array.isArray,U=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j={pending:!1,data:null,method:null,action:null},V=[],Q=-1;function B(e){return{current:e}}function H(e){0>Q||(e.current=V[Q],V[Q]=null,Q--)}function W(e,n){Q++,V[Q]=e.current,e.current=n}var q,K,Y=B(null),X=B(null),G=B(null),Z=B(null);function J(e,n){switch(W(G,n),W(X,e),W(Y,null),n.nodeType){case 9:case 11:e=(e
vendor: 5,439 bytes, line 272
272=n.documentElement)&&(e=e.namespaceURI)?If(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)e=Uf(n=If(n),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(Y),W(Y,e)}function ee(){H(Y),H(X),H(G)}function ne(e){null!==e.memoizedState&&W(Z,e);var n=Y.current,t=Uf(n,e.type);n!==t&&(W(X,e),W(Y,t))}function te(e){X.current===e&&(H(Y),H(X)),Z.current===e&&(H(Z),Id._currentValue=j)}function re(e){if(void 0===q)try{throw Error()}catch(e){var n=e.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||"",K=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+q+e+K}var le=!1;function ae(e,n){if(!e||le)return"";le=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(n){var t=function(){throw Error()};if(Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}(t=e())&&"function"==typeof t.catch&&t.catch(function(){})}}catch(e){if(e&&r&&"string"==typeof e.stack)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),o=a[0],u=a[1];if(o&&u){var i=o.split("\n"),s=u.split("\n");for(l=r=0;r<i.length&&!i[r].includes("DetermineComponentFrameRoot");)r++;for(;l<s.length&&!s[l].includes("DetermineComponentFrameRoot");)l++;if(r===i.length||l===s.length)for(r=i.length-1,l=s.length-1;1<=r&&0<=l&&i[r]!==s[l];)l--;for(;1<=r&&0<=l;r--,l--)if(i[r]!==s[l]){if(1!==r||1!==l)do{if(r--,0>--l||i[r]!==s[l]){var c="\n"+i[r].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}}while(1<=r&&0<=l);break}}}finally{le=!1,Error.prepareStackTrace=t}return(t=e?e.displayName||e.name:"")?re(t):""}function oe(e,n){switch(e.tag){case 26:case 27:case 5:return re(e.type);case 16:return re("Lazy");case 13:return e.child!==n&&null!==n?re("Suspense Fallback"):re("Suspense");case 19:return re("SuspenseList");case 0:case 15:return ae(e.type,!1);case 11:return ae(e.type.render,!1);case 1:return ae(e.type,!0);case 31:return re("Activity");default:return""}}function ue(e){try{var n="",t=null;do{n+=oe(e,t),t=e,e=e.return}while(e);return n}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ie=Object.prototype.hasOwnProperty,se=u.unstable_scheduleCallback,ce=u.unstable_cancelCallback,fe=u.unstable_shouldYield,de=u.unstable_requestPaint,pe=u.unstable_now,me=u.unstable_getCurrentPriorityLevel,he=u.unstable_ImmediatePriority,ge=u.unstable_UserBlockingPriority,ve=u.unstable_NormalPriority,ye=u.unstable_LowPriority,be=u.unstable_IdlePriority,ke=u.log,we=u.unstable_setDisableYieldValue,Se=null,Ee=null;function xe(e){if("function"==typeof ke&&we(e),Ee&&"function"==typeof Ee.setStrictMode)try{Ee.setStrictMode(Se,e)}catch(e){}}var Ce=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(ze(e)/Pe|0)|0},ze=Math.log,Pe=Math.LN2;var Ne=256,Le=262144,Te=4194304;function _e(e){var n=42&e;if(0!==n)return n;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 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Fe(e,n,t){var r=e.pendingLanes;if(0===r)return 0;var l=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var u=134217727&r;return 0!==u?0!==(r=u&~a)?l=_e(r):0!==(o&=u)?l=_e(o):t||0!==(t=u&~e)&&(l=_e(t)):0!==(u=r&~a)?l=_e(u):0!==o?l=_e(o):t||0!==(t=r&~e)&&(l=_e(t)),0===l?0:0!==n&&n!==l&&0===(n&a)&&((a=l&-l)>=(t=n&-n)||32===a&&4194048&t)?n:l}function De(e,n){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)}function Oe(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+5e3;default:return-1}}function Me(){var e=Te;return!(62914560&(Te<<=1))&&(Te=4194304),e}function Ae(e){for(var n=[],t=0;31>t;t++)n.push(e);return n}function Re(e,n){e.pendingLanes|=n,268435456!==n&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ie(e,n,t,r,l,a){var o=e.pendingLanes;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=t,e.entangledLanes&=t,e.errorRecoveryDisabledLanes&=t,e.shellSuspendCounter=0;var u=e.entanglements,i=e.expirationTimes,s=e.hiddenUpdates;for(t=o&~t;0<t;){var c=31-Ce(t),f=1<<c;u[c]=0,i[c]=-1;var d=s[c];if(null!==d)for(s[c]=null,c=0;c<d.length;c++){var p=d[c];null!==p&&(p.lane&=-536870913)}t&=~f}0!==r&&Ue(e,r,0),0!==a&&0===l&&0!==e.tag&&(e.suspendedLanes|=a&~(o&~n))}
vendor: 6,391 bytes, line 272
272function Ue(e,n,t){e.pendingLanes|=n,e.suspendedLanes&=~n;var r=31-Ce(n);e.entangledLanes|=n,e.entanglements[r]=1073741824|e.entanglements[r]|261930&t}function $e(e,n){var t=e.entangledLanes|=n;for(e=e.entanglements;t;){var r=31-Ce(t),l=1<<r;l&n|e[r]&n&&(e[r]|=n),t&=~l}}function je(e,n){var t=n&-n;return 0!==((t=42&t?1:Ve(t))&(e.suspendedLanes|n))?0:t}function Ve(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 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function Be(){var e=$.p;return 0!==e?e:void 0===(e=window.event)?32:ep(e.type)}function He(e,n){var t=$.p;try{return $.p=e,n()}finally{$.p=t}}var We=Math.random().toString(36).slice(2),qe="__reactFiber$"+We,Ke="__reactProps$"+We,Ye="__reactContainer$"+We,Xe="__reactEvents$"+We,Ge="__reactListeners$"+We,Ze="__reactHandles$"+We,Je="__reactResources$"+We,en="__reactMarker$"+We;function nn(e){delete e[qe],delete e[Ke],delete e[Xe],delete e[Ge],delete e[Ze]}function tn(e){var n=e[qe];if(n)return n;for(var t=e.parentNode;t;){if(n=t[Ye]||t[qe]){if(t=n.alternate,null!==n.child||null!==t&&null!==t.child)for(e=ud(e);null!==e;){if(t=e[qe])return t;e=ud(e)}return n}t=(e=t).parentNode}return null}function rn(e){if(e=e[qe]||e[Ye]){var n=e.tag;if(5===n||6===n||13===n||31===n||26===n||27===n||3===n)return e}return null}function ln(e){var n=e.tag;if(5===n||26===n||27===n||6===n)return e.stateNode;throw Error(c(33))}function an(e){var n=e[Je];return n||(n=e[Je]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function on(e){e[en]=!0}var un=new Set,sn={};function cn(e,n){fn(e,n),fn(e+"Capture",n)}function fn(e,n){for(sn[e]=n,e=0;e<n.length;e++)un.add(n[e])}var dn=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]*$"),pn={},mn={};function hn(e,n,t){if(l=n,ie.call(mn,l)||!ie.call(pn,l)&&(dn.test(l)?mn[l]=!0:(pn[l]=!0,0)))if(null===t)e.removeAttribute(n);else{switch(typeof t){case"undefined":case"function":case"symbol":return void e.removeAttribute(n);case"boolean":var r=n.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(n)}e.setAttribute(n,""+t)}var l}function gn(e,n,t){if(null===t)e.removeAttribute(n);else{switch(typeof t){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttribute(n,""+t)}}function vn(e,n,t,r){if(null===r)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttributeNS(n,t,""+r)}}function yn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function bn(e){var n=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===n||"radio"===n)}function kn(e,n,t){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var l=r.get,a=r.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return l.call(this)},set:function(e){t=""+e,a.call(this,e)}}),Object.defineProperty(e,n,{enumerable:r.enumerable}),{getValue:function(){return t},setValue:function(e){t=""+e},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function wn(e){if(!e._valueTracker){var n=bn(e)?"checked":"value";e._valueTracker=kn(e,n,""+e[n])}}function Sn(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue(),r="";return e&&(r=bn(e)?e.checked?"true":"false":e.value),(e=r)!==t&&(n.setValue(e),!0)}function En(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(n){return e.body}}var xn=/[\n"\\]/g;function Cn(e){return e.replace(xn,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function zn(e,n,t,r,l,a,o,u){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=n?"number"===o?(0===n&&""===e.value||e.value!=n)&&(e.value=""+yn(n)):e.value!==""+yn(n)&&(e.value=""+yn(n)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=n?Nn(e,o,yn(n)):null!=t?Nn(e,o,yn(t)):null!=r&&e.removeAttribute("value"),null==l&&null!=a&&(e.defaultChecked=!!a),null!=l&&(e.checked=l&&"function"!=typeof l&&"symbol"!=typeof l),null!=u&&"function"!=typeof u&&"symbol"!=typeof u&&"boolean"!=typeof u?e.name=""+yn(u):e.removeAttribute("name")}function Pn(e,n,t,r,l,a,o,u){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=n||null!=t){if(("submit"===a||"reset"===a)&&null==n)return void wn(e);t=null!=t?""+yn(t):"",n=null!=n?""+yn(n):t,u||n===e.value||(e.value=n),e.defaultValue=n}r="function"!=typeof(r=null!=r?r:l)&&"symbol"!=typeof r&&!!r,e.checked=u?e.checked:!!r,e.defaultChecked=!!r,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o),wn(e)}function Nn(e,n,t){"number"===n&&En(e.ownerDocument)===e||e.defaultValue===""+t||(e.defaultValue=""+t)}function Ln(e,n,t,r){if(e=e.options,n){n={};for(var l=0;l<t.length;l++)n["$"+t[l]]=!0;for(t=0;t<e.length;t++)l=n.hasOwnProperty("$"+e[t].value),e[t].selected!==l&&(e[t].selected=l),l&&r&&(e[t].defaultSelected=!0)}else{for(t=""+yn(t),n=null,l=0;l<e.length;l++){if(e[l].value===t)return e[l].selected=!0,void(r&&(e[l].defaultSelected=!0));null!==n||e[l].disabled||(n=e[l])}null!==n&&(n.selected=!0)}}function Tn(e,n,t){null==n||((n=""+yn(n))!==e.value&&(e.value=n),null!=t)?e.defaultValue=null!=t?""+yn(t):"":e.defaultValue!==n&&(e.defaultValue=n)}function _n(e,n,t,r){if(null==n){if(null!=r){if(null!=t)throw Error(c(92));if(I(r)){if(1<r.length)throw Error(c(93));r=r[0]}t=r}null==t&&(t=""),n=t}t=yn(n),e.defaultValue=t,(r=e.textContent)===t&&""!==r&&null!==r&&(e.value=r),wn(e)}function Fn(e,n){if(n){var t=e.firstChild;
vendor: 4,144 bytes, line 272
272if(t&&t===e.lastChild&&3===t.nodeType)return void(t.nodeValue=n)}e.textContent=n}var Dn=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 On(e,n,t){var r=0===n.indexOf("--");null==t||"boolean"==typeof t||""===t?r?e.setProperty(n,""):"float"===n?e.cssFloat="":e[n]="":r?e.setProperty(n,t):"number"!=typeof t||0===t||Dn.has(n)?"float"===n?e.cssFloat=t:e[n]=(""+t).trim():e[n]=t+"px"}function Mn(e,n,t){if(null!=n&&"object"!=typeof n)throw Error(c(62));if(e=e.style,null!=t){for(var r in t)!t.hasOwnProperty(r)||null!=n&&n.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var l in n)r=n[l],n.hasOwnProperty(l)&&t[l]!==r&&On(e,l,r)}else for(var a in n)n.hasOwnProperty(a)&&On(e,a,n[a])}function An(e){if(-1===e.indexOf("-"))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 Rn=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
272-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"]]),In=/^[\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 Un(e){return In.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function $n(){}var jn=null;function Vn(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Qn=null,Bn=null;function Hn(e){var n=rn(e);if(n&&(e=n.stateNode)){var t=e[Ke]||null;e:switch(e=n.stateNode,n.type){case"input":if(zn(e,t.value,t.defaultValue,t.defaultValue,t.checked,t.defaultChecked,t.type,t.name),n=t.name,"radio"===t.type&&null!=n){for(t=e;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll('input[name="'+Cn(""+n)+'"][type="radio"]'),n=0;n<t.length;n++){var r=t[n];if(r!==e&&r.form===e.form){var l=r[Ke]||null;if(!l)throw Error(c(90));zn(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(n=0;n<t.length;n++)(r=t[n]).form===e.form&&Sn(r)}break e;case"textarea":Tn(e,t.value,t.defaultValue);break e;case"select":null!=(n=t.value)&&Ln(e,!!t.multiple,n,!1)}}}var Wn=!1;function qn(e,n,t){if(Wn)return e(n,t);Wn=!0;try{return e(n)}finally{if(Wn=!1,(null!==Qn||null!==Bn)&&(hc(),Qn&&(n=Qn,e=Bn,Bn=Qn=null,Hn(n),e)))for(n=0;n<e.length;n++)Hn(e[n])}}function Kn(e,n){var t=e.stateNode;if(null===t)return null;var r=t[Ke]||null;if(null===r)return null;t=r[n];e:switch(n){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)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(t&&"function"!=typeof t)throw Error(c(231,n,typeof t));return t}var Yn=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Xn=!1;if(Yn)try{var Gn={};Object.defineProperty(Gn,"passive",{get:function(){Xn=!0}}),window.addEventListener("test",Gn,Gn),window.removeEventListener("test",Gn,Gn)}catch(e){Xn=!1}var Zn=null,Jn=null,et=null;function nt(){if(et)return et;var e,n,t=Jn,r=t.length,l="value"in Zn?Zn.value:Zn.textContent,a=l.length;for(e=0;e<r&&t[e]===l[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===l[a-n];n++);return et=l.slice(e,1<n?1-n:void 0)}function tt(e){var n=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===n&&(e=13):e=n,10===e&&(e=13),32<=e||13===e?e:0}function rt(){return!0}function lt(){return!1}function at(e){function n(n,t,r,l,a){for(var o in this._reactName=n,this._targetInst=r,this.type=t,this.nativeEvent=l,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(null!=l.defaultPrevented?l.defaultPrevented:!1===l.returnValue)?rt:lt,this.isPropagationStopped=lt,this}return y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=rt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=rt)},persist:function(){},isPersistent:rt}),n}var ot,ut,it,st={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ct=at(st),ft=y({},st,{view:0,detail:0}),dt=at(ft),pt=y({},ft,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xt,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.from
vendor: 4,957 bytes, line 272
272Element===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==it&&(it&&"mousemove"===e.type?(ot=e.screenX-it.screenX,ut=e.screenY-it.screenY):ut=ot=0,it=e),ot)},movementY:function(e){return"movementY"in e?e.movementY:ut}}),mt=at(pt),ht=at(y({},pt,{dataTransfer:0})),gt=at(y({},ft,{relatedTarget:0})),vt=at(y({},st,{animationName:0,elapsedTime:0,pseudoElement:0})),yt=at(y({},st,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),bt=at(y({},st,{data:0})),kt={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wt={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"},St={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Et(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):!!(e=St[e])&&!!n[e]}function xt(){return Et}var Ct=at(y({},ft,{key:function(e){if(e.key){var n=kt[e.key]||e.key;if("Unidentified"!==n)return n}return"keypress"===e.type?13===(e=tt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?wt[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xt,charCode:function(e){return"keypress"===e.type?tt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),zt=at(y({},pt,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Pt=at(y({},ft,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xt})),Nt=at(y({},st,{propertyName:0,elapsedTime:0,pseudoElement:0})),Lt=at(y({},pt,{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})),Tt=at(y({},st,{newState:0,oldState:0})),_t=[9,13,27,32],Ft=Yn&&"CompositionEvent"in window,Dt=null;Yn&&"documentMode"in document&&(Dt=document.documentMode);var Ot=Yn&&"TextEvent"in window&&!Dt,Mt=Yn&&(!Ft||Dt&&8<Dt&&11>=Dt),At=String.fromCharCode(32),Rt=!1;function It(e,n){switch(e){case"keyup":return-1!==_t.indexOf(n.keyCode);case"keydown":return 229!==n.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ut(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var $t=!1;function jt(e,n){switch(e){case"compositionend":return Ut(n);case"keypress":return 32!==n.which?null:(Rt=!0,At);case"textInput":return(e=n.data)===At&&Rt?null:e;default:return null}}function Vt(e,n){if($t)return"compositionend"===e||!Ft&&It(e,n)?(e=nt(),et=Jn=Zn=null,$t=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Mt&&"ko"!==n.locale?null:n.data}}var Qt={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 Bt(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===n?!!Qt[e.type]:"textarea"===n}function Ht(e,n,t,r){Qn?Bn?Bn.push(r):Bn=[r]:Qn=r,0<(n=Sf(n,"onChange")).length&&(t=new ct("onChange","change",null,t,r),e.push({event:t,listeners:n}))}var Wt=null,qt=null;function Kt(e){mf(e,0)}function Yt(e){if(Sn(ln(e)))return e}function Xt(e,n){if("change"===e)return n}var Gt=!1;if(Yn){var Zt;if(Yn){var Jt="oninput"in document;if(!Jt){var er=document.createElement("div");er.setAttribute("oninput","return;"),Jt="function"==typeof er.oninput}Zt=Jt}else Zt=!1;Gt=Zt&&(!document.documentMode||9<document.documentMode)}function nr(){Wt&&(Wt.detachEvent("onpropertychange",tr),qt=Wt=null)}function tr(e){if("value"===e.propertyName&&Yt(qt)){var n=[];Ht(n,qt,e,Vn(e)),qn(Kt,n)}}function rr(e,n,t){"focusin"===e?(nr(),qt=t,(Wt=n).attachEvent("onpropertychange",tr)):"focusout"===e&&nr()}function lr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Yt(qt)}function ar(e,n){if("click"===e)return Yt(n)}function or(e,n){if("input"===e||"change"===e)return Yt(n)}var ur="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n};function ir(e,n){if(ur(e,n))return!0;
vendor: 5,142 bytes, line 272
272if("object"!=typeof e||null===e||"object"!=typeof n||null===n)return!1;var t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;for(r=0;r<t.length;r++){var l=t[r];if(!ie.call(n,l)||!ur(e[l],n[l]))return!1}return!0}function sr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cr(e,n){var t,r=sr(e);for(e=0;r;){if(3===r.nodeType){if(t=e+r.textContent.length,e<=n&&t>=n)return{node:r,offset:n-e};e=t}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=sr(r)}}function fr(e,n){return!(!e||!n)&&(e===n||(!e||3!==e.nodeType)&&(n&&3===n.nodeType?fr(e,n.parentNode):"contains"in e?e.contains(n):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(n))))}function dr(e){for(var n=En((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);n instanceof e.HTMLIFrameElement;){try{var t="string"==typeof n.contentWindow.location.href}catch(e){t=!1}if(!t)break;n=En((e=n.contentWindow).document)}return n}function pr(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&("input"===n&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===n||"true"===e.contentEditable)}var mr=Yn&&"documentMode"in document&&11>=document.documentMode,hr=null,gr=null,vr=null,yr=!1;function br(e,n,t){var r=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;yr||null==hr||hr!==En(r)||("selectionStart"in(r=hr)&&pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},vr&&ir(vr,r)||(vr=r,0<(r=Sf(gr,"onSelect")).length&&(n=new ct("onSelect","select",null,n,t),e.push({event:n,listeners:r}),n.target=hr)))}function kr(e,n){var t={};return t[e.toLowerCase()]=n.toLowerCase(),t["Webkit"+e]="webkit"+n,t["Moz"+e]="moz"+n,t}var wr={animationend:kr("Animation","AnimationEnd"),animationiteration:kr("Animation","AnimationIteration"),animationstart:kr("Animation","AnimationStart"),transitionrun:kr("Transition","TransitionRun"),transitionstart:kr("Transition","TransitionStart"),transitioncancel:kr("Transition","TransitionCancel"),transitionend:kr("Transition","TransitionEnd")},Sr={},Er={};function xr(e){if(Sr[e])return Sr[e];if(!wr[e])return e;var n,t=wr[e];for(n in t)if(t.hasOwnProperty(n)&&n in Er)return Sr[e]=t[n];return e}Yn&&(Er=document.createElement("div").style,"AnimationEvent"in window||(delete wr.animationend.animation,delete wr.animationiteration.animation,delete wr.animationstart.animation),"TransitionEvent"in window||delete wr.transitionend.transition);var Cr=xr("animationend"),zr=xr("animationiteration"),Pr=xr("animationstart"),Nr=xr("transitionrun"),Lr=xr("transitionstart"),Tr=xr("transitioncancel"),_r=xr("transitionend"),Fr=new Map,Dr="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(" ");function Or(e,n){Fr.set(e,n),cn(n,[e])}Dr.push("scrollEnd");var Mr="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Ar=[],Rr=0,Ir=0;function Ur(){for(var e=Rr,n=Ir=Rr=0;n<e;){var t=Ar[n];Ar[n++]=null;var r=Ar[n];Ar[n++]=null;var l=Ar[n];Ar[n++]=null;var a=Ar[n];if(Ar[n++]=null,null!==r&&null!==l){var o=r.pending;null===o?l.next=l:(l.next=o.next,o.next=l),r.pending=l}0!==a&&Qr(t,l,a)}}function $r(e,n,t,r){Ar[Rr++]=e,Ar[Rr++]=n,Ar[Rr++]=t,Ar[Rr++]=r,Ir|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function jr(e,n,t,r){return $r(e,n,t,r),Br(e)}function Vr(e,n){return $r(e,null,null,n),Br(e)}function Qr(e,n,t){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t);for(var l=!1,a=e.return;null!==a;)a.childLanes|=t,null!==(r=a.alternate)&&(r.childLanes|=t),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(l=!0)),e=a,a=a.return;return 3===e.tag?(a=e.stateNode,l&&null!==n&&(l=31-Ce(t),null===(r=(e=a.hiddenUpdates)[l])?e[l]=[n]:r.push(n),n.lane=536870912|t),a):null}function Br(e){if(50<oc)throw oc=0,uc=null,Error(c(185));for(var n=e.return;null!==n;)n=(e=n).return;return 3===e.tag?e.stateNode:null}var Hr={};function Wr(e,n,t,r){this.tag=e,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 4,304 bytes, line 272
272ype=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,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 qr(e,n,t,r){return new Wr(e,n,t,r)}function Kr(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Yr(e,n){var t=e.alternate;return null===t?((t=qr(e.tag,n,e.key,e.mode)).elementType=e.elementType,t.type=e.type,t.stateNode=e.stateNode,t.alternate=e,e.alternate=t):(t.pendingProps=n,t.type=e.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=65011712&e.flags,t.childLanes=e.childLanes,t.lanes=e.lanes,t.child=e.child,t.memoizedProps=e.memoizedProps,t.memoizedState=e.memoizedState,t.updateQueue=e.updateQueue,n=e.dependencies,t.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext},t.sibling=e.sibling,t.index=e.index,t.ref=e.ref,t.refCleanup=e.refCleanup,t}function Xr(e,n){e.flags&=65011714;var t=e.alternate;return null===t?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=t.childLanes,e.lanes=t.lanes,e.child=t.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=t.memoizedProps,e.memoizedState=t.memoizedState,e.updateQueue=t.updateQueue,e.type=t.type,n=t.dependencies,e.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Gr(e,n,t,r,l,a){var o=0;if(r=e,"function"==typeof e)Kr(e)&&(o=1);else if("string"==typeof e)o=Ld(e,t,Y.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case F:return(e=qr(31,t,n,l)).elementType=F,e.lanes=a,e;case S:return Zr(t.children,l,a,n);case E:o=8,l|=24;break;case x:return(e=qr(12,t,n,2|l)).elementType=x,e.lanes=a,e;case N:return(e=qr(13,t,n,l)).elementType=N,e.lanes=a,e;case L:return(e=qr(19,t,n,l)).elementType=L,e.lanes=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case z:o=10;break e;case C:o=9;break e;case P:o=11;break e;case T:o=14;break e;case _:o=16,r=null;break e}o=29,t=Error(c(130,null===e?"null":typeof e,"")),r=null}return(n=qr(o,t,n,l)).elementType=e,n.type=r,n.lanes=a,n}function Zr(e,n,t,r){return(e=qr(7,e,r,n)).lanes=t,e}function Jr(e,n,t){return(e=qr(6,e,null,n)).lanes=t,e}function el(e){var n=qr(18,null,null,0);return n.stateNode=e,n}function nl(e,n,t){return(n=qr(4,null!==e.children?e.children:[],e.key,n)).lanes=t,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var tl=new WeakMap;function rl(e,n){if("object"==typeof e&&null!==e){var t=tl.get(e);return void 0!==t?t:(n={value:e,source:n,stack:ue(n)},tl.set(e,n),n)}return{value:e,source:n,stack:ue(n)}}var ll=[],al=0,ol=null,ul=0,il=[],sl=0,cl=null,fl=1,dl="";function pl(e,n){ll[al++]=ul,ll[al++]=ol,ol=e,ul=n}function ml(e,n,t){il[sl++]=fl,il[sl++]=dl,il[sl++]=cl,cl=e;var r=fl;e=dl;var l=32-Ce(r)-1;r&=~(1<<l),t+=1;var a=32-Ce(n)+l;if(30<a){var o=l-l%5;a=(r&(1<<o)-1).toString(32),r>>=o,l-=o,fl=1<<32-Ce(n)+l|t<<l|r,dl=a+e}else fl=1<<a|t<<l|r,dl=e}function hl(e){null!==e.return&&(pl(e,1),ml(e,1,0))}function gl(e){for(;e===ol;)ol=ll[--al],ll[al]=null,ul=ll[--al],ll[al]=null;for(;e===cl;)cl=il[--sl],il[sl]=null,dl=il[--sl],il[sl]=null,fl=il[--sl],il[sl]=null}function vl(e,n){il[sl++]=fl,il[sl++]=dl,il[sl++]=cl,fl=n.id,dl=n.overflow,cl=e}var yl=null,bl=null,kl=!1,wl=null,Sl=!1,El=Error(c(519));function xl(e){throw Tl(rl(Error(c(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),El}function Cl(e){var n=e.stateNode,t=e.type,r=e.memoizedProps;switch(n[qe]=e,n[Ke]=r,t){case"dialog":hf("cancel",n),hf("close",n);break;case"iframe":case"object":case"embed":hf("load",n);break;case"video":case"audio":for(t=0;t<df.length;t++)hf(df[t],n);break;case"source":hf("error",n);break;case"img":case"image":case"link":hf("error",n),hf("load",n);break;case"details":hf("toggle",n);break;case"input":hf("invalid",n),Pn(n,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":hf("invalid",n);break;case"textarea":hf("invalid",n),_n(n,r.value,r.defaultValue,r.children)}"string"!=typeof(t=r.children)&&"number"!=typeof t&&"bigint"!=typeof t||n.textContent===""+t||!0===r.
vendor: 2,579 bytes, line 272
272suppressHydrationWarning||Nf(n.textContent,t)?(null!=r.popover&&(hf("beforetoggle",n),hf("toggle",n)),null!=r.onScroll&&hf("scroll",n),null!=r.onScrollEnd&&hf("scrollend",n),null!=r.onClick&&(n.onclick=$n),n=!0):n=!1,n||xl(e,!0)}function zl(e){for(yl=e.return;yl;)switch(yl.tag){case 5:case 31:case 13:return void(Sl=!1);case 27:case 3:return void(Sl=!0);default:yl=yl.return}}function Pl(e){if(e!==yl)return!1;if(!kl)return zl(e),kl=!0,!1;var n,t=e.tag;if((n=3!==t&&27!==t)&&((n=5===t)&&(n=!("form"!==(n=e.type)&&"button"!==n)||$f(e.type,e.memoizedProps)),n=!n),n&&bl&&xl(e),zl(e),13===t){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(c(317));bl=od(e)}else if(31===t){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(c(317));bl=od(e)}else 27===t?(t=bl,Kf(e.type)?(e=ad,ad=null,bl=e):bl=t):bl=yl?ld(e.stateNode.nextSibling):null;return!0}function Nl(){bl=yl=null,kl=!1}function Ll(){var e=wl;return null!==e&&(null===Ws?Ws=e:Ws.push.apply(Ws,e),wl=null),e}function Tl(e){null===wl?wl=[e]:wl.push(e)}var _l=B(null),Fl=null,Dl=null;function Ol(e,n,t){W(_l,n._currentValue),n._currentValue=t}function Ml(e){e._currentValue=_l.current,H(_l)}function Al(e,n,t){for(;null!==e;){var r=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,null!==r&&(r.childLanes|=n)):null!==r&&(r.childLanes&n)!==n&&(r.childLanes|=n),e===t)break;e=e.return}}function Rl(e,n,t,r){var l=e.child;for(null!==l&&(l.return=e);null!==l;){var a=l.dependencies;if(null!==a){var o=l.child;a=a.firstContext;e:for(;null!==a;){var u=a;a=l;for(var i=0;i<n.length;i++)if(u.context===n[i]){a.lanes|=t,null!==(u=a.alternate)&&(u.lanes|=t),Al(a.return,t,e),r||(o=null);break e}a=u.next}}else if(18===l.tag){if(null===(o=l.return))throw Error(c(341));o.lanes|=t,null!==(a=o.alternate)&&(a.lanes|=t),Al(o,t,e),o=null}else o=l.child;if(null!==o)o.return=l;else for(o=l;null!==o;){if(o===e){o=null;break}if(null!==(l=o.sibling)){l.return=o.return,o=l;break}o=o.return}l=o}}function Il(e,n,t,r){e=null;for(var l=n,a=!1;null!==l;){if(!a)if(524288&l.flags)a=!0;else if(262144&l.flags)break;if(10===l.tag){var o=l.alternate;if(null===o)throw Error(c(387));if(null!==(o=o.memoizedProps)){var u=l.type;ur(l.pendingProps.value,o.value)||(null!==e?e.push(u):e=[u])}}else if(l===Z.current){if(null===(o=l.alternate))throw Error(c(387));o.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(null!==e?e.push(Id):e=[Id])}l=l.return}null!==e&&Rl(n,e,t,r),n.flags|=262144}function Ul(e){for(e=e.firstContext;null!==e;){if(!ur(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}
vendor: 4,531 bytes, line 272
272function $l(e){Fl=e,Dl=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function jl(e){return Ql(Fl,e)}function Vl(e,n){return null===Fl&&$l(e),Ql(e,n)}function Ql(e,n){var t=n._currentValue;if(n={context:n,memoizedValue:t,next:null},null===Dl){if(null===e)throw Error(c(308));Dl=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Dl=Dl.next=n;return t}var Bl="undefined"!=typeof AbortController?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(n,t){e.push(t)}};this.abort=function(){n.aborted=!0,e.forEach(function(e){return e()})}},Hl=u.unstable_scheduleCallback,Wl=u.unstable_NormalPriority,ql={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Kl(){return{controller:new Bl,data:new Map,refCount:0}}function Yl(e){e.refCount--,0===e.refCount&&Hl(Wl,function(){e.controller.abort()})}var Xl=null,Gl=0,Zl=0,Jl=null;function ea(e,n){if(null===Xl){var t=Xl=[];Gl=0,Zl=af(),Jl={status:"pending",value:void 0,then:function(e){t.push(e)}}}return Gl++,n.then(na,na),n}function na(){if(0===--Gl&&null!==Xl){null!==Jl&&(Jl.status="fulfilled");var e=Xl;Xl=null,Zl=0,Jl=null;for(var n=0;n<e.length;n++)(0,e[n])()}}var ta=U.S;U.S=function(e,n){Ys=pe(),"object"==typeof n&&null!==n&&"function"==typeof n.then&&ea(0,n),null!==ta&&ta(e,n)};var ra=B(null);function la(){var e=ra.current;return null!==e?e:Ts.pooledCache}function aa(e,n){W(ra,null===n?ra.current:n.pool)}function oa(){var e=la();return null===e?null:{parent:ql._currentValue,pool:e}}var ua=Error(c(460)),ia=Error(c(474)),sa=Error(c(542)),ca={then:function(){}};function fa(e){return"fulfilled"===(e=e.status)||"rejected"===e}function da(e,n,t){switch(void 0===(t=e[t])?e.push(n):t!==n&&(n.then($n,$n),n=t),n.status){case"fulfilled":return n.value;case"rejected":throw ga(e=n.reason),e;default:if("string"==typeof n.status)n.then($n,$n);else{if(null!==(e=Ts)&&100<e.shellSuspendCounter)throw Error(c(482));(e=n).status="pending",e.then(function(e){if("pending"===n.status){var t=n;t.status="fulfilled",t.value=e}},function(e){if("pending"===n.status){var t=n;t.status="rejected",t.reason=e}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw ga(e=n.reason),e}throw ma=n,ua}}function pa(e){try{return(0,e._init)(e._payload)}catch(e){if(null!==e&&"object"==typeof e&&"function"==typeof e.then)throw ma=e,ua;throw e}}var ma=null;function ha(){if(null===ma)throw Error(c(459));var e=ma;return ma=null,e}function ga(e){if(e===ua||e===sa)throw Error(c(483))}var va=null,ya=0;function ba(e){var n=ya;return ya+=1,null===va&&(va=[]),da(va,e,n)}function ka(e,n){n=n.props.ref,e.ref=void 0!==n?n:null}function wa(e,n){if(n.$$typeof===b)throw Error(c(525));throw e=Object.prototype.toString.call(n),Error(c(31,"[object Object]"===e?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Sa(e){function n(n,t){if(e){var r=n.deletions;null===r?(n.deletions=[t],n.flags|=16):r.push(t)}}function t(t,r){if(!e)return null;for(;null!==r;)n(t,r),r=r.sibling;return null}function r(e){for(var n=new Map;null!==e;)null!==e.key?n.set(e.key,e):n.set(e.index,e),e=e.sibling;return n}function l(e,n){return(e=Yr(e,n)).index=0,e.sibling=null,e}function a(n,t,r){return n.index=r,e?null!==(r=n.alternate)?(r=r.index)<t?(n.flags|=67108866,t):r:(n.flags|=67108866,t):(n.flags|=1048576,t)}function o(n){return e&&null===n.alternate&&(n.flags|=67108866),n}function u(e,n,t,r){return null===n||6!==n.tag?((n=Jr(t,e.mode,r)).return=e,n):((n=l(n,t)).return=e,n)}function i(e,n,t,r){var a=t.type;return a===S?f(e,n,t.props.children,r,t.key):null!==n&&(n.elementType===a||"object"==typeof a&&null!==a&&a.$$typeof===_&&pa(a)===n.type)?(ka(n=l(n,t.props),t),n.return=e,n):(ka(n=Gr(t.type,t.key,t.props,null,e.mode,r),t),n.return=e,n)}function s(e,n,t,r){return null===n||4!==n.tag||n.stateNode.containerInfo!==t.containerInfo||n.stateNode.implementation!==t.implementation?((n=nl(t,e.mode,r)).return=e,n):((n=l(n,t.children||[])).return=e,n)}function f(e,n,t,r,a){return null===n||7!==n.tag?((n=Zr(t,e.mode,r,a)).return=e,n):((n=l(n,t)).return=e,n)}function d(e,n,t){if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return(n=Jr(""+n,e.mode,t)).return=e,n;if("object"==typeof n&&null!==n){switch(n.$$typeof){case k:return ka(t=Gr(n.type,n.key,n.props,null,e.mode,t),n),t.return=e,t;case w:return(n=nl(n,e.mode,t)).return=e,n;case _:return d(e,n=pa(n),t)}if(I(n)||M(n))return(n=Zr(n,e.mode,t,null)).return=e,n;if("function"==typeof n.then)return d(e,ba(n),t);
vendor: 4,912 bytes, line 272
272if(n.$$typeof===z)return d(e,Vl(e,n),t);wa(e,n)}return null}function p(e,n,t,r){var l=null!==n?n.key:null;if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return null!==l?null:u(e,n,""+t,r);if("object"==typeof t&&null!==t){switch(t.$$typeof){case k:return t.key===l?i(e,n,t,r):null;case w:return t.key===l?s(e,n,t,r):null;case _:return p(e,n,t=pa(t),r)}if(I(t)||M(t))return null!==l?null:f(e,n,t,r,null);if("function"==typeof t.then)return p(e,n,ba(t),r);if(t.$$typeof===z)return p(e,n,Vl(e,t),r);wa(e,t)}return null}function m(e,n,t,r,l){if("string"==typeof r&&""!==r||"number"==typeof r||"bigint"==typeof r)return u(n,e=e.get(t)||null,""+r,l);if("object"==typeof r&&null!==r){switch(r.$$typeof){case k:return i(n,e=e.get(null===r.key?t:r.key)||null,r,l);case w:return s(n,e=e.get(null===r.key?t:r.key)||null,r,l);case _:return m(e,n,t,r=pa(r),l)}if(I(r)||M(r))return f(n,e=e.get(t)||null,r,l,null);if("function"==typeof r.then)return m(e,n,t,ba(r),l);if(r.$$typeof===z)return m(e,n,t,Vl(n,r),l);wa(n,r)}return null}function h(l,o,u,i){for(var s=null,c=null,f=o,h=o=0,g=null;null!==f&&h<u.length;h++){f.index>h?(g=f,f=null):g=f.sibling;var v=p(l,f,u[h],i);if(null===v){null===f&&(f=g);break}e&&f&&null===v.alternate&&n(l,f),o=a(v,o,h),null===c?s=v:c.sibling=v,c=v,f=g}if(h===u.length)return t(l,f),kl&&pl(l,h),s;if(null===f){for(;h<u.length;h++)null!==(f=d(l,u[h],i))&&(o=a(f,o,h),null===c?s=f:c.sibling=f,c=f);return kl&&pl(l,h),s}for(f=r(f);h<u.length;h++)null!==(g=m(f,l,h,u[h],i))&&(e&&null!==g.alternate&&f.delete(null===g.key?h:g.key),o=a(g,o,h),null===c?s=g:c.sibling=g,c=g);return e&&f.forEach(function(e){return n(l,e)}),kl&&pl(l,h),s}function g(l,o,u,i){if(null==u)throw Error(c(151));for(var s=null,f=null,h=o,g=o=0,v=null,y=u.next();null!==h&&!y.done;g++,y=u.next()){h.index>g?(v=h,h=null):v=h.sibling;var b=p(l,h,y.value,i);if(null===b){null===h&&(h=v);break}e&&h&&null===b.alternate&&n(l,h),o=a(b,o,g),null===f?s=b:f.sibling=b,f=b,h=v}if(y.done)return t(l,h),kl&&pl(l,g),s;if(null===h){for(;!y.done;g++,y=u.next())null!==(y=d(l,y.value,i))&&(o=a(y,o,g),null===f?s=y:f.sibling=y,f=y);return kl&&pl(l,g),s}for(h=r(h);!y.done;g++,y=u.next())null!==(y=m(h,l,g,y.value,i))&&(e&&null!==y.alternate&&h.delete(null===y.key?g:y.key),o=a(y,o,g),null===f?s=y:f.sibling=y,f=y);return e&&h.forEach(function(e){return n(l,e)}),kl&&pl(l,g),s}function v(e,r,a,u){if("object"==typeof a&&null!==a&&a.type===S&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case k:e:{for(var i=a.key;null!==r;){if(r.key===i){if((i=a.type)===S){if(7===r.tag){t(e,r.sibling),(u=l(r,a.props.children)).return=e,e=u;break e}}else if(r.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===_&&pa(i)===r.type){t(e,r.sibling),ka(u=l(r,a.props),a),u.return=e,e=u;break e}t(e,r);break}n(e,r),r=r.sibling}a.type===S?((u=Zr(a.props.children,e.mode,u,a.key)).return=e,e=u):(ka(u=Gr(a.type,a.key,a.props,null,e.mode,u),a),u.return=e,e=u)}return o(e);case w:e:{for(i=a.key;null!==r;){if(r.key===i){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){t(e,r.sibling),(u=l(r,a.children||[])).return=e,e=u;break e}t(e,r);break}n(e,r),r=r.sibling}(u=nl(a,e.mode,u)).return=e,e=u}return o(e);case _:return v(e,r,a=pa(a),u)}if(I(a))return h(e,r,a,u);if(M(a)){if("function"!=typeof(i=M(a)))throw Error(c(150));return g(e,r,a=i.call(a),u)}if("function"==typeof a.then)return v(e,r,ba(a),u);if(a.$$typeof===z)return v(e,r,Vl(e,a),u);wa(e,a)}return"string"==typeof a&&""!==a||"number"==typeof a||"bigint"==typeof a?(a=""+a,null!==r&&6===r.tag?(t(e,r.sibling),(u=l(r,a)).return=e,e=u):(t(e,r),(u=Jr(a,e.mode,u)).return=e,e=u),o(e)):t(e,r)}return function(e,n,t,r){try{ya=0;var l=v(e,n,t,r);return va=null,l}catch(n){if(n===ua||n===sa)throw n;var a=qr(29,n,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ea=Sa(!0),xa=Sa(!1),Ca=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pa(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Na(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function La(e,n,t){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&Ls){var l=r.pending;return null===l?n.next=n:(n.next=l.next,l.next=n),r.pending=n,n=Br(e),Qr(e,null,t),n}return $r(e,r,n,t),Br(e)}function Ta(e,n,t){if(null!==(n=n.updateQueue)&&(n=n.shared,4194048&t)){var r=n.lanes;t|=r&=e.pendingLanes,n.lanes=t,$e(e,t)}}function _a(e,n){var t=e.updateQueue,r=e.alternate;if(null!==r&&t===(r=r.updateQueue)){var l=null,a=null;if(null!==(t=t.firstBaseUpdate)){do{var o={lane:t.lane,tag:t.tag,payload:t.payload,callback:null,next:null};null===a?l=a=o:a=a.next=o,t=t.next}
vendor: 5,867 bytes, line 272
272while(null!==t);null===a?l=a=n:a=a.next=n}else l=a=n;return t={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=t)}null===(e=t.lastBaseUpdate)?t.firstBaseUpdate=n:e.next=n,t.lastBaseUpdate=n}var Fa=!1;function Da(){if(Fa){if(null!==Jl)throw Jl}}function Oa(e,n,t,r){Fa=!1;var l=e.updateQueue;Ca=!1;var a=l.firstBaseUpdate,o=l.lastBaseUpdate,u=l.shared.pending;if(null!==u){l.shared.pending=null;var i=u,s=i.next;i.next=null,null===o?a=s:o.next=s,o=i;var c=e.alternate;null!==c&&((u=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===u?c.firstBaseUpdate=s:u.next=s,c.lastBaseUpdate=i))}if(null!==a){var f=l.baseState;for(o=0,c=s=i=null,u=a;;){var d=-536870913&u.lane,p=d!==u.lane;if(p?(Fs&d)===d:(r&d)===d){0!==d&&d===Zl&&(Fa=!0),null!==c&&(c=c.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var m=e,h=u;d=n;var g=t;switch(h.tag){case 1:if("function"==typeof(m=h.payload)){f=m.call(g,f,d);break e}f=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(d="function"==typeof(m=h.payload)?m.call(g,f,d):m))break e;f=y({},f,d);break e;case 2:Ca=!0}}null!==(d=u.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=l.callbacks)?l.callbacks=[d]:p.push(d))}else p={lane:d,tag:u.tag,payload:u.payload,callback:u.callback,next:null},null===c?(s=c=p,i=f):c=c.next=p,o|=d;if(null===(u=u.next)){if(null===(u=l.shared.pending))break;u=(p=u).next,p.next=null,l.lastBaseUpdate=p,l.shared.pending=null}}null===c&&(i=f),l.baseState=i,l.firstBaseUpdate=s,l.lastBaseUpdate=c,null===a&&(l.shared.lanes=0),$s|=o,e.lanes=o,e.memoizedState=f}}function Ma(e,n){if("function"!=typeof e)throw Error(c(191,e));e.call(n)}function Aa(e,n){var t=e.callbacks;if(null!==t)for(e.callbacks=null,e=0;e<t.length;e++)Ma(t[e],n)}var Ra=B(null),Ia=B(0);function Ua(e,n){W(Ia,e=Is),W(Ra,n),Is=e|n.baseLanes}function $a(){W(Ia,Is),W(Ra,Ra.current)}function ja(){Is=Ia.current,H(Ra),H(Ia)}var Va=B(null),Qa=null;function Ba(e){var n=e.alternate;W(Ya,1&Ya.current),W(Va,e),null===Qa&&(null===n||null!==Ra.current||null!==n.memoizedState)&&(Qa=e)}function Ha(e){W(Ya,Ya.current),W(Va,e),null===Qa&&(Qa=e)}function Wa(e){22===e.tag?(W(Ya,Ya.current),W(Va,e),null===Qa&&(Qa=e)):qa()}function qa(){W(Ya,Ya.current),W(Va,Va.current)}function Ka(e){H(Va),Qa===e&&(Qa=null),H(Ya)}var Ya=B(0);function Xa(e){for(var n=e;null!==n;){if(13===n.tag){var t=n.memoizedState;if(null!==t&&(null===(t=t.dehydrated)||nd(t)||td(t)))return n}else if(19!==n.tag||"forwards"!==n.memoizedProps.revealOrder&&"backwards"!==n.memoizedProps.revealOrder&&"unstable_legacy-backwards"!==n.memoizedProps.revealOrder&&"together"!==n.memoizedProps.revealOrder){if(null!==n.child){n.child.return=n,n=n.child;continue}}else if(128&n.flags)return n;if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Ga=0,Za=null,Ja=null,eo=null,no=!1,to=!1,ro=!1,lo=0,ao=0,oo=null,uo=0;function io(){throw Error(c(321))}function so(e,n){if(null===n)return!1;for(var t=0;t<n.length&&t<e.length;t++)if(!ur(e[t],n[t]))return!1;return!0}function co(e,n,t,r,l,a){return Ga=a,Za=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,U.H=null===e||null===e.memoizedState?Pu:Nu,ro=!1,a=t(r,l),ro=!1,to&&(a=po(n,t,r,l)),fo(e),a}function fo(e){U.H=zu;var n=null!==Ja&&null!==Ja.next;if(Ga=0,eo=Ja=Za=null,no=!1,ao=0,oo=null,n)throw Error(c(300));null===e||Hu||null!==(e=e.dependencies)&&Ul(e)&&(Hu=!0)}function po(e,n,t,r){Za=e;var l=0;do{if(to&&(oo=null),ao=0,to=!1,25<=l)throw Error(c(301));if(l+=1,eo=Ja=null,null!=e.updateQueue){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,null!=a.memoCache&&(a.memoCache.index=0)}U.H=Lu,a=n(t,r)}while(to);return a}function mo(){var e=U.H,n=e.useState()[0];return n="function"==typeof n.then?ko(n):n,e=e.useState()[0],(null!==Ja?Ja.memoizedState:null)!==e&&(Za.flags|=1024),n}function ho(){var e=0!==lo;return lo=0,e}function go(e,n,t){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~t}function vo(e){if(no){for(e=e.memoizedState;null!==e;){var n=e.queue;null!==n&&(n.pending=null),e=e.next}no=!1}Ga=0,eo=Ja=Za=null,to=!1,ao=lo=0,oo=null}function yo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===eo?Za.memoizedState=eo=e:eo=eo.next=e,eo}function bo(){if(null===Ja){var e=Za.alternate;e=null!==e?e.memoizedState:null}else e=Ja.next;var n=null===eo?Za.memoizedState:eo.next;if(null!==n)eo=n,Ja=e;else{if(null===e){if(null===Za.alternate)throw Error(c(467));throw Error(c(310))}e={memoizedState:(Ja=e).memoizedState,baseState:Ja.baseState,baseQueue:Ja.baseQueue,queue:Ja.queue,next:null},null===eo?Za.memoizedState=eo=e:eo=eo.next=e}return eo}function ko(e){var n=ao;return ao+=1,null===oo&&(oo=[]),e=da(oo,e,n),n=Za,null===(null===eo?n.memoizedState:eo.next)&&(n=n.alternate,U.H=null===n||null===n.memoizedState?Pu:Nu),e}function wo(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return ko(e);if(e.$$typeof===z)return jl(e)}throw Error(c(438,String(e)))}function So(e){var n=null,t=Za.updateQueue;if(null!==t&&(n=t.memoCache),null==n){var r=Za.alternate;null!==r&&(null!==(r=r.updateQueue)&&(null!=(r=r.memoCache)&&(n={data:r.data.map(function(e){return e.slice()}),index:0})))}if(null==n&&(n={data:[],index:0}),null===t&&(t={lastEffect:null,events:null,stores:null,memoCache:null},Za.updateQueue=t),t.memoCache=n,void 0===(t=n.data[n.index]))for(t=n.data[n.index]=Array(e),r=0;r<e;r++)t[r]=D;return n.index++,t}function Eo(e,n){return"function"==typeof n?n(e):n}function xo(e){return Co(bo(),Ja,e)}function Co(e,n,t){var r=e.queue;if(null===r)throw Error(c(311));r.lastRenderedReducer=t;var l=e.baseQueue,a=r.pending;if(null!==a){if(null!==l){var o=l.next;l.next=a.next,a.next=o}n.baseQueue=l=a,r.pending=null}if(a=e.baseState,null===l)e.memoizedState=a;
vendor: 19,638 bytes, line 272
272else{var u=o=null,i=null,s=n=l.next,f=!1;do{var d=-536870913&s.lane;if(d!==s.lane?(Fs&d)===d:(Ga&d)===d){var p=s.revertLane;if(0===p)null!==i&&(i=i.next={lane:0,revertLane:0,gesture:null,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null}),d===Zl&&(f=!0);else{if((Ga&p)===p){s=s.next,p===Zl&&(f=!0);continue}d={lane:0,revertLane:s.revertLane,gesture:null,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null},null===i?(u=i=d,o=a):i=i.next=d,Za.lanes|=p,$s|=p}d=s.action,ro&&t(a,d),a=s.hasEagerState?s.eagerState:t(a,d)}else p={lane:d,revertLane:s.revertLane,gesture:s.gesture,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null},null===i?(u=i=p,o=a):i=i.next=p,Za.lanes|=d,$s|=d;s=s.next}while(null!==s&&s!==n);if(null===i?o=a:i.next=u,!ur(a,e.memoizedState)&&(Hu=!0,f&&null!==(t=Jl)))throw t;e.memoizedState=a,e.baseState=o,e.baseQueue=i,r.lastRenderedState=a}return null===l&&(r.lanes=0),[e.memoizedState,r.dispatch]}function zo(e){var n=bo(),t=n.queue;if(null===t)throw Error(c(311));t.lastRenderedReducer=e;var r=t.dispatch,l=t.pending,a=n.memoizedState;if(null!==l){t.pending=null;var o=l=l.next;do{a=e(a,o.action),o=o.next}while(o!==l);ur(a,n.memoizedState)||(Hu=!0),n.memoizedState=a,null===n.baseQueue&&(n.baseState=a),t.lastRenderedState=a}return[a,r]}function Po(e,n,t){var r=Za,l=bo(),a=kl;if(a){if(void 0===t)throw Error(c(407));t=t()}else t=n();var o=!ur((Ja||l).memoizedState,t);if(o&&(l.memoizedState=t,Hu=!0),l=l.queue,Zo(To.bind(null,r,l,e),[e]),l.getSnapshot!==n||o||null!==eo&&1&eo.memoizedState.tag){if(r.flags|=2048,qo(9,{destroy:void 0},Lo.bind(null,r,l,t,n),null),null===Ts)throw Error(c(349));a||127&Ga||No(r,n,t)}return t}function No(e,n,t){e.flags|=16384,e={getSnapshot:n,value:t},null===(n=Za.updateQueue)?(n={lastEffect:null,events:null,stores:null,memoCache:null},Za.updateQueue=n,n.stores=[e]):null===(t=n.stores)?n.stores=[e]:t.push(e)}function Lo(e,n,t,r){n.value=t,n.getSnapshot=r,_o(n)&&Fo(e)}function To(e,n,t){return t(function(){_o(n)&&Fo(e)})}function _o(e){var n=e.getSnapshot;e=e.value;try{var t=n();return!ur(e,t)}catch(e){return!0}}function Fo(e){var n=Vr(e,2);null!==n&&cc(n,e,2)}function Do(e){var n=yo();if("function"==typeof e){var t=e;if(e=t(),ro){xe(!0);try{t()}finally{xe(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:e},n}function Oo(e,n,t,r){return e.baseState=t,Co(e,Ja,"function"==typeof r?r:Eo)}function Mo(e,n,t,r,l){if(Eu(e))throw Error(c(485));if(null!==(e=n.action)){var a={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};null!==U.T?t(!0):a.isTransition=!1,r(a),null===(t=n.pending)?(a.next=n.pending=a,Ao(n,a)):(a.next=t.next,n.pending=t.next=a)}}function Ao(e,n){var t=n.action,r=n.payload,l=e.state;if(n.isTransition){var a=U.T,o={};U.T=o;try{var u=t(l,r),i=U.S;null!==i&&i(o,u),Ro(e,n,u)}catch(t){Uo(e,n,t)}finally{null!==a&&null!==o.types&&(a.types=o.types),U.T=a}}else try{Ro(e,n,a=t(l,r))}catch(t){Uo(e,n,t)}}function Ro(e,n,t){null!==t&&"object"==typeof t&&"function"==typeof t.then?t.then(function(t){Io(e,n,t)},function(t){return Uo(e,n,t)}):Io(e,n,t)}function Io(e,n,t){n.status="fulfilled",n.value=t,$o(n),e.state=t,null!==(n=e.pending)&&((t=n.next)===n?e.pending=null:(t=t.next,n.next=t,Ao(e,t)))}function Uo(e,n,t){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{n.status="rejected",n.reason=t,$o(n),n=n.next}while(n!==r)}e.action=null}function $o(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function jo(e,n){return n}function Vo(e,n){if(kl){var t=Ts.formState;if(null!==t){e:{var r=Za;if(kl){if(bl){n:{for(var l=bl,a=Sl;8!==l.nodeType;){if(!a){l=null;break n}if(null===(l=ld(l.nextSibling))){l=null;break n}}l="F!"===(a=l.data)||"F"===a?l:null}if(l){bl=ld(l.nextSibling),r="F!"===l.data;break e}}xl(r)}r=!1}r&&(n=t[0])}}return(t=yo()).memoizedState=t.baseState=n,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:n},t.queue=r,t=ku.bind(null,Za,r),r.dispatch=t,r=Do(!1),a=Su.bind(null,Za,!1,r.queue),l={state:n,dispatch:null,action:e,pending:null},(r=yo()).queue=l,t=Mo.bind(null,Za,l,a,t),l.dispatch=t,r.memoizedState=e,[n,t,!1]}function Qo(e){return Bo(bo(),Ja,e)}function Bo(e,n,t){if(n=Co(e,n,jo)[0],e=xo(Eo)[0],"object"==typeof n&&null!==n&&"function"==typeof n.then)try{var r=ko(n)}catch(e){if(e===ua)throw sa;throw e}else r=n;var l=(n=bo()).queue,a=l.dispatch;return t!==n.memoizedState&&(Za.flags|=2048,qo(9,{destroy:void 0},Ho.bind(null,l,t),null)),[r,a,e]}function Ho(e,n){e.action=n}function Wo(e){var n=bo(),t=Ja;if(null!==t)return Bo(n,t,e);bo(),n=n.memoizedState;var r=(t=bo()).queue.dispatch;return t.memoizedState=e,[n,r,!1]}function qo(e,n,t,r){return e={tag:e,create:t,deps:r,inst:n,next:null},null===(n=Za.updateQueue)&&(n={lastEffect:null,events:null,stores:null,memoCache:null},Za.updateQueue=n),null===(t=n.lastEffect)?n.lastEffect=e.next=e:(r=t.next,t.next=e,e.next=r,n.lastEffect=e),e}function Ko(){return bo().memoizedState}function Yo(e,n,t,r){var l=yo();Za.flags|=e,l.memoizedState=qo(1|n,{destroy:void 0},t,void 0===r?null:r)}function Xo(e,n,t,r){var l=bo();r=void 0===r?null:r;var a=l.memoizedState.inst;null!==Ja&&null!==r&&so(r,Ja.memoizedState.deps)?l.memoizedState=qo(n,a,t,r):(Za.flags|=e,l.memoizedState=qo(1|n,a,t,r))}function Go(e,n){Yo(8390656,8,e,n)}function Zo(e,n){Xo(2048,8,e,n)}function Jo(e){Za.flags|=4;var n=Za.updateQueue;if(null===n)n={lastEffect:null,events:null,stores:null,memoCache:null},Za.updateQueue=n,n.events=[e];else{var t=n.events;null===t?n.events=[e]:t.push(e)}}function eu(e){var n=bo().memoizedState;return Jo({ref:n,nextImpl:e}),function(){if(2&Ls)throw Error(c(440));return n.impl.apply(void 0,arguments)}}function nu(e,n){return Xo(4,2,e,n)}function tu(e,n){return Xo(4,4,e,n)}function ru(e,n){if("function"==typeof n){e=e();var t=n(e);return function(){"function"==typeof t?t():n(null)}}if(null!=n)return e=e(),n.current=e,function(){n.current=null}}function lu(e,n,t){t=null!=t?t.concat([e]):null,Xo(4,4,ru.bind(null,n,e),t)}function au(){}function ou(e,n){var t=bo();n=void 0===n?null:n;var r=t.memoizedState;return null!==n&&so(n,r[1])?r[0]:(t.memoizedState=[e,n],e)}function uu(e,n){var t=bo();n=void 0===n?null:n;var r=t.memoizedState;if(null!==n&&so(n,r[1]))return r[0];if(r=e(),ro){xe(!0);try{e()}finally{xe(!1)}}return t.memoizedState=[r,n],r}function iu(e,n,t){return void 0===t||1073741824&Ga&&!(261930&Fs)?e.memoizedState=n:(e.memoizedState=t,e=sc(),Za.lanes|=e,$s|=e,t)}function su(e,n,t,r){return ur(t,n)?t:null!==Ra.current?(e=iu(e,t,r),ur(e,n)||(Hu=!0),e):42&Ga&&(!(1073741824&Ga)||261930&Fs)?(e=sc(),Za.lanes|=e,$s|=e,n):(Hu=!0,e.memoizedState=t)}function cu(e,n,t,r,l){var a=$.p;$.p=0!==a&&8>a?a:8;var o,u,i,s=U.T,c={};U.T=c,Su(e,!1,n,t);try{var f=l(),d=U.S;if(null!==d&&d(c,f),null!==f&&"object"==typeof f&&"function"==typeof f.then)wu(e,n,(o=r,u=[],i={status:"pending",value:null,reason:null,then:function(e){u.push(e)}},f.then(function(){i.status="fulfilled",i.value=o;for(var e=0;e<u.length;e++)(0,u[e])(o)},function(e){for(i.status="rejected",i.reason=e,e=0;e<u.length;e++)(0,u[e])(void 0)}),i),ic());else wu(e,n,r,ic())}catch(t){wu(e,n,{then:function(){},status:"rejected",reason:t},ic())}finally{$.p=a,null!==s&&null!==c.types&&(s.types=c.types),U.T=s}}function fu(){}function du(e,n,t,r){if(5!==e.tag)throw Error(c(476));var l=pu(e).queue;cu(e,l,n,j,null===t?fu:function(){return mu(e),t(r)})}function pu(e){var n=e.memoizedState;if(null!==n)return n;var t={};return(n={memoizedState:j,baseState:j,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:j},next:null}).next={memoizedState:t,baseState:t,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:t},next:null},e.memoizedState=n,null!==(e=e.alternate)&&(e.memoizedState=n),n}function mu(e){var n=pu(e);null===n.next&&(n=e.alternate.memoizedState),wu(e,n.next.queue,{},ic())}function hu(){return jl(Id)}function gu(){return bo().memoizedState}function vu(){return bo().memoizedState}function yu(e){for(var n=e.return;null!==n;){switch(n.tag){case 24:case 3:var t=ic(),r=La(n,e=Na(t),t);return null!==r&&(cc(r,n,t),Ta(r,n,t)),n={cache:Kl()},void(e.payload=n)}n=n.return}}function bu(e,n,t){var r=ic();t={lane:r,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null},Eu(e)?xu(n,t):null!==(t=jr(e,n,t,r))&&(cc(t,e,r),Cu(t,n,r))}function ku(e,n,t){wu(e,n,t,ic())}function wu(e,n,t,r){var l={lane:r,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null};if(Eu(e))xu(n,l);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=n.lastRenderedReducer))try{var o=n.lastRenderedState,u=a(o,t);if(l.hasEagerState=!0,l.eagerState=u,ur(u,o))return $r(e,n,l,0),null===Ts&&Ur(),!1}catch(e){}if(null!==(t=jr(e,n,l,r)))return cc(t,e,r),Cu(t,n,r),!0}return!1}function Su(e,n,t,r){if(r={lane:2,revertLane:af(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Eu(e)){if(n)throw Error(c(479))}else null!==(n=jr(e,t,r,2))&&cc(n,e,2)}function Eu(e){var n=e.alternate;return e===Za||null!==n&&n===Za}function xu(e,n){to=no=!0;var t=e.pending;null===t?n.next=n:(n.next=t.next,t.next=n),e.pending=n}function Cu(e,n,t){if(4194048&t){var r=n.lanes;t|=r&=e.pendingLanes,n.lanes=t,$e(e,t)}}var zu={readContext:jl,use:wo,useCallback:io,useContext:io,useEffect:io,useImperativeHandle:io,useLayoutEffect:io,useInsertionEffect:io,useMemo:io,useReducer:io,useRef:io,useState:io,useDebugValue:io,useDeferredValue:io,useTransition:io,useSyncExternalStore:io,useId:io,useHostTransitionStatus:io,useFormState:io,useActionState:io,useOptimistic:io,useMemoCache:io,useCacheRefresh:io};zu.useEffectEvent=io;var Pu={readContext:jl,use:wo,useCallback:function(e,n){return yo().memoizedState=[e,void 0===n?null:n],e},useContext:jl,useEffect:Go,useImperativeHandle:function(e,n,t){t=null!=t?t.concat([e]):null,Yo(4194308,4,ru.bind(null,n,e),t)},useLayoutEffect:function(e,n){return Yo(4194308,4,e,n)},useInsertionEffect:function(e,n){Yo(4,2,e,n)},useMemo:function(e,n){var t=yo();n=void 0===n?null:n;var r=e();if(ro){xe(!0);try{e()}finally{xe(!1)}}return t.memoizedState=[r,n],r},useReducer:function(e,n,t){var r=yo();if(void 0!==t){var l=t(n);if(ro){xe(!0);try{t(n)}finally{xe(!1)}}}else l=n;return r.memoizedState=r.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},r.queue=e,e=e.dispatch=bu.bind(null,Za,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},yo().memoizedState=e},useState:function(e){var n=(e=Do(e)).queue,t=ku.bind(null,Za,n);return n.dispatch=t,[e.memoizedState,t]},useDebugValue:au,useDeferredValue:function(e,n){return iu(yo(),e,n)},useTransition:function(){var e=Do(!1);return e=cu.bind(null,Za,e.queue,!0,!1),yo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,t){var r=Za,l=yo();if(kl){if(void 0===t)throw Error(c(407));t=t()}else{if(t=n(),null===Ts)throw Error(c(349));127&Fs||No(r,n,t)}l.memoizedState=t;var a={value:t,getSnapshot:n};return l.queue=a,Go(To.bind(null,r,a,e),[e]),r.flags|=2048,qo(9,{destroy:void 0},Lo.bind(null,r,a,t,n),null),t},useId:function(){var e=yo(),n=Ts.identifierPrefix;if(kl){var t=dl;n="_"+n+"R_"+(t=(fl&~(1<<32-Ce(fl)-1)).toString(32)+t),0<(t=lo++)&&(n+="H"+t.toString(32)),n+="_"}else n="_"+n+"r_"+(t=uo++).toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:hu,useFormState:Vo,useActionState:Vo,useOptimistic:function(e){var n=yo();n.memoizedState=n.baseState=e;var t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=t,n=Su.bind(null,Za,!0,t),t.dispatch=n,[e,n]},useMemoCache:So,useCacheRefresh:function(){return yo().memoizedState=yu.bind(null,Za)},useEffectEvent:function(e){var n=yo(),t={impl:e};return n.memoizedState=t,function(){if(2&Ls)throw Error(c(440));return t.impl.apply(void 0,arguments)}}},Nu={readContext:jl,use:wo,useCallback:ou,useContext:jl,useEffect:Zo,useImperativeHandle:lu,useInsertionEffect:nu,useLayoutEffect:tu,useMemo:uu,useReducer:xo,useRef:Ko,useState:function(){return xo(Eo)},useDebugValue:au,useDeferredValue:function(e,n){return su(bo(),Ja.memoizedState,e,n)},useTransition:function(){var e=xo(Eo)[0],n=bo().memoizedState;return["boolean"==typeof e?e:ko(e),n]},useSyncExternalStore:Po,useId:gu,useHostTransitionStatus:hu,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,n){return Oo(bo(),0,e,n)},useMemoCache:So,useCacheRefresh:vu};Nu.useEffectEvent=eu;var Lu={readContext:jl,use:wo,useCallback:ou,useContext:jl,useEffect:Zo,useImperativeHandle:lu,useInsertionEffect:nu,useLayoutEffect:tu,useMemo:uu,useReducer:zo,useRef:Ko,useState:function(){return zo(Eo)},useDebugValue:au,useDeferredValue:function(e,n){var t=bo();return null===Ja?iu(t,e,n):su(t,Ja.memoizedState,e,n)},useTransition:function(){var e=zo(Eo)[0],n=bo().memoizedState;return["boolean"==typeof e?e:ko(e),n]},useSyncExternalStore:Po,useId:gu,useHostTransitionStatus:hu,useFormState:Wo,useActionState:Wo,useOptimistic:function(e,n){var t=bo();return null!==Ja?Oo(t,0,e,n):(t.baseState=e,[e,t.queue.dispatch])},useMemoCache:So,useCacheRefresh:vu};function Tu(e,n,t,r){t=null==(t=t(r,n=e.memoizedState))?n:y({},n,t),e.memoizedState=t,0===e.lanes&&(e.updateQueue.baseState=t)}Lu.useEffectEvent=eu;var _u={enqueueSetState:function(e,n,t){e=e._reactInternals;var r=ic(),l=Na(r);l.payload=n,null!=t&&(l.callback=t),null!==(n=La(e,l,r))&&(cc(n,e,r),Ta(n,e,r))},enqueueReplaceState:function(e,n,t){e=e._reactInternals;var r=ic(),l=Na(r);l.tag=1,l.payload=n,null!=t&&(l.callback=t),null!==(n=La(e,l,r))&&(cc(n,e,r),Ta(n,e,r))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var t=ic(),r=Na(t);r.tag=2,null!=n&&(r.callback=n),null!==(n=La(e,r,t))&&(cc(n,e,t),Ta(n,e,t))}};function Fu(e,n,t,r,l,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!n.prototype||!n.prototype.isPureReactComponent||(!ir(t,r)||!ir(l,a))}function Du(e,n,t,r){e=n.state,"function"==typeof n.componentWillReceiveProps&&n.componentWillReceiveProps(t,r),"function"==typeof n.UNSAFE_componentWillReceiveProps&&n.UNSAFE_componentWillReceiveProps(t,r),n.state!==e&&_u.enqueueReplaceState(n,n.state,null)}function Ou(e,n){var t=n;if("ref"in n)for(var r in t={},n)"ref"!==r&&(t[r]=n[r]);if(e=e.defaultProps)for(var l in t===n&&(t=y({},t)),e)void 0===t[l]&&(t[l]=e[l]);return t}function Mu(e){Mr(e)}function Au(e){console.error(e)}function Ru(e){Mr(e)}function Iu(e,n){try{(0,e.onUncaughtError)(n.value,{componentStack:n.stack})}catch(e){setTimeout(function(){throw e})}}function Uu(e,n,t){try{(0,e.onCaughtError)(t.value,{componentStack:t.stack,errorBoundary:1===n.tag?n.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function $u(e,n,t){return(t=Na(t)).tag=3,t.payload={element:null},t.callback=function(){Iu(e,n)},t}function ju(e){return(e=Na(e)).tag=3,e}function Vu(e,n,t,r){var l=t.type.getDerivedStateFromError;if("function"==typeof l){var a=r.value;e.payload=function(){return l(a)},e.callback=function(){Uu(n,t,r)}}var o=t.stateNode;null!==o&&"function"==typeof o.componentDidCatch&&(e.callback=function(){Uu(n,t,r),"function"!=typeof l&&(null===Zs?Zs=new Set([this]):Zs.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}function Qu(e,n,t,r,l){if(t.flags|=32768,null!==r&&"object"==typeof r&&"function"==typeof r.then){if(null!==(n=t.alternate)&&Il(n,t,l,!0),null!==(t=Va.current)){switch(t.tag){case 31:case 13:return null===Qa?Sc():null===t.alternate&&0===Us&&(Us=3),t.flags&=-257,t.flags|=65536,t.lanes=l,r===ca?t.flags|=16384:(null===(n=t.updateQueue)?t.updateQueue=new Set([r]):n.add(r),jc(e,r,l)),!1;case 22:return t.flags|=65536,r===ca?t.flags|=16384:(null===(n=t.updateQueue)?(n={transitions:null,markerInstances:null,retryQueue:new Set([r])},t.updateQueue=n):null===(t=n.retryQueue)?n.retryQueue=new Set([r]):t.add(r),jc(e,r,l)),!1}throw Error(c(435,t.tag))}return jc(e,r,l),Sc(),!1}if(kl)return null!==(n=Va.current)?(!(65536&n.flags)&&(n.flags|=256),n.flags|=65536,n.lanes=l,r!==El&&Tl(rl(e=Error(c(422),{cause:r}),t))):(r!==El&&Tl(rl(n=Error(c(423),{cause:r}),t)),(e=e.current.alternate).flags|=65536,l&=-l,e.lanes|=l,r=rl(r,t),_a(e,l=$u(e.stateNode,r,l)),4!==Us&&(Us=2)),!1;var a=Error(c(520),{cause:r});if(a=rl(a,t),null===Hs?Hs=[a]:Hs.push(a),4!==Us&&(Us=2),null===n)return!0;r=rl(r,t),t=n;do{switch(t.tag){case 3:return t.flags|=65536,e=l&-l,t.lanes|=e,_a(t,e=$u(t.stateNode,r,e)),!1;case 1:if(n=t.type,a=t.stateNode,!(128&t.flags||"function"!=typeof n.getDerivedStateFromError&&(null===a||"function"!=typeof a.componentDidCatch||null!==Zs&&Zs.has(a))))return t.flags|=65536,l&=-l,t.lanes|=l,Vu(l=ju(l),e,t,r),_a(t,l),!1}t=t.return}while(null!==t);return!1}var Bu=Error(c(461)),Hu=!1;function Wu(e,n,t,r){n.child=null===e?xa(n,null,t,r):Ea(n,e.child,t,r)}function qu(e,n,t,r,l){t=t.render;var a=n.ref;if("ref"in r){var o={};for(var u in r)"ref"!==u&&(o[u]=r[u])}else o=r;return $l(n),r=co(e,n,t,o,a,l),u=ho(),null===e||Hu?(kl&&u&&hl(n),n.flags|=1,Wu(e,n,r,l),n.child):(go(e,n,l),vi(e,n,l))}function Ku(e,n,t,r,l){if(null===e){var a=t.type;return"function"!=typeof a||Kr(a)||void 0!==a.defaultProps||null!==t.compare?((e=Gr(t.type,null,r,n,n.mode,l)).ref=n.ref,e.return=n,n.child=e):(n.tag=15,n.type=a,Yu(e,n,a,r,l))}if(a=e.child,!yi(e,l)){var o=a.memoizedProps;if((t=null!==(t=t.compare)?t:ir)(o,r)&&e.ref===n.ref)return vi(e,n,l)}return n.flags|=1,(e=Yr(a,r)).ref=n.ref,e.return=n,n.child=e}function Yu(e,n,t,r,l){if(null!==e){var a=e.memoizedProps;if(ir(a,r)&&e.ref===n.ref){if(Hu=!1,n.pendingProps=r=a,!yi(e,l))return n.lanes=e.lanes,vi(e,n,l);131072&e.flags&&(Hu=!0)}}return ri(e,n,t,r,l)}function Xu(e,n,t,r){var l=r.children,a=null!==e?e.memoizedState:null;if(null===e&&null===n.stateNode&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===r.mode){if(128&n.flags){if(a=null!==a?a.baseLanes|t:t,null!==e){for(r=n.child=e.child,l=0;null!==r;)l=l|r.lanes|r.childLanes,r=r.sibling;r=l&~a}else r=0,n.child=null;return Zu(e,n,a,t,r)}if(!(536870912&t))return r=n.lanes=536870912,Zu(e,n,null!==a?a.baseLanes|t:t,t,r);n.memoizedState={baseLanes:0,cachePool:null},null!==e&&aa(0,null!==a?a.cachePool:null),null!==a?Ua(n,a):$a(),Wa(n)}else null!==a?(aa(0,a.cachePool),Ua(n,a),qa(),n.memoizedState=null):(null!==e&&aa(0,null),$a(),qa());return Wu(e,n,l,t),n.child}function Gu(e,n){return null!==e&&22===e.tag||null!==n.stateNode||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Zu(e,n,t,r,l){var a=la();return a=null===a?null:{parent:ql._currentValue,pool:a},n.memoizedState={baseLanes:t,cachePool:a},null!==e&&aa(0,null),$a(),Wa(n),null!==e&&Il(e,n,r,!0),n.childLanes=l,null}function Ju(e,n){return(n=di({mode:n.mode,children:n.children},e.mode)).ref=e.ref,e.child=n,n.return=e,n}function ei(e,n,t){return Ea(n,e.child,null,t),(e=Ju(n,n.pendingProps)).flags|=2,Ka(n),n.memoizedState=null,e}function ni(e,n,t){var r=n.pendingProps,l=!!(128&n.flags);if(n.flags&=-129,null===e){if(kl){if("hidden"===r.mode)return e=Ju(n,r),n.lanes=536870912,Gu(null,e);if(Ha(n),(e=bl)?null!==(e=null!==(e=ed(e,Sl))&&"&"===e.data?e:null)&&(n.memoizedState={dehydrated:e,treeContext:null!==cl?{id:fl,overflow:dl}:null,retryLane:536870912,hydrationErrors:null},(t=el(e)).return=n,n.child=t,yl=n,bl=null):e=null,null===e)throw xl(n);return n.lanes=536870912,null}return Ju(n,r)}var a=e.memoizedState;if(null!==a){var o=a.dehydrated;
vendor: 5,881 bytes, line 272
272if(Ha(n),l)if(256&n.flags)n.flags&=-257,n=ei(e,n,t);else{if(null===n.memoizedState)throw Error(c(558));n.child=e.child,n.flags|=128,n=null}else if(Hu||Il(e,n,t,!1),l=0!==(t&e.childLanes),Hu||l){if(null!==(r=Ts)&&(0!==(o=je(r,t))&&o!==a.retryLane))throw a.retryLane=o,Vr(e,o),cc(r,e,o),Bu;Sc(),n=ei(e,n,t)}else e=a.treeContext,bl=ld(o.nextSibling),yl=n,kl=!0,wl=null,Sl=!1,null!==e&&vl(n,e),(n=Ju(n,r)).flags|=4096;return n}return(e=Yr(e.child,{mode:r.mode,children:r.children})).ref=n.ref,n.child=e,e.return=n,e}function ti(e,n){var t=n.ref;if(null===t)null!==e&&null!==e.ref&&(n.flags|=4194816);else{if("function"!=typeof t&&"object"!=typeof t)throw Error(c(284));null!==e&&e.ref===t||(n.flags|=4194816)}}function ri(e,n,t,r,l){return $l(n),t=co(e,n,t,r,void 0,l),r=ho(),null===e||Hu?(kl&&r&&hl(n),n.flags|=1,Wu(e,n,t,l),n.child):(go(e,n,l),vi(e,n,l))}function li(e,n,t,r,l,a){return $l(n),n.updateQueue=null,t=po(n,r,t,l),fo(e),r=ho(),null===e||Hu?(kl&&r&&hl(n),n.flags|=1,Wu(e,n,t,a),n.child):(go(e,n,a),vi(e,n,a))}function ai(e,n,t,r,l){if($l(n),null===n.stateNode){var a=Hr,o=t.contextType;"object"==typeof o&&null!==o&&(a=jl(o)),a=new t(r,a),n.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=_u,n.stateNode=a,a._reactInternals=n,(a=n.stateNode).props=r,a.state=n.memoizedState,a.refs={},za(n),o=t.contextType,a.context="object"==typeof o&&null!==o?jl(o):Hr,a.state=n.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(Tu(n,t,o,r),a.state=n.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(o=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),o!==a.state&&_u.enqueueReplaceState(a,a.state,null),Oa(n,r,a,l),Da(),a.state=n.memoizedState),"function"==typeof a.componentDidMount&&(n.flags|=4194308),r=!0}else if(null===e){a=n.stateNode;var u=n.memoizedProps,i=Ou(t,u);a.props=i;var s=a.context,c=t.contextType;o=Hr,"object"==typeof c&&null!==c&&(o=jl(c));var f=t.getDerivedStateFromProps;c="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate,u=n.pendingProps!==u,c||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(u||s!==o)&&Du(n,a,r,o),Ca=!1;var d=n.memoizedState;a.state=d,Oa(n,r,a,l),Da(),s=n.memoizedState,u||d!==s||Ca?("function"==typeof f&&(Tu(n,t,f,r),s=n.memoizedState),(i=Ca||Fu(n,t,i,r,d,s,o))?(c||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(n.flags|=4194308)):("function"==typeof a.componentDidMount&&(n.flags|=4194308),n.memoizedProps=r,n.memoizedState=s),a.props=r,a.state=s,a.context=o,r=i):("function"==typeof a.componentDidMount&&(n.flags|=4194308),r=!1)}else{a=n.stateNode,Pa(e,n),c=Ou(t,o=n.memoizedProps),a.props=c,f=n.pendingProps,d=a.context,s=t.contextType,i=Hr,"object"==typeof s&&null!==s&&(i=jl(s)),(s="function"==typeof(u=t.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==f||d!==i)&&Du(n,a,r,i),Ca=!1,d=n.memoizedState,a.state=d,Oa(n,r,a,l),Da();var p=n.memoizedState;o!==f||d!==p||Ca||null!==e&&null!==e.dependencies&&Ul(e.dependencies)?("function"==typeof u&&(Tu(n,t,u,r),p=n.memoizedState),(c=Ca||Fu(n,t,c,r,d,p,i)||null!==e&&null!==e.dependencies&&Ul(e.dependencies))?(s||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,i),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,i)),"function"==typeof a.componentDidUpdate&&(n.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(n.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(n.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(n.flags|=1024),n.memoizedProps=r,n.memoizedState=p),a.props=r,a.state=p,a.context=i,r=c):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(n.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(n.flags|=1024),r=!1)}return a=r,ti(e,n),r=!!(128&n.flags),a||r?(a=n.stateNode,t=r&&"function"!=typeof t.getDerivedStateFromError?null:a.render(),n.flags|=1,null!==e&&r?(n.child=Ea(n,e.child,null,l),n.child=Ea(n,null,t,l)):Wu(e,n,t,l),n.memoizedState=a.state,e=n.child):e=vi(e,n,l),e}function oi(e,n,t,r){return Nl(),n.flags|=256,Wu(e,n,t,r),n.child}var ui={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ii(e){return{baseLanes:e,cachePool:oa()}}function si(e,n,t){return e=null!==e?e.childLanes&~t:0,n&&(e|=Qs),e}function ci(e,n,t){var r,l=n.pendingProps,a=!1,o=!!(128&n.flags);if((r=o)||(r=(null===e||null!==e.memoizedState)&&!!(2&Ya.current)),r&&(a=!0,n.flags&=-129),r=!!(32&n.flags),n.flags&=-33,null===e){if(kl){if(a?Ba(n):qa(),(e=bl)?null!==(e=null!==(e=ed(e,Sl))&&"&"!==e.data?e:null)&&(n.memoizedState={dehydrated:e,treeContext:null!==cl?{id:fl,overflow:dl}:null,retryLane:536870912,hydrationErrors:null},(t=el(e)).return=n,n.child=t,yl=n,bl=null):e=null,null===e)throw xl(n);return td(e)?n.lanes=32:n.lanes=536870912,null}var u=l.children;return l=l.fallback,a?(qa(),u=di({mode:"hidden",children:u},a=n.mode),l=Zr(l,a,t,null),u.return=n,l.return=n,u.sibling=l,n.child=u,(l=n.child).memoizedState=ii(t),l.childLanes=si(e,r,t),n.memoizedState=ui,Gu(null,l)):(Ba(n),fi(n,u))}var i=e.memoizedState;
vendor: 5,706 bytes, line 272
272if(null!==i&&null!==(u=i.dehydrated)){if(o)256&n.flags?(Ba(n),n.flags&=-257,n=pi(e,n,t)):null!==n.memoizedState?(qa(),n.child=e.child,n.flags|=128,n=null):(qa(),u=l.fallback,a=n.mode,l=di({mode:"visible",children:l.children},a),(u=Zr(u,a,t,null)).flags|=2,l.return=n,u.return=n,l.sibling=u,n.child=l,Ea(n,e.child,null,t),(l=n.child).memoizedState=ii(t),l.childLanes=si(e,r,t),n.memoizedState=ui,n=Gu(null,l));else if(Ba(n),td(u)){if(r=u.nextSibling&&u.nextSibling.dataset)var s=r.dgst;r=s,(l=Error(c(419))).stack="",l.digest=r,Tl({value:l,source:null,stack:null}),n=pi(e,n,t)}else if(Hu||Il(e,n,t,!1),r=0!==(t&e.childLanes),Hu||r){if(null!==(r=Ts)&&(0!==(l=je(r,t))&&l!==i.retryLane))throw i.retryLane=l,Vr(e,l),cc(r,e,l),Bu;nd(u)||Sc(),n=pi(e,n,t)}else nd(u)?(n.flags|=192,n.child=e.child,n=null):(e=i.treeContext,bl=ld(u.nextSibling),yl=n,kl=!0,wl=null,Sl=!1,null!==e&&vl(n,e),(n=fi(n,l.children)).flags|=4096);return n}return a?(qa(),u=l.fallback,a=n.mode,s=(i=e.child).sibling,(l=Yr(i,{mode:"hidden",children:l.children})).subtreeFlags=65011712&i.subtreeFlags,null!==s?u=Yr(s,u):(u=Zr(u,a,t,null)).flags|=2,u.return=n,l.return=n,l.sibling=u,n.child=l,Gu(null,l),l=n.child,null===(u=e.child.memoizedState)?u=ii(t):(null!==(a=u.cachePool)?(i=ql._currentValue,a=a.parent!==i?{parent:i,pool:i}:a):a=oa(),u={baseLanes:u.baseLanes|t,cachePool:a}),l.memoizedState=u,l.childLanes=si(e,r,t),n.memoizedState=ui,Gu(e.child,l)):(Ba(n),e=(t=e.child).sibling,(t=Yr(t,{mode:"visible",children:l.children})).return=n,t.sibling=null,null!==e&&(null===(r=n.deletions)?(n.deletions=[e],n.flags|=16):r.push(e)),n.child=t,n.memoizedState=null,t)}function fi(e,n){return(n=di({mode:"visible",children:n},e.mode)).return=e,e.child=n}function di(e,n){return(e=qr(22,e,null,n)).lanes=0,e}function pi(e,n,t){return Ea(n,e.child,null,t),(e=fi(n,n.pendingProps.children)).flags|=2,n.memoizedState=null,e}function mi(e,n,t){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n),Al(e.return,n,t)}function hi(e,n,t,r,l,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:l,treeForkCount:a}:(o.isBackwards=n,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=t,o.tailMode=l,o.treeForkCount=a)}function gi(e,n,t){var r=n.pendingProps,l=r.revealOrder,a=r.tail;r=r.children;var o=Ya.current,u=!!(2&o);if(u?(o=1&o|2,n.flags|=128):o&=1,W(Ya,o),Wu(e,n,r,t),r=kl?ul:0,!u&&null!==e&&128&e.flags)e:for(e=n.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&mi(e,t,n);else if(19===e.tag)mi(e,t,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(l){case"forwards":for(t=n.child,l=null;null!==t;)null!==(e=t.alternate)&&null===Xa(e)&&(l=t),t=t.sibling;null===(t=l)?(l=n.child,n.child=null):(l=t.sibling,t.sibling=null),hi(n,!1,l,t,a,r);break;case"backwards":case"unstable_legacy-backwards":for(t=null,l=n.child,n.child=null;null!==l;){if(null!==(e=l.alternate)&&null===Xa(e)){n.child=l;break}e=l.sibling,l.sibling=t,t=l,l=e}hi(n,!0,t,null,a,r);break;case"together":hi(n,!1,null,null,void 0,r);break;default:n.memoizedState=null}return n.child}function vi(e,n,t){if(null!==e&&(n.dependencies=e.dependencies),$s|=n.lanes,0===(t&n.childLanes)){if(null===e)return null;if(Il(e,n,t,!1),0===(t&n.childLanes))return null}if(null!==e&&n.child!==e.child)throw Error(c(153));if(null!==n.child){for(t=Yr(e=n.child,e.pendingProps),n.child=t,t.return=n;null!==e.sibling;)e=e.sibling,(t=t.sibling=Yr(e,e.pendingProps)).return=n;t.sibling=null}return n.child}function yi(e,n){return 0!==(e.lanes&n)||!(null===(e=e.dependencies)||!Ul(e))}function bi(e,n,t){switch(n.tag){case 3:J(n,n.stateNode.containerInfo),Ol(0,ql,e.memoizedState.cache),Nl();break;case 27:case 5:ne(n);break;case 4:J(n,n.stateNode.containerInfo);break;case 10:Ol(0,n.type,n.memoizedProps.value);break;case 31:if(null!==n.memoizedState)return n.flags|=128,Ha(n),null;break;case 13:var r=n.memoizedState;if(null!==r)return null!==r.dehydrated?(Ba(n),n.flags|=128,null):0!==(t&n.child.childLanes)?ci(e,n,t):(Ba(n),null!==(e=vi(e,n,t))?e.sibling:null);Ba(n);break;case 19:var l=!!(128&e.flags);if((r=0!==(t&n.childLanes))||(Il(e,n,t,!1),r=0!==(t&n.childLanes)),l){if(r)return gi(e,n,t);n.flags|=128}if(null!==(l=n.memoizedState)&&(l.rendering=null,l.tail=null,l.lastEffect=null),W(Ya,Ya.current),r)break;return null;case 22:return n.lanes=0,Xu(e,n,t,n.pendingProps);case 24:Ol(0,ql,e.memoizedState.cache)}return vi(e,n,t)}function ki(e,n,t){if(null!==e)if(e.memoizedProps!==n.pendingProps)Hu=!0;else{if(!(yi(e,t)||128&n.flags))return Hu=!1,bi(e,n,t);Hu=!!(131072&e.flags)}else Hu=!1,kl&&1048576&n.flags&&ml(n,ul,n.index);switch(n.lanes=0,n.tag){case 16:e:{var r=n.pendingProps;if(e=pa(n.elementType),n.type=e,"function"!=typeof e){if(null!=e){var l=e.$$typeof;if(l===P){n.tag=11,n=qu(null,n,e,r,t);break e}if(l===T){n.tag=14,n=Ku(null,n,e,r,t);break e}}throw n=R(e)||e,Error(c(306,n,""))}Kr(e)?(r=Ou(e,r),n.tag=1,n=ai(null,n,e,r,t)):(n.tag=0,n=ri(null,n,e,r,t))}return n;case 0:return ri(e,n,n.type,n.pendingProps,t);case 1:return ai(e,n,r=n.type,l=Ou(r,n.pendingProps),t);case 3:e:{if(J(n,n.stateNode.containerInfo),null===e)throw Error(c(387));r=n.pendingProps;var a=n.memoizedState;l=a.element,Pa(e,n),Oa(n,r,null,t);var o=n.memoizedState;if(r=o.cache,Ol(0,ql,r),r!==a.cache&&Rl(n,[ql],t,!0),Da(),r=o.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:o.cache},n.updateQueue.baseState=a,n.memoizedState=a,256&n.flags){n=oi(e,n,r,t);break e}if(r!==l){Tl(l=rl(Error(c(424)),n)),n=oi(e,n,r,t);break e}if(9===(e=n.stateNode.containerInfo).nodeType)e=e.body;
vendor: 10,808 bytes, line 272
272else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(bl=ld(e.firstChild),yl=n,kl=!0,wl=null,Sl=!0,t=xa(n,null,r,t),n.child=t;t;)t.flags=-3&t.flags|4096,t=t.sibling}else{if(Nl(),r===l){n=vi(e,n,t);break e}Wu(e,n,r,t)}n=n.child}return n;case 26:return ti(e,n),null===e?(t=gd(n.type,null,n.pendingProps,null))?n.memoizedState=t:kl||(t=n.type,e=n.pendingProps,(r=Rf(G.current).createElement(t))[qe]=n,r[Ke]=e,_f(r,t,e),on(r),n.stateNode=r):n.memoizedState=gd(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ne(n),null===e&&kl&&(r=n.stateNode=id(n.type,n.pendingProps,G.current),yl=n,Sl=!0,l=bl,Kf(n.type)?(ad=l,bl=ld(r.firstChild)):bl=l),Wu(e,n,n.pendingProps.children,t),ti(e,n),null===e&&(n.flags|=4194304),n.child;case 5:return null===e&&kl&&((l=r=bl)&&(null!==(r=Zf(r,n.type,n.pendingProps,Sl))?(n.stateNode=r,yl=n,bl=ld(r.firstChild),Sl=!1,l=!0):l=!1),l||xl(n)),ne(n),l=n.type,a=n.pendingProps,o=null!==e?e.memoizedProps:null,r=a.children,$f(l,a)?r=null:null!==o&&$f(l,o)&&(n.flags|=32),null!==n.memoizedState&&(l=co(e,n,mo,null,null,t),Id._currentValue=l),ti(e,n),Wu(e,n,r,t),n.child;case 6:return null===e&&kl&&((e=t=bl)&&(null!==(t=Jf(t,n.pendingProps,Sl))?(n.stateNode=t,yl=n,bl=null,e=!0):e=!1),e||xl(n)),null;case 13:return ci(e,n,t);case 4:return J(n,n.stateNode.containerInfo),r=n.pendingProps,null===e?n.child=Ea(n,null,r,t):Wu(e,n,r,t),n.child;case 11:return qu(e,n,n.type,n.pendingProps,t);case 7:return Wu(e,n,n.pendingProps,t),n.child;case 8:case 12:return Wu(e,n,n.pendingProps.children,t),n.child;case 10:return r=n.pendingProps,Ol(0,n.type,r.value),Wu(e,n,r.children,t),n.child;case 9:return l=n.type._context,r=n.pendingProps.children,$l(n),r=r(l=jl(l)),n.flags|=1,Wu(e,n,r,t),n.child;case 14:return Ku(e,n,n.type,n.pendingProps,t);case 15:return Yu(e,n,n.type,n.pendingProps,t);case 19:return gi(e,n,t);case 31:return ni(e,n,t);case 22:return Xu(e,n,t,n.pendingProps);case 24:return $l(n),r=jl(ql),null===e?(null===(l=la())&&(l=Ts,a=Kl(),l.pooledCache=a,a.refCount++,null!==a&&(l.pooledCacheLanes|=t),l=a),n.memoizedState={parent:r,cache:l},za(n),Ol(0,ql,l)):(0!==(e.lanes&t)&&(Pa(e,n),Oa(n,null,null,t),Da()),l=e.memoizedState,a=n.memoizedState,l.parent!==r?(l={parent:r,cache:r},n.memoizedState=l,0===n.lanes&&(n.memoizedState=n.updateQueue.baseState=l),Ol(0,ql,r)):(r=a.cache,Ol(0,ql,r),r!==l.cache&&Rl(n,[ql],t,!0))),Wu(e,n,n.pendingProps.children,t),n.child;case 29:throw n.pendingProps}throw Error(c(156,n.tag))}function wi(e){e.flags|=4}function Si(e,n,t,r,l){if((n=!!(32&e.mode))&&(n=!1),n){if(e.flags|=16777216,(335544128&l)===l)if(e.stateNode.complete)e.flags|=8192;else{if(!bc())throw ma=ca,ia;e.flags|=8192}}else e.flags&=-16777217}function Ei(e,n){if("stylesheet"!==n.type||4&n.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!Td(n)){if(!bc())throw ma=ca,ia;e.flags|=8192}}function xi(e,n){null!==n&&(e.flags|=4),16384&e.flags&&(n=22!==e.tag?Me():536870912,e.lanes|=n,Bs|=n)}function Ci(e,n){if(!kl)switch(e.tailMode){case"hidden":n=e.tail;for(var t=null;null!==n;)null!==n.alternate&&(t=n),n=n.sibling;null===t?e.tail=null:t.sibling=null;break;case"collapsed":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?n||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zi(e){var n=null!==e.alternate&&e.alternate.child===e.child,t=0,r=0;if(n)for(var l=e.child;null!==l;)t|=l.lanes|l.childLanes,r|=65011712&l.subtreeFlags,r|=65011712&l.flags,l.return=e,l=l.sibling;else for(l=e.child;null!==l;)t|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=t,n}function Pi(e,n,t){var r=n.pendingProps;switch(gl(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return zi(n),null;case 3:return t=n.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Ml(ql),ee(),t.pendingContext&&(t.context=t.pendingContext,t.pendingContext=null),null!==e&&null!==e.child||(Pl(n)?wi(n):null===e||e.memoizedState.isDehydrated&&!(256&n.flags)||(n.flags|=1024,Ll())),zi(n),null;case 26:var l=n.type,a=n.memoizedState;return null===e?(wi(n),null!==a?(zi(n),Ei(n,a)):(zi(n),Si(n,l,0,0,t))):a?a!==e.memoizedState?(wi(n),zi(n),Ei(n,a)):(zi(n),n.flags&=-16777217):((e=e.memoizedProps)!==r&&wi(n),zi(n),Si(n,l,0,0,t)),null;case 27:if(te(n),t=G.current,l=n.type,null!==e&&null!=n.stateNode)e.memoizedProps!==r&&wi(n);else{if(!r){if(null===n.stateNode)throw Error(c(166));return zi(n),null}e=Y.current,Pl(n)?Cl(n):(e=id(l,r,t),n.stateNode=e,wi(n))}return zi(n),null;case 5:if(te(n),l=n.type,null!==e&&null!=n.stateNode)e.memoizedProps!==r&&wi(n);else{if(!r){if(null===n.stateNode)throw Error(c(166));return zi(n),null}if(a=Y.current,Pl(n))Cl(n);else{var o=Rf(G.current);switch(a){case 1:a=o.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:a=o.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":a=o.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":a=o.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":(a=o.createElement("div")).innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a="string"==typeof r.is?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a="string"==typeof r.is?o.createElement(l,{is:r.is}):o.createElement(l)}}a[qe]=n,a[Ke]=r;e:for(o=n.child;null!==o;){if(5===o.tag||6===o.tag)a.appendChild(o.stateNode);else if(4!==o.tag&&27!==o.tag&&null!==o.child){o.child.return=o,o=o.child;continue}if(o===n)break e;for(;null===o.sibling;){if(null===o.return||o.return===n)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}n.stateNode=a;e:switch(_f(a,l,r),l){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&wi(n)}}return zi(n),Si(n,n.type,null===e||e.memoizedProps,n.pendingProps,t),null;case 6:if(e&&null!=n.stateNode)e.memoizedProps!==r&&wi(n);else{if("string"!=typeof r&&null===n.stateNode)throw Error(c(166));if(e=G.current,Pl(n)){if(e=n.stateNode,t=n.memoizedProps,r=null,null!==(l=yl))switch(l.tag){case 27:case 5:r=l.memoizedProps}e[qe]=n,(e=!!(e.nodeValue===t||null!==r&&!0===r.suppressHydrationWarning||Nf(e.nodeValue,t)))||xl(n,!0)}else(e=Rf(e).createTextNode(r))[qe]=n,n.stateNode=e}return zi(n),null;case 31:if(t=n.memoizedState,null===e||null!==e.memoizedState){if(r=Pl(n),null!==t){if(null===e){if(!r)throw Error(c(318));if(!(e=null!==(e=n.memoizedState)?e.dehydrated:null))throw Error(c(557));e[qe]=n}else Nl(),!(128&n.flags)&&(n.memoizedState=null),n.flags|=4;zi(n),e=!1}else t=Ll(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=t),e=!0;if(!e)return 256&n.flags?(Ka(n),n):(Ka(n),null);if(128&n.flags)throw Error(c(558))}return zi(n),null;case 13:if(r=n.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(l=Pl(n),null!==r&&null!==r.dehydrated){if(null===e){if(!l)throw Error(c(318));if(!(l=null!==(l=n.memoizedState)?l.dehydrated:null))throw Error(c(317));l[qe]=n}else Nl(),!(128&n.flags)&&(n.memoizedState=null),n.flags|=4;zi(n),l=!1}else l=Ll(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return 256&n.flags?(Ka(n),n):(Ka(n),null)}return Ka(n),128&n.flags?(n.lanes=t,n):(t=null!==r,e=null!==e&&null!==e.memoizedState,t&&(l=null,null!==(r=n.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(l=r.alternate.memoizedState.cachePool.pool),a=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==l&&(r.flags|=2048)),t!==e&&t&&(n.child.flags|=8192),xi(n,n.updateQueue),zi(n),null);case 4:return ee(),null===e&&yf(n.stateNode.containerInfo),zi(n),null;case 10:return Ml(n.type),zi(n),null;case 19:if(H(Ya),null===(r=n.memoizedState))return zi(n),null;if(l=!!(128&n.flags),null===(a=r.rendering))if(l)Ci(r,!1);else{if(0!==Us||null!==e&&128&e.flags)for(e=n.child;null!==e;){if(null!==(a=Xa(e))){for(n.flags|=128,Ci(r,!1),e=a.updateQueue,n.updateQueue=e,xi(n,e),n.subtreeFlags=0,e=t,t=n.child;null!==t;)Xr(t,e),t=t.sibling;return W(Ya,1&Ya.current|2),kl&&pl(n,r.treeForkCount),n.child}e=e.sibling}null!==r.tail&&pe()>Xs&&(n.flags|=128,l=!0,Ci(r,!1),n.lanes=4194304)}else{if(!l)if(null!==(e=Xa(a))){if(n.flags|=128,l=!0,e=e.updateQueue,n.updateQueue=e,xi(n,e),Ci(r,!0),null===r.tail&&"hidden"===r.tailMode&&!a.alternate&&!kl)return zi(n),null}else 2*pe()-r.renderingStartTime>Xs&&536870912!==t&&(n.flags|=128,l=!0,Ci(r,!1),n.lanes=4194304);r.isBackwards?(a.sibling=n.child,n.child=a):(null!==(e=r.last)?e.sibling=a:n.child=a,r.last=a)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=pe(),e.sibling=null,t=Ya.current,W(Ya,l?1&t|2:1&t),kl&&pl(n,r.treeForkCount),e):(zi(n),null);case 22:case 23:return Ka(n),ja(),r=null!==n.memoizedState,null!==e?null!==e.memoizedState!==r&&(n.flags|=8192):r&&(n.flags|=8192),r?!!(536870912&t)&&!(128&n.flags)&&(zi(n),6&n.subtreeFlags&&(n.flags|=8192)):zi(n),null!==(t=n.updateQueue)&&xi(n,t.retryQueue),t=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(t=e.memoizedState.cachePool.pool),r=null,null!==n.memoizedState&&null!==n.memoizedState.cachePool&&(r=n.memoizedState.cachePool.pool),r!==t&&(n.flags|=2048),null!==e&&H(ra),null;case 24:return t=null,null!==e&&(t=e.memoizedState.cache),n.memoizedState.cache!==t&&(n.flags|=2048),Ml(ql),zi(n),null;case 25:case 30:return null}throw Error(c(156,n.tag))}function Ni(e,n){switch(gl(n),n.tag){case 1:return 65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 3:return Ml(ql),ee(),65536&(e=n.flags)&&!(128&e)?(n.flags=-65537&e|128,n):null;case 26:case 27:case 5:return te(n),null;case 31:if(null!==n.memoizedState){if(Ka(n),null===n.alternate)throw Error(c(340));Nl()}return 65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 13:if(Ka(n),null!==(e=n.memoizedState)&&null!==e.dehydrated){if(null===n.alternate)throw Error(c(340));Nl()}return 65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 19:return H(Ya),null;case 4:return ee(),null;case 10:return Ml(n.type),null;case 22:case 23:return Ka(n),ja(),null!==e&&H(ra),65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 24:return Ml(ql),null;default:return null}}function Li(e,n){switch(gl(n),n.tag){case 3:Ml(ql),ee();break;case 26:case 27:case 5:te(n);break;case 4:ee();break;case 31:null!==n.memoizedState&&Ka(n);break;case 13:Ka(n);break;case 19:H(Ya);break;case 10:Ml(n.type);break;case 22:case 23:Ka(n),ja(),null!==e&&H(ra);break;case 24:Ml(ql)}}function Ti(e,n){try{var t=n.updateQueue,r=null!==t?t.lastEffect:null;if(null!==r){var l=r.next;t=l;do{if((t.tag&e)===e){r=void 0;var a=t.create,o=t.inst;r=a(),o.destroy=r}
vendor: 4,626 bytes, line 272
272t=t.next}while(t!==l)}}catch(e){$c(n,n.return,e)}}function _i(e,n,t){try{var r=n.updateQueue,l=null!==r?r.lastEffect:null;if(null!==l){var a=l.next;r=a;do{if((r.tag&e)===e){var o=r.inst,u=o.destroy;if(void 0!==u){o.destroy=void 0,l=n;var i=t,s=u;try{s()}catch(e){$c(l,i,e)}}}r=r.next}while(r!==a)}}catch(e){$c(n,n.return,e)}}function Fi(e){var n=e.updateQueue;if(null!==n){var t=e.stateNode;try{Aa(n,t)}catch(n){$c(e,e.return,n)}}}function Di(e,n,t){t.props=Ou(e.type,e.memoizedProps),t.state=e.memoizedState;try{t.componentWillUnmount()}catch(t){$c(e,n,t)}}function Oi(e,n){try{var t=e.ref;if(null!==t){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof t?e.refCleanup=t(r):t.current=r}}catch(t){$c(e,n,t)}}function Mi(e,n){var t=e.ref,r=e.refCleanup;if(null!==t)if("function"==typeof r)try{r()}catch(t){$c(e,n,t)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof t)try{t(null)}catch(t){$c(e,n,t)}else t.current=null}function Ai(e){var n=e.type,t=e.memoizedProps,r=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":t.autoFocus&&r.focus();break e;case"img":t.src?r.src=t.src:t.srcSet&&(r.srcset=t.srcSet)}}catch(n){$c(e,e.return,n)}}function Ri(e,n,t){try{var r=e.stateNode;Ff(r,e.type,t,n),r[Ke]=n}catch(n){$c(e,e.return,n)}}function Ii(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&Kf(e.type)||4===e.tag}function Ui(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Ii(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&Kf(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function $i(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?(9===t.nodeType?t.body:"HTML"===t.nodeName?t.ownerDocument.body:t).insertBefore(e,n):((n=9===t.nodeType?t.body:"HTML"===t.nodeName?t.ownerDocument.body:t).appendChild(e),null!=(t=t._reactRootContainer)||null!==n.onclick||(n.onclick=$n));else if(4!==r&&(27===r&&Kf(e.type)&&(t=e.stateNode,n=null),null!==(e=e.child)))for($i(e,n,t),e=e.sibling;null!==e;)$i(e,n,t),e=e.sibling}function ji(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?t.insertBefore(e,n):t.appendChild(e);else if(4!==r&&(27===r&&Kf(e.type)&&(t=e.stateNode),null!==(e=e.child)))for(ji(e,n,t),e=e.sibling;null!==e;)ji(e,n,t),e=e.sibling}function Vi(e){var n=e.stateNode,t=e.memoizedProps;try{for(var r=e.type,l=n.attributes;l.length;)n.removeAttributeNode(l[0]);_f(n,r,t),n[qe]=e,n[Ke]=t}catch(n){$c(e,e.return,n)}}var Qi=!1,Bi=!1,Hi=!1,Wi="function"==typeof WeakSet?WeakSet:Set,qi=null;function Ki(e,n){if(e=e.containerInfo,Mf=qd,pr(e=dr(e))){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(t=(t=e.ownerDocument)&&t.defaultView||window).getSelection&&t.getSelection();if(r&&0!==r.rangeCount){t=r.anchorNode;var l=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{t.nodeType,a.nodeType}catch(e){t=null;break e}var o=0,u=-1,i=-1,s=0,f=0,d=e,p=null;n:for(;;){for(var m;d!==t||0!==l&&3!==d.nodeType||(u=o+l),d!==a||0!==r&&3!==d.nodeType||(i=o+r),3===d.nodeType&&(o+=d.nodeValue.length),null!==(m=d.firstChild);)p=d,d=m;for(;;){if(d===e)break n;if(p===t&&++s===l&&(u=o),p===a&&++f===r&&(i=o),null!==(m=d.nextSibling))break;p=(d=p).parentNode}d=m}t=-1===u||-1===i?null:{start:u,end:i}}else t=null}t=t||{start:0,end:0}}else t=null;for(Af={focusedElem:e,selectionRange:t},qd=!1,qi=n;null!==qi;)if(e=(n=qi).child,1028&n.subtreeFlags&&null!==e)e.return=n,qi=e;else for(;null!==qi;){switch(a=(n=qi).alternate,e=n.flags,n.tag){case 0:if(4&e&&null!==(e=null!==(e=n.updateQueue)?e.events:null))for(t=0;t<e.length;t++)(l=e[t]).ref.impl=l.nextImpl;break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==a){e=void 0,t=n,l=a.memoizedProps,a=a.memoizedState,r=t.stateNode;try{var h=Ou(t.type,l);e=r.getSnapshotBeforeUpdate(h,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){$c(t,t.return,e)}}break;case 3:if(1024&e)if(9===(t=(e=n.stateNode.containerInfo).nodeType))Gf(e);else if(1===t)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gf(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(c(163))}if(null!==(e=n.sibling)){e.return=n.return,qi=e;break}qi=n.return}}function Yi(e,n,t){var r=t.flags;switch(t.tag){case 0:case 11:case 15:cs(e,t),4&r&&Ti(5,t);break;case 1:if(cs(e,t),4&r)if(e=t.stateNode,null===n)try{e.componentDidMount()}catch(e){$c(t,t.return,e)}else{var l=Ou(t.type,n.memoizedProps);n=n.memoizedState;
vendor: 9,301 bytes, line 272
272try{e.componentDidUpdate(l,n,e.__reactInternalSnapshotBeforeUpdate)}catch(e){$c(t,t.return,e)}}64&r&&Fi(t),512&r&&Oi(t,t.return);break;case 3:if(cs(e,t),64&r&&null!==(e=t.updateQueue)){if(n=null,null!==t.child)switch(t.child.tag){case 27:case 5:case 1:n=t.child.stateNode}try{Aa(e,n)}catch(e){$c(t,t.return,e)}}break;case 27:null===n&&4&r&&Vi(t);case 26:case 5:cs(e,t),null===n&&4&r&&Ai(t),512&r&&Oi(t,t.return);break;case 12:cs(e,t);break;case 31:cs(e,t),4&r&&ns(e,t);break;case 13:cs(e,t),4&r&&ts(e,t),64&r&&(null!==(e=t.memoizedState)&&(null!==(e=e.dehydrated)&&rd(e,t=Bc.bind(null,t))));break;case 22:if(!(r=null!==t.memoizedState||Qi)){n=null!==n&&null!==n.memoizedState||Bi,l=Qi;var a=Bi;Qi=r,(Bi=n)&&!a?ds(e,t,!!(8772&t.subtreeFlags)):cs(e,t),Qi=l,Bi=a}break;case 30:break;default:cs(e,t)}}function Xi(e){var n=e.alternate;null!==n&&(e.alternate=null,Xi(n)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(n=e.stateNode)&&nn(n)),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 Gi=null,Zi=!1;function Ji(e,n,t){for(t=t.child;null!==t;)es(e,n,t),t=t.sibling}function es(e,n,t){if(Ee&&"function"==typeof Ee.onCommitFiberUnmount)try{Ee.onCommitFiberUnmount(Se,t)}catch(e){}switch(t.tag){case 26:Bi||Mi(t,n),Ji(e,n,t),t.memoizedState?t.memoizedState.count--:t.stateNode&&(t=t.stateNode).parentNode.removeChild(t);break;case 27:Bi||Mi(t,n);var r=Gi,l=Zi;Kf(t.type)&&(Gi=t.stateNode,Zi=!1),Ji(e,n,t),sd(t.stateNode),Gi=r,Zi=l;break;case 5:Bi||Mi(t,n);case 6:if(r=Gi,l=Zi,Gi=null,Ji(e,n,t),Zi=l,null!==(Gi=r))if(Zi)try{(9===Gi.nodeType?Gi.body:"HTML"===Gi.nodeName?Gi.ownerDocument.body:Gi).removeChild(t.stateNode)}catch(e){$c(t,n,e)}else try{Gi.removeChild(t.stateNode)}catch(e){$c(t,n,e)}break;case 18:null!==Gi&&(Zi?(Yf(9===(e=Gi).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,t.stateNode),bp(e)):Yf(Gi,t.stateNode));break;case 4:r=Gi,l=Zi,Gi=t.stateNode.containerInfo,Zi=!0,Ji(e,n,t),Gi=r,Zi=l;break;case 0:case 11:case 14:case 15:_i(2,t,n),Bi||_i(4,t,n),Ji(e,n,t);break;case 1:Bi||(Mi(t,n),"function"==typeof(r=t.stateNode).componentWillUnmount&&Di(t,n,r)),Ji(e,n,t);break;case 21:Ji(e,n,t);break;case 22:Bi=(r=Bi)||null!==t.memoizedState,Ji(e,n,t),Bi=r;break;default:Ji(e,n,t)}}function ns(e,n){if(null===n.memoizedState&&(null!==(e=n.alternate)&&null!==(e=e.memoizedState))){e=e.dehydrated;try{bp(e)}catch(e){$c(n,n.return,e)}}}function ts(e,n){if(null===n.memoizedState&&(null!==(e=n.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{bp(e)}catch(e){$c(n,n.return,e)}}function rs(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return null===n&&(n=e.stateNode=new Wi),n;case 22:return null===(n=(e=e.stateNode)._retryCache)&&(n=e._retryCache=new Wi),n;default:throw Error(c(435,e.tag))}}function ls(e,n){var t=rs(e);n.forEach(function(n){if(!t.has(n)){t.add(n);var r=Hc.bind(null,e,n);n.then(r,r)}})}function as(e,n){var t=n.deletions;if(null!==t)for(var r=0;r<t.length;r++){var l=t[r],a=e,o=n,u=o;e:for(;null!==u;){switch(u.tag){case 27:if(Kf(u.type)){Gi=u.stateNode,Zi=!1;break e}break;case 5:Gi=u.stateNode,Zi=!1;break e;case 3:case 4:Gi=u.stateNode.containerInfo,Zi=!0;break e}u=u.return}if(null===Gi)throw Error(c(160));es(a,o,l),Gi=null,Zi=!1,null!==(a=l.alternate)&&(a.return=null),l.return=null}if(13886&n.subtreeFlags)for(n=n.child;null!==n;)us(n,e),n=n.sibling}var os=null;function us(e,n){var t=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:as(n,e),is(e),4&r&&(_i(3,e,e.return),Ti(3,e),_i(5,e,e.return));break;case 1:as(n,e),is(e),512&r&&(Bi||null===t||Mi(t,t.return)),64&r&&Qi&&(null!==(e=e.updateQueue)&&(null!==(r=e.callbacks)&&(t=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===t?r:t.concat(r))));break;case 26:var l=os;if(as(n,e),is(e),512&r&&(Bi||null===t||Mi(t,t.return)),4&r){var a=null!==t?t.memoizedState:null;if(r=e.memoizedState,null===t)if(null===r)if(null===e.stateNode){e:{r=e.type,t=e.memoizedProps,l=l.ownerDocument||l;n:switch(r){case"title":(!(a=l.getElementsByTagName("title")[0])||a[en]||a[qe]||"http://www.w3.org/2000/svg"===a.namespaceURI||a.hasAttribute("itemprop"))&&(a=l.createElement(r),l.head.insertBefore(a,l.querySelector("head > title"))),_f(a,r,t),a[qe]=e,on(a),r=a;break e;case"link":var o=Pd("link","href",l).get(r+(t.href||""));if(o)for(var u=0;u<o.length;u++)if((a=o[u]).getAttribute("href")===(null==t.href||""===t.href?null:t.href)&&a.getAttribute("rel")===(null==t.rel?null:t.rel)&&a.getAttribute("title")===(null==t.title?null:t.title)&&a.getAttribute("crossorigin")===(null==t.crossOrigin?null:t.crossOrigin)){o.splice(u,1);break n}_f(a=l.createElement(r),r,t),l.head.appendChild(a);break;case"meta":if(o=Pd("meta","content",l).get(r+(t.content||"")))for(u=0;u<o.length;u++)if((a=o[u]).getAttribute("content")===(null==t.content?null:""+t.content)&&a.getAttribute("name")===(null==t.name?null:t.name)&&a.getAttribute("property")===(null==t.property?null:t.property)&&a.getAttribute("http-equiv")===(null==t.httpEquiv?null:t.httpEquiv)&&a.getAttribute("charset")===(null==t.charSet?null:t.charSet)){o.splice(u,1);break n}_f(a=l.createElement(r),r,t),l.head.appendChild(a);break;default:throw Error(c(468,r))}a[qe]=e,on(a),r=a}e.stateNode=r}else Nd(l,e.type,e.stateNode);else e.stateNode=Sd(l,r,e.memoizedProps);else a!==r?(null===a?null!==t.stateNode&&(t=t.stateNode).parentNode.removeChild(t):a.count--,null===r?Nd(l,e.type,e.stateNode):Sd(l,r,e.memoizedProps)):null===r&&null!==e.stateNode&&Ri(e,e.memoizedProps,t.memoizedProps)}break;case 27:as(n,e),is(e),512&r&&(Bi||null===t||Mi(t,t.return)),null!==t&&4&r&&Ri(e,e.memoizedProps,t.memoizedProps);break;case 5:if(as(n,e),is(e),512&r&&(Bi||null===t||Mi(t,t.return)),32&e.flags){l=e.stateNode;try{Fn(l,"")}catch(n){$c(e,e.return,n)}}4&r&&null!=e.stateNode&&Ri(e,l=e.memoizedProps,null!==t?t.memoizedProps:l),1024&r&&(Hi=!0);break;case 6:if(as(n,e),is(e),4&r){if(null===e.stateNode)throw Error(c(162));r=e.memoizedProps,t=e.stateNode;try{t.nodeValue=r}catch(n){$c(e,e.return,n)}}break;case 3:if(zd=null,l=os,os=dd(n.containerInfo),as(n,e),os=l,is(e),4&r&&null!==t&&t.memoizedState.isDehydrated)try{bp(n.containerInfo)}catch(n){$c(e,e.return,n)}Hi&&(Hi=!1,ss(e));break;case 4:r=os,os=dd(e.stateNode.containerInfo),as(n,e),is(e),os=r;break;case 12:default:as(n,e),is(e);break;case 31:case 19:as(n,e),is(e),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,ls(e,r)));break;case 13:as(n,e),is(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==t&&null!==t.memoizedState)&&(Ks=pe()),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,ls(e,r)));break;case 22:l=null!==e.memoizedState;var i=null!==t&&null!==t.memoizedState,s=Qi,f=Bi;if(Qi=s||l,Bi=f||i,as(n,e),Bi=f,Qi=s,is(e),8192&r)e:for(n=e.stateNode,n._visibility=l?-2&n._visibility:1|n._visibility,l&&(null===t||i||Qi||Bi||fs(e)),t=null,n=e;;){if(5===n.tag||26===n.tag){if(null===t){i=t=n;try{if(a=i.stateNode,l)"function"==typeof(o=a.style).setProperty?o.setProperty("display","none","important"):o.display="none";else{u=i.stateNode;var d=i.memoizedProps.style,p=null!=d&&d.hasOwnProperty("display")?d.display:null;u.style.display=null==p||"boolean"==typeof p?"":(""+p).trim()}}catch(e){$c(i,i.return,e)}}}else if(6===n.tag){if(null===t){i=n;try{i.stateNode.nodeValue=l?"":i.memoizedProps}catch(e){$c(i,i.return,e)}}}else if(18===n.tag){if(null===t){i=n;try{var m=i.stateNode;l?Xf(m,!0):Xf(i.stateNode,!1)}catch(e){$c(i,i.return,e)}}}else if((22!==n.tag&&23!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;null===n.sibling;){if(null===n.return||n.return===e)break e;t===n&&(t=null),n=n.return}t===n&&(t=null),n.sibling.return=n.return,n=n.sibling}4&r&&(null!==(r=e.updateQueue)&&(null!==(t=r.retryQueue)&&(r.retryQueue=null,ls(e,t))));case 30:case 21:}}function is(e){var n=e.flags;if(2&n){try{for(var t,r=e.return;null!==r;){if(Ii(r)){t=r;break}r=r.return}if(null==t)throw Error(c(160));switch(t.tag){case 27:var l=t.stateNode;ji(e,Ui(e),l);break;case 5:var a=t.stateNode;32&t.flags&&(Fn(a,""),t.flags&=-33),ji(e,Ui(e),a);break;case 3:case 4:var o=t.stateNode.containerInfo;$i(e,Ui(e),o);break;default:throw Error(c(161))}}catch(n){$c(e,e.return,n)}e.flags&=-3}4096&n&&(e.flags&=-4097)}function ss(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var n=e;ss(n),5===n.tag&&1024&n.flags&&n.stateNode.reset(),e=e.sibling}}function cs(e,n){if(8772&n.subtreeFlags)for(n=n.child;null!==n;)Yi(e,n.alternate,n),n=n.sibling}function fs(e){for(e=e.child;null!==e;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:_i(4,n,n.return),fs(n);break;case 1:Mi(n,n.return);var t=n.stateNode;"function"==typeof t.componentWillUnmount&&Di(n,n.return,t),fs(n);break;case 27:sd(n.stateNode);case 26:case 5:Mi(n,n.return),fs(n);break;case 22:null===n.memoizedState&&fs(n);break;default:fs(n)}e=e.sibling}}function ds(e,n,t){for(t=t&&!!(8772&n.subtreeFlags),n=n.child;null!==n;){var r=n.alternate,l=e,a=n,o=a.flags;switch(a.tag){case 0:case 11:case 15:ds(l,a,t),Ti(4,a);break;case 1:if(ds(l,a,t),"function"==typeof(l=(r=a).stateNode).componentDidMount)try{l.componentDidMount()}catch(e){$c(r,r.return,e)}if(null!==(l=(r=a).updateQueue)){var u=r.stateNode;try{var i=l.shared.hiddenCallbacks;
vendor: 9,871 bytes, line 272
272if(null!==i)for(l.shared.hiddenCallbacks=null,l=0;l<i.length;l++)Ma(i[l],u)}catch(e){$c(r,r.return,e)}}t&&64&o&&Fi(a),Oi(a,a.return);break;case 27:Vi(a);case 26:case 5:ds(l,a,t),t&&null===r&&4&o&&Ai(a),Oi(a,a.return);break;case 12:ds(l,a,t);break;case 31:ds(l,a,t),t&&4&o&&ns(l,a);break;case 13:ds(l,a,t),t&&4&o&&ts(l,a);break;case 22:null===a.memoizedState&&ds(l,a,t),Oi(a,a.return);break;case 30:break;default:ds(l,a,t)}n=n.sibling}}function ps(e,n){var t=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(t=e.memoizedState.cachePool.pool),e=null,null!==n.memoizedState&&null!==n.memoizedState.cachePool&&(e=n.memoizedState.cachePool.pool),e!==t&&(null!=e&&e.refCount++,null!=t&&Yl(t))}function ms(e,n){e=null,null!==n.alternate&&(e=n.alternate.memoizedState.cache),(n=n.memoizedState.cache)!==e&&(n.refCount++,null!=e&&Yl(e))}function hs(e,n,t,r){if(10256&n.subtreeFlags)for(n=n.child;null!==n;)gs(e,n,t,r),n=n.sibling}function gs(e,n,t,r){var l=n.flags;switch(n.tag){case 0:case 11:case 15:hs(e,n,t,r),2048&l&&Ti(9,n);break;case 1:case 31:case 13:default:hs(e,n,t,r);break;case 3:hs(e,n,t,r),2048&l&&(e=null,null!==n.alternate&&(e=n.alternate.memoizedState.cache),(n=n.memoizedState.cache)!==e&&(n.refCount++,null!=e&&Yl(e)));break;case 12:if(2048&l){hs(e,n,t,r),e=n.stateNode;try{var a=n.memoizedProps,o=a.id,u=a.onPostCommit;"function"==typeof u&&u(o,null===n.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(e){$c(n,n.return,e)}}else hs(e,n,t,r);break;case 23:break;case 22:a=n.stateNode,o=n.alternate,null!==n.memoizedState?2&a._visibility?hs(e,n,t,r):ys(e,n):2&a._visibility?hs(e,n,t,r):(a._visibility|=2,vs(e,n,t,r,!!(10256&n.subtreeFlags)||!1)),2048&l&&ps(o,n);break;case 24:hs(e,n,t,r),2048&l&&ms(n.alternate,n)}}function vs(e,n,t,r,l){for(l=l&&(!!(10256&n.subtreeFlags)||!1),n=n.child;null!==n;){var a=e,o=n,u=t,i=r,s=o.flags;switch(o.tag){case 0:case 11:case 15:vs(a,o,u,i,l),Ti(8,o);break;case 23:break;case 22:var c=o.stateNode;null!==o.memoizedState?2&c._visibility?vs(a,o,u,i,l):ys(a,o):(c._visibility|=2,vs(a,o,u,i,l)),l&&2048&s&&ps(o.alternate,o);break;case 24:vs(a,o,u,i,l),l&&2048&s&&ms(o.alternate,o);break;default:vs(a,o,u,i,l)}n=n.sibling}}function ys(e,n){if(10256&n.subtreeFlags)for(n=n.child;null!==n;){var t=e,r=n,l=r.flags;switch(r.tag){case 22:ys(t,r),2048&l&&ps(r.alternate,r);break;case 24:ys(t,r),2048&l&&ms(r.alternate,r);break;default:ys(t,r)}n=n.sibling}}var bs=8192;function ks(e,n,t){if(e.subtreeFlags&bs)for(e=e.child;null!==e;)ws(e,n,t),e=e.sibling}function ws(e,n,t){switch(e.tag){case 26:ks(e,n,t),e.flags&bs&&null!==e.memoizedState&&_d(t,os,e.memoizedState,e.memoizedProps);break;case 5:default:ks(e,n,t);break;case 3:case 4:var r=os;os=dd(e.stateNode.containerInfo),ks(e,n,t),os=r;break;case 22:null===e.memoizedState&&(null!==(r=e.alternate)&&null!==r.memoizedState?(r=bs,bs=16777216,ks(e,n,t),bs=r):ks(e,n,t))}}function Ss(e){var n=e.alternate;if(null!==n&&null!==(e=n.child)){n.child=null;do{n=e.sibling,e.sibling=null,e=n}while(null!==e)}}function Es(e){var n=e.deletions;if(16&e.flags){if(null!==n)for(var t=0;t<n.length;t++){var r=n[t];qi=r,zs(r,e)}Ss(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)xs(e),e=e.sibling}function xs(e){switch(e.tag){case 0:case 11:case 15:Es(e),2048&e.flags&&_i(9,e,e.return);break;case 3:case 12:default:Es(e);break;case 22:var n=e.stateNode;null!==e.memoizedState&&2&n._visibility&&(null===e.return||13!==e.return.tag)?(n._visibility&=-3,Cs(e)):Es(e)}}function Cs(e){var n=e.deletions;if(16&e.flags){if(null!==n)for(var t=0;t<n.length;t++){var r=n[t];qi=r,zs(r,e)}Ss(e)}for(e=e.child;null!==e;){switch((n=e).tag){case 0:case 11:case 15:_i(8,n,n.return),Cs(n);break;case 22:2&(t=n.stateNode)._visibility&&(t._visibility&=-3,Cs(n));break;default:Cs(n)}e=e.sibling}}function zs(e,n){for(;null!==qi;){var t=qi;switch(t.tag){case 0:case 11:case 15:_i(8,t,n);break;case 23:case 22:if(null!==t.memoizedState&&null!==t.memoizedState.cachePool){var r=t.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:Yl(t.memoizedState.cache)}if(null!==(r=t.child))r.return=t,qi=r;else e:for(t=e;null!==qi;){var l=(r=qi).sibling,a=r.return;if(Xi(r),r===t){qi=null;break e}if(null!==l){l.return=a,qi=l;break e}qi=a}}}var Ps={getCacheForType:function(e){var n=jl(ql),t=n.data.get(e);return void 0===t&&(t=e(),n.data.set(e,t)),t},cacheSignal:function(){return jl(ql).controller.signal}},Ns="function"==typeof WeakMap?WeakMap:Map,Ls=0,Ts=null,_s=null,Fs=0,Ds=0,Os=null,Ms=!1,As=!1,Rs=!1,Is=0,Us=0,$s=0,js=0,Vs=0,Qs=0,Bs=0,Hs=null,Ws=null,qs=!1,Ks=0,Ys=0,Xs=1/0,Gs=null,Zs=null,Js=0,ec=null,nc=null,tc=0,rc=0,lc=null,ac=null,oc=0,uc=null;function ic(){return 2&Ls&&0!==Fs?Fs&-Fs:null!==U.T?af():Be()}function sc(){if(0===Qs)if(536870912&Fs&&!kl)Qs=536870912;else{var e=Le;!(3932160&(Le<<=1))&&(Le=262144),Qs=e}return null!==(e=Va.current)&&(e.flags|=32),Qs}function cc(e,n,t){(e!==Ts||2!==Ds&&9!==Ds)&&null===e.cancelPendingCommit||(vc(e,0),mc(e,Fs,Qs,!1)),Re(e,t),2&Ls&&e===Ts||(e===Ts&&(!(2&Ls)&&(js|=t),4===Us&&mc(e,Fs,Qs,!1)),Zc(e))}function fc(e,n,t){if(6&Ls)throw Error(c(327));for(var r=!t&&!(127&n)&&0===(n&e.expiredLanes)||De(e,n),l=r?Cc(e,n):Ec(e,n,!0),a=r;;){if(0===l){As&&!r&&mc(e,n,0,!1);break}if(t=e.current.alternate,!a||pc(t)){if(2===l){if(a=n,e.errorRecoveryDisabledLanes&a)var o=0;else o=0!==(o=-536870913&e.pendingLanes)?o:536870912&o?536870912:0;if(0!==o){n=o;e:{var u=e;l=Hs;var i=u.current.memoizedState.isDehydrated;if(i&&(vc(u,o).flags|=256),2!==(o=Ec(u,o,!1))){if(Rs&&!i){u.errorRecoveryDisabledLanes|=a,js|=a,l=4;break e}a=Ws,Ws=l,null!==a&&(null===Ws?Ws=a:Ws.push.apply(Ws,a))}l=o}if(a=!1,2!==l)continue}}if(1===l){vc(e,0),mc(e,n,0,!0);break}e:{switch(r=e,a=l){case 0:case 1:throw Error(c(345));case 4:if((4194048&n)!==n)break;case 6:mc(r,n,Qs,!Ms);break e;case 2:Ws=null;break;case 3:case 5:break;default:throw Error(c(329))}if((62914560&n)===n&&10<(l=Ks+300-pe())){if(mc(r,n,Qs,!Ms),0!==Fe(r,0,!0))break e;tc=n,r.timeoutHandle=Qf(dc.bind(null,r,t,Ws,Gs,qs,n,Qs,js,Bs,Ms,a,"Throttled",-0,0),l)}else dc(r,t,Ws,Gs,qs,n,Qs,js,Bs,Ms,a,null,-0,0)}break}l=Ec(e,n,!1),a=!1}Zc(e)}function dc(e,n,t,r,l,a,o,u,i,s,c,f,d,p){if(e.timeoutHandle=-1,8192&(f=n.subtreeFlags)||!(16785408&~f)){ws(n,a,f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$n});var m=(62914560&a)===a?Ks-pe():(4194048&a)===a?Ys-pe():0;if(null!==(m=Dd(f,m)))return tc=a,e.cancelPendingCommit=m(Fc.bind(null,e,n,a,t,r,l,o,u,i,c,f,null,d,p)),void mc(e,a,o,!s)}Fc(e,n,a,t,r,l,o,u,i)}function pc(e){for(var n=e;;){var t=n.tag;if((0===t||11===t||15===t)&&16384&n.flags&&(null!==(t=n.updateQueue)&&null!==(t=t.stores)))for(var r=0;r<t.length;r++){var l=t[r],a=l.getSnapshot;l=l.value;try{if(!ur(a(),l))return!1}catch(e){return!1}}if(t=n.child,16384&n.subtreeFlags&&null!==t)t.return=n,n=t;else{if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function mc(e,n,t,r){n&=~Vs,n&=~js,e.suspendedLanes|=n,e.pingedLanes&=~n,r&&(e.warmLanes|=n),r=e.expirationTimes;for(var l=n;0<l;){var a=31-Ce(l),o=1<<a;r[a]=-1,l&=~o}0!==t&&Ue(e,t,n)}function hc(){return!!(6&Ls)||(Jc(0,!1),!1)}function gc(){if(null!==_s){if(0===Ds)var e=_s.return;else Dl=Fl=null,vo(e=_s),va=null,ya=0,e=_s;for(;null!==e;)Li(e.alternate,e),e=e.return;_s=null}}function vc(e,n){var t=e.timeoutHandle;-1!==t&&(e.timeoutHandle=-1,Bf(t)),null!==(t=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,t()),tc=0,gc(),Ts=e,_s=t=Yr(e.current,null),Fs=n,Ds=0,Os=null,Ms=!1,As=De(e,n),Rs=!1,Bs=Qs=Vs=js=$s=Us=0,Ws=Hs=null,qs=!1,8&n&&(n|=32&n);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=n;0<r;){var l=31-Ce(r),a=1<<l;n|=e[l],r&=~a}return Is=n,Ur(),t}function yc(e,n){Za=null,U.H=zu,n===ua||n===sa?(n=ha(),Ds=3):n===ia?(n=ha(),Ds=4):Ds=n===Bu?8:null!==n&&"object"==typeof n&&"function"==typeof n.then?6:1,Os=n,null===_s&&(Us=1,Iu(e,rl(n,e.current)))}function bc(){var e=Va.current;return null===e||((4194048&Fs)===Fs?null===Qa:!!((62914560&Fs)===Fs||536870912&Fs)&&e===Qa)}function kc(){var e=U.H;return U.H=zu,null===e?zu:e}function wc(){var e=U.A;return U.A=Ps,e}function Sc(){Us=4,Ms||(4194048&Fs)!==Fs&&null!==Va.current||(As=!0),!(134217727&$s)&&!(134217727&js)||null===Ts||mc(Ts,Fs,Qs,!1)}function Ec(e,n,t){var r=Ls;Ls|=2;var l=kc(),a=wc();Ts===e&&Fs===n||(Gs=null,vc(e,n)),n=!1;var o=Us;e:for(;;)try{if(0!==Ds&&null!==_s){var u=_s,i=Os;switch(Ds){case 8:gc(),o=6;break e;case 3:case 2:case 9:case 6:null===Va.current&&(n=!0);var s=Ds;if(Ds=0,Os=null,Lc(e,u,i,s),t&&As){o=0;break e}break;default:s=Ds,Ds=0,Os=null,Lc(e,u,i,s)}}xc(),o=Us;break}catch(n){yc(e,n)}return n&&e.shellSuspendCounter++,Dl=Fl=null,Ls=r,U.H=l,U.A=a,null===_s&&(Ts=null,Fs=0,Ur()),o}function xc(){for(;null!==_s;)Pc(_s)}function Cc(e,n){var t=Ls;Ls|=2;var r=kc(),l=wc();Ts!==e||Fs!==n?(Gs=null,Xs=pe()+500,vc(e,n)):As=De(e,n);e:for(;;)try{if(0!==Ds&&null!==_s){n=_s;var a=Os;n:switch(Ds){case 1:Ds=0,Os=null,Lc(e,n,a,1);break;case 2:case 9:if(fa(a)){Ds=0,Os=null,Nc(n);break}n=function(){2!==Ds&&9!==Ds||Ts!==e||(Ds=7),Zc(e)},a.then(n,n);break e;case 3:Ds=7;break e;case 4:Ds=5;break e;case 7:fa(a)?(Ds=0,Os=null,Nc(n)):(Ds=0,Os=null,Lc(e,n,a,7));break;case 5:var o=null;switch(_s.tag){case 26:o=_s.memoizedState;case 5:case 27:var u=_s;if(o?Td(o):u.stateNode.complete){Ds=0,Os=null;var i=u.sibling;if(null!==i)_s=i;else{var s=u.return;null!==s?(_s=s,Tc(s)):_s=null}break n}}Ds=0,Os=null,Lc(e,n,a,5);break;case 6:Ds=0,Os=null,Lc(e,n,a,6);break;case 8:gc(),Us=6;break e;default:throw Error(c(462))}}zc();break}catch(n){yc(e,n)}return Dl=Fl=null,U.H=r,U.A=l,Ls=t,null!==_s?0:(Ts=null,Fs=0,Ur(),Us)}function zc(){for(;null!==_s&&!fe();)Pc(_s)}function Pc(e){var n=ki(e.alternate,e,Is);e.memoizedProps=e.pendingProps,null===n?Tc(e):_s=n}function Nc(e){var n=e,t=n.alternate;
vendor: 3,986 bytes, line 272
272switch(n.tag){case 15:case 0:n=li(t,n,n.pendingProps,n.type,void 0,Fs);break;case 11:n=li(t,n,n.pendingProps,n.type.render,n.ref,Fs);break;case 5:vo(n);default:Li(t,n),n=ki(t,n=_s=Xr(n,Is),Is)}e.memoizedProps=e.pendingProps,null===n?Tc(e):_s=n}function Lc(e,n,t,r){Dl=Fl=null,vo(n),va=null,ya=0;var l=n.return;try{if(Qu(e,l,n,t,Fs))return Us=1,Iu(e,rl(t,e.current)),void(_s=null)}catch(n){if(null!==l)throw _s=l,n;return Us=1,Iu(e,rl(t,e.current)),void(_s=null)}32768&n.flags?(kl||1===r?e=!0:As||536870912&Fs?e=!1:(Ms=e=!0,(2===r||9===r||3===r||6===r)&&(null!==(r=Va.current)&&13===r.tag&&(r.flags|=16384))),_c(n,e)):Tc(n)}function Tc(e){var n=e;do{if(32768&n.flags)return void _c(n,Ms);e=n.return;var t=Pi(n.alternate,n,Is);if(null!==t)return void(_s=t);if(null!==(n=n.sibling))return void(_s=n);_s=n=e}while(null!==n);0===Us&&(Us=5)}function _c(e,n){do{var t=Ni(e.alternate,e);if(null!==t)return t.flags&=32767,void(_s=t);if(null!==(t=e.return)&&(t.flags|=32768,t.subtreeFlags=0,t.deletions=null),!n&&null!==(e=e.sibling))return void(_s=e);_s=e=t}while(null!==e);Us=6,_s=null}function Fc(e,n,t,r,l,a,o,u,i){e.cancelPendingCommit=null;do{Rc()}while(0!==Js);if(6&Ls)throw Error(c(327));if(null!==n){if(n===e.current)throw Error(c(177));if(a=n.lanes|n.childLanes,Ie(e,t,a|=Ir,o,u,i),e===Ts&&(_s=Ts=null,Fs=0),nc=n,ec=e,tc=t,rc=a,lc=l,ac=r,10256&n.subtreeFlags||10256&n.flags?(e.callbackNode=null,e.callbackPriority=0,se(ve,function(){return Ic(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(13878&n.flags),13878&n.subtreeFlags||r){r=U.T,U.T=null,l=$.p,$.p=2,o=Ls,Ls|=4;try{Ki(e,n)}finally{Ls=o,$.p=l,U.T=r}}Js=1,Dc(),Oc(),Mc()}}function Dc(){if(1===Js){Js=0;var e=ec,n=nc,t=!!(13878&n.flags);if(13878&n.subtreeFlags||t){t=U.T,U.T=null;var r=$.p;$.p=2;var l=Ls;Ls|=4;try{us(n,e);var a=Af,o=dr(e.containerInfo),u=a.focusedElem,i=a.selectionRange;if(o!==u&&u&&u.ownerDocument&&fr(u.ownerDocument.documentElement,u)){if(null!==i&&pr(u)){var s=i.start,c=i.end;if(void 0===c&&(c=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(c,u.value.length);else{var f=u.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var p=d.getSelection(),m=u.textContent.length,h=Math.min(i.start,m),g=void 0===i.end?h:Math.min(i.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var v=cr(u,h),y=cr(u,g);if(v&&y&&(1!==p.rangeCount||p.anchorNode!==v.node||p.anchorOffset!==v.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var b=f.createRange();b.setStart(v.node,v.offset),p.removeAllRanges(),h>g?(p.addRange(b),p.extend(y.node,y.offset)):(b.setEnd(y.node,y.offset),p.addRange(b))}}}}for(f=[],p=u;p=p.parentNode;)1===p.nodeType&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for("function"==typeof u.focus&&u.focus(),u=0;u<f.length;u++){var k=f[u];k.element.scrollLeft=k.left,k.element.scrollTop=k.top}}qd=!!Mf,Af=Mf=null}finally{Ls=l,$.p=r,U.T=t}}e.current=n,Js=2}}function Oc(){if(2===Js){Js=0;var e=ec,n=nc,t=!!(8772&n.flags);if(8772&n.subtreeFlags||t){t=U.T,U.T=null;var r=$.p;$.p=2;var l=Ls;Ls|=4;try{Yi(e,n.alternate,n)}finally{Ls=l,$.p=r,U.T=t}}Js=3}}function Mc(){if(4===Js||3===Js){Js=0,de();var e=ec,n=nc,t=tc,r=ac;10256&n.subtreeFlags||10256&n.flags?Js=5:(Js=0,nc=ec=null,Ac(e,e.pendingLanes));var l=e.pendingLanes;if(0===l&&(Zs=null),Qe(t),n=n.stateNode,Ee&&"function"==typeof Ee.onCommitFiberRoot)try{Ee.onCommitFiberRoot(Se,n,void 0,!(128&~n.current.flags))}catch(e){}if(null!==r){n=U.T,l=$.p,$.p=2,U.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var u=r[o];a(u.value,{componentStack:u.stack})}}finally{U.T=n,$.p=l}}3&tc&&Rc(),Zc(e),l=e.pendingLanes,261930&t&&42&l?e===uc?oc++:(oc=0,uc=e):oc=0,Jc(0,!1)}}function Ac(e,n){0===(e.pooledCacheLanes&=n)&&(null!=(n=e.pooledCache)&&(e.pooledCache=null,Yl(n)))}function Rc(){return Dc(),Oc(),Mc(),Ic()}function Ic(){if(5!==Js)return!1;var e=ec,n=rc;rc=0;var t=Qe(tc),r=U.T,l=$.p;try{$.p=32>t?32:t,U.T=null,t=lc,lc=null;var a=ec,o=tc;if(Js=0,nc=ec=null,tc=0,6&Ls)throw Error(c(331));var u=Ls;
vendor: 5,094 bytes, line 272
272if(Ls|=4,xs(a.current),gs(a,a.current,o,t),Ls=u,Jc(0,!1),Ee&&"function"==typeof Ee.onPostCommitFiberRoot)try{Ee.onPostCommitFiberRoot(Se,a)}catch(e){}return!0}finally{$.p=l,U.T=r,Ac(e,n)}}function Uc(e,n,t){n=rl(t,n),null!==(e=La(e,n=$u(e.stateNode,n,2),2))&&(Re(e,2),Zc(e))}function $c(e,n,t){if(3===e.tag)Uc(e,e,t);else for(;null!==n;){if(3===n.tag){Uc(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Zs||!Zs.has(r))){e=rl(t,e),null!==(r=La(n,t=ju(2),2))&&(Vu(t,r,n,e),Re(r,2),Zc(r));break}}n=n.return}}function jc(e,n,t){var r=e.pingCache;if(null===r){r=e.pingCache=new Ns;var l=new Set;r.set(n,l)}else void 0===(l=r.get(n))&&(l=new Set,r.set(n,l));l.has(t)||(Rs=!0,l.add(t),e=Vc.bind(null,e,n,t),n.then(e,e))}function Vc(e,n,t){var r=e.pingCache;null!==r&&r.delete(n),e.pingedLanes|=e.suspendedLanes&t,e.warmLanes&=~t,Ts===e&&(Fs&t)===t&&(4===Us||3===Us&&(62914560&Fs)===Fs&&300>pe()-Ks?!(2&Ls)&&vc(e,0):Vs|=t,Bs===Fs&&(Bs=0)),Zc(e)}function Qc(e,n){0===n&&(n=Me()),null!==(e=Vr(e,n))&&(Re(e,n),Zc(e))}function Bc(e){var n=e.memoizedState,t=0;null!==n&&(t=n.retryLane),Qc(e,t)}function Hc(e,n){var t=0;switch(e.tag){case 31:case 13:var r=e.stateNode,l=e.memoizedState;null!==l&&(t=l.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(c(314))}null!==r&&r.delete(n),Qc(e,t)}var Wc=null,qc=null,Kc=!1,Yc=!1,Xc=!1,Gc=0;function Zc(e){e!==qc&&null===e.next&&(null===qc?Wc=qc=e:qc=qc.next=e),Yc=!0,Kc||(Kc=!0,Wf(function(){6&Ls?se(he,ef):nf()}))}function Jc(e,n){if(!Xc&&Yc){Xc=!0;do{for(var t=!1,r=Wc;null!==r;){if(!n)if(0!==e){var l=r.pendingLanes;if(0===l)var a=0;else{var o=r.suspendedLanes,u=r.pingedLanes;a=(1<<31-Ce(42|e)+1)-1,a=201326741&(a&=l&~(o&~u))?201326741&a|1:a?2|a:0}0!==a&&(t=!0,lf(r,a))}else a=Fs,!(3&(a=Fe(r,r===Ts?a:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||De(r,a)||(t=!0,lf(r,a));r=r.next}}while(t);Xc=!1}}function ef(){nf()}function nf(){Yc=Kc=!1;var e=0;0!==Gc&&Vf()&&(e=Gc);for(var n=pe(),t=null,r=Wc;null!==r;){var l=r.next,a=tf(r,n);0===a?(r.next=null,null===t?Wc=l:t.next=l,null===l&&(qc=t)):(t=r,(0!==e||3&a)&&(Yc=!0)),r=l}0!==Js&&5!==Js||Jc(e,!1),0!==Gc&&(Gc=0)}function tf(e,n){for(var t=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var o=31-Ce(a),u=1<<o,i=l[o];-1===i?0!==(u&t)&&0===(u&r)||(l[o]=Oe(u,n)):i<=n&&(e.expiredLanes|=u),a&=~u}if(t=Fs,t=Fe(e,e===(n=Ts)?t:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===t||e===n&&(2===Ds||9===Ds)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(3&t)||De(e,t)){if((n=t&-t)===e.callbackPriority)return n;switch(null!==r&&ce(r),Qe(t)){case 2:case 8:t=ge;break;case 32:default:t=ve;break;case 268435456:t=be}return r=rf.bind(null,e),t=se(t,r),e.callbackPriority=n,e.callbackNode=t,n}return null!==r&&null!==r&&ce(r),e.callbackPriority=2,e.callbackNode=null,2}function rf(e,n){if(0!==Js&&5!==Js)return e.callbackNode=null,e.callbackPriority=0,null;var t=e.callbackNode;if(Rc()&&e.callbackNode!==t)return null;var r=Fs;return 0===(r=Fe(e,e===Ts?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(fc(e,r,n),tf(e,pe()),null!=e.callbackNode&&e.callbackNode===t?rf.bind(null,e):null)}function lf(e,n){if(Rc())return null;fc(e,n,!0)}function af(){if(0===Gc){var e=Zl;0===e&&(e=Ne,!(261888&(Ne<<=1))&&(Ne=256)),Gc=e}return Gc}function of(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:Un(""+e)}function uf(e,n){var t=n.ownerDocument.createElement("input");return t.name=n.name,t.value=n.value,e.id&&t.setAttribute("form",e.id),n.parentNode.insertBefore(t,n),e=new FormData(e),t.parentNode.removeChild(t),e}function sf(e,n,t,r,l){if("submit"===n&&t&&t.stateNode===l){var a=of((l[Ke]||null).action),o=r.submitter;o&&(null!==(n=(n=o[Ke]||null)?of(n.formAction):o.getAttribute("formAction"))&&(a=n,o=null));var u=new ct("action","action",null,r,l);e.push({event:u,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==Gc){var e=o?uf(l,o):new FormData(l);du(t,{pending:!0,data:e,method:l.method,action:a},null,e)}}else"function"==typeof a&&(u.preventDefault(),e=o?uf(l,o):new FormData(l),du(t,{pending:!0,data:e,method:l.method,action:a},a,e))},currentTarget:l}]})}}for(var cf=0;cf<Dr.length;cf++){var ff=Dr[cf];Or(ff.toLowerCase(),"on"+(ff[0].toUpperCase()+ff.slice(1)))}Or(Cr,"onAnimationEnd"),Or(zr,"onAnimationIteration"),Or(Pr,"onAnimationStart"),Or("dblclick","onDoubleClick"),Or("focusin","onFocus"),Or("focusout","onBlur"),Or(Nr,"onTransitionRun"),Or(Lr,"onTransitionStart"),Or(Tr,"onTransitionCancel"),Or(_r,"onTransitionEnd"),fn("onMouseEnter",["mouseout","mouseover"]),fn("onMouseLeave",["mouseout","mouseover"]),fn("onPointerEnter",["pointerout","pointerover"]),fn("onPointerLeave",["pointerout","pointerover"]),cn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cn("onSelect","focusout contextmenu dragend focu
272sin keydown keyup mousedown mouseup selectionchange".split(" ")),cn("onBeforeInput",["compositionend","keypress","textInput","paste"]),cn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var df="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(" "),pf=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(df));function mf(e,n){n=!!(4&n);for(var t=0;t<e.length;t++){var r=e[t],l=r.event;r=r.listeners;e:{var a=void 0;if(n)for(var o=r.length-1;0<=o;o--){var u=r[o],i=u.instance,s=u.currentTarget;if(u=u.listener,i!==a&&l.isPropagationStopped())break e;a=u,l.currentTarget=s;try{a(l)}catch(e){Mr(e)}l.currentTarget=null,a=i}else for(o=0;o<r.length;o++){if(i=(u=r[o]).instance,s=u.currentTarget,u=u.listener,i!==a&&l.isPropagationStopped())break e;a=u,l.currentTarget=s;try{a(l)}catch(e){Mr(e)}l.currentTarget=null,a=i}}}}function hf(e,n){var t=n[Xe];void 0===t&&(t=n[Xe]=new Set);var r=e+"__bubble";t.has(r)||(bf(n,e,2,!1),t.add(r))}function gf(e,n,t){var r=0;n&&(r|=4),bf(t,e,r,n)}var vf="_reactListening"+Math.random().toString(36).slice(2);function yf(e){if(!e[vf]){e[vf]=!0,un.forEach(function(n){"selectionchange"!==n&&(pf.has(n)||gf(n,!1,e),gf(n,!0,e))});var n=9===e.nodeType?e:e.ownerDocument;null===n||n[vf]||(n[vf]=!0,gf("selectionchange",!1,n))}}function bf(e,n,t,r){switch(ep(n)){case 2:var l=Kd;break;case 8:l=Yd;break;default:l=Xd}t=l.bind(null,n,t,e),l=void 0,!Xn||"touchstart"!==n&&"touchmove"!==n&&"wheel"!==n||(l=!0),r?void 0!==l?e.addEventListener(n,t,{capture:!0,passive:l}):e.addEventListener(n,t,!0):void 0!==l?e.addEventListener(n,t,{passive:l}):e.addEventListener(n,t,!1)}function kf(e,n,t,r,l){var a=r;if(!(1&n||2&n||null===r))e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var u=r.stateNode.containerInfo;if(u===l)break;if(4===o)for(o=r.return;null!==o;){var i=o.tag;if((3===i||4===i)&&o.stateNode.containerInfo===l)return;o=o.return}for(;null!==u;){if(null===(o=tn(u)))return;if(5===(i=o.tag)||6===i||26===i||27===i){r=a=o;continue e}u=u.parentNode}}r=r.return}qn(function(){var r=a,l=Vn(t),o=[];e:{var u=Fr.get(e);if(void 0!==u){var i=ct,s=e;switch(e){case"keypress":if(0===tt(t))break e;case"keydown":case"keyup":i=Ct;break;case"focusin":s="focus",i=gt;break;case"focusout":s="blur",i=gt;break;case"beforeblur":case"afterblur":i=gt;break;case"click":if(2===t.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":i=mt;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":i=ht;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":i=Pt;break;case Cr:case zr:case Pr:i=vt;break;case _r:i=Nt;break;case"scroll":case"scrollend":i=dt;break;case"wheel":i=Lt;break;case"copy":case"cut":case"paste":i=yt;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":i=zt;break;case"toggle":case"beforetoggle":i=Tt}var c=!!(4&n),f=!c&&("scroll"===e||"scrollend"===e),p=c?null!==u?u+"Capture":null:u;c=[];for(var m,h=r;null!==h;){var g=h;if(m=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===m||null===p||null!=(g=Kn(h,p))&&c.push(wf(h,g,m)),f)break;h=h.return}0<c.length&&(u=new i(u,s,null,t,l),o.push({event:u,listeners:c}))}}if(!(7&n)){if(i="mouseout"===e||"pointerout"===e,(!(u="mouseover"===e||"pointerover"===e)||t===jn||!(s=t.relatedTarget||t.fromElement)||!tn(s)&&!s[Ye])&&(i||u)&&(u=l.window===l?l:(u=l.ownerDocument)?u.defaultView||u.parentWindow:window,i?(i=r,null!==(s=(s=t.relatedTarget||t.toElement)?tn(s):null)&&(f=d(s),c=s.tag,s!==f||5!==c&&27!==c&&6!==c)&&(s=null)):(i=null,s=r),i!==s)){if(c=mt,g="onMouseLeave",p="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=zt,g="onPointerLeave",p="onPointerEnter",h="pointer"),f=null==i?u:ln(i),m=null==s?u:ln(s),(u=new c(g,h+"leave",i,t,l)).target=f,u.relatedTarget=m,g=null,tn(l)===r&&((c=new c(p,h+"enter",s,t,l)).target=m,c.relatedTarget=f,g=c),f=g,i&&s)e:{for(c=Ef,h=s,m=0,g=p=i;g;g=c(g))m++;g=0;for(var v=h;v;v=c(v))g++;for(;0<m-g;)p=c(p),m--;for(;0<g-m;)h=c(h),g--;for(;m--;){if(p===h||null!==h&&p===h.alternate){c=p;break e}p=c(p),h=c(h)}c=null}else c=null;null!==i&&xf(o,u,i,c,!1),null!==s&&null!==f&&xf(o,f,s,c,!0)}if("select"===(i=(u=r?ln(r):window).nodeName&&u.nodeName.toLowerCase())||"input"===i&&"file"===u.type)var y=Xt;else if(Bt(u))if(Gt)y=or;else{y=lr;var b=rr}else!(i=u.nodeName)||"input"!==i.toLowerCase()||"checkbox"!==u.type&&"radio"!==u.type?r&&An(r.elementType)&&(y=Xt):y=ar;switch(y&&(y=y(e,r))?Ht(o,y,t,l):(b&&b(e,u,r),"focusout"===e&&r&&"number"===u.type&&null!=r.memoizedProps.value&&Nn(u,"number",u.value)),b=r?ln(r):window,e){case"focusin":(Bt(b)||"true"===b.contentEditable)&&(hr=b,gr=r,vr=null);break;case"focusout":vr=gr=hr=null;break;case"mousedown":yr=!0;break;case"contextmenu":case"mouseup":case"dragend":yr=!1,br(o,t,l);break;case"selectionchange":if(mr)break;case"keydown":case"keyup":br(o,t,l)}var k;
vendor: 4,392 bytes, line 272
272if(Ft)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else $t?It(e,t)&&(w="onCompositionEnd"):"keydown"===e&&229===t.keyCode&&(w="onCompositionStart");w&&(Mt&&"ko"!==t.locale&&($t||"onCompositionStart"!==w?"onCompositionEnd"===w&&$t&&(k=nt()):(Jn="value"in(Zn=l)?Zn.value:Zn.textContent,$t=!0)),0<(b=Sf(r,w)).length&&(w=new bt(w,e,null,t,l),o.push({event:w,listeners:b}),k?w.data=k:null!==(k=Ut(t))&&(w.data=k))),(k=Ot?jt(e,t):Vt(e,t))&&(0<(w=Sf(r,"onBeforeInput")).length&&(b=new bt("onBeforeInput","beforeinput",null,t,l),o.push({event:b,listeners:w}),b.data=k)),sf(o,e,r,t,l)}mf(o,n)})}function wf(e,n,t){return{instance:e,listener:n,currentTarget:t}}function Sf(e,n){for(var t=n+"Capture",r=[];null!==e;){var l=e,a=l.stateNode;if(5!==(l=l.tag)&&26!==l&&27!==l||null===a||(null!=(l=Kn(e,t))&&r.unshift(wf(e,l,a)),null!=(l=Kn(e,n))&&r.push(wf(e,l,a))),3===e.tag)return r;e=e.return}return[]}function Ef(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function xf(e,n,t,r,l){for(var a=n._reactName,o=[];null!==t&&t!==r;){var u=t,i=u.alternate,s=u.stateNode;if(u=u.tag,null!==i&&i===r)break;5!==u&&26!==u&&27!==u||null===s||(i=s,l?null!=(s=Kn(t,a))&&o.unshift(wf(t,s,i)):l||null!=(s=Kn(t,a))&&o.push(wf(t,s,i))),t=t.return}0!==o.length&&e.push({event:n,listeners:o})}var Cf=/\r\n?/g,zf=/\u0000|\uFFFD/g;function Pf(e){return("string"==typeof e?e:""+e).replace(Cf,"\n").replace(zf,"")}function Nf(e,n){return n=Pf(n),Pf(e)===n}function Lf(e,n,t,r,l,a){switch(t){case"children":"string"==typeof r?"body"===n||"textarea"===n&&""===r||Fn(e,r):("number"==typeof r||"bigint"==typeof r)&&"body"!==n&&Fn(e,""+r);break;case"className":gn(e,"class",r);break;case"tabIndex":gn(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":gn(e,t,r);break;case"style":Mn(e,r,a);break;case"data":if("object"!==n){gn(e,"data",r);break}case"src":case"href":if(""===r&&("a"!==n||"href"!==t)){e.removeAttribute(t);break}if(null==r||"function"==typeof r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(t);break}r=Un(""+r),e.setAttribute(t,r);break;case"action":case"formAction":if("function"==typeof r){e.setAttribute(t,"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}if("function"==typeof a&&("formAction"===t?("input"!==n&&Lf(e,n,"name",l.name,l,null),Lf(e,n,"formEncType",l.formEncType,l,null),Lf(e,n,"formMethod",l.formMethod,l,null),Lf(e,n,"formTarget",l.formTarget,l,null)):(Lf(e,n,"encType",l.encType,l,null),Lf(e,n,"method",l.method,l,null),Lf(e,n,"target",l.target,l,null))),null==r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(t);break}r=Un(""+r),e.setAttribute(t,r);break;case"onClick":null!=r&&(e.onclick=$n);break;case"onScroll":null!=r&&hf("scroll",e);break;case"onScrollEnd":null!=r&&hf("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(c(61));if(null!=(t=r.__html)){if(null!=l.children)throw Error(c(60));e.innerHTML=t}}break;case"multiple":e.multiple=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"muted":e.muted=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==r||"function"==typeof r||"boolean"==typeof r||"symbol"==typeof r){e.removeAttribute("xlink:href");break}t=Un(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(t,""+r):e.removeAttribute(t);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"playsInl
272ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(t,""):e.removeAttribute(t);break;case"capture":case"download":!0===r?e.setAttribute(t,""):!1!==r&&null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(t,r):e.removeAttribute(t);break;case"cols":case"rows":case"size":case"span":null!=r&&"function"!=typeof r&&"symbol"!=typeof r&&!isNaN(r)&&1<=r?e.setAttribute(t,r):e.removeAttribute(t);break;case"rowSpan":case"start":null==r||"function"==typeof r||"symbol"==typeof r||isNaN(r)?e.removeAttribute(t):e.setAttribute(t,r);break;case"popover":hf("beforetoggle",e),hf("toggle",e),hn(e,"popover",r);break;case"xlinkActuate":vn(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":vn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":vn(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":vn(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":vn(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":vn(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":vn(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":vn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":vn(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":hn(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&hn(e,t=Rn.get(t)||t,r)}}function Tf(e,n,t,r,l,a){switch(t){case"style":Mn(e,r,a);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(c(61));if(null!=(t=r.__html)){if(null!=l.children)throw Error(c(60));e.innerHTML=t}}break;case"children":"string"==typeof r?Fn(e,r):("number"==typeof r||"bigint"==typeof r)&&Fn(e,""+r);break;case"onScroll":null!=r&&hf("scroll",e);break;case"onScrollEnd":null!=r&&hf("scrollend",e);break;case"onClick":null!=r&&(e.onclick=$n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:sn.hasOwnProperty(t)||("o"!==t[0]||"n"!==t[1]||(l=t.endsWith("Capture"),n=t.slice(2,l?t.length-7:void 0),"function"==typeof(a=null!=(a=e[Ke]||null)?a[t]:null)&&e.removeEventListener(n,a,l),"function"!=typeof r)?t in e?e[t]=r:!0===r?e.setAttribute(t,""):hn(e,t,r):("function"!=typeof a&&null!==a&&(t in e?e[t]=null:e.hasAttribute(t)&&e.removeAttribute(t)),e.addEventListener(n,r,l)))}}function _f(e,n,t){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":hf("error",e),hf("load",e);var r,l=!1,a=!1;for(r in t)if(t.hasOwnProperty(r)){var o=t[r];if(null!=o)switch(r){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,n));default:Lf(e,n,r,o,t,null)}}return a&&Lf(e,n,"srcSet",t.srcSet,t,null),void(l&&Lf(e,n,"src",t.src,t,null));case"input":hf("invalid",e);var u=r=o=a=null,i=null,s=null;for(l in t)if(t.hasOwnProperty(l)){var f=t[l];if(null!=f)switch(l){case"name":a=f;break;case"type":o=f;break;case"checked":i=f;break;case"defaultChecked":s=f;break;case"value":r=f;break;case"defaultValue":u=f;break;case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(c(137,n));break;default:Lf(e,n,l,f,t,null)}}return void Pn(e,r,u,i,s,o,a,!1);case"select":for(a in hf("invalid",e),l=o=r=null,t)if(t.hasOwnProperty(a)&&null!=(u=t[a]))switch(a){case"value":r=u;break;case"defaultValue":o=u;break;case"multiple":l=u;default:Lf(e,n,a,u,t,null)}return n=r,t=o,e.multiple=!!l,void(null!=n?Ln(e,!!l,n,!1):null!=t&&Ln(e,!!l,t,!0));case"textarea":for(o in hf("invalid",e),r=a=l=null,t)if(t.hasOwnProperty(o)&&null!=(u=t[o]))switch(o){case"value":l=u;break;case"defaultValue":a=u;break;case"children":r=u;break;case"dangerouslySetInnerHTML":if(null!=u)throw Error(c(91));break;default:Lf(e,n,o,u,t,null)}return void _n(e,l,a,r);case"option":for(i in t)if(t.hasOwnProperty(i)&&null!=(l=t[i]))if("selected"===i)e.selected=l&&"function"!=typeof l&&"symbol"!=typeof l;else Lf(e,n,i,l,t,null);return;case"dialog":hf("beforetoggle",e),hf("toggle",e),hf("cancel",e),hf("close",e);break;case"iframe":case"object":hf("load",e);break;case"video":case"audio":for(l=0;l<df.length;l++)hf(df[l],e);break;case"image":hf("error",e),hf("load",e);break;case"details":hf("toggle",e);break;case"embed":case"source":case"link":hf("error",e),hf("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(s in t)if(t.hasOwnProperty(s)&&null!=(l=t[s]))switch(s){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,n));default:Lf(e,n,s,l,t,null)}return;default:if(An(n)){for(f in t)t.hasOwnProperty(f)&&(void 0!==(l=t[f])&&Tf(e,n,f,l,t,void 0));return}}for(u in t)t.hasOwnProperty(u)&&(null!=(l=t[u])&&Lf(e,n,u,l,t,null))}function Ff(e,n,t,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;
vendor: 5,316 bytes, line 272
272case"input":var l=null,a=null,o=null,u=null,i=null,s=null,f=null;for(m in t){var d=t[m];if(t.hasOwnProperty(m)&&null!=d)switch(m){case"checked":case"value":break;case"defaultValue":i=d;default:r.hasOwnProperty(m)||Lf(e,n,m,null,r,d)}}for(var p in r){var m=r[p];if(d=t[p],r.hasOwnProperty(p)&&(null!=m||null!=d))switch(p){case"type":a=m;break;case"name":l=m;break;case"checked":s=m;break;case"defaultChecked":f=m;break;case"value":o=m;break;case"defaultValue":u=m;break;case"children":case"dangerouslySetInnerHTML":if(null!=m)throw Error(c(137,n));break;default:m!==d&&Lf(e,n,p,m,r,d)}}return void zn(e,o,u,i,s,f,a,l);case"select":for(a in m=o=u=p=null,t)if(i=t[a],t.hasOwnProperty(a)&&null!=i)switch(a){case"value":break;case"multiple":m=i;default:r.hasOwnProperty(a)||Lf(e,n,a,null,r,i)}for(l in r)if(a=r[l],i=t[l],r.hasOwnProperty(l)&&(null!=a||null!=i))switch(l){case"value":p=a;break;case"defaultValue":u=a;break;case"multiple":o=a;default:a!==i&&Lf(e,n,l,a,r,i)}return n=u,t=o,r=m,void(null!=p?Ln(e,!!t,p,!1):!!r!=!!t&&(null!=n?Ln(e,!!t,n,!0):Ln(e,!!t,t?[]:"",!1)));case"textarea":for(u in m=p=null,t)if(l=t[u],t.hasOwnProperty(u)&&null!=l&&!r.hasOwnProperty(u))switch(u){case"value":case"children":break;default:Lf(e,n,u,null,r,l)}for(o in r)if(l=r[o],a=t[o],r.hasOwnProperty(o)&&(null!=l||null!=a))switch(o){case"value":p=l;break;case"defaultValue":m=l;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(c(91));break;default:l!==a&&Lf(e,n,o,l,r,a)}return void Tn(e,p,m);case"option":for(var h in t)if(p=t[h],t.hasOwnProperty(h)&&null!=p&&!r.hasOwnProperty(h))if("selected"===h)e.selected=!1;else Lf(e,n,h,null,r,p);for(i in r)if(p=r[i],m=t[i],r.hasOwnProperty(i)&&p!==m&&(null!=p||null!=m))if("selected"===i)e.selected=p&&"function"!=typeof p&&"symbol"!=typeof p;else Lf(e,n,i,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 t)p=t[g],t.hasOwnProperty(g)&&null!=p&&!r.hasOwnProperty(g)&&Lf(e,n,g,null,r,p);for(s in r)if(p=r[s],m=t[s],r.hasOwnProperty(s)&&p!==m&&(null!=p||null!=m))switch(s){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(c(137,n));break;default:Lf(e,n,s,p,r,m)}return;default:if(An(n)){for(var v in t)p=t[v],t.hasOwnProperty(v)&&void 0!==p&&!r.hasOwnProperty(v)&&Tf(e,n,v,void 0,r,p);for(f in r)p=r[f],m=t[f],!r.hasOwnProperty(f)||p===m||void 0===p&&void 0===m||Tf(e,n,f,p,r,m);return}}for(var y in t)p=t[y],t.hasOwnProperty(y)&&null!=p&&!r.hasOwnProperty(y)&&Lf(e,n,y,null,r,p);for(d in r)p=r[d],m=t[d],!r.hasOwnProperty(d)||p===m||null==p&&null==m||Lf(e,n,d,p,r,m)}function Df(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Of(){if("function"==typeof performance.getEntriesByType){for(var e=0,n=0,t=performance.getEntriesByType("resource"),r=0;r<t.length;r++){var l=t[r],a=l.transferSize,o=l.initiatorType,u=l.duration;if(a&&u&&Df(o)){for(o=0,u=l.responseEnd,r+=1;r<t.length;r++){var i=t[r],s=i.startTime;if(s>u)break;var c=i.transferSize,f=i.initiatorType;c&&Df(f)&&(o+=c*((i=i.responseEnd)<u?1:(u-s)/(i-s)))}if(--r,n+=8*(a+o)/(l.duration/1e3),10<++e)break}}if(0<e)return n/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}var Mf=null,Af=null;function Rf(e){return 9===e.nodeType?e:e.ownerDocument}function If(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 Uf(e,n){if(0===e)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===n?0:e}function $f(e,n){return"textarea"===e||"noscript"===e||"string"==typeof n.children||"number"==typeof n.children||"bigint"==typeof n.children||"object"==typeof n.dangerouslySetInnerHTML&&null!==n.dangerouslySetInnerHTML&&null!=n.dangerouslySetInnerHTML.__html}var jf=null;function Vf(){var e=window.event;return e&&"popstate"===e.type?e!==jf&&(jf=e,!0):(jf=null,!1)}var Qf="function"==typeof setTimeout?setTimeout:void 0,Bf="function"==typeof clearTimeout?clearTimeout:void 0,Hf="function"==typeof Promise?Promise:void 0,Wf="function"==typeof queueMicrotask?queueMicrotask:void 0!==Hf?function(e){return Hf.resolve(null).then(e).catch(qf)}:Qf;function qf(e){setTimeout(function(){throw e})}function Kf(e){return"head"===e}function Yf(e,n){var t=n,r=0;do{var l=t.nextSibling;if(e.removeChild(t),l&&8===l.nodeType)if("/$"===(t=l.data)||"/&"===t){if(0===r)return e.removeChild(l),void bp(n);r--}else if("$"===t||"$?"===t||"$~"===t||"$!"===t||"&"===t)r++;else if("html"===t)sd(e.ownerDocument.documentElement);else if("head"===t){sd(t=e.ownerDocument.head);for(var a=t.firstChild;a;){var o=a.nextSibling,u=a.nodeName;a[en]||"SCRIPT"===u||"STYLE"===u||"LINK"===u&&"stylesheet"===a.rel.toLowerCase()||t.removeChild(a),a=o}}else"body"===t&&sd(e.ownerDocument.body);t=l}while(t);bp(n)}function Xf(e,n){var t=e;e=0;do{var r=t.nextSibling;if(1===t.nodeType?n?(t._stashedDisplay=t.style.display,t.style.display="none"):(t.style.display=t._stashedDisplay||"",""===t.getAttribute("style")&&t.removeAttribute("style")):3===t.nodeType&&(n?(t._stashedText=t.nodeValue,t.nodeValue=""):t.nodeValue=t._stashedText||""),r&&8===r.
vendor: 4,257 bytes, line 272
272nodeType)if("/$"===(t=r.data)){if(0===e)break;e--}else"$"!==t&&"$?"!==t&&"$~"!==t&&"$!"!==t||e++;t=r}while(t)}function Gf(e){var n=e.firstChild;for(n&&10===n.nodeType&&(n=n.nextSibling);n;){var t=n;switch(n=n.nextSibling,t.nodeName){case"HTML":case"HEAD":case"BODY":Gf(t),nn(t);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===t.rel.toLowerCase())continue}e.removeChild(t)}}function Zf(e,n,t,r){for(;1===e.nodeType;){var l=t;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[en])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(a=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(a!==l.rel||e.getAttribute("href")!==(null==l.href||""===l.href?null:l.href)||e.getAttribute("crossorigin")!==(null==l.crossOrigin?null:l.crossOrigin)||e.getAttribute("title")!==(null==l.title?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((a=e.getAttribute("src"))!==(null==l.src?null:l.src)||e.getAttribute("type")!==(null==l.type?null:l.type)||e.getAttribute("crossorigin")!==(null==l.crossOrigin?null:l.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==n||"hidden"!==e.type)return e;var a=null==l.name?null:""+l.name;if("hidden"===l.type&&e.getAttribute("name")===a)return e}if(null===(e=ld(e.nextSibling)))break}return null}function Jf(e,n,t){if(""===n)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t)return null;if(null===(e=ld(e.nextSibling)))return null}return e}function ed(e,n){for(;8!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=ld(e.nextSibling)))return null}return e}function nd(e){return"$?"===e.data||"$~"===e.data}function td(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function rd(e,n){var t=e.ownerDocument;if("$~"===e.data)e._reactRetry=n;else if("$?"!==e.data||"loading"!==t.readyState)n();else{var r=function(){n(),t.removeEventListener("DOMContentLoaded",r)};t.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ld(e){for(;null!=e;e=e.nextSibling){var n=e.nodeType;if(1===n||3===n)break;if(8===n){if("$"===(n=e.data)||"$!"===n||"$?"===n||"$~"===n||"&"===n||"F!"===n||"F"===n)break;if("/$"===n||"/&"===n)return null}}return e}var ad=null;function od(e){e=e.nextSibling;for(var n=0;e;){if(8===e.nodeType){var t=e.data;if("/$"===t||"/&"===t){if(0===n)return ld(e.nextSibling);n--}else"$"!==t&&"$!"!==t&&"$?"!==t&&"$~"!==t&&"&"!==t||n++}e=e.nextSibling}return null}function ud(e){e=e.previousSibling;for(var n=0;e;){if(8===e.nodeType){var t=e.data;if("$"===t||"$!"===t||"$?"===t||"$~"===t||"&"===t){if(0===n)return e;n--}else"/$"!==t&&"/&"!==t||n++}e=e.previousSibling}return null}function id(e,n,t){switch(n=Rf(t),e){case"html":if(!(e=n.documentElement))throw Error(c(452));return e;case"head":if(!(e=n.head))throw Error(c(453));return e;case"body":if(!(e=n.body))throw Error(c(454));return e;default:throw Error(c(451))}}function sd(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);nn(e)}var cd=new Map,fd=new Set;function dd(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var pd=$.d;$.d={f:function(){var e=pd.f(),n=hc();return e||n},r:function(e){var n=rn(e);null!==n&&5===n.tag&&"form"===n.type?mu(n):pd.r(e)},D:function(e){pd.D(e),hd("dns-prefetch",e,null)},C:function(e,n){pd.C(e,n),hd("preconnect",e,n)},L:function(e,n,t){pd.L(e,n,t);var r=md;if(r&&e&&n){var l='link[rel="preload"][as="'+Cn(n)+'"]';"image"===n&&t&&t.imageSrcSet?(l+='[imagesrcset="'+Cn(t.imageSrcSet)+'"]',"string"==typeof t.imageSizes&&(l+='[imagesizes="'+Cn(t.imageSizes)+'"]')):l+='[href="'+Cn(e)+'"]';var a=l;switch(n){case"style":a=vd(e);break;case"script":a=kd(e)}cd.has(a)||(e=y({rel:"preload",href:"image"===n&&t&&t.imageSrcSet?void 0:e,as:n},t),cd.set(a,e),null!==r.querySelector(l)||"style"===n&&r.querySelector(yd(a))||"script"===n&&r.querySelector(wd(a))||(_f(n=r.createElement("link"),"link",e),on(n),r.head.appendChild(n)))}},m:function(e,n){pd.m(e,n);var t=md;
vendor: 8,397 bytes, line 272
272if(t&&e){var r=n&&"string"==typeof n.as?n.as:"script",l='link[rel="modulepreload"][as="'+Cn(r)+'"][href="'+Cn(e)+'"]',a=l;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=kd(e)}if(!cd.has(a)&&(e=y({rel:"modulepreload",href:e},n),cd.set(a,e),null===t.querySelector(l))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(t.querySelector(wd(a)))return}_f(r=t.createElement("link"),"link",e),on(r),t.head.appendChild(r)}}},X:function(e,n){pd.X(e,n);var t=md;if(t&&e){var r=an(t).hoistableScripts,l=kd(e),a=r.get(l);a||((a=t.querySelector(wd(l)))||(e=y({src:e,async:!0},n),(n=cd.get(l))&&Cd(e,n),on(a=t.createElement("script")),_f(a,"link",e),t.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(l,a))}},S:function(e,n,t){pd.S(e,n,t);var r=md;if(r&&e){var l=an(r).hoistableStyles,a=vd(e);n=n||"default";var o=l.get(a);if(!o){var u={loading:0,preload:null};if(o=r.querySelector(yd(a)))u.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},t),(t=cd.get(a))&&xd(e,t);var i=o=r.createElement("link");on(i),_f(i,"link",e),i._p=new Promise(function(e,n){i.onload=e,i.onerror=n}),i.addEventListener("load",function(){u.loading|=1}),i.addEventListener("error",function(){u.loading|=2}),u.loading|=4,Ed(o,n,r)}o={type:"stylesheet",instance:o,count:1,state:u},l.set(a,o)}}},M:function(e,n){pd.M(e,n);var t=md;if(t&&e){var r=an(t).hoistableScripts,l=kd(e),a=r.get(l);a||((a=t.querySelector(wd(l)))||(e=y({src:e,async:!0,type:"module"},n),(n=cd.get(l))&&Cd(e,n),on(a=t.createElement("script")),_f(a,"link",e),t.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(l,a))}}};var md="undefined"==typeof document?null:document;function hd(e,n,t){var r=md;if(r&&"string"==typeof n&&n){var l=Cn(n);l='link[rel="'+e+'"][href="'+l+'"]',"string"==typeof t&&(l+='[crossorigin="'+t+'"]'),fd.has(l)||(fd.add(l),e={rel:e,crossOrigin:t,href:n},null===r.querySelector(l)&&(_f(n=r.createElement("link"),"link",e),on(n),r.head.appendChild(n)))}}function gd(e,n,t,r){var l,a,o,u,i=(i=G.current)?dd(i):null;if(!i)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof t.precedence&&"string"==typeof t.href?(n=vd(t.href),(r=(t=an(i).hoistableStyles).get(n))||(r={type:"style",instance:null,count:0,state:null},t.set(n,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===t.rel&&"string"==typeof t.href&&"string"==typeof t.precedence){e=vd(t.href);var s=an(i).hoistableStyles,f=s.get(e);if(f||(i=i.ownerDocument||i,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,f),(s=i.querySelector(yd(e)))&&!s._p&&(f.instance=s,f.state.loading=5),cd.has(e)||(t={rel:"preload",as:"style",href:t.href,crossOrigin:t.crossOrigin,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy},cd.set(e,t),s||(l=i,a=e,o=t,u=f.state,l.querySelector('link[rel="preload"][as="style"]['+a+"]")?u.loading=1:(a=l.createElement("link"),u.preload=a,a.addEventListener("load",function(){return u.loading|=1}),a.addEventListener("error",function(){return u.loading|=2}),_f(a,"link",o),on(a),l.head.appendChild(a))))),n&&null===r)throw Error(c(528,""));return f}if(n&&null!==r)throw Error(c(529,""));return null;case"script":return n=t.async,"string"==typeof(t=t.src)&&n&&"function"!=typeof n&&"symbol"!=typeof n?(n=kd(t),(r=(t=an(i).hoistableScripts).get(n))||(r={type:"script",instance:null,count:0,state:null},t.set(n,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function vd(e){return'href="'+Cn(e)+'"'}function yd(e){return'link[rel="stylesheet"]['+e+"]"}function bd(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function kd(e){return'[src="'+Cn(e)+'"]'}function wd(e){return"script[async]"+e}function Sd(e,n,t){if(n.count++,null===n.instance)switch(n.type){case"style":var r=e.querySelector('style[data-href~="'+Cn(t.href)+'"]');if(r)return n.instance=r,on(r),r;var l=y({},t,{"data-href":t.href,"data-precedence":t.precedence,href:null,precedence:null});return on(r=(e.ownerDocument||e).createElement("style")),_f(r,"style",l),Ed(r,t.precedence,e),n.instance=r;case"stylesheet":l=vd(t.href);var a=e.querySelector(yd(l));if(a)return n.state.loading|=4,n.instance=a,on(a),a;r=bd(t),(l=cd.get(l))&&xd(r,l),on(a=(e.ownerDocument||e).createElement("link"));var o=a;return o._p=new Promise(function(e,n){o.onload=e,o.onerror=n}),_f(a,"link",r),n.state.loading|=4,Ed(a,t.precedence,e),n.instance=a;case"script":return a=kd(t.src),(l=e.querySelector(wd(a)))?(n.instance=l,on(l),l):(r=t,(l=cd.get(a))&&Cd(r=y({},t),l),on(l=(e=e.ownerDocument||e).createElement("script")),_f(l,"link",r),e.head.appendChild(l),n.instance=l);case"void":return null;default:throw Error(c(443,n.type))}else"stylesheet"===n.type&&!(4&n.state.loading)&&(r=n.instance,n.state.loading|=4,Ed(r,t.precedence,e));return n.instance}function Ed(e,n,t){for(var r=t.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=r.length?r[r.length-1]:null,a=l,o=0;o<r.length;o++){var u=r[o];if(u.dataset.precedence===n)a=u;else if(a!==l)break}a?a.parentNode.insertBefore(e,a.nextSibling):(n=9===t.nodeType?t.head:t).insertBefore(e,n.firstChild)}function xd(e,n){null==e.crossOrigin&&(e.crossOrigin=n.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=n.referrerPolicy),null==e.title&&(e.title=n.title)}function Cd(e,n){null==e.crossOrigin&&(e.crossOrigin=n.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=n.referrerPolicy),null==e.integrity&&(e.integrity=n.integrity)}var zd=null;function Pd(e,n,t){if(null===zd){var r=new Map,l=zd=new Map;l.set(t,r)}else(r=(l=zd).get(t))||(r=new Map,l.set(t,r));if(r.has(e))return r;for(r.set(e,null),t=t.getElementsByTagName(e),l=0;l<t.length;l++){var a=t[l];if(!(a[en]||a[qe]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var o=a.getAttribute(n)||"";o=e+o;var u=r.get(o);u?u.push(a):r.set(o,[a])}}return r}function Nd(e,n,t){(e=e.ownerDocument||e).head.insertBefore(t,"title"===n?e.querySelector("head > title"):null)}function Ld(e,n,t){if(1===t||null!=n.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof n.precedence||"string"!=typeof n.href||""===n.href)break;return!0;case"link":if("string"!=typeof n.rel||"string"!=typeof n.href||""===n.href||n.onLoad||n.onError)break;return"stylesheet"!==n.rel||(e=n.disabled,"string"==typeof n.precedence&&null==e);case"script":if(n.async&&"function"!=typeof n.async&&"symbol"!=typeof n.async&&!n.onLoad&&!n.onError&&n.src&&"string"==typeof n.src)return!0}return!1}function Td(e){return!!("stylesheet"!==e.type||3&e.state.loading)}function _d(e,n,t,r){if(!("stylesheet"!==t.type||"string"==typeof r.media&&!1===matchMedia(r.media).matches||4&t.state.loading)){if(null===t.instance){var l=vd(r.href),a=n.querySelector(yd(l));if(a)return null!==(n=a._p)&&"object"==typeof n&&"function"==typeof n.then&&(e.count++,e=Od.bind(e),n.then(e,e)),t.state.loading|=4,t.instance=a,void on(a);a=n.ownerDocument||n,r=bd(r),(l=cd.get(l))&&xd(r,l),on(a=a.createElement("link"));var o=a;o._p=new Promise(function(e,n){o.onload=e,o.onerror=n}),_f(a,"link",r),t.instance=a}null===e.stylesheets&&(e.stylesheets=new Map),e.stylesheets.set(t,n),(n=t.state.preload)&&!(3&t.state.loading)&&(e.count++,t=Od.bind(e),n.addEventListener("load",t),n.addEventListener("error",t))}}var Fd=0;function Dd(e,n){return e.stylesheets&&0===e.count&&Ad(e,e.stylesheets),0<e.count||0<e.imgCount?function(t){var r=setTimeout(function(){if(e.stylesheets&&Ad(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+n);0<e.imgBytes&&0===Fd&&(Fd=62500*Of());var l=setTimeout(function(){if(e.waitingForImages=!1,0===e.count&&(e.stylesheets&&Ad(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>Fd?50:800)+n);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(l)}}:null}function Od(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)Ad(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var Md=null;function Ad(e,n){e.stylesheets=null,null!==e.unsuspend&&(e.count++,Md=new Map,n.forEac
vendor: 6,872 bytes, line 272
272h(Rd,e),Md=null,Od.call(e))}function Rd(e,n){if(!(4&n.state.loading)){var t=Md.get(e);if(t)var r=t.get(null);else{t=new Map,Md.set(e,t);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<l.length;a++){var o=l[a];"LINK"!==o.nodeName&&"not all"===o.getAttribute("media")||(t.set(o.dataset.precedence,o),r=o)}r&&t.set(null,r)}o=(l=n.instance).getAttribute("data-precedence"),(a=t.get(o)||r)===r&&t.set(null,l),t.set(o,l),this.count++,r=Od.bind(this),l.addEventListener("load",r),l.addEventListener("error",r),a?a.parentNode.insertBefore(l,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(l,e.firstChild),n.state.loading|=4}}var Id={$$typeof:z,Provider:null,Consumer:null,_currentValue:j,_currentValue2:j,_threadCount:0};function Ud(e,n,t,r,l,a,o,u,i){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=Ae(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ae(0),this.hiddenUpdates=Ae(null),this.identifierPrefix=r,this.onUncaughtError=l,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=i,this.incompleteTransitions=new Map}function $d(e,n,t,r,l,a,o,u,i,s,c,f){return e=new Ud(e,n,t,o,i,s,c,f,u),n=1,!0===a&&(n|=24),a=qr(3,null,null,n),e.current=a,a.stateNode=e,(n=Kl()).refCount++,e.pooledCache=n,n.refCount++,a.memoizedState={element:r,isDehydrated:t,cache:n},za(a),e}function jd(e){return e?e=Hr:Hr}function Vd(e,n,t,r,l,a){l=jd(l),null===r.context?r.context=l:r.pendingContext=l,(r=Na(n)).payload={element:t},null!==(a=void 0===a?null:a)&&(r.callback=a),null!==(t=La(e,r,n))&&(cc(t,0,n),Ta(t,e,n))}function Qd(e,n){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var t=e.retryLane;e.retryLane=0!==t&&t<n?t:n}}function Bd(e,n){Qd(e,n),(e=e.alternate)&&Qd(e,n)}function Hd(e){if(13===e.tag||31===e.tag){var n=Vr(e,67108864);null!==n&&cc(n,0,67108864),Bd(e,67108864)}}function Wd(e){if(13===e.tag||31===e.tag){var n=ic(),t=Vr(e,n=Ve(n));null!==t&&cc(t,0,n),Bd(e,n)}}var qd=!0;function Kd(e,n,t,r){var l=U.T;U.T=null;var a=$.p;try{$.p=2,Xd(e,n,t,r)}finally{$.p=a,U.T=l}}function Yd(e,n,t,r){var l=U.T;U.T=null;var a=$.p;try{$.p=8,Xd(e,n,t,r)}finally{$.p=a,U.T=l}}function Xd(e,n,t,r){if(qd){var l=Gd(r);if(null===l)kf(e,n,r,Zd,t),sp(e,r);else if(fp(l,e,n,t,r))r.stopPropagation();else if(sp(e,r),4&n&&-1<ip.indexOf(e)){for(;null!==l;){var a=rn(l);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var o=_e(a.pendingLanes);if(0!==o){var u=a;for(u.pendingLanes|=2,u.entangledLanes|=2;o;){var i=1<<31-Ce(o);u.entanglements[1]|=i,o&=~i}Zc(a),!(6&Ls)&&(Xs=pe()+500,Jc(0,!1))}}break;case 31:case 13:null!==(u=Vr(a,2))&&cc(u,0,2),hc(),Bd(a,2)}if(null===(a=Gd(r))&&kf(e,n,r,Zd,t),a===l)break;l=a}null!==l&&r.stopPropagation()}else kf(e,n,r,null,t)}}function Gd(e){return Jd(e=Vn(e))}var Zd=null;function Jd(e){if(Zd=null,null!==(e=tn(e))){var n=d(e);if(null===n)e=null;else{var t=n.tag;if(13===t){if(null!==(e=p(n)))return e;e=null}else if(31===t){if(null!==(e=m(n)))return e;e=null}else if(3===t){if(n.stateNode.current.memoizedState.isDehydrated)return 3===n.tag?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Zd=e,null}function ep(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(me()){case he:return 2;case ge:return 8;case ve:case ye:return 32;case be:return 268435456;default:return 32}default:return 32}}var np=!1,tp=null,rp=null,lp=null,ap=new Map,op=new Map,up=[],ip="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 sp(e,n){switch(e){case"focusin":case"focusout":tp=null;break;case"dragenter":case"dragleave":rp=null;break;case"mouseover":case"mouseout":lp=null;break;case"pointerover":case"pointerout":ap.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":op.delete(n.pointerId)}}function cp(e,n,t,r,l,a){return null===e||e.nativeEvent!==a?(e={blockedOn:n,domEventName:t,eventSystemFlags:r,nativeEvent:a,targetContainers:[l]},null!==n&&(null!==(n=rn(n))&&Hd(n)),e):(e.eventSystemFlags|=r,n=e.targetContainers,null!==l&&-1===n.indexOf(l)&&n.push(l),e)}function fp(e,n,t,r,l){switch(n){case"focusin":return tp=cp(tp,e,n,t,r,l),!0;case"dragenter":return rp=cp(rp,e,n,t,r,l),!0;case"mouseover":return lp=cp(lp,e,n,t,r,l),!0;case"pointerover":var a=l.pointerId;return ap.set(a,cp(ap.get(a)||null,e,n,t,r,l)),!0;case"gotpointercapture":return a=l.pointerId,op.set(a,cp(op.get(a)||null,e,n,t,r,l)),!0}return!1}function dp(e){var n=tn(e.target);if(null!==n){var t=d(n);if(null!==t)if(13===(n=t.tag)){if(null!==(n=p(t)))return e.blockedOn=n,void He(e.priority,function(){Wd(t)})}else if(31===n){if(null!==(n=m(t)))return e.blockedOn=n,void He(e.priority,function(){Wd(t)})}else if(3===n&&t.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===t.tag?t.stateNode.containerInfo:null)}e.blockedOn=null}function pp(e){if(null!==e.blockedOn)return!1;for(var n=e.targetContainers;0<n.length;){var t=Gd(e.nativeEvent);if(null!==t)return null!==(n=rn(t))&&Hd(n),e.blockedOn=t,!1;var r=new(t=e.nativeEvent).constructor(t.type,t);jn=r,t.target.dispatchEvent(r),jn=null,n.shift()}return!0}function mp(e,n,t){pp(e)&&t.delete(n)}function hp(){np=!1,null!==tp&&pp(tp)&&(tp=null),null!==rp&&pp(rp)&&(rp=null),null!==lp&&pp(lp)&&(lp=null),ap.forEac
vendor: 11,105 bytes, lines 272-296
272h(mp),op.forEach(mp)}function gp(e,n){e.blockedOn===n&&(e.blockedOn=null,np||(np=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,hp)))}var vp=null;function yp(e){vp!==e&&(vp=e,u.unstable_scheduleCallback(u.unstable_NormalPriority,function(){vp===e&&(vp=null);for(var n=0;n<e.length;n+=3){var t=e[n],r=e[n+1],l=e[n+2];if("function"!=typeof r){if(null===Jd(r||t))continue;break}var a=rn(t);null!==a&&(e.splice(n,3),n-=3,du(a,{pending:!0,data:l,method:t.method,action:r},r,l))}}))}function bp(e){function n(n){return gp(n,e)}null!==tp&&gp(tp,e),null!==rp&&gp(rp,e),null!==lp&&gp(lp,e),ap.forEach(n),op.forEach(n);for(var t=0;t<up.length;t++){var r=up[t];r.blockedOn===e&&(r.blockedOn=null)}for(;0<up.length&&null===(t=up[0]).blockedOn;)dp(t),null===t.blockedOn&&up.shift();if(null!=(t=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<t.length;r+=3){var l=t[r],a=t[r+1],o=l[Ke]||null;if("function"==typeof a)o||yp(t);else if(o){var u=null;if(a&&a.hasAttribute("formAction")){if(l=a,o=a[Ke]||null)u=o.formAction;else if(null!==Jd(l))continue}else u=o.action;"function"==typeof u?t[r+1]=u:(t.splice(r,3),r-=3),yp(t)}}}function kp(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return l=e})},focusReset:"manual",scroll:"manual"})}function n(){null!==l&&(l(),l=null),r||setTimeout(t,20)}function t(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var r=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(t,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),null!==l&&(l(),l=null)}}}function wp(e){this._internalRoot=e}function Sp(e){this._internalRoot=e}Sp.prototype.render=wp.prototype.render=function(e){var n=this._internalRoot;if(null===n)throw Error(c(409));Vd(n.current,ic(),e,n,null,null)},Sp.prototype.unmount=wp.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var n=e.containerInfo;Vd(e.current,2,null,e,null,null),hc(),n[Ye]=null}},Sp.prototype.unstable_scheduleHydration=function(e){if(e){var n=Be();e={blockedOn:null,target:e,priority:n};for(var t=0;t<up.length&&0!==n&&n<up[t].priority;t++);up.splice(t,0,e),0===t&&dp(e)}};var Ep=i.version;if("19.2.3"!==Ep)throw Error(c(527,Ep,"19.2.3"));$.findDOMNode=function(e){var n=e._reactInternals;if(void 0===n){if("function"==typeof e.render)throw Error(c(188));throw e=Object.keys(e).join(","),Error(c(268,e))}return e=null===(e=null!==(e=g(n))?v(e):null)?null:e.stateNode};var xp={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.3"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Cp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cp.isDisabled&&Cp.supportsFiber)try{Se=Cp.inject(xp),Ee=Cp}catch(e){}}a.createRoot=function(e,n){if(!f(e))throw Error(c(299));var t=!1,r="",l=Mu,a=Au,o=Ru;return null!=n&&(!0===n.unstable_strictMode&&(t=!0),void 0!==n.identifierPrefix&&(r=n.identifierPrefix),void 0!==n.onUncaughtError&&(l=n.onUncaughtError),void 0!==n.onCaughtError&&(a=n.onCaughtError),void 0!==n.onRecoverableError&&(o=n.onRecoverableError)),n=$d(e,1,!1,null,0,t,r,null,l,a,o,kp),e[Ye]=n.current,yf(e),new wp(n)},a.hydrateRoot=function(e,n,t){if(!f(e))throw Error(c(299));var r=!1,l="",a=Mu,o=Au,u=Ru,i=null;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(l=t.identifierPrefix),void 0!==t.onUncaughtError&&(a=t.onUncaughtError),void 0!==t.onCaughtError&&(o=t.onCaughtError),void 0!==t.onRecoverableError&&(u=t.onRecoverableError),void 0!==t.formState&&(i=t.formState)),(n=$d(e,1,!0,n,0,r,l,i,a,o,u,kp)).context=jd(null),t=n.current,(l=Na(r=Ve(r=ic()))).callback=null,La(t,l,r),t=r,n.current.lanes=t,Re(n,t),Zc(n),e[Ye]=n.current,yf(e),new Sp(n)},a.version="19.2.3"},236,[237,11,239]); 273__d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},237,[238]); 274__d(function(g,r,i,_a,m,e,d){ 275/** 276 * @license React 277 * scheduler.production.js 278 * 279 * Copyright (c) Meta Platforms, Inc. and affiliates. 280 * 281 * This source code is licensed under the MIT license found in the 282 * LICENSE file in the root directory of this source tree. 283 */ 284"use strict";function n(n,t){var a=n.length;n.push(t);e:for(;0<a;){var o=a-1>>>1,u=n[o];if(!(0<l(u,t)))break e;n[o]=t,n[a]=u,a=o}}function t(n){return 0===n.length?null:n[0]}function a(n){if(0===n.length)return null;var t=n[0],a=n.pop();if(a!==t){n[0]=a;e:for(var o=0,u=n.length,s=u>>>1;o<s;){var f=2*(o+1)-1,c=n[f],b=f+1,p=n[b];if(0>l(c,a))b<u&&0>l(p,c)?(n[o]=p,n[b]=a,o=b):(n[o]=c,n[f]=a,o=f);else{if(!(b<u&&0>l(p,a)))break e;n[o]=p,n[b]=a,o=b}}}return t}function l(n,t){var a=n.sortIndex-t.sortIndex;return 0!==a?a:n.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,s=u.now();e.unstable_now=function(){return u.now()-s}}var f=[],c=[],b=1,p=null,v=3,y=!1,_=!1,k=!1,w=!1,h="function"==typeof setTimeout?setTimeout:null,T="function"==typeof clearTimeout?clearTimeout:null,x="undefined"!=typeof setImmediate?setImmediate:null;function I(l){for(var o=t(c);null!==o;){if(null===o.callback)a(c);else{if(!(o.startTime<=l))break;a(c),o.sortIndex=o.expirationTime,n(f,o)}o=t(c)}}function P(n){if(k=!1,I(n),!_)if(null!==t(f))_=!0,L||(L=!0,C());else{var a=t(c);null!==a&&N(P,a.startTime-n)}}var C,L=!1,M=-1,j=5,F=-1;function R(){return!!w||!(e.unstable_now()-F<j)}function q(){if(w=!1,L){var n=e.unstable_now();F=n;var l=!0;try{e:{_=!1,k&&(k=!1,T(M),M=-1),y=!0;var o=v;try{n:{for(I(n),p=t(f);null!==p&&!(p.expirationTime>n&&R());){var u=p.callback;if("function"==typeof u){p.callback=null,v=p.priorityLevel;var s=u(p.expirationTime<=n);if(n=e.unstable_now(),"function"==typeof s){p.callback=s,I(n),l=!0;break n}p===t(f)&&a(f),I(n)}else a(f);p=t(f)}if(null!==p)l=!0;else{var b=t(c);null!==b&&N(P,b.startTime-n),l=!1}}break e}finally{p=null,v=o,y=!1}l=void 0}}finally{l?C():L=!1}}}if("function"==typeof x)C=function(){x(q)};else if("undefined"!=typeof MessageChannel){var B=new MessageChannel,D=B.port2;B.port1.onmessage=q,C=function(){D.postMessage(null)}}else C=function(){h(q,0)};function N(n,t){M=h(function(){n(e.unstable_now())},t)}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(n){n.callback=null},e.unstable_forceFrameRate=function(n){0>n||125<n?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<n?Math.floor(1e3/n):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(n){switch(v){case 1:case 2:case 3:var t=3;break;default:t=v}var a=v;v=t;try{return n()}finally{v=a}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(n,t){switch(n){case 1:case 2:case 3:case 4:case 5:break;default:n=3}var a=v;v=n;try{return t()}finally{v=a}},e.unstable_scheduleCallback=function(a,l,o){var u=e.unstable_now();switch("object"==typeof o&&null!==o?o="number"==typeof(o=o.delay)&&0<o?u+o:u:o=u,a){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 a={id:b++,callback:l,priorityLevel:a,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>u?(a.sortIndex=o,n(c,a),null===t(f)&&a===t(c)&&(k?(T(M),M=-1):k=!0,N(P,o-u))):(a.sortIndex=s,n(f,a),_||y||(_=!0,L||(L=!0,C()))),a},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(n){var t=v;return function(){var a=v;v=t;try{return n.apply(this,arguments)}finally{v=a}}}},238,[]); 285__d(function(g,r,i,a,m,e,d){'use strict';!(function _(){if('undefined'!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&'function'==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_)}catch(_){console.error(_)}})(),m.exports=r(d[0])},239,[240]); 286__d(function(g,r,_i,_a,m,e,d){ 287/** 288 * @license React 289 * react-dom.production.js 290 * 291 * Copyright (c) Meta Platforms, Inc. and affiliates. 292 * 293 * This source code is licensed under the MIT license found in the 294 * LICENSE file in the root directory of this source tree. 295 */ 296"use strict";var t=r(d[0]);function i(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)i+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var o={d:{f:n,r:function(){throw Error(i(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function f(t,i,n){var o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:s,key:null==o?null:""+o,children:t,containerInfo:i,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(t,i){return"font"===t?"":"string"==typeof i?"use-credentials"===i?i:"":void 0}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,e.createPortal=function(t,n){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(i(299));return f(t,n,null,o)},e.flushSync=function(t){var i=c.T,n=o.p;try{if(c.T=null,o.p=2,t)return t()}finally{c.T=i,o.p=n,o.d.f()}},e.preconnect=function(t,i){"string"==typeof t&&(i?i="string"==typeof(i=i.crossOrigin)?"use-credentials"===i?i:"":void 0:i=null,o.d.C(t,i))},e.prefetchDNS=function(t){"string"==typeof t&&o.d.D(t)},e.preinit=function(t,i){if("string"==typeof t&&i&&"string"==typeof i.as){var n=i.as,s=y(n,i.crossOrigin),f="string"==typeof i.integrity?i.integrity:void 0,c="string"==typeof i.fetchPriority?i.fetchPriority:void 0;"style"===n?o.d.S(t,"string"==typeof i.precedence?i.precedence:void 0,{crossOrigin:s,integrity:f,fetchPriority:c}):"script"===n&&o.d.X(t,{crossOrigin:s,integrity:f,fetchPriority:c,nonce:"string"==typeof i.nonce?i.nonce:void 0})}},e.preinitModule=function(t,i){if("string"==typeof t)if("object"==typeof i&&null!==i){if(null==i.as||"script"===i.as){var n=y(i.as,i.crossOrigin);o.d.M(t,{crossOrigin:n,integrity:"string"==typeof i.integrity?i.integrity:void 0,nonce:"string"==typeof i.nonce?i.nonce:void 0})}}else null==i&&o.d.M(t)},e.preload=function(t,i){if("string"==typeof t&&"object"==typeof i&&null!==i&&"string"==typeof i.as){var n=i.as,s=y(n,i.crossOrigin);o.d.L(t,n,{crossOrigin:s,integrity:"string"==typeof i.integrity?i.integrity:void 0,nonce:"string"==typeof i.nonce?i.nonce:void 0,type:"string"==typeof i.type?i.type:void 0,fetchPriority:"string"==typeof i.fetchPriority?i.fetchPriority:void 0,referrerPolicy:"str
296ing"==typeof i.referrerPolicy?i.referrerPolicy:void 0,imageSrcSet:"string"==typeof i.imageSrcSet?i.imageSrcSet:void 0,imageSizes:"string"==typeof i.imageSizes?i.imageSizes:void 0,media:"string"==typeof i.media?i.media:void 0})}},e.preloadModule=function(t,i){if("string"==typeof t)if(i){var n=y(i.as,i.crossOrigin);o.d.m(t,{as:"string"==typeof i.as&&"script"!==i.as?i.as:void 0,crossOrigin:n,integrity:"string"==typeof i.integrity?i.integrity:void 0})}else o.d.m(t)},e.requestFormReset=function(t){o.d.r(t)},e.unstable_batchedUpdates=function(t,i){return t(i)},e.useFormState=function(t,i,n){return c.H.useFormState(t,i,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version="19.2.3"},240,[11]); 297__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isRunningInExpoGo=function(){return!1},e.getExpoGoProjectConfig=function(){return null}},241,[]); 298__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useEvent=function(u,s,c=null){const[o,f]=(0,t.useState)(c);return n(u,s,t=>f(t)),o},e.useEventListener=n;var t=r(d[0]);function n(n,u,s){const c=(0,t.useRef)(s);c.current=s,(0,t.useEffect)(()=>{const t=n.addListener(u,(...t)=>c.current(...t));return()=>t.remove()},[n,u,c])}},242,[11]); 299__d(function(g,r,i,a,m,e,d){"use strict";var t;Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AESKeySize",{enumerable:!0,get:function(){return t}}),(function(t){t[t.AES128=128]="AES128",t[t.AES192=192]="AES192",t[t.AES256=256]="AES256"})(t||(t={}))},243,[]); 300__d(function(g,r,_i,a,m,e,d){"use strict";function t(t){const n=atob(t),o=n.length,i=new Uint8Array(o);for(let t=0;t<o;t++)i[t]=n.charCodeAt(t);return i}Object.defineProperty(e,'__esModule',{value:!0}),e.hexToUintArray=function(t){const n=t.length/2,o=new Uint8Array(n);for(let n=0;n<t.length;n+=2)o[n>>>1]=parseInt(t.substring(n,n+2),16);return o},e.bytesToHex=function(t){const n=[];for(const o of t){const t=o<0?o+256:o;n.push((t>>>4).toString(16)),n.push((15&t).toString(16))}return n.join('')},e.base64ToUintArray=t,e.uint8ArrayToBase64=function(t){let n='';for(const o of t)n+=String.fromCharCode(o);return btoa(n)},e.binaryInputBytes=function(n){if(n instanceof Uint8Array)return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);if('string'==typeof n)return t(n);throw new Error('Cannot parse serializable input as ArrayBuffer')}},244,[]); 301__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WebBrowserResultType",{enumerable:!0,get:function(){return u.WebBrowserResultType}}),Object.defineProperty(_e,"WebBrowserPresentationStyle",{enumerable:!0,get:function(){return u.WebBrowserPresentationStyle}}),_e.getCustomTabsSupportingBrowsersAsync=async function(){if(!t.default.getCustomTabsSupportingBrowsersAsync)throw new o.UnavailabilityError('WebBrowser','getCustomTabsSupportingBrowsersAsync');return l},_e.warmUpAsync=async function(e){if(!t.default.warmUpAsync)throw new o.UnavailabilityError('WebBrowser','warmUpAsync');return{}},_e.mayInitWithUrlAsync=async function(e,n){if(!t.default.mayInitWithUrlAsync)throw new o.UnavailabilityError('WebBrowser','mayInitWithUrlAsync');return{}},_e.coolDownAsync=async function(e){if(!t.default.coolDownAsync)throw new o.UnavailabilityError('WebBrowser','coolDownAsync');return{}},_e.openBrowserAsync=c,_e.dismissBrowser=function(){return t.default.dismissBrowser?.()},_e.openAuthSessionAsync=async function(e,n,s={}){if(!t.default.openAuthSessionAsync)throw new o.UnavailabilityError('WebBrowser','openAuthSessionAsync');return['ios','macos','web'].includes("web")?t.default.openAuthSessionAsync(e,n,y(s)):t.default.openAuthSessionAsync(e,n)},_e.dismissAuthSession=function(){if(!t.default.dismissAuthSession)throw new o.UnavailabilityError('WebBrowser','dismissAuthSession');t.default.dismissAuthSession()},_e.maybeCompleteAuthSession=function(e={}){if(t.default.maybeCompleteAuthSession)return t.default.maybeCompleteAuthSession(e);return{type:'failed',message:'Not supported on this platform'}};var o=r(d[0]),n=e(r(d[1]));e(r(d[2]));r(d[3]);var s=e(r(d[4])),t=e(r(d[5])),u=r(d[6]);const l={defaultBrowserPackage:void 0,preferredBrowserPackage:void 0,browserPackages:[],servicePackages:[]};async function c(e,n={}){if(!t.default.openBrowserAsync)throw new o.UnavailabilityError('WebBrowser','openBrowserAsync');return await t.default.openBrowserAsync(e,y(n))}function y(e){return{...e,controlsColor:(0,s.default)(e.controlsColor),toolbarColor:(0,s.default)(e.toolbarColor),secondaryToolbarColor:(0,s.default)(e.secondaryToolbarColor)}}n.default.currentState},245,[115,200,199,136,33,246,247]); 302__d(function(g,r,_i,a,m,_e,d){"use strict";
302Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}}),_e.normalizeUrl=u,_e.featureObjectToString=I;var e,t=r(d[0]),n=r(d[1]),o=(e=n)&&e.__esModule?e:{default:e},i=r(d[2]);let s=null;const c=new Map,l=e=>`ExpoWebBrowser_OriginUrl_${e}`,w=e=>`ExpoWebBrowser_RedirectUrl_${e}`;function u(e){return(e.origin.replace(e.protocol,'').replace(/^\/+/,'').replace(/\/+$/,'')+decodeURI(e.pathname.replace(/\/{2,}/g,'/'))).toLowerCase()}function p(){if(s&&(s.close(),c.has(s))){const{listener:e,appStateSubscription:t,interval:n}=c.get(s);clearInterval(n),window.removeEventListener('message',e),t.remove(),c.delete(s);const o=window.localStorage.getItem('ExpoWebBrowserRedirectHandle');o&&(window.localStorage.removeItem('ExpoWebBrowserRedirectHandle'),window.localStorage.removeItem(l(o)),window.localStorage.removeItem(w(o))),s=null}}var f={async openBrowserAsync(e,t={}){if('undefined'==typeof window)return{type:i.WebBrowserResultType.CANCEL};const{windowName:n="_blank",windowFeatures:o}=t,s=B(o);return window.open(e,n,s),{type:i.WebBrowserResultType.OPENED}},dismissAuthSession(){'undefined'!=typeof window&&p()},maybeCompleteAuthSession({skipRedirectCheck:e}){if('undefined'==typeof window)return{type:'failed',message:'Cannot use expo-web-browser in a non-browser environment'};const n=window.localStorage.getItem('ExpoWebBrowserRedirectHandle');if(!n)return{type:'failed',message:'No auth session is currently in progress'};const o=window.location.href;if(!0!==e){const e=window.localStorage.getItem(w(n)),t=u(window.location);if(e!==t)return{type:'failed',message:`Current URL "${t}" and original redirect URL "${e}" do not match.`}}window.localStorage.setItem(l(n),o);const i=window.opener??window.parent;if(!i)throw new t.CodedError('ERR_WEB_BROWSER_REDIRECT',"The window cannot complete the redirect request because the invoking window doesn't have a reference to it's parent. This can happen if the parent window was reloaded.");return i.postMessage({url:o,expoSender:n},i.location.toString()),{type:'success',message:"Attempting to complete auth"}},async openAuthSessionAsync(e,n,f){if('undefined'==typeof window)return{type:i.WebBrowserResultType.CANCEL};if(n=n??b(e),null==s||s?.closed){const n=B(f?.windowFeatures);if(s=window.open(e,f?.windowName,n),!s)throw new t.CodedError('ERR_WEB_BROWSER_BLOCKED','Popup window was blocked by the browser or failed to open. This can happen in mobile browsers when the window.open() method was invoked too long after a user input was fired.');try{s.focus()}catch{}}const h=await y(e);window.localStorage.setItem('ExpoWebBrowserRedirectHandle',h);const R=(()=>{if(!n)return n;try{return u(new URL(n))}catch{return n}})();return window.localStorage.setItem(w(h),R),new Promise(async e=>{const t=t=>{if(!t.isTrusted)return;if(t.origin!==window.location.origin)return;const{data:n}=t,o=window.localStorage.getItem('ExpoWebBrowserRedirectHandle');n.expoSender===o&&(p(),e({type:'success',url:n.url}))};window.addEventListener('message',t,!1);const n=o.default.addEventListener('change',t=>{if('active'!==t)return;const n=window.localStorage.getItem('ExpoWebBrowserRedirectHandle');if(n){const t=window.localStorage.getItem(l(n));t&&(p(),e({type:'success',url:t}))}}),w=setInterval(()=>{s?.closed&&(e&&e({type:i.WebBrowserResultType.DISMISS}),clearInterval(w),p())},1e3);c.set(s,{listener:t,interval:w,appStateSubscription:n})})}};function h(){return'undefined'!=typeof window&&!!window?.crypto}async function y(e){const t=new URL(e);return t.searchParams.has('state')&&'string'==typeof t.searchParams.get('state')?t.searchParams.get('state'):await E()}function b(e){const t=new URL(e);return t.searchParams.has('redirect_uri')&&'string'==typeof t.searchParams.get('redirect_uri')?t.searchParams.get('redirect_uri'):location.origin+location.pathname}const R='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';async function E(){if(!h()||!window.crypto.subtle)throw new t.CodedError('ERR_WEB_BROWSER_CRYPTO',"The current environment doesn't support crypto. Ensure you are running from a secure origin (localhost/https).");const e=new TextEncoder,n=S(10),o=e.encode(n),i=await crypto.subtle.digest('SHA-256',o);return btoa(String.fromCharCode(...new Uint8Array(i)))}function S(e){let t=new Uint8Array(e);t.byteLength!==t.length&&(t=new Uint8Array(t.buffer));const n=new Uint8Array(t.length);if(h())window.crypto.getRandomValues(n);else for(let t=0;t<e;t+=1)n[t]=Math.random()*R.length|0;return v(n)}function v(e){let t='';for(const n of e){const e=n%R.length,o=R[e];null!=o&&(t+=o)}return t}function _(e){let t={};if('string'==typeof e){const n=e.split(',');for(const e of n){const[n,o]=e.trim().split('=');n&&o&&(t[n]=o)}}else e&&(t=e);return t}function B(e){const t=_(e),n=t.width??500,o=t.height??650,i=t.top??Math.max(0,.5*(window.screen.height-o)),s=t.left??Math.max(0,.5*(window.screen.width-n));return I({...t,toolbar:t.toolbar??'no',menubar:t.menubar??'no',location:t.location??'yes',resizable:t.resizable??'yes',status:t.status??'no',scrollbars:t.scrollbars??'yes',to
302p:i,left:s,width:n,height:o})}function I(e){return Object.keys(e).reduce((t,n)=>{let o=e[n];return'boolean'==typeof o&&(o=o?'yes':'no'),n&&o?(t&&(t+=','),`${t}${n}=${o}`):t},'')}},246,[115,200,247]); 303__d(function(g,r,i,a,m,e,d){"use strict";var t,n;Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"WebBrowserResultType",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"WebBrowserPresentationStyle",{enumerable:!0,get:function(){return n}}),(function(t){t.CANCEL="cancel",t.DISMISS="dismiss",t.OPENED="opened",t.LOCKED="locked"})(t||(t={})),(function(t){t.FULL_SCREEN="fullScreen",t.PAGE_SHEET="pageSheet",t.FORM_SHEET="formSheet",t.CURRENT_CONTEXT="currentContext",t.OVER_FULL_SCREEN="overFullScreen",t.OVER_CURRENT_CONTEXT="overCurrentContext",t.POPOVER="popover",t.AUTOMATIC="automatic"})(n||(n={}))},247,[]); 304__d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"verdictTone",{enumerable:!0,get:function(){return s.verdictTone}}),Object.defineProperty(e,"NO_RULE_BADGE",{enumerable:!0,get:function(){return s.NO_RULE_BADGE}}),Object.defineProperty(e,"MIN_TRADES_DEFAULT",{enumerable:!0,get:function(){return n.MIN_TRADES_DEFAULT}}),Object.defineProperty(e,"DATA_STALE_DAYS",{enumerable:!0,get:function(){return n.DATA_STALE_DAYS}}),Object.defineProperty(e,"SAMPLE_MODERATE_MIN",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"SAMPLE_LARGER_MIN",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"ALL_FRAMES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"verdictTitles",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"HISTORY_ONLY_NEXT",{enumerable:!0,get:function(){return f}}),e.sampleSize=h,e.discoverDefaults=function(s){const o=(Array.isArray(s)?s:[]).filter(t=>l.includes(t));return 1===o.length?{...t.initialFilters,minimum:n.MIN_TRADES_DEFAULT,timeframe:o[0],frames:[]}:{...t.initialFilters,minimum:n.MIN_TRADES_DEFAULT,timeframe:'All',frames:o.length&&o.length<l.length?o:[]}},e.frameMatch=function(t,n){return'All'!==n.timeframe||!n.frames?.length||n.frames.includes(t.timeframe)},e.historyScreenOff=function(t){return'research'===t},Object.defineProperty(e,"NO_HISTORY_SCREEN_NOTE",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"NO_HISTORY_SCREEN_PAIR_NOTE",{enumerable:!0,get:function(){return m}}),Object.defineProperty(e,"NO_HISTORY_SCREEN_LABEL",{enumerable:!0,get:function(){return _}}),e.appliedFilters=function(t,n){return n?{...t,minimum:0,band:''}:t},e.dataAgeDays=function(t,n=new Date){const s=/^(\d{4})-(\d{2})-(\d{2})/.exec(t||'');if(!s)return null;const o=new Date(n.getTime()+198e5);return Math.max(0,Math.round((Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate())-Date.UTC(+s[1],+s[2]-1,+s[3]))/864e5))},e.dataAgeText=function(t){return null==t?'Data age unknown':0===t?'Data from today':`Data ${t} ${1===t?'day':'days'} old`},e.isStale=function(t,s){return!!s||null==t||t>n.DATA_STALE_DAYS},e.decision=function(n,l,p){const m=(p?n.history.find(t=>t.side===p):void 0)||(0,t.histories)(n,l)[0]||n.history[0],_=m?.reference,T=_?.expectancy_pct,y=Math.max(1,l.minimum),A=m?.test,b=A?.expectancy_pct,E='tested'===m?.status&&(A?.n||0)>=y&&null!=b&&Number.isFinite(b);let v='watch',D='There is not enough stock-specific history to judge the outcome.';_&&_.n>=y&&null!=T&&(T<=0?(v='pass',D='The past average did not cover the assumed trading costs.'):'neutral'===n.direction?D='The structure is present. Its breakout direction is still unresolved.':(v='history',D=`A positive hold-period average on this stock, with ${_.n} historical trades. That is pattern history, not a tested exit rule.`));const O=_?.expectancy_ci95;(_?.n||0)>=5&&Array.isArray(O)&&null!=O[1]&&O[1]<0&&(v='pass',D='The whole 95% range of the past average is below zero after costs.');E&&'pass'!==v&&'neutral'!==n.direction&&(b>0?(v='review',D=`The tested exit rule stayed positive after costs on later (out-of-sample) data: average ${(0,t.pct)(b)} per trade over ${A.n}
304 later-test trades.`):(v='pass',D='The tested exit rule did not cover the assumed trading costs on later data.'));(A?.n||0)>=5&&A?.expectancy_ci95&&A.expectancy_ci95[1]<0&&(v='pass',D='The selected exit rule lost money on later data after costs.');const S=_?.n||0,R=E?{value:b,n:A.n,label:'later-test avg. after costs',sample:h(A.n)}:{value:_?.expectancy_pct??null,n:S,label:'past avg. after costs',sample:h(S)};return{verdict:v,why:D,history:m,stats:_,headline:R,title:u[v],tone:(0,s.verdictTone)(v),basis:E?'tested_rule':S>0?'hold_period_history':'none',ruleNote:'no_validated_rule'===m?.status?s.NO_RULE_BADGE:'',sample:h(S),next:n.current?'history'===v?f:'neutral'===n.direction?'Wait for a confirmed direction before preparing the trade.':'setup'===n.state?'Recheck the boundary and confirmation on the next completed candle.':'Review the historical evidence and prepare an entry and exit plan.':'Wait for a fresh completed candle. Recheck the pattern before any entry.',caution:S<o?'Small historical sample. A few outcomes can change the average.':S<c?'Moderate historical sample. The average can still shift materially.':'A past average describes the recorded trades; it does not establish the next trade\u2019s outcome.'}};var t=r(d[0]),n=r(d[1]),s=r(d[2]);const o=10,c=30,l=n.TIMEFRAMES,u=s.VERDICT_TITLES,f='No exit rule has been tested for this; treat the history as context only.';function h(t){const n=t||0;return n>=c?{label:'Larger sample',tone:'green'}:n>=o?{label:'Moderate sample',tone:'neutral'}:{label:'Small sample',tone:'amber'}}const p='These setups have no past trades to count. The sample-size filter is off. Each setup\u2019s evidence is on its own card.',m='These setups have no past trades to count, so the return-range and sample-size filters are off. Each setup\u2019s evidence is on its own card.',_='No sample-size filter'},248,[197,249,250]); 305__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CAPITAL_CHOICES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"DEFAULT_CAPITAL",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"TIMEFRAMES",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"DEFAULT_STUDY_START",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"DEFAULT_STUDY_END",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"DEFAULT_STUDY_PATTERNS",{enumerable:!0,get:function(){return T}}),Object.defineProperty(e,"DEFAULT_STUDY_TIMEFRAMES",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"DEFAULT_STUDY_UNIVERSE",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"ROUND_TRIP_COST_PCT",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"MIN_TRADES_DEFAULT",{enumerable:!0,get:function(){return A}}),Object.defineProperty(e,"DATA_STALE_DAYS",{enumerable:!0,get:function(){return D}});const t=[1e4,3e4,5e4],n=1e4,u=['1H','4H','1D','1W'],c='2020-01-01',o='2026-07-31',T=['cup_handle'],f=['1D'],_='nifty50',b=.4,A=10,D=3},249,[]); 306__d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VERDICT_TITLES",{enumerable:!0,get:function(){return t}}),e.verdictTone=function(t){return'review'===t?'green':'pass'===t?'red':'watch'===t?'amber':'neutral'},Object.defineProperty(e,"NO_RULE_BADGE",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"RANKED_LUCK_LINE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"SHORT_STUDY_LINE",{enumerable:!0,get:function(){return c}}),e.labelDate=u,e.backtestRunLine=l,e.knownBacktestRunLine=function(t){const n=String(t?.run_id||'').trim(),o=u(t?.source_latest),c=String(t?.detector_version||'').trim();return n&&(o||c)?l(t):''};const t={review:'For review',history:'History only',watch:'Watch',pass:'Pass'};const n='No exit rule passed validation',o='Ranked across many stocks; top results are partly luck and usually shrink.',c='Hypothetical short price study (no borrow/funding modelled)',s=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];function u(t){const n=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(t||''));if(!n)return'';const o=+n[2];return o<1||o>12?'':`${+n[3]} ${s[o-1]} ${n[1]}`}function l(t){const n=u(t?.source_latest),o=String(t?.detector_version||'').trim();return`Backtest: ${o?`same detector (v${o.replace(/^v/i,'')})`:'same detector'} replayed on archived prices${n?` to ${n}`:''} \xb7 not re-run on the live 15-minute feed \xb7 prices not adjusted for dividends/corporate actions.`}},250,[]); 307__d(function(g,r,_i,_a,_m,_e,d){"use strict";
307Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"HISTORY_CAP",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"DEFAULT_TIMEFRAME",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"emptyHistory",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"WORKSPACE_TITLE_PATHS",{enumerable:!0,get:function(){return c}}),_e.parseMatchId=b,_e.normalizeActive=p,_e.sameActive=v,_e.applyActive=A,_e.stepHistory=I,_e.matchesActive=x,_e.selectedActiveMatch=C,_e.selectedChartDetection=function(e,t){if(!e.detectionId||t?.symbol!==e.symbol||t?.timeframe!==e.timeframe||!Array.isArray(t.matches))return;const n=C(e,t.matches.map(e=>({...e,symbol:e.symbol||t.symbol,timeframe:e.timeframe||t.timeframe})));return n?{...n,history:[]}:void 0},_e.parseActiveParams=P,_e.serializeActiveParams=k,_e.paramsSignature=O,_e.activeTitle=S,_e.navIndex=T,_e.stepTarget=j,_e.evidenceKey=function(e){const t=h(e?.symbol).toUpperCase(),n=h(e?.pattern),s=h(e?.timeframe).toUpperCase(),i=h(e?.side).toLowerCase(),o=h(e?.dataEnd),c='string'==typeof e?.rule?e.rule.trim():null==e?.rule?'':E(e.rule);return t&&n&&s&&('long'===i||'short'===i)&&c&&o?['ev1',t,n,s,i,c,o].map(encodeURIComponent).join('|'):''},_e.readKeyed=U,_e.useKeyedValue=function(t,n){const s=t||'',[i,o]=(0,e.useState)(null),[c,a]=(0,e.useState)(0),u=(0,e.useRef)(n);(0,e.useEffect)(()=>{u.current=n}),(0,e.useEffect)(()=>{if(!s)return void o(null);let e=!0;const t=()=>e;return Promise.resolve().then(()=>u.current(s,t)).then(t=>{e&&o({key:s,value:t})},t=>{e&&o({key:s,error:t?.message||'Unable to load'})}),()=>{e=!1}},[s,c]);const l=U(i,s),m=(0,e.useCallback)(()=>a(e=>e+1),[]);return{value:l.value,error:l.error,loading:!!s&&!l.fresh,key:s,reload:m}},_e.ActiveSymbolProvider=function({children:s,onWrite:i}){const[u,l]=(0,e.useState)(o),m=(0,e.useRef)(o),f=(0,e.useRef)(i);f.current=i;const b=(0,e.useCallback)(e=>{e!==m.current&&(m.current=e,l(e))},[]),v=(0,e.useCallback)((e,t)=>{f.current?.();const n=m.current,s=p(e,n.entries[n.index]);return!!s&&(b(A(n,s,!!t?.replace)),!0)},[b]),C=(0,e.useCallback)(()=>b(I(m.current,-1)),[b]),T=(0,e.useCallback)(()=>b(I(m.current,1)),[b]),j=(0,e.useCallback)(()=>b(o),[b]),E=u.entries[u.index]||null,U=(0,e.useCallback)((e,t)=>x(E,e,t),[E]),w='undefined'!=typeof window,M=(0,t.usePathname)(),R=(0,t.useGlobalSearchParams)(),$=O(R),D=(0,e.useRef)({loaded:!1,seen:'',path:''});(0,e.useEffect)(()=>{const e=D.current,t=!e.loaded,n=e.path;if(e.loaded=!0,e.path=M,!w||M!==a)return;const s=n===a&&e.seen!==$,i=n!==a&&!!h(y(R.d));if(e.seen=$,!t&&!s&&!i)return;const o=m.current;if($===O(k(o.entries[o.index])))return;const c=P(R);c&&v(c)},[w,M,$]),(0,e.useEffect)(()=>{if(!w||M!==a)return;const e=m.current,n=e.entries[e.index];if(!n)return;const s=k(n);if(O(s)!==$)try{t.router.setParams(s)}catch{}},[w,M,u,$]);const K=S(c.includes(M)?E:null);(0,e.useEffect)(()=>{const e=globalThis.document;if(!w||!e)return;const t=()=>{e.title!==K&&(e.title=K)};t();const n=setTimeout(t,0);let s;try{const n=globalThis.MutationObserver;n&&e.head&&(s=new n(t),s.observe(e.head,{subtree:!0,childList:!0,characterData:!0}))}catch{}return()=>{clearTimeout(n),s?.disconnect()}},[w,K]);const N=(0,e.useMemo)(()=>({active:E,history:u,setActive:v,back:C,forward:T,canBack:u.index>
3070,canForward:u.index<u.entries.length-1,isActive:U,reset:j}),[E,u,v,C,T,U,j]);return(0,n.jsx)(_.Provider,{value:N,children:s})},_e.useActiveSymbol=w,_e.useActiveNavigation=function(t,n="nav"){const{active:s,setActive:i}=w(),o=(0,e.useMemo)(()=>T(t,s),[t,s]),c=(0,e.useCallback)(e=>{const o=j(t,s,e);return!!o&&i({...o,source:n})},[t,s,i,n]),a=(0,e.useCallback)(()=>c(1),[c]),u=(0,e.useCallback)(()=>c(-1),[c]);return{index:o,next:a,prev:u,hasNext:t.length>0&&o<t.length-1,hasPrev:t.length>0&&0!==o}};var e=r(d[0]);r(d[1]);var t=r(d[2]),n=r(d[3]);const s=50,i='1D',o={entries:[],index:-1},c=['/chart','/simulate','/watch','/autotrade','/activity'],a='/chart',u=/^[A-Z0-9][A-Z0-9&._-]{0,39}$/,l=/^[0-9]{1,3}[A-Z]{1,2}$/,m=/^[A-Za-z0-9&._:-]{1,160}$/,f=/^\d{4}-\d{2}-\d{2}([ T][0-9:.+Z-]{0,20})?$/,h=e=>'string'==typeof e?e.trim():'',y=e=>Array.isArray(e)?e[0]:e;function b(e){const t=h(e).split(':');if(3!==t.length&&5!==t.length)return null;const n=t[0].toUpperCase(),s=t[1].toUpperCase(),i=t[2];return u.test(n)&&l.test(s)&&i?5===t.length?!t[3]||'long'!==t[4]&&'short'!==t[4]?null:{symbol:n,timeframe:s,pattern:i,variant:t[3],side:t[4]}:{symbol:n,timeframe:s,pattern:i}:null}function p(e,t){const n=h(e?.symbol).toUpperCase();if(!u.test(n))return null;const s=h(e.matchId),o=s&&m.test(s)?b(s):null,c=h(e.timeframe).toUpperCase()||(o&&o.symbol===n?o.timeframe:'')||t?.timeframe||i;if(!l.test(c))return null;const a={symbol:n,timeframe:c,source:e.source};s&&m.test(s)&&(!o||o.symbol===n&&o.timeframe===c)&&(a.matchId=s);const y=h(e.detectionId);a.matchId&&o&&/^[A-Za-z0-9]{1,64}$/.test(y)&&(a.detectionId=y),a.matchId&&o?.side?a.side=o.side:'long'!==e.side&&'short'!==e.side||(a.side=e.side);const p=h(e.asOf);return p&&f.test(p)&&(a.asOf=p),a}function v(e,t){return e&&t?e.symbol===t.symbol&&e.timeframe===t.timeframe&&(e.matchId||'')===(t.matchId||'')&&(e.detectionId||'')===(t.detectionId||'')&&(e.side||'')===(t.side||'')&&(e.asOf||'')===(t.asOf||''):!e&&!t}function A(e,t,n=!1){const s=e.entries[e.index],i=()=>({entries:e.entries.map((n,s)=>s===e.index?t:n),index:e.index});if(s&&v(s,t))return s.source===t.source?e:i();if(s&&n)return i();const o=[...e.entries.slice(0,e.index+1),t].slice(-50);return{entries:o,index:o.length-1}}function I(e,t){const n=e.index+t;return n<0||n>=e.entries.length?e:{entries:e.entries,index:n}}function x(e,t,n){return!(!e||h(t).toUpperCase()!==e.symbol||n&&e.matchId!==n)}function C(e,t){return t.find(t=>t.id===e.matchId&&t.symbol===e.symbol&&t.timeframe===e.timeframe&&(!e.detectionId||t.detection_id===e.detectionId))}function P(e){const t=h(y(e?.s));return t?p({symbol:t,timeframe:h(y(e?.tf))||void 0,matchId:h(y(e?.m))||void 0,detectionId:h(y(e?.d))||void 0,source:'url'}):null}function k(e){return{s:e?.symbol,tf:e?e.timeframe:void 0,m:e?.matchId,d:e?.detectionId}}function O(e){return['s','tf','m','d'].map(t=>h(y(e?.[t]))).join('|')}function S(e){return e?`${e.symbol} \xb7 ${e.timeframe} \u2014 KANIDA`:'KANIDA'}function T(e,t){if(!t)return-1;const n=t.matchId?e.findIndex(e=>e.matchId===t.matchId):-1;return n>=0?n:e.findIndex(e=>h(e.symbol).toUpperCase()===t.symbol&&h(e.timeframe).toUpperCase()===t.timeframe)}function j(e,t,n){if(!e.length)return null;const s=T(e,t),i=s<0?n>0?0:e.length-1:s+n;return i<0||i>=e.length?null:e[i]}const E=e=>null===e||'object'!=typeof e?JSON.stringify(e)??'null':Array.isArray(e)?'['+e.map(E).join(',')+']':'{'+Object.keys(e).sort().filter(t=>void 0!==e[t]).map(t=>JSON.stringify(t)+':'+E(e[t])).join(',')+'}';function U(e,t){const n=!!t&&!!e&&e.key===t;return{value:n?e.value:void 0,error:n&&e.error||'',fresh:n}}const _=(0,e.createContext)(null);function w(){const t=(0,e.useContext)(_);if(!t)throw new Error('useActiveSymbol must be used inside ActiveSymbolProvider (mounted by ProductProvider in src/context.tsx)');return t}},251,[11,136,252,6]); 308__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,o,c){void 0===c&&(c=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,c,u)}:function(t,n,o,c){void 0===c&&(c=o),t[c]=n[o]}),n=this&&this.__exportStar||function(n,o){for(var c in n)"default"===c||Object.prototype.hasOwnProperty.call(o,c)||t(o,n,c)};
308Object.defineProperty(e,"__esModule",{value:!0}),r(d[0]),n(r(d[1]),e),n(r(d[2]),e),n(r(d[3]),e),n(r(d[4]),e)},252,[253,254,810,811,813]); 309__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},253,[]); 310__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,o){void 0===o&&(o=u);var i=Object.getOwnPropertyDescriptor(n,u);i&&!("get"in i?!n.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,o,i)}:function(t,n,u,o){void 0===o&&(o=u),t[o]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(o){if(o&&o.__esModule)return o;var i={};if(null!=o)for(var c=t(o),b=0;b<c.length;b++)"default"!==c[b]&&n(i,o,c[b]);return u(i,o),i});Object.defineProperty(e,"__esModule",{value:!0}),e.ExperimentalStack=e.Tabs=e.unstable_navigationEvents=e.TabRouter=e.StackRouter=e.unstable_integrateWithRouter=e.unstable_createStandardRouterNavigator=e.VectorIcon=e.Label=e.Icon=e.Badge=e.useRoute=e.useScrollToTop=e.useRoutePath=e.LocaleProvider=e.useTheme=e.ThemeProvider=e.DefaultTheme=e.DarkTheme=e.useIsFocused=e.useFocusEffect=e.useNavigation=e.SplashScreen=e.SuspenseFallback=e.ErrorBoundary=e.useSitemap=e.Sitemap=e.Unmatched=e.ExpoRoot=e.Slot=e.Navigator=e.withLayoutContext=e.router=e.useCurrentRouteInfo=e.useLoaderData=e.useRootNavigationState=e.useRootNavigation=e.useSegments=e.useLocalSearchParams=e.useGlobalSearchParams=e.useNavigationContainerRef=e.usePathname=e.useUnstableGlobalHref=e.useRouter=void 0;const i=r(d[0]);Object.defineProperty(e,"Navigator",{enumerable:!0,get:function(){return i.Navigator}}),Object.defineProperty(e,"Slot",{enumerable:!0,get:function(){return i.Slot}});var c=r(d[1]);Object.defineProperty(e,"useRouter",{enumerable:!0,get:function(){return c.useRouter}}),Object.defineProperty(e,"useUnstableGlobalHref",{enumerable:!0,get:function(){return c.useUnstableGlobalHref}}),Object.defineProperty(e,"usePathname",{enumerable:!0,get:function(){return c.usePathname}}),Object.defineProperty(e,"useNavigationContainerRef",{enumerable:!0,get:function(){return c.useNavigationContainerRef}}),Object.defineProperty(e,"useGlobalSearchParams",{enumerable:!0,get:function(){return c.useGlobalSearchParams}}),Object.defineProperty(e,"useLocalSearchParams",{enumerable:!0,get:function(){return c.useLocalSearchParams}}),Object.defineProperty(e,"useSegments",{enumerable:!0,get:function(){return c.useSegments}}),Object.defineProperty(e,"useRootNavigation",{enumerable:!0,get:function(){return c.useRootNavigation}}),Object.defineProperty(e,"useRootNavigationState",{enumerable:!0,get:function(){return c.useRootNavigationState}}),Object.defineProperty(e,"useLoaderData",{enumerable:!0,get:function(){return c.useLoaderData}}),Object.defineProperty(e,"useCurrentRouteInfo",{enumerable:!0,get:function(){return c.useCurrentRouteInfo}});var b=r(d[2]);Object.defineProperty(e,"router",{enumerable:!0,get:function(){return b.router}});var f=r(d[3]);Object.defineProperty(e,"withLayoutContext",{enumerable:!0,get:function(){return f.withLayoutContext}});var l=r(d[4]);Object.defineProperty(e,"ExpoRoot",{enumerable:!0,get:function(){return l.ExpoRoot}});var s=r(d[5]);Object.defineProperty(e,"Unmatched",{enumerable:!0,get:function(){return s.Unmatched}});var m=r(d[6]);Object.defineProperty(e,"Sitemap",{enumerable:!0,get:function(){return m.Sitemap}});var p=r(d[7]);Object.defineProperty(e,"useSitemap",{enumerable:!0,get:function(){return p.useSitemap}});var v=r(d[8]);Object.defineProperty(e,"ErrorBoundary",{enumerable:!0,get:function(){return v.ErrorBoundary}});var P=r(d[9]);Object.defineProperty(e,"SuspenseFallback",{enumerable:!0,get:function(){return P.SuspenseFallback}}),e.SplashScreen=o(r(d[10]));var y=r(d[11]);Object.defineProperty(e,"useNavigation",{enumerable:!0,get:function(){return y.useNavigation}});var O=r(d[12]);Object.defineProperty(e,"useFocusEffect",{enumerable:!0,get:function(){return O.useFocusEffect}});var j=r(d[13]);Object.defineProperty(e,"useIsFocused",{enumerable:!0,get:function(){return j.useIsFocused}});var h=r(d[14]);Object.defineProperty(e,"DarkTheme",{enumerable:!0,get:function(){return h.DarkTheme}});var S=r(d[15]);Object.defineProperty(e,"DefaultTheme",{enumerable:!0,get:function(){return S.DefaultTheme}});var R=r(d[16]);Object.defineProperty(e,"ThemeProvider",{enumerable:!0,get:function(){return R.ThemeProvider}});var T=r(d[17]);Object.defineProperty(e,"useTheme",{enumerable:!0,get:function(){return T.useTheme}});var _=r(d[18]);Object.defineProperty(e,"LocaleProvider",{enumerable:!0,get:function(){return _.LocaleProvider}});var N=r(d[19]);Object.defineProperty(e,"useRoutePath",{enumerable:!0,get:function(){return N.useRoutePath}});var E=r(d[20]);Object.defineProperty(e,"useScrollToTop",{enumerable:!0,get:function(){return E.useScrollToTop}});var L=r(d[21]);Object.defineProperty(e,"useRoute",{enumerable:!0,get:function(){return L.useRoute}});var k=r(d[22]);Object.defineProperty(e,"Badge",{enumerable:!0,get:function(){return k.Badge}}),Object.defineProperty(e,"Icon",{enumerable:!0,get:function(){return k.Icon}}),Object.defineProperty(e,"Label",{enumerable:!0,get:function(){return k.Label}}
310),Object.defineProperty(e,"VectorIcon",{enumerable:!0,get:function(){return k.VectorIcon}});var I=r(d[23]);Object.defineProperty(e,"unstable_createStandardRouterNavigator",{enumerable:!0,get:function(){return I.unstable_createStandardRouterNavigator}}),Object.defineProperty(e,"unstable_integrateWithRouter",{enumerable:!0,get:function(){return I.unstable_integrateWithRouter}});var D=r(d[24]);Object.defineProperty(e,"StackRouter",{enumerable:!0,get:function(){return D.StackRouter}}),Object.defineProperty(e,"TabRouter",{enumerable:!0,get:function(){return D.TabRouter}});var x=r(d[25]);Object.defineProperty(e,"unstable_navigationEvents",{enumerable:!0,get:function(){return x.unstable_navigationEvents}});var C=r(d[26]);Object.defineProperty(e,"Tabs",{enumerable:!0,get:function(){return C.Tabs}});var F=r(d[27]);Object.defineProperty(e,"ExperimentalStack",{enumerable:!0,get:function(){return F.ExperimentalStack}})},254,[255,557,563,261,782,735,726,729,793,686,539,707,529,794,512,501,426,468,795,517,518,467,520,796,406,595,804,806]); 311__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var s=t(i),c=0;c<s.length;c++)"default"!==s[c]&&n(u,i,s[c]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.NavigatorContext=void 0,e.Navigator=S,e.useNavigatorContext=C,e.Slot=function(t){const n=(0,l.useContextKey)(),o=s.use(e.NavigatorContext);if(o?.contextKey!==n)return(0,u.jsx)(N,{...t});return(0,u.jsx)(j,{})},e.DefaultNavigator=function(){return(0,u.jsx)(c.SafeAreaView,{style:{flex:1},children:(0,u.jsx)(N,{})})};const u=r(d[0]),s=i(r(d[1])),c=r(d[2]),l=r(d[3]),f=r(d[4]),v=r(d[5]),x=r(d[6]),h=r(d[7]),y=r(d[8]);function S({initialRouteName:t,screenOptions:n,children:o,router:i,routerOptions:s,unstable_screenErrorBoundary:c}){const S=(0,l.useContextKey)(),{screens:C,children:N,protectedScreens:j}=(0,v.useFilterScreenChildren)(o,{isCustomNavigator:!0,contextKey:S}),p=(0,h.useSortedScreens)(C??[],j);i||=f.StackRouter;const _=(0,x.useNavigationBuilder)(i,{...s,id:S,children:p||[(0,u.jsx)(y.Screen,{},"default")],screenOptions:n,initialRouteName:t});return p.length?(0,u.jsx)(e.NavigatorContext.Provider,{value:{..._,contextKey:S,router:i},children:c?(0,u.jsx)(l.ScreenErrorBoundaryContext,{value:c,children:N}):N}):(console.warn(`Navigator at "${S}" has no children.`),null)}function C(){const t=s.use(e.NavigatorContext);if(!t)throw new Error('useNavigatorContext must be used within a <Navigator />');return t}function N({unstable_screenErrorBoundary:t,...n}){const o=(0,l.useContextKey)(),{screens:i,protectedScreens:s}=(0,v.useFilterScreenChildren)([],{contextKey:o}),{state:c,descriptors:y,NavigationContent:S}=(0,x.useNavigationBuilder)(f.StackRouter,{...n,id:o,children:(0,h.useSortedScreens)(i??[],s)}),C=(0,u.jsx)(S,{children:y[c.routes[c.index].key].render()});return t?(0,u.jsx)(l.ScreenErrorBoundaryContext,{value:t,children:C}):C}function j(){const t=C(),{state:n,descriptors:o}=t;return o[n.routes[n.index].key]?.render()??null}e.NavigatorContext=s.createContext(null),S.Slot=j,S.useContext=C,S.Screen=y.Screen},255,[6,11,105,256,259,261,401,588,740]); 312__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sortRoutes=e.sortRoutesWithInitial=e.LocalRouteParamsContext=e.ScreenErrorBoundaryContext=e.SuspenseFallbackContext=void 0,e.useRouteNode=c,e.useContextKey=function(){const t=c();if(null==t)throw new Error('No filename found. This is likely a bug in expo-router.');return(0,n.getContextKey)(t.contextKey)},e.Route=function({children:o,node:n,params:u}
312){return(0,t.jsx)(e.LocalRouteParamsContext.Provider,{value:u,children:(0,t.jsx)(s.Provider,{value:n,children:o})})};const t=r(d[0]),o=r(d[1]),n=r(d[2]),u=r(d[3]);Object.defineProperty(e,"sortRoutesWithInitial",{enumerable:!0,get:function(){return u.sortRoutesWithInitial}}),Object.defineProperty(e,"sortRoutes",{enumerable:!0,get:function(){return u.sortRoutes}});const s=(0,o.createContext)(null);function c(){return(0,o.use)(s)}e.SuspenseFallbackContext=(0,o.createContext)(void 0),e.ScreenErrorBoundaryContext=(0,o.createContext)(void 0),e.LocalRouteParamsContext=(0,o.createContext)({})},256,[6,11,257,258]); 313__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.matchDynamicName=function(n){const u=n.match(t)?.[1];return null==u?void 0:u.startsWith('...')?{name:u.slice(3),deep:!0}:{name:u,deep:!1}},e.testNotFound=function(t){return/\+not-found$/.test(t)},e.matchGroupName=n,e.matchLastGroupName=function(t){return t.match(/.*(?:\/|^)\(([^\\/]+)\)[^\s]*$/)?.[1]},e.matchArrayGroupName=function(t){return t.match(/(?:[^\\()])*?\(([^\\/]+,[^\\/]+)\)/)?.[1]},e.getNameFromFilePath=u,e.getContextKey=function(t){const n='/'+u(t);if(!n.endsWith('_layout'))return n;return n.replace(/\/?_layout$/,'')},e.removeSupportedExtensions=o,e.removeFileSystemExtensions=function(t){return t.replace(/\.[jt]sx?$/g,'')},e.removeFileSystemDots=c,e.stripGroupSegmentsFromPath=s,e.stripInvisibleSegmentsFromPath=function(t){return s(t).replace(/\/?index$/,'')},e.isTypedRoute=function(t){return!t.startsWith('+')&&null===t.match(/(_layout|[^/]*?\+[^/]*?)\.[tj]sx?$/)};const t=/^\[([^[\]]+?)\]$/;function n(t){return t.match(/^(?:[^\\()])*?\(([^\\/]+)\)/)?.[1]}function u(t){return o(c(t))}function o(t){return t.replace(/(\+api)?\.[jt]sx?$/g,'')}function c(t){return t.replace(/^(?:\.\.?\/)+/g,'')}function s(t){return t.split('/').reduce((t,u)=>(null==n(u)&&t.push(u),t),[]).join('/')}},257,[]); 314__d(function(g,r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sortRoutes=u,e.sortRoutesWithInitial=function(n){return(t,o)=>{if(n){if(t.route===n)return-1;if(o.route===n)return 1}return u(t,o)}};const n=r(d[0]);function t(n,t){return n.deep&&!t.deep?1:!n.deep&&t.deep?-1:0}function u(u,o){if(u.dynamic&&!o.dynamic)return 1;if(!u.dynamic&&o.dynamic)return-1;if(u.dynamic&&o.dynamic){if(u.dynamic.length!==o.dynamic.length)return o.dynamic.length-u.dynamic.length;for(let n=0;n<u.dynamic.length;n++){const i=u.dynamic[n],c=o.dynamic[n];if(i.notFound&&c.notFound){const n=t(i,c);if(n)return n}if(i.notFound&&!c.notFound)return 1;if(!i.notFound&&c.notFound)return-1;const a=t(i,c);if(a)return a}return 0}const i='index'===u.route||null!=(0,n.matchGroupName)(u.route),c='index'===o.route||null!=(0,n.matchGroupName)(o.route);return i&&!c?-1:!i&&c?1:u.route.length-o.route.length}},258,[257]); 315__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackRouter=e.stackRouterOverride=void 0;const t=_r(d[0]),r=_r(d[1]),o=_r(d[2]),n=_r(d[3]),p=_r(d[4]),s=_r(d[5]),l=_r(d[6]),u=_r(d[7]),c=_r(d[8]),y=_r(d[9]),A=_r(d[10]),f=_r(d[11]),R=(0,p.createNativeStackNavigator)().Navigator,_=(0,n.withLayoutContext)(R);function O(t){return'PUSH'===t.type||'NAVIGATE'===t.type||'POP'===t.type||'POP_TO_TOP'===t.type||'REPLACE'===t.type||'PRELOAD'===t.type}const E=t=>!!t.payload&&'params'in t.payload&&'object'==typeof t.payload.params&&!!(0,l.getInternalExpoRouterParams)(t.payload?.params??void 0)[l.INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME],N=t=>{const r=t.payload&&'params'in t.payload&&'object'==typeof t.payload.params?t.payload.params:void 0,o=(0,l.getInternalExpoRouterParams)(r??void 0)[l.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];if(o&&'string'==typeof o)return o};function S(t,r){return'function'==typeof t?o=>t(r,o.params??{}):!0===t?t=>(0,u.getSingularId)(r,t):void 0}function T(t,r){if(!t)return t;if(!t.routes)return t;const o=t.index||t.routes.length-1,n=t.routes[o],p=n.name,s=r?.({params:n.params});if(!s)return t;let l=t.routes;return l=l.filter((t,n)=>n===o||(p!==t.name||s!==r?.({params:t.params}))),{...t,index:l.length-1,routes:l}}e.stackRouterOverride=t=>({getStateForAction:(o,n,p)=>{if(n.target&&n.target!==o.key)return null;if(!O(n))return t.getStateForAction(o,n,p);const s=n.payload&&'singular'in n.payload?n.payload.singular:void 0;const{routeParamList:c}=p;switch(n.type){case'PUSH':case'NAVIGATE':{if(!o.routeNames.includes(n.payload.name))return null;const t=(function(){if(!('payload'in n)||!n.payload||!('name'in n.payload)||'string'!=typeof n.payload.name)return;const t=n.payload.name;return S(s,t)||p.routeGetIdList[t]})(),y=t?.({params:n.payload.params});let A;if(void 0!==y)A=o.routes.findLast(r=>r.name===n.payload.name&&y===t?.({params:r.params}));else if('NAVIGATE'===n.type){const t=o.routes[o.index];n.payload.name!==t.name||E(n)?n.payload.pop&&(A=o.routes.findLast(t=>t.name===n.payload.name)):A=t}let f,R,_=!1;if(E(n)&&!A&&(A=o.preloadedRoutes.find(t=>t.name===n.payload.name&&y===t.key),_=!!A),A||(A=o.preloadedRoutes.find(r=>r.name===n.payload.name&&y===t?.({params:r.params})),_=!!A),f='NAVIGATE'===n.type&&n.payload.merge&&A?void 0!==n.payload.params||void 0!==c[n.payload.name]?{...c[n.payload.name],...A.params,...n.payload.params}:A.params:void 0!==c[n.payload.name]?{...c[n.payload.name],...n.payload.params}:n.payload.params,A)if('NAVIGATE'===n.type&&n.payload.pop){R=[];for(const t of o.routes){if(t.key===A.key){R.push({...A,path:void 0!==n.payload.path?n.payload.path:A.path,params:f});break}R.push(t)}}else{if(void 0!==y)R=o.routes.filter(t=>t.key!==A.key);else if('NAVIGATE'===n.type&&o.routes.length>0){const t=o.routes[o.routes.length-1];R=(0,u.getSingularId)(t.name,{params:t.params})===(0,u.getSingularId)(A.name,{params:f})?o.routes.slice(0,-1):[...o.routes]}else R=[...o.routes];const t=R.length!==o.routes.length||_?A.key:`${n.payload.name}-${(0,r.nanoid)()}`;R.push({...A,key:t,path:'NAVIGATE'===n.type&&void 0!==n.payload.path?n.payload.path:A.path,params:f})}else R=[...o.routes,{key:`${n.payload.name}-${(0,r.nanoid)()}`,name:n.payload.name,path:'NAVIGATE'===n.type?n.payload.path:void 0,params:f}];const O={...o,index:R.length-1,preloadedRoutes:o.preloadedRoutes.filter(t=>R[R.length-1].key!==t.key),routes:R};if(s)return T(O,t);if(N(n)){const t=O.routes[O.routes.length-1],r=t.key,o={...t,params:{...t.params,[l.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME]:r}};return{...O,routes:[...O.routes.slice(0,-1),o]}}return O}case'PRELOAD':{if(!o.routeNames.includes(n.payload.name))return null;const t=p.routeGetIdList[n.payload.name],s=t?.({params:n.payload.params});let u;void 0!==s&&(u=o.routes.find(r=>r.name===n.payload.name&&s===t?.({params:r.params})));const y=N(n);if(u)return{...o,routes:o.routes.map(t=>{if(t.key!==u?.key)return t;const r=void 0!==c[n.payload.name]?{...c[n.payload.name],...n.payload.params}:n.payload.params;return{...t,params:y?{...r,[l.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME]:t.key}:r}})};{const p=`${n.payload.name}-${(0,r.nanoid)()}`,u=void 0!==c[n.payload.name]?{...c[n.payload.name],...n.payload.params}:n.payload.params,A={key:p,name:n.payload.name,params:y?{...u,[l.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME]:p}:u};return{...o,preloadedRoutes:[A].concat(o.preloadedRoutes.filter(r=>r.name!==n.payload.name||s!==t?.({params:r.params})))}}}default:return t.getStateForAction(o,n,p)}}});const I=Object.assign(r=>{const{isStackAnimationDisabled:n}=(0,s.useLinkPreviewContext)(),p=(0,o.useMemo)(()=>{const t=o.Children.toArray(r.children).find(t=>(0,A.isChildOfType)(t,c.StackHeader));if(t){const o={children:t},n=r.screenOptions;return n?'function'==typeof n?(...t)=>{const r=n(...t);return(0,c.appendScreenStackPropsToOptions)(r,o)}:(0,c.appendScreenStackPropsToOptions)(n,o):(0,c.appendScreenStackPropsToOptions)({},o)}if(r.screenOptions){const t=r.screenOptions;return(0,c.validateStackPresentation)(t)}return r.screenOptions},[r.screenOptions,r.children]),l=(0,o.useMemo)(()=>k(p,n?()=>!0:h),[p,n]),u=(0,o.useMemo)(()=>(0,c.mapProtectedScreen)({guard:!0,children:r.children}).children,[r.children]);return(0,t.jsx)(_,{...r,children:u,screenOptions:l,UNSTABLE_router:e.stackRouterOverride})},{Screen:c.StackScreen,Protected:f.Protected,Header:c.StackHeader,SearchBar:c.StackSearchBar,Title:c.StackTitle,Toolbar:c.StackToolbar});function k(t,r){return t&&'function'==typeof t?o=>{const n=t(o);return r(o.route)?{...n,animation:'none'}:n??{}}:o=>r(o.route)?{...t??{},animation:'none'}:t??{}}function h(t){return!!(0,l.getInternalExpoRouterParams)(t.params)[l.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME]}e.default=I;e.StackRouter=t=>{const r=(0,y.StackRouter)(t);return{...r,...(0,e.stackRouterOverride)(r)}}},259,[6,260,11,261,741,718,573,588,753,401,527,739]); 316__d(function(g,r,_i,a,m,e,d){"use strict";
316Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"nanoid",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"customAlphabet",{enumerable:!0,get:function(){return t}});let t=(t,n=21)=>(o=n)=>{let u='',l=0|o;for(;l-- >0;)u+=t[Math.random()*t.length|0];return u},n=(t=21)=>{let n='',o=0|t;for(;o-- >0;)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return n}},260,[]); 317__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useFilterScreenChildren=h,e.withLayoutContext=function(s,f,y=!1){return Object.assign((0,n.forwardRef)(({children:n,unstable_screenErrorBoundary:l,...p},S)=>{const x=(0,o.useContextKey)(),{screens:C,protectedScreens:v}=h(n,{contextKey:x}),b=f?f(C??[]):C,_=(0,c.useSortedScreens)(b??[],v,y);if(!_.length)return null;const j=(0,t.jsx)(u.IsWithinLayoutContext,{value:!0,children:(0,t.jsx)(s,{...p,id:x,ref:S,children:_})});return l?(0,t.jsx)(o.ScreenErrorBoundaryContext,{value:l,children:j}):j}),{Screen:p.Screen,Protected:l.Protected})};const t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),u=r(d[5]),l=r(d[6]),p=r(d[7]);function h(t,{isCustomNavigator:o,contextKey:c}={}){return(0,n.useMemo)(()=>{const u=[],h=[],f=new Set;function y(t,S=!1){if((0,p.isScreen)(t,c))S?f.add(t.props.name):h.push(t.props);else{if(!(0,s.isNativeTabTrigger)(t,c)){if((0,l.isProtectedReactElement)(t)){const o=S||!t.props.guard;return void n.Children.forEach(t.props.children,t=>{y(t,o)})}return o?(u.push(t),null):(console.warn(`Layout children must be of type Screen, all other children are ignored. To use custom children, create a custom <Layout />. Update Layout Route at: "app${c}/_layout"`),null)}if(S)f.add(t.props.name);else{const n=(0,s.convertTabPropsToOptions)(t.props);!1===n.hidden?h.push({...t.props,options:n}):f.add(t.props.name)}}}return n.Children.forEach(t,t=>y(t)),{screens:h,children:u,protectedScreens:f}},[t])}},261,[6,11,256,262,588,738,739,740]); 318__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeTabTrigger=void 0,e.convertTabPropsToOptions=T,e.isNativeTabTrigger=function(t,o){if((0,p.isChildOfType)(t,e.NativeTabTrigger)){if('name'in t.props&&!t.props.name)throw new Error(`<Trigger /> component in \`default export\` at \`app${o}/_layout\` must have a \`name\` prop when used as a child of a Layout Route.`);return!0}return!1};
318const t=r(d[0]),o=r(d[1]),l=r(d[2]),n=r(d[3]),s=r(d[4]),c=r(d[5]),b=r(d[6]),p=r(d[7]);function T({hidden:t,children:o,role:l,disablePopToTop:c,disableScrollToTop:b,unstable_nativeProps:T,disableAutomaticContentInsets:f,contentStyle:y,disableTransparentOnScrollEdge:h,disabled:I,rippleColor:C,indicatorColor:N,disableIndicator:S,labelVisibilityMode:O,testID:B,accessibilityLabel:L},E=!1){const w=E?{...T?{nativeProps:T}:{},...void 0!==h?{disableTransparentOnScrollEdge:h}:{},...void 0!==I?{disabled:I}:{},...void 0!==C?{rippleColor:C}:{},...void 0!==N?{indicatorColor:N}:{},...void 0!==S?{disableIndicator:S}:{},...void 0!==O?{labelVisibilityMode:O}:{},...void 0!==B?{tabBarItemTestID:B}:{},...void 0!==L?{tabBarItemAccessibilityLabel:L}:{}}:{hidden:!!t,specialEffects:{repeatedTabSelection:{popToRoot:!c,scrollToTop:!b}},contentStyle:y,role:l,nativeProps:T,disableAutomaticContentInsets:f,...void 0!==h?{disableTransparentOnScrollEdge:h}:{},...void 0!==I?{disabled:I}:{},...void 0!==C?{rippleColor:C}:{},...void 0!==N?{indicatorColor:N}:{},...void 0!==S?{disableIndicator:S}:{},...void 0!==O?{labelVisibilityMode:O}:{},...void 0!==B?{tabBarItemTestID:B}:{},...void 0!==L?{tabBarItemAccessibilityLabel:L}:{}};return(0,p.filterAllowedChildrenElements)(o,[n.NativeTabsTriggerBadge,n.NativeTabsTriggerLabel,n.NativeTabsTriggerIcon]).reduce((t,o)=>((0,p.isChildOfType)(o,n.NativeTabsTriggerBadge)?v(t,o.props):(0,p.isChildOfType)(o,n.NativeTabsTriggerLabel)?u(t,o.props):(0,p.isChildOfType)(o,n.NativeTabsTriggerIcon)&&(0,s.appendIconOptions)(t,o.props),t),{...w})}function v(t,o){o.children?(t.badgeValue=String(o.children),t.selectedBadgeBackgroun
318dColor=o.selectedBackgroundColor):o.hidden||(t.badgeValue=' ')}function u(t,l){l.hidden?t.title='':(t.title=l.children,l.selectedStyle&&(t.selectedLabelStyle=o.StyleSheet.flatten(l.selectedStyle)))}e.NativeTabTrigger=Object.assign(function(o){const n=(0,l.useRoute)(),s=(0,l.useNavigation)(),p=(0,c.useIsPreview)();return(0,b.useFocusEffect)((0,t.useCallback)(()=>{if(!p){if('tab'!==s.getState()?.type)throw new Error(`Trigger component can only be used in the tab screen. Current route: ${n.name}`);const t=T(o,!0);s.setOptions(t)}},[o,p])),null},{Label:n.NativeTabsTriggerLabel,Icon:n.NativeTabsTriggerIcon,Badge:n.NativeTabsTriggerBadge,VectorIcon:n.NativeTabsTriggerVectorIcon})},262,[11,263,401,519,524,528,529,527]); 319__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"unstable_createElement",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(_e,"findNodeHandle",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(_e,"processColor",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(_e,"render",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(_e,"unmountComponentAtNode",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(_e,"NativeModules",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(_e,"AccessibilityInfo",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(_e,"Alert",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(_e,"Animated",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(_e,"Appearance",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(_e,"AppRegistry",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(_e,"AppState",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(_e,"BackHandler",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(_e,"Clipboard",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(_e,"Dimensions",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(_e,"Easing",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(_e,"I18nManager",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(_e,"Keyboard",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(_e,"InteractionManager",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(_e,"LayoutAnimation",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(_e,"Linking",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(_e,"NativeEventEmitter",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(_e,"PanResponder",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(_e,"PixelRatio",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(_e,"Platform",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(_e,"Share",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(_e,"StyleSheet",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(_e,"UIManager",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(_e,"Vibration",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(_e,"ActivityIndicator",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(_e,"Button",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(_e,"CheckBox",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(_e,"FlatList",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(_e,"Image",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(_e,"ImageBackground",{enumerable:!0,get:function(){return H.default}}),Object.defineProperty(_e,"KeyboardAvoidingView",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(_e,"Modal",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(_e,"Picker",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(_e,"Pressable",{enumerable:!0,get:function(){return U.default}}),Object.defineProperty(_e,"ProgressBar",{enumerable:!0,get:function(){return Y.default}}),Object.defineProperty(_e,"RefreshControl",{enumerable:!0,get:function(){return q.default}}
319),Object.defineProperty(_e,"SafeAreaView",{enumerable:!0,get:function(){return G.default}}),Object.defineProperty(_e,"ScrollView",{enumerable:!0,get:function(){return J.default}}),Object.defineProperty(_e,"SectionList",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(_e,"StatusBar",{enumerable:!0,get:function(){return X.default}}),Object.defineProperty(_e,"Switch",{enumerable:!0,get:function(){return Z.default}}),Object.defineProperty(_e,"Text",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(_e,"TextInput",{enumerable:!0,get:function(){return ee.default}}),Object.defineProperty(_e,"Touchable",{enumerable:!0,get:function(){return te.default}}),Object.defineProperty(_e,"TouchableHighlight",{enumerable:!0,get:function(){return ne.default}}),Object.defineProperty(_e,"TouchableNativeFeedback",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(_e,"TouchableOpacity",{enumerable:!0,get:function(){return ue.default}}),Object.defineProperty(_e,"TouchableWithoutFeedback",{enumerable:!0,get:function(){return fe.default}}),Object.defineProperty(_e,"View",{enumerable:!0,get:function(){return ae.default}}),Object.defineProperty(_e,"VirtualizedList",{enumerable:!0,get:function(){return ie.default}}),Object.defineProperty(_e,"YellowBox",{enumerable:!0,get:function(){return oe.default}}),Object.defineProperty(_e,"LogBox",{enumerable:!0,get:function(){return le.default}}),Object.defineProperty(_e,"DeviceEventEmitter",{enumerable:!0,get:function(){return ce.default}}),Object.defineProperty(_e,"useColorScheme",{enumerable:!0,get:function(){return de.default}}),Object.defineProperty(_e,"useLocaleContext",{enumerable:!0,get:function(){return be.default}}),Object.defineProperty(_e,"useWindowDimensions",{enumerable:!0,get:function(){return ge.default}});var t=e(r(d[0])),n=e(r(d[1])),u=e(r(d[2])),f=e(r(d[3])),o=e(r(d[4])),l=e(r(d[5])),c=e(r(d[6])),b=e(r(d[7])),p=e(r(d[8])),y=e(r(d[9])),P=e(r(d[10])),O=e(r(d[11])),j=e(r(d[12])),s=e(r(d[13])),h=e(r(d[14])),A=e(r(d[15])),v=e(r(d[16])),S=e(r(d[17])),B=e(r(d[18])),I=e(r(d[19])),k=e(r(d[20])),w=e(r(d[21])),x=e(r(d[22])),C=e(r(d[23])),L=e(r(d[24])),M=e(r(d[25])),T=e(r(d[26])),_=e(r(d[27])),E=e(r(d[28])),V=e(r(d[29])),N=e(r(d[30])),R=e(r(d[31])),D=e(r(d[32])),F=e(r(d[33])),H=e(r(d[34])),K=e(r(d[35])),W=e(r(d[36])),z=e(r(d[37])),U=e(r(d[38])),Y=e(r(d[39])),q=e(r(d[40])),G=e(r(d[41])),J=e(r(d[42])),Q=e(r(d[43])),X=e(r(d[44])),Z=e(r(d[45])),$=e(r(d[46])),ee=e(r(d[47])),te=e(r(d[48])),ne=e(r(d[49])),re=e(r(d[50])),ue=e(r(d[51])),fe=e(r(d[52])),ae=e(r(d[53])),ie=e(r(d[54])),oe=e(r(d[55])),le=e(r(d[56])),ce=e(r(d[57])),de=e(r(d[58])),be=e(r(d[59])),ge=e(r(d[60]))},263,[15,264,33,234,230,170,265,266,267,348,229,200,349,350,107,345,351,352,285,353,199,152,355,169,136,358,26,88,359,360,361,365,270,319,366,367,368,373,375,380,277,381,278,323,382,383,327,385,386,390,391,362,393,13,394,395,396,397,398,399,400]); 320__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=t=>{throw new Error("findNodeHandle is not supported on web. Use the ref property on the component instead.")}},264,[]); 321__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}});var e,n=r(d[0]);function t(){return new Promise((e,n)=>{e(!0)})}var o=((e=n)&&e.__esModule?e:{default:e}).default&&'function'==typeof window.matchMedia?window.matchMedia('(prefers-reduced-motion: reduce)'):null;var u={},c={isScreenReaderEnabled:t,isReduceMotionEnabled:function(){return new Promise((e,n)=>{e(!o||o.matches)})},fetch:t,addEventListener:function(e,n){if('reduceMotionChanged'===e){if(!o)return;var t=e=>{n(e.matches)};s=t,null!=o&&(null!=o.addEventListener?o.addEventListener('change',s):o.addListener(s)),u[n]=t}var s;return{remove:()=>c.removeEventListener(e,n)}},setAccessibilityFocus:function(e){},announceForAccessibility:function(e){},removeEventListener:function(e,n){if('reduceMotionChanged'===e){var t=u[n];if(!t||!o)return;c=t,null!=o&&(null!=o.removeEventListener?o.removeEventListener('change',c):o.removeListener(c))}var c}},s=c},265,[35]); 322__d(function(g,r,i,a,m,e,d){"use strict";
322Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=class{static alert(){}}},266,[]); 323__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},267,[268]); 324__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}});var t=e(r(d[0])),u=e(r(d[1])),l=e(r(d[2])),f=e(r(d[3])),n=e(r(d[4])),o=e(r(d[5])),c=e(r(d[6])),s=e(r(d[7])),_=e(r(d[8])),b=e(r(d[9])),j=u.default.isTesting?_.default:b.default,p=(0,t.default)({FlatList:l.default,Image:f.default,ScrollView:n.default,SectionList:o.default,Text:c.default,View:s.default},j)},268,[21,136,269,318,321,322,326,328,329,330]); 325__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}});var t=e(r(_d[0])),n=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[1])),u=e(r(_d[2])),f=e(r(_d[3])),o=n.forwardRef((e,f)=>n.createElement(u.default,(0,t.default)({scrollEventThrottle:1e-4},e,{ref:f}))),c=(0,f.default)(o)},269,[232,11,270,300]); 326__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},270,[271]); 327__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return w}});var t=e(r(_d[0])),s=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),o=e(r(_d[4])),u=e(r(_d[5]));r(_d[6]);var h=e(r(_d[7])),p=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}),t.default=e,t})(r(_d[8])),f=e(r(_d[9])),d=r(_d[10]),c=e(r(_d[11])),C=["numColumns","columnWrapperStyle","removeClippedSubviews","strictMode"];function b(e){return null!=e?e:1}function v(e){return'number'==typeof Object(e).length}class _ extends p.PureComponent{scrollToEnd(e){this._listRef&&this._listRef.scrollToEnd(e)}scrollToIndex(e){this._listRef&&this._listRef.scrollToIndex(e)}scrollToItem(e){this._listRef&&this._listRef.scrollToItem(e)}scrollToOffset(e){this._listRef&&this._listRef.scrollToOffset(e)}recordInteraction(){this._listRef&&this._listRef.recordInteraction()}flashScrollIndicators(){this._listRef&&this._listRef.flashScrollIndicators()}getScrollResponder(){if(this._listRef)return this._listRef.getScrollResponder()}getNativeScrollRef(){if(this._listRef)return this._listRef.getScrollRef()}getScrollableNode(){if(this._listRef)return this._listRef.getScrollableNode()}constructor(e){super(e),this._virtualizedListPairs=[],this._captureRef=e=>{this._listRef=e},this._getItem=(e,t)=>{var s=b(this.props.numColumns);if(s>1){for(var n=[],l=0;l<s;l++){var o=t*s+l;if(o<e.length){var u=e[o];n.push(u)}}return n}return e[t]},this._getItemCount=e=>{if(null!=e&&v(e)){var t=b(this.props.numColumns);return t>1?Math.ceil(e.length/t):e.length}return 0},this._keyExtractor=(e,t)=>{var s,n=b(this.props.numColumns),l=null!==(s=this.props.keyExtractor)&&void 0!==s?s:d.keyExtractor;return n>1?((0,h.default)(Array.isArray(e),"FlatList: Encountered internal consistency error, expected each item to consist of an array with 1-%s columns; instead, received a single item.",n),e.map((e,s)=>l(e,t*n+s)).join(':')):l(e,t)},this._renderer=(e,t,s,n,o)=>{var u=b(n),f=s=>e?p.createElement(e,s):t?t(s):null,d=e=>{if(u>1){var t=e.item,n=e.index;return(0,h.default)(Array.isArray(t),'Expected array of items with numColumns > 1'),p.createElement(l.default,{style:[y.row,s]},t.map((t,s)=>
327{var l=f({item:t,index:n*u+s,separators:e.separators});return null!=l?p.createElement(p.Fragment,{key:s},l):null}))}return f(e)};return e?{ListItemComponent:d}:{renderItem:d}},this._memoizedRenderer=(0,c.default)(this._renderer),this._checkProps(this.props),this.props.viewabilityConfigCallbackPairs?this._virtualizedListPairs=this.props.viewabilityConfigCallbackPairs.map(e=>({viewabilityConfig:e.viewabilityConfig,onViewableItemsChanged:this._createOnViewableItemsChanged(e.onViewableItemsChanged)})):this.props.onViewableItemsChanged&&this._virtualizedListPairs.push({viewabilityConfig:this.props.viewabilityConfig,onViewableItemsChanged:this._createOnViewableItemsChanged(this.props.onViewableItemsChanged)})}componentDidUpdate(e){(0,h.default)(e.numColumns===this.props.numColumns,"Changing numColumns on the fly is not supported. Change the key prop on FlatList when changing the number of columns to force a fresh render of the component."),(0,h.default)(e.onViewableItemsChanged===this.props.onViewableItemsChanged,'Changing onViewableItemsChanged on the fly is not supported'),(0,h.default)(!(0,u.default)(e.viewabilityConfig,this.props.viewabilityConfig),'Changing viewabilityConfig on the fly is not supported'),(0,h.default)(e.viewabilityConfigCallbackPairs===this.props.viewabilityConfigCallbackPairs,'Changing viewabilityConfigCallbackPairs on the fly is not supported'),this._checkProps(this.props)}_checkProps(e){var t=e.getItem,s=e.getItemCount,n=e.horizontal,l=e.columnWrapperStyle,o=e.onViewableItemsChanged,u=e.viewabilityConfigCallbackPairs,p=b(this.props.numColumns);(0,h.default)(!t&&!s,'FlatList does not support custom data formats.'),p>1?(0,h.default)(!n,'numColumns does not support horizontal.'):(0,h.default)(!l,'columnWrapperStyle not supported for single column lists'),(0,h.default)(!(o&&u),"FlatList does not support setting both onViewableItemsChanged and viewabilityConfigCallbackPairs.")}_pushMultiColumnViewable(e,t){var s,l=b(this.props.numColumns),o=null!==(s=this.props.keyExtractor)&&void 0!==s?s:d.keyExtractor;t.item.forEach((s,u)=>{(0,h.default)(null!=t.index,'Missing index!');var p=t.index*l+u;e.push((0,n.default)((0,n.default)({},t),{},{item:s,key:o(s,p),index:p}))})}_createOnViewableItemsChanged(e){return t=>{var s=b(this.props.numColumns);if(e)if(s>1){var n=[],l=[];t.viewableItems.forEach(e=>this._pushMultiColumnViewable(l,e)),t.changed.forEach(e=>this._pushMultiColumnViewable(n,e)),e({viewableItems:l,changed:n})}else e(t)}}render(){var e,n=this.props,l=n.numColumns,o=n.columnWrapperStyle,u=n.removeClippedSubviews,h=n.strictMode,d=void 0!==h&&h,c=(0,s.default)(n,C),b=d?this._memoizedRenderer:this._renderer;return p.createElement(f.default,(0,t.default)({},c,{getItem:this._getItem,getItemCount:this._getItemCount,keyExtractor:this._keyExtractor,ref:this._captureRef,viewabilityConfigCallbackPairs:this._virtualizedListPairs,removeClippedSubviews:(e=u,null!=e&&e)},b(this.props.ListItemComponent,this.props.renderItem,o,l,this.props.extraData)))}}var y=o.default.create({row:{flexDirection:'row'}}),w=_},271,[232,14,21,13,26,272,136,108,11,273,297,299]); 328__d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=function t(n,f,u){if(void 0===u&&(u=-1),0===u)return!0;if(n===f)return!1;if('function'==typeof n&&'function'==typeof f)return!1;if('object'!=typeof n||null===n)return n!==f;if('object'!=typeof f||null===f)return!0;if(n.constructor!==f.constructor)return!0;if(Array.isArray(n)){var o=n.length;if(f.length!==o)return!0;for(var c=0;c<o;c++)if(t(n[c],f[c],u-1))return!0}else{for(var l in n)if(t(n[l],f[l],u-1))return!0;for(var v in f)if(void 0===n[v]&&void 0!==f[v])return!0}return!1}},272,[]); 329__d(function(g,_r,_i3,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var t=e(_r(_d[0])),s=e(_r(_d[1])),r=e(_r(_d[2])),i=e(_r(_d[3])),o=e(_r(_d[4])),l=e(_r(_d[5])),n=e(_r(_d[6])),h=e(_r(_d[7])),d=e(_r(_d[8])),c=e(_r(_d[9])),u=_r(_d[10]),p=e(_r(_d[11])),f=e(_r(_d[12])),_=e(_r(_d[13])),v=e(_r(_d[14])),y=e(_r(_d[15])),C=_r(_d[16]),L=_r(_d[17]),b=e(_r(_d[18])),S=e(_r(_d[19])),M=(function(e){if(e&&e.__esMo
329dule)return e;var t={};return e&&Object.keys(e).forEach(function(s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}),t.default=e,t})(_r(_d[20])),I=!1,R='';function w(e){return null!=e&&e}function x(e){return null!=e?e:10}function E(e){return null!=e?e:2}function T(e){return null!=e?e:2}function F(e,t){return e*t/2}function V(e){return null!=e?e:21}function k(e,t){for(var s=e.length-1;s>=0;s--)if(t(e[s]))return e[s];return null}class O extends _.default{scrollToEnd(e){var t=!e||e.animated,s=this.props.getItemCount(this.props.data)-1;if(!(s<0)){var r=this.__getFrameMetricsApprox(s,this.props),i=Math.max(0,r.offset+r.length+this._footerLength-this._scrollMetrics.visibleLength);null!=this._scrollRef&&(null!=this._scrollRef.scrollTo?this._scrollRef.scrollTo(w(this.props.horizontal)?{x:i,animated:t}:{y:i,animated:t}):console.warn("No scrollTo method provided. This may be because you have two nested VirtualizedLists with the same orientation, or because you are using a custom component that does not implement scrollTo."))}}scrollToIndex(e){var t=this.props,s=t.data,r=t.horizontal,i=t.getItemCount,o=t.getItemLayout,l=t.onScrollToIndexFailed,n=e.animated,h=e.index,d=e.viewOffset,c=e.viewPosition;if((0,b.default)(h>=0,"scrollToIndex out of range: requested index "+h+" but minimum is 0"),(0,b.default)(i(s)>=1,"scrollToIndex out of range: item length "+i(s)+" but minimum is 1"),(0,b.default)(h<i(s),"scrollToIndex out of range: requested index "+h+" is out of 0 to "+(i(s)-1)),!o&&h>this._highestMeasuredFrameIndex)return(0,b.default)(!!l,"scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures."),void l({averageItemLength:this._averageCellLength,highestMeasuredFrameIndex:this._highestMeasuredFrameIndex,index:h});var u=this.__getFrameMetricsApprox(Math.floor(h),this.props),p=Math.max(0,this._getOffsetApprox(h,this.props)-(c||0)*(this._scrollMetrics.visibleLength-u.length))-(d||0);null!=this._scrollRef&&(null!=this._scrollRef.scrollTo?this._scrollRef.scrollTo(r?{x:p,animated:n}:{y:p,animated:n}):console.warn("No scrollTo method provided. This may be because you have two nested VirtualizedLists with the same orientation, or because you are using a custom component that does not implement scrollTo."))}scrollToItem(e){for(var t=e.item,s=this.props,i=s.data,o=s.getItem,l=(0,s.getItemCount)(i),n=0;n<l;n++)if(o(i,n)===t){this.scrollToIndex((0,r.default)((0,r.default)({},e),{},{index:n}));break}}scrollToOffset(e){var t=e.animated,s=e.offset;null!=this._scrollRef&&(null!=this._scrollRef.scrollTo?this._scrollRef.scrollTo(w(this.props.horizontal)?{x:s,animated:t}:{y:s,animated:t}):console.warn("No scrollTo method provided. This may be because you have two nested VirtualizedLists with the same orientation, or because you are using a custom component that does not implement scrollTo."))}recordInteraction(){this._nestedChildLists.forEach(e=>{e.recordInteraction()}),this._viewabilityTuples.forEach(e=>{e.viewabilityHelper.recordInteraction()}),this._updateViewableItems(this.props,this.state.cellsAroundViewport)}flashScrollIndicators(){null!=this._scrollRef&&this._scrollRef.flashScrollIndicators()}getScrollResponder(){if(this._scrollRef&&this._scrollRef.getScrollResponder)return this._scrollRef.getScrollResponder()}getScrollableNode(){return this._scrollRef&&this._scrollRef.getScrollableNode?this._scrollRef.getScrollableNode():this._scrollRef}getScrollRef(){return this._scrollRef&&this._scrollRef.getScrollRef?this._scrollRef.getScrollRef():this._scrollRef}_getCellKey(){var e;return(null==(e=this.context)?void 0:e.cellKey)||'rootList'}hasMore(){return this._hasMore}constructor(e){var t;if(super(e),this._getScrollMetrics=()=>this._scrollMetrics,this._getOutermostParentListRef=()=>this._isNestedWithSameOrientation()?this.context.getOutermostParentListRef():this,this._registerAsNestedChild=e=>{this._nestedChildLists.add(e.ref,e.cellKey),this._hasInteracted&&e.ref.recordInteraction()},this._unregisterAsNestedChild=e=>{this._nestedChildLists.remove(e.ref)},this._onUpdateSeparators=(e,t)=>
329{e.forEach(e=>{var s=null!=e&&this._cellRefs[e];s&&s.updateSeparatorProps(t)})},this._getSpacerKey=e=>e?'height':'width',this._averageCellLength=0,this._cellRefs={},this._frames={},this._footerLength=0,this._hasTriggeredInitialScrollToIndex=!1,this._hasInteracted=!1,this._hasMore=!1,this._hasWarned={},this._headerLength=0,this._hiPriInProgress=!1,this._highestMeasuredFrameIndex=0,this._indicesToKeys=new Map,this._lastFocusedCellKey=null,this._nestedChildLists=new p.default,this._offsetFromParentVirtualizedList=0,this._prevParentOffset=0,this._scrollMetrics={contentLength:0,dOffset:0,dt:10,offset:0,timestamp:0,velocity:0,visibleLength:0,zoomScale:1},this._scrollRef=null,this._sentStartForContentLength=0,this._sentEndForContentLength=0,this._totalCellLength=0,this._totalCellsMeasured=0,this._viewabilityTuples=[],this._captureScrollRef=e=>{this._scrollRef=e},this._defaultRenderScrollComponent=e=>{var t,r=e.onRefresh;return this._isNestedWithSameOrientation()?M.createElement(l.default,e):r?((0,b.default)('boolean'==typeof e.refreshing,'`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `'+JSON.stringify(null!==(t=e.refreshing)&&void 0!==t?t:'undefined')+'`'),M.createElement(o.default,(0,s.default)({},e,{refreshControl:null==e.refreshControl?M.createElement(i.default,{refreshing:e.refreshing,onRefresh:r,progressViewOffset:e.progressViewOffset}):e.refreshControl}))):M.createElement(o.default,e)},this._onCellLayout=(e,t,s)=>{var r=e.nativeEvent.layout,i={offset:this._selectOffset(r),length:this._selectLength(r),index:s,inLayout:!0},o=this._frames[t];o&&i.offset===o.offset&&i.length===o.length&&s===o.index?this._frames[t].inLayout=!0:(this._totalCellLength+=i.length-(o?o.length:0),this._totalCellsMeasured+=o?0:1,this._averageCellLength=this._totalCellLength/this._totalCellsMeasured,this._frames[t]=i,this._highestMeasuredFrameIndex=Math.max(this._highestMeasuredFrameIndex,s),this._scheduleCellsToRenderUpdate()),this._triggerRemeasureForChildListsInCell(t),this._computeBlankness(),this._updateViewableItems(this.props,this.state.cellsAroundViewport)},this._onCellUnmount=e=>{delete this._cellRefs[e];var t=this._frames[e];t&&(this._frames[e]=(0,r.default)((0,r.default)({},t),{},{inLayout:!1}))},this._onLayout=e=>{this._isNestedWithSameOrientation()?this.measureLayoutRelativeToContainingList():this._scrollMetrics.visibleLength=this._selectLength(e.nativeEvent.layout),this.props.onLayout&&this.props.onLayout(e),this._scheduleCellsToRenderUpdate(),this._maybeCallOnEdgeReached()},this._onLayoutEmpty=e=>{this.props.onLayout&&this.props.onLayout(e)},this._onLayoutFooter=e=>{this._triggerRemeasureForChildListsInCell(this._getFooterCellKey()),this._footerLength=this._selectLength(e.nativeEvent.layout)},this._onLayoutHeader=e=>{this._headerLength=this._selectLength(e.nativeEvent.layout)},this._onContentSizeChange=(e,t)=>
329{e>0&&t>0&&null!=this.props.initialScrollIndex&&this.props.initialScrollIndex>0&&!this._hasTriggeredInitialScrollToIndex&&(null==this.props.contentOffset&&(this.props.initialScrollIndex<this.props.getItemCount(this.props.data)?this.scrollToIndex({animated:!1,index:(0,S.default)(this.props.initialScrollIndex)}):this.scrollToEnd({animated:!1})),this._hasTriggeredInitialScrollToIndex=!0),this.props.onContentSizeChange&&this.props.onContentSizeChange(e,t),this._scrollMetrics.contentLength=this._selectLength({height:t,width:e}),this._scheduleCellsToRenderUpdate(),this._maybeCallOnEdgeReached()},this._convertParentScrollMetrics=e=>{var t=e.offset-this._offsetFromParentVirtualizedList,s=e.visibleLength,r=t-this._scrollMetrics.offset;return{visibleLength:s,contentLength:this._scrollMetrics.contentLength,offset:t,dOffset:r}},this._onScroll=e=>{this._nestedChildLists.forEach(t=>{t._onScroll(e)}),this.props.onScroll&&this.props.onScroll(e);var t=e.timeStamp,s=this._selectLength(e.nativeEvent.layoutMeasurement),r=this._selectLength(e.nativeEvent.contentSize),i=this._selectOffset(e.nativeEvent.contentOffset),o=i-this._scrollMetrics.offset;if(this._isNestedWithSameOrientation()){if(0===this._scrollMetrics.contentLength)return;var l=this._convertParentScrollMetrics({visibleLength:s,offset:i});s=l.visibleLength,r=l.contentLength,i=l.offset,o=l.dOffset}var n=this._scrollMetrics.timestamp?Math.max(1,t-this._scrollMetrics.timestamp):1,h=o/n;n>500&&this._scrollMetrics.dt>500&&r>5*s&&!this._hasWarned.perf&&((0,c.default)("VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc.",{dt:n,prevDt:this._scrollMetrics.dt,contentLength:r}),this._hasWarned.perf=!0);var d=e.nativeEvent.zoomScale<0?1:e.nativeEvent.zoomScale;this._scrollMetrics={contentLength:r,dt:n,dOffset:o,offset:i,timestamp:t,velocity:h,visibleLength:s,zoomScale:d},this._updateViewableItems(this.props,this.state.cellsAroundViewport),this.props&&(this._maybeCallOnEdgeReached(),0!==h&&this._fillRateHelper.activate(),this._computeBlankness(),this._scheduleCellsToRenderUpdate())},this._onScrollBeginDrag=e=>{this._nestedChildLists.forEach(t=>{t._onScrollBeginDrag(e)}),this._viewabilityTuples.forEach(e=>{e.viewabilityHelper.recordInteraction()}),this._hasInteracted=!0,this.props.onScrollBeginDrag&&this.props.onScrollBeginDrag(e)},this._onScrollEndDrag=e=>{this._nestedChildLists.forEach(t=>{t._onScrollEndDrag(e)});var t=e.nativeEvent.velocity;t&&(this._scrollMetrics.velocity=this._selectOffset(t)),this._computeBlankness(),this.props.onScrollEndDrag&&this.props.onScrollEndDrag(e)},this._onMomentumScrollBegin=e=>{this._nestedChildLists.forEach(t=>{t._onMomentumScrollBegin(e)}),this.props.onMomentumScrollBegin&&this.props.onMomentumScrollBegin(e)},this._onMomentumScrollEnd=e=>{this._nestedChildLists.forEach(t=>{t._onMomentumScrollEnd(e)}),this._scrollMetrics.velocity=0,this._computeBlankness(),this.props.onMomentumScrollEnd&&this.props.onMomentumScrollEnd(e)},this._updateCellsToRender=()=>{this._updateViewableItems(this.props,this.state.cellsAroundViewport),this.setState((e,t)=>{var s=this._adjustCellsAroundViewport(t,e.cellsAroundViewport),r=O._createRenderMask(t,s,this._getNonViewportRenderRegions(t));return s.first===e.cellsAroundViewport.first&&s.last===e.cellsAroundViewport.last&&r.equals(e.renderMask)?null:{cellsAroundViewport:s,renderMask:r}})},this._createViewToken=(e,t,s)=>{var r=s.data,i=(0,s.getItem)(r,e);return{index:e,item:i,key:this._keyExtractor(i,e,s),isViewable:t}},this._getOffsetApprox=(e,t)=>{if(Number.isInteger(e))return this.__getFrameMetricsApprox(e,t).offset;var s=this.__getFrameMetricsApprox(Math.floor(e),t),r=e-Math.floor(e);return s.offset+r*s.length},this.__getFrameMetricsApprox=(e,t)=>{var s=this._getFrameMetrics(e,t);if(s&&s.index===e)return s;var r=t.data,i=t.getItemCount,o=t.getItemLayout;return(0,b.default)(e>=0&&e<i(r),'Tried to get frame for out of range index '+e),(0,b.default)(!o,'Should not have to estimate frames when a measurement metrics function is provided'),{length:this._averageCellLength,offset:this._averageCellLength*e}},this._getFrameMetrics=(e,t)=>{var s=t.data,r=t.getItem,i=t.getItemCount,o=t.getItemLayout;(0,b.default)(e>=0&&e<i(s),'Tried to get frame for out of range index '+e);var l=r(s,e),n=this._frames[this._keyExtractor(l,e,t)];return n&&n.index===e||!o?n:o(s,e)},this._getNonViewportRenderRegions=e=>{if(!this._lastFocusedCellKey||!this._cellRefs[this._lastFocusedCellKey])return[];var t=this._cellRefs[this._lastFocusedCellKey].props.index,s=e.getItemCount(e.data);if(t>=s||this._keyExtractor(e.getItem(e.data,t),t,e)!==this._lastFocusedCellKey)return[];for(var r=t,i=0,o=r-1;o>=0&&i<this._scrollMetrics.visibleLength;o--)r--,i+=this.__getFrameMetricsApprox(o,e).length;for(var l=t,n=0,h=l+1;h<s&&n<this._scrollMetrics.visibleLength;h++)l++,n+=this.__getFrameMetricsApprox(h,e).length;return[{first:r,last:l}]},this._checkProps(e),this._fillRateHelper=new f.default(this._getFrameMetrics),this._updateCellsToRenderBatcher=new h.default(this._updateCellsToRender,null!==(t=this.props.updateCellsBatchingPerio
329d)&&void 0!==t?t:50),this.props.viewabilityConfigCallbackPairs)this._viewabilityTuples=this.props.viewabilityConfigCallbackPairs.map(e=>({viewabilityHelper:new v.default(e.viewabilityConfig),onViewableItemsChanged:e.onViewableItemsChanged}));else{var n=this.props,d=n.onViewableItemsChanged,u=n.viewabilityConfig;d&&this._viewabilityTuples.push({viewabilityHelper:new v.default(u),onViewableItemsChanged:d})}var _=O._initialRenderRegion(e);this.state={cellsAroundViewport:_,renderMask:O._createRenderMask(e,_)},this.invertedWheelEventHandler=e=>{var t=this.props.horizontal?e.target.scrollLeft:e.target.scrollTop,s=this.props.horizontal?e.target.scrollWidth:e.target.scrollHeight,r=this.props.horizontal?e.target.clientWidth:e.target.clientHeight,i=s>r,o=this.props.horizontal?e.deltaX||e.wheelDeltaX:e.deltaY||e.wheelDeltaY,l=o;i&&(l=o<0?Math.min(o+t,0):Math.max(o-(s-r-t),0));var n=o-l;if(this.props.inverted&&this._scrollRef&&this._scrollRef.getScrollableNode){var h=this._scrollRef.getScrollableNode();if(this.props.horizontal){e.target.scrollLeft+=n;var d=h.scrollLeft-l;h.scrollLeft=this.props.getItemLayout?d:Math.min(d,this._totalCellLength)}else{e.target.scrollTop+=n;var c=h.scrollTop-l;h.scrollTop=this.props.getItemLayout?c:Math.min(c,this._totalCellLength)}e.preventDefault()}}}_checkProps(e){var t=e.onScroll,s=e.windowSize,r=e.getItemCount,i=e.data,o=e.initialScrollIndex;(0,b.default)(!t||!t.__isNative,"Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent to support native onScroll events with useNativeDriver"),(0,b.default)(V(s)>0,'VirtualizedList: The windowSize prop must be present and set to a value greater than 0.'),(0,b.default)(r,'VirtualizedList: The "getItemCount" prop must be provided');var l=r(i);null==o||this._hasTriggeredInitialScrollToIndex||!(o<0||l>0&&o>=l)||this._hasWarned.initialScrollIndex||(console.warn("initialScrollIndex \""+o+"\" is not valid (list has "+l+" items)"),this._hasWarned.initialScrollIndex=!0)}static _createRenderMask(e,t,s){var r=e.getItemCount(e.data);(0,b.default)(t.first>=0&&t.last>=t.first-1&&t.last<r,"Invalid cells around viewport \"["+t.first+", "+t.last+"]\" was passed to VirtualizedList._createRenderMask");var i=new u.CellRenderMask(r);if(r>0){for(var o=0,l=[t,...null!=s?s:[]];o<l.length;o++){var n=l[o];i.addCells(n)}if(null==e.initialScrollIndex||e.initialScrollIndex<=0){var h=O._initialRenderRegion(e);i.addCells(h)}var d=new Set(e.stickyHeaderIndices);O._ensureClosestStickyHeader(e,d,i,t.first)}return i}static _initialRenderRegion(e){var t,s,r=e.getItemCount(e.data),i=Math.max(0,Math.min(r-1,Math.floor(null!==(t=e.initialScrollIndex)&&void 0!==t?t:0)));return{first:i,last:Math.min(r,i+(null!=(s=e.initialNumToRender)?s:10))-1}}static _ensureClosestStickyHeader(e,t,s,r){for(var i=e.ListHeaderComponent?1:0,o=r-1;o>=0;o--)if(t.has(o+i)){s.addCells({first:o,last:o});break}}_adjustCellsAroundViewport(e,t){var s,r=e.data,i=e.getItemCount,o=T(e.onEndReachedThreshold),l=this._scrollMetrics,n=l.contentLength,h=l.offset,d=l.visibleLength,c=n-d-h;if(d<=0||n<=0)return t.last>=i(r)?O._constrainToItemCount(t,e):t;if(e.disableVirtualization){var u=c<o*d?x(e.maxToRenderPerBatch):0;s={first:0,last:Math.min(t.last+u,i(r)-1)}}else{if(e.initialScrollIndex&&!this._scrollMetrics.offset&&Math.abs(c)>=Number.EPSILON)return t.last>=i(r)?O._constrainToItemCount(t,e):t;s=(0,L.computeWindowedRenderLimits)(e,x(e.maxToRenderPerBatch),V(e.windowSize),t,this.__getFrameMetricsApprox,this._scrollMetrics),(0,b.default)(s.last<i(r),'computeWindowedRenderLimits() should return range in-bounds')}if(this._nestedChildLists.size()>0){var p=this._findFirstChildWithMore(s.first,s.last);s.last=null!=p?p:s.last}return s}_findFirstChildWithMore(e,t){for(var s=e;s<=t;s++){var r=this._indicesToKeys.get(s);if(null!=r&&this._nestedChildLists.anyInCell(r,e=>e.hasMore()))return s}return null}componentDidMount(){this._isNestedWithSameOrientation()&&this.context.registerAsNestedChild({ref:this,cellKey:this.context.cellKey}),this.setupWebWheelHandler()}componentWillUnmount(){this._isNestedWithSameOrientation()&&this.context.unregisterAsNestedChild({ref:this}),this._updateCellsToRenderBatcher.dispose({abort:!0}
329),this._viewabilityTuples.forEach(e=>{e.viewabilityHelper.dispose()}),this._fillRateHelper.deactivateAndFlush(),this.teardownWebWheelHandler()}setupWebWheelHandler(){this._scrollRef&&this._scrollRef.getScrollableNode?this._scrollRef.getScrollableNode().addEventListener('wheel',this.invertedWheelEventHandler):setTimeout(()=>this.setupWebWheelHandler(),50)}teardownWebWheelHandler(){this._scrollRef&&this._scrollRef.getScrollableNode&&this._scrollRef.getScrollableNode().removeEventListener('wheel',this.invertedWheelEventHandler)}static getDerivedStateFromProps(e,t){if(e.getItemCount(e.data)===t.renderMask.numCells())return t;var s=O._constrainToItemCount(t.cellsAroundViewport,e);return{cellsAroundViewport:s,renderMask:O._createRenderMask(e,s)}}_pushCells(e,t,r,i,o,l){var n,h=this,d=this.props,c=d.CellRendererComponent,u=d.ItemSeparatorComponent,p=d.ListHeaderComponent,f=d.ListItemComponent,_=d.data,v=d.debug,C=d.getItem,L=d.getItemCount,b=d.getItemLayout,S=d.horizontal,I=d.renderItem,R=p?1:0,w=L(_)-1;o=Math.min(w,o);for(var x=function(){var i=C(_,E),o=h._keyExtractor(i,E,h.props);h._indicesToKeys.set(E,o),r.has(E+R)&&t.push(e.length);var d=null==b||v||h._fillRateHelper.enabled();e.push(M.createElement(y.default,(0,s.default)({CellRendererComponent:c,ItemSeparatorComponent:E<w?u:void 0,ListItemComponent:f,cellKey:o,horizontal:S,index:E,inversionStyle:l,item:i,key:o,prevCellKey:n,onUpdateSeparators:h._onUpdateSeparators,onCellFocusCapture:e=>h._onCellFocusCapture(o),onUnmount:h._onCellUnmount,ref:e=>{h._cellRefs[o]=e},renderItem:I},d&&{onCellLayout:h._onCellLayout}))),n=o},E=i;E<=o;E++)x()}static _constrainToItemCount(e,t){var s=t.getItemCount(t.data),r=Math.min(s-1,e.last),i=x(t.maxToRenderPerBatch);return{first:(0,d.default)(0,s-1-i,e.first),last:r}}_isNestedWithSameOrientation(){var e=this.context;return!(!e||!!e.horizontal!==w(this.props.horizontal))}_keyExtractor(e,t,s){if(null!=s.keyExtractor)return s.keyExtractor(e,t);var r=(0,L.keyExtractor)(e,t);return r===String(t)&&(I=!0,e.type&&e.type.displayName&&(R=e.type.displayName)),r}render(){this._checkProps(this.props);var e=this.props,s=e.ListEmptyComponent,i=e.ListFooterComponent,o=e.ListHeaderComponent,n=this.props,h=n.data,c=n.horizontal,u=this.props.inverted?w(this.props.horizontal)?z.horizontallyInverted:z.verticallyInverted:null,p=[],f=new Set(this.props.stickyHeaderIndices),_=[];if(o){f.has(0)&&_.push(0);var v=M.isValidElement(o)?o:M.createElement(o,null);p.push(M.createElement(C.VirtualizedListCellContextProvider,{cellKey:this._getCellKey()+'-header',key:"$header"},M.createElement(l.default,{onLayout:this._onLayoutHeader,style:[u,this.props.ListHeaderComponentStyle]},v)))}var y=this.props.getItemCount(h);if(0===y&&s){var L=M.isValidElement(s)?s:M.createElement(s,null);p.push(M.createElement(C.VirtualizedListCellContextProvider,{cellKey:this._getCellKey()+'-empty',key:"$empty"},M.cloneElement(L,{onLayout:e=>{this._onLayoutEmpty(e),L.props.onLayout&&L.props.onLayout(e)},style:[u,L.props.style]})))}if(y>0){I=!1,R='';for(var b,S=this._getSpacerKey(!c),x=this.state.renderMask.enumerateRegions(),E=k(x,e=>e.isSpacer),T=(0,t.default)(x);!(b=T()).done;){var F=b.value;if(F.isSpacer){if(this.props.disableVirtualization)continue;var V=F===E&&!this.props.getItemLayout?(0,d.default)(F.first-1,F.last,this._highestMeasuredFrameIndex):F.last,O=this.__getFrameMetricsApprox(F.first,this.props),A=this.__getFrameMetricsApprox(V,this.props),P=A.offset+A.length-O.offset;p.push(M.createElement(l.default,{key:"$spacer-"+F.first,style:{[S]:P}}))}else this._pushCells(p,_,f,F.first,F.last,u)}!this._hasWarned.keys&&I&&(console.warn("VirtualizedList: missing keys for items, make sure to specify a key or id property on each item or provide a custom keyExtractor.",R),this._hasWarned.keys=!0)}if(i){var N=M.isValidElement(i)?i:M.createElement(i,null);p.push(M.createElement(C.VirtualizedListCellContextProvider,{cellKey:this._getFooterCellKey(),key:"$footer"},M.createElement(l.default,{onLayout:this._onLayoutFooter,style:[u,this.props.ListFooterComponentStyle]},N)))}var W,H=(0,r.default)((0,r.default)({},this.props),{},{onContentSizeChange:this._onContentSizeChange,onLayout:this._onLayout,onScroll:this._onScroll,onScrollBeginDrag:this._onScrollBeginDrag,onScrollEndDrag:this._onScrollEndDrag,onMomentumScrollBegin:this._onMomentumScrollBegin,onMomentumScrollEnd:this._onMomentumScrollEnd,scrollEventThrottle:(W=this.props.scrollEventThrottle,null!=W?W:50),invertStickyHeaders:void 0!==this.props.invertStickyHeaders?this.props.invertStickyHeaders:this.props.inverted,stickyHeaderIndices:_,style:u?[u,this.props.style]:this.props.style});this._hasMore=this.state.cellsAroundViewport.last<y-1;var B=M.createElement(C.VirtualizedListContextProvider,{value:{cellKey:null,getScrollMetrics:this._getScrollMetrics,horizontal:w(this.props.horizontal),getOutermostParentListRef:this._getOutermostParentListRef,registerAsNestedChild:this._registerAsNestedChild,unregisterAsNestedChild:this._unregisterAsNestedChild}}
329,M.cloneElement((this.props.renderScrollComponent||this._defaultRenderScrollComponent)(H),{ref:this._captureScrollRef},p));return this.props.debug?M.createElement(l.default,{style:z.debug},B,this._renderDebugOverlay()):B}componentDidUpdate(e){var t=this.props,s=t.data,r=t.extraData;s===e.data&&r===e.extraData||this._viewabilityTuples.forEach(e=>{e.viewabilityHelper.resetViewableIndices()});var i=this._hiPriInProgress;this._scheduleCellsToRenderUpdate(),i&&(this._hiPriInProgress=!1)}_computeBlankness(){this._fillRateHelper.computeBlankness(this.props,this.state.cellsAroundViewport,this._scrollMetrics)}_onCellFocusCapture(e){this._lastFocusedCellKey=e,this._updateCellsToRender()}_triggerRemeasureForChildListsInCell(e){this._nestedChildLists.forEachInCell(e,e=>{e.measureLayoutRelativeToContainingList()})}measureLayoutRelativeToContainingList(){try{if(!this._scrollRef)return;this._scrollRef.measureLayout(this.context.getOutermostParentListRef().getScrollRef(),(e,t,s,r)=>{this._offsetFromParentVirtualizedList=this._selectOffset({x:e,y:t}),this._scrollMetrics.contentLength=this._selectLength({width:s,height:r});var i=this._convertParentScrollMetrics(this.context.getScrollMetrics());(this._scrollMetrics.visibleLength!==i.visibleLength||this._scrollMetrics.offset!==i.offset)&&(this._scrollMetrics.visibleLength=i.visibleLength,this._scrollMetrics.offset=i.offset,this._nestedChildLists.forEach(e=>{e.measureLayoutRelativeToContainingList()}))},e=>{console.warn("VirtualizedList: Encountered an error while measuring a list's offset from its containing VirtualizedList.")})}catch(e){console.warn('measureLayoutRelativeToContainingList threw an error',e.stack)}}_getFooterCellKey(){return this._getCellKey()+'-footer'}_renderDebugOverlay(){for(var e=this._scrollMetrics.visibleLength/(this._scrollMetrics.contentLength||1),t=[],s=this.props.getItemCount(this.props.data),r=0;r<s;r++){var i=this.__getFrameMetricsApprox(r,this.props);i.inLayout&&t.push(i)}var o=this.__getFrameMetricsApprox(this.state.cellsAroundViewport.first,this.props).offset,n=this.__getFrameMetricsApprox(this.state.cellsAroundViewport.last,this.props),h=n.offset+n.length-o,d=this._scrollMetrics.offset,c=this._scrollMetrics.visibleLength;return M.createElement(l.default,{style:[z.debugOverlayBase,z.debugOverlay]},t.map((t,s)=>M.createElement(l.default,{key:'f'+s,style:[z.debugOverlayBase,z.debugOverlayFrame,{top:t.offset*e,height:t.length*e}]})),M.createElement(l.default,{style:[z.debugOverlayBase,z.debugOverlayFrameLast,{top:o*e,height:h*e}]}),M.createElement(l.default,{style:[z.debugOverlayBase,z.debugOverlayFrameVis,{top:d*e,height:c*e}]}))}_selectLength(e){return w(this.props.horizontal)?e.width:e.height}_selectOffset(e){return w(this.props.horizontal)?e.x:e.y}_maybeCallOnEdgeReached(){var e=this.props,t=e.data,s=e.getItemCount,r=e.onStartReached,i=e.onStartReachedThreshold,o=e.onEndReached,l=e.onEndReachedThreshold,n=e.initialScrollIndex,h=this._scrollMetrics,d=h.contentLength,c=h.visibleLength,u=h.offset,p=u,f=d-c-u;p<.001&&(p=0),f<.001&&(f=0);var _=p<=(null!=i?i*c:2),v=f<=(null!=l?l*c:2);o&&this.state.cellsAroundViewport.last===s(t)-1&&v&&this._scrollMetrics.contentLength!==this._sentEndForContentLength?(this._sentEndForContentLength=this._scrollMetrics.contentLength,o({distanceFromEnd:f})):null!=r&&0===this.state.cellsAroundViewport.first&&_&&this._scrollMetrics.contentLength!==this._sentStartForContentLength?n&&0===this._scrollMetrics.timestamp||(this._sentStartForContentLength=this._scrollMetrics.contentLength,r({distanceFromStart:p})):(this._sentStartForContentLength=_?this._sentStartForContentLength:0,this._sentEndForContentLength=v?this._sentEndForContentLength:0)}_scheduleCellsToRenderUpdate(){var e=this.state.cellsAroundViewport,t=e.first,s=e.last,r=this._scrollMetrics,i=r.offset,o=r.visibleLength,l=r.velocity,n=this.props.getItemCount(this.props.data),h=!1,d=E(this.props.onStartReachedThreshold),c=T(this.props.onEndReachedThreshold);if(t>0){var u=i-this.__getFrameMetricsApprox(t,this.props).offset;h=u<0||l<-2&&u<F(d,o)}if(!h&&s>=0&&s<n-1){var p=this.__getFrameMetricsApprox(s,this.props).offset-(i+o);h=p<0||l>2&&p<F(c,o)}if(h&&(this._averageCellLength||this.props.getItemLayout)&&!this._hiPriInProgress)return this._hiPriInProgress=!0,this._updateCellsToRenderBatcher.dispose({abort:!0}),void this._updateCellsToRender();this._updateCellsToRenderBatcher.schedule()}
329_updateViewableItems(e,t){this._viewabilityTuples.forEach(s=>{s.viewabilityHelper.onUpdate(e,this._scrollMetrics.offset,this._scrollMetrics.visibleLength,this._getFrameMetrics,this._createViewToken,s.onViewableItemsChanged,t)})}}O.contextType=C.VirtualizedListContext;var z=n.default.create({verticallyInverted:{transform:'scaleY(-1)'},horizontallyInverted:{transform:'scaleX(-1)'},debug:{flex:1},debugOverlayBase:{position:'absolute',top:0,right:0},debugOverlay:{bottom:0,width:20,borderColor:'blue',borderWidth:1},debugOverlayFrame:{left:0,backgroundColor:'orange'},debugOverlayFrameLast:{left:0,borderColor:'green',borderWidth:2},debugOverlayFrameVis:{left:0,borderColor:'red',borderWidth:2}}),A=O},273,[274,232,21,277,278,13,26,284,288,289,290,291,292,293,294,295,296,297,108,298,11]); 330__d(function(g,_r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e,t=_r(d[0]),r=(e=t)&&e.__esModule?e:{default:e};function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=(0,r.default)(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},274,[275]); 331__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e,t=_r(d[0]),r=(e=t)&&e.__esModule?e:{default:e};function n(e,t){if(e){if("string"==typeof e)return(0,r.default)(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.default)(e,t):void 0}}},275,[276]); 332__d(function(g,_r,i,_a,m,_e,d){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return e}})},276,[]); 333__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}});var t=e(r(d[0])),o=e(r(d[1])),n=e(r(d[2])),l=["colors","enabled","onRefresh","progressBackgroundColor","progressViewOffset","refreshing","size","tintColor","title","titleColor"];var s=function(e){e.colors,e.enabled,e.onRefresh,e.progressBackgroundColor,e.progressViewOffset,e.refreshing,e.size,e.tintColor,e.title,e.titleColor;var s=(0,t.default)(e,l);return n.default.createElement(o.default,s)}},277,[14,13,11]); 334__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return C}});var o=e(r(d[0])),l=e(r(d[1])),n=e(r(d[2])),t=e(r(d[3])),s=e(r(d[4])),i=e(r(d[5])),c=e(r(d[6]));r(d[7]);var h=e(r(d[8])),p=e(r(d[9])),u=e(r(d[10])),S=e(r(d[11])),R=e(r(d[12])),f=e(r(d[13])),y=e(r(d[14])),T=["contentContainerStyle","horizontal","onContentSizeChange","refreshControl","stickyHeaderIndices","pagingEnabled","forwardedRef","keyboardDismissMode","onScroll","centerContent"],b={};class v extends f.default.Component{constructor(){super(...arguments),this._scrollNodeRef=null,this._innerViewRef=null,this.isTouching=!1,this.lastMomentumScrollBeginTime=0,this.lastMomentumScrollEndTime=0,this.observedScrollSinceBecomingResponder=!1,this.becameResponderWhileAnimating=!1,this.scrollResponderHandleScrollShouldSetResponder=()=>this.isTouching,this.scrollResponderHandleStartShouldSetResponderCapture=e=>this.scrollResponderIsAnimating(),this.scrollResponderHandleTerminationRequest=()=>!this.observedScrollSinceBecomingResponder,this.scrollResponderHandleTouchEnd=e=>{var o=e.nativeEvent;this.isTouching=0!==o.touches.length,this.props.onTouchEnd&&this.props.onTouchEnd(e)},this.scrollResponderHandleResponderRelease=e=>{this.props.onResponderRelease&&this.props.onResponderRelease(e);var o=u.default.currentlyFocusedField();this.props.keyboardShouldPersistTaps||null==o||e.target===o||this.observedScrollSinceBecomingResponder||this.becameResponderWhileAnimating||(this.props.onScrollResponderKeyboardDismissed&&this.props.onScrollResponderKeyboardDismissed(e),u.default.blurTextInput(o))},this.scrollResponderHandleScroll=e=>{this.observedScrollSinceBecomingResponder=!0,this.props.onScroll&&this.props.onScroll(e)},this.scrollResponderHandleResponderGrant=e=>{this.observedScrollSinceBecomingResponder=!1,this.props.onResponderGrant&&this.props.onResponderGrant(e),this.becameResponderWhileAnimating=this.scrollResponderIsAnimating()},this.scrollResponderHandleScrollBeginDrag=e=>{this.props.onScrollBeginDrag&&this.props.onScrollBeginDrag(e)},this.scrollResponderHandleScrollEndDrag=e=>{this.props.onScrollEndDrag&&this.props.onScrollEndDrag(e)},this.scrollResponderHandleMomentumScrollBegin=e=>{this.lastMomentumScrollBeginTime=Date.now(),this.props.onMomentumScrollBegin&&this.props.onMomentumScrollBegin(e)},this.scrollResponderHandleMomentumScrollEnd=e=>{this.lastMomentumScrollEndTime=Date.now(),this.props.onMomentumScrollEnd&&this.props.onMomentumScrollEnd(e)},this.scrollResponderHandleTouchStart=e=>{this.isTouching=!0,this.props.onTouchStart&&this.props.onTouchStart(e)},this.scrollResponderHandleTouchMove=e=>{this.props.onTouchMove&&this.props.onTouchMove(e)},this.scrollResponderIsAnimating=()=>Date.now()-this.lastMomentumScrollEndTime<16||this.lastMomentumScrollEndTime<this.lastMomentumScrollBeginTime,this.scrollResponderScrollTo=(e,o,l)=>{if('number'==typeof e)console.warn('`scrollResponderScrollTo(x, y, animated)` is deprecated. Use `scrollResponderScrollTo({x: 5, y: 5, animated: true})` instead.');else{var n=e||b;e=n.x,o=n.y,l=n.animated}var t=this.getScrollableNode(),s=e||0,i=o||0;null!=t&&('function'==typeof t.scroll?t.scroll({top:i,left:s,behavior:l?'smooth':'auto'}):(t.scrollLeft=s,t.scrollTop=i))},this.scrollResponderZoomTo=(e,o)=>{(0,i.default)('zoomToRect is not implemented')},this.scrollResponderScrollNativeHandleToKeyboard=(e,o,l)=>{this.additionalScrollOffset=o||0,this.preventNegativeScrollOffset=!!l,S.default.measureLayout(e,this.getInnerViewNode(),this.scrollResponderTextInputFocusError,this.scrollResponderInputMeasureAndScrollToKeyboard)},this.scrollResponderInputMeasureAndScrollToKeyboard=(e,o,l,n)=>{var s=t.default.get('window').height;this.keyboardWillOpenTo&&(s=this.keyboardWillOpenTo.endCoordinates.screenY);var i=o-s+n+this.additionalScrollOffset;this.preventNegativeScrollOffset&&(i=Math.max(0,i)),this.scrollResponderScrollTo({x:0,y:i,animated:!0}),this.additionalOffset=0,this.preventNegativeScrollOffset=!1},this.scrollResponderKeyboardWillShow=e=>{this.keyboardWillOpenTo=e,this.props.onKeyboardWillShow&&this.props.onKeyboardWillShow(e)},this.scrollResponderKeyboardWillHide=e=>{this.keyboardWillOpenTo=null,this.props.onKeyboardWillHide&&this.props.onKeyboardWillHide(e)},this.scrollResponderKeyboardDidShow=e=>{e&&(this.keyboardWillOpenTo=e),this.props.onKeyboardDidShow&&this.props.onKeyboardDidShow(e)},this.scrollResponderKeyboardDidHide=e=>{this.keyboardWillOpenTo=null,this.props.onKeyboardDidHide&&this.props.onKeyboardDidHide(e)},this.flashScrollIndicators=()=>{this.scrollResponderFlashScrollIndicators()}
334,this.getScrollResponder=()=>this,this.getScrollableNode=()=>this._scrollNodeRef,this.getInnerViewRef=()=>this._innerViewRef,this.getInnerViewNode=()=>this._innerViewRef,this.getNativeScrollRef=()=>this._scrollNodeRef,this.scrollTo=(e,o,l)=>{if('number'==typeof e)console.warn('`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.');else{var n=e||b;o=n.x,e=n.y,l=n.animated}this.scrollResponderScrollTo({x:o||0,y:e||0,animated:!1!==l})},this.scrollToEnd=e=>{var o=!1!==(e&&e.animated),l=this.props.horizontal,n=this.getScrollableNode(),t=l?n.scrollWidth:0,s=l?0:n.scrollHeight;this.scrollResponderScrollTo({x:t,y:s,animated:o})},this._handleContentOnLayout=e=>{var o=e.nativeEvent.layout,l=o.width,n=o.height;this.props.onContentSizeChange(l,n)},this._handleScroll=e=>{'on-drag'===this.props.keyboardDismissMode&&(0,s.default)(),this.scrollResponderHandleScroll(e)},this._setInnerViewRef=e=>{this._innerViewRef=e},this._setScrollNodeRef=e=>{this._scrollNodeRef=e,null!=e&&(e.getScrollResponder=this.getScrollResponder,e.getInnerViewNode=this.getInnerViewNode,e.getInnerViewRef=this.getInnerViewRef,e.getNativeScrollRef=this.getNativeScrollRef,e.getScrollableNode=this.getScrollableNode,e.scrollTo=this.scrollTo,e.scrollToEnd=this.scrollToEnd,e.flashScrollIndicators=this.flashScrollIndicators,e.scrollResponderZoomTo=this.scrollResponderZoomTo,e.scrollResponderScrollNativeHandleToKeyboard=this.scrollResponderScrollNativeHandleToKeyboard),(0,c.default)(this.props.forwardedRef)(e)}}scrollResponderHandleStartShouldSetResponder(){return!1}scrollResponderHandleResponderReject(){(0,y.default)(!1,"ScrollView doesn't take rejection well - scrolls anyway")}scrollResponderFlashScrollIndicators(){}scrollResponderTextInputFocusError(e){console.error('Error measuring text field: ',e)}render(){var e=this.props,t=e.contentContainerStyle,s=e.horizontal,c=e.onContentSizeChange,p=e.refreshControl,u=e.stickyHeaderIndices,S=e.pagingEnabled,y=(e.forwardedRef,e.keyboardDismissMode,e.onScroll,e.centerContent),b=(0,n.default)(e,T),v={};c&&(v={onLayout:this._handleContentOnLayout});var H=!s&&Array.isArray(u),E=H||S?f.default.Children.map(this.props.children,(e,o)=>{var l=H&&u.indexOf(o)>-1;return null!=e&&(l||S)?f.default.createElement(R.default,{style:[l&&w.stickyHeader,S&&w.pagingEnabledChild]},e):e}):this.props.children,C=f.default.createElement(R.default,(0,l.default)({},v,{children:E,collapsable:!1,ref:this._setInnerViewRef,style:[s&&w.contentContainerHorizontal,y&&w.c
334ontentContainerCenterContent,t]})),M=s?w.baseHorizontal:w.baseVertical,D=s?w.pagingEnabledHorizontal:w.pagingEnabledVertical,I=(0,o.default)((0,o.default)({},b),{},{style:[M,S&&D,this.props.style],onTouchStart:this.scrollResponderHandleTouchStart,onTouchMove:this.scrollResponderHandleTouchMove,onTouchEnd:this.scrollResponderHandleTouchEnd,onScrollBeginDrag:this.scrollResponderHandleScrollBeginDrag,onScrollEndDrag:this.scrollResponderHandleScrollEndDrag,onMomentumScrollBegin:this.scrollResponderHandleMomentumScrollBegin,onMomentumScrollEnd:this.scrollResponderHandleMomentumScrollEnd,onStartShouldSetResponder:this.scrollResponderHandleStartShouldSetResponder,onStartShouldSetResponderCapture:this.scrollResponderHandleStartShouldSetResponderCapture,onScrollShouldSetResponder:this.scrollResponderHandleScrollShouldSetResponder,onScroll:this._handleScroll,onResponderGrant:this.scrollResponderHandleResponderGrant,onResponderTerminationRequest:this.scrollResponderHandleTerminationRequest,onResponderTerminate:this.scrollResponderHandleTerminate,onResponderRelease:this.scrollResponderHandleResponderRelease,onResponderReject:this.scrollResponderHandleResponderReject}),N=h.default;(0,i.default)(void 0!==N,'ScrollViewClass must not be undefined');var x=f.default.createElement(N,(0,l.default)({},I,{ref:this._setScrollNodeRef}),C);return p?f.default.cloneElement(p,{style:I.style},x):x}}var H={flexGrow:1,flexShrink:1,transform:'translateZ(0)',WebkitOverflowScrolling:'touch'},w=p.default.create({baseVertical:(0,o.default)((0,o.default)({},H),{},{flexDirection:'column',overflowX:'hidden',overflowY:'auto'}),baseHorizontal:(0,o.default)((0,o.default)({},H),{},{flexDirection:'row',overflowX:'auto',overflowY:'hidden'}),contentContainerHorizontal:{flexDirection:'row'},contentContainerCenterContent:{justifyContent:'center',flexGrow:1},stickyHeader:{position:'sticky',top:0,zIndex:10},pagingEnabledHorizontal:{scrollSnapType:'x mandatory'},pagingEnabledVertical:{scrollSnapType:'y mandatory'},pagingEnabledChild:{scrollSnapAlign:'start'}}),E=f.default.forwardRef((e,o)=>f.default.createElement(v,(0,l.default)({},e,{forwardedRef:o})));E.displayName='ScrollView';var C=E},278,[21,232,14,107,279,108,94,136,281,26,280,88,13,11,282]); 335__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e},l=()=>{u.default.blurTextInput(u.default.currentlyFocusedField())}},279,[280]); 336__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var e,u=r(d[0]),t=(e=u)&&e.__esModule?e:{default:e},l={_currentlyFocusedNode:null,currentlyFocusedField(){return document.activeElement!==this._currentlyFocusedNode&&(this._currentlyFocusedNode=null),this._currentlyFocusedNode},focusTextInput(e){null!==e&&(this._currentlyFocusedNode=e,document.activeElement!==e&&t.default.focus(e))},blurTextInput(e){null!==e&&(this._currentlyFocusedNode=null,document.activeElement===e&&t.default.blur(e))}}},280,[88]); 337__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return v}});var t=e(r(_d[0])),o=e(r(_d[1])),n=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}),t.default=e,t})(r(_d[2])),l=e(r(_d[3])),c=e(r(_d[4])),u=e(r(_d[5])),s=["onScroll","onTouchMove","onWheel","scrollEnabled","scrollEventThrottle","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","style"];function f(e){return{nativeEvent:{contentOffset:{get x(){return e.target.scrollLeft},get y(){return e.target.scrollTop}},contentSize:{get height(){return e.target.scrollHeight},get width(){return e.target.scrollWidth}},layoutMeasurement:{get height(){return e.target.offsetHeight},get width(){return e.target.offsetWidth}}},timeStamp:Date.now()}}var d=n.forwardRef((e,l)=>{var d=e.onScroll,v=e.onTouchMove,S=e.onWheel,b=e.scrollEnabled,w=void 0===b||b,T=e.scrollEventThrottle,p=void 0===T?0:T,y=e.showsHorizontalScrollIndicator,_=e.showsVerticalScrollIndicator,E=e.style,M=(0,o.default)(e,s),O=n.useRef({isScrolling:!1,scrollLastTick:0}),D=n.useRef(null),W=n.useRef(null);function j(e){return t=>{w&&e&&e(t)}}function P(e){O.current.isScrolling=!0,k(e)}function k(e){O.current.scrollLastTick=Date.now(),d&&d(f(e))}function H(e){O.current.isScrolling=!1,d&&d(f(e))}var I=!1===y||!1===_;return n.createElement(c.default,(0,t.default)({},M,{onScroll:function(e){var t,o,n;e.stopPropagation(),e.target===W.current&&(e.persist(),null!=D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{H(e)},100),O.current.isScrolling?(t=O.current.scrollLastTick,o=p,n=Date.now()-t,o>0&&n>=o&&k(e)):P(e))},onTouchMove:j(v),onWheel:j(S),ref:(0,u.default)(W,l),style:[E,!w&&h.scrollDisabled,I&&h.hideScrollbar]}))}),h=l.default.create({scrollDisabled:{overflowX:'hidden',overflowY:'hidden',touchAction:'none'},hideScrollbar:{scrollbarWidth:'none'}}),v=d},281,[232,14,11,26,13,93]); 338__d(function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);m.exports=t},282,[283]); 339__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return function(){return t}}var n=function(){};n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(t){return t},m.exports=n},283,[]); 340__d(function(g,r,i,a,m,_e,d){'use strict';
340Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}});var e,t=r(d[0]),l=(e=t)&&e.__esModule?e:{default:e};var s=class{constructor(e,t){this._delay=t,this._callback=e}dispose(e){void 0===e&&(e={abort:!1}),this._taskHandle&&(this._taskHandle.cancel(),e.abort||this._callback(),this._taskHandle=null)}schedule(){if(!this._taskHandle){var e=setTimeout(()=>{this._taskHandle=l.default.runAfterInteractions(()=>{this._taskHandle=null,this._callback()})},this._delay);this._taskHandle={cancel:()=>clearTimeout(e)}}}}},284,[285]); 341__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return _}});var t=e(r(d[0])),n=e(r(d[1])),o=e(r(d[2])),s=e(r(d[3])),c=new o.default,u={Events:{interactionStart:'interactionStart',interactionComplete:'interactionComplete'},runAfterInteractions(e){var t=[],n=new Promise(n=>{S(),e&&t.push(e),t.push({run:n,name:'resolve '+(e&&e.name||'?')}),h.enqueueTasks(t)});return{then:n.then.bind(n),done:n.then.bind(n),cancel:()=>{h.cancelTasks(t)}}},createInteractionHandle(){S();var e=++w;return f.add(e),e},clearInteractionHandle(e){(0,t.default)(!!e,'Must provide a handle to clear.'),S(),f.delete(e),v.add(e)},addListener:c.addListener.bind(c),setDeadline(e){b=e}},l=new Set,f=new Set,v=new Set,h=new n.default({onMoreTasks:S}),p=0,w=0,b=-1;function S(){p||(p=b>0?setTimeout(T):(0,s.default)(T))}function T(){p=0;var e=l.size;f.forEach(e=>l.add(e)),v.forEach(e=>l.delete(e));var t=l.size;if(0!==e&&0===t?c.emit(u.Events.interactionComplete):0===e&&0!==t&&c.emit(u.Events.interactionStart),0===t)for(var n=Date.now();h.hasTasksToProcess();)if(h.processNext(),b>0&&Date.now()-n>=b){S();break}f.clear(),v.clear()}var _=u},285,[108,286,155,287]); 342__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var t=e(r(d[0])),s=e(r(d[1]));var u=class{constructor(e){var t=e.onMoreTasks;this._onMoreTasks=t,this._queueStack=[{tasks:[],popable:!0}]}enqueue(e){this._getCurrentQueue().push(e)}enqueueTasks(e){e.forEach(e=>this.enqueue(e))}cancelTasks(e){this._queueStack=this._queueStack.map(s=>(0,t.default)((0,t.default)({},s),{},{tasks:s.tasks.filter(t=>-1===e.indexOf(t))})).filter((e,t)=>e.tasks.length>0||0===t)}hasTasksToProcess(){return this._getCurrentQueue().length>0}processNext(){var e=this._getCurrentQueue();if(e.length){var t=e.shift();try{'object'==typeof t&&t.gen?this._genPromise(t):'object'==typeof t&&t.run?t.run():((0,s.default)('function'==typeof t,'Expected Function, SimpleTask, or PromiseTask, but got:\n'+JSON.stringify(t,null,2)),t())}catch(e){throw e.message='TaskQueue: Error with task '+(t.name||'')+': '+e.message,e}}}_getCurrentQueue(){var e=this._queueStack.length-1,t=this._queueStack[e];return t.popable&&0===t.tasks.length&&e>0?(this._queueStack.pop(),this._getCurrentQueue()):t.tasks}_genPromise(e){var t=this._queueStack.push({tasks:[],popable:!1})-1,s=this._queueStack[t];e.gen().then(()=>{s.popable=!0,this.hasTasksToProcess()&&this._onMoreTasks()}).catch(t=>{setTimeout(()=>{throw t.message="TaskQueue: Error resolving Promise in task "+e.name+": "+t.message,t},0)})}}},286,[21,108]); 343__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"cancelIdleCallback",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),n=((e=t)&&e.__esModule?e:{default:e}).default&&void 0!==window.requestIdleCallback,l=n?window.requestIdleCallback:function(e,t){return setTimeout(()=>{var t=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},u=n?window.cancelIdleCallback:function(e){clearTimeout(e)},o=l},287,[35]); 344__d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=function(t,n,u){return n<t?t:n>u?u:n}},288,[]); 345__d(function(g,r,i,a,m,e,d){'use strict';
345Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=function(){return console.log(...arguments)}},289,[]); 346__d(function(g,r,_i,a,m,_e,d){"use strict";function s(s){return s&&s.__esModule?s:{default:s}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CellRenderMask",{enumerable:!0,get:function(){return i}});var e=s(r(d[0])),t=s(r(d[1]));class i{constructor(s){(0,t.default)(s>=0,'CellRenderMask must contain a non-negative number os cells'),this._numCells=s,this._regions=0===s?[]:[{first:0,last:s-1,isSpacer:!0}]}enumerateRegions(){return this._regions}addCells(s){if((0,t.default)(s.first>=0&&s.first<this._numCells&&s.last>=-1&&s.last<this._numCells&&s.last>=s.first-1,'CellRenderMask.addCells called with invalid cell range'),!(s.last<s.first)){var i=this._findRegion(s.first),l=i[0],n=i[1],f=this._findRegion(s.last),u=f[0],o=f[1];if(n!==o||l.isSpacer){var _=[],c=[],h=(0,e.default)((0,e.default)({},s),{},{isSpacer:!1});l.first<h.first&&(l.isSpacer?_.push({first:l.first,last:h.first-1,isSpacer:!0}):h.first=l.first),u.last>h.last&&(u.isSpacer?c.push({first:h.last+1,last:u.last,isSpacer:!0}):h.last=u.last);var p=[..._,h,...c],C=o-n+1;this._regions.splice(n,C,...p)}}}numCells(){return this._numCells}equals(s){return this._numCells===s._numCells&&this._regions.length===s._regions.length&&this._regions.every((e,t)=>e.first===s._regions[t].first&&e.last===s._regions[t].last&&e.isSpacer===s._regions[t].isSpacer)}_findRegion(s){for(var e=0,i=this._regions.length-1;e<=i;){var l=Math.floor((e+i)/2),n=this._regions[l];if(s>=n.first&&s<=n.last)return[n,l];s<n.first?i=l-1:s>n.last&&(e=l+1)}(0,t.default)(!1,"A region was not found containing cellIdx "+s)}}},290,[21,108]); 347__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var l=e(r(d[0])),t=e(r(d[1]));class n{constructor(){this._cellKeyToChildren=new Map,this._childrenToCellKey=new Map}add(e,l){var n;(0,t.default)(!this._childrenToCellKey.has(e),'Trying to add already present child list');var o=null!==(n=this._cellKeyToChildren.get(l))&&void 0!==n?n:new Set;o.add(e),this._cellKeyToChildren.set(l,o),this._childrenToCellKey.set(e,l)}remove(e){var l=this._childrenToCellKey.get(e);(0,t.default)(null!=l,'Trying to remove non-present child list'),this._childrenToCellKey.delete(e);var n=this._cellKeyToChildren.get(l);(0,t.default)(n,'_cellKeyToChildren should contain cellKey'),n.delete(e),0===n.size&&this._cellKeyToChildren.delete(l)}forEach(e){for(var t,n=(0,l.default)(this._cellKeyToChildren.values());!(t=n()).done;)for(var o,h=t.value,s=(0,l.default)(h);!(o=s()).done;){e(o.value)}}forEachInCell(e,t){for(var n,o,h=null!==(n=this._cellKeyToChildren.get(e))&&void 0!==n?n:[],s=(0,l.default)(h);!(o=s()).done;){t(o.value)}}anyInCell(e,t){for(var n,o,h=null!==(n=this._cellKeyToChildren.get(e))&&void 0!==n?n:[],s=(0,l.default)(h);!(o=s()).done;){if(t(o.value))return!0}return!1}size(){return this._childrenToCellKey.size}}},291,[274,108]); 348__d(function(g,r,i,a,m,_e,d){'use strict';Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var t,e=r(d[0]),s=(t=e)&&t.__esModule?t:{default:t};class n{constructor(){this.any_blank_count=0,this.any_blank_ms=0,this.any_blank_speed_sum=0,this.mostly_blank_count=0,this.mostly_blank_ms=0,this.pixels_blank=0,this.pixels_sampled=0,this.pixels_scrolled=0,this.total_time_spent=0,this.sample_count=0}}var l=[],_=10,h=null;var o=class{static addListener(t){return null===h&&console.warn('Call `FillRateHelper.setSampleRate` before `addListener`.'),l.push(t),{remove:()=>{l=l.filter(e=>t!==e)}}}static setSampleRate(t){h=t}static setMinSampleCount(t){_=t}constructor(t){this._anyBlankStartTime=null,this._enabled=!1,this._info=new n,this._mostlyBlankStartTime=null,this._samplesStartTime=null,this._getFrameMetrics=t,this._enabled=(h||0)>Math.random(),this._resetData()}activate(){this._enabled&&null==this._samplesStartTime&&(this._samplesStartTime=g.performance.now())}deactivateAndFlush(){if(this._enabled){var t=this._samplesStartTime;if(null!=t)if(this._info.sample_count<_)this._resetData();else{var e=g.performance.now()-t,n=(0,s.default)((0,s.default)({},this._info),{},{total_time_spent:e});l.forEach(t=>t(n)),this._resetData()}}}computeBlankness(t,e,s){if(!this._enabled||0===t.getItemCount(t.data)||e.last<e.first||null==this._samplesStartTime)return 0;var n=s.dOffset,l=s.offset,_=s.velocity,h=s.visibleLength;this._info.sample_count++,this._info.pixels_sampled+=Math.round(h),this._info.pixels_scrolled+=Math.round(Math.abs(n));var o=Math.round(1e3*Math.abs(_)),u=g.performance.now();null!=this._anyBlankStartTime&&(this._info.any_blank_ms+=u-this._anyBlankStartTime),this._anyBlankStartTime=null,null!=this._mostlyBlankStartTime&&(this._info.mostly_blank_ms+=u-this._mostlyBlankStartTime),this._mostlyBlankStartTime=null;for(var f=0,c=e.first,p=this._getFrameMetrics(c,t);c<=e.last&&(!p||!p.inLayout);)p=this._getFrameMetrics(c,t),c++;p&&c>0&&(f=Math.min(h,Math.max(0,p.offset-l)));for(var b=0,y=e.last,k=this._getFrameMetrics(y,t);y>=e.first&&(!k||!k.inLayout);)k=this._getFrameMetrics(y,t),y--;if(k&&y<t.getItemCount(t.data)-1){var S=k.offset+k.length;b=Math.min(h,Math.max(0,l+h-S))}
348var M=Math.round(f+b),v=M/h;return v>0?(this._anyBlankStartTime=u,this._info.any_blank_speed_sum+=o,this._info.any_blank_count++,this._info.pixels_blank+=M,v>.5&&(this._mostlyBlankStartTime=u,this._info.mostly_blank_count++)):(o<.01||Math.abs(n)<1)&&this.deactivateAndFlush(),v}enabled(){return this._enabled}_resetData(){this._anyBlankStartTime=null,this._info=new n,this._mostlyBlankStartTime=null,this._samplesStartTime=null}}},292,[21]); 349__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var t,e=r(_d[0]),s=(t=e)&&t.__esModule?t:{default:t},n=(function(t){if(t&&t.__esModule)return t;var e={};return t&&Object.keys(t).forEach(function(s){var n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,n.get?n:{enumerable:!0,get:function(){return t[s]}})}),e.default=t,e})(r(_d[1]));class o extends n.PureComponent{constructor(t){super(t),this._inAsyncStateUpdate=!1,this._installSetStateHooks()}setState(t,e){'function'==typeof t?super.setState((e,s)=>{var n;this._inAsyncStateUpdate=!0;try{n=t(e,s)}catch(t){throw t}finally{this._inAsyncStateUpdate=!1}return n},e):super.setState(t,e)}_installSetStateHooks(){var t=this,e=this.props,n=this.state;Object.defineProperty(this,'props',{get:()=>((0,s.default)(!t._inAsyncStateUpdate,'"this.props" should not be accessed during state updates'),e),set(t){e=t}}),Object.defineProperty(this,'state',{get:()=>((0,s.default)(!t._inAsyncStateUpdate,'"this.state" should not be acceessed during state updates'),n),set(t){n=t}})}}},293,[108,11]); 350__d(function(g,r,i,a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var t=e(r(d[0])),n=e(r(d[1])),s=e(r(d[2]));function l(e,t,n,s,l,u){if(h(n,s,l))return!0;var c=o(n,s,l);return 100*(e?c/l:c/u)>=t}function o(e,t,n){var s=Math.min(t,n)-Math.max(e,0);return Math.max(0,s)}function h(e,t,n){return e>=0&&t<=n&&t>e}var u=class{constructor(e){void 0===e&&(e={viewAreaCoveragePercentThreshold:0}),this._hasInteracted=!1,this._timers=new Set,this._viewableIndices=[],this._viewableItems=new Map,this._config=e}dispose(){this._timers.forEach(clearTimeout)}computeViewableItems(e,t,n,o,h){var u=e.getItemCount(e.data),c=this._config,f=c.itemVisiblePercentThreshold,v=c.viewAreaCoveragePercentThreshold,_=null!=v,w=_?v:f;(0,s.default)(null!=w&&null!=f!=(null!=v),'Must set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold');var b=[];if(0===u)return b;var I=-1,p=h||{first:0,last:u-1},y=p.first,T=p.last;if(T>=u)return console.warn('Invalid render range computing viewability '+JSON.stringify({renderRange:h,itemCount:u})),[];for(var M=y;M<=T;M++){var V=o(M,e);if(V){var C=V.offset-t,P=C+V.length;if(C<n&&P>0)I=M,l(_,w,C,P,n,V.length)&&b.push(M);else if(I>=0)break}}return b}onUpdate(e,t,n,s,l,o,h){var u=e.getItemCount(e.data);if((!this._config.waitForInteraction||this._hasInteracted)&&0!==u&&s(0,e)){var c=[];if(u&&(c=this.computeViewableItems(e,t,n,s,h)),this._viewableIndices.length!==c.length||!this._viewableIndices.every((e,t)=>e===c[t]))if(this._viewableIndices=c,this._config.minimumViewTime){var f=setTimeout(()=>{this._timers.delete(f),this._onUpdateSync(e,c,o,l)},this._config.minimumViewTime);this._timers.add(f)}else this._onUpdateSync(e,c,o,l)}}resetViewableIndices(){this._viewableIndices=[]}recordInteraction(){this._hasInteracted=!0}_onUpdateSync(e,s,l,o){s=s.filter(e=>this._viewableIndices.includes(e));for(var h,u=this._viewableItems,c=new Map(s.map(t=>{var n=o(t,!0,e);return[n.key,n]})),f=[],v=(0,n.default)(c);!(h=v()).done;){var _=h.value,w=_[0],b=_[1];u.has(w)||f.push(b)}for(var I,p=(0,n.default)(u);!(I=p()).done;){var y=I.value,T=y[0],M=y[1];c.has(T)||f.push((0,t.default)((0,t.default)({},M),{},{isViewable:!1}))}f.length>0&&(this._viewableItems=c,l({viewableItems:Array.from(c.values()),changed:f,viewabilityConfig:this._config}))}}},294,[21,274,108]); 351__d(function(g,r,i,a,m,_e,_d){"use strict";
351function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return d}});var t=e(r(_d[0])),o=e(r(_d[1])),s=e(r(_d[2])),n=e(r(_d[3])),l=r(_d[4]),p=e(r(_d[5])),u=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(o){var s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,s.get?s:{enumerable:!0,get:function(){return e[o]}})}),t.default=e,t})(r(_d[6]));class d extends u.Component{constructor(){super(...arguments),this.state={separatorProps:{highlighted:!1,leadingItem:this.props.item}},this._separators={highlight:()=>{var e=this.props,t=e.cellKey,o=e.prevCellKey;this.props.onUpdateSeparators([t,o],{highlighted:!0})},unhighlight:()=>{var e=this.props,t=e.cellKey,o=e.prevCellKey;this.props.onUpdateSeparators([t,o],{highlighted:!1})},updateProps:(e,t)=>{var o=this.props,s=o.cellKey,n=o.prevCellKey;this.props.onUpdateSeparators(['leading'===e?n:s],t)}},this._onLayout=e=>{this.props.onCellLayout&&this.props.onCellLayout(e,this.props.cellKey,this.props.index)}}static getDerivedStateFromProps(e,t){return{separatorProps:(0,o.default)((0,o.default)({},t.separatorProps),{},{leadingItem:e.item})}}updateSeparatorProps(e){this.setState(t=>({separatorProps:(0,o.default)((0,o.default)({},t.separatorProps),e)}))}componentWillUnmount(){this.props.onUnmount(this.props.cellKey)}_renderElement(e,t,o,s){return e&&t&&console.warn("VirtualizedList: Both ListItemComponent and renderItem props are present. ListItemComponent will take precedence over renderItem."),t?u.createElement(t,{item:o,index:s,separators:this._separators}):e?e({item:o,index:s,separators:this._separators}):void(0,p.default)(!1,'VirtualizedList: Either ListItemComponent or renderItem props are required but none were found.')}render(){var e=this.props,o=e.CellRendererComponent,n=e.ItemSeparatorComponent,p=e.ListItemComponent,d=e.cellKey,h=e.horizontal,y=e.item,f=e.index,v=e.inversionStyle,C=e.onCellFocusCapture,_=e.onCellLayout,L=e.renderItem,P=this._renderElement(L,p,y,f),K=u.isValidElement(n)?n:n&&u.createElement(n,this.state.separatorProps),I=v?h?[c.rowReverse,v]:[c.columnReverse,v]:h?[c.row,v]:v,w=o?u.createElement(o,(0,t.default)({cellKey:d,index:f,item:y,style:I,onFocusCapture:C},_&&{onLayout:this._onLayout}),P,K):u.createElement(s.default,(0,t.default)({style:I,onFocusCapture:C},_&&{onLayout:this._onLayout}),P,K);return u.createElement(l.VirtualizedListCellContextProvider,{cellKey:this.props.cellKey},w)}}var c=n.default.create({row:{flexDirection:'row'},rowReverse:{flexDirection:'row-reverse'},columnReverse:{flexDirection:'column-reverse'}})},295,[232,21,13,26,296,108,11]); 352__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VirtualizedListContext",{enumerable:!0,get:function(){return o}}),_e.VirtualizedListContextResetter=function(e){var t=e.children;return u.createElement(o.Provider,{value:null},t)},_e.VirtualizedListContextProvider=function(e){var t=e.children,l=e.value,s=(0,n.useMemo)(()=>({cellKey:null,getScrollMetrics:l.getScrollMetrics,horizontal:l.horizontal,getOutermostParentListRef:l.getOutermostParentListRef,registerAsNestedChild:l.registerAsNestedChild,unregisterAsNestedChild:l.unregisterAsNestedChild}),[l.getScrollMetrics,l.horizontal,l.getOutermostParentListRef,l.registerAsNestedChild,l.unregisterAsNestedChild]);return u.createElement(o.Provider,{value:s},t)},_e.VirtualizedListCellContextProvider=function(e){var t=e.cellKey,s=e.children,d=(0,n.useContext)(o),c=(0,n.useMemo)(()=>null==d?null:(0,l.default)((0,l.default)({},d),{},{cellKey:t}),[d,t]);return u.createElement(o.Provider,{value:c},s)};var e,t=r(_d[0]),l=(e=t)&&e.__esModule?e:{default:e},n=r(_d[1]),u=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(l){var n=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,n.get?n:{enumerable:!0,get:function(){return e[l]}})}),t.default=e,t})(n),o=u.createContext(null)},296,[21,11]); 353__d(function(g,r,i,a,m,e,d){'use strict';function t(t,n,f,o){void 0===o&&(o=1);for(var s=n.getItemCount(n.data),l=[],u=0;u<t.length;u++)for(var v=t[u],c=0,h=s-1;c<=h;){var M=c+(h-c>>>1),b=f(M,n),x=b.offset*o,y=(b.offset+b.length)*o;if(0===M&&v<x||0!==M&&v<=x)h=M-1;else{if(!(v>y)){l[u]=M;break}c=M+1}}return l}function n(t,n){return n.last-n.first+1-Math.max(0,1+Math.min(n.last,t.last)-Math.max(n.first,t.first))}
353Object.defineProperty(e,'__esModule',{value:!0}),e.elementsThatOverlapOffsets=t,e.newRangeCount=n,e.computeWindowedRenderLimits=function(f,o,s,l,u,v){var c=f.getItemCount(f.data);if(0===c)return{first:0,last:-1};var h=v.offset,M=v.velocity,b=v.visibleLength,x=v.zoomScale,y=void 0===x?1:x,w=Math.max(0,h),k=w+b,p=(s-1)*b,C=M>1?'after':M<-1?'before':'none',O=Math.max(0,w-.5*p),_=Math.max(0,k+.5*p);if(u(c-1,f).offset*y<O)return{first:Math.max(0,c-1-o),last:c-1};var j=t([O,w,k,_],f,u,y),L=j[0],S=j[1],E=j[2],I=j[3];L=null==L?0:L,S=null==S?Math.max(0,L):S,I=null==I?c-1:I,E=null==E?Math.min(I,S+o-1):E;var R={first:S,last:E},z=n(l,R);for(;!(S<=L&&E>=I);){var B=z>=o,F=S<=l.first||S>l.last,J=S>L&&(!B||!F),N=E>=l.last||E<l.first,P=E<I&&(!B||!N);if(B&&!J&&!P)break;!J||'after'===C&&P&&N||(F&&z++,S--),!P||'before'===C&&J&&F||(N&&z++,E++)}if(!(E>=S&&S>=0&&E<c&&S>=L&&E<=I&&S<=R.first&&E>=R.last))throw new Error('Bad window calculation '+JSON.stringify({first:S,last:E,itemCount:c,overscanFirst:L,overscanLast:I,visible:R}));return{first:S,last:E}},e.keyExtractor=function(t,n){if('object'==typeof t&&null!=(null==t?void 0:t.key))return t.key;if('object'==typeof t&&null!=(null==t?void 0:t.id))return t.id;return String(n)}},297,[]); 354__d(function(g,r,i,a,m,e,d){'use strict';function t(t,o){if(null!=t)return t;var n=new Error(void 0!==o?o:'Got unexpected '+t);throw n.framesToPop=1,n}m.exports=t,m.exports.default=t,Object.defineProperty(m.exports,'__esModule',{value:!0})},298,[]); 355__d(function(g,r,_i2,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return l}});var t=Number.isNaN||function(t){return'number'==typeof t&&t!=t};function n(n,u){return n===u||!(!t(n)||!t(u))}function u(t,u){if(t.length!==u.length)return!1;for(var l=0;l<t.length;l++)if(!n(t[l],u[l]))return!1;return!0}function l(t,n){void 0===n&&(n=u);var l=null;function i(){for(var u=[],i=0;i<arguments.length;i++)u[i]=arguments[i];if(l&&l.lastThis===this&&n(u,l.lastArgs))return l.lastResult;var s=t.apply(this,u);return l={lastResult:s,lastArgs:u,lastThis:this},s}return i.clear=function(){l=null},i}},299,[]); 356__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}});var t=e(r(_d[0])),u=e(r(_d[1])),n=e(r(_d[2])),f=e(r(_d[3]));r(_d[4]),r(_d[5]);var l=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(u){var n=Object.getOwnPropertyDescriptor(e,u);Object.defineProperty(t,u,n.get?n:{enumerable:!0,get:function(){return e[u]}})}),t.default=e,t})(r(_d[6])),o=["style"];function c(e){return l.forwardRef((c,d)=>{var s=(0,n.default)(c),y=s[0],p=s[1],_=(0,f.default)(p,d),b=y.passthroughAnimatedPropExplicitValues,v=y.style,O=null!=b?b:{},j=O.style,P=(0,u.default)(O,o),h=[v,j];return l.createElement(e,(0,t.default)({},y,P,{style:h,ref:_}))})}},300,[232,14,301,317,26,13,11]); 357__d(function(g,r,i,a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return _}});var t=e(r(d[0])),u=e(r(d[1])),n=r(d[2]),l=e(r(d[3])),c=e(r(d[4])),f=r(d[5]),o=e(r(d[6]));function _(e){var t=(0,f.useReducer)(e=>e+1,0)[1],c=(0,f.useRef)(null),o=(0,f.useMemo)(()=>new u.default(e,()=>null==c.current?void 0:c.current()),[e]);v(o);var _=(0,f.useCallback)(u=>{o.setNativeView(u),c.current=()=>{t()};var l=b(u),f=[];for(var _ in e){var s=e[_];s instanceof n.AnimatedEvent&&s.__isNative&&(s.__attach(l,_),f.push([_,s]))}return()=>{c.current=null;for(var e=0,t=f;e<t.length;e++){var u=t[e],n=u[0];u[1].__detach(l,n)}}},[e,o]),h=(0,l.default)(_);return[s(o),h]}function s(e){return(0,t.default)((0,t.default)({},e.__getValue()),{},{collapsable:!1})}function v(e){var t=(0,f.useRef)(null),u=(0,f.useRef)(!1);(0,f.useEffect)(()=>{c.default.API.flushQueue()}),(0,o.default)(()=>(u.current=!1,()=>{u.current=!0}),[]),(0,o.default)(()=>
357{if(e.__attach(),null!=t.current){var n=t.current;n.__restoreDefaultValues(),n.__detach(),t.current=null}return()=>{u.current?e.__detach():t.current=e}},[e])}function b(e){return'object'==typeof e&&'function'==typeof(null==e?void 0:e.getScrollableNode)?e.getScrollableNode():e}},301,[21,302,303,316,308,11,87]); 358__d(function(g,r,i,a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var t=e(r(d[0])),_=r(d[1]),s=e(r(d[2])),n=e(r(d[3])),o=e(r(d[4])),l=e(r(d[5]));class u extends s.default{constructor(e,_){super(),e.style&&(e=(0,t.default)((0,t.default)({},e),{},{style:new n.default(e.style)})),this._props=e,this._callback=_}__getValue(){var e={};for(var t in this._props){var o=this._props[t];o instanceof s.default?(!o.__isNative||o instanceof n.default)&&(e[t]=o.__getValue()):o instanceof _.AnimatedEvent?e[t]=o.__getHandler():e[t]=o}return e}__getAnimatedValue(){var e={};for(var t in this._props){var _=this._props[t];_ instanceof s.default&&(e[t]=_.__getAnimatedValue())}return e}__attach(){for(var e in this._props){var t=this._props[e];t instanceof s.default&&t.__addChild(this)}}__detach(){for(var e in this.__isNative&&this._animatedView&&this.__disconnectAnimatedView(),this._animatedView=null,this._props){var t=this._props[e];t instanceof s.default&&t.__removeChild(this)}super.__detach()}update(){this._callback()}__makeNative(){if(!this.__isNative){for(var e in this.__isNative=!0,this._props){var t=this._props[e];t instanceof s.default&&t.__makeNative()}this._animatedView&&this.__connectAnimatedView()}}setNativeView(e){this._animatedView!==e&&(this._animatedView=e,this.__isNative&&this.__connectAnimatedView())}__connectAnimatedView(){(0,l.default)(this.__isNative,'Expected node to be marked as "native"');var e=this._animatedView;(0,l.default)(null!=e,'Unable to locate attached view in the native tree'),o.default.API.connectAnimatedNodeToView(this.__getNativeTag(),e)}__disconnectAnimatedView(){(0,l.default)(this.__isNative,'Expected node to be marked as "native"');var e=this._animatedView;(0,l.default)(null!=e,'Unable to locate attached view in the native tree'),o.default.API.disconnectAnimatedNodeFromView(this.__getNativeTag(),e)}__restoreDefaultValues(){this.__isNative&&o.default.API.restoreDefaultValues(this.__getNativeTag())}__getNativeConfig(){var e={};for(var t in this._props){var _=this._props[t];_ instanceof s.default&&(_.__makeNative(),e[t]=_.__getNativeTag())}return{type:'props',props:e}}}var h=u},302,[21,303,307,314,308,108]); 359__d(function(g,r,i,a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.attachNativeEvent=v,Object.defineProperty(_e,"AnimatedEvent",{enumerable:!0,get:function(){return _}});var t=e(r(d[0])),n=r(d[1]),s=e(n),l=e(r(d[2]));function v(e,n,v){var _=[],o=(e,n)=>{if(e instanceof t.default)e.__makeNative(),_.push({nativeEventPath:n,animatedValueTag:e.__getNativeTag()});else if('object'==typeof e)for(var s in e)o(e[s],n.concat(s))};return(0,l.default)(v[0]&&v[0].nativeEvent,'Native driven events only support animated values contained inside `nativeEvent`.'),o(v[0].nativeEvent,[]),null!=e&&_.forEach(t=>{s.default.API.addAnimatedEventToView(e,n,t)}),{detach(){null!=e&&_.forEach(t=>{s.default.API.removeAnimatedEventFromView(e,n,t.animatedValueTag)})}}}class _{constructor(e,t){this._listeners=[],this._argMapping=e,null==t&&(console.warn('Animated.event now requires a second argument for options'),t={useNativeDriver:!1}),t.listener&&this.__addListener(t.listener),this._callListeners=this._callListeners.bind(this),this._attachedEvent=null,this.__isNative=(0,n.shouldUseNativeDriver)(t)}__addListener(e){this._listeners.push(e)}__removeListener(e){this._listeners=this._listeners.filter(t=>t!==e)}__attach(e,t){(0,l.default)(this.__isNative,'Only native driven events need to be attached.'),this._attachedEvent=v(e,t,this._argMapping)}__detach(e,t){(0,l.default)(this.__isNative,'Only native driven events need to be detached.'),this._attachedEvent&&this._attachedEvent.detach()}__getHandler(){var e=this;if(this.__isNative)return this._callListeners;return function(){for(var n=arguments.length,s=new Array(n),l=0;l<n;l++)s[l]=arguments[l];var v=(e,n,s)=>{if(e instanceof t.default)'number'==typeof n&&e.setValue(n);else if('object'==typeof e)for(var l in e)v(e[l],n[l],l)};e._argMapping.forEach((e,t)=>{v(e,s[t],'arg'+t)}),e._callListeners(...s)}}_callListeners(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];
359this._listeners.forEach(e=>e(...t))}}},303,[304,308,108]); 360__d(function(g,r,i,a,m,_e,d){'use strict';function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var e=t(r(d[0])),s=t(r(d[1])),n=t(r(d[2])),_=t(r(d[3])).default.API;class u extends s.default{constructor(t,e){if(super(),'number'!=typeof t)throw new Error('AnimatedValue: Attempting to set value to undefined');this._startingValue=this._value=t,this._offset=0,this._animation=null,e&&e.useNativeDriver&&this.__makeNative()}__detach(){this.__isNative&&_.getValue(this.__getNativeTag(),t=>{this._value=t-this._offset}),this.stopAnimation(),super.__detach()}__getValue(){return this._value+this._offset}setValue(t){var e,s;this._animation&&(this._animation.stop(),this._animation=null),this._updateValue(t,!this.__isNative),this.__isNative&&(e=this.__getNativeTag().toString(),s=()=>_.setAnimatedNodeValue(this.__getNativeTag(),t),_.setWaitingForIdentifier(e),s(),_.unsetWaitingForIdentifier(e))}setOffset(t){this._offset=t,this.__isNative&&_.setAnimatedNodeOffset(this.__getNativeTag(),t)}flattenOffset(){this._value+=this._offset,this._offset=0,this.__isNative&&_.flattenAnimatedNodeOffset(this.__getNativeTag())}extractOffset(){this._offset+=this._value,this._value=0,this.__isNative&&_.extractAnimatedNodeOffset(this.__getNativeTag())}stopAnimation(t){this.stopTracking(),this._animation&&this._animation.stop(),this._animation=null,t&&(this.__isNative?_.getValue(this.__getNativeTag(),t):t(this.__getValue()))}resetAnimation(t){this.stopAnimation(t),this._value=this._startingValue,this.__isNative&&_.setAnimatedNodeValue(this.__getNativeTag(),this._startingValue)}__onAnimatedValueUpdateReceived(t){this._updateValue(t,!1)}interpolate(t){return new e.default(this,t)}animate(t,e){var s=null;t.__isInteraction&&(s=n.default.createInteractionHandle());var _=this._animation;this._animation&&this._animation.stop(),this._animation=t,t.start(this._value,t=>{this._updateValue(t,!0)},t=>{this._animation=null,null!==s&&n.default.clearInteractionHandle(s),e&&e(t)},_,this)}stopTracking(){this._tracking&&this._tracking.__detach(),this._tracking=null}track(t){this.stopTracking(),this._tracking=t,this._tracking&&this._tracking.update()}_updateValue(t,e){if(void 0===t)throw new Error('AnimatedValue: Attempting to set value to undefined');var s,n;this._value=t,e&&(s=this,n=new Set,(function t(e){'function'==typeof e.update?n.add(e):e.__getChildren().forEac
360h(t)})(s),n.forEach(t=>t.update())),super.__callListeners(this.__getValue())}__getNativeConfig(){return{type:'value',value:this._value,offset:this._offset}}}var h=u},304,[305,306,285,308]); 361__d(function(_g,_r,_i,_a,m,_e,d){'use strict';function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return g}});var e=t(_r(d[0])),a=t(_r(d[1])),n=t(_r(d[2])),r=t(_r(d[3])),i=t(_r(d[4])),o=t=>t;function u(t){if(t.outputRange&&'string'==typeof t.outputRange[0])return _(t);var e=t.outputRange,a=t.inputRange,n=t.easing||o,i='extend';void 0!==t.extrapolateLeft?i=t.extrapolateLeft:void 0!==t.extrapolate&&(i=t.extrapolate);var u='extend';return void 0!==t.extrapolateRight?u=t.extrapolateRight:void 0!==t.extrapolate&&(u=t.extrapolate),t=>{(0,r.default)('number'==typeof t,'Cannot interpolation an input which is not a number');var o=s(t,a);return p(t,a[o],a[o+1],e[o],e[o+1],n,i,u)}}function p(t,e,a,n,r,i,o,u){var p=t;if(p<e){if('identity'===o)return p;'clamp'===o&&(p=e)}if(p>a){if('identity'===u)return p;'clamp'===u&&(p=a)}return n===r?n:e===a?t<=e?n:r:(e===-1/0?p=-p:a===1/0?p-=e:p=(p-e)/(a-e),p=i(p),n===-1/0?p=-p:r===1/0?p+=n:p=p*(r-n)+n,p)}function l(t){var e=(0,i.default)(t);return null===e||'number'!=typeof e?t:"rgba("+((4278190080&(e=e||0))>>>24)+", "+((16711680&e)>>>16)+", "+((65280&e)>>>8)+", "+(255&e)/255+")"}var f=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g;function _(t){var a=t.outputRange;(0,r.default)(a.length>=2,'Bad output range'),h(a=a.map(l));var n=a[0].match(f).map(()=>[]);a.forEach(t=>{t.match(f).forEach((t,e)=>{n[e].push(+t)})});var i,o=a[0].match(f).map((a,r)=>u((0,e.default)((0,e.default)({},t),{},{outputRange:n[r]}))),p='string'==typeof(i=a[0])&&i.startsWith('rgb');return t=>{var e=0;return a[0].replace(f,()=>{var a=+o[e++](t);return p&&(a=e<4?Math.round(a):Math.round(1e3*a)/1e3),String(a)})}}function h(t){for(var e=t[0].replace(f,''),a=1;a<t.length;++a)(0,r.default)(e===t[a].replace(f,''),'invalid pattern '+t[0]+' and '+t[a])}function s(t,e){var a;for(a=1;a<e.length-1&&!(e[a]>=t);++a);return a-1}class c extends a.default{constructor(t,e){super(),this._parent=t,this._config=e,this._interpolation=u(e)}__makeNative(t){this._parent.__makeNative(t),super.__makeNative(t)}__getValue(){var t=this._parent.__getValue();return(0,r.default)('number'==typeof t,'Cannot interpolate an input which is not a number.'),this._interpolation(t)}interpolate(t){return new c(this,t)}__attach(){this._parent.__addChild(this)}__detach(){this._parent.__removeChild(this),super.__detach()}__transformDataType(t){return t.map(n.default.transformDataType)}__getNativeConfig(){return{inputRange:this._config.inputRange,outputRange:this.__transformDataType(this._config.outputRange),extrapolateLeft:this._config.extrapolateLeft||this._config.extrapolate||'extend',extrapolateRight:this._config.extrapolateRight||this._config.extrapolate||'extend',type:'interpolation'}}}c.__createInterpolation=u;var g=c},305,[21,306,308,108,34]); 362__d(function(g,r,i,a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var t=e(r(d[0])),_=e(r(d[1])),s=e(r(d[2]));class n extends _.default{constructor(){super(),this._children=[]}__makeNative(e){if(!this.__isNative){this.__isNative=!0;for(var _,n=(0,t.default)(this._children);!(_=n()).done;){var l=_.value;l.__makeNative(e),s.default.API.connectAnimatedNodes(this.__getNativeTag(),l.__getNativeTag())}}super.__makeNative(e)}__addChild(e){0===this._children.length&&this.__attach(),this._children.push(e),this.__isNative&&(e.__makeNative(this.__getPlatformConfig()),s.default.API.connectAnimatedNodes(this.__getNativeTag(),e.__getNativeTag()))}__removeChild(e){var t=this._children.indexOf(e);-1!==t?(this.__isNative&&e.__isNative&&s.default.API.disconnectAnimatedNodes(this.__getNativeTag(),e.__getNativeTag()),this._children.splice(t,1),0===this._children.length&&this.__detach()):console.warn("Trying to remove a child that doesn't exist")}__getChildren(){return this._children}__callListeners(e){if(super.__callListeners(e),!this.__isNative)for(var _,s=(0,t.default)(this._children);!(_=s()).done;){var n=_.value;n.__getValue&&n.__callListeners(n.__getValue())}}}var l=n},306,[274,307,308]); 363__d(function(g,r,i,a,m,_e,d){'use strict';
363function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var t=e(r(d[0])),s=e(r(d[1])),n=t.default.API,_=1;var o=class{__attach(){}__detach(){this.__isNative&&null!=this.__nativeTag&&(t.default.API.dropAnimatedNode(this.__nativeTag),this.__nativeTag=void 0)}__getValue(){}__getAnimatedValue(){return this.__getValue()}__addChild(e){}__removeChild(e){}__getChildren(){return[]}constructor(){this._listeners={}}__makeNative(e){if(!this.__isNative)throw new Error('This node cannot be made a "native" animated node');this._platformConfig=e,this.hasListeners()&&this._startListeningToNativeValueUpdates()}addListener(e){var t=String(_++);return this._listeners[t]=e,this.__isNative&&this._startListeningToNativeValueUpdates(),t}removeListener(e){delete this._listeners[e],this.__isNative&&!this.hasListeners()&&this._stopListeningForNativeValueUpdates()}removeAllListeners(){this._listeners={},this.__isNative&&this._stopListeningForNativeValueUpdates()}hasListeners(){return!!Object.keys(this._listeners).length}_startListeningToNativeValueUpdates(){this.__nativeAnimatedValueListener&&!this.__shouldUpdateListenersForNewNativeTag||(this.__shouldUpdateListenersForNewNativeTag&&(this.__shouldUpdateListenersForNewNativeTag=!1,this._stopListeningForNativeValueUpdates()),n.startListeningToAnimatedNodeValue(this.__getNativeTag()),this.__nativeAnimatedValueListener=t.default.nativeEventEmitter.addListener('onAnimatedValueUpdate',e=>{e.tag===this.__getNativeTag()&&this.__onAnimatedValueUpdateReceived(e.value)}))}__onAnimatedValueUpdateReceived(e){this.__callListeners(e)}__callListeners(e){for(var t in this._listeners)this._listeners[t]({value:e})}_stopListeningForNativeValueUpdates(){this.__nativeAnimatedValueListener&&(this.__nativeAnimatedValueListener.remove(),this.__nativeAnimatedValueListener=null,n.stopListeningToAnimatedNodeValue(this.__getNativeTag()))}__getNativeTag(){var e;t.default.assertNativeAnimatedModule(),(0,s.default)(this.__isNative,'Attempt to get native tag from node not marked as "native"');var n=null!==(e=this.__nativeTag)&&void 0!==e?e:t.default.generateNewNodeTag();if(null==this.__nativeTag){this.__nativeTag=n;var _=this.__getNativeConfig();this._platformConfig&&(_.platformConfig=this._platformConfig),t.default.API.createAnimatedNode(n,_),this.__shouldUpdateListenersForNewNativeTag=!0}return n}__getNativeConfig(){throw new Error('This JS animated node type cannot be used as native animated node')}toJSON(){return this.__getValue()}__getPlatformConfig(){return this._platformConfig}__setPlatformConfig(e){this._platformConfig=e}}},307,[308,108]); 364__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"API",{enumerable:!0,get:function(){return A}}),Object.defineProperty(_e,"isSupportedColorStyleProp",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"isSupportedStyleProp",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"isSupportedTransformProp",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"isSupportedInterpolationParam",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"addWhitelistedStyleProp",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"addWhitelistedTransformProp",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"addWhitelistedInterpolationParam",{enumerable:!0,get:function(){return V}}),Object.defineProperty(_e,"validateStyles",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"validateTransform",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"validateInterpolation",{enumerable:!0,get:function(){return F}}),Object.defineProperty(_e,"generateNewNodeTag",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"generateNewAnimationId",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"assertNativeAnimatedModule",{enumerable:!0,get:function(){return W}}),Object.defineProperty(_e,"shouldUseNativeDriver",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"transformDataType",{enumerable:!0,get:function(){return _}});var t=e(r(d[0])),n=e(r(d[1]));r(d[2]);var o=e(r(d[3]));r(d[4]);var u=e(r(d[5])),l=e(r(d[6]));r(d[7]);var s,f=n.default,p=1,c=1,v=new Set,b=!1,N=[],O=null,y=f,A={getValue:function(e,t){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.getValue,e,t)},setWaitingForIdentifier:function(e){v.add(e),b=!0,u.default.animatedShouldDebounceQueueFlush()&&O&&clearTimeout(O)},unsetWaitingForIdentifier:function(e){v.delete(e),0===v.size&&(b=!1,A.disableQueue())},disableQueue:function(){((0,l.default)(y,'Native animated module is not available'),u.default.animatedShouldDebounceQueueFlush())?(clearImmediate(O),O=setImmediate(A.flushQueue)):A.flushQueue()},flushQueue:function(){},queueOperation:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];b||0!==N.length?N.push(()=>e(...n)):e(...n)},createAnimatedNode:function(e,t){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.createAnimatedNode,e,t)},updateAnimatedNodeConfig:function(e,t){(0,l.default)(y,'Native animated module is not available')},startListeningToAnimatedNodeValue:function(e){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.startListeningToAnimatedNodeValue,e)},stopListeningToAnimatedNodeValue:function(e){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.stopListeningToAnimatedNodeValue,e)},connectAnimatedNodes:function(e,t){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.connectAnimatedNodes,e,t)},disconnectAnimatedNodes:function(e,t){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.disconnectAnimatedNodes,e,t)},startAnimatingNode:function(e,t,n,o){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.startAnimatingNode,e,t,n,o)},stopAnimation:function(e){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.stopAnimation,e)},setAnimatedNodeValue:function(e,t){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.setAnimatedNodeValue,e,t)},setAnimatedNodeOffset:function(e,t){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.setAnimatedNodeOffset,e,t)},flattenAnimatedNodeOffset:function(e){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.flattenAnimatedNodeOffset,e)},extractAnimatedNodeOffset:function(e){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.extractAnimatedNodeOffset,e)},connectAnimatedNodeToView:function(e,t){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.connectAnimatedNodeToView,e,t)},disconnectAnimatedNodeFromView:function(e,t){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.disconnectAnimatedNodeFromView,e,t)},restoreDefaultValues:function(e){(0,l.default)(y,'Native animated module is not available'),null!=y.restoreDefaultValues&&A.queueOperation(y.restoreDefaultValues,e)},dropAnimatedNode:function(e){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.dropAnimatedNode,e)},addAnimatedEventToView:function(e,t,n){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.addAnimatedEventToView,e,t,n)}
364,removeAnimatedEventFromView(e,t,n){(0,l.default)(y,'Native animated module is not available'),A.queueOperation(y.removeAnimatedEventFromView,e,t,n)}},P={backgroundColor:!0,borderBottomColor:!0,borderColor:!0,borderEndColor:!0,borderLeftColor:!0,borderRightColor:!0,borderStartColor:!0,borderTopColor:!0,color:!0,tintColor:!0},h=(0,t.default)((0,t.default)({},P),{},{borderBottomEndRadius:!0,borderBottomLeftRadius:!0,borderBottomRightRadius:!0,borderBottomStartRadius:!0,borderRadius:!0,borderTopEndRadius:!0,borderTopLeftRadius:!0,borderTopRightRadius:!0,borderTopStartRadius:!0,elevation:!0,opacity:!0,transform:!0,zIndex:!0,shadowOpacity:!0,shadowRadius:!0,scaleX:!0,scaleY:!0,translateX:!0,translateY:!0}),w={translateX:!0,translateY:!0,scale:!0,scaleX:!0,scaleY:!0,rotate:!0,rotateX:!0,rotateY:!0,rotateZ:!0,perspective:!0},T={inputRange:!0,outputRange:!0,extrapolate:!0,extrapolateRight:!0,extrapolateLeft:!0};function S(e){h[e]=!0}function q(e){w[e]=!0}function V(e){T[e]=!0}function j(e){return P.hasOwnProperty(e)}function R(e){return h.hasOwnProperty(e)}function I(e){return w.hasOwnProperty(e)}function D(e){return T.hasOwnProperty(e)}function C(e){e.forEach(e=>{if(!I(e.property))throw new Error("Property '"+e.property+"' is not supported by native animated module")})}function E(e){for(var t in e)if(!R(t))throw new Error("Style property '"+t+"' is not supported by native animated module")}function F(e){for(var t in e)if(!D(t))throw new Error("Interpolation property '"+t+"' is not supported by native animated module")}function x(){return p++}function L(){return c++}function W(){(0,l.default)(f,'Native animated module is not available')}var Q=!1;function M(e){return null==e.useNativeDriver&&console.warn("Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false`"),!0!==e.useNativeDriver||f?e.useNativeDriver||!1:(Q||(console.warn("Animated: `useNativeDriver` is not supported because the native animated module is missing. Falling back to JS-based animation. To resolve this, add `RCTAnimation` module to this app, or remove `useNativeDriver`. Make sure to run `bundle exec pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md"),Q=!0),!1)}function _(e){return'string'!=typeof e?e:/deg$/.test(e)?(parseFloat(e)||0)*Math.PI/180:e}var k={API:A,isSupportedColorStyleProp:j,isSupportedStyleProp:R,isSupportedTransformProp:I,isSupportedInterpolationParam:D,addWhitelistedStyleProp:S,addWhitelistedTransformProp:q,addWhitelistedInterpolationParam:V,validateStyles:E,validateTransform:C,validateInterpolation:F,generateNewNodeTag:x,generateNewAnimationId:L,assertNativeAnimatedModule:W,shouldUseNativeDriver:M,transformDataType:_,get nativeEventEmitter(){return s||(s=new o.default(null)),s}}},308,[21,309,311,153,312,313,108,154]); 365__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return e}});var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])).get('NativeAnimatedModule')},309,[310]); 366__d(function(g,r,i,a,m,_e,d){'use strict';Object.defineProperty(_e,'__esModule',{value:!0}),_e.get=u,_e.getEnforcing=function(e){var n=null;return(0,t.default)(null!=n,"TurboModuleRegistry.getEnforcing(...): '"+e+"' could not be found. Verify that a module by this name is registered in the native binary."),n};var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e};function u(e){return null}},310,[108]); 367__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return e}});var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])).get('NativeAnimatedTurboModule')},311,[310]); 368__d(function(g,r,i,a,m,_e,d){"use strict";
368Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},312,[136]); 369__d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t={isLayoutAnimationEnabled:()=>!0,shouldEmitW3CPointerEvents:()=>!1,shouldPressibilityUseW3CPointerEventsForHover:()=>!1,animatedShouldDebounceQueueFlush:()=>!1,animatedShouldUseSingleOp:()=>!1}},313,[]); 370__d(function(g,r,i,a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return y}});var t=e(r(d[0])),s=e(r(d[1])),l=e(r(d[2])),n=e(r(d[3])),_=e(r(d[4])).default.flatten;function u(e){var l=_(e),n={};for(var f in l){var y=l[f];'transform'===f&&Array.isArray(y)?n[f]=new s.default(y):y instanceof t.default?n[f]=y:y&&!Array.isArray(y)&&'object'==typeof y&&(n[f]=u(y))}return n}class f extends l.default{constructor(e){super(),this._inputStyle=e,this._style=u(e)}_walkStyleAndGetValues(e){var s={};for(var l in e){var n=e[l];n instanceof t.default?n.__isNative||(s[l]=n.__getValue()):n&&!Array.isArray(n)&&'object'==typeof n?s[l]=this._walkStyleAndGetValues(n):s[l]=n}return s}__getValue(){return[this._inputStyle,this._walkStyleAndGetValues(this._style)]}_walkStyleAndGetAnimatedValues(e){var s={};for(var l in e){var n=e[l];n instanceof t.default?s[l]=n.__getAnimatedValue():n&&!Array.isArray(n)&&'object'==typeof n&&(s[l]=this._walkStyleAndGetAnimatedValues(n))}return s}__getAnimatedValue(){return this._walkStyleAndGetAnimatedValues(this._style)}__attach(){for(var e in this._style){var s=this._style[e];s instanceof t.default&&s.__addChild(this)}}__detach(){for(var e in this._style){var s=this._style[e];s instanceof t.default&&s.__removeChild(this)}super.__detach()}__makeNative(){for(var e in this._style){var s=this._style[e];s instanceof t.default&&s.__makeNative()}super.__makeNative()}__getNativeConfig(){var e={};for(var s in this._style)if(this._style[s]instanceof t.default){var l=this._style[s];l.__makeNative(),e[s]=l.__getNativeTag()}return n.default.validateStyles(e),{type:'style',style:e}}}var y=f},314,[307,315,306,308,26]); 371__d(function(g,r,i,a,m,_e,d){'use strict';function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var e=t(r(d[0])),n=t(r(d[1])),s=t(r(d[2]));class f extends n.default{constructor(t){super(),this._transforms=t}
371__makeNative(){this._transforms.forEach(t=>{for(var n in t){var s=t[n];s instanceof e.default&&s.__makeNative()}}),super.__makeNative()}__getValue(){return this._transforms.map(t=>{var n={};for(var s in t){var f=t[s];f instanceof e.default?n[s]=f.__getValue():n[s]=f}return n})}__getAnimatedValue(){return this._transforms.map(t=>{var n={};for(var s in t){var f=t[s];f instanceof e.default?n[s]=f.__getAnimatedValue():n[s]=f}return n})}__attach(){this._transforms.forEach(t=>{for(var n in t){var s=t[n];s instanceof e.default&&s.__addChild(this)}})}__detach(){this._transforms.forEach(t=>{for(var n in t){var s=t[n];s instanceof e.default&&s.__removeChild(this)}}),super.__detach()}__getNativeConfig(){var t=[];return this._transforms.forEach(n=>{for(var f in n){var o=n[f];o instanceof e.default?t.push({type:'animated',property:f,nodeTag:o.__getNativeTag()}):t.push({type:'static',property:f,value:s.default.transformDataType(o)})}}),s.default.validateTransform(t),{type:'transform',transforms:t}}}var o=f},315,[307,306,308]); 372__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var t=r(d[0]);function u(u){var n=(0,t.useRef)(void 0);return(0,t.useCallback)(t=>{n.current&&(n.current(),n.current=void 0),null!=t&&(n.current=u(t))},[u])}},316,[11]); 373__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var n=r(d[0]);function t(){for(var t=arguments.length,u=new Array(t),f=0;f<t;f++)u[f]=arguments[f];return(0,n.useCallback)(n=>{for(var t=0,f=u;t<f.length;t++){var l=f[t];null!=l&&('function'==typeof l?l(n):l.current=n)}},[...u])}},317,[11]); 374__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var t=e(r(d[1])),u=(0,e(r(d[2])).default)(t.default)},318,[11,319,300]); 375__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return P}});var t=e(r(_d[0])),n=e(r(_d[1])),o=e(r(_d[2])),l=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[3])),u=e(r(_d[4])),d=r(_d[5]),s=r(_d[6]),c=e(r(_d[7])),f=e(r(_d[8])),h=e(r(_d[9])),p=e(r(_d[10])),b=e(r(_d[11])),y=r(_d[12]),v=["aria-label","accessibilityLabel","blurRadius","defaultSource","draggable","onError","onLayout","onLoad","onLoadEnd","onLoadStart","pointerEvents","source","style"],w='LOADED',E='LOADING',z=0,S=/^(data:image\/svg\+xml;utf8,)(.*)/;function k(e,t){return e&&null!=t?l.createElement("svg",{style:{position:'absolute',height:0,visibility:'hidden',width:0}},l.createElement("defs",null,l.createElement("filter",{id:"tint-"+t,suppressHydrationWarning:!0},l.createElement("feFlood",{floodColor:""+e,key:e}),l.createElement("feComposite",{in2:"SourceAlpha",operator:"in"})))):null}function I(e,t,n,o){var l=h.default.flatten(e),u=l.filter,d=l.resizeMode,c=l.shadowOffset,f=l.tintColor;l.resizeMode&&(0,y.warnOnce)('Image.style.resizeMode','Image: style.resizeMode is deprecated. Please use props.resizeMode.'),l.tintColor&&(0,y.warnOnce)('Image.style.tintColor','Image: style.tintColor is deprecated. Please use props.tintColor.');var p=[],b=null;if(u&&p.push(u),t&&p.push("blur("+t+"px)"),c){var v=(0,s.createBoxShadowValue)(l);v&&p.push("drop-shadow("+v+")")}return(o||f)&&null!=n&&p.push("url(#tint-"+n+")"),p.length>0&&(b=p.join(' ')),[d,b,f]}function C(e){if('number'==typeof e){var t=(0,d.getAssetByID)(e);return{height:t.height,width:t.width}}if(null!=e&&!Array.isArray(e)&&'object'==typeof e)return{height:e.height,width:e.width}}function O(e){var t=null;if('number'==typeof e){var n=(0,d.getAssetByID)(e);if(null==n)throw new Error("Image: asset with ID \""+e+"\" could not be found. Please check the image source or packager.");var o=n.scales[0];if(n.scales.length>1){var l=f.default.get();o=n.scales.reduce((e,t)=>
375Math.abs(t-l)<Math.abs(e-l)?t:e)}var u=1!==o?"@"+o+"x":'';t=n?n.httpServerLocation+"/"+n.name+u+"."+n.type:''}else'string'==typeof e?t=e:e&&'string'==typeof e.uri&&(t=e.uri);if(t){var s=t.match(S);if(s){var c=s[1],h=s[2];return""+c+encodeURIComponent(h)}}return t}var L=l.forwardRef((e,t)=>{var d=e['aria-label'],s=e.accessibilityLabel,f=e.blurRadius,h=e.defaultSource,y=e.draggable,S=e.onError,L=e.onLayout,M=e.onLoad,P=e.onLoadEnd,j=e.onLoadStart,D=e.pointerEvents,_=e.source,A=e.style,B=(0,o.default)(e,v),F=d||s,H=l.useState(()=>{var e=O(_);if(null!=e&&c.default.has(e))return w;return"IDLE"}),W=H[0],q=H[1],N=l.useState({}),$=N[0],G=N[1],U=l.useContext(p.default),V=l.useRef(null),J=l.useRef(z++),K=l.useRef(null),Q=W===w||W===E&&null==h,T=I(A,f,J.current,e.tintColor),X=T[0],Y=T[1],Z=T[2],ee=e.resizeMode||X||'cover',te=e.tintColor||Z,re=Q?_:h,ae=O(re),ne=C(re),oe=ae?"url(\""+ae+"\")":null,le=(function(){if(null!=V.current&&('center'===ee||'repeat'===ee)){var e=V.current,t=e.naturalHeight,n=e.naturalWidth,o=$.height,l=$.width;if(t&&n&&o&&l){var u=Math.min(1,l/n,o/t);return Math.ceil(u*n)+"px "+Math.ceil(u*t)+"px"}}})(),ue=ae?(0,u.default)('img',{alt:F||'',style:R.accessibilityImage$raw,draggable:y||!1,ref:V,src:ae}):null;var ie=O(_);return l.useEffect(()=>{function e(){null!=K.current&&(c.default.abort(K.current),K.current=null)}return e(),null!=ie&&(q(E),j&&j(),K.current=c.default.load(ie,function(e){q(w),M&&M(e),P&&P()},function(){q("ERRORED"),S&&S({nativeEvent:{error:"Failed to load resource "+ie}}),P&&P()})),e},[ie,K,q,S,M,P,j]),l.createElement(b.default,(0,n.default)({},B,{"aria-label":F,onLayout:function(e){if('center'===ee||'repeat'===ee||L){var t=e.nativeEvent.layout;L&&L(e),G(t)}},pointerEvents:D,ref:t,style:[R.root,U&&R.inline,ne,A,R.undo,{boxShadow:null}]}),l.createElement(b.default,{style:[R.image,x[ee],{backgroundImage:oe,filter:Y},null!=le&&{backgroundSize:le}],suppressHydrationWarning:!0}),ue,k(te,J.current))});L.displayName='Image';var M=L;M.getSize=function(e,t,n){c.default.getSize(e,t,n)},M.prefetch=function(e){return c.default.prefetch(e)},M.queryCache=function(e){return c.default.queryCache(e)};var R=h.default.create({root:{flexBasis:'auto',overflow:'hidden',zIndex:0},inline:{display:'inline-flex'},undo:{blurRadius:null,shadowColor:null,shadowOpacity:null,shadowOffset:null,shadowRadius:null,tintColor:null,overlayColor:null,resizeMode:null},image:(0,t.default)((0,t.default)({},h.default.absoluteFillObject),{},{backgroundColor:'transparent',backgroundPosition:'center',backgroundRepeat:'no-repeat',backgroundSize:'cover',height:'100%',width:'100%',zIndex:-1}),accessibilityImage$raw:(0,t.default)((0,t.default)({},h.default.absoluteFillObject),{},{height:'100%',opacity:0,width:'100%',zIndex:-1})}),x=h.default.create({center:{backgroundSize:'auto'},contain:{backgroundSize:'contain'},cover:{backgroundSize:'cover'},none:{backgroundPosition:'0',backgroundSize:'auto'},repeat:{backgroundPosition:'0',backgroundRepeat:'repeat',backgroundSize:'auto'},stretch:{backgroundSize:'100% 100%'}}),P=M},319,[21,232,14,11,15,167,73,320,169,26,104,13,74]); 376__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"ImageUriCache",{enumerable:!0,get:function(){return t}});var e=/^data:/;class t{static has(n){var o=t._entries;return e.test(n)||Boolean(o[n])}static add(e){var n=t._entries,o=Date.now();n[e]?(n[e].lastUsedTimestamp=o,n[e].refCount+=1):n[e]={lastUsedTimestamp:o,refCount:1}}static remove(e){var n=t._entries;n[e]&&(n[e].refCount-=1),t._cleanUpIfNeeded()}static _cleanUpIfNeeded(){var e,n,o=t._entries,s=Object.keys(o);s.length+1>t._maximumEntries&&(s.forEach(t=>{var s=o[t];(!n||s.lastUsedTimestamp<n.lastUsedTimestamp)&&0===s.refCount&&(e=t,n=s)}),e&&delete o[e])}}t._maximumEntries=256,t._entries={};var n=0,o={},s={abort(e){var t=o[""+e];t&&(t.onerror=null,t.onload=null,t=null,delete o[""+e])},getSize(e,t,n){var l=!1,u=setInterval(f,16),c=s.load(e,f,function(){'function'==typeof n&&n();s.abort(c),clearInterval(u)});function f(){var e=o[""+c];
376if(e){var n=e.naturalHeight,f=e.naturalWidth;n&&f&&(t(f,n),l=!0)}l&&(s.abort(c),clearInterval(u))}},has:e=>t.has(e),load(e,t,s){n+=1;var l=new window.Image;return l.onerror=s,l.onload=e=>{var n=()=>t({nativeEvent:e});'function'==typeof l.decode?l.decode().then(n,n):setTimeout(n,0)},l.src=e,o[""+n]=l,n},prefetch:e=>new Promise((n,o)=>{s.load(e,()=>{t.add(e),t.remove(e),n()},o)}),queryCache(e){var n={};return e.forEach(e=>{t.has(e)&&(n[e]='disk/memory')}),Promise.resolve(n)}},l=s},320,[]); 377__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}});var t=e(r(_d[0])),n=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[1])),u=e(r(_d[2])),f=e(r(_d[3])),o=n.forwardRef((e,f)=>n.createElement(u.default,(0,t.default)({scrollEventThrottle:1e-4},e,{ref:f}))),c=(0,f.default)(o)},321,[232,11,278,300]); 378__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}});var t=e(r(_d[0])),n=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[1])),u=e(r(_d[2])),f=e(r(_d[3])),o=n.forwardRef((e,f)=>n.createElement(u.default,(0,t.default)({scrollEventThrottle:1e-4},e,{ref:f}))),c=(0,f.default)(o)},322,[232,11,323,300]); 379__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},323,[324]); 380__d(function(g,r,i,a,m,_e,_d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var t=e(r(_d[0])),s=e(r(_d[1]));r(_d[2]);var n=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}),t.default=e,t})(r(_d[3])),o=e(r(_d[4])),c=["stickySectionHeadersEnabled"];class l extends n.PureComponent{constructor(){super(...arguments),this._captureRef=e=>{this._wrapperListRef=e}}scrollToLocation(e){null!=this._wrapperListRef&&this._wrapperListRef.scrollToLocation(e)}recordInteraction(){var e=this._wrapperListRef&&this._wrapperListRef.getListRef();e&&e.recordInteraction()}flashScrollIndicators(){var e=this._wrapperListRef&&this._wrapperListRef.getListRef();e&&e.flashScrollIndicators()}getScrollResponder(){var e=this._wrapperListRef&&this._wrapperListRef.getListRef();if(e)return e.getScrollResponder()}getScrollableNode(){var e=this._wrapperListRef&&this._wrapperListRef.getListRef();if(e)return e.getScrollableNode()}render(){var e=this.props,l=e.stickySectionHeadersEnabled,f=(0,s.default)(e,c),p=null!=l&&l;return n.createElement(o.default,(0,t.default)({},f,{stickySectionHeadersEnabled:p,ref:this._captureRef,getItemCount:e=>e.length,getItem:(e,t)=>e[t]}))}}},324,[232,14,136,11,325]); 381__d(function(g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return S}});var t=e(r(_d[0])),i=e(r(_d[1])),n=e(r(_d[2])),o=e(r(_d[3])),s=e(r(_d[4])),l=e(r(_d[5])),d=r(_d[6]),p=e(r(_d[7])),u=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}),t.default=e,t})(r(_d[8])),c=["ItemSeparatorComponent","SectionSeparatorComponent","renderItem","render
381SectionFooter","renderSectionHeader","sections","stickySectionHeadersEnabled"];class h extends u.PureComponent{constructor(){super(...arguments),this._keyExtractor=(e,t)=>{var i=this._subExtractor(t);return i&&i.key||String(t)},this._convertViewable=e=>{var t;(0,p.default)(null!=e.index,'Received a broken ViewToken');var i=this._subExtractor(e.index);if(!i)return null;var n=i.section.keyExtractor,s=this.props.keyExtractor||d.keyExtractor,l=null!=n?n(e.item,i.index):s(e.item,null!==(t=i.index)&&void 0!==t?t:0);return(0,o.default)((0,o.default)({},e),{},{index:i.index,key:l,section:i.section})},this._onViewableItemsChanged=e=>{var t=e.viewableItems,i=e.changed,n=this.props.onViewableItemsChanged;null!=n&&n({viewableItems:t.map(this._convertViewable,this).filter(Boolean),changed:i.map(this._convertViewable,this).filter(Boolean)})},this._renderItem=e=>t=>{var i=t.item,n=t.index,o=this._subExtractor(n);if(!o)return null;var s=o.index;if(null==s){var l=o.section;if(!0===o.header){var d=this.props.renderSectionHeader;return d?d({section:l}):null}var c=this.props.renderSectionFooter;return c?c({section:l}):null}var h=o.section.renderItem||this.props.renderItem,S=this._getSeparatorComponent(n,o,e);return(0,p.default)(h,'no renderItem!'),u.createElement(f,{SeparatorComponent:S,LeadingSeparatorComponent:0===s?this.props.SectionSeparatorComponent:void 0,cellKey:o.key,index:s,item:i,leadingItem:o.leadingItem,leadingSection:o.leadingSection,prevCellKey:(this._subExtractor(n-1)||{}).key,setSelfHighlightCallback:this._setUpdateHighlightFor,setSelfUpdatePropsCallback:this._setUpdatePropsFor,updateHighlightFor:this._updateHighlightFor,updatePropsFor:this._updatePropsFor,renderItem:h,section:o.section,trailingItem:o.trailingItem,trailingSection:o.trailingSection,inverted:!!this.props.inverted})},this._updatePropsFor=(e,t)=>{var i=this._updatePropsMap[e];null!=i&&i(t)},this._updateHighlightFor=(e,t)=>{var i=this._updateHighlightMap[e];null!=i&&i(t)},this._setUpdateHighlightFor=(e,t)=>{null!=t?this._updateHighlightMap[e]=t:delete this._updateHighlightFor[e]},this._setUpdatePropsFor=(e,t)=>{null!=t?this._updatePropsMap[e]=t:delete this._updatePropsMap[e]},this._updateHighlightMap={},this._updatePropsMap={},this._captureRef=e=>{this._listRef=e}}scrollToLocation(e){for(var t=e.itemIndex,i=0;i<e.sectionIndex;i++)t+=this.props.getItemCount(this.props.sections[i].data)+2;var n=e.viewOffset||0;if(null!=this._listRef){if(e.itemIndex>0&&this.props.stickySectionHeadersEnabled)n+=this._listRef.__getFrameMetricsApprox(t-e.itemIndex,this._listRef.props).length;var s=(0,o.default)((0,o.default)({},e),{},{viewOffset:n,index:t});this._listRef.scrollToIndex(s)}}getListRef(){return this._listRef}render(){for(var e,o=this.props,s=(o.ItemSeparatorComponent,o.SectionSeparatorComponent,o.renderItem,o.renderSectionFooter,o.renderSectionHeader,o.sections,o.stickySectionHeadersEnabled,(0,n.default)(o,c)),d=this.props.ListHeaderComponent?1:0,p=this.props.stickySectionHeadersEnabled?[]:void 0,h=0,f=(0,i.default)(this.props.sections);!(e=f()).done;){var S=e.value;null!=p&&p.push(h+d),h+=2,h+=this.props.getItemCount(S.data)}var _=this._renderItem(h);return u.createElement(l.default,(0,t.default)({},s,{keyExtractor:this._keyExtractor,stickyHeaderIndices:p,renderItem:_,data:this.props.sections,getItem:(e,t)=>this._getItem(this.props,e,t),getItemCount:()=>h,onViewableItemsChanged:this.props.onViewableItemsChanged?this._onViewableItemsChanged:void 0,ref:this._captureRef}))}_getItem(e,t,i){if(!t)return null;for(var n=i-1,o=0;o<t.length;o++){var s=t[o],l=s.data,d=e.getItemCount(l);if(-1===n||n===d)return s;if(n<d)return e.getItem(l,n);n-=d+2}return null}_subExtractor(e){for(var t=e,i=this.props,n=i.getItem,o=i.getItemCount,s=i.keyExtractor,l=i.sections,p=0;p<l.length;p++){var u=l[p],c=u.data,h=u.key||String(p);if(!((t-=1)>=o(c)+1))return-1===t?{section:u,key:h+':header',index:null,header:!0,trailingSection:l[p+1]}:t===o(c)?{section:u,key:h+':footer',index:null,header:!1,trailingSection:l[p+1]}:{section:u,key:h+':'+(u.keyExtractor||s||d.keyExtractor)(n(c,t),t),index:t,leadingItem:n(c,t-1),leadingSection:l[p-1],trailingItem:n(c,t+1),trailingSection:l[p+1]};t-=o(c)+1}}_getSeparatorComponent(e,t,i){if(!(t=t||this._subExtractor(e)))return null;var n=t.section.ItemSeparatorComponent||this.props.ItemSeparatorComponent,o=this.props.SectionSeparatorComponent,s=e===i-1,l=t.index===this.props.getItemCount(t.section.data)-1;return o&&l?o:!n||l||s?null:n}}function f(e){var i=e.LeadingSeparatorComponent,n=e.SeparatorComponent,l=e.cellKey,d=e.prevCellKey,p=e.setSelfHighlightCallback,c=e.updateHighlightFor,h=e.setSelfUpdatePropsCallback,f=e.updatePropsFor,S=e.item,_=e.index,I=e.section,v=e.inverted,x=u.useState(!1),C=x[0],b=x[1],y=u.useState(!1),k=y[0],E=y[1],H=u.useState({leadingItem:e.leadingItem,leadingSection:e.leadingSection,section:e.section,trailingItem:e.item,trailingSection:e.trailingSection}),P=H[0],F=H[1],w=u.useState({leadingItem:e.item,leadingSection:e.leadingSection,section:e.section,trailingItem:e.trailingItem,trailingSection:e.trailingSection}),M=w[0],R=w[1];u.useEffect(()=>(p(l,E),h(l,R),()=>{h(l,null),p(l,null)}),[l,p,R,h]);var V={highlight:()=>{b(!0),E(!0),null!=d&&c(d,!0)},unhighlight:()=>{b(!1),E(!1),null!=d&&c(d,!1)},updateProps:(e,t)=>{'leading'===e?null!=i?F((0,o.default)((0,o.default)({},P),t)):null!=d&&f(d,(0,o.default)((0,o.default)({},P),t)):'trailing'===e&&null!=n&&R((0,o.default)((0,o.default)({},M),t))}},O=e.renderItem({item:S,index:_,section:I,separators:V}),U=null!=i&&u.createElement(i,(0,t.default)({highlighted:C},P)),j=null!=n&&u.createElement(n,(0,t.default)({highlighted:k},M));return U||j?u.createElement(s.default,null,!1===v?U:j,O,!1===v?j:U):O}var S=h},325,[232,274,14,21,13,273,297,108,11]); 382__d(function(g,r,i,a,m,_e,d){"use strict";
382function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var t=e(r(d[1])),u=(0,e(r(d[2])).default)(t.default)},326,[11,327,300]); 383__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var o={};return e&&Object.keys(e).forEach(function(n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}),o.default=e,o}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return k}});var n=e(r(_d[0])),t=e(r(_d[1])),l=o(r(_d[2])),d=e(r(_d[3])),s=o(r(_d[4])),u=e(r(_d[5])),p=e(r(_d[6])),S=e(r(_d[7])),c=e(r(_d[8])),R=e(r(_d[9])),h=e(r(_d[10])),f=e(r(_d[11])),b=r(_d[12]),v=["hrefAttrs","numberOfLines","onClick","onLayout","onPress","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStart
383ShouldSetResponder","onStartShouldSetResponderCapture","selectable"],C=Object.assign({},s.defaultProps,s.accessibilityProps,s.clickProps,s.focusProps,s.keyboardProps,s.mouseProps,s.touchProps,s.styleProps,{href:!0,lang:!0,pointerEvents:!0}),x=e=>(0,u.default)(e,C),w=l.forwardRef((e,o)=>{var n=e.hrefAttrs,s=e.numberOfLines,u=e.onClick,h=e.onLayout,C=e.onPress,w=e.onMoveShouldSetResponder,y=e.onMoveShouldSetResponderCapture,k=e.onResponderEnd,M=e.onResponderGrant,O=e.onResponderMove,L=e.onResponderReject,_=e.onResponderRelease,j=e.onResponderStart,A=e.onResponderTerminate,T=e.onResponderTerminationRequest,E=e.onScrollShouldSetResponder,W=e.onScrollShouldSetResponderCapture,D=e.onSelectionChangeShouldSetResponder,$=e.onSelectionChangeShouldSetResponderCapture,q=e.onStartShouldSetResponder,G=e.onStartShouldSetResponderCapture,H=e.selectable,z=(0,t.default)(e,v),B=l.useContext(f.default),N=l.useRef(null),F=(0,b.useLocaleContext)().direction;(0,p.default)(N,h),(0,R.default)(N,{onMoveShouldSetResponder:w,onMoveShouldSetResponderCapture:y,onResponderEnd:k,onResponderGrant:M,onResponderMove:O,onResponderReject:L,onResponderRelease:_,onResponderStart:j,onResponderTerminate:A,onResponderTerminationRequest:T,onScrollShouldSetResponder:E,onScrollShouldSetResponderCapture:W,onSelectionChangeShouldSetResponder:D,onSelectionChangeShouldSetResponderCapture:$,onStartShouldSetResponder:q,onStartShouldSetResponderCapture:G});var I=l.useCallback(e=>{null!=u?u(e):null!=C&&(e.stopPropagation(),C(e))},[u,C]),J=B?'span':'div',K=null!=e.lang?(0,b.getLocaleDirection)(e.lang):null,Q=e.dir||K,U=Q||F,V=x(z);if(V.dir=Q,B||(V.dir=null!=Q?Q:'auto'),(u||C)&&(V.onClick=I),V.style=[null!=s&&s>1&&{WebkitLineClamp:s},!0===B?P.textHasAncestor$raw:P.text$raw,1===s&&P.textOneLine,null!=s&&s>1&&P.textMultiLine,e.style,!0===H&&P.selectable,!1===H&&P.notSelectable,C&&P.pressable],null!=e.href&&(J='a',null!=n)){var X=n.download,Y=n.rel,Z=n.target;null!=X&&(V.download=X),null!=Y&&(V.rel=Y),'string'==typeof Z&&(V.target='_'!==Z.charAt(0)?'_'+Z:Z)}var ee=(0,c.default)(V),oe=(0,S.default)(N,ee,o);V.ref=oe;var ne=(0,d.default)(J,V,{writingDirection:U});return B?ne:l.createElement(f.default.Provider,{value:!0},ne)});w.displayName='Text';var y={backgroundColor:'transparent',border:'0 solid black',boxSizing:'border-box',color:'black',display:'inline',font:'14px System',listStyle:'none',margin:0,padding:0,position:'relative',textAlign:'start',textDecoration:'none',whiteSpace:'pre-wrap',wordWrap:'break-word'},P=h.default.create({text$raw:y,textHasAncestor$raw:(0,n.default)((0,n.default)({},y),{},{color:'inherit',font:'inherit',textAlign:'inherit',whiteSpace:'inherit'}),textOneLine:{maxWidth:'100%',overflow:'hidden',textOverflow:'ellipsis',whiteSpace:'nowrap',wordWrap:'normal'},textMultiLine:{display:'-webkit-box',maxWidth:'100%',overflow:'clip',textOverflow:'ellipsis',WebkitBoxOrient:'vertical'},notSelectable:{userSelect:'none'},selectable:{userSelect:'text'},pressable:{cursor:'pointer'}}),k=w},327,[21,14,11,15,84,85,86,93,95,97,26,104,82]); 384__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var t=e(r(d[1])),u=(0,e(r(d[2])).default)(t.default)},328,[11,13,300]); 385__d(function(g,r,i,a,m,_e,d){'use strict';function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var e=t(r(d[0])),n=r(d[1]),u=t(r(d[2])),l=t(r(d[3])),f=t(r(d[4])),o=t(r(d[5])),c=t(r(d[6])),s=t(r(d[7])),v=t(r(d[8])),p=!1;function E(t){return e=>{var n=null==e?e:function(){if(p)console.warn('Ignoring recursive animation callback when running mock animations');else{p=!0;try{e(...arguments)}finally{p=!1}}};t(n)}}var y={start:()=>{},stop:()=>{},reset:()=>{},_startNativeLoop:()=>{},_isUsingNativeDriver:()=>!1},_=t=>(0,e.default)((0,e.default)({},y),{},{start:E(e=>{t.forEach(t=>t.start()),null==e||e({finished:!0})})}),h={Value:o.default,ValueXY:c.default,Color:v.default,Interpolation:l.default,Node:f.default,decay:function(t,e){return y},timing:function(t,n){var u=t;return(0,e.default)((0,e.default)({},y),{},{start:E(t=>{u.setValue(n.toValue),null==t||t({finished:!0})})})},spring:function(t,n){var u=t;return(0,e.default)((0,e.default)({},y),{},{start:E(t=>{u.setValue(n.toValue),null==t||t({finished:!0})})})},add:u.default.add,subtract:u.default.subtract,divide:u.default.divide,multiply:u.default.multiply,modulo:u.default.modulo,diffClamp:u.default.diffClamp,delay:function(t){return y},sequence:function(t){return _(t)},parallel:function(t,e){return _(t)},stagger:function(t,e){return _(e)},loop:function(t,e){(void 0===e?{}:e).iterations;return y},event:u.default.event,createAnimatedComponent:s.default,attachNativeEvent:n.attachNativeEvent,forkEvent:u.default.forkEvent,unforkEvent:u.default.unforkEvent,Event:n.AnimatedEvent}},329,[21,303,330,305,307,304,338,300,343]); 386__d(function(_g,_r,_i,_a,m,_e,d){'use strict';function t(t){return t&&t.__esModule?t:{default:t}}
386Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return k}});var n=t(_r(d[0])),e=_r(d[1]),i=t(_r(d[2])),r=t(_r(d[3])),a=t(_r(d[4])),o=t(_r(d[5])),u=t(_r(d[6])),f=t(_r(d[7])),s=t(_r(d[8]));_r(d[9]);var c=t(_r(d[10])),v=t(_r(d[11])),l=t(_r(d[12])),p=t(_r(d[13])),g=t(_r(d[14])),_=t(_r(d[15])),h=t(_r(d[16])),N=t(_r(d[17])),w=t(_r(d[18])),E=function(t,n){return t&&n.onComplete?function(){n.onComplete&&n.onComplete(...arguments),t&&t(...arguments)}:t||n.onComplete},A=function(t,e,i){if(t instanceof p.default){var r=(0,n.default)({},e),a=(0,n.default)({},e);for(var o in e){var u=e[o],f=u.x,s=u.y;void 0!==f&&void 0!==s&&(r[o]=f,a[o]=s)}var c=i(t.x,r),v=i(t.y,a);return y([c,v],{stopTogether:!1})}if(t instanceof w.default){var l=(0,n.default)({},e),g=(0,n.default)({},e),_=(0,n.default)({},e),h=(0,n.default)({},e);for(var N in e){var E=e[N],A=E.r,D=E.g,L=E.b,U=E.a;void 0!==A&&void 0!==D&&void 0!==L&&void 0!==U&&(l[N]=A,g[N]=D,_[N]=L,h[N]=U)}var k=i(t.r,l),C=i(t.g,g),V=i(t.b,_),b=i(t.a,h);return y([k,C,V,b],{stopTogether:!1})}return null},D=function t(e,i){var r=function(t,n,e){e=E(e,n);var i=t,r=n;i.stopTracking(),n.toValue instanceof s.default?i.track(new v.default(i,n.toValue,h.default,r,e)):i.animate(new h.default(r),e)};return A(e,i,t)||{start:function(t){r(e,i,t)},stop:function(){e.stopAnimation()},reset:function(){e.resetAnimation()},_startNativeLoop:function(t){var a=(0,n.default)((0,n.default)({},i),{},{iterations:t});r(e,a)},_isUsingNativeDriver:function(){return i.useNativeDriver||!1}}},L=function(t){var n=0;return{start:function(e){0===t.length?e&&e({finished:!0}):t[n].start(function i(r){if(r.finished){if(++n===t.length)return n=0,void(e&&e(r));t[n].start(i)}else e&&e(r)})},stop:function(){n<t.length&&t[n].stop()},reset:function(){t.forEach((t,e)=>{e<=n&&t.reset()}),n=0},_startNativeLoop:function(){throw new Error('Loops run using the native driver cannot contain Animated.sequence animations')},_isUsingNativeDriver:function(){return!1}}},y=function(t,n){var e=0,i={},r=!(n&&!1===n.stopTogether),a={start:function(n){e!==t.length?t.forEach((o,u)=>{var f=function(o){if(i[u]=!0,++e===t.length)return e=0,void(n&&n(o));!o.finished&&r&&a.stop()};o?o.start(f):f({finished:!0})}):n&&n({finished:!0})},stop:function(){t.forEach((t,n)=>{!i[n]&&t.stop(),i[n]=!0})},reset:function(){t.forEach((t,n)=>{t.reset(),i[n]=!1,e=0})},_startNativeLoop:function(){throw new Error('Loops run using the native driver cannot contain Animated.parallel animations')},_isUsingNativeDriver:function(){return!1}};return a},U=function(t){return D(new l.default(0),{toValue:0,delay:t,duration:0,useNativeDriver:!1})};var k={Value:l.default,ValueXY:p.default,Color:w.default,Interpolation:o.default,Node:s.default,decay:function t(e,i){var r=function(t,n,e){e=E(e,n);var i=t,r=n;i.stopTracking(),i.animate(new g.default(r),e)};return A(e,i,t)||{start:function(t){r(e,i,t)},stop:function(){e.stopAnimation()},reset:function(){e.resetAnimation()},_startNativeLoop:function(t){var a=(0,n.default)((0,n.default)({},i),{},{iterations:t});r(e,a)},_isUsingNativeDriver:function(){return i.useNativeDriver||!1}}},timing:D,spring:function t(e,i){var r=function(t,n,e){e=E(e,n);var i=t,r=n;i.stopTracking(),n.toValue instanceof s.default?i.track(new v.default(i,n.toValue,_.default,r,e)):i.animate(new _.default(r),e)};return A(e,i,t)||{start:function(t){r(e,i,t)},stop:function(){e.stopAnimation()},reset:function(){e.resetAnimation()},_startNativeLoop:function(t){var a=(0,n.default)((0,n.default)({},i),{},{iterations:t});r(e,a)},_isUsingNativeDriver:function(){return i.useNativeDriver||!1}}},add:function(t,n){return new i.default(t,n)},subtract:function(t,n){return new c.default(t,n)},divide:function(t,n){return new a.default(t,n)},multiply:function(t,n){return new f.default(t,n)},modulo:function(t,n){return new u.default(t,n)},diffClamp:function(t,n,e){return new r.default(t,n,e)},delay:U,sequence:L,parallel:y,stagger:function(t,n){return y(n.map((n,e)=>L([U(t*e),n])))},loop:function(t,n){var e=void 0===n?{}:n,i=e.iterations,r=void 0===i?-1:i,a=e.resetBeforeIteration,o=void 0===a||a,u=!1,f=0;return{start:function(n){t&&0!==r?t._isUsingNativeDriver()?t._startNativeLoop(r):(function e(i){void 0===i&&(i={finished:!0}),u||f===r||!1===i.finished?n&&n(i):(f++,o&&t.reset(),t.start(e))})():n&&n({finished:!0})},stop:function(){u=!0,t.stop()},reset:function(){f=0,u=!1,t.reset()},_startNativeLoop:function(){throw new Error('Loops run using the native driver cannot contain Animated.loop animations')},_isUsingNativeDriver:function(){return t._isUsingNativeDriver()}}},event:function(t,n){var i=new e.AnimatedEvent(t,n);return i.__isNative?i:i.__getHandler()},createAnimatedComponent:N.default,attachNativeEvent:e.attachNativeEvent,forkEvent:function(t,n){return t?t instanceof e.AnimatedEvent?(t.__addListener(n),t):function(){'function'==typeof t&&t(...arguments),n(...arguments)}:n},unforkEvent:function(t,n){t&&t instanceof e.AnimatedEvent&&t.__removeListener(n)},Event:e.AnimatedEvent}},330,[21,303,331,332,333,305,334,335,307,302,336,337,304,338,339,341,344,300,343]); 387__d(function(g,r,i,_a,m,_e,d){'use strict';
387function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}});var t=e(r(d[0])),_=e(r(d[1])),a=e(r(d[2]));class u extends a.default{constructor(e,t){super(),this._a='number'==typeof e?new _.default(e):e,this._b='number'==typeof t?new _.default(t):t}__makeNative(e){this._a.__makeNative(e),this._b.__makeNative(e),super.__makeNative(e)}__getValue(){return this._a.__getValue()+this._b.__getValue()}interpolate(e){return new t.default(this,e)}__attach(){this._a.__addChild(this),this._b.__addChild(this)}__detach(){this._a.__removeChild(this),this._b.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'addition',input:[this._a.__getNativeTag(),this._b.__getNativeTag()]}}}var s=u},331,[305,304,306]); 388__d(function(g,r,i,_a,m,_e,d){'use strict';function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}});var e=t(r(d[0])),a=t(r(d[1]));class _ extends a.default{constructor(t,e,a){super(),this._a=t,this._min=e,this._max=a,this._value=this._lastValue=this._a.__getValue()}__makeNative(t){this._a.__makeNative(t),super.__makeNative(t)}interpolate(t){return new e.default(this,t)}__getValue(){var t=this._a.__getValue(),e=t-this._lastValue;return this._lastValue=t,this._value=Math.min(Math.max(this._value+e,this._min),this._max),this._value}__attach(){this._a.__addChild(this)}__detach(){this._a.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'diffclamp',input:this._a.__getNativeTag(),min:this._min,max:this._max}}}var s=_},332,[305,306]); 389__d(function(g,r,i,_a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var t=e(r(d[0])),_=e(r(d[1])),a=e(r(d[2])),n=e(r(d[3]));class s extends n.default{constructor(e,t){super(),this._warnedAboutDivideByZero=!1,(0===t||t instanceof _.default&&0===t.__getValue())&&console.error('Detected potential division by zero in AnimatedDivision'),this._a='number'==typeof e?new a.default(e):e,this._b='number'==typeof t?new a.default(t):t}__makeNative(e){this._a.__makeNative(e),this._b.__makeNative(e),super.__makeNative(e)}__getValue(){var e=this._a.__getValue(),t=this._b.__getValue();return 0===t?(this._warnedAboutDivideByZero||(console.error('Detected division by zero in AnimatedDivision'),this._warnedAboutDivideByZero=!0),0):(this._warnedAboutDivideByZero=!1,e/t)}interpolate(e){return new t.default(this,e)}__attach(){this._a.__addChild(this),this._b.__addChild(this)}__detach(){this._a.__removeChild(this),this._b.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'division',input:[this._a.__getNativeTag(),this._b.__getNativeTag()]}}}var o=s},333,[305,307,304,306]); 390__d(function(g,r,i,_a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return a}});var t=e(r(d[0])),_=e(r(d[1]));class u extends _.default{constructor(e,t){super(),this._a=e,this._modulus=t}__makeNative(e){this._a.__makeNative(e),super.__makeNative(e)}__getValue(){return(this._a.__getValue()%this._modulus+this._modulus)%this._modulus}interpolate(e){return new t.default(this,e)}__attach(){this._a.__addChild(this)}__detach(){this._a.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'modulus',input:this._a.__getNativeTag(),modulus:this._modulus}}}var a=u},334,[305,306]); 391__d(function(g,r,i,_a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}});var t=e(r(d[0])),_=e(r(d[1])),a=e(r(d[2]));class u extends a.default{constructor(e,t){super(),this._a='number'==typeof e?new _.default(e):e,this._b='number'==typeof t?new _.default(t):t}__makeNative(e){this._a.__makeNative(e),this._b.__makeNative(e),super.__makeNative(e)}__getValue(){return this._a.__getValue()*this._b.__getValue()}interpolate(e){return new t.default(this,e)}__attach(){this._a.__addChild(this),this._b.__addChild(this)}__detach(){this._a.__removeChild(this),this._b.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'multiplication',input:[this._a.__getNativeTag(),this._b.__getNativeTag()]}}}var s=u},335,[305,304,306]); 392__d(function(g,r,i,_a,m,_e,d){'use strict';
392function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}});var t=e(r(d[0])),_=e(r(d[1])),a=e(r(d[2]));class u extends a.default{constructor(e,t){super(),this._a='number'==typeof e?new _.default(e):e,this._b='number'==typeof t?new _.default(t):t}__makeNative(e){this._a.__makeNative(e),this._b.__makeNative(e),super.__makeNative(e)}__getValue(){return this._a.__getValue()-this._b.__getValue()}interpolate(e){return new t.default(this,e)}__attach(){this._a.__addChild(this),this._b.__addChild(this)}__detach(){this._a.__removeChild(this),this._b.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'subtraction',input:[this._a.__getNativeTag(),this._b.__getNativeTag()]}}}var s=u},336,[305,304,306]); 393__d(function(g,r,i,a,m,_e,d){'use strict';function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e=t(r(d[0]));r(d[1]);var _=t(r(d[2])),n=r(d[3]);class s extends _.default{constructor(t,e,_,s,u){super(),this._value=t,this._parent=e,this._animationClass=_,this._animationConfig=s,this._useNativeDriver=(0,n.shouldUseNativeDriver)(s),this._callback=u,this.__attach()}__makeNative(){this.__isNative=!0,this._parent.__makeNative(),super.__makeNative(),this._value.__makeNative()}__getValue(){return this._parent.__getValue()}__attach(){this._parent.__addChild(this),this._useNativeDriver&&this.__makeNative()}__detach(){this._parent.__removeChild(this),super.__detach()}update(){this._value.animate(new this._animationClass((0,e.default)((0,e.default)({},this._animationConfig),{},{toValue:this._animationConfig.toValue.__getValue()})),this._callback)}__getNativeConfig(){var t=new this._animationClass((0,e.default)((0,e.default)({},this._animationConfig),{},{toValue:void 0})).__getNativeAnimationConfig();return{type:'tracking',animationId:(0,n.generateNewAnimationId)(),animationConfig:t,toValue:this._parent.__getNativeTag(),value:this._value.__getNativeTag()}}}var u=s},337,[21,304,307,308]); 394__d(function(g,r,i,a,m,_e,d){'use strict';function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e=t(r(d[0])),s=t(r(d[1])),n=t(r(d[2])),l=1;class f extends s.default{constructor(t){super();var s=t||{x:0,y:0};'number'==typeof s.x&&'number'==typeof s.y?(this.x=new e.default(s.x),this.y=new e.default(s.y)):((0,n.default)(s.x instanceof e.default&&s.y instanceof e.default,"AnimatedValueXY must be initialized with an object of numbers or AnimatedValues."),this.x=s.x,this.y=s.y),this._listeners={}}setValue(t){this.x.setValue(t.x),this.y.setValue(t.y)}setOffset(t){this.x.setOffset(t.x),this.y.setOffset(t.y)}flattenOffset(){this.x.flattenOffset(),this.y.flattenOffset()}extractOffset(){this.x.extractOffset(),this.y.extractOffset()}__getValue(){return{x:this.x.__getValue(),y:this.y.__getValue()}}resetAnimation(t){this.x.resetAnimation(),this.y.resetAnimation(),t&&t(this.__getValue())}stopAnimation(t){this.x.stopAnimation(),this.y.stopAnimation(),t&&t(this.__getValue())}addListener(t){var e=String(l++),s=e=>{e.value;t(this.__getValue())};return this._listeners[e]={x:this.x.addListener(s),y:this.y.addListener(s)},e}removeListener(t){this.x.removeListener(this._listeners[t].x),this.y.removeListener(this._listeners[t].y),delete this._listeners[t]}removeAllListeners(){this.x.removeAllListeners(),this.y.removeAllListeners(),this._listeners={}}getLayout(){return{left:this.x,top:this.y}}getTranslateTransform(){return[{translateX:this.x},{translateY:this.y}]}}var u=f},338,[304,306,108]); 395__d(function(g,r,i,a,m,_e,d){'use strict';Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return _}});var t,e=r(d[0]),s=(t=e)&&t.__esModule?t:{default:t},n=r(d[1]);class o extends s.default{constructor(t){var e,s,o;super(),this._deceleration=null!==(e=t.deceleration)&&void 0!==e?e:.998,this._velocity=t.velocity,this._useNativeDriver=(0,n.shouldUseNativeDriver)(t),this.__isInteraction=null!==(s=t.isInteraction)&&void 0!==s?s:!this._useNativeDriver,this.__iterations=null!==(o=t.iterations)&&void 0!==o?o:1}__getNativeAnimationConfig(){return{type:'decay',deceleration:this._deceleration,velocity:this._velocity,iterations:this.__iterations}}start(t,e,s,n,o){this.__active=!0,this._lastValue=t,this._fromValue=t,this._onUpdate=e,this.__onEnd=s,this._startTime=Date.now(),this._useNativeDriver?this.__startNativeAnimation(o):this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this))}onUpdate(){var t=Date.now(),e=this._fromValue+this._velocity/(1-this._deceleration)*(1-Math.exp(-(1-this._deceleration)*(t-this._startTime)));this._onUpdate(e),Math.abs(this._lastValue-e)<.1?this.__debouncedOnEnd({finished:!0}):(this._lastValue=e,this.__active&&(this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this))))}stop(){super.stop(),this.__active=!1,g.cancelAnimationFrame(this._animationFrame),this.__debouncedOnEnd({finished:!1})}}var _=o},339,[340,308]); 396__d(function(g,r,i,a,m,_e,d){'use strict';
396Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return _}});var t,e=r(d[0]),n=(t=e)&&t.__esModule?t:{default:t},o=1;var _=class{start(t,e,n,o,_){}stop(){this.__nativeId&&n.default.API.stopAnimation(this.__nativeId)}__getNativeAnimationConfig(){throw new Error('This animation type cannot be offloaded to native')}__debouncedOnEnd(t){var e=this.__onEnd;this.__onEnd=null,e&&e(t)}__startNativeAnimation(t){var e=o+":startAnimation";o+=1,n.default.API.setWaitingForIdentifier(e);try{var _=this.__getNativeAnimationConfig();t.__makeNative(_.platformConfig),this.__nativeId=n.default.generateNewAnimationId(),n.default.API.startAnimatingNode(this.__nativeId,t.__getNativeTag(),_,this.__debouncedOnEnd.bind(this))}catch(t){throw t}finally{n.default.API.unsetWaitingForIdentifier(e)}}}},340,[308]); 397__d(function(g,r,i,a,_m,_e,d){'use strict';function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var s=t(r(d[0])),e=t(r(d[1])),n=t(r(d[2])),o=r(d[3]);r(d[4]);class h extends s.default{constructor(t){var s,h,l,_,f,u,m,v,c,p,V;if(super(),this._overshootClamping=null!==(s=t.overshootClamping)&&void 0!==s&&s,this._restDisplacementThreshold=null!==(h=t.restDisplacementThreshold)&&void 0!==h?h:.001,this._restSpeedThreshold=null!==(l=t.restSpeedThreshold)&&void 0!==l?l:.001,this._initialVelocity=null!==(_=t.velocity)&&void 0!==_?_:0,this._lastVelocity=null!==(f=t.velocity)&&void 0!==f?f:0,this._toValue=t.toValue,this._delay=null!==(u=t.delay)&&void 0!==u?u:0,this._useNativeDriver=(0,o.shouldUseNativeDriver)(t),this._platformConfig=t.platformConfig,this.__isInteraction=null!==(m=t.isInteraction)&&void 0!==m?m:!this._useNativeDriver,this.__iterations=null!==(v=t.iterations)&&void 0!==v?v:1,void 0!==t.stiffness||void 0!==t.damping||void 0!==t.mass)(0,n.default)(void 0===t.bounciness&&void 0===t.speed&&void 0===t.tension&&void 0===t.friction,'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one'),this._stiffness=null!==(c=t.stiffness)&&void 0!==c?c:100,this._damping=null!==(p=t.damping)&&void 0!==p?p:10,this._mass=null!==(V=t.mass)&&void 0!==V?V:1;else if(void 0!==t.bounciness||void 0!==t.speed){var T,y;(0,n.default)(void 0===t.tension&&void 0===t.friction&&void 0===t.stiffness&&void 0===t.damping&&void 0===t.mass,'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');var b=e.default.fromBouncinessAndSpeed(null!==(T=t.bounciness)&&void 0!==T?T:8,null!==(y=t.speed)&&void 0!==y?y:12);this._stiffness=b.stiffness,this._damping=b.damping,this._mass=1}else{var M,P,D=e.default.fromOrigamiTensionAndFriction(null!==(M=t.tension)&&void 0!==M?M:40,null!==(P=t.friction)&&void 0!==P?P:7);this._stiffness=D.stiffness,this._damping=D.damping,this._mass=1}(0,n.default)(this._stiffness>0,'Stiffness value must be greater than 0'),(0,n.default)(this._damping>0,'Damping value must be greater than 0'),(0,n.default)(this._mass>0,'Mass value must be greater than 0')}__getNativeAnimationConfig(){var t;return{type:'spring',overshootClamping:this._overshootClamping,restDisplacementThreshold:this._restDisplacementThreshold,restSpeedThreshold:this._restSpeedThreshold,stiffness:this._stiffness,damping:this._damping,mass:this._mass,initialVelocity:null!==(t=this._initialVelocity)&&void 0!==t?t:this._lastVelocity,toValue:this._toValue,iterations:this.__iterations,platformConfig:this._platformConfig}}start(t,s,e,n,o){if(this.__active=!0,this._startPosition=t,this._lastPosition=this._startPosition,this._onUpdate=s,this.__onEnd=e,this._lastTime=Date.now(),this._frameTime=0,n instanceof h){var l=n.getInternalState();this._lastPosition=l.lastPosition,this._lastVelocity=l.lastVelocity,this._initialVelocity=this._lastVelocity,this._lastTime=l.lastTime}var _=()=>{this._useNativeDriver?this.__startNativeAnimation(o):this.onUpdate()};this._delay?this._timeout=setTimeout(_,this._delay):_()}getInternalState(){return{lastPosition:this._lastPosition,lastVelocity:this._lastVelocity,lastTime:this._lastTime}}
397onUpdate(){var t=Date.now();t>this._lastTime+64&&(t=this._lastTime+64);var s=(t-this._lastTime)/1e3;this._frameTime+=s;var e=this._damping,n=this._mass,o=this._stiffness,h=-this._initialVelocity,l=e/(2*Math.sqrt(o*n)),_=Math.sqrt(o/n),f=_*Math.sqrt(1-l*l),u=this._toValue-this._startPosition,m=0,v=0,c=this._frameTime;if(l<1){var p=Math.exp(-l*_*c);m=this._toValue-p*((h+l*_*u)/f*Math.sin(f*c)+u*Math.cos(f*c)),v=l*_*p*(Math.sin(f*c)*(h+l*_*u)/f+u*Math.cos(f*c))-p*(Math.cos(f*c)*(h+l*_*u)-f*u*Math.sin(f*c))}else{var V=Math.exp(-_*c);m=this._toValue-V*(u+(h+_*u)*c),v=V*(h*(c*_-1)+c*u*(_*_))}if(this._lastTime=t,this._lastPosition=m,this._lastVelocity=v,this._onUpdate(m),this.__active){var T=!1;this._overshootClamping&&0!==this._stiffness&&(T=this._startPosition<this._toValue?m>this._toValue:m<this._toValue);var y=Math.abs(v)<=this._restSpeedThreshold,b=!0;if(0!==this._stiffness&&(b=Math.abs(this._toValue-m)<=this._restDisplacementThreshold),T||y&&b)return 0!==this._stiffness&&(this._lastPosition=this._toValue,this._lastVelocity=0,this._onUpdate(this._toValue)),void this.__debouncedOnEnd({finished:!0});this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this))}}stop(){super.stop(),this.__active=!1,clearTimeout(this._timeout),g.cancelAnimationFrame(this._animationFrame),this.__debouncedOnEnd({finished:!1})}}var l=h},341,[340,342,108,308,343]); 398__d(function(g,r,i,a,m,e,d){'use strict';function n(n){return 3.62*(n-30)+194}function t(n){return 3*(n-8)+25}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var u={fromOrigamiTensionAndFriction:function(u,o){return{stiffness:n(u),damping:t(o)}},fromBouncinessAndSpeed:function(u,o){function f(n,t,u){return(n-t)/(u-t)}function c(n,t,u){return t+n*(u-t)}function s(n,t,u){return n*u+(1-n)*t}function p(n){return 44e-6*Math.pow(n,3)-.006*Math.pow(n,2)+.36*n+2}function M(n){return 45e-8*Math.pow(n,3)-332e-6*Math.pow(n,2)+.1078*n+5.84}var h=f(u/1.7,0,20);h=c(h,0,.8);var w,l,v,_,b=c(f(o/1.7,0,20),.5,200),O=(w=h,l=(v=b)<=18?(_=v,7e-4*Math.pow(_,3)-.031
398*Math.pow(_,2)+.64*_+1.28):v>18&&v<=44?p(v):M(v),s(2*w-w*w,l,.01));return{stiffness:n(b),damping:t(O)}}}},342,[]); 399__d(function(_g,_r,i,_a,m,_e,d){'use strict';function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var e=t(_r(d[0])),s=t(_r(d[1])),a=t(_r(d[2])),r=t(_r(d[3])).default.API,n={r:0,g:0,b:0,a:1},h=1;function l(t){if(null==t)return null;if(_(t))return t;var e=(0,a.default)(t);if(null==e)return null;if('object'==typeof e){if(null!=e)return e}else if('number'==typeof e){return{r:(4278190080&e)>>>24,g:(16711680&e)>>>16,b:(65280&e)>>>8,a:(255&e)/255}}return null}function _(t){return t&&'number'==typeof t.r&&'number'==typeof t.g&&'number'==typeof t.b&&'number'==typeof t.a}function o(t){return t&&t.r instanceof e.default&&t.g instanceof e.default&&t.b instanceof e.default&&t.a instanceof e.default}class f extends s.default{constructor(t,s){super(),this._listeners={};var a=null!=t?t:n;if(o(a)){var r=a;this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a}else{var h,f=null!==(h=l(a))&&void 0!==h?h:n,u=n;_(f)?u=f:this.nativeColor=f,this.r=new e.default(u.r),this.g=new e.default(u.g),this.b=new e.default(u.b),this.a=new e.default(u.a)}(this.nativeColor||s&&s.useNativeDriver)&&this.__makeNative()}setValue(t){var e,s=!1;if(this.__isNative){var a=this.__getNativeTag();r.setWaitingForIdentifier(a.toString())}var h=null!==(e=l(t))&&void 0!==e?e:n;if(_(h)){var o=h;this.r.setValue(o.r),this.g.setValue(o.g),this.b.setValue(o.b),this.a.setValue(o.a),null!=this.nativeColor&&(this.nativeColor=null,s=!0)}else{var f=h;this.nativeColor!==f&&(this.nativeColor=f,s=!0)}if(this.__isNative){var u=this.__getNativeTag();s&&r.updateAnimatedNodeConfig(u,this.__getNativeConfig()),r.unsetWaitingForIdentifier(u.toString())}}setOffset(t){this.r.setOffset(t.r),this.g.setOffset(t.g),this.b.setOffset(t.b),this.a.setOffset(t.a)}flattenOffset(){this.r.flattenOffset(),this.g.flattenOffset(),this.b.flattenOffset(),this.a.flattenOffset()}extractOffset(){this.r.extractOffset(),this.g.extractOffset(),this.b.extractOffset(),this.a.extractOffset()}addListener(t){var e=String(h++),s=e=>{e.value;t(this.__getValue())};return this._listeners[e]={r:this.r.addListener(s),g:this.g.addListener(s),b:this.b.addListener(s),a:this.a.addListener(s)},e}removeListener(t){this.r.removeListener(this._listeners[t].r),this.g.removeListener(this._listeners[t].g),this.b.removeListener(this._listeners[t].b),this.a.removeListener(this._listeners[t].a),delete this._listeners[t]}removeAllListeners(){this.r.removeAllListeners(),this.g.removeAllListeners(),this.b.removeAllListeners(),this.a.removeAllListeners(),this._listeners={}}stopAnimation(t){this.r.stopAnimation(),this.g.stopAnimation(),this.b.stopAnimation(),this.a.stopAnimation(),t&&t(this.__getValue())}resetAnimation(t){this.r.resetAnimation(),this.g.resetAnimation(),this.b.resetAnimation(),this.a.resetAnimation(),t&&t(this.__getValue())}__getValue(){return null!=this.nativeColor?this.nativeColor:"rgba("+this.r.__getValue()+", "+this.g.__getValue()+", "+this.b.__getValue()+", "+this.a.__getValue()+")"}__attach(){this.r.__addChild(this),this.g.__addChild(this),this.b.__addChild(this),this.a.__addChild(this),super.__attach()}__detach(){this.r.__removeChild(this),this.g.__removeChild(this),this.b.__removeChild(this),this.a.__removeChild(this),super.__detach()}__makeNative(t){this.r.__makeNative(t),this.g.__makeNative(t),this.b.__makeNative(t),this.a.__makeNative(t),super.__makeNative(t)}__getNativeConfig(){return{type:'color',r:this.r.__getNativeTag(),g:this.g.__getNativeTag(),b:this.b.__getNativeTag(),a:this.a.__getNativeTag(),nativeColor:this.nativeColor}}}},343,[304,306,34,308]); 400__d(function(g,r,i,a,m,_e,d){'use strict';function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}}),r(d[0]),r(d[1]),r(d[2]);var e,s=t(r(d[3])),n=t(r(d[4])),o=r(d[5]);r(d[6]);class _ extends n.default{constructor(t){var n,_,h,u,l;super(),this._toValue=t.toValue,this._easing=null!==(n=t.easing)&&void 0!==n?n:(e||(e=s.default.inOut(s.default.ease)),e),this._duration=null!==(_=t.duration)&&void 0!==_?_:500,this._delay=null!==(h=t.delay)&&void 0!==h?h:0,this.__iterations=null!==(u=t.iterations)&&void 0!==u?u:1,this._useNativeDriver=(0,o.shouldUseNativeDriver)(t),this._platformConfig=t.platformConfig,this.__isInteraction=null!==(l=t.isInteraction)&&void 0!==l?l:!this._useNativeDriver}__getNativeAnimationConfig(){for(var t=[],e=Math.round(this._duration/16.666666666666668),s=0;s<e;s++)t.push(this._easing(s/e));return t.push(this._easing(1)),{type:'frames',frames:t,toValue:this._toValue,iterations:this.__iterations,platformConfig:this._platformConfig}}start(t,e,s,n,o){this.__active=!0,this._fromValue=t,this._onUpdate=e,this.__onEnd=s;var _=()=>{0!==this._duration||this._useNativeDriver?(this._startTime=Date.now(),this._useNativeDriver?this.__startNativeAnimation(o):this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this))):(this._onUpdate(this._toValue),this.__debouncedOnEnd({finished:!0}))};this._delay?this._timeout=setTimeout(_,this._delay):_()}onUpdate(){var t=Date.now();if(t>=this._startTime+this._duration)return 0===this._duration?this._onUpdate(this._toValue):this._onUpdate(this._fromValue+this._easing(1)*(this._toValue-this._fromValue)),void this.__debouncedOnEnd({finished:!0});this._onUpdate(this._fromValue+this._easing((t-this._startTime)/this._duration)*(this._toValue-this._fromValue)),this.__active&&(this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this)))}stop(){super.stop(),this.__active=!1,clearTimeout(this._timeout),g.cancelAnimationFrame(this._animationFrame),this.__debouncedOnEnd({finished:!1})}}var h=_},344,[304,338,305,345,340,308,343]); 401__d(function(g,r,i,a,m,_e,d){"use strict";
401Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},345,[346]); 402__d(function(g,r,i,a,m,_e,d){'use strict';Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}});var t,e,u=r(d[0]),c=(t=u)&&t.__esModule?t:{default:t};class n{static step0(t){return t>0?1:0}static step1(t){return t>=1?1:0}static linear(t){return t}static ease(t){return e||(e=n.bezier(.42,0,1,1)),e(t)}static quad(t){return t*t}static cubic(t){return t*t*t}static poly(t){return e=>Math.pow(e,t)}static sin(t){return 1-Math.cos(t*Math.PI/2)}static circle(t){return 1-Math.sqrt(1-t*t)}static exp(t){return Math.pow(2,10*(t-1))}static elastic(t){void 0===t&&(t=1);var e=t*Math.PI;return t=>1-Math.pow(Math.cos(t*Math.PI/2),3)*Math.cos(t*e)}static back(t){return void 0===t&&(t=1.70158),e=>e*e*((t+1)*e-t)}static bounce(t){if(t<.36363636363636365)return 7.5625*t*t;if(t<.7272727272727273){var e=t-.5454545454545454;return 7.5625*e*e+.75}if(t<.9090909090909091){var u=t-.8181818181818182;return 7.5625*u*u+.9375}var c=t-.9545454545454546;return 7.5625*c*c+.984375}static bezier(t,e,u,n){return(0,c.default)(t,e,u,n)}static in(t){return t}static out(t){return e=>1-t(1-e)}static inOut(t){return e=>e<.5?t(2*e)/2:1-t(2*(1-e))/2}}var s=n},346,[347]); 403__d(function(g,r,_i,a,m,e,d){ 404/** 405 * BezierEasing - use bezier curve for transition easing function 406 * https://github.com/gre/bezier-easing 407 * @copyright 2014-2015 Gaëtan Renaudeau. MIT License. 408 */ 409'use strict';Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return h}});var n=4,t=.001,u=1e-7,o=10,f=11,i=.1,c='function'==typeof Float32Array;function v(n,t){return 1-3*t+3*n}function l(n,t){return 3*t-6*n}function b(n){return 3*n}
409function s(n,t,u){return((v(t,u)*n+l(t,u))*n+b(t))*n}function y(n,t,u){return 3*v(t,u)*n*n+2*l(t,u)*n+b(t)}function w(n,t,f,i,c){var v,l,b=0,y=t,w=f;do{(v=s(l=y+(w-y)/2,i,c)-n)>0?w=l:y=l}while(Math.abs(v)>u&&++b<o);return l}function _(t,u,o,f){for(var i=u,c=0;c<n;++c){var v=y(i,o,f);if(0===v)return i;i-=(s(i,o,f)-t)/v}return i}function h(n,u,o,v){if(!(n>=0&&n<=1&&o>=0&&o<=1))throw new Error('bezier x values must be in [0, 1] range');var l=c?new Float32Array(f):new Array(f);if(n!==u||o!==v)for(var b=0;b<f;++b)l[b]=s(b*i,n,o);function h(u){for(var f=0,c=1;10!==c&&l[c]<=u;++c)f+=i;--c;var v=f+(u-l[c])/(l[c+1]-l[c])*i,b=y(v,n,o);return b>=t?_(u,v,n,o):0===b?v:w(u,f,f+i,n,o)}return function(t){return n===u&&o===v?t:0===t?0:1===t?1:s(h(t),u,v)}}},347,[]); 410__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var e,t=r(d[0]);var n=((e=t)&&e.__esModule?e:{default:e}).default&&null!=window.matchMedia?window.matchMedia('(prefers-color-scheme: dark)'):null,l=new WeakMap,o={getColorScheme:()=>n&&n.matches?'dark':'light',addChangeListener(e){var t=l.get(e);return t||(t=t=>{var n=t.matches;e({colorScheme:n?'dark':'light'})},l.set(e,t)),n&&n.addListener(t),{remove:function(){var t=l.get(e);n&&t&&n.removeListener(t),l.delete(e)}}}}},348,[35]); 411__d(function(g,r,i,a,m,e,d){"use strict";function t(){}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var n={exitApp:t,addEventListener:()=>({remove:t}),removeEventListener:t}},349,[]); 412__d(function(g,r,i,a,m,_e,d){"use strict";var e;Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return t}});class t{static isAvailable(){return void 0===e&&(e='function'==typeof document.queryCommandSupported&&document.queryCommandSupported('copy')),e}static getString(){return Promise.resolve('')}static setString(e){var t=!1,n=document.body;if(n){var o=document.createElement('span');o.textContent=e,o.style.opacity='0',o.style.position='absolute',o.style.whiteSpace='pre-wrap',o.style.userSelect='auto',n.appendChild(o);var c=window.getSelection();c.removeAllRanges();var u=document.createRange();u.selectNodeContents(o),c.addRange(u);try{document.execCommand('copy'),t=!0}catch(e){}c.removeAllRanges(),n.removeChild(o)}return t}}},350,[]); 413__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t={allowRTL(){},forceRTL(){},getConstants:()=>({isRTL:!1})}},351,[]); 414__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var e,t=r(d[0]),s=(e=t)&&e.__esModule?e:{default:e},n={isVisible:()=>!1,addListener:()=>({remove:()=>{}}),dismiss(){(0,s.default)()},removeAllListeners(){},removeListener(){}}},352,[279]); 415__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},353,[354]); 416__d(function(g,r,i,a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}});var t=e(r(d[0])),n=e(r(d[1]));function s(e,s){t.default.isTesting||n.default.configureNextLayoutAnimation(e,null!=s?s:function(){},function(){})}function u(e,t,n){return{duration:e,create:{type:t,property:n},update:{type:t},delete:{type:t,property:n}}}var o={easeInEaseOut:u(300,'easeInEaseOut','opacity'),linear:u(500,'linear','opacity'),spring:{duration:700,create:{type:'linear',property:'opacity'},update:{type:'spring',springDamping:.4},delete:{type:'linear',property:'opacity'}}},c={configureNext:s,create:u,Types:Object.freeze({spring:'spring',linear:'linear',easeInEaseOut:'easeInEaseOut',easeIn:'easeIn',easeOut:'easeOut',keyboard:'keyboard'}),Properties:Object.freeze({opacity:'opacity',scaleX:'scaleX',scaleY:'scaleY',scaleXY:'scaleXY'}),checkConfig(){console.error('LayoutAnimation.checkConfig(...) has been disabled.')},Presets:o,easeInEaseOut:s.bind(null,o.easeInEaseOut),linear:s.bind(null,o.linear),spring:s.bind(null,o.spring)}},354,[136,88]); 417__d(function(g,r,i,a,m,_e,d){"use strict";
417Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},355,[356]); 418__d(function(g,r,i,a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return T}});var o=e(r(d[0])),n=e(r(d[1])),t=n.default.currentCentroidXOfTouchesChangedAfter,u=n.default.currentCentroidYOfTouchesChangedAfter,s=n.default.previousCentroidXOfTouchesChangedAfter,c=n.default.previousCentroidYOfTouchesChangedAfter,l=n.default.currentCentroidX,p=n.default.currentCentroidY,v={_initializeGestureState(e){e.moveX=0,e.moveY=0,e.x0=0,e.y0=0,e.dx=0,e.dy=0,e.vx=0,e.vy=0,e.numberActiveTouches=0,e._accountsForMovesUpTo=0},_updateGestureStateOnMove(e,o){e.numberActiveTouches=o.numberActiveTouches,e.moveX=t(o,e._accountsForMovesUpTo),e.moveY=u(o,e._accountsForMovesUpTo);var n=e._accountsForMovesUpTo,l=s(o,n),p=t(o,n),v=c(o,n),h=u(o,n),S=e.dx+(p-l),R=e.dy+(h-v),T=o.mostRecentTimeStamp-e._accountsForMovesUpTo;e.vx=(S-e.dx)/T,e.vy=(R-e.dy)/T,e.dx=S,e.dy=R,e._accountsForMovesUpTo=o.mostRecentTimeStamp},create(e){var n={handle:null,shouldCancelClick:!1,timeout:null},t={stateID:Math.random(),moveX:0,moveY:0,x0:0,y0:0,dx:0,dy:0,vx:0,vy:0,numberActiveTouches:0,_accountsForMovesUpTo:0};return{panHandlers:{onStartShouldSetResponder:o=>null!=e.onStartShouldSetPanResponder&&e.onStartShouldSetPanResponder(o,t),onMoveShouldSetResponder:o=>null!=e.onMoveShouldSetPanResponder&&e.onMoveShouldSetPanResponder(o,t),onStartShouldSetResponderCapture:o=>(1===o.nativeEvent.touches.length&&v._initializeGestureState(t),t.numberActiveTouches=o.touchHistory.numberActiveTouches,null!=e.onStartShouldSetPanResponderCapture&&e.onStart
418ShouldSetPanResponderCapture(o,t)),onMoveShouldSetResponderCapture(o){var n=o.touchHistory;return t._accountsForMovesUpTo!==n.mostRecentTimeStamp&&(v._updateGestureStateOnMove(t,n),!!e.onMoveShouldSetPanResponderCapture&&e.onMoveShouldSetPanResponderCapture(o,t))},onResponderGrant:u=>(n.handle||(n.handle=o.default.createInteractionHandle()),n.timeout&&S(n),n.shouldCancelClick=!0,t.x0=l(u.touchHistory),t.y0=p(u.touchHistory),t.dx=0,t.dy=0,e.onPanResponderGrant&&e.onPanResponderGrant(u,t),null==e.onShouldBlockNativeResponder||e.onShouldBlockNativeResponder(u,t)),onResponderReject(o){h(n,e.onPanResponderReject,o,t)},onResponderRelease(o){h(n,e.onPanResponderRelease,o,t),R(n),v._initializeGestureState(t)},onResponderStart(o){var n=o.touchHistory;t.numberActiveTouches=n.numberActiveTouches,e.onPanResponderStart&&e.onPanResponderStart(o,t)},onResponderMove(o){var n=o.touchHistory;t._accountsForMovesUpTo!==n.mostRecentTimeStamp&&(v._updateGestureStateOnMove(t,n),e.onPanResponderMove&&e.onPanResponderMove(o,t))},onResponderEnd(o){var u=o.touchHistory;t.numberActiveTouches=u.numberActiveTouches,h(n,e.onPanResponderEnd,o,t)},onResponderTerminate(o){h(n,e.onPanResponderTerminate,o,t),R(n),v._initializeGestureState(t)},onResponderTerminationRequest:o=>null==e.onPanResponderTerminationRequest||e.onPanResponderTerminationRequest(o,t),onClickCapture:e=>{!0===n.shouldCancelClick&&(e.stopPropagation(),e.preventDefault())}},getInteractionHandle:()=>n.handle}}};function h(e,n,t,u){e.handle&&(o.default.clearInteractionHandle(e.handle),e.handle=null),n&&n(t,u)}function S(e){clearTimeout(e.timeout)}function R(e){e.timeout=setTimeout(()=>{e.shouldCancelClick=!1},250)}var T=v},356,[285,357]); 419__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var n={centroidDimension:function(t,i,o,u){var c=t.touchBank,f=0,s=0,h=1===t.numberActiveTouches?t.touchBank[t.indexOfSingleActiveTouch]:null;if(null!==h)h.touchActive&&h.currentTimeStamp>i&&(f+=u&&o?h.currentPageX:u&&!o?h.currentPageY:!u&&o?h.previousPageX:h.previousPageY,s=1);else for(var v=0;v<c.length;v++){var l=c[v];if(null!=l&&l.touchActive&&l.currentTimeStamp>=i){f+=u&&o?l.currentPageX:u&&!o?l.currentPageY:!u&&o?l.previousPageX:l.previousPageY,s++}}return s>0?f/s:n.noCentroid},currentCentroidXOfTouchesChangedAfter:function(t,i){return n.centroidDimension(t,i,!0,!0)},currentCentroidYOfTouchesChangedAfter:function(t,i){return n.centroidDimension(t,i,!1,!0)},previousCentroidXOfTouchesChangedAfter:function(t,i){return n.centroidDimension(t,i,!0,!1)},previousCentroidYOfTouchesChangedAfter:function(t,i){return n.centroidDimension(t,i,!1,!1)},currentCentroidX:function(t){return n.centroidDimension(t,0,!0,!0)},currentCentroidY:function(t){return n.centroidDimension(t,0,!1,!0)},noCentroid:-1},t=n},357,[]); 420__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var e,t=r(d[0]),s=(e=t)&&e.__esModule?e:{default:e};var o=class{static share(e,t){return void 0===t&&(t={}),(0,s.default)('object'==typeof e&&null!==e,'Content to share must be a valid object'),(0,s.default)('string'==typeof e.url||'string'==typeof e.message,'At least one of URL and message is required'),(0,s.default)('object'==typeof t&&null!==t,'Options must be a valid object'),(0,s.default)(!e.title||'string'==typeof e.title,'Invalid title: title should be a string.'),void 0!==window.navigator.share?window.navigator.share({title:e.title,text:e.message,url:e.url}):Promise.reject(new Error('Share is not supported in this browser'))}static get sharedAction(){return'sharedAction'}static get dismissedAction(){return'dismissedAction'}}},358,[108]); 421__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var t=t=>{'vibrate'in window.navigator&&window.navigator.vibrate(t)}
421,n={cancel(){t(0)},vibrate(n){void 0===n&&(n=400),t(n)}}},359,[]); 422__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return y}});var t=e(r(_d[0])),n=e(r(_d[1])),o=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[2])),l=e(r(_d[3])),d=e(r(_d[4])),s=["animating","color","hidesWhenStopped","size","style"],u=e=>o.createElement("circle",{cx:"16",cy:"16",fill:"none",r:"14",strokeWidth:"4",style:e}),c=o.forwardRef((e,l)=>{var c=e.animating,y=void 0===c||c,p=e.color,v=void 0===p?'#1976D2':p,b=e.hidesWhenStopped,_=void 0===b||b,w=e.size,P=void 0===w?'small':w,j=e.style,k=(0,n.default)(e,s),O=o.createElement("svg",{height:"100%",viewBox:"0 0 32 32",width:"100%"},u({stroke:v,opacity:.2}),u({stroke:v,strokeDasharray:80,strokeDashoffset:60}));return o.createElement(d.default,(0,t.default)({},k,{"aria-valuemax":1,"aria-valuemin":0,ref:l,role:"progressbar",style:[f.container,j]}),o.createElement(d.default,{children:O,style:['number'==typeof P?{height:P,width:P}:h[P],f.animation,!y&&f.animationPause,!y&&_&&f.hidesWhenStopped]}))});c.displayName='ActivityIndicator';var f=l.default.create({container:{alignItems:'center',justifyContent:'center'},hidesWhenStopped:{visibility:'hidden'},animation:{animationDuration:'0.75s',animationKeyframes:[{'0%':{transform:'rotate(0deg)'},'100%':{transform:'rotate(360deg)'}}],animationTimingFunction:'linear',animationIterationCount:'infinite'},animationPause:{animationPlayState:'paused'}}),h=l.default.create({small:{width:20,height:20},large:{width:36,height:36}}),y=c},360,[232,14,11,26,13]); 423__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}});var t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}),t.default=e,t})(r(_d[0])),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),u=t.forwardRef((e,o)=>{var u=e.accessibilityLabel,c=e.color,s=e.disabled,f=e.onPress,b=e.testID,y=e.title;return t.createElement(n.default,{accessibilityLabel:u,accessibilityRole:"button",disabled:s,focusable:!s,onPress:f,ref:o,style:[d.button,c&&{backgroundColor:c},s&&d.buttonDisabled],testID:b},t.createElement(l.default,{style:[d.text,s&&d.textDisabled]},y))});u.displayName='Button';var d=o.default.create({button:{backgroundColor:'#2196F3',borderRadius:2},text:{color:'#fff',fontWeight:'500',padding:8,textAlign:'center',textTransform:'uppercase'},buttonDisabled:{backgroundColor:'#dfdfdf'},textDisabled:{color:'#a1a1a1'}}),c=u},361,[11,26,362,327]); 424__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}});var t=e(r(_d[0])),n=e(r(_d[1])),s=r(_d[2]),o=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(s),l=e(r(_d[3])),u=e(r(_d[4])),c=e(r(_d[5])),d=e(r(_d[6])),f=["activeOpacity","delayPressIn","delayPressOut","delayLongPress","disabled","focusable","onLongPress","onPress","onPressIn","onPressOut","rejectResponderTermination","style"];function y(e,c){var y=e.activeOpacity,b=e.delayPressIn,p=e.delayPressOut,O=e.delayLongPress,v=e.disabled,_=e.focusable,j=e.onLongPress,L=e.onPress,h=e.onPressIn,k=e.onPressOut,C=e.rejectResponderTermination,E=e.style,R=(0,n.default)(e,f),S=(0,s.useRef)(null),D=(0,l.default)(c,S),I=(0,s.useState)('0s'),M=I[0],w=I[1],T=(0,s.use
424State)(null),N=T[0],x=T[1],A=(0,s.useCallback)((e,t)=>{x(e),w(t?t/1e3+"s":'0s')},[x,w]),G=(0,s.useCallback)(e=>{A(null!=y?y:.2,e)},[y,A]),q=(0,s.useCallback)(e=>{A(null,e)},[A]),z=(0,s.useMemo)(()=>({cancelable:!C,disabled:v,delayLongPress:O,delayPressStart:b,delayPressEnd:p,onLongPress:j,onPress:L,onPressStart(e){var t=null!=e.dispatchConfig?'onResponderGrant'===e.dispatchConfig.registrationName:'keydown'===e.type;G(t?0:150),null!=h&&h(e)},onPressEnd(e){q(250),null!=k&&k(e)}}),[O,b,p,v,j,L,h,k,C,G,q]),B=(0,u.default)(S,z);return o.createElement(d.default,(0,t.default)({},R,B,{accessibilityDisabled:v,focusable:!v&&!1!==_,pointerEvents:v?'box-none':void 0,ref:D,style:[P.root,!v&&P.actionable,E,null!=N&&{opacity:N},{transitionDuration:M}]}))}var P=c.default.create({root:{transitionProperty:'opacity',transitionDuration:'0.15s',userSelect:'none'},actionable:{cursor:'pointer',touchAction:'manipulation'}}),b=o.memo(o.forwardRef(y));b.displayName='TouchableOpacity';var p=b},362,[232,14,11,93,363,26,13]); 425__d(function(g,r,i,a,m,_e,d){'use strict';Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var e,u=r(d[0]),t=(e=u)&&e.__esModule?e:{default:e},n=r(d[1]);function f(e,u){var f=(0,n.useRef)(null);null==f.current&&(f.current=new t.default(u));var l=f.current;return(0,n.useEffect)(()=>{l.configure(u)},[u,l]),(0,n.useEffect)(()=>()=>{l.reset()},[l]),(0,n.useDebugValue)(u),l.getEventHandlers()}},363,[364,11]); 426__d(function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return N}});var t='DELAY',s='ERROR',n='LONG_PRESS_DETECTED',o='NOT_RESPONDER',l='RESPONDER_ACTIVE_LONG_PRESS_START',_='RESPONDER_ACTIVE_PRESS_START',E='RESPONDER_INACTIVE_PRESS_START',u='RESPONDER_RELEASE',h='RESPONDER_TERMINATED',c=Object.freeze({NOT_RESPONDER:{DELAY:s,RESPONDER_GRANT:E,RESPONDER_RELEASE:s,RESPONDER_TERMINATED:s,LONG_PRESS_DETECTED:s},RESPONDER_INACTIVE_PRESS_START:{DELAY:_,RESPONDER_GRANT:s,RESPONDER_RELEASE:o,RESPONDER_TERMINATED:o,LONG_PRESS_DETECTED:s},RESPONDER_ACTIVE_PRESS_START:{DELAY:s,RESPONDER_GRANT:s,RESPONDER_RELEASE:o,RESPONDER_TERMINATED:o,LONG_PRESS_DETECTED:l},RESPONDER_ACTIVE_LONG_PRESS_START:{DELAY:s,RESPONDER_GRANT:s,RESPONDER_RELEASE:o,RESPONDER_TERMINATED:o,LONG_PRESS_DETECTED:l},ERROR:{DELAY:o,RESPONDER_GRANT:E,RESPONDER_RELEASE:o,RESPONDER_TERMINATED:o,LONG_PRESS_DETECTED:o}}),R=t=>t.getAttribute('role'),T=t=>t.tagName.toLowerCase(),P=t=>t===_||t===l,S=t=>'button'===R(t),D=t=>t===E||t===_||t===l,v=t=>t===h||t===u,p=t=>{var s=t.key,n=t.target,o=' '===s||'Spacebar'===s,l='button'===T(n)||S(n);return'Enter'===s||o&&l};class N{constructor(t){this._eventHandlers=null,this._isPointerTouch=!1,this._longPressDelayTimeout=null,this._longPressDispatched=!1,this._pressDelayTimeout=null,this._pressOutDelayTimeout=null,this._touchState=o,this._responderElement=null,this.configure(t)}configure(t){this._config=t}reset(){this._cancelLongPressDelayTimeout(),this._cancelPressDelayTimeout(),this._cancelPressOutDelayTimeout()}getEventHandlers(){return null==this._eventHandlers&&(this._eventHandlers=this._createEventHandlers()),this._eventHandlers}_createEventHandlers(){var s=(s,n)=>{s.persist(),this._cancelPressOutDelayTimeout(),this._longPressDispatched=!1,this._selectionTerminated=!1,this._touchState=o,this._isPointerTouch='touchstart'===s.nativeEvent.type,this._receiveSignal("RESPONDER_GRANT",s);var l=O(this._config.delayPressStart,0,50);!1!==n&&l>0?this._pressDelayTimeout=setTimeout(()=>{this._receiveSignal(t,s)},l):this._receiveSignal(t,s);var _=O(this._config.delayLongPress,10,450);this._longPressDelayTimeout=setTimeout(()=>{this._handleLongPress(s)},_+l)},n=t=>{this._receiveSignal(u,t)},l=t=>{var s=this._config.onPress,_=t.target;if(this._touchState!==o&&p(t)){n(t),document.removeEventListener('keyup',l);var E=_.getAttribute('role'),u=T(_),h='link'===E||'a'===u||'button'===u||'input'===u||'select'===u||'textarea'===u,c=this._responderElement===_;null!=s&&!h&&c&&s(t),this._responderElement=null}};
426return{onStartShouldSetResponder:t=>{var s=this._config.disabled;return s&&S(t.currentTarget)&&t.stopPropagation(),null==s||!s},onKeyDown:t=>{var n=this._config.disabled,_=t.key,E=t.target;if(!n&&p(t)){this._touchState===o&&(s(t,!1),this._responderElement=E,document.addEventListener('keyup',l));var u=' '===_||'Spacebar'===_,h=R(E);u&&('button'===h||'menuitem'===h)&&'button'!==T(E)&&t.preventDefault(),t.stopPropagation()}},onResponderGrant:t=>s(t),onResponderMove:t=>{null!=this._config.onPressMove&&this._config.onPressMove(t);var s=f(t);if(null!=this._touchActivatePosition){var n=this._touchActivatePosition.pageX-s.pageX,o=this._touchActivatePosition.pageY-s.pageY;Math.hypot(n,o)>10&&this._cancelLongPressDelayTimeout()}},onResponderRelease:t=>n(t),onResponderTerminate:t=>{'selectionchange'===t.nativeEvent.type&&(this._selectionTerminated=!0),this._receiveSignal(h,t)},onResponderTerminationRequest:t=>{var s=this._config,n=s.cancelable,o=s.disabled,l=s.onLongPress;return!(!o&&null!=l&&this._isPointerTouch&&'contextmenu'===t.nativeEvent.type)&&(null==n||n)},onClick:t=>{var s=this._config,n=s.disabled,o=s.onPress;n?S(t.currentTarget)&&t.stopPropagation():(t.stopPropagation(),this._longPressDispatched||this._selectionTerminated?t.preventDefault():null!=o&&!1===t.altKey&&o(t))},onContextMenu:t=>{var s=this._config,n=s.disabled,o=s.onLongPress;n?S(t.currentTarget)&&t.stopPropagation():null!=o&&this._isPointerTouch&&!t.defaultPrevented&&(t.preventDefault(),t.stopPropagation())}}}_receiveSignal(t,n){var l=this._touchState,_=null;null!=c[l]&&(_=c[l][t]),this._touchState===o&&t===u||(null==_||_===s?console.error("PressResponder: Invalid signal "+t+" for state "+l+" on responder"):l!==_&&(this._performTransitionSideEffects(l,_,t,n),this._touchState=_))}_performTransitionSideEffects(t,s,o,_){if(v(o)&&(setTimeout(()=>{this._isPointerTouch=!1},0),this._touchActivatePosition=null,this._cancelLongPressDelayTimeout()),D(t)&&o===n){var E=this._config.onLongPress;null!=E&&null==_.nativeEvent.key&&(E(_),this._longPressDispatched=!0)}var h=P(t),c=P(s);if(!h&&c?this._activate(_):h&&!c&&this._deactivate(_),D(t)&&o===u){var R=this._config,T=R.onLongPress;if(null!=R.onPress)null!=T&&t===l||c||h||(this._activate(_),this._deactivate(_))}this._cancelPressDelayTimeout()}_activate(t){var s=this._config,n=s.onPressChange,o=s.onPressStart,l=f(t);this._touchActivatePosition={pageX:l.pageX,pageY:l.pageY},null!=o&&o(t),null!=n&&n(!0)}_deactivate(t){var s=this._config,n=s.onPressChange,o=s.onPressEnd;function l(){null!=o&&o(t),null!=n&&n(!1)}var _=O(this._config.delayPressEnd);_>0?this._pressOutDelayTimeout=setTimeout(()=>{l()},_):l()}_handleLongPress(t){this._touchState!==_&&this._touchState!==l||this._receiveSignal(n,t)}_cancelLongPressDelayTimeout(){null!=this._longPressDelayTimeout&&(clearTimeout(this._longPressDelayTimeout),this._longPressDelayTimeout=null)}_cancelPressDelayTimeout(){null!=this._pressDelayTimeout&&(clearTimeout(this._pressDelayTimeout),this._pressDelayTimeout=null)}_cancelPressOutDelayTimeout(){null!=this._pressOutDelayTimeout&&(clearTimeout(this._pressOutDelayTimeout),this._pressOutDelayTimeout=null)}}function O(t,s,n){return void 0===s&&(s=0),void 0===n&&(n=0),Math.max(s,null!=t?t:n)}function f(t){var s=t.nativeEvent,n=s.changedTouches,o=s.touches;return null!=o&&o.length>0?o[0]:null!=n&&n.length>0?n[0]:t.nativeEvent}},364,[]); 427__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return y}});var o=e(r(_d[0])),t=e(r(_d[1])),l=e(r(_d[2])),n=(function(e){if(e&&e.__esModule)return e;var o={};return e&&Object.keys(e).forEach(function(t){var l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,l.get?l:{enumerable:!0,get:function(){return e[t]}})}),o.default=e,o})(r(_d[3])),d=e(r(_d[4])),c=e(r(_d[5])),u=e(r(_d[6])),C=["aria-readonly","color","disabled","onChange","onValueChange","readOnly","style","value"],M=n.forwardRef((e,o)=>{var c=e['aria-readonly'],M=e.color,y=e.disabled,I=e.onChange,s=e.onValueChange,f=e.readOnly,v=e.style,h=e.value,k=(0,l.default)(e,C);var j=n.createElement(u.default,{style:[b.fakeControl,h&&b.fakeControlChecked,h&&M&&{backgroundColor:M,borderColor:M},y&&b.fakeControlDisabled,h&&y&&b.fakeControlCheckedAndDisabled]}),z=(0,d.default)('input',{checked:h,disabled:y,onChange:function(e){var o=e.nativeEvent.target.checked;e.nativeEvent.value=o,I&&I(e),s&&s(o)},readOnly:!0===f||!0===c||!0===k.accessibilityReadOnly,ref:o,style:[b.nativeControl,b.cursorInherit],type:'checkbox'});return n.createElement(u.default,(0,t.default)({},k,{"aria-disabled":y,"aria-readonly":c,style:[b.root,v,y&&b.cursorDefault]}),j,z)});M.displayName='CheckBox';var b=c.default.create({root:{cursor:'pointer',height:16,userSelect:'none',width:16},cursorDefault:{cursor:'default'},cursorInherit:{cursor:'inherit'},fakeControl:{alignItems:'center',backgroundColor:'#fff',borderColor:'#657786',borderRadius:2,borderStyle:'solid',borderWidth:2,height:'100%',justifyContent:'center',width:'100%'},fakeControlChecked:{backgroundColor:'#009688',backgroundImage:'url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8
427cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K")',backgroundRepeat:'no-repeat',borderColor:'#009688'},fakeControlDisabled:{borderColor:'#CCD6DD'},fakeControlCheckedAndDisabled:{backgroundColor:'#AAB8C2',borderColor:'#AAB8C2'},nativeControl:(0,o.default)((0,o.default)({},c.default.absoluteFillObject),{},{height:'100%',margin:0,appearance:'none',padding:0,width:'100%'})}),y=M},365,[21,232,14,11,15,26,13]); 428__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var t=e(r(_d[0])),n=e(r(_d[1])),l=r(_d[2]),u=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(l),f=e(r(_d[3])),d=e(r(_d[4])),c=e(r(_d[5])),o=["children","style","imageStyle","imageRef"],s={},y=(0,l.forwardRef)((e,l)=>{var y=e.children,h=e.style,b=void 0===h?s:h,_=e.imageStyle,v=e.imageRef,p=(0,n.default)(e,o),O=d.default.flatten(b),j=O.height,w=O.width;return u.createElement(c.default,{ref:l,style:b},u.createElement(f.default,(0,t.default)({},p,{ref:v,style:[{width:w,height:j,zIndex:-1},d.default.absoluteFill,_]})),y)});y.displayName='ImageBackground';var h=y},366,[232,14,11,319,26,13]); 429__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}});var t=e(r(_d[0])),n=e(r(_d[1])),o=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[2])),u=e(r(_d[3])),f=["behavior","contentContainerStyle","keyboardVerticalOffset"];class s extends o.Component{constructor(){super(...arguments),this.frame=null,this.onLayout=e=>{this.frame=e.nativeEvent.layout}}relativeKeyboardHeight(e){var t=this.frame;if(!t||!e)return 0;var n=e.screenY-(this.props.keyboardVerticalOffset||0);return Math.max(t.y+t.height-n,0)}onKeyboardChange(e){}render(){var e=this.props,s=(e.behavior,e.contentContainerStyle,e.keyboardVerticalOffset,(0,n.default)(e,f));return o.createElement(u.default,(0,t.default)({onLayout:this.onLayout},s))}}var c=s},367,[232,14,11,13]); 430__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return _}});var t=e(r(_d[0])),n=e(r(_d[1])),u=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[2])),o=e(r(_d[3])),l=e(r(_d[4])),s=e(r(_d[5])),f=e(r(_d[6])),c=["animationType","children","onDismiss","onRequestClose","onShow","transparent","visible"],d=0,v=[],p={};function b(){if(0!==v.length){var e=v[v.length-1];v.forEach(t=>{t in p&&p[t](t===e)})}}function h(e){e in p&&(p[e](!1),delete p[e]);var t=v.indexOf(e);-1!==t&&(v.splice(t,1),b())}function y(e,t){h(e),v.push(e),p[e]=t,b()}var _=u.forwardRef((e,v)=>{var p=e.animationType,b=e.children,_=e.onDismiss,E=e.onRequestClose,O=e.onShow,j=e.transparent,w=e.visible,C=void 0===w||w,D=(0,n.default)(e,c),M=u.useMemo(()=>d++,[]),P=u.useState(!1),R=P[0],S=P[1],k=u.useCallback(()=>{h(M),_&&_()},[M,_]),q=u.useCallback(()=>{y(M,S),O&&O()},[M,O]);return u.useEffect(()=>()=>h(M),[M]),u.createElement(o.default,null,u.createElement(l.default,{animationType:p,onDismiss:k,onShow:q,visible:C},u.createElement(f.default,{active:R},u.createElement(s.default,(0,t.default)({},D,{active:R,onRequestClose:E,ref:v,transparent:j}),b))))})},368,[232,14,11,369,370,371,372]); 431__d(function(g,r,i,a,m,_e,_d){"use strict";
431Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return d}});var e,t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),n=r(_d[1]),u=r(_d[2]),c=(e=u)&&e.__esModule?e:{default:e};var d=function(e){var u=e.children,d=t.useRef(null);if(c.default&&!d.current){var o=document.createElement('div');o&&document.body&&(document.body.appendChild(o),d.current=o)}return t.useEffect(()=>{if(c.default)return()=>{document.body&&d.current&&(document.body.removeChild(d.current),d.current=null)}},[]),d.current&&c.default?(0,n.createPortal)(u,d.current):null}},369,[11,239,35]); 432__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return y}});var n=(function(e){if(e&&e.__esModule)return e;var n={};return e&&Object.keys(e).forEach(function(t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}),n.default=e,n})(r(_d[0])),t=e(r(_d[1])),o=e(r(_d[2]));function u(e,n){return'slide'===e?n?s:f:'fade'===e?n?d:l:n?c.container:c.hidden}var c=t.default.create({container:{position:'fixed',top:0,right:0,bottom:0,left:0,zIndex:9999},animatedIn:{animationDuration:"250ms",animationTimingFunction:'cubic-bezier(0.215, 0.61, 0.355, 1)'},animatedOut:{pointerEvents:'none',animationDuration:"250ms",animationTimingFunction:'cubic-bezier(0.47, 0, 0.745, 0.715)'},fadeIn:{opacity:1,animationKeyframes:{'0%':{opacity:0},'100%':{opacity:1}}},fadeOut:{opacity:0,animationKeyframes:{'0%':{opacity:1},'100%':{opacity:0}}},slideIn:{transform:'translateY(0%)',animationKeyframes:{'0%':{transform:'translateY(100%)'},'100%':{transform:'translateY(0%)'}}},slideOut:{transform:'translateY(100%)',animationKeyframes:{'0%':{transform:'translateY(0%)'},'100%':{transform:'translateY(100%)'}}},hidden:{opacity:0}}),s=[c.container,c.animatedIn,c.slideIn],f=[c.container,c.animatedOut,c.slideOut],d=[c.container,c.animatedIn,c.fadeIn],l=[c.container,c.animatedOut,c.fadeOut],y=function(e){var t=e.animationType,s=e.children,f=e.onDismiss,d=e.onShow,l=e.visible,y=n.useState(!1),p=y[0],b=y[1],O=n.useRef(!1),v=n.useRef(!1),h=t&&'none'!==t,I=n.useCallback(e=>{e&&e.currentTarget!==e.target||(l?d&&d():b(!1))},[d,l]);return n.useEffect(()=>{v.current&&!p&&f&&f(),v.current=p},[p,f]),n.useEffect(()=>{l&&b(!0),l===O.current||h||I(),O.current=l},[h,l,I]),p||l?(0,o.default)('div',{style:p?u(t,l):c.hidden,onAnimationEnd:I,children:s}):null}},370,[11,26,15]); 433__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}});var t=e(r(_d[0])),n=e(r(_d[1])),o=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[2])),u=e(r(_d[3])),l=e(r(_d[4])),d=e(r(_d[5])),c=["active","children","onRequestClose","transparent"],f=o.forwardRef((e,l)=>{var f=e.active,p=e.children,v=e.onRequestClose,b=e.transparent,y=(0,n.default)(e,c);o.useEffect(()=>{if(d.default){var e=e=>{f&&'Escape'===e.key&&(e.stopPropagation(),v&&v())};return document.addEventListener('keyup',e,!1),()=>document.removeEventListener('keyup',e,!1)}},[f,v]);var O=o.useMemo(()=>[s.modal,b?s.modalTransparent:s.modalOpaque],[b]);return o.createElement(u.default,(0,t.default)({},y,{"aria-modal":!0,ref:l,role:f?'dialog':null,style:O}),o.createElement(u.default,{style:s.container},p))}),s=l.default.create({modal:{position:'fixed',top:0,right:0,bottom:0,left:0},modalTransparent:{backgroundColor:'transparent'},modalOpaque:{backgroundColor:'white'},container:{top:0,flex:1}}),p=f},371,[232,14,11,13,26,35]); 434__d(function(g,r,_i,a,m,_e,_d){"use strict";
434function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return v}});var t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),n=e(r(_d[1])),u=e(r(_d[2])),c=e(r(_d[3])),o=e(r(_d[4])),l=e(r(_d[5])),f=()=>(0,u.default)('div',{role:'none',tabIndex:0,style:E.focusBracket});function s(e){if(!l.default)return!1;try{e.focus()}catch(e){}return document.activeElement===e}function d(e){for(var t=0;t<e.childNodes.length;t++){var n=e.childNodes[t];if(s(n)||d(n))return!0}return!1}function i(e){for(var t=e.childNodes.length-1;t>=0;t--){var n=e.childNodes[t];if(s(n)||i(n))return!0}return!1}var v=e=>{var u=e.active,c=e.children,s=t.useRef(),v=t.useRef({trapFocusInProgress:!1,lastFocusedElement:null});return t.useEffect(()=>{if(l.default){var e=()=>{if(null!=s.current&&!v.current.trapFocusInProgress&&u){try{if(v.current.trapFocusInProgress=!0,document.activeElement instanceof Node&&!s.current.contains(document.activeElement)){var e=d(s.current);v.current.lastFocusedElement===document.activeElement&&(e=i(s.current)),!e&&null!=s.current&&document.activeElement&&o.default.focus(s.current)}}finally{v.current.trapFocusInProgress=!1}v.current.lastFocusedElement=document.activeElement}};return e(),document.addEventListener('focus',e,!0),()=>document.removeEventListener('focus',e,!0)}},[u]),t.useEffect(function(){if(l.default){var e=document.activeElement;return function(){e&&document.contains(e)&&o.default.focus(e)}}},[]),t.createElement(t.Fragment,null,t.createElement(f,null),t.createElement(n.default,{ref:s},c),t.createElement(f,null))},E=c.default.create({focusBracket:{outlineStyle:'none'}})},372,[11,13,15,26,88,35]); 435__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var t=e(r(_d[0])),n=e(r(_d[1])),l=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[2])),u=e(r(_d[3])),d=e(r(_d[4])),f=e(r(_d[5])),o=e(r(_d[6])),c=e(r(_d[7])),s=["children","enabled","onValueChange","selectedValue","style","testID","itemStyle","mode","prompt"],y=l.forwardRef((e,o)=>{var c=e.children,y=e.enabled,b=e.onValueChange,p=e.selectedValue,h=e.style,_=e.testID,O=(e.itemStyle,e.mode,e.prompt,(0,n.default)(e,s)),j=l.useRef(null);var I=(0,t.default)({children:c,disabled:!1===y||void 0,onChange:function(e){var t=e.target,n=t.selectedIndex,l=t.value;b&&b(l,n)},style:[v.initial,h],testID:_,value:p},O),D=(0,f.default)(I),P=(0,d.default)(j,D,o);return I.ref=P,(0,u.default)('select',I)});y.Item=o.default;var v=c.default.create({initial:{fontFamily:'System',fontSize:'inherit',margin:0}}),b=y},373,[21,14,11,15,93,95,374,26]); 436__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),l=(e=t)&&e.__esModule?e:{default:e};function u(e){var t=e.color,u=e.label,n=e.testID,o=e.value,c={color:t};return(0,l.default)('option',{children:u,style:c,testID:n,value:o})}},374,[15]); 437__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return p}});var n=e(r(_d[0])),t=e(r(_d[1])),o=r(_d[2]),s=(function(e){if(e&&e.__esModule)return e;var n={};return e&&Object.keys(e).forEach(function(t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}),n.default=e,n})(o),l=e(r(_d[3])),u=e(r(_d[4])),d=e(r(_d[5])),c=e(r(_d[6])),f=e(r(_d[7])),v=["children","delayLongPress","delayPressIn","delayPressOut","disabled","onBlur","onContextMenu","onFocus","onHoverIn","onHoverOut","onKeyDown","onLongPress","onPress","onPressMove","onPressIn","onPressOut","style","tabIndex","testOnly_hovered","testOnly_pressed"];function P(e,c){var P=e.children,O=e.delayLongPress,p=e.delayPressIn,_=e.delayPressOut,M=e.disabled,C=e.onBlur,h=e.onContextMenu,I=e.onFocus,x=e.onHoverIn,E=e.onHoverOut,H=e.onKeyDown,w=e.onLongPress,L=e.onPress,j=e.onPressMove,k=e.onPressIn,D=e.onPressOut,K=e.style,S=e.tabIndex,B=e.testOnly_hovered,F=e.testOnly_pressed,R=(0,t.default)(e,v),A=y(!0===B),N=A[0],q=A[1],z=y(!1),G=z[0],J=z[1],Q=y(!0===F),T=Q[0],U=Q[1],V=(0,o.useRef)(null),W=(0,l.default)(c,V),X=(0,o.useMemo)(()=>({delayLongPress:O,delayPressStart:p,delayPressEnd:_,disabled:M,onLongPress:w,onPress:L,onPressChange:U,onPressStart:k,onPressMove:j,onPressEnd:D}),[O,p,_,M,w,L,k,j,D,U]),Y=(0,d.default)(V,X),Z=Y.onContextMenu,$=Y.onKeyDown;(0,u.default)(V,{contain:!0,disabled:M,onHoverChange:q,onHoverStart:x,onHoverEnd:E});var ee,ne={hovered:N,focused:G,pressed:T},te=s.useCallback(e=>{e.nativeEvent.target===V.current&&(J(!1),null!=C&&C(e))},[V,J,C]),oe=s.useCallback(e=>{e.nativeEvent.target===V.current&&(J(!0),null!=I&&I(e))},[V,J,I]),re=s.useCallback(e=>{null!=Z&&Z(e),null!=h&&h(e)},[h,Z]),se=s.useCallback(e=>{null!=$&&$(e),null!=H&&H(e)},[H,$]);return ee=void 0!==S?S:M?-1:0,s.createElement(f.default,(0,n.default)({},R,Y,{"aria-disabled":M,onBlur:te,onContextMenu:re,onFocus:oe,onKeyDown:se,ref:W,style:[M?b.disabled:b.active,'function'==typeof K?K(ne):K],tabIndex:ee}),'function'==typeof P?P(ne):P)}function y(e){var n=(0,o.useState)(!1);return[n[0]||e,n[1]]}var b=c.default.create({active:{cursor:'pointer',touchAction:'manipulation'},disabled:{pointerEvents:'box-none'}}),O=(0,o.memo)((0,o.forwardRef)(P));O.displayName='Pressable';var p=O},375,[232,14,11,93,376,363,26,13]); 438__d(function(g,r,i,a,m,_e,d){"use strict";function n(n){return n&&n.__esModule?n:{default:n}}
438Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var e=r(d[0]),t=n(r(d[1])),u=n(r(d[2])),l={},o={passive:!0},c='react-gui:hover:lock',f='react-gui:hover:unlock',v=()=>!('undefined'==typeof window||null==window.PointerEvent);function s(n,e,t){var u=document.createEvent('CustomEvent'),o=t||l,c=o.bubbles,f=void 0===c||c,v=o.cancelable,s=void 0===v||v,p=o.detail;u.initCustomEvent(e,f,s,p),n.dispatchEvent(u)}function p(n){var t=n.pointerType;return null!=t?t:(0,e.getModality)()}function b(n,e){var l=e.contain,b=e.disabled,h=e.onHoverStart,y=e.onHoverChange,E=e.onHoverUpdate,_=e.onHoverEnd,w=v(),H=(0,t.default)(w?'pointermove':'mousemove',o),C=(0,t.default)(w?'pointerenter':'mouseenter',o),M=(0,t.default)(w?'pointerleave':'mouseleave',o),P=(0,t.default)(c,o),j=(0,t.default)(f,o);(0,u.default)(()=>{var e=n.current;if(null!==e){var t=function(n){null!=_&&_(n),null!=y&&y(!1),H(e,null),M(e,null)},u=function(e){var u=n.current;null!=u&&'touch'!==p(e)&&(l&&s(u,f),t(e))},o=function(n){'touch'!==p(n)&&null!=E&&(null==n.x&&(n.x=n.clientX),null==n.y&&(n.y=n.clientY),E(n))},v=function(n){null!=h&&h(n),null!=y&&y(!0),null!=E&&H(e,b?null:o),M(e,b?null:u)};C(e,b?null:function(e){var u=n.current;if(null!=u&&'touch'!==p(e)){l&&s(u,c),v(e);P(u,b?null:function(n){n.target!==u&&t(e)}),j(u,b?null:function(n){n.target!==u&&v(e)})}})}},[C,H,M,P,j,l,b,h,y,E,_,n])}},376,[377,379,87]); 439__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getActiveModality=function(){return s},_e.getModality=function(){return l},_e.addModalityListener=function(e){return y.add(e),()=>{y.delete(e)}},_e.testOnly_resetActiveModality=function(){v=!1,s=f,l=f};var e,t,n,o=r(d[0]),u=r(d[1]),c=(e=u)&&e.__esModule?e:{default:e},s='keyboard',l='keyboard',v=!1,y=new Set,f='keyboard',p='mouse',E='touch',L='contextmenu',w='mousedown',h='mousemove',b='mouseup',M='pointerdown',_='pointermove',T='scroll',k='selectionchange',K='touchcancel',A='touchmove',O='touchstart',P={passive:!0},S={capture:!0,passive:!0};function j(){null==t&&null==n||(null!=t&&(l=t,t=null),null!=n&&(s=n,n=null),q())}function x(e){var t=e.type;if('undefined'!=typeof window&&null!=window.PointerEvent){if(t===M)return void(s!==e.pointerType&&(l=e.pointerType,s=e.pointerType,q()));if(t===_)return void(l!==e.pointerType&&(l=e.pointerType,q()))}else{if(v||(t===w&&s!==p&&(l=p,s=p,q()),t===h&&l!==p&&(l=p,q())),t===O)return v=!0,e.touches&&e.touches.length>1&&(v=!1),void(s!==E&&(l=E,s=E,q()));t!==L&&t!==b&&t!==k&&t!==T&&t!==K&&t!==A||(v=!1)}}function q(){var e={activeModality:s,modality:l};y.forEach(t=>{t(e)})}c.default&&((0,o.addEventListener)(window,'blur',function(){t=l,n=s,s=f,l=f,q(),v=!1},P),(0,o.addEventListener)(window,'focus',function(){j()},P),(0,o.addEventListener)(document,'keydown',function(e){e.metaKey||e.altKey||e.ctrlKey||l!==f&&(l=f,s=f,q())},S),(0,o.addEventListener)(document,'visibilitychange',function(){'hidden'!==document.visibilityState&&j()},S),(0,o.addEventListener)(document,M,x,S),(0,o.addEventListener)(document,_,x,S),(0,o.addEventListener)(document,L,x,S),(0,o.addEventListener)(document,w,x,S),(0,o.addEventListener)(document,h,x,S),(0,o.addEventListener)(document,b,x,S),(0,o.addEventListener)(document,K,x,S),(0,o.addEventListener)(document,A,x,S),(0,o.addEventListener)(document,O,x,S),(0,o.addEventListener)(document,k,x,S),(0,o.addEventListener)(document,T,x,S))},377,[378,35]); 440__d(function(g,r,i,a,m,_e,d){'use strict';Object.defineProperty(_e,'__esModule',{value:!0}),_e.addEventListener=function(e,t,n,u){var o=s(u),l=e=>n(c(e));return e.addEventListener(t,l,o),function(){null!=e&&e.removeEventListener(t,l,o)}};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},u=()=>{};var o=(function(){var e=!1;if(n.default)try{var t={};Object.defineProperty(t,'passive',{get:()=>(e=!0,!1)}),window.addEventListener('test',null,t),window.removeEventListener('test',null,t)}catch(e){}return e})();function s(e){return null!=e&&(o?e:Boolean(e.capture))}function l(){return this.cancelBubble}function v(){return this.defaultPrevented}function c(e){return e.nativeEvent=e,e.persist=u,e.isDefaultPrevented=v,e.isPropagationStopped=l,e}},378,[35]); 441__d(function(g,r,i,a,m,_e,d){"use strict";
441function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var t=r(d[0]),n=e(r(d[1])),u=e(r(d[2]));function l(e,l){var f=(0,u.default)(()=>new Map),c=(0,u.default)(()=>(n,u)=>{var c=f.get(n);null!=c&&c(),null==u&&(f.delete(n),u=()=>{});var o=(0,t.addEventListener)(n,e,u,l);return f.set(n,o),o});return(0,n.default)(()=>()=>{f.forEach(e=>{e()}),f.clear()},[f]),c}},379,[378,87,96]); 442__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=e(r(_d[0])),n=e(r(_d[1])),o=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[2])),l=e(r(_d[3])),u=e(r(_d[4])),d=["color","indeterminate","progress","trackColor","style"],s=o.forwardRef((e,l)=>{var s=e.color,f=void 0===s?'#1976D2':s,v=e.indeterminate,p=void 0!==v&&v,y=e.progress,b=void 0===y?0:y,_=e.trackColor,h=void 0===_?'transparent':_,j=e.style,k=(0,n.default)(e,d),C=100*b,O=p?'25%':C+"%";return o.createElement(u.default,(0,t.default)({},k,{"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":p?null:C,ref:l,role:"progressbar",style:[c.track,j,{backgroundColor:h}]}),o.createElement(u.default,{style:[{backgroundColor:f,width:O},c.progress,p&&c.animation]}))});s.displayName='ProgressBar';var c=l.default.create({track:{forcedColorAdjust:'none',height:5,overflow:'hidden',userSelect:'none',zIndex:0},progress:{forcedColorAdjust:'none',height:'100%',zIndex:-1},animation:{animationDuration:'1s',animationKeyframes:[{'0%':{transform:'translateX(-100%)'},'100%':{transform:'translateX(400%)'}}],animationTimingFunction:'linear',animationIterationCount:'infinite'}}),f=s},380,[232,14,11,26,13]); 443__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return w}});var t=e(r(_d[0])),n=e(r(_d[1])),o=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[2])),f=e(r(_d[3])),u=e(r(_d[4])),d=e(r(_d[5])),s=["style"],l=d.default&&window.CSS&&window.CSS.supports&&window.CSS.supports('top: constant(safe-area-inset-top)')?'constant':'env',c=o.forwardRef((e,f)=>{var d=e.style,l=(0,n.default)(e,s);return o.createElement(u.default,(0,t.default)({},l,{ref:f,style:[p.root,d]}))});c.displayName='SafeAreaView';var p=f.default.create({root:{paddingTop:l+"(safe-area-inset-top)",paddingRight:l+"(safe-area-inset-right)",paddingBottom:l+"(safe-area-inset-bottom)",paddingLeft:l+"(safe-area-inset-left)"}}),w=c},381,[232,14,11,26,13,35]); 444__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var t=()=>{};function n(){return null}n.setBackgroundColor=t,n.setBarStyle=t,n.setHidden=t,n.setNetworkActivityIndicatorVisible=t,n.setTranslucent=t;var u=n},382,[]); 445__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return j}});var t=e(r(_d[0])),l=e(r(_d[1])),o=e(r(_d[2])),n=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(l){var o=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,o.get?o:{enumerable:!0,get:function(){return e[l]}})}),t.default=e,t})(r(_d[3])),u=e(r(_d[4])),c=e(r(_d[5])),d=e(r(_d[6])),f=e(r(_d[7])),s=["aria-label","accessibilityLabel","activeThumbColor","activeTrackColor","disabled","onValueChange","style","thumbColor","trackColor","value"],b={},h='0px 1px 3px rgba(0,0,0,0.5)',p='#D5D5D5',v='#BDBDBD',y=n.forwardRef((e,t)=>
445{var y=e['aria-label'],j=e.accessibilityLabel,k=e.activeThumbColor,x=e.activeTrackColor,D=e.disabled,w=void 0!==D&&D,A=e.onValueChange,O=e.style,_=void 0===O?b:O,F=e.thumbColor,S=e.trackColor,E=e.value,B=void 0!==E&&E,P=(0,o.default)(e,s),R=n.useRef(null);function T(e){var t='focus'===e.nativeEvent.type?"0px 1px 3px rgba(0,0,0,0.5), 0 0 0 10px rgba(0,0,0,0.1)":h;null!=R.current&&(R.current.style.boxShadow=t)}var I=d.default.flatten(_),M=I.height,L=I.width,V=M||'20px',N=(0,c.default)(V,2),Z=L>N?L:N,q=(0,c.default)(V,.5),z=!0===B?null!=S&&'object'==typeof S?S.true:null!=x?x:"#A3D3CF":null!=S&&'object'==typeof S?S.false:null!=S?S:"#939393",G=B?null!=k?k:"#009688":null!=F?F:"#FAFAFA",H=V,J=H,K=[C.root,_,w&&C.cursorDefault,{height:V,width:Z}],Q=!0===B?'string'==typeof x&&null!=x||'object'==typeof S&&null!=S&&S.true?z:p:'string'==typeof S&&null!=S||'object'==typeof S&&null!=S&&S.false?z:p,U=!0===B?null==k?v:G:null==F?v:G,W=[C.track,{backgroundColor:w?Q:z,borderRadius:q}],X=[C.thumb,B&&C.thumbActive,{backgroundColor:w?U:G,height:H,marginStart:B?(0,c.default)(J,-1):0,width:J}],Y=(0,u.default)('input',{'aria-label':y||j,checked:B,disabled:w,onBlur:T,onChange:function(e){null!=A&&A(e.nativeEvent.target.checked)},onFocus:T,ref:t,style:[C.nativeControl,C.cursorInherit],type:'checkbox',role:'switch'});return n.createElement(f.default,(0,l.default)({},P,{style:K}),n.createElement(f.default,{style:W}),n.createElement(f.default,{ref:R,style:X}),Y)});y.displayName='Switch';var C=d.default.create({root:{cursor:'pointer',userSelect:'none'},cursorDefault:{cursor:'default'},cursorInherit:{cursor:'inherit'},track:(0,t.default)((0,t.default)({forcedColorAdjust:'none'},d.default.absoluteFillObject),{},{height:'70%',margin:'auto',transitionDuration:'0.1s',width:'100%'}),thumb:{forcedColorAdjust:'none',alignSelf:'flex-start',borderRadius:'100%',boxShadow:h,start:'0%',transform:'translateZ(0)',transitionDuration:'0.1s'},thumbActive:{insetInlineStart:'100%'},nativeControl:(0,t.default)((0,t.default)({},d.default.absoluteFillObject),{},{height:'100%',margin:0,appearance:'none',padding:0,width:'100%'})}),j=y},383,[21,232,14,11,15,384,26,13]); 446__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var t=/^[+-]?\d*(?:\.\d+)?(?:[Ee][+-]?\d+)?(%|\w*)/,n=(n,o)=>{var u;return'string'==typeof n?""+parseFloat(n)*o+n.match(t)[1]:(u=n,!isNaN(parseFloat(u))&&isFinite(u)?n*o:void 0)}},384,[]); 447__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t}function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return w}});var n=e(r(_d[0])),o=t(r(_d[1])),l=e(r(_d[2])),u=t(r(_d[3])),d=t(r(_d[4])),c=t(r(_d[5])),s=t(r(_d[6])),p=t(r(_d[7])),h=t(r(_d[8])),v=r(_d[9]),f=t(r(_d[10])),S=t(r(_d[11])),R=(e,t)=>{var n=e.selectionEnd,o=e.selectionStart,l=t.start,u=t.end;return l!==o||u!==n},C=(e,t)=>{if(R(e,t)){var n=t.start,o=t.end;try{e.setSelectionRange(n,o||n)}catch(e){}}},y=Object.assign({},l.defaultProps,l.accessibilityProps,l.clickProps,l.focusProps,l.keyboardProps,l.mouseProps,l.touchProps,l.styleProps,{autoCapitalize:!0,autoComplete:!0,autoCorrect:!0,autoFocus:!0,defaultValue:!0,disabled:!0,lang:!0,maxLength:!0,onChange:!0,onScroll:!0,placeholder:!0,pointerEvents:!0,readOnly:!0,rows:!0,spellCheck:!0,value:!0,type:!0}),b=e=>(0,u.default)(e,y);function x(e){return e.isComposing||229===e.keyCode}var k=null,E=n.forwardRef((e,t)=>{var l,u,f=e.autoCapitalize,R=void 0===f?'sentences':f,y=e.autoComplete,E=e.autoCompleteType,w=e.autoCorrect,O=void 0===w||w,P=e.blurOnSubmit,M=e.caretHidden,F=e.clearTextOnFocus,_=e.dir,j=e.editable,z=e.enterKeyHint,D=e.inputMode,H=e.keyboardType,K=e.multiline,L=void 0!==K&&K,N=e.numberOfLines,q=e.onBlur,A=e.onChange,B=e.onChangeText,G=e.onContentSizeChange,I=e.onFocus,W=e.onKeyPress,$=e.onLayout,V=e.onMoveShouldSetResponder,J=e.onMoveShouldSetResponderCapture,Q=e.onResponderEnd,U=e.onResponderGrant,X=e.onResponderMove,Y=e.onResponderReject,Z=e.onResponderRelease,ee=e.onResponderStart,te=e.onResponderTerminate,ne=e.onResponderTerminationRequest,re=e.onScrollShouldSetResponder,oe=e.onScrollShouldSetResponderCapture,ae=e.onSelectionChange,le=e.onSelectionChangeShouldSetResponder,ue=e.onSelectionChangeShouldSetResponderCapture,de=e.onStart
447ShouldSetResponder,ie=e.onStartShouldSetResponderCapture,ce=e.onSubmitEditing,se=e.placeholderTextColor,pe=e.readOnly,he=void 0!==pe&&pe,ve=e.returnKeyType,fe=e.rows,Se=e.secureTextEntry,Re=void 0!==Se&&Se,ge=e.selection,Ce=e.selectTextOnFocus,ye=e.showSoftInputOnFocus,me=e.spellCheck;if(null!=D)u=D,l='email'===D?'email':'tel'===D?'tel':'search'===D?'search':'url'===D?'url':'text';else if(null!=H)switch(H){case'email-address':l='email';break;case'number-pad':case'numeric':u='numeric';break;case'decimal-pad':u='decimal';break;case'phone-pad':l='tel';break;case'search':case'web-search':l='search';break;case'url':l='url';break;default:l='text'}Re&&(l='password');var be=n.useRef({height:null,width:null}),xe=n.useRef(null),ke=n.useRef(null),Ee=n.useRef(!1);n.useEffect(()=>{xe.current&&ke.current&&C(xe.current,ke.current),Ee.current=Re},[Re]);var Te=n.useCallback(e=>{if(L&&G&&null!=e){var t=e.scrollHeight,n=e.scrollWidth;t===be.current.height&&n===be.current.width||(be.current.height=t,be.current.width=n,G({nativeEvent:{contentSize:{height:be.current.height,width:be.current.width}}}))}},[L,G]),we=n.useMemo(()=>e=>{null!=e&&(e.clear=function(){null!=e&&(e.value='')},e.isFocused=function(){return null!=e&&S.default.currentlyFocusedField()===e},Te(e))},[Te]);(0,c.default)(()=>{var e=xe.current;null!=e&&null!=ge&&C(e,ge),document.activeElement===e&&(S.default._currentlyFocusedNode=e)},[xe,ge]);var Oe=L?'textarea':'input';(0,d.default)(xe,$),(0,h.default)(xe,{onMoveShouldSetResponder:V,onMoveShouldSetResponderCapture:J,onResponderEnd:Q,onResponderGrant:U,onResponderMove:X,onResponderReject:Y,onResponderRelease:Z,onResponderStart:ee,onResponderTerminate:te,onResponderTerminationRequest:ne,onScrollShouldSetResponder:re,onScrollShouldSetResponderCapture:oe,onSelectionChangeShouldSetResponder:le,onSelectionChangeShouldSetResponderCapture:ue,onStartShouldSetResponder:de,onStartShouldSetResponderCapture:ie});var Pe=(0,v.useLocaleContext)().direction,Me=b(e);Me.autoCapitalize=R,Me.autoComplete=y||E||'on',Me.autoCorrect=O?'on':'off',Me.dir=void 0!==_?_:'auto',Me.enterKeyHint=z||ve,Me.inputMode=u,Me.onBlur=function(e){S.default._currentlyFocusedNode=null,q&&(e.nativeEvent.text=e.target.value,q(e))},Me.onChange=function(e){var t=e.target,n=t.value;e.nativeEvent.text=n,Te(t),A&&A(e),B&&B(n)},Me.onFocus=function(e){var t=e.target;I&&(e.nativeEvent.text=t.value,I(e)),null!=t&&(S.default._currentlyFocusedNode=t,F&&(t.value=''),Ce&&(null!=k&&clearTimeout(k),k=setTimeout(()=>{null!=t&&document.activeElement===t&&t.select()},0)))},Me.onKeyDown=function(e){var t=e.target;e.stopPropagation();var n=null==P?!L:P,o=e.nativeEvent,l=x(o);W&&W(e),'Enter'!==e.key||e.shiftKey||l||e.isDefaultPrevented()||(!P&&L||!ce||(e.preventDefault(),o.text=e.target.value,ce(e)),n&&null!=t&&setTimeout(()=>t.blur(),0))},Me.onSelect=function(e){try{var t=e.target,n={start:t.selectionStart,end:t.selectionEnd};ae&&(e.nativeEvent.selection=n,e.nativeEvent.text=e.target.value,ae(e)),Ee.current===Re&&(ke.current=n)}catch(e){}},Me.readOnly=!0===he||!1===j,Me.rows=L?null!=fe?fe:N:1,Me.spellCheck=null!=me?me:O,Me.style=[{'--placeholderTextColor':se},T.textinput$raw,T.placeholder,e.style,M&&T.caretHidden],Me.type=L?void 0:l,Me.virtualkeyboardpolicy=!1===ye?'manual':'auto';var Fe=(0,p.default)(Me),je=(0,s.default)(xe,Fe,we,t);Me.ref=je;var ze=null!=e.lang?(0,v.getLocaleDirection)(e.lang):null,De=e.dir||ze||Pe;return(0,o.default)(Oe,Me,{writingDirection:De})});E.displayName='TextInput',E.State=S.default;var T=f.default.create({textinput$raw:{MozAppearance:'textfield',WebkitAppearance:'none',backgroundColor:'transparent',border:'0 solid black',borderRadius:0,boxSizing:'border-box',font:'14px System',margin:0,padding:0,resize:'none'},placeholder:{placeholderTextColor:'var(--placeholderTextColor)'},caretHidden:{caretColor:'transparent'}}),w=E},385,[11,15,84,85,86,87,93,95,97,82,26,280]); 448__d(function(g,r,i,a,m,_e,d){'use strict';function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return F}});var t=e(r(d[0])),o=e(r(d[1])),s=e(r(d[2])),E=e(r(d[3])),n=e(r(d[4])),l=e(r(d[5])),h=e(r(d[6])),u=e(r(d[7])),R=e(r(d[8])),c=r(d[9]),_=e=>{var t=e.touches,o=e.changedTouches,s=t&&t.length>0,E=o&&o.length>0;return!s&&E?o[0]:s?t[0]:e},S='NOT_RESPONDER',T='RESPONDER_INACTIVE_PRESS_IN',P='RESPONDER_INACTIVE_PRESS_OUT',D='RESPONDER_ACTIVE_PRESS_IN',N='RESPONDER_ACTIVE_PRESS_OUT',b='RESPONDER_ACTIVE_LONG_PRESS_IN',O='RESPONDER_ACTIVE_LONG_PRESS_OUT',A='ERROR',p={NOT_RESPONDER:!1,RESPONDER_INACTIVE_PRESS_IN:!1,RESPONDER_INACTIVE_PRESS_OUT:!1,RESPONDER_ACTIVE_PRESS_IN:!1,RESPONDER_ACTIVE_PRESS_OUT:!1,RESPONDER_ACTIVE_LONG_PRESS_IN:!1,RESPONDER_ACTIVE_LONG_PRESS_OUT:!1,ERROR:!1},f=(0,o.default)((0,o.default)({},p),{},{RESPONDER_ACTIVE_PRESS_OUT:!0,RESPONDER_ACTIVE_PRESS_IN:!0}),v=(0,o.default)((0,o.default)({},p),{},{RESPONDER_INACTIVE_PRESS_IN:!0,RESPONDER_ACTIVE_PRESS_IN:!0,RESPONDER_ACTIVE_LONG_PRESS_IN:!0}),L=(0,o.default)((0,o.default)({},p),{},{RESPONDER_ACTIVE_LONG_PRESS_IN:!0}
448),I='DELAY',y='RESPONDER_GRANT',C='RESPONDER_RELEASE',G='RESPONDER_TERMINATED',H='ENTER_PRESS_RECT',V='LEAVE_PRESS_RECT',M='LONG_PRESS_DETECTED',U={NOT_RESPONDER:{DELAY:A,RESPONDER_GRANT:T,RESPONDER_RELEASE:A,RESPONDER_TERMINATED:A,ENTER_PRESS_RECT:A,LEAVE_PRESS_RECT:A,LONG_PRESS_DETECTED:A},RESPONDER_INACTIVE_PRESS_IN:{DELAY:D,RESPONDER_GRANT:A,RESPONDER_RELEASE:S,RESPONDER_TERMINATED:S,ENTER_PRESS_RECT:T,LEAVE_PRESS_RECT:P,LONG_PRESS_DETECTED:A},RESPONDER_INACTIVE_PRESS_OUT:{DELAY:N,RESPONDER_GRANT:A,RESPONDER_RELEASE:S,RESPONDER_TERMINATED:S,ENTER_PRESS_RECT:T,LEAVE_PRESS_RECT:P,LONG_PRESS_DETECTED:A},RESPONDER_ACTIVE_PRESS_IN:{DELAY:A,RESPONDER_GRANT:A,RESPONDER_RELEASE:S,RESPONDER_TERMINATED:S,ENTER_PRESS_RECT:D,LEAVE_PRESS_RECT:N,LONG_PRESS_DETECTED:b},RESPONDER_ACTIVE_PRESS_OUT:{DELAY:A,RESPONDER_GRANT:A,RESPONDER_RELEASE:S,RESPONDER_TERMINATED:S,ENTER_PRESS_RECT:D,LEAVE_PRESS_RECT:N,LONG_PRESS_DETECTED:A},RESPONDER_ACTIVE_LONG_PRESS_IN:{DELAY:A,RESPONDER_GRANT:A,RESPONDER_RELEASE:S,RESPONDER_TERMINATED:S,ENTER_PRESS_RECT:b,LEAVE_PRESS_RECT:O,LONG_PRESS_DETECTED:b},RESPONDER_ACTIVE_LONG_PRESS_OUT:{DELAY:A,RESPONDER_GRANT:A,RESPONDER_RELEASE:S,RESPONDER_TERMINATED:S,ENTER_PRESS_RECT:b,LEAVE_PRESS_RECT:O,LONG_PRESS_DETECTED:A},error:{DELAY:S,RESPONDER_GRANT:T,RESPONDER_RELEASE:S,RESPONDER_TERMINATED:S,ENTER_PRESS_RECT:S,LEAVE_PRESS_RECT:S,LONG_PRESS_DETECTED:S}},Y={componentDidMount:function(){(0,c.warnOnce)('TouchableMixin','TouchableMixin is deprecated. Please use Pressable.');var e=this.getTouchableNode&&this.getTouchableNode();e&&e.addEventListener&&(this._touchableBlurListener=e=>{this._isTouchableKeyboardActive&&(this.state.touchable.touchState&&this.state.touchable.touchState!==S&&this.touchableHandleResponderTerminate({nativeEvent:e}),this._isTouchableKeyboardActive=!1)},e.addEventListener('blur',this._touchableBlurListener))},componentWillUnmount:function(){var e=this.getTouchableNode&&this.getTouchableNode();e&&e.addEventListener&&e.removeEventListener('blur',this._touchableBlurListener),this.touchableDelayTimeout&&clearTimeout(this.touchableDelayTimeout),this.longPressDelayTimeout&&clearTimeout(this.longPressDelayTimeout),this.pressOutDelayTimeout&&clearTimeout(this.pressOutDelayTimeout),this.pressInLocation=null,this.state.touchable.responderID=null},touchableGetInitialState:function(){return{touchable:{touchState:void 0,responderID:null}}},touchableHandleResponderTerminationRequest:function(){return!this.props.rejectResponderTermination},touchableHandleStartShouldSetResponder:function(){return!this.props.disabled},touchableLongPressCancelsPress:function(){return!0},touchableHandleResponderGrant:function(e){var t=e.currentTarget;e.persist(),this.pressOutDelayTimeout&&clearTimeout(this.pressOutDelayTimeout),this.pressOutDelayTimeout=null,this.state.touchable.touchState=S,this.state.touchable.responderID=t,this._receiveSignal(y,e);var o=void 0!==this.touchableGetHighlightDelayMS?Math.max(this.touchableGetHighlightDelayMS(),0):130;0!==(o=isNaN(o)?130:o)?this.touchableDelayTimeout=setTimeout(this._handleDelay.bind(this,e),o):this._handleDelay(e);var s=void 0!==this.touchableGetLongPressDelayMS?Math.max(this.touchableGetLongPressDelayMS(),10):370;s=isNaN(s)?370:s,this.longPressDelayTimeout=setTimeout(this._handleLongDelay.bind(this,e),s+o)},touchableHandleResponderRelease:function(e){this.pressInLocation=null,this._receiveSignal(C,e)},touchableHandleResponderTerminate:function(e){this.pressInLocation=null,this._receiveSignal(G,e)},touchableHandleResponderMove:function(e){if(this.state.touchable.positionOnActivate){var t=this.state.touchable.positionOnActivate,o=this.state.touchable.dimensionsOnActivate,s=this.touchableGetPressRectOffset?this.touchableGetPressRectOffset():{left:20,right:20,top:20,bottom:20},E=s.left,n=s.top,l=s.right,h=s.bottom,u=this.touchableGetHitSlop?this.touchableGetHitSlop():null;u&&(E+=u.left||0,n+=u.top||0,l+=u.right||0,h+=u.bottom||0);var R=_(e.nativeEvent),c=R&&R.pageX,S=R&&R.pageY;if(this.pressInLocation)this._getDistanceBetweenPoints(c,S,this.pressInLocation.pageX,this.pressInLocation.pageY)>10&&this._cancelLongPressDelayTimeout();if(c>t.left-E&&S>t.top-n&&c<t.left+o.width+l&&S<t.top+o.height+h){var P=this.state.touchable.touchState;this._receiveSignal(H,e),this.state.touchable.touchState===T&&P!==T&&this._cancelLongPressDelayTimeout()}else this._cancelLongPressDelayTimeout(),this._receiveSignal(V,e)}},touchableHandleFocus:function(e){this.props.onFocus&&this.props.onFocus(e)},touchableHandleBlur:function(e){this.props.onBlur&&this.props.onBlur(e)},_remeasureMetricsOnActivation:function(){var e=this.state.touchable.responderID;null!=e&&u.default.measure(e,this._handleQueryLayout)},_handleQueryLayout:function(e,t,o,s,n,h){(e||t||o||s||n||h)&&(this.state.touchable.positionOnActivate&&l.default.release(this.state.touchable.positionOnActivate),this.state.touchable.dimensionsOnActivate&&E.default.release(this.state.touchable.dimensionsOnActivate),this.state.touchable.positionOnActivate=l.default.getPooled(n,h),this.state.touchable.dimensionsOnActivate=E.default.getPooled(o,s))},_handleDelay:function(e){this.touchableDelayTimeout=null,this._receiveSignal(I,e)},_handleLongDelay:function(e){this.longPressDelayTimeout=null;var t=this.state.touchable.touchState;t!==D&&t!==b?console.error('Attempted to transition from state `'+t+'` to `'+b+"`, which is not supported. This is most likely due to `Touchable.longPressDelayTimeout` not being cancelled."):this._receiveSignal(M,e)},_receiveSignal:function(e,t){var o=this.state.touchable.responderID,s=this.state.touchable.touchState,E=U[s]&&U[s][e];if(o||e!==C){if(!E)throw new Error('Unrecognized signal `'+e+'` or state `'+s+'` for Touchable responder `'+o+'`');
448if(E===A)throw new Error('Touchable cannot transition from `'+s+'` to `'+e+'` for responder `'+o+'`');s!==E&&(this._performSideEffectsForTransition(s,E,e,t),this.state.touchable.touchState=E)}},_cancelLongPressDelayTimeout:function(){this.longPressDelayTimeout&&clearTimeout(this.longPressDelayTimeout),this.longPressDelayTimeout=null},_isHighlight:function(e){return e===D||e===b},_savePressInLocation:function(e){var t=_(e.nativeEvent),o=t&&t.pageX,s=t&&t.pageY,E=t&&t.locationX,n=t&&t.locationY;this.pressInLocation={pageX:o,pageY:s,locationX:E,locationY:n}},_getDistanceBetweenPoints:function(e,t,o,s){var E=e-o,n=t-s;return Math.sqrt(E*E+n*n)},_performSideEffectsForTransition:function(e,t,o,s){var E=this._isHighlight(e),n=this._isHighlight(t);(o===G||o===C)&&this._cancelLongPressDelayTimeout();var l=e===S&&t===T,h=!f[e]&&f[t];if((l||h)&&this._remeasureMetricsOnActivation(),v[e]&&o===M&&this.touchableHandleLongPress&&this.touchableHandleLongPress(s),n&&!E?this._startHighlight(s):!n&&E&&this._endHighlight(s),v[e]&&o===C){var u=!!this.props.onLongPress,R=L[e]&&(!u||!this.touchableLongPressCancelsPress());(!L[e]||R)&&this.touchableHandlePress&&(n||E||(this._startHighlight(s),this._endHighlight(s)),this.touchableHandlePress(s))}this.touchableDelayTimeout&&clearTimeout(this.touchableDelayTimeout),this.touchableDelayTimeout=null},_playTouchSound:function(){u.default.playTouchSound()},_startHighlight:function(e){this._savePressInLocation(e),this.touchableHandleActivePressIn&&this.touchableHandleActivePressIn(e)},_endHighlight:function(e){this.touchableHandleActivePressOut&&(this.touchableGetPressOutDelayMS&&this.touchableGetPressOutDelayMS()?this.pressOutDelayTimeout=setTimeout(()=>{this.touchableHandleActivePressOut(e)},this.touchableGetPressOutDelayMS()):this.touchableHandleActivePressOut(e))},touchableHandleKeyEvent:function(e){var t=e.type,o=e.key;'Enter'!==o&&' '!==o||('keydown'===t?this._isTouchableKeyboardActive||this.state.touchable.touchState&&this.state.touchable.touchState!==S||(this.touchableHandleResponderGrant(e),this._isTouchableKeyboardActive=!0):'keyup'===t&&this._isTouchableKeyboardActive&&this.state.touchable.touchState&&this.state.touchable.touchState!==S&&(this.touchableHandleResponderRelease(e),this._isTouchableKeyboardActive=!1),e.stopPropagation(),'Enter'===o&&'link'===s.default.propsToAriaRole(this.props)||e.preventDefault())},withoutDefaultFocusAndBlur:{}},B=(Y.touchableHandleFocus,Y.touchableHandleBlur,(0,t.default)(Y,["touchableHandleFocus","touchableHandleBlur"]));Y.withoutDefaultFocusAndBlur=B;var w={Mixin:Y,TOUCH_TARGET_DEBUG:!1,renderDebugView:e=>{var t=e.color,s=e.hitSlop;if(!w.TOUCH_TARGET_DEBUG)return null;var E={};for(var l in s=s||{top:0,bottom:0,left:0,right:0})E[l]=-s[l];var u=(0,n.default)(t);if('number'!=typeof u)return null;var c='#'+('00000000'+u.toString(16)).substr(-8);return h.default.createElement(R.default,{pointerEvents:"none",style:(0,o.default)({position:'absolute',borderColor:c.slice(0,-2)+'55',borderWidth:1,borderStyle:'dashed',backgroundColor:c.slice(0,-2)+'0F'},E)})}},F=w},386,[14,21,16,387,34,389,11,88,13,74]); 449__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var e,t=r(d[0]),o=(e=t)&&e.__esModule?e:{default:e},n=o.default.twoArgumentPooler;function u(e,t){this.width=e,this.height=t}u.prototype.destructor=function(){this.width=null,this.height=null},u.getPooledFromElement=function(e){return u.getPooled(e.offsetWidth,e.offsetHeight)},o.default.addPoolingTo(u,n);var l=u},387,[388]); 450__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return l}}),r(d[0]);var o=function(o,n){var t=this;if(t.instancePool.length){var l=t.instancePool.pop();return t.call(l,o,n),l}return new t(o,n)},n=function(o){var n=this;o.destructor(),n.instancePool.length<n.poolSize&&n.instancePool.push(o)},t=o,l={addPoolingTo:function(o,l){var u=o;return u.instancePool=[],u.getPooled=l||t,u.poolSize||(u.poolSize=10),u.release=n,u},twoArgumentPooler:o}},388,[108]); 451__d(function(g,r,i,a,m,_e,d){"use strict";
451Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var t,e=r(d[0]),o=(t=e)&&t.__esModule?t:{default:t},u=o.default.twoArgumentPooler;function l(t,e){this.left=t,this.top=e}l.prototype.destructor=function(){this.left=null,this.top=null},o.default.addPoolingTo(l,u);var n=l},389,[388]); 452__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var n=e(r(_d[0])),l=e(r(_d[1])),s=r(_d[2]),t=(function(e){if(e&&e.__esModule)return e;var n={};return e&&Object.keys(e).forEach(function(l){var s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(n,l,s.get?s:{enumerable:!0,get:function(){return e[l]}})}),n.default=e,n})(s),o=e(r(_d[3])),u=e(r(_d[4])),d=e(r(_d[5])),c=e(r(_d[6])),y=["activeOpacity","children","delayPressIn","delayPressOut","delayLongPress","disabled","focusable","onHideUnderlay","onLongPress","onPress","onPressIn","onPressOut","onShowUnderlay","rejectResponderTermination","style","testOnly_pressed","underlayColor"];function f(e,n){return{child:{opacity:null!=e?e:.85},underlay:{backgroundColor:void 0===n?'black':n}}}function P(e){return null!=e.onPress||null!=e.onPressIn||null!=e.onPressOut||null!=e.onLongPress}function b(e,d){var b=e.activeOpacity,O=e.children,h=e.delayPressIn,v=e.delayPressOut,_=e.delayLongPress,j=e.disabled,L=e.focusable,C=e.onHideUnderlay,E=e.onLongPress,S=e.onPress,k=e.onPressIn,I=e.onPressOut,w=e.onShowUnderlay,M=e.rejectResponderTermination,R=e.style,U=e.testOnly_pressed,H=e.underlayColor,T=(0,l.default)(e,y),D=(0,s.useRef)(null),x=(0,o.default)(d,D),A=(0,s.useState)(!0===U?f(b,H):null),N=A[0],q=A[1],z=(0,s.useCallback)(()=>{P(e)&&(q(f(b,H)),null!=w&&w())},[b,w,e,H]),B=(0,s.useCallback)(()=>{!0!==U&&P(e)&&(q(null),null!=C&&C())},[C,e,U]),F=(0,s.useMemo)(()=>({cancelable:!M,disabled:j,delayLongPress:_,delayPressStart:h,delayPressEnd:v,onLongPress:E,onPress:S,onPressStart(e){z(),null!=k&&k(e)},onPressEnd(e){B(),null!=I&&I(e)}}),[_,h,v,j,E,S,k,I,M,z,B]),G=(0,u.default)(D,F),J=t.Children.only(O);return t.createElement(c.default,(0,n.default)({},T,G,{accessibilityDisabled:j,focusable:!j&&!1!==L,pointerEvents:j?'box-none':void 0,ref:x,style:[p.root,R,!j&&p.actionable,N&&N.underlay]}),t.cloneElement(J,{style:[J.props.style,N&&N.child]}))}var p=d.default.create({root:{userSelect:'none'},actionable:{cursor:'pointer',touchAction:'manipulation'}}),O=t.memo(t.forwardRef(b));O.displayName='TouchableHighlight';var h=O},390,[232,14,11,93,363,26,13]); 453__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},391,[392]); 454__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var t=e(r(d[0])),u=e(r(d[1])),n=e(r(d[2])),l=e(r(d[3])),f=["style"];var c={},o=function(e){var o=e.style,s=(0,u.default)(e,f);return l.default.createElement(n.default,(0,t.default)({},s,{style:[c,o]}))}},392,[232,14,13,11]); 455__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return y}});var s=r(_d[0]),t=(function(e){if(e&&e.__esModule)return e;var s={};return e&&Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),s.default=e,s})(s),n=e(r(_d[1])),l=e(r(_d[2])),o=e(r(_d[3])),c=r(_d[4]),u={accessibilityDisabled:!0,accessibilityLabel:!0,accessibilityLiveRegion:!0,accessibilityRole:!0,accessibilityState:!0,accessibilityValue:!0,children:!0,disabled:!0,focusable:!0,nativeID:!0,onBlur:!0,onFocus:!0,onLayout:!0,testID:!0},d=e=>(0,n.default)(e,u);function b(e,n){(0,c.warnOnce)('TouchableWithoutFeedback','TouchableWithoutFeedback is deprecated. Please use Pressable.');var u=e.delayPressIn,b=e.delayPressOut,f=e.delayLongPress,y=e.disabled,P=e.focusable,h=e.onLongPress,p=e.onPress,v=e.onPressIn,O=e.onPressOut,_=e.rejectResponderTermination,j=(0,s.useRef)(null),L=(0,s.useMemo)(()=>({cancelable:!_,disabled:y,delayLongPress:f,delayPressStart:u,delayPressEnd:b,onLongPress:h,onPress:p,onPressStart:v,onPressEnd:O}),[y,u,b,f,h,p,v,O,_]),D=(0,o.default)(j,L),R=t.Children.only(e.children),k=[R.props.children],E=d(e);E.accessibilityDisabled=y,E.focusable=!y&&!1!==P,E.ref=(0,l.default)(n,j,R.ref);var F=Object.assign(E,D);return t.cloneElement(R,F,...k)}var f=t.memo(t.forwardRef(b));f.displayName='TouchableWithoutFeedback';var y=f},393,[11,85,93,363,74]); 456__d(function(g,r,i,a,m,_e,d){"use strict";
456Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},394,[273]); 457__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var t=e(r(d[0])),n=e(r(d[1]));function u(e){return t.default.createElement(n.default,e)}u.ignoreWarnings=()=>{};var f=u},395,[11,392]); 458__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var n={ignoreLogs(){},ignoreAllLogs(){},uninstall(){},install(){}}},396,[]); 459__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},397,[154]); 460__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var e,t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),n=r(_d[1]),u=(e=n)&&e.__esModule?e:{default:e};function o(){var e=t.useState(u.default.getColorScheme()),n=e[0],o=e[1];return t.useEffect(()=>u.default.addChangeListener(function(e){o(e.colorScheme)}).remove),n}},398,[11,348]); 461__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=r(d[0]).useLocaleContext},399,[82]); 462__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},u=r(d[1]);function f(){var e=(0,u.useState)(()=>n.default.get('window')),t=e[0],f=e[1];return(0,u.useEffect)(()=>{function e(e){var t=e.window;null!=t&&f(t)}return n.default.addEventListener('change',e),f(n.default.get('window')),()=>{n.default.removeEventListener('change',e)}},[]),t}},400,[107,11]); 463__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,o,u){void 0===u&&(u=o);var c=Object.getOwnPropertyDescriptor(n,o);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,u,c)}:function(t,n,o,u){void 0===u&&(u=o),t[u]=n[o]}),n=this&&this.__exportStar||function(n,o){for(var u in n)"default"===u||Object.prototype.hasOwnProperty.call(o,u)||t(o,n,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.useScrollToTop=e.useRoutePath=e.useLocale=e.useLinkTo=e.useLinkProps=e.useLinkBuilder=e.UNSTABLE_UnhandledLinkingContext=e.DefaultTheme=e.DarkTheme=e.ServerContainer=e.NavigationContainer=e.LocaleDirContext=e.LinkingContext=e.Link=e.createStaticNavigation=void 0;var o=r(d[0]);Object.defineProperty(e,"createStaticNavigation",{enumerable:!0,get:function(){return o.createStaticNavigation}});var u=r(d[1]);Object.defineProperty(e,"Link",{enumerable:!0,get:function(){return u.Link}});var c=r(d[2]);Object.defineProperty(e,"LinkingContext",{enumerable:!0,get:function(){return c.LinkingContext}});var l=r(d[3]);Object.defineProperty(e,"LocaleDirContext",{enumerable:!0,get:function(){return l.LocaleDirContext}});var f=r(d[4]);Object.defineProperty(e,"NavigationContainer",{enumerable:!0,get:function(){return f.NavigationContainer}});var b=r(d[5]);Object.defineProperty(e,"ServerContainer",{enumerable:!0,get:function(){return b.ServerContainer}});var s=r(d[6]);Object.defineProperty(e,"DarkTheme",{enumerable:!0,get:function(){return s.DarkTheme}});var v=r(d[7]);Object.defineProperty(e,"DefaultTheme",{enumerable:!0,get:function(){return v.DefaultTheme}}),n(r(d[8]),e);var p=r(d[9]);Object.defineProperty(e,"UNSTABLE_UnhandledLinkingContext",{enumerable:!0,get:function(){return p.UnhandledLinkingContext}});var L=r(d[10]);Object.defineProperty(e,"useLinkBuilder",{enumerable:!0,get:function(){return L.useLinkBuilder}});var P=r(d[11]);Object.defineProperty(e,"useLinkProps",{enumerable:!0,get:function(){return P.useLinkProps}});var m=r(d[12]);Object.defineProperty(e,"useLinkTo",{enumerable:!0,get:function(){return m.useLinkTo}});var O=r(d[13]);Object.defineProperty(e,"useLocale",{enumerable:!0,get:function(){return O.useLocale}});var k=r(d[14]);Object.defineProperty(e,"useRoutePath",{enumerable:!0,get:function(){return k.useRoutePath}});var j=r(d[15]);Object.defineProperty(e,"useScrollToTop",{enumerable:!0,get:function(){return j.useScrollToTop}}),n(r(d[16]),e)},401,[402,509,498,499,497,511,512,501,513,500,514,510,515,516,517,518,403]); 464__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var c=Object.getOwnPropertyDescriptor(n,i);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,c)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)}
464,function(o){if(o&&o.__esModule)return o;var c={};if(null!=o)for(var u=t(o),l=0;l<u.length;l++)"default"!==u[l]&&n(c,o,u[l]);return i(c,o),c});Object.defineProperty(e,"__esModule",{value:!0}),e.createStaticNavigation=function(t){const n=(0,l.createComponentForStaticNavigation)(t,'RootNavigator');return u.forwardRef(function({linking:i,...o},f){const b=u.useMemo(()=>{const n=(0,l.createPathConfigForStaticNavigation)(t,{initialRouteName:i?.config?.initialRouteName},'auto'===i?.enabled);if(n)return{path:i?.config?.path,initialRouteName:i?.config?.initialRouteName,screens:n}},[i?.enabled,i?.config?.path,i?.config?.initialRouteName]),h=u.useMemo(()=>{if(!i)return;const t='boolean'==typeof i.enabled?i.enabled:null!=b?.screens;return{...i,enabled:t,config:b}},[i,b]);if(!0===i?.enabled&&null==b?.screens)throw new Error("Linking is enabled but no linking configuration was found for the screens.\n\nTo solve this:\n- Specify a 'linking' property for the screens you want to link to.\n- Or set 'linking.enabled' to 'auto' to generate paths automatically.\n\nSee usage guide: https://reactnavigation.org/docs/static-configuration#linking");return(0,c.jsx)(s.NavigationContainer,{...o,ref:f,linking:h,children:(0,c.jsx)(n,{})})})};const c=r(d[0]),u=o(r(d[1])),l=r(d[2]),s=r(d[3])},402,[6,11,403,497]); 465__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,o,u){void 0===u&&(u=o);var v=Object.getOwnPropertyDescriptor(n,o);v&&!("get"in v?!n.__esModule:v.writable||v.configurable)||(v={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,u,v)}:function(t,n,o,u){void 0===u&&(u=o),t[u]=n[o]}),n=this&&this.__exportStar||function(n,o){for(var u in n)"default"===u||Object.prototype.hasOwnProperty.call(o,u)||t(o,n,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.validatePathConfig=e.useStateForPath=e.useRoute=e.usePreventRemoveContext=e.usePreventRemove=e.useNavigationState=e.useNavigationIndependentTree=e.useNavigationContainerRef=e.useNavigationBuilder=e.useNavigation=e.useIsFocused=e.useFocusEffect=e.useTheme=e.ThemeProvider=e.ThemeContext=e.createPathConfigForStaticNavigation=e.createComponentForStaticNavigation=e.PreventRemoveProvider=e.PreventRemoveContext=e.NavigationRouteContext=e.NavigationProvider=e.NavigationMetaContext=e.NavigationIndependentTree=e.NavigationHelpersContext=e.NavigationContext=e.NavigationContainerRefContext=e.getStateFromPath=e.getPathFromState=e.getFocusedRouteNameFromRoute=e.getActionFromState=e.findFocusedRoute=e.CurrentRenderContext=e.createNavigatorFactory=e.createNavigationContainerRef=e.BaseNavigationContainer=void 0;var o=r(d[0]);Object.defineProperty(e,"BaseNavigationContainer",{enumerable:!0,get:function(){return o.BaseNavigationContainer}});var u=r(d[1]);Object.defineProperty(e,"createNavigationContainerRef",{enumerable:!0,get:function(){return u.createNavigationContainerRef}});var v=r(d[2]);Object.defineProperty(e,"createNavigatorFactory",{enumerable:!0,get:function(){return v.createNavigatorFactory}});var c=r(d[3]);Object.defineProperty(e,"CurrentRenderContext",{enumerable:!0,get:function(){return c.CurrentRenderContext}});var f=r(d[4]);Object.defineProperty(e,"findFocusedRoute",{enumerable:!0,get:function(){return f.findFocusedRoute}});var b=r(d[5]);Object.defineProperty(e,"getActionFromState",{enumerable:!0,get:function(){return b.getActionFromState}});var m=r(d[6]);Object.defineProperty(e,"getFocusedRouteNameFromRoute",{enumerable:!0,get:function(){return m.getFocusedRouteNameFromRoute}});var P=r(d[7]);Object.defineProperty(e,"getPathFromState",{enumerable:!0,get:function(){return P.getPathFromState}});var s=r(d[8]);Object.defineProperty(e,"getStateFromPath",{enumerable:!0,get:function(){return s.getStateFromPath}});var p=r(d[9]);Object.defineProperty(e,"NavigationContainerRefContext",{enumerable:!0,get:function(){return p.NavigationContainerRefContext}});var N=r(d[10]);Object.defineProperty(e,"NavigationContext",{enumerable:!0,get:function(){return N.NavigationContext}});var l=r(d[11]);Object.defineProperty(e,"NavigationHelpersContext",{enumerable:!0,get:function(){return l.NavigationHelpersContext}});var C=r(d[12]);Object.defineProperty(e,"NavigationIndependentTree",{enumerable:!0,get:function(){return C.NavigationIndependentTree}});var y=r(d[13]);Object.defineProperty(e,"NavigationMetaContext",{enumerable:!0,get:function(){return y.NavigationMetaContext}});var O=r(d[14]);Object.defineProperty(e,"NavigationProvider",{enumerable:!0,get:function(){return O.NavigationProvider}});var j=r(d[14]);Object.defineProperty(e,"NavigationRouteContext",{enumerable:!0,get:function(){return j.NavigationRouteContext}});var R=r(d[15]);Object.defineProperty(e,"PreventRemoveContext",{enumerable:!0,get:function(){return R.PreventRemoveContext}});var F=r(d[16]);Object.defineProperty(e,"PreventRemoveProvider",{enumerable:!0,get:function(){return F.PreventRemoveProvider}});var h=r(d[17]);Object.defineProperty(e,"createComponentForStaticNavigation",{enumerable:!0,get:function(){return h.createComponentForStaticNavigation}}),Object.defineProperty(e,"createPathConfigForStaticNavigation",{enumerable:!0,get:function(){return h.createPathConfigForStaticNavigation}});var x=r(d[18]);Object.defineProperty(e,"ThemeContext",{enumerable:!0,get:function(){return x.ThemeContext}});var S=r(d[19]);Object.defineProperty(e,"ThemeProvider",{enumerable:!0,get:function(){return S.ThemeProvider}});var T=r(d[20]);Object.defineProperty(e,"useTheme",{enumerable:!0,get:function(){return T.useTheme}}),n(r(d[21]),e);var _=r(d[22]);Object.defineProperty(e,"useFocusEffect",{enumerable:!0,get:function(){return _.useFocusEffect}});var I=r(d[23]);Object.defineProperty(e,"useIsFocused",{enumerable:!0,get:function(){return I.useIsF
465ocused}});var B=r(d[24]);Object.defineProperty(e,"useNavigation",{enumerable:!0,get:function(){return B.useNavigation}});var M=r(d[25]);Object.defineProperty(e,"useNavigationBuilder",{enumerable:!0,get:function(){return M.useNavigationBuilder}});var w=r(d[26]);Object.defineProperty(e,"useNavigationContainerRef",{enumerable:!0,get:function(){return w.useNavigationContainerRef}});var A=r(d[27]);Object.defineProperty(e,"useNavigationIndependentTree",{enumerable:!0,get:function(){return A.useNavigationIndependentTree}});var E=r(d[28]);Object.defineProperty(e,"useNavigationState",{enumerable:!0,get:function(){return E.useNavigationState}});var H=r(d[29]);Object.defineProperty(e,"usePreventRemove",{enumerable:!0,get:function(){return H.usePreventRemove}});var D=r(d[30]);Object.defineProperty(e,"usePreventRemoveContext",{enumerable:!0,get:function(){return D.usePreventRemoveContext}});var k=r(d[31]);Object.defineProperty(e,"useRoute",{enumerable:!0,get:function(){return k.useRoute}});var q=r(d[32]);Object.defineProperty(e,"useStateForPath",{enumerable:!0,get:function(){return q.useStateForPath}});var z=r(d[33]);Object.defineProperty(e,"validatePathConfig",{enumerable:!0,get:function(){return z.validatePathConfig}}),n(r(d[34]),e)},403,[404,424,435,438,425,439,440,443,451,418,455,456,457,461,458,462,463,464,427,426,468,469,470,459,460,471,493,431,485,494,495,467,496,450,406]); 466__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var s=Object.getOwnPropertyDescriptor(n,o);s&&!("get"in s?!n.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,s)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var s={};if(null!=i)for(var u=t(i),c=0;c<u.length;c++)"default"!==u[c]&&n(s,i,u[c]);return o(s,i),s}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseNavigationContainer=function({ref:t,initialState:n,onStateChange:o,onReady:i,onUnhandledAction:s,navigationInChildEnabled:E=!1,theme:L,children:A}){const D=(0,l.use)(C.NavigationStateContext),M=(0,S.useNavigationIndependentTree)();if(!D.isDefault&&!M)throw new Error("Looks like you have nested a 'NavigationContainer' inside another. Normally you need only one container at the root of the app, so this was probably an error. If this was intentional, wrap the container in 'NavigationIndependentTree' explicitly. Note that this will make the child navigators disconnected from the parent and you won't be able to navigate between them.");const{state:T,getState:U,setState:B,scheduleUpdate:G,flushUpdates:K}=(0,w.useSyncState)(()=>P(null==n?void 0:n)),F=c.useRef(!0),Z=c.useRef(void 0),H=c.useCallback(()=>Z.current,[]),q=c.useCallback(t=>{Z.current=t},[]),{listeners:z,addListener:J}=(0,j.useChildListeners)(),{keyedListeners:Q,addKeyedListener:V}=(0,x.useKeyedChildListeners)(),W=(0,f.default)(t=>{null==z.focus[0]?console.error(b.NOT_INITIALIZED_ERROR):z.focus[0](n=>n.dispatch(t))}),X=(0,f.default)(()=>{if(null==z.focus[0])return!1;const{result:t,handled:n}=z.focus[0](t=>t.canGoBack());return!!n&&t}),Y=(0,f.default)(t=>{const n=t?.key??Q.getState.root?.().key;null==n?console.error(b.NOT_INITIALIZED_ERROR):z.focus[0](o=>o.dispatch({...h.CommonActions.reset(t),target:n}))}),$=(0,f.default)(()=>Q.getState.root?.()),ee=(0,f.default)(()=>{const t=$();if(null==t)return;return(0,R.findFocusedRoute)(t)}),te=(0,f.default)(()=>null!=z.focus[0]),ne=(0,I.useEventEmitter)(),{addOptionsGetter:re,getCurrentOptions:oe}=(0,k.useOptionsGetters)({}),ae=c.useMemo(()=>({...Object.keys(h.CommonActions).reduce((t,n)=>(t[n]=(...t)=>W(h.CommonActions[n](...t)),t),{}),...ne.create('root'),dispatch:W,resetRoot:Y,isFocused:()=>!0,canGoBack:X,getParent:()=>{},getState:U,getRootState:$,getCurrentRoute:ee,getCurrentOptions:oe,isReady:te,setOptions:()=>{throw new Error('Cannot call setOptions outside a screen')}}),[X,W,ne,oe,ee,$,U,te,Y]);c.useImperativeHandle(t,()=>ae,[ae]);const ie=(0,f.default)((t,n)=>{ne.emit({type:'__unsafe_action__',data:{action:t,noop:n,stack:ce.current}})}),se=c.useRef(void 0),ue=(0,f.default)(t=>{se.current!==t&&(se.current=t,ne.emit({type:'options',data:{options:t}}))}),ce=c.useRef(void 0),de=c.useMemo(()=>({addListener:J,addKeyedListener:V,onDispatchAction:ie,onOptionsChange:ue,scheduleUpdate:G,flushUpdates:K,stackRef:ce}),[J,V,ie,ue,G,K]),le=c.useRef(!0),fe=c.useCallback(()=>le.current,[]),he=c.useMemo(()=>({state:T,getState:U,setState:B,getKey:H,setKey:q,getIsInitial:fe,addOptionsGetter:re}
466),[T,U,B,H,q,fe,re]),ve=c.useRef(i),pe=c.useRef(o);c.useEffect(()=>{le.current=!1,pe.current=o,ve.current=i});const ge=c.useRef(!1);c.useEffect(()=>{!ge.current&&te()&&(ge.current=!0,ve.current?.(),ne.emit({type:'ready'}))},[T,te,ne]),c.useEffect(()=>{const t=$();ne.emit({type:'state',data:{state:T}}),!F.current&&pe.current&&pe.current(t),F.current=!1},[$,ne,T]);const ye=(0,f.default)(t=>{});return(0,u.jsx)(_.NavigationIndependentTreeContext.Provider,{value:!1,children:(0,u.jsx)(m.NavigationContainerRefContext.Provider,{value:ae,children:(0,u.jsx)(y.NavigationBuilderContext.Provider,{value:de,children:(0,u.jsx)(C.NavigationStateContext.Provider,{value:he,children:(0,u.jsx)(O.UnhandledActionContext.Provider,{value:s??ye,children:(0,u.jsx)(v.DeprecatedNavigationInChildContext.Provider,{value:E,children:(0,u.jsx)(p.EnsureSingleNavigator,{children:(0,u.jsx)(N.ThemeProvider,{value:L,children:A})})})})})})})})};const u=r(d[0]),c=i(r(d[1])),l=r(d[1]),f=s(r(d[2])),h=r(d[3]),v=r(d[4]),p=r(d[5]),y=r(d[6]),m=r(d[7]),_=r(d[8]),C=r(d[9]),O=r(d[10]),b=(r(d[11]),r(d[12]),r(d[13])),R=r(d[14]),N=r(d[15]),j=r(d[16]),I=r(d[17]),x=r(d[18]),S=r(d[19]),k=r(d[20]),w=r(d[21]),P=t=>{if(void 0===t)return;const{key:n,routeNames:o,...i}=t;return{...i,stale:!0,routes:t.routes.map(t=>void 0===t.state?t:{...t,state:P(t.state)})}}},404,[6,11,405,406,415,416,417,418,419,420,421,422,423,424,425,426,428,429,430,431,432,433]); 467__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,i){void 0===i&&(i=u);var o=Object.getOwnPropertyDescriptor(n,u);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,i,o)}:function(t,n,u,i){void 0===i&&(i=u),t[i]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var c=t(i),f=0;f<c.length;f++)"default"!==c[f]&&n(o,i,c[f]);return u(o,i),o});Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){const n=o.useRef(t),u=o.useRef(function(...t){return n.current.apply(this,t)}).current;return c(()=>{n.current=t},[t]),u};const o=i(r(d[0])),c='undefined'!=typeof document||'undefined'!=typeof navigator&&'ReactNative'===navigator.product?o.useInsertionEffect:o.useEffect},405,[11]); 468__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,u){void 0===u&&(u=o);var i=Object.getOwnPropertyDescriptor(n,o);i&&!("get"in i?!n.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,u,i)}:function(t,n,o,u){void 0===u&&(u=o),t[u]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),u=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(u){if(u&&u.__esModule)return u;var i={};if(null!=u)for(var c=t(u),f=0;f<c.length;f++)"default"!==c[f]&&n(i,u,c[f]);return o(i,u),i}),i=this&&this.__exportStar||function(t,o){for(var u in t)"default"===u||Object.prototype.hasOwnProperty.call(o,u)||n(o,t,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.TabRouter=e.TabActions=e.StackRouter=e.StackActions=e.DrawerRouter=e.DrawerActions=e.BaseRouter=e.CommonActions=void 0;const c=u(r(d[0]));e.CommonActions=c;var f=r(d[1]);Object.defineProperty(e,"BaseRouter",{enumerable:!0,get:function(){return f.BaseRouter}});var b=r(d[2]);Object.defineProperty(e,"DrawerActions",{enumerable:!0,get:function(){return b.DrawerActions}}),Object.defineProperty(e,"DrawerRouter",{enumerable:!0,get:function(){return b.DrawerRouter}});var s=r(d[3]);Object.defineProperty(e,"StackActions",{enumerable:!0,get:function(){return s.StackActions}}),Object.defineProperty(e,"StackRouter",{enumerable:!0,get:function(){return s.StackRouter}});var l=r(d[4]);Object.defineProperty(e,"TabActions",{enumerable:!0,get:function(){return l.TabActions}}),Object.defineProperty(e,"TabRouter",{enumerable:!0,get:function(){return l.TabRouter}}),i(r(d[5]),e)},406,[407,408,409,412,410,414]); 469__d(function(g,r,i,a,m,e,d){"use strict";
469Object.defineProperty(e,"__esModule",{value:!0}),e.goBack=function(){return{type:'GO_BACK'}},e.navigate=function(...t){if('string'==typeof t[0]){const[n,o,p]=t;return'boolean'==typeof p&&console.warn("Passing a boolean as the third argument to 'navigate' is deprecated. Pass '{ merge: true }' instead."),{type:'NAVIGATE',payload:{name:n,params:o,merge:'boolean'==typeof p?p:p?.merge,pop:p?.pop}}}{const n=t[0]||{};if(!('name'in n))throw new Error('You need to specify a name when calling navigate with an object as the argument. See https://reactnavigation.org/docs/navigation-actions#navigate for usage.');return{type:'NAVIGATE',payload:n}}},e.navigateDeprecated=function(...t){if('string'==typeof t[0])return{type:'NAVIGATE_DEPRECATED',payload:{name:t[0],params:t[1]}};{const n=t[0]||{};if(!('name'in n))throw new Error('You need to specify a name when calling navigateDeprecated with an object as the argument. See https://reactnavigation.org/docs/navigation-actions#navigatelegacy for usage.');return{type:'NAVIGATE_DEPRECATED',payload:n}}},e.reset=function(t){return{type:'RESET',payload:t}},e.setParams=function(t){return{type:'SET_PARAMS',payload:{params:t}}},e.replaceParams=function(t){return{type:'REPLACE_PARAMS',payload:{params:t}}},e.preload=function(t,n){return{type:'PRELOAD',payload:{name:t,params:n}}}},407,[]); 470__d(function(g,_r,_i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseRouter=void 0;const t=_r(d[0]);e.BaseRouter={getStateForAction(s,o){switch(o.type){case'SET_PARAMS':case'REPLACE_PARAMS':{const t=o.source?s.routes.findIndex(t=>t.key===o.source):s.index;return-1===t?null:{...s,routes:s.routes.map((s,u)=>u===t?{...s,params:'REPLACE_PARAMS'===o.type?o.payload.params:{...s.params,...o.payload.params}}:s)}}case'RESET':{const u=o.payload;return 0===u.routes.length||u.routes.some(t=>!s.routeNames.includes(t.name))?null:!1===u.stale?s.routeNames.length!==u.routeNames.length||u.routeNames.some(t=>!s.routeNames.includes(t))?null:{...u,routes:u.routes.map(s=>s.key?s:{...s,key:`${s.name}-${(0,t.nanoid)()}`})}:u}default:return null}},shouldActionChangeFocus:t=>'NAVIGATE'===t.type||'NAVIGATE_DEPRECATED'===t.type}},408,[260]); 471__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrawerActions=void 0,e.DrawerRouter=function({defaultStatus:s="closed",...n}){const u=(0,o.TabRouter)(n),c=t=>Boolean(t.history?.some(t=>'drawer'===t.type)),y=t=>c(t)?t:{...t,history:[...t.history,{type:'drawer',status:'open'===s?'closed':'open'}]},A=t=>c(t)?{...t,history:t.history.filter(t=>'drawer'!==t.type)}:t,l=t=>'open'===s?A(t):y(t),R=t=>'open'===s?y(t):A(t);return{...u,type:'drawer',getInitialState:({routeNames:o,routeParamList:n,routeGetIdList:c})=>({...u.getInitialState({routeNames:o,routeParamList:n,routeGetIdList:c}),default:s,stale:!1,type:'drawer',key:`drawer-${(0,t.nanoid)()}`}),getRehydratedState(o,{routeNames:n,routeParamList:l,routeGetIdList:R}){if(!1===o.stale)return o;let E=u.getRehydratedState(o,{routeNames:n,routeParamList:l,routeGetIdList:R});return c(o)&&(E=A(E),E=y(E)),{...E,default:s,type:'drawer',key:`drawer-${(0,t.nanoid)()}`}},getStateForRouteFocus(t,o){const s=u.getStateForRouteFocus(t,o);return R(s)},getStateForAction(t,o,s){switch(o.type){case'OPEN_DRAWER':return l(t);case'CLOSE_DRAWER':return R(t);case'TOGGLE_DRAWER':return c(t)?A(t):y(t);case'JUMP_TO':case'NAVIGATE':case'NAVIGATE_DEPRECATED':{const n=u.getStateForAction(t,o,s);return null!=n&&n.index!==t.index?R(n):n}case'GO_BACK':return c(t)?A(t):u.getStateForAction(t,o,s);default:return u.getStateForAction(t,o,s)}},actionCreators:e.DrawerActions}};const t=r(d[0]),o=r(d[1]);e.DrawerActions={...o.TabActions,openDrawer:()=>({type:'OPEN_DRAWER'}),closeDrawer:()=>({type:'CLOSE_DRAWER'}),toggleDrawer:()=>({type:'TOGGLE_DRAWER'})}},409,[260,410]); 472__d(function(g,_r,_i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TabActions=void 0,e.TabRouter=function(t){const r=y(t);return{...r,getStateForAction:(t,o,s)=>{if(o.target&&o.target!==t.key)return null;if('REPLACE'===o.type){const n=o;let i=r.getStateForAction(t,{...n,type:'JUMP_TO'},s);if(!i||void 0===i.index||!Array.isArray(i.history))return null;if(0!==i.index){const t=i.index-1;i={...i,key:`${i.key}-replace`,history:[...i.history.slice(0,t),...i.history.splice(i.index)]}}return i}return r.getStateForAction(t,o,s)}}};
472const t=_r(d[0]),r=_r(d[1]),o=_r(d[2]),s='route';e.TabActions={jumpTo:(t,r)=>({type:'JUMP_TO',payload:{name:t,params:r}})};const n=(t,r,o,n)=>{const i=[{type:s,key:t[r].key}];let y;switch(o){case'order':for(let o=r;o>0;o--)i.unshift({type:s,key:t[o-1].key});break;case'firstRoute':0!==r&&i.unshift({type:s,key:t[0].key});break;case'initialRoute':y=t.findIndex(t=>t.name===n),y=-1===y?0:y,r!==y&&i.unshift({type:s,key:t[y].key})}return i},i=(t,r,o,i)=>{let y=t.history;if('history'===o||'fullHistory'===o){const n=t.routes[r];if('history'===o)y=y.filter(t=>'route'===t.type&&t.key!==n.key);else if('fullHistory'===o){const t=y.findLastIndex(t=>'route'===t.type);n.key===y[t]?.key&&(y=[...y.slice(0,t),...y.slice(t+1)])}y=y.concat({type:s,key:n.key,params:'fullHistory'===o?n.params:void 0})}else y=n(t.routes,r,o,i);return{...t,index:r,history:y}};function y({initialRouteName:s,backBehavior:y="firstRoute"}){return{...r.BaseRouter,type:'tab',getInitialState({routeNames:r,routeParamList:o}){const i=void 0!==s&&r.includes(s)?r.indexOf(s):0,u=r.map(r=>({name:r,key:`${r}-${(0,t.nanoid)()}`,params:o[r]})),l=n(u,i,y,s);return{stale:!1,type:'tab',key:`tab-${(0,t.nanoid)()}`,index:i,routeNames:r,history:l,routes:u,preloadedRouteKeys:[]}},getRehydratedState(r,{routeNames:o,routeParamList:n}){const u=r;if(!1===u.stale)return u;const l=o.map(r=>{const o=u.routes.find(t=>t.name===r);return{...o,name:r,key:o&&o.name===r&&o.key?o.key:`${r}-${(0,t.nanoid)()}`,params:void 0!==n[r]?{...n[r],...o?o.params:void 0}:o?o.params:void 0}}),p=Math.min(Math.max(o.indexOf(u.routes[u?.index??0]?.name),0),l.length-1),c=l.map(t=>t.key),f=u.history?.filter(t=>c.includes(t.key))??[];return i({stale:!1,type:'tab',key:`tab-${(0,t.nanoid)()}`,index:p,routeNames:o,history:f,routes:l,preloadedRouteKeys:u.preloadedRouteKeys?.filter(t=>c.includes(t))??[]},p,y,s)},getStateForRouteNamesChange(r,{routeNames:o,routeParamList:i,routeKeyChanges:u}){const l=o.map(o=>r.routes.find(t=>t.name===o&&!u.includes(t.name))||{name:o,key:`${o}-${(0,t.nanoid)()}`,params:i[o]}),p=r.preloadedRouteKeys.filter(t=>l.some(r=>r.key===t)),c=Math.max(0,o.indexOf(r.routes[r.index].name));let f=r.history.filter(t=>'route'!==t.type||l.find(r=>r.key===t.key));return f.length||(f=n(l,c,y,s)),{...r,history:f,routeNames:o,routes:l,preloadedRouteKeys:p,index:c}},getStateForRouteFocus(t,r){const o=t.routes.findIndex(t=>t.key===r);return-1===o||o===t.index?t:i(t,o,y,s)},getStateForAction(n,u,{routeParamList:l,routeGetIdList:p}){switch(u.type){case'JUMP_TO':case'NAVIGATE':case'NAVIGATE_DEPRECATED':{const r=n.routes.findIndex(t=>t.name===u.payload.name);if(-1===r)return null;const c=i({...n,routes:n.routes.map(r=>{if(r.name!==u.payload.name)return r;const s=p[r.name],n=s?.({params:r.params}),i=s?.({params:u.payload.params}),y=n===i?r.key:`${r.name}-${(0,t.nanoid)()}`;let c;c='NAVIGATE'!==u.type&&'NAVIGATE_DEPRECATED'!==u.type||!u.payload.merge||n!==i?(0,o.createParamsFromAction)({action:u,routeParamList:l}):void 0!==u.payload.params||void 0!==l[r.name]?{...l[r.name],...r.params,...u.payload.params}:r.params;const f='NAVIGATE'===u.type&&null!=u.payload.path?u.payload.path:r.path;return c!==r.params||f!==r.path?{...r,key:y,path:f,params:c}:r})},r,y,s);return{...c,preloadedRouteKeys:c.preloadedRouteKeys.filter(t=>t!==n.routes[c.index].key)}}case'SET_PARAMS':case'REPLACE_PARAMS':{const t=r.BaseRouter.getStateForAction(n,u);if(null!==t){const r=t.index;if(null!=r){const o=t.routes[r],s=n.history.findLastIndex(t=>t.key===o.key);let i=n.history;return-1!==s&&(i=[...n.history],i[s]={...i[s],params:o.params}),{...t,history:i}}}return t}case'GO_BACK':{if(1===n.history.length)return null;const t=n.history[n.history.length-2],r=t?.key,o=n.routes.findLastIndex(t=>t.key===r);if(-1===o)return null;let s=n.routes;return'fullHistory'===y&&s[o].params!==t.params&&(s=[...n.routes],s[o]={...s[o],params:t.params}),{...n,routes:s,preloadedRouteKeys:n.preloadedRouteKeys.filter(t=>t!==n.routes[o].key),history:n.history.slice(0,-1),index:o}}case'PRELOAD':{const r=n.routes.findIndex(t=>t.name===u.payload.name);if(-1===r)return null;const s=n.routes[r],i=p[s.name],y=i?.({params:s.params}),c=i?.({params:u.payload.params}),f=y===c?s.key:`${s.name}
472-${(0,t.nanoid)()}`,k=(0,o.createParamsFromAction)({action:u,routeParamList:l}),h=k!==s.params?{...s,key:f,params:k}:s;return{...n,preloadedRouteKeys:n.preloadedRouteKeys.filter(t=>t!==s.key).concat(h.key),routes:n.routes.map((t,o)=>o===r?h:t),history:f===s.key?n.history:n.history.filter(t=>t.key!==s.key)}}default:return r.BaseRouter.getStateForAction(n,u)}},actionCreators:e.TabActions}}},410,[260,408,411]); 473__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createParamsFromAction=function({action:t,routeParamList:o}){const{name:n,params:c}=t.payload;return void 0!==o[n]?{...o[n],...c}:c}},411,[]); 474__d(function(g,_r,_i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackActions=void 0,e.StackRouter=function(s){const p={...o.BaseRouter,type:'stack',getInitialState({routeNames:o,routeParamList:r}){const n=void 0!==s.initialRouteName&&o.includes(s.initialRouteName)?s.initialRouteName:o[0];return{stale:!1,type:'stack',key:`stack-${(0,t.nanoid)()}`,index:0,routeNames:o,preloadedRoutes:[],routes:[{key:`${n}-${(0,t.nanoid)()}`,name:n,params:r[n]}]}},getRehydratedState(o,{routeNames:r,routeParamList:n}){const p=o;if(!1===p.stale)return p;const i=p.routes.filter(t=>r.includes(t.name)).map(o=>({...o,key:o.key||`${o.name}-${(0,t.nanoid)()}`,params:void 0!==n[o.name]?{...n[o.name],...o.params}:o.params})),u=p.preloadedRoutes?.filter(t=>r.includes(t.name)).map(o=>({...o,key:o.key||`${o.name}-${(0,t.nanoid)()}`,params:void 0!==n[o.name]?{...n[o.name],...o.params}:o.params}))??[];if(0===i.length){const o=void 0!==s.initialRouteName?s.initialRouteName:r[0];i.push({key:`${o}-${(0,t.nanoid)()}`,name:o,params:n[o]})}return{stale:!1,type:'stack',key:`stack-${(0,t.nanoid)()}`,index:i.length-1,routeNames:r,routes:i,preloadedRoutes:u}},getStateForRouteNamesChange(o,{routeNames:r,routeParamList:n,routeKeyChanges:p}){const i=o.routes.filter(t=>r.includes(t.name)&&!p.includes(t.name)),u=o.preloadedRoutes.filter(t=>r.includes(t.name)&&!p.includes(t.name));if(0===i.length){const o=void 0!==s.initialRouteName&&r.includes(s.initialRouteName)?s.initialRouteName:r[0];i.push({key:`${o}-${(0,t.nanoid)()}`,name:o,params:n[o]})}return{...o,routeNames:r,routes:i,preloadedRoutes:u,index:Math.min(o.index,i.length-1)}},getStateForRouteFocus(t,o){const r=t.routes.findIndex(t=>t.key===o);return-1===r||r===t.index?t:{...t,index:r,routes:t.routes.slice(0,r+1)}},getStateForAction(s,i,u){const{routeParamList:l}=u;switch(i.type){case'REPLACE':{const t=i.target===s.key&&i.source?s.routes.findIndex(t=>t.key===i.source):s.index;if(-1===t)return null;if(!s.routeNames.includes(i.payload.name))return null;const o=u.routeGetIdList[i.payload.name],r=o?.({params:i.payload.params});let p=s.preloadedRoutes.find(t=>t.name===i.payload.name&&r===o?.({params:t.params}));return p||(p=(0,n.createRouteFromAction)({action:i,routeParamList:l})),{...s,routes:s.routes.map((o,r)=>r===t?p:o),preloadedRoutes:s.preloadedRoutes.filter(t=>t.key!==p.key)}}case'PUSH':case'NAVIGATE':{if(!s.routeNames.includes(i.payload.name))return null;const o=u.routeGetIdList[i.payload.name],n=o?.({params:i.payload.params});let p,c,y;if(void 0!==n)p=s.routes.findLast(t=>t.name===i.payload.name&&n===o?.({params:t.params}));else if('NAVIGATE'===i.type){const t=s.routes[s.index];i.payload.name===t.name?p=t:i.payload.pop&&(p=s.routes.findLast(t=>t.name===i.payload.name))}if(p||(p=s.preloadedRoutes.find(t=>t.name===i.payload.name&&n===o?.({params:t.params}))),c='NAVIGATE'===i.type&&i.payload.merge&&p?void 0!==i.payload.params||void 0!==l[i.payload.name]?{...l[i.payload.name],...p.params,...i.payload.params}:p.params:(0,r.createParamsFromAction)({action:i,routeParamList:l}),p)if('NAVIGATE'===i.type&&i.payload.pop){y=[];for(const t of s.routes){if(t.key===p.key){y.push({...p,path:void 0!==i.payload.path?i.payload.path:p.path,params:c});break}y.push(t)}}else y=s.routes.filter(t=>t.key!==p.key),y.push({...p,path:'NAVIGATE'===i.type&&void 0!==i.payload.path?i.payload.path:p.path,params:c});else y=[...s.routes,{key:`${i.payload.name}-${(0,t.nanoid)()}`,name:i.payload.name,path:'NAVIGATE'===i.type?i.payload.path:void 0,params:c}];return{...s,index:y.length-1,preloadedRoutes:s.preloadedRoutes.filter(t=>y[y.length-1].key!==t.key),routes:y}}case'NAVIGATE_DEPRECATED':{if(!s.routeNames.includes(i.payload.name))return null;if(s.preloadedRoutes.find(t=>t.name===i.payload.name&&p===o?.({params:t.params})))return null;let t=-1;const o=u.routeGetIdList[i.payload.name],p=o?.({params:i.payload.params});if(t=void 0!==p?s.routes.findIndex(t=>t.name===i.payload.name&&p===o?.({params:t.params})):s.routes[s.index].name===i.payload.name?s.index:s.routes.findLastIndex(t=>t.name===i.payload.name),-1===t){const t=[...s.routes,(0,n.createRouteFromAction)({action:i,routeParamList:l})];return{...s,routes:t,index:t.length-1}}const c=s.routes[t];let y;return y=i.payload.merge?void 0!==i.payload.params||void 0!==l[c.name]?{...l[c.name],...c.params,...i.payload.params}:c.params:(0,r.createParamsFromAction)({action:i,routeParamList:l}),{...s,index:t,routes:[...s.routes.slice(0,t),y!==c.params?{...c,params:y}:s.routes[t]]}}case'POP':{const t=i.target===s.key&&i.source?s.routes.findIndex(t=>t.key===i.source):s.index;if(t>0){const o=Math.max(t-i.payload.count+1,1),r=s.routes.slice(0,o).c
474oncat(s.routes.slice(t+1));return{...s,index:r.length-1,routes:r}}return null}case'POP_TO_TOP':return p.getStateForAction(s,{type:'POP',payload:{count:s.routes.length-1}},u);case'POP_TO':{const t=i.target===s.key&&i.source?s.routes.findLastIndex(t=>t.key===i.source):s.index;if(-1===t)return null;if(!s.routeNames.includes(i.payload.name))return null;let o=-1;const p=u.routeGetIdList[i.payload.name],c=p?.({params:i.payload.params});if(void 0!==c)o=s.routes.findIndex(t=>t.name===i.payload.name&&c===p?.({params:t.params}));else if(s.routes[t].name===i.payload.name)o=t;else for(let r=t;r>=0;r--)if(s.routes[r].name===i.payload.name){o=r;break}if(-1===o){let o=s.preloadedRoutes.find(t=>t.name===i.payload.name&&c===p?.({params:t.params}));o||(o=(0,n.createRouteFromAction)({action:i,routeParamList:l}));const r=s.routes.slice(0,t).concat(o);return{...s,index:r.length-1,routes:r,preloadedRoutes:s.preloadedRoutes.filter(t=>t.key!==o.key)}}const y=s.routes[o];let f;return f=i.payload.merge?void 0!==i.payload.params||void 0!==l[y.name]?{...l[y.name],...y.params,...i.payload.params}:y.params:(0,r.createParamsFromAction)({action:i,routeParamList:l}),{...s,index:o,routes:[...s.routes.slice(0,o),f!==y.params?{...y,params:f}:s.routes[o]]}}case'GO_BACK':return s.index>0?p.getStateForAction(s,{type:'POP',payload:{count:1},target:i.target,source:i.source},u):null;case'PRELOAD':{const t=u.routeGetIdList[i.payload.name],o=t?.({params:i.payload.params});let p;return void 0!==o&&(p=s.routes.find(r=>r.name===i.payload.name&&o===t?.({params:r.params}))),p?{...s,routes:s.routes.map(t=>t.key!==p?.key?t:{...t,params:(0,r.createParamsFromAction)({action:i,routeParamList:l})})}:{...s,preloadedRoutes:s.preloadedRoutes.filter(r=>r.name!==i.payload.name||o!==t?.({params:r.params})).concat((0,n.createRouteFromAction)({action:i,routeParamList:l}))}}default:return o.BaseRouter.getStateForAction(s,i)}},actionCreators:e.StackActions};return p};const t=_r(d[0]),o=_r(d[1]),r=_r(d[2]),n=_r(d[3]);e.StackActions={replace:(t,o)=>({type:'REPLACE',payload:{name:t,params:o}}),push:(t,o)=>({type:'PUSH',payload:{name:t,params:o}}),pop:(t=1)=>({type:'POP',payload:{count:t}}),popToTop:()=>({type:'POP_TO_TOP'}),popTo:(t,o,r)=>('boolean'==typeof r&&console.warn("Passing a boolean as the third argument to 'popTo' is deprecated. Pass '{ merge: true }' instead."),{type:'POP_TO',payload:{name:t,params:o,merge:'boolean'==typeof r?r:r?.merge}})}},412,[260,408,411,413]); 475__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createRouteFromAction=function({action:n,routeParamList:c}){const{name:s}=n.payload;return{key:`${s}-${(0,t.nanoid)()}`,name:s,params:(0,o.createParamsFromAction)({action:n,routeParamList:c})}};const t=r(d[0]),o=r(d[1])},413,[260,411]); 476__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},414,[]); 477__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),l=0;l<c.length;l++)"default"!==c[l]&&n(u,o,c[l]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.DeprecatedNavigationInChildContext=void 0;const u=o(r(d[0]));e.DeprecatedNavigationInChildContext=u.createContext(!1)},415,[11]); 478__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)}
478,function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),s=0;s<c.length;s++)"default"!==c[s]&&n(u,o,c[s]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.SingleNavigatorContext=void 0,e.EnsureSingleNavigator=function({children:t}){const n=c.useRef(void 0),i=c.useMemo(()=>({register(t){const i=n.current;if(void 0!==i&&t!==i)throw new Error(s);n.current=t},unregister(t){t===n.current&&(n.current=void 0)}}),[]);return(0,u.jsx)(e.SingleNavigatorContext.Provider,{value:i,children:t})};const u=r(d[0]),c=o(r(d[1])),s="Another navigator is already registered for this container. You likely have multiple navigators under a single \"NavigationContainer\" or \"Screen\". Make sure each navigator is under a separate \"Screen\" container. See https://reactnavigation.org/docs/nesting-navigators for a guide on nesting.";e.SingleNavigatorContext=c.createContext(void 0)},416,[6,11]); 479__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),l=0;l<c.length;l++)"default"!==c[l]&&n(u,i,c[l]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationBuilderContext=void 0;const u=i(r(d[0]));e.NavigationBuilderContext=u.createContext({onDispatchAction:()=>{},onOptionsChange:()=>{},scheduleUpdate:()=>{throw new Error("Couldn't find a context for scheduling updates.")},flushUpdates:()=>{throw new Error("Couldn't find a context for flushing updates.")}})},417,[11]); 480__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),f=0;f<c.length;f++)"default"!==c[f]&&n(u,o,c[f]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationContainerRefContext=void 0;const u=o(r(d[0]));e.NavigationContainerRefContext=u.createContext(void 0)},418,[11]); 481__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),f=0;f<c.length;f++)"default"!==c[f]&&n(u,o,c[f]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationIndependentTreeContext=void 0;const u=o(r(d[0]));e.NavigationIndependentTreeContext=u.createContext(!1)},419,[11]); 482__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),s=0;s<c.length;s++)"default"!==c[s]&&n(u,i,c[s]);return o(u,i),u});
482Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationStateContext=void 0;const u=i(r(d[0])),c="Couldn't find a navigation context. Have you wrapped your app with 'NavigationContainer'? See https://reactnavigation.org/docs/getting-started for setup instructions.";e.NavigationStateContext=u.createContext({isDefault:!0,get getKey(){throw new Error(c)},get setKey(){throw new Error(c)},get getState(){throw new Error(c)},get setState(){throw new Error(c)},get getIsInitial(){throw new Error(c)}})},420,[11]); 483__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),l=0;l<c.length;l++)"default"!==c[l]&&n(u,i,c[l]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.UnhandledActionContext=void 0;const u=i(r(d[0]));e.UnhandledActionContext=u.createContext(void 0)},421,[11]); 484__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.checkDuplicateRouteNames=function(t){const n=[],s=(t,c)=>{c.routes.forEach(c=>{const o=t?`${t} > ${c.name}`:c.name;c.state?.routeNames?.forEach(t=>{t===c.name&&n.push([o,`${o} > ${c.name}`])}),c.state&&s(o,c.state)})};return s('',t),n}},422,[]); 485__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.checkSerializable=function(n){return t(n,new Set,[])};const t=(n,i,o)=>{if(null==n||'boolean'==typeof n||'number'==typeof n||'string'==typeof n)return{serializable:!0};if('[object Object]'!==Object.prototype.toString.call(n)&&!Array.isArray(n))return{serializable:!1,location:o,reason:'function'==typeof n?'Function':String(n)};if(i.has(n))return{serializable:!1,reason:'Circular reference',location:o};if(i.add(n),Array.isArray(n))for(let l=0;l<n.length;l++){const c=t(n[l],new Set(i),[...o,l]);if(!c.serializable)return c}else for(const l in n){const c=t(n[l],new Set(i),[...o,l]);if(!c.serializable)return c}return{serializable:!0}}},423,[]); 486__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NOT_INITIALIZED_ERROR=void 0,e.createNavigationContainerRef=function(){const n=[...Object.keys(t.CommonActions),'addListener','removeListener','resetRoot','dispatch','isFocused','canGoBack','getRootState','getState','getParent','getCurrentRoute','getCurrentOptions'],o={},s=(t,n)=>{o[t]&&(o[t]=o[t].filter(t=>t!==n))};let c=null;return{get current(){return c},set current(t){c=t,null!=t&&Object.entries(o).forEach(([n,o])=>{o.forEach(o=>{t.addListener(n,o)})})},isReady:()=>null!=c&&c.isReady(),...n.reduce((t,n)=>(t[n]=(...t)=>{if(null!=c)return c[n](...t);switch(n){case'addListener':{const[n,c]=t;return o[n]=o[n]||[],o[n].push(c),()=>s(n,c)}case'removeListener':{const[n,o]=t;s(n,o);break}default:console.error(e.NOT_INITIALIZED_ERROR)}},t),{})}};const t=r(d[0]);e.NOT_INITIALIZED_ERROR="The 'navigation' object hasn't been initialized yet. This might happen if you don't have a navigator mounted, or if the navigator hasn't finished mounting. See https://reactnavigation.org/docs/navigating-without-navigation-prop#handling-initialization for more details."},424,[406]); 487__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findFocusedRoute=function(t){let n=t;for(;null!=n?.routes[n.index??0].state;)n=n.routes[n.index??0].state;const u=n?.routes[n?.index??0];return u}},425,[]); 488__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ThemeProvider=function({value:o,children:u}){return(0,n.jsx)(t.ThemeContext.Provider,{value:o,children:u})};const n=r(d[0]),t=r(d[1])},426,[6,427]); 489__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),f=0;f<c.length;f++)"default"!==c[f]&&n(u,i,c[f]);return o(u,i),u});
489Object.defineProperty(e,"__esModule",{value:!0}),e.ThemeContext=void 0;const u=i(r(d[0]));e.ThemeContext=u.createContext(void 0),e.ThemeContext.displayName='ThemeContext'},427,[11]); 490__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,u){void 0===u&&(u=i);var o=Object.getOwnPropertyDescriptor(n,i);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,u,o)}:function(t,n,i,u){void 0===u&&(u=i),t[u]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),u=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(u){if(u&&u.__esModule)return u;var o={};if(null!=u)for(var c=t(u),s=0;s<c.length;s++)"default"!==c[s]&&n(o,u,c[s]);return i(o,u),o});Object.defineProperty(e,"__esModule",{value:!0}),e.useChildListeners=function(){const{current:t}=o.useRef({action:[],focus:[]}),n=o.useCallback((n,i)=>{t[n].push(i);let u=!1;return()=>{const o=t[n].indexOf(i);!u&&o>-1&&(u=!0,t[n].splice(o,1))}},[t]);return{listeners:t,addListener:n}};const o=u(r(d[0]))},428,[11]); 491__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,c){void 0===c&&(c=u);var i=Object.getOwnPropertyDescriptor(n,u);i&&!("get"in i?!n.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,c,i)}:function(t,n,u,c){void 0===c&&(c=u),t[c]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),c=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(c){if(c&&c.__esModule)return c;var i={};if(null!=c)for(var o=t(c),l=0;l<o.length;l++)"default"!==o[l]&&n(i,c,o[l]);return u(i,c),i});Object.defineProperty(e,"__esModule",{value:!0}),e.useEventEmitter=function(t){const n=i.useRef(t);i.useEffect(()=>{n.current=t});const u=i.useRef(Object.create(null)),c=i.useCallback(t=>{const n=(n,c)=>{const i=u.current[n]?u.current[n][t]:void 0;if(!i)return;const o=i.indexOf(c);o>-1&&i.splice(o,1)};return{addListener:(c,i)=>{u.current[c]=u.current[c]||{},u.current[c][t]=u.current[c][t]||[],u.current[c][t].push(i);let o=!1;return()=>{o||(o=!0,n(c,i))}},removeListener:n}},[]),o=i.useCallback(({type:t,data:c,target:i,canPreventDefault:o})=>{const l=u.current[t]||{},f=void 0!==i?l[i]?.slice():[].concat(...Object.keys(l).map(t=>l[t])).filter((t,n,u)=>u.lastIndexOf(t)===n),s={get type(){return t}};if(void 0!==i&&Object.defineProperty(s,'target',{enumerable:!0,get:()=>i}),void 0!==c&&Object.defineProperty(s,'data',{enumerable:!0,get:()=>c}),o){let t=!1;Object.defineProperties(s,{defaultPrevented:{enumerable:!0,get:()=>t},preventDefault:{enumerable:!0,value(){t=!0}}})}return n.current?.(s),f?.forEach(t=>t(s)),s},[]);return i.useMemo(()=>({create:c,emit:o}),[c,o])};const i=c(r(d[0]))},429,[11]); 492__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,u){void 0===u&&(u=i);var o=Object.getOwnPropertyDescriptor(n,i);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,u,o)}:function(t,n,i,u){void 0===u&&(u=i),t[u]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),u=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(u){if(u&&u.__esModule)return u;var o={};if(null!=u)for(var c=t(u),s=0;s<c.length;s++)"default"!==c[s]&&n(o,u,c[s]);return i(o,u),o});
492Object.defineProperty(e,"__esModule",{value:!0}),e.useKeyedChildListeners=function(){const{current:t}=o.useRef(Object.assign(Object.create(null),{getState:{},beforeRemove:{}})),n=o.useCallback((n,i,u)=>(t[n][i]=u,()=>{t[n][i]=void 0}),[t]);return{keyedListeners:t,addKeyedListener:n}};const o=u(r(d[0]))},430,[11]); 493__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useNavigationIndependentTree=function(){return(0,n.use)(t.NavigationIndependentTreeContext)};const n=r(d[0]),t=r(d[1])},431,[11,419]); 494__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,i){void 0===i&&(i=u);var o=Object.getOwnPropertyDescriptor(n,u);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,i,o)}:function(t,n,u,i){void 0===i&&(i=u),t[i]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var c=t(i),s=0;s<c.length;s++)"default"!==c[s]&&n(o,i,c[s]);return u(o,i),o});Object.defineProperty(e,"__esModule",{value:!0}),e.useOptionsGetters=function({key:t,options:n,navigation:u}){const i=o.useRef(n),f=o.useRef({}),{onOptionsChange:b}=(0,c.use)(s.NavigationBuilderContext),{addOptionsGetter:O}=(0,c.use)(l.NavigationStateContext),p=o.useCallback(()=>{const t=u?.isFocused()??!0,n=Object.keys(f.current).length;t&&!n&&b(i.current??{})},[u,b]);o.useEffect(()=>(i.current=n,p(),u?.addListener('focus',p)),[u,n,p]);const _=o.useCallback(()=>{for(const t in f.current)if(t in f.current){const n=f.current[t]?.();if(null!==n)return n}return null},[]),v=o.useCallback(()=>{if(!(u?.isFocused()??!0))return null;const t=_();return null!==t?t:i.current},[u,_]);o.useEffect(()=>O?.(t,v),[v,O,t]);return{addOptionsGetter:o.useCallback((t,n)=>(f.current[t]=n,p(),()=>{delete f.current[t],p()}),[p]),getCurrentOptions:v}};const o=i(r(d[0])),c=r(d[0]),s=r(d[1]),l=r(d[2])},432,[11,417,420]); 495__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,c){void 0===c&&(c=u);var s=Object.getOwnPropertyDescriptor(n,u);s&&!("get"in s?!n.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,c,s)}:function(t,n,u,c){void 0===c&&(c=u),t[c]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),c=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(c){if(c&&c.__esModule)return c;var s={};if(null!=c)for(var o=t(c),i=0;i<o.length;i++)"default"!==o[i]&&n(s,c,o[i]);return u(s,c),s}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSyncState=function(t){const n=o.useRef(l(t)).current,u=o.useSyncExternalStore(n.subscribe,n.getState,n.getState);o.useDebugValue(u);const c=o.useRef([]),s=(0,f.default)(t=>{c.current.push(t)}),i=(0,f.default)(()=>{const t=c.current;c.current=[],0!==t.length&&n.batchUpdates(()=>{for(const n of t)n()})});return{state:u,getState:n.getState,setState:n.setState,scheduleUpdate:s,flushUpdates:i}};const o=c(r(d[0])),i=r(d[1]),f=s(r(d[2])),l=t=>{const n=[];let u,c=!1;let s=!1,o=!1;return{getState:()=>(c||(c=!0,u=(0,i.deepFreeze)(t())),u),setState:t=>{u=(0,i.deepFreeze)(t),o=!0,s||n.forEach(t=>t())},batchUpdates:t=>{s=!0,t(),s=!1,o&&(o=!1,n.forEach(t=>t()))},subscribe:t=>(n.push(t),()=>{const u=n.indexOf(t);u>-1&&n.splice(u,1)})}}},433,[11,434,405]); 496__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.deepFreeze=e.isPlainObject=void 0;e.isPlainObject=t=>'object'==typeof t&&null!==t&&Object.getPrototypeOf(t)===Object.prototype;e.deepFreeze=t=>t},434,[]); 497__d(function(g,r,i,a,m,e,d){"use strict";
497Object.defineProperty(e,"__esModule",{value:!0}),e.createNavigatorFactory=function(t){return function(c){return null!=c?{Navigator:t,Screen:o.Screen,Group:n.Group,config:c}:{Navigator:t,Screen:o.Screen,Group:n.Group}}};const n=r(d[0]),o=r(d[1])},435,[436,437]); 498__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Group=function(u){return null}},436,[]); 499__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Screen=function(n){return null}},437,[]); 500__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),f=0;f<c.length;f++)"default"!==c[f]&&n(u,i,c[f]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.CurrentRenderContext=void 0;const u=i(r(d[0]));e.CurrentRenderContext=u.createContext(void 0)},438,[11]); 501__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getActionFromState=function(n,s){const o=s?t(s):{},l=null!=n.index?n.routes.slice(0,n.index+1):n.routes;if(0===l.length)return;if(!(1===l.length&&void 0===l[0].key||2===l.length&&void 0===l[0].key&&l[0].name===o?.initialRouteName&&void 0===l[1].key))return{type:'RESET',payload:n};const c=n.routes[n.index??n.routes.length-1];let p=c?.state,u=null!=c?o?.screens?.[c.name]:void 0,h={...c?.params};const v=c?{name:c.name,path:c.path,params:h}:void 0;v&&u?.screens&&Object.keys(u.screens).length&&(v.pop=!0);for(;p;){if(0===p.routes.length)return;const t=null!=p.index?p.routes.slice(0,p.index+1):p.routes,n=t[t.length-1];if(Object.assign(h,{initial:void 0,screen:void 0,params:void 0,state:void 0}),1===t.length&&void 0===t[0].key)h.initial=!0,h.screen=n.name;else{if(2!==t.length||void 0!==t[0].key||t[0].name!==u?.initialRouteName||void 0!==t[1].key){h.state=p;break}h.initial=!1,h.screen=n.name}n.state?(h.params={...n.params},h.pop=!0,h=h.params):(h.path=n.path,h.params=n.params),p=n.state,u=u?.screens?.[n.name],u?.screens&&Object.keys(u.screens).length&&(h.pop=!0)}(v?.params.screen||v?.params.state)&&(v.pop=!0);if(!v)return;return{type:'NAVIGATE',payload:v}};const t=t=>'object'==typeof t&&null!=t?{initialRouteName:t.initialRouteName,screens:null!=t.screens?n(t.screens):void 0}:{},n=n=>Object.entries(n).reduce((n,[s,o])=>(n[s]=t(o),n),{})},439,[]); 502__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFocusedRouteNameFromRoute=function(n){const o=n[t.CHILD_STATE]??n.state,s=n.params;return o?o.routes[o.index??('string'==typeof o.type&&'stack'!==o.type?0:o.routes.length-1)].name:'string'==typeof s?.screen?s.screen:void 0};const t=r(d[0])},440,[441]); 503__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,o){void 0===o&&(o=u);var c=Object.getOwnPropertyDescriptor(n,u);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,o,c)}:function(t,n,u,o){void 0===o&&(o=u),t[o]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(o){if(o&&o.__esModule)return o;var c={};if(null!=o)for(var i=t(o),l=0;l<i.length;l++)"default"!==i[l]&&n(c,o,i[l]);return u(c,o),c});
503Object.defineProperty(e,"__esModule",{value:!0}),e.CHILD_STATE=void 0,e.useRouteCache=function(t){const n=c.useMemo(()=>({current:new Map}),[]);return n.current=t.reduce((t,u)=>{const o=n.current.get(u.key),{state:c,...l}=u;let f;return f=o&&(0,i.isRecordEqual)(o,l)?o:l,Object.defineProperty(f,e.CHILD_STATE,{enumerable:!1,configurable:!0,value:c}),t.set(u.key,f),t},new Map),Array.from(n.current.values())};const c=o(r(d[0])),i=r(d[1]);e.CHILD_STATE=Symbol('CHILD_STATE')},441,[11,442]); 504__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isRecordEqual=function(t,n){if(t===n)return!0;const c=Object.keys(t),u=Object.keys(n);if(c.length!==u.length)return!1;return c.every(c=>Object.is(t[c],n[c]))}},442,[]); 505__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,s,i){void 0===i&&(i=s);var o=Object.getOwnPropertyDescriptor(n,s);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[s]}}),Object.defineProperty(t,i,o)}:function(t,n,s,i){void 0===i&&(i=s),t[i]=n[s]}),s=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},t(n)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var c=t(i),u=0;u<c.length;u++)"default"!==c[u]&&n(o,i,c[u]);return s(o,i),o});Object.defineProperty(e,"__esModule",{value:!0}),e.getPathFromState=function(t,n){if(null==t)throw Error(`Got '${String(t)}' for the navigation state. You must pass a valid state object.`);n&&(0,u.validatePathConfig)(n);const s=l(n);let i='/',c=t;const p={};for(;c;){let n,u,l='number'==typeof c.index?c.index:0,m=c.routes[l],h=s;const b=f(t),v=[];let y=!0;for(;m.name in h&&y;){if(n=h[m.name].parts,v.push(m.name),m.params){const t=h[m.name],s=Object.fromEntries(Object.entries(m.params).map(([n,s])=>{if(void 0===s){if(!t)return null;{const s=t.parts?.find(t=>t.param===n)?.optional;if(s)return null}}return[n,(t?.stringify?.[n]??String)(s)]}).filter(t=>null!=t));n?.length&&Object.assign(p,s),b===m&&(u={...s},n?.forEach(({param:t})=>{t&&u&&delete u[t]}))}if(h[m.name].screens&&void 0!==m.state){l='number'==typeof m.state.index?m.state.index:m.state.routes.length-1;const t=m.state.routes[l],n=h[m.name].screens;n&&t.name in n?(m=t,h=n):y=!1}else y=!1}if(void 0!==h[m.name]?i+=n?.map(({segment:t,param:n,optional:s})=>{if('*'===t)return m.name;if(n){const t=p[n];return void 0===t&&s?'':Array.from(String(t)).map(t=>/[^A-Za-z0-9\-._~!$&'()*+,;=:@]/g.test(t)?encodeURIComponent(t):t).join('')}return encodeURIComponent(t)}).join('/'):i+=encodeURIComponent(m.name),!u&&b.params&&(u=Object.fromEntries(Object.entries(b.params).map(([t,n])=>[t,String(n)]))),m.state)i+='/';else if(u){for(const t in u)'undefined'===u[t]&&delete u[t];const t=o.stringify(u,{sort:!1});t&&(i+=`?${t}`)}c=m.state}n?.path&&(i=`${n.path}/${i}`);i=i.replace(/\/+/g,'/'),i=i.length>1?i.replace(/\/$/,''):i,i.startsWith('/')||(i=`/${i}`);return i};const o=i(r(d[0])),c=r(d[1]),u=r(d[2]),f=t=>{const n=null!=t.index?t.routes[t.index]:t.routes[t.routes.length-1];return n.state?f(n.state):n},p=new WeakMap,l=t=>{if(!t?.screens)return{};const n=p.get(t?.screens);if(n)return n;const s=h(t.screens);return p.set(t.screens,s),s};
505const m=(t,n)=>{if('string'==typeof t){const s=(0,c.getPatternParts)(t);return n?{parts:[...n,...s]}:{parts:s}}if(t.exact&&void 0===t.path)throw new Error("A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. `path: ''`.");const s=!0!==t.exact?[...n||[],...t.path?(0,c.getPatternParts)(t.path):[]]:t.path?(0,c.getPatternParts)(t.path):void 0,i=t.screens?h(t.screens,s):void 0;return{parts:s,stringify:t.stringify,screens:i}},h=(t,n)=>Object.fromEntries(Object.entries(t).map(([t,s])=>[t,m(s,n)]))},443,[444,449,450]); 506__d(function(g,r,i,_a,m,e,d){'use strict';const t=r(d[0]),n=r(d[1]),a=r(d[2]),o=r(d[3]),s=Symbol('encodeFragmentIdentifier');function c(t){switch(t.arrayFormat){case'index':return n=>(a,o)=>{const s=a.length;return void 0===o||t.skipNull&&null===o||t.skipEmptyString&&''===o?a:null===o?[...a,[p(n,t),'[',s,']'].join('')]:[...a,[p(n,t),'[',p(s,t),']=',p(o,t)].join('')]};case'bracket':return n=>(a,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&''===o?a:null===o?[...a,[p(n,t),'[]'].join('')]:[...a,[p(n,t),'[]=',p(o,t)].join('')];case'colon-list-separator':return n=>(a,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&''===o?a:null===o?[...a,[p(n,t),':list='].join('')]:[...a,[p(n,t),':list=',p(o,t)].join('')];case'comma':case'separator':case'bracket-separator':{const n='bracket-separator'===t.arrayFormat?'[]=':'=';return a=>(o,s)=>void 0===s||t.skipNull&&null===s||t.skipEmptyString&&''===s?o:(s=null===s?'':s,0===o.length?[[p(a,t),n,p(s,t)].join('')]:[[o,p(s,t)].join(t.arrayFormatSeparator)])}default:return n=>(a,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&''===o?a:null===o?[...a,p(n,t)]:[...a,[p(n,t),'=',p(o,t)].join('')]}}function l(t){let n;switch(t.arrayFormat){case'index':return(t,a,o)=>{n=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,''),n?(void 0===o[t]&&(o[t]={}),o[t][n[1]]=a):o[t]=a};case'bracket':return(t,a,o)=>{n=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,''),n?void 0!==o[t]?o[t]=[].concat(o[t],a):o[t]=[a]:o[t]=a};case'colon-list-separator':return(t,a,o)=>{n=/(:list)$/.exec(t),t=t.replace(/:list$/,''),n?void 0!==o[t]?o[t]=[].concat(o[t],a):o[t]=[a]:o[t]=a};case'comma':case'separator':return(n,a,o)=>{const s='string'==typeof a&&a.includes(t.arrayFormatSeparator),c='string'==typeof a&&!s&&f(a,t).includes(t.arrayFormatSeparator);a=c?f(a,t):a;const l=s||c?a.split(t.arrayFormatSeparator).map(n=>f(n,t)):null===a?a:f(a,t);o[n]=l};case'bracket-separator':return(n,a,o)=>{const s=/(\[\])$/.test(n);if(n=n.replace(/\[\]$/,''),!s)return void(o[n]=a?f(a,t):a);const c=null===a?[]:a.split(t.arrayFormatSeparator).map(n=>f(n,t));void 0!==o[n]?o[n]=[].concat(o[n],c):o[n]=c};default:return(t,n,a)=>{void 0!==a[t]?a[t]=[].concat(a[t],n):a[t]=n}}}function u(t){if('string'!=typeof t||1!==t.length)throw new TypeError('arrayFormatSeparator must be single character string')}function p(n,a){return a.encode?a.strict?t(n):encodeURIComponent(n):n}function f(t,a){return a.decode?n(t):t}function y(t){return Array.isArray(t)?t.sort():'object'==typeof t?y(Object.keys(t)).sort((t,n)=>Number(t)-Number(n)).map(n=>t[n]):t}function b(t){const n=t.indexOf('#');return-1!==n&&(t=t.slice(0,n)),t}function j(t){let n='';const a=t.indexOf('#');return-1!==a&&(n=t.slice(a)),n}function k(t){const n=(t=b(t)).indexOf('?');return-1===n?'':t.slice(n+1)}function F(t,n){return n.parseNumbers&&!Number.isNaN(Number(t))&&'string'==typeof t&&''!==t.trim()?t=Number(t):!n.parseBooleans||null===t||'true'!==t.toLowerCase()&&'false'!==t.toLowerCase()||(t='true'===t.toLowerCase()),t}function O(t,n){u((n=Object.assign({decode:!0,sort:!0,arrayFormat:'none',arrayFormatSeparator:',',parseNumbers:!1,parseBooleans:!1},n)).arrayFormatSeparator);const o=l(n),s=Object.create(null);if('string'!=typeof t)return s;if(!(t=t.trim().replace(/^[?#&]/,'')))return s;for(const c of t.split('&')){if(''===c)continue;let[t,l]=a(n.decode?c.replace(/\+/g,' '):c,'=');l=void 0===l?null:['comma','separator','bracket-separator'].includes(n.arrayFormat)?l:f(l,n),o(f(t,n),l,s)}for(const t of Object.keys(s)){const a=s[t];if('object'==typeof a&&null!==a)for(const t of Object.keys(a))a[t]=F(a[t],n);else s[t]=F(a,n)}return!1===n.sort?s:(!0===n.sort?Object.keys(s).sort():Object.keys(s).sort(n.sort)).reduce((t,n)=>{const a=s[n];return Boolean(a)&&'object'==typeof a&&!Array.isArray(a)?t[n]=y(a):t[n]=a,t},Object.create(null))}e.extract=k,e.parse=O,e.stringify=(t,n)=>{if(!t)return'';u((n=Object.assign({encode:!0,strict:!0,arrayFormat:'none',arrayFormatSeparator:','},n)).arrayFormatSeparator);const a=a=>n.skipNull&&null==t[a]||n.skipEmptyString&&''===t[a],o=c(n),s={};for(const n of Object.keys(t))a(n)||(s[n]=t[n]);const l=Object.keys(s);return!1!==n.sort&&l.sort(n.sort),l.map(a=>{const s=t[a];return void 0===s?'':null===s?p(a,n):Array.isArray(s)?0===s.length&&'bracket-separator'===n.arrayFormat?p(a,n)+'[]':s.reduce(o(a),[]).join('&'):p(a,n)+'='+p(s,n)}).filter(t=>t.length>0).join('&')},e.parseUrl=(t,n)=>{n=Object.assign({decode:!0},n);const[o,s]=a(t,'#');return Object.assign({url:o.split('?')[0]||'',query:O(k(t),n)},n&&n.parseFragmentIdentifier&&s?{fragmentIdentifier:f(s,n)}:{})}
506,e.stringifyUrl=(t,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);const a=b(t.url).split('?')[0]||'',o=e.extract(t.url),c=e.parse(o,{sort:!1}),l=Object.assign(c,t.query);let u=e.stringify(l,n);u&&(u=`?${u}`);let f=j(t.url);return t.fragmentIdentifier&&(f=`#${n[s]?p(t.fragmentIdentifier,n):t.fragmentIdentifier}`),`${a}${u}${f}`},e.pick=(t,n,a)=>{a=Object.assign({parseFragmentIdentifier:!0,[s]:!1},a);const{url:c,query:l,fragmentIdentifier:u}=e.parseUrl(t,a);return e.stringifyUrl({url:c,query:o(l,n),fragmentIdentifier:u},a)},e.exclude=(t,n,a)=>{const o=Array.isArray(n)?t=>!n.includes(t):(t,a)=>!n(t,a);return e.pick(t,o,a)}},444,[445,446,447,448]); 507__d(function(g,r,i,a,m,e,d){'use strict';m.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)},445,[]); 508__d(function(g,r,_i,a,m,e,d){'use strict';var t=new RegExp("(%[a-f0-9]{2})|([^%]+?)",'gi'),n=new RegExp("(%[a-f0-9]{2})+",'gi');function o(t,n){try{return[decodeURIComponent(t.join(''))]}catch(t){}if(1===t.length)return t;n=n||1;var c=t.slice(0,n),p=t.slice(n);return Array.prototype.concat.call([],o(c),o(p))}function c(n){try{return decodeURIComponent(n)}catch(i){for(var c=n.match(t)||[],p=1;p<c.length;p++)c=(n=o(c,p).join('')).match(t)||[];return n}}function p(t){for(var o={'%FE%FF':'\ufffd\ufffd','%FF%FE':'\ufffd\ufffd'},p=n.exec(t);p;){try{o[p[0]]=decodeURIComponent(p[0])}catch(t){var i=c(p[0]);i!==p[0]&&(o[p[0]]=i)}p=n.exec(t)}o['%C2']='\ufffd';for(var f=Object.keys(o),u=0;u<f.length;u++){var y=f[u];t=t.replace(new RegExp(y,'g'),o[y])}return t}m.exports=function(t){if('string'!=typeof t)throw new TypeError('Expected `encodedURI` to be of type `string`, got `'+typeof t+'`');try{return t=t.replace(/\+/g,' '),decodeURIComponent(t)}catch(n){return p(t)}}},446,[]); 509__d(function(g,r,i,a,m,e,d){'use strict';m.exports=(t,n)=>{if('string'!=typeof t||'string'!=typeof n)throw new TypeError('Expected the arguments to be of type `string`');if(''===n)return[t];const s=t.indexOf(n);return-1===s?[t]:[t.slice(0,s),t.slice(s+n.length)]}},447,[]); 510__d(function(g,r,_i,a,m,e,d){'use strict';m.exports=function(t,n){for(var i={},s=Object.keys(t),c=Array.isArray(n),f=0;f<s.length;f++){var o=s[f],u=t[o];(c?-1!==n.indexOf(o):n(o,u,t))&&(i[o]=u)}return i}},448,[]); 511__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPatternParts=function(n){const t=[];let i={segment:''},o=!1,l=!1,p=0;for(let f=0;f<=n.length;f++){const s=n[f];if(null!=s&&(i.segment+=s),':'===s){if(':'===i.segment)l=!0;else if(!o)throw new Error(`Encountered ':' in the middle of a segment in path: ${n}`)}else if('('===s){if(!l)throw new Error(`Encountered '(' without preceding ':' in path: ${n}`);o?p++:o=!0}else if(')'===s){if(!l||!o)throw new Error(`Encountered ')' without preceding '(' in path: ${n}`);p?(p--,i.regex+=s):(o=!1,l=!1)}else if('?'===s){if(!i.param)throw new Error(`Encountered '?' without preceding ':' in path: ${n}`);l=!1,i.optional=!0}else if(null==s||'/'===s&&!o){if(l=!1,i.segment=i.segment.replace(/\/$/,''),''===i.segment)continue;if(i.param&&(i.param=i.param.replace(/^:/,'')),i.regex&&(i.regex=i.regex.replace(/^\(/,'').replace(/\)$/,'')),t.push(i),null==s)break;i={segment:''}}o&&(i.regex=i.regex||'',i.regex+=s),l&&!o&&(i.param=i.param||'',i.param+=s)}if(o)throw new Error(`Could not find closing ')' in path: ${n}`);const f=t.map(n=>n.param).filter(Boolean);for(const[t,i]of f.entries())if(f.indexOf(i)!==t)throw new Error(`Duplicate param name '${i}' found in path: ${n}`);return t}},449,[]); 512__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validatePathConfig=function n(o,s=!0){const c={path:'string',initialRouteName:'string',screens:'object',...s?null:{alias:'array',exact:'boolean',stringify:'object',parse:'object'}};if('object'!=typeof o||null===o)throw new Error(`Expected the configuration to be an object, but got ${JSON.stringify(o)}.`);const f=Object.fromEntries(Object.keys(o).map(t=>{if(!(t in c))return[t,'extraneous'];{const n=c[t],s=o[t];if(void 0!==s)if('array'===n){if(!Array.isArray(s))return[t,`expected 'Array', got '${typeof s}'`]}else if(typeof s!==n)return[t,`expected '${n}', got '${typeof s}'`]}return null}
512).filter(Boolean));if(Object.keys(f).length)throw new Error(`Found invalid properties in the configuration:\n${t(f)}\n\nYou can only specify the following properties:\n${t(c)}\n\nIf you want to specify configuration for screens, you need to specify them under a 'screens' property.\n\nSee https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.`);if(s&&'path'in o&&'string'==typeof o.path&&o.path.includes(':'))throw new Error(`Found invalid path '${o.path}'. The 'path' in the top-level configuration cannot contain patterns for params.`);'screens'in o&&o.screens&&Object.entries(o.screens).forEach(([t,o])=>{'string'!=typeof o&&n(o,!1)})};const t=t=>Object.entries(t).map(([t,n])=>`- ${t} (${n})`).join('\n')},450,[]); 513__d(function(g,r,_i,_a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,s,a){void 0===a&&(a=s);var o=Object.getOwnPropertyDescriptor(n,s);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[s]}}),Object.defineProperty(t,a,o)}:function(t,n,s,a){void 0===a&&(a=s),t[a]=n[s]}),s=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),a=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},t(n)},function(a){if(a&&a.__esModule)return a;var o={};if(null!=a)for(var i=t(a),u=0;u<i.length;u++)"default"!==i[u]&&n(o,a,i[u]);return s(o,a),o}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.getStateFromPath=function(t,n){const{initialRoutes:s,configs:a}=y(n),o=n?.screens;let i=t.replace(/\/+/g,'/').replace(/^\//,'').replace(/\?.*$/,'');i=i.endsWith('/')?i:`${i}/`;const u=n?.path?.replace(/^\//,'');if(u){const t=u.endsWith('/')?u:`${u}/`;if(!i.startsWith(t))return;i=i.replace(t,'')}if(void 0===o){const n=i.split('/').filter(Boolean).map(t=>({name:decodeURIComponent(t)}));return n.length?S(t,n,s):void 0}if('/'===i){const n=a.find(t=>''===t.segments.join('/'));return n?S(t,n.routeNames.map(t=>({name:t})),s,a):void 0}let c,p;const{routes:l,remainingPath:f}=_(i,a);void 0!==l&&(p=S(t,l,s,a),i=f,c=p);if(null==p||null==c)return;return c};const i=o(r(d[0])),u=a(r(d[1])),c=r(d[2]),p=r(d[3]),l=r(d[4]),f=r(d[5]),m=r(d[6]);const h=new WeakMap;function y(t){if(!t)return b();const n=h.get(t);if(n)return n;const s=b(t);return h.set(t,s),s}function b(t){t&&(0,m.validatePathConfig)(t);const n=j(t),s=v(n,t?.screens);O(s);return{initialRoutes:n,configs:s,configWithRegexes:x(s)}}function j(t){const n=[];return t?.initialRouteName&&n.push({initialRouteName:t.initialRouteName,parentScreens:[]}),n}function v(t,n={}){return[].concat(...Object.keys(n).map(s=>N(s,n,t,[],[],[]))).sort((t,n)=>{if((0,f.isArrayEqual)(t.segments,n.segments))return n.routeNames.join('>').localeCompare(t.routeNames.join('>'));if((0,c.arrayStartsWith)(t.segments,n.segments))return-1;if((0,c.arrayStartsWith)(n.segments,t.segments))return 1;for(let s=0;s<Math.max(t.segments.length,n.segments.length);s++){if(null==t.segments[s])return 1;if(null==n.segments[s])return-1;const a='*'===t.segments[s],o='*'===n.segments[s],i=t.segments[s].startsWith(':'),u=n.segments[s].startsWith(':'),c=i&&t.segments[s].includes('('),p=u&&n.segments[s].includes('(');if(!(a&&o||c&&p)){if(a&&!o)return 1;if(o&&!a)return-1;if(i&&!u)return 1;if(u&&!i)return-1;if(c&&!p)return-1;if(p&&!c)return 1}}return t.segments.length-n.segments.length})}function O(t){t.reduce((t,n)=>{const s=n.segments.join('/');if(t[s]){const a=t[s].routeNames,o=n.routeNames;if(!(a.length>o.length?o.every((t,n)=>a[n]===t):a.every((t,n)=>o[n]===t)))throw new Error(`Found conflicting screens with the same pattern. The pattern '${s}' resolves to both '${a.join(' > ')}' and '${o.join(' > ')}'. Patterns must be unique and cannot resolve to more than one screen.`)}return Object.assign(t,{[s]:n})},{})}function x(t){return t.map(t=>({...t,regex:t.regex?new RegExp(t.regex.source+'$'):void 0}))}const _=(t,n)=>{let s,a=t;for(const t of n){if(!t.regex)continue;const o=a.match(t.regex);if(o){s=t.routeNames.map(s=>{const a=n.find(n=>n.screen===s&&(0,c.arrayStartsWith)(t.segments,n.segments)),i=a&&o.groups?Object.fromEntries(Object.entries(o.groups).map(([t,n])=>{const o=Number(t.replace('param_','')),i=a.params.find(t=>t.index===o);return i?.screen===s&&i?.name?[i.name,n]:null}).filter(t=>null!=t).map(([t,n])=>{if(null==n)return[t,void 0];const s=decodeURIComponent(n);return[t,a.parse?.[t]?a.parse[t](s):s]})):void 0;return i&&Object.keys(i).length?{name:s,params:i}:{name:s}}),a=a.replace(o[0],'');break}}return{routes:s,remainingPath:a}},N=(t,n,s,a,o,i)=>{const u=[];i.push(t),o.push(t);const c=n[t];if('string'==typeof c)a.push({screen:t,path:c}),u.push(w(t,[...i],[...a]));else if('object'==typeof c){if('string'==typeof c.path){if(c.exact&&null==c.path)throw new Error(`Screen '${t}' doesn't specify a 'path'. A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. \`path: ''\`.`);const n=[];if(c.alias)for(const s of c.alias)'string'==typeof s?n.push(w(t,[...i],[...a,{screen:t,path:s}],c.parse)):'object'==typeof s&&n.push(w(t,[...i],s.exact?[{screen:t,path:s.path}]:[...a,{screen:t,path:s.path}],s.parse));
513c.exact&&(a.length=0),a.push({screen:t,path:c.path}),u.push(w(t,[...i],[...a],c.parse)),u.push(...n)}if('string'!=typeof c&&'string'!=typeof c.path&&c.alias?.length)throw new Error(`Screen '${t}' doesn't specify a 'path'. A 'path' needs to be specified in order to use 'alias'.`);c.screens&&(c.initialRouteName&&s.push({initialRouteName:c.initialRouteName,parentScreens:o}),Object.keys(c.screens).forEach(t=>{const n=N(t,c.screens,s,[...a],[...o],i);u.push(...n)}))}return i.pop(),u},w=(t,n,s,a)=>{const o=[];for(const{screen:t,path:n}of s)o.push(...(0,l.getPatternParts)(n).map(n=>({...n,screen:t})));return{screen:t,regex:o.length?new RegExp(`^(${o.map((t,n)=>{if(t.param){return`(((?<param_${n}>${t.regex||'[^/]+'})\\/)${t.optional?'?':''})`}return`${'*'===t.segment?'.*':(0,i.default)(t.segment)}\\/`}).join('')})$`):void 0,segments:o.map(t=>t.segment),params:o.map((t,n)=>t.param?{index:n,screen:t.screen,name:t.param}:null).filter(t=>null!=t),routeNames:n,parse:a}},R=(t,n)=>{for(const s of n)if(t===s.routeNames[s.routeNames.length-1])return s.parse},$=(t,n,s)=>{for(const a of s)if(n.length===a.parentScreens.length){let s=!0;for(let t=0;t<n.length;t++)if(0!==n[t].localeCompare(a.parentScreens[t])){s=!1;break}if(s)return t!==a.initialRouteName?a.initialRouteName:void 0}},P=(t,n,s)=>s?t?{index:1,routes:[{name:t},n]}:{routes:[n]}:t?{index:1,routes:[{name:t},{...n,state:{routes:[]}}]}:{routes:[{...n,state:{routes:[]}}]},S=(t,n,s,a)=>{let o=n.shift();const i=[];let u=$(o.name,i,s);i.push(o.name);const c=P(u,o,0===n.length);if(n.length>0){let t=c;for(;o=n.shift();){u=$(o.name,i,s);const a=t.index||t.routes.length-1;t.routes[a].state=P(u,o,0===n.length),n.length>0&&(t=t.routes[a].state),i.push(o.name)}}o=(0,p.findFocusedRoute)(c),o.path=t.replace(/\/$/,'');const l=W(t,a?R(o.name,a):void 0);return l&&(o.params={...o.params,...l}),c},W=(t,n)=>{const s=t.split('?')[1];if(!s)return;const a=u.parse(s);return n&&Object.keys(a).forEach(t=>{Object.hasOwnProperty.call(n,t)&&'string'==typeof a[t]&&(a[t]=n[t](a[t]))}),Object.keys(a).length?a:void 0}},451,[452,444,453,425,449,454,450]); 514__d(function(g,r,i,a,m,e,d){'use strict';m.exports=t=>{if('string'!=typeof t)throw new TypeError('Expected a string');return t.replace(/[|\\{}()[\]^$+*?.]/g,'\\$&').replace(/-/g,'\\x2d')}},452,[]); 515__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayStartsWith=function(t,n){if(n.length>t.length)return!1;return n.every((n,u)=>n===t[u])}},453,[]); 516__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArrayEqual=function(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;return t.every((t,u)=>Object.is(t,n[u]))}},454,[]); 517__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),f=0;f<c.length;f++)"default"!==c[f]&&n(u,o,c[f]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationContext=void 0;const u=o(r(d[0]));e.NavigationContext=u.createContext(void 0)},455,[11]); 518__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)}
518,function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),l=0;l<c.length;l++)"default"!==c[l]&&n(u,o,c[l]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationHelpersContext=void 0;const u=o(r(d[0]));e.NavigationHelpersContext=u.createContext(void 0)},456,[11]); 519__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationIndependentTree=function({children:c}){return(0,n.jsx)(v.NavigationRouteContext.Provider,{value:void 0,children:(0,n.jsx)(t.NavigationContext.Provider,{value:void 0,children:(0,n.jsx)(u.IsFocusedContext.Provider,{value:void 0,children:(0,n.jsx)(o.NavigationIndependentTreeContext.Provider,{value:!0,children:c})})})})};const n=r(d[0]),t=r(d[1]),o=r(d[2]),v=r(d[3]),u=r(d[4])},457,[6,455,419,458,459]); 520__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),l=0;l<c.length;l++)"default"!==c[l]&&n(u,i,c[l]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.NamedRouteContextListContext=e.NavigationRouteContext=void 0,e.NavigationProvider=function({route:t,navigation:n,children:o}){const i=(0,l.use)(v.IsFocusedContext),c=(0,l.use)(v.FocusedRouteKeyContext),f=!(null!=i&&!i)&&c===t.key;return(0,u.jsx)(e.NavigationRouteContext.Provider,{value:t,children:(0,u.jsx)(s.NavigationContext.Provider,{value:n,children:(0,u.jsx)(v.IsFocusedContext.Provider,{value:f,children:o})})})};const u=r(d[0]),c=i(r(d[1])),l=r(d[1]),s=r(d[2]),v=r(d[3]);e.NavigationRouteContext=c.createContext(void 0),e.NamedRouteContextListContext=c.createContext(void 0)},458,[6,11,455,459]); 521__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,u){void 0===u&&(u=o);var i=Object.getOwnPropertyDescriptor(n,o);i&&!("get"in i?!n.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,u,i)}:function(t,n,o,u){void 0===u&&(u=o),t[u]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),u=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(u){if(u&&u.__esModule)return u;var i={};if(null!=u)for(var c=t(u),s=0;s<c.length;s++)"default"!==c[s]&&n(i,u,c[s]);return o(i,u),i});Object.defineProperty(e,"__esModule",{value:!0}),e.IsFocusedContext=e.FocusedRouteKeyContext=void 0,e.useIsFocused=function(){const t=(0,c.use)(e.IsFocusedContext),n=(0,s.useNavigation)(),o=void 0!==t,u=i.useCallback(t=>{if(o)return()=>{};const u=n.addListener('focus',t),i=n.addListener('blur',t);return()=>{u(),i()}},[o,n]),f=i.useSyncExternalStore(u,n.isFocused,n.isFocused);return t??f};const i=u(r(d[0])),c=r(d[0]),s=r(d[1]);e.FocusedRouteKeyContext=i.createContext(void 0),e.IsFocusedContext=i.createContext(void 0)},459,[11,460]); 522__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useNavigation=function(){const u=(0,n.use)(o.NavigationContainerRefContext),s=(0,n.use)(t.NavigationContext);if(void 0===s&&void 0===u)throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");return s??u};const n=r(d[0]),o=r(d[1]),t=r(d[2])},460,[11,418,455]); 523__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)}
523,function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),f=0;f<c.length;f++)"default"!==c[f]&&n(u,o,c[f]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationMetaContext=void 0;const u=o(r(d[0]));e.NavigationMetaContext=u.createContext(void 0)},461,[11]); 524__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),f=0;f<c.length;f++)"default"!==c[f]&&n(u,i,c[f]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.PreventRemoveContext=void 0;const u=i(r(d[0]));e.PreventRemoveContext=u.createContext(void 0)},462,[11]); 525__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,u){void 0===u&&(u=o);var i=Object.getOwnPropertyDescriptor(n,o);i&&!("get"in i?!n.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,u,i)}:function(t,n,o,u){void 0===u&&(u=o),t[u]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),u=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(u){if(u&&u.__esModule)return u;var i={};if(null!=u)for(var v=t(u),s=0;s<v.length;s++)"default"!==v[s]&&n(i,u,v[s]);return o(i,u),i}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PreventRemoveProvider=function({children:t}){const[n]=c.useState(()=>(0,s.nanoid)()),[o,u]=c.useState(()=>new Map),i=(0,l.use)(f.NavigationHelpersContext),h=(0,l.use)(p.NavigationRouteContext),P=(0,l.use)(m.PreventRemoveContext),R=P?.setPreventRemove,b=(0,y.default)((t,n,o)=>{if(o&&(null==i||i?.getState().routes.every(t=>t.key!==n)))throw new Error(`Couldn't find a route with the key ${n}. Is your component inside NavigationContent?`);u(u=>{if(n===u.get(t)?.routeKey&&o===u.get(t)?.preventRemove)return u;const i=new Map(u);return o?i.set(t,{routeKey:n,preventRemove:o}):i.delete(t),i})}),O=[...o.values()].some(({preventRemove:t})=>t);c.useEffect(()=>{if(void 0!==h?.key&&void 0!==R)return R(n,h.key,O),()=>{R(n,h.key,!1)}},[n,O,h?.key,R]);const j=c.useMemo(()=>({setPreventRemove:b,preventedRoutes:_(o)}),[b,o]);return(0,v.jsx)(m.PreventRemoveContext.Provider,{value:j,children:t})};const v=r(d[0]),s=r(d[1]),c=u(r(d[2])),l=r(d[2]),f=r(d[3]),p=r(d[4]),m=r(d[5]),y=i(r(d[6])),_=t=>[...t.values()].reduce((t,{routeKey:n,preventRemove:o})=>(t[n]={preventRemove:t[n]?.preventRemove||o},t),{})},463,[6,260,11,456,458,462,405]); 526__d(function(g,r,_i,_a,_m,e,d){"use strict";var n,t=this&&this.__createBinding||(Object.create?function(n,t,i,o){void 0===o&&(o=i);var c=Object.getOwnPropertyDescriptor(t,i);c&&!("get"in c?!t.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(n,o,c)}:function(n,t,i,o){void 0===o&&(o=i),n[o]=t[i]}),i=this&&this.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),o=this&&this.__importStar||(n=function(t){return n=Object.getOwnPropertyNames||function(n){var t=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[t.length]=i);return t},n(t)}
526,function(o){if(o&&o.__esModule)return o;var c={};if(null!=o)for(var s=n(o),a=0;a<s.length;a++)"default"!==s[a]&&t(c,o,s[a]);return i(c,o),c});Object.defineProperty(e,"__esModule",{value:!0}),e.createComponentForStaticNavigation=f,e.createPathConfigForStaticNavigation=function(n,t,i){let o,c=!1;const s=(n,t,a)=>{const l=(n,t)=>Object.fromEntries(Object.entries(n).sort(([n],[i])=>n===t?-1:i===t?1:0).map(([n,l])=>{const u={};let p;'linking'in l&&('string'==typeof l.linking?u.path=l.linking:Object.assign(u,l.linking),'string'==typeof u.path&&(u.path=u.path.replace(/^\//,'').replace(/\/$/,'')));const f=a||null!=u.path&&''!==u.path;return'config'in l?p=s(l,void 0,f):'screen'in l&&'config'in l.screen&&(l.screen.config.screens||l.screen.config.groups)&&(p=s(l.screen,void 0,f)),p&&(u.screens=p),!i||u.screens||'linking'in l&&null==l.linking||(null!=u.path?a||(n===t&&null!=u.path?c=!0:''===u.path&&(o=void 0)):(a||null!=o||(o=u),u.path=n.replace(/([A-Z]+)/g,'-$1').replace(/^-/,'').toLowerCase())),[n,u]}).filter(([,n])=>Object.keys(n).length>0)),u={};for(const i in n.config)'screens'===i&&n.config.screens&&Object.assign(u,l(n.config.screens,t?.initialRouteName??n.config.initialRouteName)),'groups'===i&&n.config.groups&&Object.entries(n.config.groups).forEach(([,i])=>{Object.assign(u,l(i.screens,t?.initialRouteName??n.config.initialRouteName))});if(0!==Object.keys(u).length)return u},a=s(n,t,!1);i&&o&&!c&&(o.path='');return a};const c=r(d[0]),s=o(r(d[1])),a=r(d[2]),l=r(d[3]),u=s.memo(({component:n})=>{const t=(0,l.useRoute)();return s.createElement(n,{route:t})});u.displayName='Memo(Screen)';const p=(n,t)=>Object.entries(t).map(([t,i])=>{let o,l,p={},h=!1;if('screen'in i){const{screen:n,if:c,...s}=i;l=c,p=s,(0,a.isValidElementType)(n)?o=n:'config'in n&&(h=!0,o=f(n,`${t}Navigator`))}else(0,a.isValidElementType)(i)?o=i:'config'in i&&(h=!0,o=f(i,`${t}Navigator`));if(null==o)throw new Error(`Couldn't find a 'screen' property for the screen '${t}'. This can happen if you passed 'undefined'. You likely forgot to export your component from the file it's defined in, or mixed up default import and named import when importing.`);const m=h?s.createElement(o,{}):(0,c.jsx)(u,{component:o});return()=>null==l||l()?(0,c.jsx)(n,{name:t,...p,children:()=>m},t):null});function f(n,t){const{Navigator:i,Group:o,Screen:s,config:a}=n,{screens:l,groups:u,...f}=a;if(null==l&&null==u)throw new Error("Couldn't find a 'screens' or 'groups' property. Make sure to define your screens under a 'screens' property in the configuration.");const h=[];for(const n in a)'screens'===n&&l&&h.push(...p(s,l)),'groups'===n&&u&&h.push(...Object.entries(u).map(([n,{if:t,...i}])=>{const a=p(s,i.screens);return()=>{const s=a.map(n=>n());return null==t||t()?(0,c.jsx)(o,{navigationKey:n,...i,children:s},n):null}}));const m=()=>{const n=h.map(n=>n());return(0,c.jsx)(i,{...f,children:n})};return m.displayName=t,m}},464,[6,11,465,467]); 527__d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},465,[466]); 528__d(function(g,r,i,a,m,e,d){ 529/** 530 * @license React 531 * react-is.production.js 532 * 533 * Copyright (c) Meta Platforms, Inc. and affiliates. 534 * 535 * This source code is licensed under the MIT license found in the 536 * LICENSE file in the root directory of this source tree. 537 */ 538"use strict";var t=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),b=Symbol.for("react.view_transition"),w=Symbol.for("react.client.reference");function v(w){if("object"==typeof w&&null!==w){var v=w.$$typeof;switch(v){case t:switch(w=w.type){case n:case f:case c:case y:case p:case b:return w;default:switch(w=w&&w.$$typeof){case u:case l:case $:case S:case s:return w;default:return v}}case o:return v}}}e.ContextConsumer=s,e.ContextProvider=u,e.Element=t,e.ForwardRef=l,e.Fragment=n,e.Lazy=$,e.Memo=S,e.Portal=o,e.Profiler=f,e.StrictMode=c,e.Suspense=y,e.SuspenseList=p,e.isContextConsumer=function(t){return v(t)===s},e.isContextProvider=function(t){return v(t)===u},e.isElement=function(o){return"object"==typeof o&&null!==o&&o.$$typeof===t},e.isForwardRef=function(t){return v(t)===l},e.isFragment=function(t){return v(t)===n},e.isLazy=function(t){return v(t)===$},e.isMemo=function(t){return v(t)===S},e.isPortal=function(t){return v(t)===o},e.isProfiler=function(t){return v(t)===f},e.isStrictMode=function(t){return v(t)===c},e.isSuspense=function(t){return v(t)===y},e.isSuspenseList=function(t){return v(t)===p},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===f||t===c||t===y||t===p||t===b||"object"==typeof t&&null!==t&&(t.$$typeof===$||t.$$typeof===S||t.$$typeof===u||t.$$typeof===s||t.$$typeof===l||t.$$typeof===w||void 0!==t.getModuleId)},e.typeOf=v},466,[]); 539__d(function(g,r,i,a,m,e,d){"use strict";
539Object.defineProperty(e,"__esModule",{value:!0}),e.useRoute=function(){const n=(0,o.use)(t.NavigationRouteContext);if(void 0===n)throw new Error("Couldn't find a route object. Is your component inside a screen in a navigator?");return n};const o=r(d[0]),t=r(d[1])},467,[11,458]); 540__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useTheme=function(){const o=(0,n.use)(t.ThemeContext);if(null==o)throw new Error("Couldn't find a theme. Is your component inside NavigationContainer or does it have a theme?");return o};const n=r(d[0]),t=r(d[1])},468,[11,427]); 541__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PrivateValueStore=void 0;e.PrivateValueStore=class{}},469,[]); 542__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,u){void 0===u&&(u=o);var c=Object.getOwnPropertyDescriptor(n,o);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,u,c)}:function(t,n,o,u){void 0===u&&(u=o),t[u]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),u=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(u){if(u&&u.__esModule)return u;var c={};if(null!=u)for(var i=t(u),s=0;s<i.length;s++)"default"!==i[s]&&n(c,u,i[s]);return o(c,u),c});Object.defineProperty(e,"__esModule",{value:!0}),e.useFocusEffect=function(t){const n=(0,i.useNavigation)();if(void 0!==arguments[1]){const t="You passed a second argument to 'useFocusEffect', but it only accepts one argument. If you want to pass a dependency array, you can use 'React.useCallback':\n\nuseFocusEffect(\n React.useCallback(() => {\n // Your code here\n }, [depA, depB])\n);\n\nSee usage guide: https://reactnavigation.org/docs/use-focus-effect";console.error(t)}c.useEffect(()=>{let o,u=!1;const c=()=>{const n=t();if(void 0===n||'function'==typeof n)return n};n.isFocused()&&(o=c(),u=!0);const i=n.addListener('focus',()=>{u||(void 0!==o&&o(),o=c(),u=!0)}),s=n.addListener('blur',()=>{void 0!==o&&o(),o=void 0,u=!1});return()=>{void 0!==o&&o(),i(),s()}},[t,n])};const c=u(r(d[0])),i=r(d[1])},470,[11,460]); 543__d(function(g,_r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},e(t)},function(n){if(n&&n.__esModule)return n;var o={};if(null!=n)for(var s=e(n),i=0;i<s.length;i++)"default"!==s[i]&&t(o,n,s[i]);return r(o,n),o}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};
543Object.defineProperty(_e,"__esModule",{value:!0}),_e.useNavigationBuilder=function(e,t){const r=(0,T.useRegisterNavigator)(),n=(0,p.use)(v.NavigationRouteContext),o='object'==typeof n?.params&&null!=n.params&&(V in n.params&&n.params[V]===n.params),{children:m,layout:L,screenOptions:O,screenLayout:J,screenListeners:H,UNSTABLE_router:Q,...W}=t,X=q(m),Y=(0,U.useLazyValue)(()=>{if(null!=W.initialRouteName&&X.every(e=>e.props.name!==W.initialRouteName))throw new Error(`Couldn't find a screen named '${W.initialRouteName}' to use as 'initialRouteName'.`);const t=e(W);if(null!=Q){const e=Q(t);return{...t,...e}}return t}),Z=X.reduce((e,t)=>{if(t.props.name in e)throw new Error(`A navigator cannot contain multiple 'Screen' components with the same name (found duplicate screen named '${t.props.name}')`);return e[t.props.name]=t,e},{}),ee=X.map(e=>e.props.name),te=ee.reduce((e,t)=>(e[t]=Z[t].keys.map(e=>e??'').join(':'),e),{}),re=ee.reduce((e,t)=>{const{initialParams:r}=Z[t].props;return e[t]=r,e},{}),ae=ee.reduce((e,t)=>Object.assign(e,{[t]:Z[t].props.getId}),{});if(!ee.length)throw new Error("Couldn't find any screens for the navigator. Have you defined any screens as its children?");const ne=u.useCallback(e=>void 0===e.type||e.type===Y.type,[Y.type]),oe=u.useCallback(e=>void 0!==e&&!1===e.stale&&ne(e),[ne]),se=u.useCallback(e=>e.routes.every(e=>!ee.includes(e.name)),[ee]),{state:ie,getState:ue,setState:pe,setKey:ce,getKey:le,getIsInitial:de}=(0,p.use)(h.NavigationStateContext),me=u.useRef(!1),fe=u.useRef(void 0),ye=(0,c.default)(e=>{me.current?fe.current=e:pe(e)}),[ve,ge,he,Se]=u.useMemo(()=>{if(me.current&&fe.current&&ne(fe.current)){return[void 0,oe(fe.current)?fe.current:Y.getRehydratedState(fe.current,{routeNames:ee,routeParamList:re,routeGetIdList:ae}),!1,void 0]}const e=ee.reduce((e,t)=>{const{initialParams:r}=Z[t].props,o=null==n?.params?.state&&!1!==n?.params?.initial&&n?.params?.screen===t?n.params.params:void 0;return e[t]=void 0!==r||void 0!==o?{...r,...o}:void 0,e},{});if(void 0!==ie&&ne(ie)||null!=n?.params?.state||'string'==typeof n?.params?.screen&&!1!==n?.params?.initial||o){const r=o?void 0:n?.params,s=(r?z(r):void 0)??ie,i=null==s?Y.getInitialState({routeNames:ee,routeParamList:e,routeGetIdList:ae}):Y.getRehydratedState(s,{routeNames:ee,routeParamList:e,routeGetIdList:ae});return null!=s&&'lastUnhandled'===t.UNSTABLE_routeNamesChangeBehavior&&se(s)?[s,i,!0,r]:[void 0,i,!1,r]}return[void 0,Y.getInitialState({routeNames:ee,routeParamList:e,routeGetIdList:ae}),!0,void 0]},[ie,Y,ne]),Le=u.useRef(te);u.useEffect(()=>{Le.current=te});const Ne=Le.current,[be,Ce]=u.useState(ve);'lastUnhandled'===t.UNSTABLE_routeNamesChangeBehavior&&ve&&be!==ve&&Ce(ve);let Ee=oe(ie)?ie:ge,Oe=Ee,Re=!1;be?.routes.every(e=>ee.includes(e.name))&&Ee?.routes.every(e=>!ee.includes(e.name))?(Re=!0,Oe=Y.getRehydratedState(be,{routeNames:ee,routeParamList:re,routeGetIdList:ae})):(0,C.isArrayEqual)(Ee.routeNames,ee)&&(0,E.isRecordEqual)(te,Ne)||(Oe=Y.getStateForRouteNamesChange(Ee,{routeNames:ee,routeParamList:re,routeGetIdList:ae,routeKeyChanges:Object.keys(te).filter(e=>e in Ne&&te[e]!==Ne[e])}));let je=n?.params===Se;if(n?.params&&!je){let e;if('object'!=typeof n.params.state||null==n.params.state||o){if('string'==typeof n.params.screen&&(!1===n.params.initial&&he||!o))if(je=!0,'lastUnhandled'!==t.UNSTABLE_routeNamesChangeBehavior||ee.includes(n.params.screen))e=l.CommonActions.navigate({name:n.params.screen,params:n.params.params,path:n.params.path,merge:n.params.merge,pop:n.params.pop});else{const e=z(n.params);null==e||(0,i.default)(e,be)||Ce(e)}}else je=!0,'lastUnhandled'===t.UNSTABLE_routeNamesChangeBehavior&&se(n.params.state)?n.params.state!==be&&Ce(n.params.state):e=l.CommonActions.reset(n.params.state);const r=e?Y.getStateForAction(Oe,e,{routeNames:ee,routeParamList:re,routeGetIdList:ae}):null;Oe=null!==r?Y.getRehydratedState(r,{routeNames:ee,routeParamList:re,routeGetIdList:ae}):Oe}u.useEffect(()=>{je&&'object'==typeof n?.params&&null!=n.params&&Object.defineProperty(n.params,V,{value:n.params,enumerable:!1})},[je,n?.params]);const Pe=Ee!==Oe;(0,D.useScheduleUpdate)(()=>{Pe&&(ye(Oe),Re&&Ce(void 0))}),Ee=Oe,u.useEffect(()=>{fe.current=Ee});const Ae=u.useRef(null);u.useEffect(()=>(me.current=!1,ce(r),de()||Ae.current===Ee||(ye(Ee),Ae.current=Ee),()=>{void 0!==ue()&&le()===r&&(pe(void 0),me.current=!0)}),[]);const we=u.useRef(Ee);we.current=Ee,(0,j.useClientLayoutEffect)(()=>{we.current=null});const Ie=(0,c.default)(()=>{const e=ue();return(0,b.deepFreeze)(oe(e)?e:ge)}),Ge=(0,w.useEventEmitter)(e=>{const t=[];let r;if(e.target?(r=Ee.routes.find(t=>t.key===e.target),r?.name&&t.push(r.name)):(r=Ee.routes[Ee.index],t.push(...Object.keys(Z).filter(e=>r?.name===e))),null==r)return;const n=Ve[r.key].navigation;[].concat(...[H,...t.map(e=>{const{listeners:t}=Z[e].props;return t})].map(t=>{const o='function'==typeof t?t({route:r,navigation:n}):t;return o?Object.keys(o).filter(t=>t===e.type).map(e=>o?.[e]):void 0})).filter((e,t,r)=>e&&r.lastIndexOf(e)===t).forEach(t=>t?.(e))});(0,I.useFocusEvents)({state:Ee,emitter:Ge}),u.useEffect(()=>{Ge.emit({type:'state',data:{state:Ee}})},[Ge,Ee]);const{listeners:Ke,addListener:ke}=(0,R.useChildListeners)(),{keyedListeners:Ue,addKeyedListener:xe}=(0,k.useKeyedChildListeners)(),Be=(0,$.useOnAction)({router:Y,getState:Ie,setState:ye,key:n?.key,actionListeners:Ke.action,beforeRemoveListeners:Ue.beforeRemove,routerConfigOptions:{routeNames:ee,routeParamList:re,routeGetIdList:ae},emitter:Ge}),$e=(0,M.useOnRouteFocus)({router:Y,key:n?.key,getState:Ie,setState:ye}),Fe=(0,p.use)(N.UnhandledActionContext),Me=(0,c.default)(e=>{if('lastUnhandled'===t.UNSTABLE_routeNamesChangeBehavior&&'NAVIGATE'===e.type&&null!=e.payload&&'name'in e.payload&&'string'==typeof e.payload.name&&!ee.includes(e.payload.name)){const t={routes:[{name:e.payload.name,params:'params'in e.payload&&'object'==typeof e.payload.params&&null!==e.payload.params?e.payload.params:void 0,path:'path'in e.payload&&'string'==typeof e.payload.path?e.payload.path:void 0}]};Ce(t)}Fe?.(e)}),Te=(0,x.useNavigationHelpers)({id:t.id,onAction:Be,onUnhandledAction:Me,getState:Ie,emitter:Ge,router:Y,stateRef:we});(0,G.useFocusedListenersChildrenAdapter)({navigation:Te,focusedListeners:Ke.focus}),(0,F.useOnGetState)({getState:Ie,getStateListeners:Ue.getState});const{describe:De,descriptors:Ve}=(0,A.useDescriptors)({state:Ee,screens:Z,navigation:Te,screenOptions:O,screenLayout:J,onAction:Be,getState:Ie,setState:ye,onRouteFocus:$e,addListener:ke,addKeyedListener:xe,router:Y,emitter:Ge});(0,_.useCurrentRender)({state:Ee,navigation:Te,descriptors:Ve});const Je=(0,P.useComponent)(e=>{const t=null!=L?L({state:Ee,descriptors:Ve,navigation:Te,children:e}):e;return(0,s.jsx)(y.NavigationMetaContext.Provider,{value:void 0,children:(0,s.jsx)(f.NavigationHelpersContext.Provider,{value:Te,children:(0,s.jsx)(B.NavigationStateListenerProvider,{state:Ee,children:(0,s.jsx)(K.FocusedRouteKeyContext.Provider,{value:Ee.routes[Ee.index].key,children:(0,s.jsx)(S.PreventRemoveProvider,{children:t})})})})})});return{state:Ee,navigation:Te,describe:De,descriptors:Ve,NavigationContent:Je}};const s=_r(d[0]),i=o(_r(d[1])),u=n(_r(d[2])),p=_r(d[2]),c=(_r(d[3]),o(_r(d[4]))),l=_r(d[5]),m=_r(d[6]),f=_r(d[7]),y=_r(d[8]),v=_r(d[9]),h=_r(d[10]),S=_r(d[
54311]),L=_r(d[12]),N=_r(d[13]),b=_r(d[14]),C=_r(d[15]),E=_r(d[16]),O=_r(d[17]),R=_r(d[18]),j=_r(d[19]),P=_r(d[20]),_=_r(d[21]),A=_r(d[22]),w=_r(d[23]),I=_r(d[24]),G=_r(d[25]),K=_r(d[26]),k=_r(d[27]),U=_r(d[28]),x=_r(d[29]),B=_r(d[30]),$=_r(d[31]),F=_r(d[32]),M=_r(d[33]),T=_r(d[34]),D=_r(d[35]);O.PrivateValueStore;const V=Symbol('CONSUMED_PARAMS'),J=e=>e.type===L.Screen,H=e=>e.type===u.Fragment||e.type===m.Group,q=(e,t,r,n)=>u.Children.toArray(e).reduce((e,o)=>{if(u.isValidElement(o)){if(J(o)){if('object'!=typeof o.props||null===o.props)throw new Error("Got an invalid element for screen.");if('string'!=typeof o.props.name||''===o.props.name)throw new Error(`Got an invalid name (${JSON.stringify(o.props.name)}) for the screen. It must be a non-empty string.`);if(void 0!==o.props.navigationKey&&('string'!=typeof o.props.navigationKey||''===o.props.navigationKey))throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(o.props.navigationKey)}) for the screen '${o.props.name}'. It must be a non-empty string or 'undefined'.`);return e.push({keys:[t,o.props.navigationKey],options:r,layout:n,props:o.props}),e}if(H(o)){if(void 0!==(s=o.props.navigationKey)&&('string'!=typeof s||''===s))throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(o.props.navigationKey)}) for the group. It must be a non-empty string or 'undefined'.`);return e.push(...q(o.props.children,o.props.navigationKey,o.type!==m.Group?r:null!=r?[...r,o.props.screenOptions]:[o.props.screenOptions],'function'==typeof o.props.screenLayout?o.props.screenLayout:n)),e}}var s;throw new Error(`A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found ${u.isValidElement(o)?`'${'string'==typeof o.type?o.type:o.type?.name}'${null!=o.props&&'object'==typeof o.props&&'name'in o.props&&o.props?.name?` for the screen '${o.props.name}'`:''}`:'object'==typeof o?JSON.stringify(o):`'${String(o)}'`}). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.`)},[]),z=e=>null!=e?.state?e.state:'string'==typeof e?.screen&&!1!==e?.initial?{routes:[{name:e.screen,params:e.params,path:e.path}]}:void 0},471,[6,472,11,465,405,406,436,456,461,458,420,463,437,421,434,454,442,469,428,473,474,475,476,429,481,482,459,430,483,484,485,487,489,490,491,492]); 544__d(function(g,r,_i,_a,m,e,d){'use strict';m.exports=function t(n,o){if(n===o)return!0;if(n&&o&&'object'==typeof n&&'object'==typeof o){if(n.constructor!==o.constructor)return!1;var f,u,i;if(Array.isArray(n)){if((f=n.length)!=o.length)return!1;for(u=f;0!==u--;)if(!t(n[u],o[u]))return!1;return!0}if(n.constructor===RegExp)return n.source===o.source&&n.flags===o.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===o.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===o.toString();if((f=(i=Object.keys(n)).length)!==Object.keys(o).length)return!1;for(u=f;0!==u--;)if(!Object.prototype.hasOwnProperty.call(o,i[u]))return!1;for(u=f;0!==u--;){var c=i[u];if(!t(n[c],o[c]))return!1}return!0}return n!=n&&o!=o}},472,[]); 545__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,i){void 0===i&&(i=u);var o=Object.getOwnPropertyDescriptor(n,u);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,i,o)}:function(t,n,u,i){void 0===i&&(i=u),t[i]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var f=t(i),c=0;c<f.length;c++)"default"!==f[c]&&n(o,i,f[c]);return u(o,i),o});Object.defineProperty(e,"__esModule",{value:!0}),e.useClientLayoutEffect=void 0;const o=i(r(d[0]));e.useClientLayoutEffect='undefined'!=typeof document||'undefined'!=typeof navigator&&'ReactNative'===navigator.product?o.useLayoutEffect:o.useEffect},473,[11]); 546__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,o){void 0===o&&(o=u);var c=Object.getOwnPropertyDescriptor(n,u);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,o,c)}:function(t,n,u,o){void 0===o&&(o=u),t[o]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)}
546,function(o){if(o&&o.__esModule)return o;var c={};if(null!=o)for(var i=t(o),f=0;f<i.length;f++)"default"!==i[f]&&n(c,o,i[f]);return u(c,o),c});Object.defineProperty(e,"__esModule",{value:!0}),e.useComponent=function(t){const n=i.useRef(t);return n.current=t,i.useEffect(()=>{n.current=null}),i.useRef(({children:t})=>{const u=n.current;if(null===u)throw new Error('The returned component must be rendered in the same render phase as the hook.');return(0,c.jsx)(f,{render:u,children:t})}).current};const c=r(d[0]),i=o(r(d[1])),f=({render:t,children:n})=>t(n)},474,[6,11]); 547__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useCurrentRender=function({state:o,navigation:s,descriptors:u}){const c=(0,t.use)(n.CurrentRenderContext);c&&s.isFocused()&&(c.options=u[o.routes[o.index].key].options)};const t=r(d[0]),n=r(d[1])},475,[11,438]); 548__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var s=Object.getOwnPropertyDescriptor(n,o);s&&!("get"in s?!n.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,s)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var s={};if(null!=i)for(var u=t(i),c=0;c<u.length;c++)"default"!==u[c]&&n(s,i,u[c]);return o(s,i),s});Object.defineProperty(e,"__esModule",{value:!0}),e.useDescriptors=function({state:t,screens:n,navigation:o,screenOptions:i,screenLayout:O,onAction:b,getState:_,setState:j,addListener:k,addKeyedListener:m,onRouteFocus:S,router:w,emitter:C}){const P=(0,c.use)(h.ThemeContext),[x,D]=u.useState({}),{onDispatchAction:L,onOptionsChange:M,scheduleUpdate:N,flushUpdates:R,stackRef:A}=(0,c.use)(l.NavigationBuilderContext),B=u.useMemo(()=>({navigation:o,onAction:b,addListener:k,addKeyedListener:m,onRouteFocus:S,onDispatchAction:L,onOptionsChange:M,scheduleUpdate:N,flushUpdates:R,stackRef:A}),[o,b,k,m,S,L,M,N,R,A]),{base:U,navigations:F}=(0,v.useNavigationCache)({state:t,getState:_,navigation:o,setOptions:D,router:w,emitter:C}),K=(0,y.useRouteCache)(t.routes),E=(t,o,s)=>{const u=n[t.name],c=u.props;return[i,...u.options?u.options.filter(Boolean):[],c.options,s].reduce((n,i)=>Object.assign(n,'function'!=typeof i?i:i({route:t,navigation:o,theme:P})),{})},T=(t,o,i,u)=>{const c=n[t.name],h=c.props,v=h.layout??c.layout??O;let y=(0,s.jsx)(f.SceneView,{navigation:o,route:t,screen:h,routeState:u,getState:_,setState:j,options:i,clearOptions:()=>D(n=>{if(t.key in n){const{[t.key]:o,...i}=n;return i}return n})});return null!=v&&(y=v({route:t,navigation:o,options:i,theme:P,children:y})),(0,s.jsx)(l.NavigationBuilderContext.Provider,{value:B,children:(0,s.jsx)(p.NavigationProvider,{route:t,navigation:o,children:y})},t.key)},V=K.reduce((n,o,i)=>{const s=F[o.key],u=E(o,s,x[o.key]),c=T(o,s,u,t.routes[i].state);return n[o.key]={route:o,navigation:s,render:()=>c,options:u},n},{});return{describe:(t,n)=>{if(!n){if(!(t.key in V))throw new Error(`Couldn't find a route with the key ${t.key}.`);return V[t.key]}const o=U,i=E(t,o,{}),s=T(t,o,i,void 0);return{route:t,navigation:o,render:()=>s,options:i}},descriptors:V}};const s=r(d[0]),u=i(r(d[1])),c=r(d[1]),l=r(d[2]),p=r(d[3]),f=r(d[4]),h=r(d[5]),v=r(d[6]),y=r(d[7])},476,[6,11,417,458,477,427,480,441]); 549__d(function(g,_r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,r,o){void 0===o&&(o=r);var i=Object.getOwnPropertyDescriptor(n,r);i&&!("get"in i?!n.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,o,i)}:function(t,n,r,o){void 0===o&&(o=r),t[o]=n[r]}),r=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[n.length]=r);return n},t(n)}
549,function(o){if(o&&o.__esModule)return o;var i={};if(null!=o)for(var s=t(o),u=0;u<s.length;u++)"default"!==s[u]&&n(i,o,s[u]);return r(i,o),i});Object.defineProperty(e,"__esModule",{value:!0}),e.SceneView=function({screen:t,route:n,navigation:r,routeState:o,getState:h,setState:m,options:b,clearOptions:k}){const O=s.useRef(void 0),_=s.useCallback(()=>O.current,[]),{addOptionsGetter:j}=(0,y.useOptionsGetters)({key:n.key,options:b,navigation:r}),S=s.useCallback(t=>{O.current=t},[]),C=s.useCallback(()=>{const t=h().routes.find(t=>t.key===n.key);return t?t.state:void 0},[h,n.key]),x=s.useCallback(t=>{const r=h(),o=r.routes.map(r=>r.key===n.key&&r.state!==t?{...r,state:t}:r);(0,p.isArrayEqual)(r.routes,o)||m({...r,routes:o})},[h,n.key,m]),P=s.useRef(!0);s.useEffect(()=>{P.current=!1}),s.useEffect(()=>k,[]);const M=s.useCallback(()=>P.current,[]),w=(0,u.use)(l.NavigationFocusedRouteStateContext),N=s.useMemo(()=>{const t={routes:[{key:n.key,name:n.name,params:n.params,path:n.path}]},r=n=>{const o=n?.routes[0];return o?{routes:[{...o,state:r(o.state)}]}:t};return r(w)},[w,n.key,n.name,n.params,n.path]),E=s.useMemo(()=>({state:o,getState:C,setState:x,getKey:_,setKey:S,getIsInitial:M,addOptionsGetter:j}),[o,C,x,_,S,M,j]),R=t.getComponent?t.getComponent():t.component;return(0,i.jsx)(f.NavigationStateContext.Provider,{value:E,children:(0,i.jsx)(l.NavigationFocusedRouteStateContext.Provider,{value:N,children:(0,i.jsx)(c.EnsureSingleNavigator,{children:(0,i.jsx)(v.StaticContainer,{name:t.name,render:R||t.children,navigation:r,route:n,children:void 0!==R?(0,i.jsx)(R,{navigation:r,route:n}):void 0!==t.children?t.children({navigation:r,route:n}):null})})})})};const i=_r(d[0]),s=o(_r(d[1])),u=_r(d[1]),c=_r(d[2]),l=_r(d[3]),f=_r(d[4]),v=_r(d[5]),p=_r(d[6]),y=_r(d[7])},477,[6,11,416,478,420,479,454,432]); 550__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),f=0;f<c.length;f++)"default"!==c[f]&&n(u,i,c[f]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationFocusedRouteStateContext=void 0;const u=i(r(d[0]));e.NavigationFocusedRouteStateContext=u.createContext(void 0)},478,[11]); 551__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var c=Object.getOwnPropertyDescriptor(n,i);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,c)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var c={};if(null!=o)for(var u=t(o),f=0;f<u.length;f++)"default"!==u[f]&&n(c,o,u[f]);return i(c,o),c});Object.defineProperty(e,"__esModule",{value:!0}),e.StaticContainer=void 0;const c=o(r(d[0]));e.StaticContainer=c.memo(function(t){return t.children},(t,n)=>{const i=Object.keys(t),o=Object.keys(n);if(i.length!==o.length)return!1;for(const o of i)if('children'!==o&&t[o]!==n[o])return!1;return!0})},479,[11]); 552__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var c=Object.getOwnPropertyDescriptor(n,o);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,c)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var c={};if(null!=i)for(var s=t(i),u=0;u<s.length;u++)"default"!==s[u]&&n(c,i,s[u]);return o(c,i),c});
552Object.defineProperty(e,"__esModule",{value:!0}),e.useNavigationCache=function({state:t,getState:n,navigation:o,setOptions:i,router:f,emitter:y}){const{stackRef:p}=(0,s.use)(l.NavigationBuilderContext),h=c.useMemo(()=>{const{emit:t,...n}=o,i={...f.actionCreators,...u.CommonActions},c=()=>{throw new Error('Actions cannot be dispatched from a placeholder screen.')},s=Object.keys(i).reduce((t,n)=>(t[n]=c,t),{});return{...n,...s,addListener:()=>()=>{},removeListener:()=>{},dispatch:c,getParent:t=>void 0!==t&&t===n.getId()?h:n.getParent(t),setOptions:()=>{throw new Error('Options cannot be set from a placeholder screen.')},isFocused:()=>!1}},[o,f.actionCreators]),b=c.useMemo(()=>({current:{}}),[h,n,o,i,y]);return b.current=t.routes.reduce((t,c)=>{const s=b.current[c.key];if(s)t[c.key]=s;else{const s=t=>{const i='function'==typeof t?t(n()):t;null!=i&&o.dispatch({source:c.key,...i})},l=t=>{try{t()}finally{}},p={...f.actionCreators,...u.CommonActions},b=Object.keys(p).reduce((t,n)=>(t[n]=(...t)=>l(()=>s(p[n](...t))),t),{});t[c.key]={...h,...b,...y.create(c.key),dispatch:t=>l(()=>s(t)),getParent:n=>void 0!==n&&n===h.getId()?t[c.key]:h.getParent(n),setOptions:t=>{i(n=>({...n,[c.key]:{...n[c.key],...t}}))},isFocused:()=>{const t=h.getState();return t.routes[t.index].key===c.key&&(!o||o.isFocused())}}}return t},{}),{base:h,navigations:b.current}};const c=i(r(d[0])),s=r(d[0]),u=r(d[1]),l=r(d[2])},480,[11,406,417]); 553__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,i){void 0===i&&(i=u);var o=Object.getOwnPropertyDescriptor(n,u);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,i,o)}:function(t,n,u,i){void 0===i&&(i=u),t[i]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var c=t(i),s=0;s<c.length;s++)"default"!==c[s]&&n(o,i,c[s]);return u(o,i),o});Object.defineProperty(e,"__esModule",{value:!0}),e.useFocusEvents=function({state:t,emitter:n}){const u=(0,c.use)(s.NavigationContext),i=o.useRef(void 0),f=t.routes[t.index].key;o.useEffect(()=>u?.addListener('focus',()=>{i.current=f,n.emit({type:'focus',target:f})}),[f,n,u]),o.useEffect(()=>u?.addListener('blur',()=>{i.current=void 0,n.emit({type:'blur',target:f})}),[f,n,u]),o.useEffect(()=>{const t=i.current;i.current=f,void 0!==t||u||n.emit({type:'focus',target:f}),t===f||u&&!u.isFocused()||void 0!==t&&(n.emit({type:'blur',target:t}),n.emit({type:'focus',target:f}))},[f,n,u])};const o=i(r(d[0])),c=r(d[0]),s=r(d[1])},481,[11,455]); 554__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,i){void 0===i&&(i=u);var o=Object.getOwnPropertyDescriptor(n,u);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,i,o)}:function(t,n,u,i){void 0===i&&(i=u),t[i]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var s=t(i),c=0;c<s.length;c++)"default"!==s[c]&&n(o,i,s[c]);return u(o,i),o});Object.defineProperty(e,"__esModule",{value:!0}),e.useFocusedListenersChildrenAdapter=function({navigation:t,focusedListeners:n}){const{addListener:u}=(0,s.use)(c.NavigationBuilderContext),i=o.useCallback(u=>{if(t.isFocused()){for(const t of n){const{handled:n,result:i}=t(u);if(n)return{handled:n,result:i}}return{handled:!0,result:u(t)}}return{handled:!1,result:null}},[n,t]);o.useEffect(()=>u?.('focus',i),[u,i])};
554const o=i(r(d[0])),s=r(d[0]),c=r(d[1])},482,[11,417]); 555__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,i){void 0===i&&(i=u);var o=Object.getOwnPropertyDescriptor(n,u);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,i,o)}:function(t,n,u,i){void 0===i&&(i=u),t[i]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var c=t(i),f=0;f<c.length;f++)"default"!==c[f]&&n(o,i,c[f]);return u(o,i),o});Object.defineProperty(e,"__esModule",{value:!0}),e.useLazyValue=function(t){const n=o.useRef(void 0);void 0===n.current&&(n.current=t());return n.current};const o=i(r(d[0]))},483,[11]); 556__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),s=0;s<c.length;s++)"default"!==c[s]&&n(u,i,c[s]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.useNavigationHelpers=function({id:t,onAction:n,onUnhandledAction:o,getState:i,emitter:f,router:m,stateRef:v}){const _=(0,c.use)(l.NavigationContext);return u.useMemo(()=>{const u=t=>{const u='function'==typeof t?t(i()):t;n(u)||o?.(u)},c={...m.actionCreators,...s.CommonActions},l=Object.keys(c).reduce((t,n)=>(t[n]=(...t)=>u(c[n](...t)),t),{}),b={..._,...l,dispatch:u,emit:f.emit,isFocused:_?_.isFocused:()=>!0,canGoBack:()=>{const t=i();return null!==m.getStateForAction(t,s.CommonActions.goBack(),{routeNames:t.routeNames,routeParamList:{},routeGetIdList:{}})||_?.canGoBack()||!1},getId:()=>t,getParent:t=>{if(void 0!==t){let n=b;for(;n&&t!==n.getId();)n=n.getParent();return n}return _},getState:()=>null!=v.current?v.current:i()};return b},[m,_,f.emit,i,n,o,t,v])};const u=i(r(d[0])),c=r(d[0]),s=r(d[1]),l=r(d[2]);r(d[3]).PrivateValueStore},484,[11,406,455,469]); 557__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,i){void 0===i&&(i=u);var o=Object.getOwnPropertyDescriptor(n,u);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,i,o)}:function(t,n,u,i){void 0===i&&(i=u),t[i]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var c=t(i),s=0;s<c.length;s++)"default"!==c[s]&&n(o,i,c[s]);return u(o,i),o}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.useNavigationState=function(t){const n=(0,s.use)(h);if(null==n)throw new Error("Couldn't get the navigation state. Is your component inside a navigator?");return(0,l.useSyncExternalStoreWithSelector)(n.subscribe,n.getState,n.getState,t)},e.NavigationStateListenerProvider=function({state:t,children:n}){const u=s.default.useRef([]),i=s.default.useRef(t),o=(0,f.default)(()=>i.current),l=(0,f.default)(t=>(u.current.push(t),()=>{u.current=u.current.filter(n=>n!==t)}));s.default.useLayoutEffect(()=>{i.current=t,u.current.forEach(t=>t())},[t]);const v=s.default.useMemo(()=>({getState:o,subscribe:l}),[o,l]);return(0,c.jsx)(h.Provider,{value:v,children:n})};const c=r(d[0]),s=i(r(d[1])),f=o(r(d[2])),l=r(d[3]);const h=s.default.createContext(void 0)},485,[6,11,405,486]); 558__d(function(g,r,i,a,m,e,d){"use strict";
558Object.defineProperty(e,"__esModule",{value:!0}),e.useSyncExternalStoreWithSelector=function(u,n,l,s,c){const o=(0,t.useRef)(null);let f;null===o.current?(f={hasValue:!1,value:null},o.current=f):f=o.current;const[v,S]=(0,t.useMemo)(()=>{let t,u,o=!1;const v=n=>{if(!o){o=!0,t=n;const l=s(n);if(void 0!==c&&f.hasValue){const t=f.value;if(c(t,l))return u=t,t}return u=l,l}const l=t,v=u;if(Object.is(l,n))return v;const S=s(n);return void 0!==c&&c(v,S)?(t=n,v):(t=n,u=S,S)};return[()=>v(n()),null==l?void 0:()=>v(l())]},[n,l,s,c]),h=(0,t.useSyncExternalStore)(u,v,S);return(0,t.useEffect)(()=>{f.hasValue=!0,f.value=h},[h]),(0,t.useDebugValue)(h),h};const t=r(d[0])},486,[11]); 559__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var s=t(i),c=0;c<s.length;c++)"default"!==s[c]&&n(u,i,s[c]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.useOnAction=function({router:t,getState:n,setState:o,key:i,actionListeners:v,beforeRemoveListeners:h,routerConfigOptions:p,emitter:b}){const{onAction:y,onRouteFocus:_,addListener:O,onDispatchAction:m}=(0,s.use)(f.NavigationBuilderContext),P=(0,s.use)(c.DeprecatedNavigationInChildContext),j=u.useRef(p);u.useEffect(()=>{j.current=p});const A=u.useCallback((u,s=new Set)=>{const c=n();if(s.has(c.key))return!1;if(s.add(c.key),'string'!=typeof u.target||u.target===c.key){let n=t.getStateForAction(c,u,j.current);if(n=null===n&&u.target===c.key?c:n,null!==n){if(m(u,c===n),c!==n){if((0,l.shouldPreventRemove)(b,h,c.routes,n.routes,u))return!0;o(n)}if(void 0!==_){t.shouldActionChangeFocus(u)&&void 0!==i&&_(i)}return!0}}if(void 0!==y&&y(u,s))return!0;if('string'==typeof u.target||'NAVIGATE_DEPRECATED'===u.type||P)for(let t=v.length-1;t>=0;t--){if((0,v[t])(u,s))return!0}return!1},[v,h,b,n,P,i,y,m,_,t,o]);return(0,l.useOnPreventRemove)({getState:n,emitter:b,beforeRemoveListeners:h}),u.useEffect(()=>O?.('action',A),[O,A]),A};const u=i(r(d[0])),s=r(d[0]),c=r(d[1]),f=r(d[2]),l=r(d[3])},487,[11,415,417,488]); 560__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),f=0;f<c.length;f++)"default"!==c[f]&&n(u,i,c[f]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.shouldPreventRemove=void 0,e.useOnPreventRemove=function({getState:t,emitter:n,beforeRemoveListeners:o}){const{addKeyedListener:i}=(0,c.use)(f.NavigationBuilderContext),l=(0,c.use)(s.NavigationRouteContext),v=l?.key;u.useEffect(()=>{if(v)return i?.('beforeRemove',v,i=>{const u=t();return(0,e.shouldPreventRemove)(n,o,u.routes,[],i)})},[i,o,n,t,v])};const u=i(r(d[0])),c=r(d[0]),f=r(d[1]),s=r(d[2]),l=Symbol('VISITED_ROUTE_KEYS');e.shouldPreventRemove=(t,n,o,i,u)=>{const c=i.map(t=>t.key),f=o.filter(t=>!c.includes(t.key)).reverse(),s=u[l]??new Set,v={...u,[l]:s};for(const o of f){if(s.has(o.key))continue;const i=n[o.key]?.(v);if(i)return!0;s.add(o.key);if(t.emit({type:'beforeRemove',target:o.key,data:{action:v}
560,canPreventDefault:!0}).defaultPrevented)return!0}return!1}},488,[11,417,458]); 561__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,u){void 0===u&&(u=o);var i=Object.getOwnPropertyDescriptor(n,o);i&&!("get"in i?!n.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,u,i)}:function(t,n,o,u){void 0===u&&(u=o),t[u]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),u=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(u){if(u&&u.__esModule)return u;var i={};if(null!=u)for(var s=t(u),c=0;c<s.length;c++)"default"!==s[c]&&n(i,u,s[c]);return o(i,u),i});Object.defineProperty(e,"__esModule",{value:!0}),e.useOnGetState=function({getState:t,getStateListeners:n}){const{addKeyedListener:o}=(0,s.use)(c.NavigationBuilderContext),u=(0,s.use)(f.NavigationRouteContext),_=u?u.key:'root',b=i.useCallback(()=>{const o=t(),u=o.routes.map(t=>{const o=n[t.key]?.();return t.state===o?t:{...t,state:o}});return(0,l.isArrayEqual)(o.routes,u)?o:{...o,routes:u}},[t,n]);i.useEffect(()=>o?.('getState',_,b),[o,b,_])};const i=u(r(d[0])),s=r(d[0]),c=r(d[1]),f=r(d[2]),l=r(d[3])},489,[11,417,458,454]); 562__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,u){void 0===u&&(u=o);var i=Object.getOwnPropertyDescriptor(n,o);i&&!("get"in i?!n.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,u,i)}:function(t,n,o,u){void 0===u&&(u=o),t[u]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),u=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(u){if(u&&u.__esModule)return u;var i={};if(null!=u)for(var c=t(u),s=0;s<c.length;s++)"default"!==c[s]&&n(i,u,c[s]);return o(i,u),i});Object.defineProperty(e,"__esModule",{value:!0}),e.useOnRouteFocus=function({router:t,getState:n,key:o,setState:u}){const{onRouteFocus:l}=(0,c.use)(s.NavigationBuilderContext);return i.useCallback(i=>{const c=n(),s=t.getStateForRouteFocus(c,i);s!==c&&u(s),void 0!==l&&void 0!==o&&l(o)},[n,l,t,u,o])};const i=u(r(d[0])),c=r(d[0]),s=r(d[1])},490,[11,417]); 563__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),s=0;s<c.length;s++)"default"!==c[s]&&n(u,o,c[s]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.useRegisterNavigator=function(){const[t]=c.useState(()=>(0,u.nanoid)()),n=(0,s.use)(f.SingleNavigatorContext);if(void 0===n)throw new Error("Couldn't register the navigator. Have you wrapped your app with 'NavigationContainer'?\n\nThis can also happen if there are multiple copies of '@react-navigation' packages installed.");return c.useEffect(()=>{const{register:i,unregister:o}=n;return i(t),()=>o(t)},[n,t]),t};const u=r(d[0]),c=o(r(d[1])),s=r(d[1]),f=r(d[2])},491,[260,11,416]); 564__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useScheduleUpdate=function(n){const{scheduleUpdate:c,flushUpdates:o}=(0,t.use)(u.NavigationBuilderContext);c(n),(0,s.useClientLayoutEffect)(o)};const t=r(d[0]),u=r(d[1]),s=r(d[2])},492,[11,417,473]); 565__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,u){void 0===u&&(u=i);var o=Object.getOwnPropertyDescriptor(n,i);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,u,o)}:function(t,n,i,u){void 0===u&&(u=i),t[u]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),u=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)}
565,function(u){if(u&&u.__esModule)return u;var o={};if(null!=u)for(var c=t(u),f=0;f<c.length;f++)"default"!==c[f]&&n(o,u,c[f]);return i(o,u),o});Object.defineProperty(e,"__esModule",{value:!0}),e.useNavigationContainerRef=function(){const t=o.useRef(null);null==t.current&&(t.current=(0,c.createNavigationContainerRef)());return t.current};const o=u(r(d[0])),c=r(d[1])},493,[11,424]); 566__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,u){void 0===u&&(u=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,u,o)}:function(e,t,n,u){void 0===u&&(u=n),e[u]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(u){if(u&&u.__esModule)return u;var o={};if(null!=u)for(var i=e(u),f=0;f<i.length;f++)"default"!==i[f]&&t(o,u,i[f]);return n(o,u),o}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};
566Object.defineProperty(_e,"__esModule",{value:!0}),_e.usePreventRemove=function(e,t){const[n]=f.useState(()=>(0,i.nanoid)()),u=(0,s.useNavigation)(),{key:o}=(0,v.useRoute)(),{setPreventRemove:_}=(0,l.usePreventRemoveContext)();f.useEffect(()=>(_(n,o,e),()=>{_(n,o,!1)}),[_,n,o,e]);const b=(0,c.default)(n=>{e&&(n.preventDefault(),t({data:n.data}))});f.useEffect(()=>u?.addListener('beforeRemove',b),[u,b])};const i=r(d[0]),f=u(r(d[1])),c=o(r(d[2])),s=r(d[3]),l=r(d[4]),v=r(d[5])},494,[260,11,405,460,495,467]); 567__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.usePreventRemoveContext=function(){const o=(0,t.use)(n.PreventRemoveContext);if(null==o)throw new Error("Couldn't find the prevent remove context. Is your component inside NavigationContent?");return o};const t=r(d[0]),n=r(d[1])},495,[11,462]); 568__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useStateForPath=function(){return(0,t.use)(o.NavigationFocusedRouteStateContext)};const t=r(d[0]),o=r(d[1])},496,[11,478]); 569__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var l=t(o),c=0;c<l.length;c++)"default"!==l[c]&&n(u,o,l[c]);return i(u,o),u}),u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationContainer=void 0;const l=r(d[0]),c=o(r(d[1])),s=r(d[2]),f=u(r(d[3])),h=r(d[4]),v=r(d[5]),m=r(d[6]),_=r(d[7]),S=r(d[8]),p=r(d[9]),b=r(d[10]),P=r(d[11]),O=r(d[12]);globalThis.REACT_NAVIGATION_DEVTOOLS=new WeakMap,e.NavigationContainer=c.forwardRef(function({direction:t=(s.I18nManager.getConstants().isRTL?'rtl':'ltr'),theme:n=S.DefaultTheme,linking:i,fallback:o=null,documentTitle:u,onReady:C,onStateChange:j,...x},T){const L=!!i&&!1!==i.enabled;i?.config&&(0,h.validatePathConfig)(i.config);const k=c.useRef(null);(0,p.useBackButton)(k),(0,b.useDocumentTitle)(k,u);const[y,A]=c.useState(),{getInitialState:D}=(0,P.useLinking)(k,{enabled:L,prefixes:[],...i},A),F=c.useMemo(()=>({options:i}),[i]),M=c.useMemo(()=>({lastUnhandledLink:y,setLastUnhandledLink:A}),[y,A]),R=(0,f.default)(()=>{const t=k.current?.getCurrentRoute()?.path;A(n=>{if(n!==t)return n}),C?.()}),N=(0,f.default)(t=>{const n=k.current?.getCurrentRoute()?.path;A(t=>{if(t!==n)return t}),j?.(t)});c.useEffect(()=>{k.current&&REACT_NAVIGATION_DEVTOOLS.set(k.current,{get linking(){return{...i,enabled:L,prefixes:i?.prefixes??[],getStateFromPath:i?.getStateFromPath??h.getStateFromPath,getPathFromState:i?.getPathFromState??h.getPathFromState,getActionFromState:i?.getActionFromState??h.getActionFromState}}})});const[I,w]=(0,O.useThenable)(D);return c.useImperativeHandle(T,()=>k.current),null!=x.initialState||!L||I?(0,l.jsx)(m.LocaleDirContext.Provider,{value:t,children:(0,l.jsx)(_.UnhandledLinkingContext.Provider,{value:M,children:(0,l.jsx)(v.LinkingContext.Provider,{value:F,children:(0,l.jsx)(h.BaseNavigationContainer,{...x,theme:n,onReady:R,onStateChange:N,initialState:null==x.initialState?w:x.initialState,ref:k})})})}):(0,l.jsx)(m.LocaleDirContext.Provider,{value:t,children:(0,l.jsx)(h.ThemeProvider,{value:n,children:o})})})},497,[6,11,263,405,403,498,499,500,501,503,504,505,508]); 570__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)}
570,function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),f=0;f<c.length;f++)"default"!==c[f]&&n(u,o,c[f]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.LinkingContext=void 0;const u=o(r(d[0]));e.LinkingContext=u.createContext({get options(){throw new Error("Couldn't find a LinkingContext context.")}}),e.LinkingContext.displayName='LinkingContext'},498,[11]); 571__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var c=Object.getOwnPropertyDescriptor(n,o);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,c)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var c={};if(null!=i)for(var u=t(i),l=0;l<u.length;l++)"default"!==u[l]&&n(c,i,u[l]);return o(c,i),c});Object.defineProperty(e,"__esModule",{value:!0}),e.LocaleDirContext=void 0;const c=i(r(d[0]));e.LocaleDirContext=c.createContext('ltr'),e.LocaleDirContext.displayName='LocaleDirContext'},499,[11]); 572__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var l=Object.getOwnPropertyDescriptor(n,i);l&&!("get"in l?!n.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,l)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var l={};if(null!=o)for(var u=t(o),c=0;c<u.length;c++)"default"!==u[c]&&n(l,o,u[c]);return i(l,o),l});Object.defineProperty(e,"__esModule",{value:!0}),e.UnhandledLinkingContext=void 0;const l=o(r(d[0])),u="Couldn't find an UnhandledLinkingContext context.";e.UnhandledLinkingContext=l.createContext({get lastUnhandledLink(){throw new Error(u)},get setLastUnhandledLink(){throw new Error(u)}}),e.UnhandledLinkingContext.displayName='UnhandledLinkingContext'},500,[11]); 573__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultTheme=void 0;const t=r(d[0]);e.DefaultTheme={dark:!1,colors:{primary:'rgb(0, 122, 255)',background:'rgb(242, 242, 242)',card:'rgb(255, 255, 255)',text:'rgb(28, 28, 30)',border:'rgb(216, 216, 216)',notification:'rgb(255, 59, 48)'},fonts:t.fonts}},501,[502]); 574__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fonts=void 0;const t=r(d[0]),o='system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';e.fonts=t.Platform.select({web:{regular:{fontFamily:o,fontWeight:'400'},medium:{fontFamily:o,fontWeight:'500'},bold:{fontFamily:o,fontWeight:'600'},heavy:{fontFamily:o,fontWeight:'700'}},ios:{regular:{fontFamily:'System',fontWeight:'400'},medium:{fontFamily:'System',fontWeight:'500'},bold:{fontFamily:'System',fontWeight:'600'},heavy:{fontFamily:'System',fontWeight:'700'}},default:{regular:{fontFamily:'sans-serif',fontWeight:'normal'},medium:{fontFamily:'sans-serif-medium',fontWeight:'normal'},bold:{fontFamily:'sans-serif',fontWeight:'600'},heavy:{fontFamily:'sans-serif',fontWeight:'700'}}})},502,[263]); 575__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useBackButton=function(t){}},503,[]); 576__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var u=Object.getOwnPropertyDescriptor(t,n);
576u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,u)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var i=e(o),c=0;c<i.length;c++)"default"!==i[c]&&t(u,o,i[c]);return n(u,o),u});Object.defineProperty(_e,"__esModule",{value:!0}),_e.useDocumentTitle=function(e,{enabled:t=!0,formatter:n=(e,t)=>e?.title??t?.name}={}){u.useEffect(()=>{if(!t)return;const o=e.current;if(o){const e=n(o.getCurrentOptions(),o.getCurrentRoute());document.title=e}return o?.addListener('options',e=>{const t=n(e.data.options,o?.getCurrentRoute());document.title=t})})};const u=o(r(d[0]))},504,[11]); 577__d(function(g,_r,_i,_a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},e(t)},function(n){if(n&&n.__esModule)return n;var o={};if(null!=n)for(var s=e(n),u=0;u<s.length;u++)"default"!==s[u]&&t(o,n,s[u]);return r(o,n),o}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};
577Object.defineProperty(_e,"__esModule",{value:!0}),_e.series=void 0,_e.useLinking=function(e,{enabled:t=!0,config:r,getStateFromPath:n=c.getStateFromPath,getPathFromState:o=c.getPathFromState,getActionFromState:l=c.getActionFromState},h){const p=(0,c.useNavigationIndependentTree)();u.useEffect(()=>{},[t,p]);const[y]=u.useState(a.createMemoryHistory),v=u.useRef(t),m=u.useRef(r),R=u.useRef(n),_=u.useRef(o),b=u.useRef(l);u.useEffect(()=>{v.current=t,m.current=r,R.current=n,_.current=o,b.current=l});const k=u.useCallback(t=>{const r=e.current,n=r?.getRootState();return t?.routes.some(e=>!n?.routeNames.includes(e.name))},[e]),w=u.useContext(i.ServerContext),S=u.useCallback(()=>{let e;if(v.current){const t=w?.location??('undefined'!=typeof window?window.location:void 0),r=t?t.pathname+t.search:void 0;r&&(e=R.current(r,m.current)),h(r)}const t={then:t=>Promise.resolve(t?t(e):e),catch:()=>t};return t},[]),P=u.useRef(void 0),O=u.useRef(void 0),F=u.useRef(void 0);return u.useEffect(()=>(P.current=y.index,y.listen(()=>{const r=e.current;if(!r||!t)return;const{location:n}=window,o=n.pathname+n.search,s=y.index,u=P.current??0;P.current=s,F.current=o;const c=y.get(s);if(c?.path===o&&c?.state)return void r.resetRoot(c.state);const i=R.current(o,m.current);if(i){if(h(o),k(i))return;if(s>u){const e=b.current(i,m.current);if(void 0!==e)try{r.dispatch(e)}catch(e){console.warn(`An error occurred when trying to handle the link '${o}': ${'object'==typeof e&&null!=e&&'message'in e?e.message:e}`)}else r.resetRoot(i)}else r.resetRoot(i)}else r.resetRoot(i)})),[t,y,h,e,k]),u.useEffect(()=>{if(!t)return;const r=(e,t)=>{let r;if(e?.path){const t=R.current(e.path,m.current);if(t){const n=(0,c.findFocusedRoute)(t);n&&n.name===e.name&&(0,s.default)(n.params,e.params)&&(r=e.path)}}null==r&&(r=_.current(t,m.current));const n=O.current?(0,c.findFocusedRoute)(O.current):void 0;return n&&e&&'key'in n&&'key'in e&&n.key===e.key&&(r+=location.hash),r};if(e.current){const t=e.current.getRootState();if(t){const e=(0,c.findFocusedRoute)(t),n=r(e,t);void 0===O.current&&(O.current=t),y.replace({path:n,state:t})}}return e.current?.addListener('state',(0,_e.series)(async()=>{const n=e.current;if(!n||!t)return;const o=O.current,s=n.getRootState();if(!s)return;const u=F.current,i=(0,c.findFocusedRoute)(s),a=r(i,s);O.current=s,F.current=void 0;const[l,h]=f(o,s);if(l&&h&&a!==u){const e=(h.history?h.history.length:h.routes.length)-(l.history?l.history.length:l.routes.length);if(e>0)y.push({path:a,state:s});else if(e<0){const t=y.backIndex({path:a}),r=y.index;try{-1!==t&&t<r&&y.get(t)?await y.go(t-r):await y.go(e),y.replace({path:a,state:s})}catch(e){}}else y.replace({path:a,state:s})}else y.replace({path:a,state:s})}))},[t,y,e]),{getInitialState:S}};const s=o(_r(d[0])),u=n(_r(d[1])),c=_r(d[2]),i=_r(d[3]),a=_r(d[4]),f=(e,t)=>{if(void 0===e||void 0===t||e.key!==t.key)return[void 0,void 0];const r=e.history?e.history.length:e.routes.length,n=t.history?t.history.length:t.routes.length,o=e.routes[e.index],s=t.routes[t.index],u=o?.state,c=s?.state;return r!==n||o?.key!==s?.key||void 0===u||void 0===c||u.key!==c.key?[e,t]:f(u,c)};_e.series=e=>{let t=Promise.resolve();return()=>{t=t.then(e)}}},505,[472,11,403,506,507]); 578__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),f=0;f<c.length;f++)"default"!==c[f]&&n(u,i,c[f]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.ServerContext=void 0;const u=i(r(d[0]));e.ServerContext=u.createContext(void 0)},506,[11]); 579__d(function(g,r,_i,a,m,e,d){"use strict";
579Object.defineProperty(e,"__esModule",{value:!0}),e.createMemoryHistory=function(){let n=0,i=[];const o=[],s=()=>{o.forEach(t=>{const n=t.cb;t.cb=()=>n(!0)})};return{get index(){const t=window.history.state?.id;if(t){const n=i.findIndex(n=>n.id===t);return n>-1?n:0}return 0},get:t=>i[t],backIndex({path:t}){for(let o=n-1;o>=0;o--){const n=i[o];if(n?.path===t)return o}return-1},push({path:o,state:c}){s();const h=(0,t.nanoid)();i=i.slice(0,n+1),i.push({path:o,state:c,id:h}),n=i.length-1,window.history.pushState({id:h},'',o)},replace({path:o,state:c}){s();const h=window.history.state?.id??(0,t.nanoid)();let w=o;const p=w.includes('#')?'':location.hash;!i.length||i.findIndex(t=>t.id===h)<0?(w+=p,i=[{path:w,state:c,id:h}],n=0):(i[n]?.path===o&&(w+=p),i[n]={path:o,state:c,id:h}),window.history.replaceState({id:h},'',w)},go(t){s();const c=n+t,h=i.length-1;if(t<0&&!i[c]?(t=-n,n=0):t>0&&c>h?(t=h-n,n=h):n=c,0!==t)return new Promise((i,s)=>{const c=t=>{if(clearTimeout(h),t)return void s(new Error('History was changed during navigation.'));const{title:n}=window.document;window.document.title='',window.document.title=n,i()};o.push({ref:c,cb:c});const h=setTimeout(()=>{const t=o.findIndex(t=>t.ref===c);t>-1&&(o[t]?.cb(),o.splice(t,1)),n=this.index},100),w=()=>{n=this.index;const t=o.pop();window.removeEventListener('popstate',w),t?.cb()};window.addEventListener('popstate',w),window.history.go(t)})},listen(t){const i=()=>{n=this.index,o.length||t()};return window.addEventListener('popstate',i),()=>window.removeEventListener('popstate',i)}}};const t=r(d[0])},507,[260]); 580__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,i){void 0===i&&(i=u);var o=Object.getOwnPropertyDescriptor(n,u);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,i,o)}:function(t,n,u,i){void 0===i&&(i=u),t[i]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var c=t(i),l=0;l<c.length;l++)"default"!==c[l]&&n(o,i,c[l]);return u(o,i),o});Object.defineProperty(e,"__esModule",{value:!0}),e.useThenable=function(t){const[n]=o.useState(t);let u=[!1,void 0];n.then(t=>{u=[!0,t]});const[i,c]=o.useState(u),[l]=i;return o.useEffect(()=>{let t=!1;return l||(async()=>{let u;try{u=await n}finally{t||c([!0,u])}})(),()=>{t=!0}},[n,l]),i};const o=i(r(d[0]))},508,[11]); 581__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(o){if(o&&o.__esModule)return o;var i={};if(null!=o)for(var s=e(o),c=0;c<s.length;c++)"default"!==s[c]&&t(i,o,s[c]);return n(i,o),i});
581Object.defineProperty(_e,"__esModule",{value:!0}),_e.Link=function({screen:e,params:t,action:n,href:o,style:l,...f}){const{colors:p,fonts:_}=(0,c.useTheme)(),b=(0,u.useLinkProps)({screen:e,params:t,action:n,href:o}),P=e=>{'onPress'in f&&f.onPress?.(e),e.defaultPrevented||b.onPress(e)};return i.createElement(s.Text,{...b,...f,...s.Platform.select({web:{onClick:P},default:{onPress:P}}),style:[{color:p.primary},_.regular,l]})};const i=o(r(d[0])),s=r(d[1]),c=r(d[2]),u=r(d[3])},509,[11,263,403,510]); 582__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var s=e(i),u=0;u<s.length;u++)"default"!==s[u]&&t(o,i,s[u]);return n(o,i),o});
582Object.defineProperty(_e,"__esModule",{value:!0}),_e.useLinkProps=function({screen:e,params:t,href:n,action:i}){const f=o.useContext(u.NavigationContainerRefContext),p=o.useContext(u.NavigationHelpersContext),{options:v}=o.useContext(c.LinkingContext),b=v?.getPathFromState??u.getPathFromState;return{href:n??('web'===s.Platform.OS&&null!=e?b({routes:[{name:e,params:t,state:l(t)}]},v?.config):void 0),role:'link',onPress:n=>{let o=!1;if('web'===s.Platform.OS&&n){const e='metaKey'in n&&n.metaKey||'altKey'in n&&n.altKey||'ctrlKey'in n&&n.ctrlKey||'shiftKey'in n&&n.shiftKey,t=!('button'in n)||null==n.button||0===n.button,i=!n.currentTarget||!('target'in n.currentTarget)||[void 0,null,'','self'].includes(n.currentTarget.target);!e&&t&&i&&(n.preventDefault?.(),o=!0)}else n?.preventDefault?.(),o=!0;if(o)if(i)if(p)p.dispatch(i);else{if(!f)throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");f.dispatch(i)}else p?.navigate(e,t)}}};const o=i(r(d[0])),s=r(d[1]),u=r(d[2]),c=r(d[3]),l=e=>e?.state?e.state:e?.screen?{routes:[{name:e.screen,params:e.params,state:e.screen?l(e.params):void 0}]}:void 0},510,[11,263,403,498]); 583__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),l=0;l<c.length;l++)"default"!==c[l]&&n(u,i,c[l]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.ServerContainer=function({ref:t,children:n,location:o}){c.useEffect(()=>{console.error("'ServerContainer' should only be used on the server with 'react-dom/server' for SSR.")},[]);const i={};if(t){const n={getCurrentOptions:()=>i.options};'function'==typeof t?t(n):t.current=n}return(0,u.jsx)(f.ServerContext.Provider,{value:{location:o},children:(0,u.jsx)(l.CurrentRenderContext.Provider,{value:i,children:n})})};const u=r(d[0]),c=i(r(d[1])),l=r(d[2]),f=r(d[3])},511,[6,11,403,506]); 584__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DarkTheme=void 0;const o=r(d[0]);e.DarkTheme={dark:!0,colors:{primary:'rgb(10, 132, 255)',background:'rgb(1, 1, 1)',card:'rgb(18, 18, 18)',text:'rgb(229, 229, 231)',border:'rgb(39, 39, 41)',notification:'rgb(255, 69, 58)'},fonts:o.fonts}},512,[502]); 585__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},513,[]); 586__d(function(g,_r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,r,o){void 0===o&&(o=r);var i=Object.getOwnPropertyDescriptor(n,r);i&&!("get"in i?!n.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,o,i)}:function(t,n,r,o){void 0===o&&(o=r),t[o]=n[r]}),r=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[n.length]=r);return n},t(n)},function(o){if(o&&o.__esModule)return o;var i={};if(null!=o)for(var u=t(o),s=0;s<u.length;s++)"default"!==u[s]&&n(i,o,u[s]);return r(i,o),i});Object.defineProperty(e,"__esModule",{value:!0}),e.useBuildAction=void 0,e.useBuildHref=f,e.useLinkBuilder=function(){const t=f(),n=(0,e.useBuildAction)();return{buildHref:t,buildAction:n}};const i=o(_r(d[0])),u=_r(d[0]),s=_r(d[1]),c=_r(d[2]);function f(){const t=(0,u.use)(s.NavigationHelpersContext),n=(0,u.use)(s.NavigationRouteContext),{options:r}
586=(0,u.use)(c.LinkingContext),o=(0,s.useStateForPath)(),f=r?.getPathFromState??s.getPathFromState;return i.useCallback((i,u)=>{if(!1===r?.enabled)return;const c=!!(t&&n?.key&&o)&&(n.key===(0,s.findFocusedRoute)(o)?.key&&t.getState().routes.some(t=>t.key===n.key)),l={routes:[{name:i,params:u}]},h=t=>{if(t){const n=t.routes[0];return c&&!n.state?l:{routes:[{...n,state:h(n.state)}]}}return l},b=h(o);return f(b,r?.config)},[r?.enabled,r?.config,n?.key,t,o,f])}e.useBuildAction=()=>{const{options:t}=(0,u.use)(c.LinkingContext),n=t?.getStateFromPath??s.getStateFromPath,r=t?.getActionFromState??s.getActionFromState;return i.useCallback(o=>{if(!o.startsWith('/'))throw new Error(`The href must start with '/' (${o}).`);const i=n(o,t?.config);if(i){return r(i,t?.config)??s.CommonActions.reset(i)}throw new Error('Failed to parse the href to a navigation state.')},[t?.config,n,r])}},514,[11,403,498]); 587__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),f=0;f<c.length;f++)"default"!==c[f]&&n(u,o,c[f]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.useLinkTo=function(){const t=u.useContext(c.NavigationContainerRefContext),n=(0,f.useBuildAction)();return u.useCallback(i=>{if(void 0===t)throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");const o=n(i);t.dispatch(o)},[n,t])};const u=o(r(d[0])),c=r(d[1]),f=r(d[2])},515,[11,403,514]); 588__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useLocale=function(){const o=(0,t.use)(n.LocaleDirContext);if(void 0===o)throw new Error("Couldn't determine the text direction. Is your component inside NavigationContainer?");return{direction:o}};const t=r(d[0]),n=r(d[1])},516,[11,499]); 589__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),f=0;f<c.length;f++)"default"!==c[f]&&n(u,i,c[f]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.useRoutePath=function(){const{options:t}=(0,c.use)(s.LinkingContext),n=(0,f.useStateForPath)();if(void 0===n)throw new Error("Couldn't find a state for the route object. Is your component inside a screen in a navigator?");const o=t?.getPathFromState??f.getPathFromState;return u.useMemo(()=>{if(!1===t?.enabled)return;return o(n,t?.config)},[t?.enabled,t?.config,n,o])};const u=i(r(d[0])),c=r(d[0]),f=r(d[1]),s=r(d[2])},517,[11,403,498]); 590__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var c=Object.getOwnPropertyDescriptor(t,n);c&&!("get"in c?!t.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,c)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)}
590,function(o){if(o&&o.__esModule)return o;var c={};if(null!=o)for(var l=e(o),i=0;i<l.length;i++)"default"!==l[i]&&t(c,o,l[i]);return n(c,o),c});Object.defineProperty(_e,"__esModule",{value:!0}),_e.useScrollToTop=function(e){const t=(0,l.use)(i.NavigationContext),n=(0,i.useRoute)();if(void 0===t)throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");c.useEffect(()=>{const o=[];let c=t;for(;c;)'tab'===c.getState().type&&o.push(c),c=c.getParent();if(0===o.length)return;const l=o.map(c=>c.addListener('tabPress',c=>{const l=t.isFocused(),i=o.includes(t)||t.getState().routes[0].key===n.key;requestAnimationFrame(()=>{const t=u(e);l&&i&&t&&!c.defaultPrevented&&('scrollToTop'in t?t.scrollToTop():'scrollTo'in t?t.scrollTo({y:0,animated:!0}):'scrollToOffset'in t?t.scrollToOffset({offset:0,animated:!0}):'scrollResponderScrollTo'in t&&t.scrollResponderScrollTo({y:0,animated:!0}))})}));return()=>{l.forEach(e=>e())}},[t,e,n.key])};const c=o(r(d[0])),l=r(d[0]),i=r(d[1]);function u(e){return null==e.current?null:'scrollToTop'in e.current||'scrollTo'in e.current||'scrollToOffset'in e.current||'scrollResponderScrollTo'in e.current?e.current:'getScrollResponder'in e.current?e.current.getScrollResponder():'getNode'in e.current?e.current.getNode():e.current}},518,[11,403]); 591__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeTabsBottomAccessory=e.NativeTabsTriggerBadge=e.NativeTabsTriggerPromiseIcon=e.NativeTabsTriggerVectorIcon=e.NativeTabsTriggerIcon=e.NativeTabsTriggerLabel=void 0;const t=r(d[0]);e.NativeTabsTriggerLabel=t.Label,e.NativeTabsTriggerIcon=t.Icon,e.NativeTabsTriggerVectorIcon=t.VectorIcon;e.NativeTabsTriggerPromiseIcon=function(t){return null},e.NativeTabsTriggerBadge=t.Badge;e.NativeTabsBottomAccessory=()=>null},519,[520]); 592__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,o,c){void 0===c&&(c=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,c,u)}:function(t,n,o,c){void 0===c&&(c=o),t[c]=n[o]}),n=this&&this.__exportStar||function(n,o){for(var c in n)"default"===c||Object.prototype.hasOwnProperty.call(o,c)||t(o,n,c)};Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.Screen=void 0;var o=r(d[0]);Object.defineProperty(e,"Screen",{enumerable:!0,get:function(){return o.Screen}}),Object.defineProperty(e,"Group",{enumerable:!0,get:function(){return o.Group}}),n(r(d[1]),e),n(r(d[2]),e)},520,[521,522,523]); 593__d(function(g,r,i,a,m,e,d){"use strict";var o;Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.Screen=void 0;o=(0,r(d[0]).createNavigatorFactory)({})(),e.Screen=o.Screen,e.Group=o.Group},521,[401]); 594__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},522,[]); 595__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Badge=function(n){return null},e.Icon=function(n){return null},e.VectorIcon=function(n){return null},e.Label=function(n){return null}},523,[]); 596__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.appendIconOptions=function(o,c){'src'in c&&c.src&&(0,n.applyIconSrcOptions)(o,c);(0,n.applySelectedColor)(o,c.selectedColor)},e.convertOptionsIconToScreensPropsIcon=function(n,o){return},e.resolveIconRenderingMode=function(n,o){return};const n=r(d[0])},524,[525]); 597__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.applyIconSrcOptions=function(n,c){const t=o(c);n.icon=t?.icon,n.selectedIcon=t?.selectedIcon},e.applySelectedColor=function(n,c){c&&(n.selectedIconColor=c)};const n=r(d[0]),c=r(d[1]);function o(n){if(n&&n.src){const{defaultIcon:c,selected:o}='object'==typeof n.src&&'selected'in n.src?{defaultIcon:n.src.default,selected:n.src.selected}:{defaultIcon:n.src},s={};return s.icon=t(c,{renderingMode:n.renderingMode}),s.selectedIcon=t(o,{renderingMode:n.renderingMode}),s}}function t(o,t){if(o)return(0,n.isValidElement)(o)?(0,c.convertComponentSrcToImageSource)(o,t.renderingMode):{src:o,renderingMode:t.renderingMode}}},525,[11,526]); 598__d(function(g,r,i,a,m,e,d){"use strict";
598Object.defineProperty(e,"__esModule",{value:!0}),e.convertIconColorPropToObject=function(n){if(n)return'object'==typeof n&&('default'in n||'selected'in n)?n:{default:n};return{}},e.useAwaitedScreensIcon=function(o){const t=o&&'object'==typeof o&&'src'in o?o.src:void 0,s=o&&'object'==typeof o&&'renderingMode'in o?o.renderingMode:void 0,[u,f]=(0,n.useState)(void 0);return(0,n.useEffect)(()=>{(async()=>{if(t&&t instanceof Promise){const n=await t;n&&f({src:n})}})()},[t]),(0,n.useMemo)(()=>{const n=c(o)?o:u;return n&&s&&'src'in n?{...n,renderingMode:s}:n},[u,o,s])},e.convertComponentSrcToImageSource=function(n,c){let s;if((0,o.isChildOfType)(n,t.NativeTabsTriggerVectorIcon)){const o=n.props;s={src:o.family.getImageSource(o.name,24,'white')}}else{if(!(0,o.isChildOfType)(n,t.NativeTabsTriggerPromiseIcon))return void console.warn('Only VectorIcon is supported as a React element in Icon.src');s={src:n.props.loader()}}c&&(s={...s,renderingMode:c});return s};const n=r(d[0]),o=r(d[1]),t=r(d[2]);function c(n){return!n||!('src'in n&&n.src instanceof Promise)}},526,[11,527,519]); 599__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isChildOfType=n,e.getFirstChildOfType=function(l,f){return t.Children.toArray(l).find(t=>n(t,f))},e.getAllChildrenOfType=function(l,f){return t.Children.toArray(l).filter(t=>n(t,f))},e.getAllChildrenNotOfType=function(l,f){return t.Children.toArray(l).filter(t=>!n(t,f))},e.filterAllowedChildrenElements=function(n,l){return t.Children.toArray(n).filter(n=>(0,t.isValidElement)(n)&&l.includes(n.type))};const t=r(d[0]);function n(n,l){return(0,t.isValidElement)(n)&&n.type===l}},527,[11]); 600__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PreviewRouteContext=void 0,e.usePreviewInfo=o,e.useIsPreview=function(){const{isPreview:t}=o();return t};const t=r(d[0]);function o(){const o=(0,t.use)(e.PreviewRouteContext);return{isPreview:!!o,...o}}e.PreviewRouteContext=(0,t.createContext)(void 0)},528,[11]); 601__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,u){void 0===u&&(u=o);var c=Object.getOwnPropertyDescriptor(n,o);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,u,c)}:function(t,n,o,u){void 0===u&&(u=o),t[u]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),u=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(u){if(u&&u.__esModule)return u;var c={};if(null!=u)for(var s=t(u),i=0;i<s.length;i++)"default"!==s[i]&&n(c,u,s[i]);return o(c,u),c});Object.defineProperty(e,"__esModule",{value:!0}),e.useFocusEffect=function(t,n){const o=(0,s.useOptionalNavigation)(),u=(0,i.useNavigation)();if(void 0!==n){const t="You passed a second argument to 'useFocusEffect', but it only accepts one argument. If you want to pass a dependency array, you can use 'React.useCallback':\n\nuseFocusEffect(\n React.useCallback(() => {\n // Your code here\n }, [depA, depB])\n);\n\nSee usage guide: https://docs.expo.dev/versions/latest/sdk/router/#usefocuseffecteffect-do_not_pass_a_second_prop";console.error(t)}c.useEffect(()=>{if(!u||!o)return;let n,c=!1;const s=()=>{const n=t();if(void 0===n||'function'==typeof n)return n};u.isFocused()&&(n=s(),c=!0);const i=u.addListener('focus',()=>{c||(void 0!==n&&n(),n=s(),c=!0)}),f=u.addListener('blur',()=>{void 0!==n&&n(),n=void 0,c=!1});return()=>{void 0!==n&&n(),i(),f()}},[t,u,o])};const c=u(r(d[0])),s=r(d[1]),i=r(d[2])},529,[11,530,707]); 602__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useLoadedNavigation=c,e.useOptionalNavigation=function(){const[n,u]=(0,t.useState)(null),s=c();return(0,t.useEffect)(()=>{s(t=>u(t))},[]),n};const t=r(d[0]),n=r(d[1]),u=r(d[2]);function c(){const c=(0,u.useNavigation)(),s=(0,t.useRef)(!0),o=(0,t.useRef)([]);(0,t.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);const f=(0,t.useCallback)(()=>
602{if(s.current){const t=o.current;o.current=[],t.forEach(t=>{t(c)})}},[c]);(0,t.useEffect)(()=>{n.store.navigationRef.current&&f()},[f]);return(0,t.useCallback)(t=>{o.current.push(t),n.store.navigationRef.current&&f()},[f])}},530,[11,531,401]); 603__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useRouteInfo=e.useStore=e.store=void 0;var t=r(d[0]);Object.defineProperty(e,"store",{enumerable:!0,get:function(){return t.store}});var o=r(d[1]);Object.defineProperty(e,"useStore",{enumerable:!0,get:function(){return o.useStore}});var u=r(d[2]);Object.defineProperty(e,"useRouteInfo",{enumerable:!0,get:function(){return u.useRouteInfo}})},531,[532,541,558]); 604__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var s=t(i),f=0;f<s.length;f++)"default"!==s[f]&&n(u,i,s[f]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.store=e.storeRef=void 0,e.getSplashScreenAnimationFrame=function(){return l},e.setSplashScreenAnimationFrame=h,e.setHasAttemptedToHideSplash=m;const u=r(d[0]),s=r(d[1]),f=r(d[2]),c=i(r(d[3]));let l;e.storeRef={current:{}};let R=!1;function h(t){l=t}function m(t){R=t}e.store={shouldShowTutorial:()=>!e.storeRef.current.routeNode&&!1,get state(){return e.storeRef.current.state},get navigationRef(){return e.storeRef.current.navigationRef},get routeNode(){return e.storeRef.current.routeNode},getRouteInfo:()=>e.storeRef.current.routeInfo||u.defaultRouteInfo,get redirects(){return e.storeRef.current.redirects||[]},get rootComponent(){return e.storeRef.current.rootComponent},getStateForHref(t,n){return t=(0,f.resolveHref)(t),t=(0,f.resolveHrefStringWithSegments)(t,e.store.getRouteInfo(),n),this.linking?.getStateFromPath(t,this.linking.config)},get linking(){return e.storeRef.current.linking},setFocusedState(t){const n=(0,s.getCachedRouteInfo)(t);e.storeRef.current.routeInfo=n},onReady(){R||(m(!0),h(requestAnimationFrame(()=>{c._internal_maybeHideAsync?.()})))},onStateChange(t){if(t){e.storeRef.current.state=t,e.storeRef.current.routeInfo=(0,s.getCachedRouteInfo)(t);for(const t of s.routeInfoSubscribers)t()}},assertIsReady(){if(!e.storeRef.current.navigationRef.isReady())throw new Error('Attempted to navigate before mounting the Root Layout component. Ensure the Root Layout component is rendering a Slot, or other navigator on the first render.')}}},532,[533,537,538,539]); 605__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultRouteInfo=void 0,e.getRouteInfoFromState=function(o){if(!o)return e.defaultRouteInfo;const c='index'in o?o.index??0:0;let p=o.routes[c];if(p.name===t.NOT_FOUND_ROUTE_NAME||p.name===t.SITEMAP_ROUTE_NAME){const n=p.path||(p.name===t.NOT_FOUND_ROUTE_NAME?'/':`/${p.name}`);return{...e.defaultRouteInfo,unstable_globalHref:(0,s.appendBaseUrl)(n),pathname:n,pathnameWithParams:n,segments:[p.name]}}if(p.name!==t.INTERNAL_SLOT_NAME)throw new Error(`Expected the first route to be ${t.INTERNAL_SLOT_NAME}, but got ${p.name}`);o=p.state;const l=[];let f=Object.create(null);for(;o;){p=o.routes['index'in o&&o.index?o.index:0],Object.assign(f,p.params);let t=p.name;t.startsWith('/')&&(t=t.slice(1)),l.push(...t.split('/')),o=p.state}f=Object.fromEntries(Object.entries(f).map(([t,s])=>'string'==typeof s?[t,(0,n.safeDecodeURIComponent)(s)]:Array.isArray(s)?[t,s.map(t=>(0,n.safeDecodeURIComponent)(t))]:[t,s]));let u=p.params;for(;u&&'screen'in u;){if('string'==typeof u.screen){const t=u.screen.startsWith('/')?u.screen.slice(1):u.screen;l.push(...t.split('/'))}u='object'!=typeof u.params||Array.isArray(u.params)?void 0:u.params}if(p.params&&'screen'in p.params&&'string'===p.params.screen){const t=p.params.screen.startsWith('/')?p.params.screen.slice(1):p.params.screen;l.push(...t.split('/'))}'index'===l[l.length-1]&&l.pop();delete f.screen,delete f.params;const h=new Set,_='/'+l.filter(t=>!(t.startsWith('(')&&t.endsWith(')'))).flatMap(t=>{if('+not-found'===t){const t=f['not-found'];return h.add('not-found'),void 0===t?[]:Array.isArray(t)?t:[t]}if(t.startsWith('[...')&&t.endsWith(']')){let s=t.slice(4,-1);s.endsWith('?')&&(s=s.slice(0,-1));const n=f[s];return h.add(s),n||[]}if(t.startsWith('[')&&t.endsWith(']')){const s=t.slice(1,-1),n=f[s];return h.add(s),n?[n]:[]}return[t]}).join('/'),A=new URLSearchParams(Object.entries(f).flatMap(([t,s])=>h.has(t)?[]:Array.isArray(s)?s.map(s=>[t,s]):[[t,s]]));let b;A.has('#')&&(b=A.get('#')||void 0,A.delete('#'));const O=A.toString();let E=O?_+'?'+O:_;return E=b?E+'#'+b:E,{segments:l,pathname:_,params:f,unstable_globalHref:(0,s.appendBaseUrl)(E),searchParams:A,pathnameWithParams:E,isIndex:!1}
605};const t=r(d[0]),s=r(d[1]),n=r(d[2]);e.defaultRouteInfo={unstable_globalHref:'',searchParams:new URLSearchParams,pathname:'/',params:{},segments:[],pathnameWithParams:'/',isIndex:!1}},533,[534,535,536]); 606__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SITEMAP_ROUTE_NAME=e.NOT_FOUND_ROUTE_NAME=e.INTERNAL_SLOT_NAME=void 0,e.INTERNAL_SLOT_NAME='__root',e.NOT_FOUND_ROUTE_NAME='+not-found',e.SITEMAP_ROUTE_NAME='_sitemap'},534,[]); 607__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);s&&!("get"in s?!n.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var s={};if(null!=o)for(var u=t(o),c=0;c<u.length;c++)"default"!==u[c]&&n(s,o,u[c]);return i(s,o),s});Object.defineProperty(e,"__esModule",{value:!0}),e.getParamName=void 0,e.validatePathConfig=function({preserveDynamicRoutes:t,preserveGroups:n,shouldEncodeURISegment:i,...o}){(0,c.validatePathConfig)(o)},e.fixCurrentParams=function(t,n,i){const o=Object.fromEntries(Object.entries(n.params).flatMap(([t,n])=>'screen'===t||'params'===t?[]:[[t,i?.[t]?i[t](n):Array.isArray(n)?n.map(String):String(n)]]));return Object.assign(t,o),o},e.appendQueryAndHash=function(t,{'#':n,...i}){const o=s.stringify(i,{sort:!1});o&&(t+=`?${o}`);n&&(t+=`#${n}`);return t},e.appendBaseUrl=function(t,n=""){if(n)return`/${n.replace(/^\/+/,'').replace(/\/$/,'')}${t}`;return t},e.getPathWithConventionsCollapsed=function({pattern:t,route:n,params:i,preserveGroups:o,preserveDynamicRoutes:s,shouldEncodeURISegment:c=!0,initialRouteName:f}){const p=t.split('/');return p.map((t,m)=>{const h=(0,e.getParamName)(t);if(t.startsWith('*'))return s?'not-found'===h?'+not-found':`[...${h}]`:i[h]?Array.isArray(i[h])?i[h].join('/'):i[h]:n.name.startsWith('[')&&n.name.endsWith(']')||'*not-found'===t?'':n.name;if(t.startsWith(':')){if(s)return`[${h}]`;const n=i[h];if(void 0===n&&t.endsWith('?'))return;return(c?l(n):n)??'undefined'}return o||null==(0,u.matchGroupName)(t)?c?l(t,{preserveBrackets:!0}):t:p.length-1===m&&f?'index'===(v=f)||null!=(0,u.matchGroupName)(v)||null!=(0,u.matchDynamicName)(v)?'':c?l(f,{preserveBrackets:!0}):f:'';var v}).map(t=>t??'').join('/')},e.isDynamicPart=function(t){return t.startsWith(':')||t.startsWith('*')};const s=o(r(d[0])),u=r(d[1]),c=r(d[2]);function l(t,{preserveBrackets:n=!1}={}){return t=String(t).replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]/g,t=>encodeURIComponent(t)),n&&(t=t.replace(/%5B/g,'[').replace(/%5D/g,']')),t}e.getParamName=t=>t.replace(/^[:*]/,'').replace(/\?$/,'')},535,[444,257,401]); 608__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return/^([\w\d_+.-]+:)?\/\//.test(t)}function n(t){return/^(https?|mailto|tel|sms|geo|maps|market|itmss?|itms-apps|content|file):/.test(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.hasUrlProtocolPrefix=t,e.isWellKnownUri=n,e.shouldLinkExternally=function(o){return!o.startsWith('.')&&(t(o)||n(o))},e.parseUrlUsingCustomBase=function(t){return new URL(t,'file:')},e.safeDecodeURI=function(t){try{return'string'==typeof t?decodeURI(t):t}catch{return t}},e.safeDecodeURIComponent=function(t){try{return'string'==typeof t?decodeURIComponent(t):t}catch{return t}}},536,[]); 609__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.routeInfoSubscribe=e.routeInfoSubscribers=void 0,e.getCachedRouteInfo=function(s){let u=o.get(s);if(!u){u=(0,t.getRouteInfoFromState)(s);const f=JSON.stringify(u),c=n.get(f);c?u=c:n.set(f,u),o.set(s,u)}return u},e.setCachedRouteInfo=function(t,s){o.set(t,s),n.set(JSON.stringify(s),s)};const t=r(d[0]),o=new WeakMap,n=new Map;e.routeInfoSubscribers=new Set;e.routeInfoSubscribe=t=>(e.routeInfoSubscribers.add(t),()=>{e.routeInfoSubscribers.delete(t)})},537,[533]); 610__d(function(g,r,i,a,m,e,d){"use strict";
610Object.defineProperty(e,"__esModule",{value:!0}),e.resolveHref=void 0,e.resolveHrefStringWithSegments=function(t,{segments:n=[],params:o={}}={},{relativeToDirectory:s}={}){if(t.startsWith('.')){let c=n?.map(t=>{if(!t.startsWith('['))return t;if(t.startsWith('[...')){t=t.slice(4,-1);const n=o[t];return Array.isArray(n)?n.join('/'):n?.split(',')?.join('/')??''}return t=t.slice(1,-1),o[t]}).filter(Boolean).join('/')??'/';s&&(c=`${c}/`);const l=new URL(t,`http://hostname/${c}`);t=`${l.pathname}${l.search}`}return t.replace(/^\/+/,'/')};function t(t,o){for(const[s,c=""]of Object.entries(o)){const l=`[${s}]`,f=`[...${s}]`;if(t.includes(l))t=t.replace(l,n(c));else{if(!t.includes(f))continue;t=t.replace(f,n(c))}delete o[s]}return{pathname:t,params:o}}function n(t){return Array.isArray(t)?t.map(t=>n(t)).join('/'):encodeURIComponent(t.toString())}function o(t){return Object.entries(t).filter(([,t])=>null!=t).map(([t,n])=>`${t}=${encodeURIComponent(n.toString())}`).join('&')}e.resolveHref=n=>{if('string'==typeof n)return(0,e.resolveHref)({pathname:n});const s=n.pathname??'';if(!n?.params)return s;const{pathname:c,params:l}=t(s,{...n.params}),f=o(l);return c+(f?`?${f}`:'')}},538,[]); 611__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,o,c){void 0===c&&(c=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,c,u)}:function(t,n,o,c){void 0===c&&(c=o),t[c]=n[o]}),n=this&&this.__exportStar||function(n,o){for(var c in n)"default"===c||Object.prototype.hasOwnProperty.call(o,c)||t(o,n,c)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(d[0]),e)},539,[540]); 612__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hide=c,e.hideAsync=async function(){c()},e.preventAutoHideAsync=async function(){if(!n)return;return n.preventAutoHideAsync()},e._internal_preventAutoHideAsync=async function(){if(!n||!n.internalPreventAutoHideAsync)return!1;if(!t){if(ErrorUtils?.getGlobalHandler){const n=ErrorUtils.getGlobalHandler();ErrorUtils.setGlobalHandler((t,l)=>{c(),n(t,l)})}t=!0}return n.internalPreventAutoHideAsync()},e._internal_maybeHideAsync=async function(){if(!n||!n.internalMaybeHideAsync)return!1;return n.internalMaybeHideAsync()};const n=(0,r(d[0]).requireOptionalNativeModule)('ExpoSplashScreen');let t=!1;function c(){n&&n.hide()}},540,[208]); 613__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.useStore=function(t,x,C){const k=(0,S.useNavigationContainerRef)(),y=o.default.expoConfig?.extra?.router;let I,P,E=n.Fragment;const w=(0,F.getRoutes)(t,{...y,skipGenerated:!0,ignoreEntryPoints:!0,platform:s.Platform.OS,preserveRedirectAndRewrites:!0}),A=[y?.redirects,y?.rewrites].filter(Boolean).flat().map(t=>[(0,p.routePatternToRegex)((0,h.parseRouteSegments)(t.source)),t,(0,v.shouldLinkExternally)(t.destination)]);if(!w)throw new Error('No routes found');{I=(0,R.getLinkingConfig)(w,t,()=>c.store.getRouteInfo(),{metaOnly:x.metaOnly,serverUrl:C,redirects:A,skipGenerated:y?.skipGenerated??!1,sitemap:y?.sitemap??!0,notFound:y?.notFound??!0}),E=(0,_.getQualifiedRouteComponent)(w);const o=I?.getInitialURL?.();if('string'==typeof o){let t=(0,l.extractExpoPathFromURL)(I.prefixes,o);t.startsWith('/')||(t='/'+t),P=I.getStateFromPath(t,I.config);const n=(0,u.getRouteInfoFromState)(P);(0,f.setCachedRouteInfo)(P,n)}}c.storeRef.current={navigationRef:k,routeNode:w,config:y,rootComponent:E,linking:I,redirects:A,state:P},P&&(c.storeRef.current.routeInfo=(0,f.getCachedRouteInfo)(P));return(0,n.useEffect)(()=>()=>{const t=(0,c.getSplashScreenAnimationFrame)();t&&(cancelAnimationFrame(t),(0,c.setSplashScreenAnimationFrame)(void 0))}),c.store};const o=t(r(d[0])),n=r(d[1]),s=r(d[2]),u=r(d[3]),f=r(d[4]),c=r(d[5]),l=r(d[6]),p=r(d[7]),R=r(d[8]),h=r(d[9]),F=r(d[10]),S=r(d[11]),_=r(d[12]),v=r(d[13])},541,[542,11,263,533,537,532,545,546,547,548,724,401,588,536]); 614__d(function(g,r,i,a,m,_e,d){"use strict";
614function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"AppOwnership",{enumerable:!0,get:function(){return u.AppOwnership}}),Object.defineProperty(_e,"ExecutionEnvironment",{enumerable:!0,get:function(){return u.ExecutionEnvironment}}),Object.defineProperty(_e,"UserInterfaceIdiom",{enumerable:!0,get:function(){return u.UserInterfaceIdiom}}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var n=r(d[0]);r(d[1]);var t=e(r(d[2])),u=r(d[3]),l=e(r(d[4]));l.default||console.warn("No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?");const o=(0,n.requireOptionalNativeModule)('ExpoUpdates');let s=null;if(o){let e;o.manifest?e=o.manifest:o.manifestString&&(e=JSON.parse(o.manifestString)),e&&Object.keys(e).length>0&&(s=e)}let f=null;if(t.default.EXDevLauncher){let e;t.default.EXDevLauncher.manifestString&&(e=JSON.parse(t.default.EXDevLauncher.manifestString)),e&&Object.keys(e).length>0&&(f=e)}let c=null;if(l.default&&l.default.manifest){const e=l.default.manifest;c='string'==typeof e?JSON.parse(e):e}let p=s??f??c;const{name:E,appOwnership:b,...x}=l.default||{},v={...x,appOwnership:b??null};function O(e){return!_(e)}function _(e){return'metadata'in e}function S(e=!1){if(!p){const e=null===p?'null':'undefined';if(x.executionEnvironment,u.ExecutionEnvironment.Bare,x.executionEnvironment===u.ExecutionEnvironment.StoreClient||x.executionEnvironment===u.ExecutionEnvironment.Standalone)throw new n.CodedError('ERR_CONSTANTS_MANIFEST_UNAVAILABLE',`Constants.manifest is ${e}, must be an object.`)}return p}Object.defineProperties(v,{__unsafeNoWarnManifest:{get(){const e=S(!0);return e&&O(e)?e:null},enumerable:!1},__unsafeNoWarnManifest2:{get(){const e=S(!0);return e&&_(e)?e:null},enumerable:!1},manifest:{get(){const e=S();return e&&O(e)?e:null},enumerable:!0},manifest2:{get(){const e=S();return e&&_(e)?e:null},enumerable:!0},expoConfig:{get(){const e=S(!0);return e?o&&o.isEmbeddedLaunch?c:_(e)?e.extra?.expoClient??null:O(e)?e:null:null},enumerable:!0},expoGoConfig:{get(){const e=S(!0);return e?_(e)?e.extra?.expoGo??null:O(e)?e:null:null},enumerable:!0},easConfig:{get(){const e=S(!0);return e?_(e)?e.extra?.eas??null:O(e)?e:null:null},enumerable:!0},__rawManifest_TEST:{get:()=>p,set(e){p=e},enumerable:!1}});var h=v},542,[115,136,170,543,544]); 615__d(function(g,r,i,a,m,e,d){"use strict";var t,n,o;Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AppOwnership",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ExecutionEnvironment",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"UserInterfaceIdiom",{enumerable:!0,get:function(){return o}}),(function(t){t.Expo="expo"})(t||(t={})),(function(t){t.Bare="bare",t.Standalone="standalone",t.StoreClient="storeClient"})(n||(n={})),(function(t){t.Handset="handset",t.Tablet="tablet",t.Desktop="desktop",t.TV="tv",t.Unsupported="unsupported"})(o||(o={}))},543,[]); 616__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var n=r(d[0]);const t=(Date.now()+'-'+Math.floor(1e9*Math.random())).toString();function o(){if('undefined'!=typeof navigator&&'string'==typeof navigator.userAgent){const n=navigator.userAgent.toLowerCase();if(n.includes('edge'))return'Edge';if(n.includes('edg'))return'Chromium Edge';if(n.includes('opr')&&'opr'in window&&window.opr)return'Opera';if(n.includes('chrome')&&'chrome'in window&&window.chrome)return'Chrome';if(n.includes('trident'))return'IE';if(n.includes('firefox'))return'Firefox';if(n.includes('safari'))return'Safari'}}var u={get appOwnership(){return null},get executionEnvironment(){return n.ExecutionEnvironment.Bare},get sessionId(){return t},get isHeadless(){return'undefined'==typeof navigator||/\bHeadlessChrome\//.test(navigator.userAgent)},get expoVersion(){return this.manifest.sdkVersion||null},get linkingUri(){return'undefined'!=typeof location?location.origin:''},get expoRuntimeVersion(){return this.expoVersion},get deviceName(){return o()},get systemFonts(){return[]},get statusBarHeight(){return 0},get deviceYearClass(){return null},get manifest(){return"{\"name\":\"KANIDA\",\"slug\":\"kanida\",\"ver
616sion\":\"1.0.0\",\"scheme\":\"kanida\",\"orientation\":\"default\",\"userInterfaceStyle\":\"dark\",\"web\":{\"bundler\":\"metro\",\"output\":\"single\",\"name\":\"KANIDA \xb7 Trading intelligence\",\"shortName\":\"KANIDA \xb7 Trading intelligence\"},\"experiments\":{\"typedRoutes\":false},\"extra\":{\"router\":{}},\"sdkVersion\":\"57.0.0\",\"platforms\":[\"ios\",\"android\",\"web\"]}"},get manifest2(){return null},get experienceUrl(){return'undefined'!=typeof location?location.origin:''},get debugMode(){return!1},getWebViewUserAgentAsync:async()=>'undefined'!=typeof navigator?navigator.userAgent:null}},544,[543]); 617__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parsePathAndParamsFromExpoGoLink=function(t){const o=n(t).match(/([^?]*)(\?.*)?/);return{pathname:o?.[1]??'',queryString:o?.[2]??''}},e.parsePathFromExpoGoLink=n,e.extractExpoPathFromURL=function(t,n=""){return o(n).replace(/^\//,'')};const t=r(d[0]);function n(t){return t.match(/exps?:\/\/.*?\/--\/(.*)/)?.[1]??''}function o(t){if(t.match(/^https?:\/\//)){const{origin:n,href:o,hostname:s}=new URL(t);return'exp.host'===s||'u.expo.dev'===s?'':o.replace(n,'')}if('undefined'!=typeof expo&&globalThis.expo?.modules?.ExpoGo&&t.match(/^exp(s)?:\/\//)){const o=n(t);if(o)return c('a://'+o);const s=t.match(/exps?:\/\/.*\?(.*)/)?.[1];return s?c('a://?'+s):''}return c(t)}function s(t){return'expo-development-client'===t.hostname}function c(n){let c;try{c=new URL(n)}catch{return n.startsWith('/')?n:n.replace(/^[^:]+:\/\//,'')}if(s(c)){if(!c.searchParams.get('url'))return'';const n=c.searchParams.get('url');return o((0,t.safeDecodeURI)(n))}let u='';c.host&&(u+=c.host),c.pathname&&(u+=c.pathname);const p=c.search?[...c.searchParams.entries()].map(([n,o])=>`${n}=${(0,t.safeDecodeURIComponent)(o)}`).join('&'):'';return p&&(u+='?'+p),u}},545,[536]); 618__d(function(g,r,_i,_a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.populateParams=function(t,n){if(!t||!n||0===Object.keys(n).length)return;for(const a of t)Object.assign(a,{params:n});return t},e.safelyDecodeURIComponent=function(t){try{return decodeURIComponent(t)}catch{return t}},e.getUrlWithReactNavigationConcessions=function(t,n=""){const i=(0,a.stripGroupSegmentsFromPath)(o(t,n));let c='',u='';try{const n=(0,s.parseUrlUsingCustomBase)(t);c=n.pathname,u=n.hash}catch{}const p=o(c,n);return{path:t,nonstandardPathname:p.replace(/^\/+/g,'').replace(/\/+$/g,'')+'/',hash:u,pathWithoutGroups:i}},e.createConfig=function(t,n,s,i={}){const o=[];let c=!1;const u='index'===t||t.endsWith('/index');let p=0;for(const t of n.split('/'))if(t){const n=t.startsWith(':')||t.startsWith('*')||t.includes('*not-found');c||=n,(0,a.matchGroupName)(t)||(o.push(t),n||p++)}const l=!!i.screens&&!!Object.keys(i.screens)?.length,h=l?'layout':c?'dynamic':'static';u&&(o.push('index'),p++);return{type:h,isIndex:u,hasChildren:l,parts:o,staticPartCount:p,userReadableName:[...s.slice(0,-1),i.path||t].join('/'),expandedRouteNames:s.slice(1).flatMap(t=>t.split('/'))}},e.assertScreens=function(t){if(!t?.screens)throw Error("You must pass a 'screens' object to 'getStateFromPath' to generate a path.")},e.configRegExp=function(t){return t.pattern?new RegExp(`^(${t.pattern.split('/').map(i).join('')})$`):void 0},e.isDynamicPart=function(t){return t.length>1&&(t.startsWith(':')||t.startsWith('*'))},e.replacePart=function(t){return t.replace(/^[:*]/,'').replace(/\?$/,'')},e.getParamValue=function(t,n){if(t.startsWith('*')){const a=n.split('/').filter(t=>''!==t);return 0===a.length&&t.endsWith('?')?void 0:a}return n},e.handleUrlParams=function(t,n){if(n){t.params=Object.assign(Object.create(null),t.params);for(const[a,s]of Object.entries(n))t.params,t.params?.[a]||(t.params[a]=s);0===Object.keys(t.params).length&&delete t.params}},e.spreadParamsAcrossAllStates=function(t,n){for(;t;){const a=t.routes[0];a.params=Object.assign({},a.params,n)}},e.stripBaseUrl=o,e.matchForEmptyPath=function(t){const n=t.filter(t=>!t.hasChildren).map(t=>({...t,path:(0,a.stripGroupSegmentsFromPath)(t.path)}));return n.find(t=>''===t.path&&(!t.regex||t.regex.test('')))??n.find(t=>t.path.startsWith(':')&&t.regex.test(''))??n.find(t=>t.path.startsWith('*')&&t.regex.test('/'))},e.appendIsInitial=function(t){const n=t.map(t=>c(...t.parentScreens,t.initialRouteName));return function(t){return t.isInitial=n.includes(t.routeNames.join('/')),t}},e.getRouteConfigSorter=function(t=[]){return function(n,a){if(n.pattern===a.pattern)return a.routeNames.join('>').localeCompare(n.routeNames.join('>'));if(n.pattern.startsWith(a.pattern)&&!a.isIndex)return-1;if(a.pattern.startsWith(n.pattern)&&!n.isIndex)return 1;if('static'===n.type&&'static'!==a.type)return-1;if('static'!==n.type&&'static'===a.type)return 1;if(n.staticPartCount!==a.staticPartCount)return a.staticPartCount-n.staticPartCount;const s=t.filter((t,a)=>t===n.expandedRouteNames[a]&&t.startsWith('(')&&t.endsWith(')')),i=t.filter((t,
618n)=>t===a.expandedRouteNames[n]&&t.startsWith('(')&&t.endsWith(')'));if((s.length>0||i.length>0)&&s.length!==i.length)return i.length-s.length;for(let t=0;t<Math.max(n.parts.length,a.parts.length);t++){const s=n.parts[t],i=a.parts[t];if(null==n.parts[t])return 1;if(null==a.parts[t])return-1;const o=s.startsWith('*'),c=i.startsWith('*');if(o&&c){const t=s.match(/^[*]not-found$/),n=i.match(/^[*]not-found$/);if(t&&n)continue;if(t)return 1;if(n)return-1;continue}if(o)return 1;if(c)return-1;const u=s.startsWith(':'),p=i.startsWith(':');if(u&&p){const t=s.match(/^[*]not-found$/),n=i.match(/^[*]not-found$/);if(t&&n)continue;if(t)return 1;if(n)return-1;continue}if(u)return 1;if(p)return-1}return n.isInitial&&!a.isInitial?-1:!n.isInitial&&a.isInitial?1:a.parts.length-n.parts.length}},e.parseQueryParams=function(t,n,a,i){const o=(0,s.parseUrlUsingCustomBase)(t).searchParams,c=Object.create(null);i&&(c['#']=i.slice(1));for(const t of o.keys())if(n.params?.[t]);else{const n=a?.hasOwnProperty(t)?o.getAll(t).map(n=>a[t](n)):o.getAll(t);c[t]=1===n.length?n[0]:n}return Object.keys(c).length?c:void 0},e.cleanPath=function(t){return(t=t.replace(/\/+/g,'/').replace(/^\//,'').replace(/\?.*$/,'')).endsWith('/')?t:`${t}/`},e.routePatternToRegex=function(t){return new RegExp(`^(${t.split('/').map(t=>t.startsWith('(')&&t.endsWith(')')?`${t}?`:t.startsWith(':')?`(([^/]+\\/)${t.endsWith('?')?'?':''})`:`${'*'===t?'.*':(0,n.default)(t)}\\/`).join('')})`)};const n=t(r(d[0])),a=r(d[1]),s=r(d[2]);function i(t){return(t=t.replace(/ /g,'%20')).startsWith(':')?`(([^/]+\\/)${t.endsWith('?')?'?':''})`:t.startsWith('*')?`((.*\\/)${t.endsWith('?')?'?':''})`:null!=(0,a.matchGroupName)(t)?`(?:${(0,n.default)(t)}\\/)?`:(0,n.default)(t)+"\\/"}function o(t,a=""){return a?t.replace(/^\/+/g,'/').replace(new RegExp(`^\\/?${(0,n.default)(a)}`,'g'),''):t}const c=(...t)=>[].concat(...t.map(t=>t.split('/'))).filter(Boolean).join('/')},546,[452,257,536]); 619__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getNavigationConfig=f,e.getLinkingConfig=function(n,s,p,{metaOnly:h=!0,serverUrl:l,redirects:y,skipGenerated:S,sitemap:_,notFound:P}){let F,N=!1;const O=s.keys().find(t=>t.match(/^\.\/\+native-intent\.[tj]sx?$/)),R=O?s(O):void 0,b=f(n,h,{sitemap:!S&&_,notFound:!S&&P});return{prefixes:[],config:b,getInitialURL:()=>(N||('web'===t.Platform.OS?F=l??(0,c.getInitialURL)():(F=l??(0,c.getInitialURL)(),'string'==typeof F?(F=(0,o.applyRedirects)(F,y),F&&'function'==typeof R?.redirectSystemPath&&(F=R.redirectSystemPath({path:F,initial:!0}))):F&&(F=F.then(t=>(t=(0,o.applyRedirects)(t,y))&&'function'==typeof R?.redirectSystemPath?R.redirectSystemPath({path:t,initial:!0}):t))),N=!0),F),subscribe:(0,c.subscribe)(R,y),getStateFromPath:(t,n)=>(0,c.getStateFromPath)(t,n,p().segments),getPathFromState:(t,n)=>(0,c.getPathFromState)(t,{...b,...n,screens:b.screens??n?.screens??{}})??'/',getActionFromState:u.getActionFromState}};const t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),c=r(d[4]),u=r(d[5]);function f(t,o,{sitemap:c,notFound:u}){const f=(0,s.getReactNavigationConfig)(t,o),l=(()=>{const t='_sitemap';return!1===c||p(f,t)?{}:h(n.SITEMAP_ROUTE_NAME,t,o)})(),y=(()=>{const t='*not-found';return!1===u||p(f,t)?{}:h(n.NOT_FOUND_ROUTE_NAME,t,o)})();return{screens:{[n.INTERNAL_SLOT_NAME]:{path:'',...f},...l,...y}}}function p(t,n){return Object.values(t.screens).some(t=>'string'==typeof t?t===n:t.path===n)}function h(t,n,s){return s?{[t]:n}:{[t]:{path:n}}}},547,[115,534,548,549,708,401]); 620__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseRouteSegments=o,e.getReactNavigationScreensConfig=c,e.getReactNavigationConfig=function(t,n){const o={initialRouteName:void 0,screens:t?c(t.children,n):{}};t?.initialRouteName&&(o.initialRouteName=t.initialRouteName);return o};const t=r(d[0]);
620function n(n){if('index'===n)return'';if('+not-found'===n)return'*not-found';const o=(0,t.matchDynamicName)(n);return o&&!o.deep?`:${o.name}`:o?.deep?'*'+o.name:n}function o(t){return t.split('/').map(n).filter(Boolean).join('/')}function u(t,n){const u=o(t.route);if(!t.children.length)return n?u:{path:u,screens:{},_route:t};const s={path:u,screens:c(t.children,n)};return t.initialRouteName&&(s.initialRouteName=t.initialRouteName),n||(s._route=t),s}function c(t,n){return Object.fromEntries(t.map(t=>[t.route,u(t,n)]))}},548,[257]); 621__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var c=Object.getOwnPropertyDescriptor(n,i);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,c)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var c={};if(null!=o)for(var u=t(o),s=0;s<u.length;s++)"default"!==u[s]&&n(c,o,u[s]);return i(c,o),c});Object.defineProperty(e,"__esModule",{value:!0}),e.applyRedirects=function t(n,i){if('string'!=typeof n||!i)return n;const o=(0,s.cleanPath)(n),u=i.find(([t])=>t.test(o));if(!u)return n;if(u[2]){let t=u[1].destination;return t.startsWith('//'),c.openURL(t),t}return t(p(n,u[1]),i)},e.getRedirectModule=function(t){return{default:function(){const n=r(d[5]).usePathname(),i=(0,l.shouldLinkExternally)(t.destination);if((0,u.useEffect)(()=>{if(i){let n=t.destination;n.startsWith('//'),0,c.openURL(n)}},[]),i)return null;const o=p(n,t);return(0,u.createElement)(r(d[6]).Redirect,{href:o})}}},e.convertRedirect=p,e.mergeVariablesWithPath=h;const c=o(r(d[0])),u=r(d[1]),s=r(d[2]),f=r(d[3]),l=r(d[4]);function p(t,n){const i={},o=t.split('/'),c=n.source.split('/');for(const[t,n]of c.entries()){const c=(0,f.matchDynamicName)(n);if(c){if(c.deep){i[c.name]=o.slice(t);break}i[c.name]=o[t]}else;}return h(n.destination,i)}function h(t,n){return t.split('/').map(t=>{const i=(0,f.matchDynamicName)(t);if(i){const t=n[i.name];return delete n[i.name],t}return t}).filter(Boolean).join('/')}},549,[550,11,546,257,536,557,689]); 622__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"parse",{enumerable:!0,get:function(){return l.parse}}),Object.defineProperty(_e,"createURL",{enumerable:!0,get:function(){return l.createURL}}),_e.addEventListener=L,_e.parseInitialURLAsync=async function(){const e=await c.default.getInitialURL();if(!e)return{scheme:null,hostname:null,path:null,queryParams:null};return(0,l.parse)(e)},_e.sendIntent=async function(e,t){throw new n.UnavailabilityError('Linking','sendIntent')},_e.openSettings=async function(){throw new n.UnavailabilityError('Linking','openSettings')},_e.getInitialURL=p,_e.getLinkingURL=function(){return u.default.getLinkingURL()},_e.clearInitialURL=function(){u.default.clearInitialURL?.()},_e.openURL=U,_e.canOpenURL=async function(e){return(0,o.validateURL)(e),await c.default.canOpenURL(e)},_e.useURL=function(){const[e,n]=(0,t.useState)(null);function u(e){n(e.url)}return(0,t.useEffect)(()=>{p().then(e=>n(e));const e=L('url',u);return()=>e.remove()},[]),e},_e.useLinkingURL=function(){const[e,n]=(0,t.useState)(u.default.getLinkingURL);function c(e){n(e.url)}return(0,t.useEffect)(()=>{const e=u.default.addListener('onURLReceived',c);return()=>e.remove()},[]),e??null};var n=r(d[0]),t=r(d[1]);r(d[2]);var u=e(r(d[3])),c=e(r(d[4])),l=r(d[5]),o=r(d[6]),f=r(d[7]);Object.keys(f).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return f[e]}})});var s=r(d[8]);function L(e,n){return c.default.addEventListener(e,n)}async function p(){return await c.default.getInitialURL()??null}async function U(e){return(0,o.validateURL)(e),await c.default.openURL(e)}
622Object.keys(s).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return s[e]}})})},550,[115,11,136,551,552,553,554,555,556]); 623__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e},o={addListener(e,n){if((0,t.default)('onURLReceived'===e,`Linking.addListener(): ${e} is not a valid event`),'undefined'==typeof window)return{remove(){}};const o=e=>n({url:window.location.href,nativeEvent:e});return window.addEventListener('message',o,!1),{remove:()=>{window.removeEventListener('message',o)}}},getLinkingURL:()=>'undefined'==typeof window?'':window.location.href,clearInitialURL(){}}},551,[151]); 624__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}});var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e};const o=[];var s={addEventListener(e,n){if('undefined'==typeof window)return{remove(){}};(0,t.default)('url'===e,`Linking.addEventListener(): ${e} is not a valid event`);const s=e=>n({url:window.location.href,nativeEvent:e});return o.push({listener:n,nativeListener:s}),window.addEventListener('message',s,!1),{remove:()=>{this.removeEventListener(e,n)}}},removeEventListener(e,n){if('undefined'==typeof window)return;(0,t.default)('url'===e,`Linking.addEventListener(): ${e} is not a valid event`);const s=o.findIndex(e=>e.listener===n);(0,t.default)(-1!==s,'Linking.removeEventListener(): cannot remove an unregistered event listener.');const v=o[s]?.nativeListener;null!=v&&(window.removeEventListener('message',v,!1),o.splice(s,1))},canOpenURL:async()=>!0,getInitialURL:async()=>'undefined'==typeof window?'':window.location.href,async openURL(e){'undefined'!=typeof window&&(window.location=new URL(e,window.location).toString())}}},552,[151]); 625__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createURL=function(n,{queryParams:t={}}={}){if('undefined'==typeof window)return'';const o=new URL(n,window.location.origin);return Object.entries(t).forEach(([n,t])=>{'string'==typeof t?o.searchParams.set(n,encodeURIComponent(t)):null!=t&&o.searchParams.set(n,t)}),o.toString().replace(/\/$/,'')},e.parse=function(n){let t;try{t=new URL(n)}catch{return'undefined'==typeof window?{hostname:null,path:n,queryParams:{},scheme:null}:{hostname:'localhost',path:n,queryParams:{},scheme:'http'}}const o={};return t.searchParams.forEach((n,t)=>{o[t]=decodeURIComponent(n)}),{hostname:t.hostname||null,path:t.hostname||t.pathname?''===t.pathname?null:t.pathname.replace(/^\//,''):null,queryParams:o,scheme:t.protocol.replace(/:$/,'')}}},553,[]); 626__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.validateURL=function(e){(0,n.default)('string'==typeof e,'Invalid URL: should be a string. Was: '+e),(0,n.default)(e,'Invalid URL: cannot be empty')};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e}},554,[151]); 627__d(function(g,r,i,a,m,e,d){},555,[]); 628__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.hasCustomScheme=function(){return!0},e.collectManifestSchemes=function(){return[]},e.hasConstantsManifest=function(){return!1},e.resolveScheme=function(){return'https'}},556,[]); 629__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useCurrentRouteInfo=e.useLoaderData=e.useSearchParams=e.useLocalSearchParams=e.useGlobalSearchParams=e.usePathname=e.useSegments=e.useUnstableGlobalHref=e.useRouter=e.useNavigationContainerRef=e.useRootNavigation=e.useRootNavigationState=e.useRouteInfo=void 0;var t=r(d[0]);Object.defineProperty(e,"useRouteInfo",{enumerable:!0,get:function(){return t.useRouteInfo}});var n=r(d[1]);Object.defineProperty(e,"useRootNavigationState",{enumerable:!0,get:function(){return n.useRootNavigationState}});var u=r(d[2]);Object.defineProperty(e,"useRootNavigation",{enumerable:!0,get:function(){return u.useRootNavigation}});var o=r(d[3]);Object.defineProperty(e,"useNavigationContainerRef",{enumerable:!0,get:function(){return o.useNavigationContainerRef}});var s=r(d[4]);Object.defineProperty(e,"useRouter",{enumerable:!0,get:function(){return s.useRouter}});var c=r(d[5]);Object.defineProperty(e,"useUnstableGlobalHref",{enumerable:!0,get:function(){return c.useUnstableGlobalHref}});var f=r(d[6]);Object.defineProperty(e,"useSegments",{enumerable:!0,get:function(){return f.useSegments}});
629var b=r(d[7]);Object.defineProperty(e,"usePathname",{enumerable:!0,get:function(){return b.usePathname}});var l=r(d[8]);Object.defineProperty(e,"useGlobalSearchParams",{enumerable:!0,get:function(){return l.useGlobalSearchParams}});var P=r(d[9]);Object.defineProperty(e,"useLocalSearchParams",{enumerable:!0,get:function(){return P.useLocalSearchParams}});var v=r(d[10]);Object.defineProperty(e,"useSearchParams",{enumerable:!0,get:function(){return v.useSearchParams}});var R=r(d[11]);Object.defineProperty(e,"useLoaderData",{enumerable:!0,get:function(){return R.useLoaderData}});var S=r(d[12]);Object.defineProperty(e,"useCurrentRouteInfo",{enumerable:!0,get:function(){return S.useCurrentRouteInfo}})},557,[558,559,560,561,562,577,578,579,580,581,582,583,591]); 630__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useRouteInfo=function(){const u=(0,t.useSyncExternalStore)(n.routeInfoSubscribe,s.store.getRouteInfo,s.store.getRouteInfo),{isPreview:c,segments:f,params:h,pathname:l}=(0,o.usePreviewInfo)();if(c)return{pathname:l??'',segments:f??[],unstable_globalHref:'',params:h??{},searchParams:new URLSearchParams,pathnameWithParams:l??'',isIndex:!1};return u};const t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3])},558,[11,537,532,528]); 631__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useRootNavigationState=function(){const n=(0,o.useNavigation)().getParent(t.INTERNAL_SLOT_NAME);if(!n)throw new Error('useRootNavigationState was called from a generated route. This is likely a bug in Expo Router.');return n.getState()};const t=r(d[0]),o=r(d[1])},559,[534,401]); 632__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useRootNavigation=function(){return t.store.navigationRef.current};const t=r(d[0])},560,[532]); 633__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useNavigationContainerRef=function(){return n.store.navigationRef};const n=r(d[0])},561,[532]); 634__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useRouter=function(){const{isPreview:c}=(0,t.usePreviewInfo)();if(c)return n;return s.router};const s=r(d[0]),t=r(d[1]),n={back:()=>{},canGoBack:()=>!1,push:()=>{},navigate:()=>{},replace:()=>{},dismiss:()=>{},dismissTo:()=>{},dismissAll:()=>{},canDismiss:()=>!1,setParams:()=>{},reload:()=>{},prefetch:()=>{}}},562,[563,528]); 635__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.router=void 0,e.useImperativeApiEmitter=function(u){const o=(0,t.useSyncExternalStore)(n.routingQueue.subscribe,n.routingQueue.snapshot,n.routingQueue.snapshot);return(0,t.useEffect)(()=>{n.routingQueue.run(u)},[o,u]),null};const t=r(d[0]),u=r(d[1]);Object.defineProperty(e,"router",{enumerable:!0,get:function(){return u.router}});const n=r(d[2])},563,[11,564,576]); 636__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var s=Object.getOwnPropertyDescriptor(n,o);s&&!("get"in s?!n.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,s)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var s={};if(null!=i)for(var u=t(i),c=0;c<u.length;c++)"default"!==u[c]&&n(s,i,u[c]);return o(s,i),s});Object.defineProperty(e,"__esModule",{value:!0}),e.router=void 0,e.navigate=h,e.reload=O,e.prefetch=y,e.push=P,e.dismiss=_,e.dismissTo=D,e.replace=w,e.dismissAll=b,e.goBack=k,e.canGoBack=R,e.canDismiss=E,e.setParams=j,e.linkTo=A;const s=r(d[0]),u=i(r(d[1])),c=r(d[2]),f=r(d[3]),l=r(d[4]),p=r(d[5]),m=r(d[6]),v=r(d[7]);function h(t,n){return A((0,m.resolveHref)(t),{...n,event:'NAVIGATE'})}function O(){throw new Error('The reload method is not implemented in the client-side router yet.')}function y(t,n){return A((0,m.resolveHref)(t),{...n,event:'PRELOAD'})}function P(t,n){return A((0,m.resolveHref)(t),{...n,event:'PUSH'})}function _(t=1){(0,p.emitDomDismiss)(t)||f.routingQueue.add({type:'POP',payload:{count:t}})}function D(t,n){return A((0,m.resolveHref)(t),{...n,event:'POP_TO'})}function w(t,n){return A((0,m.resolveHref)(t),{...n,event:'REPLACE'})}function b(){(0,p.emitDomDismissAll)()||f.routingQueue.add({type:'POP_TO_TOP'})}function k(){(0,p.emitDomGoBack)()||(l.store.assertIsReady(),f.routingQueue.add({type:'GO_BACK'}))}function R(){if(s.IS_DOM)throw new Error('canGoBack imperative method is not supported. Pass the property to the DOM component instead.');return!!l.store.navigationRef.isReady()&&(l.store.navigationRef?.current?.canGoBack()??!1)}
636function E(){if(s.IS_DOM)throw new Error('canDismiss imperative method is not supported. Pass the property to the DOM component instead.');let t=l.store.state;for(;t;){if('stack'===t.type&&t.routes.length>1)return!0;if(void 0===t.index)return!1;t=t.routes?.[t.index]?.state}return!1}function j(t={}){if(!(0,p.emitDomSetParams)(t))return l.store.assertIsReady(),(l.store.navigationRef?.current?.setParams)(t)}function A(t,n={}){let o=t='string'==typeof t?t:(0,m.resolveHref)(t);if((0,p.emitDomLinkEvent)(o,n))return;if((0,v.shouldLinkExternally)(o))return o.startsWith('//')&&'web'!==c.Platform.OS&&(o=`https:${o}`),void u.openURL(o);if('..'===o||'../'===o){l.store.assertIsReady();const t=l.store.navigationRef.current;if(null==t)throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");if(!l.store.linking)throw new Error('Attempted to link to route when no routes are present');return void t.goBack()}const i={type:'ROUTER_LINK',payload:{href:o,options:n}};f.routingQueue.add(i)}e.router={navigate:h,push:P,dismiss:_,dismissAll:b,dismissTo:D,canDismiss:E,replace:w,back:()=>k(),canGoBack:R,reload:O,prefetch:y,setParams:j}},564,[565,550,263,570,532,574,538,536]); 637__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},565,[566]); 638__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"IS_DOM",{enumerable:!0,get:function(){return n}});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});const n='undefined'!=typeof $$EXPO_INITIAL_PROPS},566,[567]); 639__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDOMImperativeHandle=function(_,l,n){const P=!(0,t.hasWebViewBridge)()&&void 0===window.$$EXPO_INITIAL_PROPS,f=(0,o.useCallback)(()=>({}),n??[]);(0,o.useImperativeHandle)(_,P?l:f,n),(0,o.useEffect)(()=>(P||(globalThis._domRefProxy=l(),(0,t.getWebViewBridge)().postMessage(JSON.stringify({type:s.REGISTER_DOM_IMPERATIVE_HANDLE_PROPS,data:Object.keys(globalThis._domRefProxy)}))),()=>{P||(globalThis._domRefProxy=void 0)}),n)};var o=r(d[0]),s=r(d[1]),t=r(d[2])},567,[11,568,569]); 640__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NATIVE_ACTION",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"NATIVE_ACTION_RESULT",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"DOM_EVENT",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"MATCH_CONTENTS_EVENT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"REGISTER_DOM_IMPERATIVE_HANDLE_PROPS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"DOM_READY",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"getInjectEventScript",{enumerable:!0,get:function(){return b}}),e.getInjectBodySizeObserverScript=function(){return`;(function observeDocumentBodySize() {\n if (window.ReactNativeWebView == null) {\n throw new Error(\n 'window.ReactNativeWebView is not defined. This script should only be injected in a WebView environment.'\n );\n }\n\n function registerObserver() {\n new ResizeObserver(entries => {\n const { width, height } = entries[0].contentRect;\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: '${c}',\n data: {\n width,\n height,\n },\n }));\n })\n .observe(document.body);\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: '${c}',\n data: {\n width: document.body.clientWidth,\n height: document.body.clientHeight,\n },\n }));\n }\n\n if (document.readyState !== 'loading') {\n registerObserver();\n return;\n }\n window.addEventListener('DOMContentLoaded', () => {\n registerObserver();\n });\n })();\n true;`};const n='$$native_action',t='$$native_action_result',o='$$dom_event',c='$$match_contents_event',u='$$register_dom_imperative_handle_props',s='$$dom_ready',b
640=n=>`;(function() {\n try {\n window.dispatchEvent(new CustomEvent("${o}",${JSON.stringify({detail:n})}));\n } catch (e) {}\n })();\n true;`},568,[]); 641__d(function(g,r,i,a,m,e,d){"use strict";function n(){return'undefined'!=typeof window?window.ReactNativeWebView:void 0}Object.defineProperty(e,'__esModule',{value:!0}),e.hasWebViewBridge=function(){return null!=n()},e.getWebViewBridge=function(){const t=n();if(!t)throw new Error("The react-native-webview bridge (window.ReactNativeWebView) is not available. This module must only be called from code running inside a DOM Component WebView. Guard the call with hasWebViewBridge() when the caller may also run on web or React Native.");return t}},569,[]); 642__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.routingQueue=void 0;const u=r(d[0]);e.routingQueue={queue:[],subscribers:new Set,subscribe:u=>(e.routingQueue.subscribers.add(u),()=>{e.routingQueue.subscribers.delete(u)}),snapshot:()=>e.routingQueue.queue,add(u){e.routingQueue.queue.push(u);for(const u of e.routingQueue.subscribers)u()},run(t){const n=e.routingQueue.queue;let s;for(e.routingQueue.queue=[];s=n.shift();)if(t.current)if('ROUTER_LINK'===s.type){const{payload:{href:n,options:o}}=s;s=(0,u.getNavigateAction)(n,o,o.event,o.withAnchor,o.dangerouslySingular,!!o.__internal__PreviewKey),s&&t.current.dispatch(s)}else t.current.dispatch(s)}}},570,[571]); 643__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getNavigateAction=function(c,p,u="NAVIGATE",A,R,E){let _=c;n.store.assertIsReady();const f=n.store.navigationRef.current;if(null==f)throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");if(!n.store.linking)throw new Error('Attempted to link to route when no routes are present');const N=f.getRootState();if(_=(0,s.resolveHrefStringWithSegments)(_,n.store.getRouteInfo(),p),_=(0,o.applyRedirects)(_,n.store.redirects)??void 0,!_)return;const I=n.store.linking.getStateFromPath(_,n.store.linking.config);if(!I||0===I.routes.length)return void console.error('Could not generate a valid navigation state for the given path: '+_);const{actionStateRoute:v,navigationState:P}=(0,t.findDivergentState)(I,N,'PRELOAD'===u),y=(0,t.getPayloadFromStateRoute)(v||{});'PUSH'===u&&'stack'!==P.type?u='NAVIGATE':('expo-tab'===P.type||'REPLACE'===u&&'drawer'===P.type)&&(u='JUMP_TO');if(A){y.params.initial;let t=y.params;for(;t;)t.initial=!A,t=t.params}const O=E?{[l.INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME]:!0,[l.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME]:!0}:{},S=(0,l.appendInternalExpoRouterParams)(y.params,O);return{type:u,target:P.key,payload:{name:y.screen,params:S,singular:R}}};const t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4])},571,[572,532,549,538,573]); 644__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPayloadFromStateRoute=function(t){const n={params:{}};let s=n,o=s.params,u=t;for(;u;)Object.assign(o,{...s.params,...u.params}),s.screen=u.name,s.params={...o},delete s.params.screen,s=s.params,o=s,u=u.state?.routes[u.state?.routes.length-1];return n},e.findDivergentState=function(n,s,o=!1){let u,c=n,p=s;const f=[];for(;c&&p;){u=c.routes[c.routes.length-1];const n=(()=>'tab'===p.type&&o&&p.routes.find(t=>t.name===u?.name)||p.routes[p.index??0])(),s=u.state,l=n.state,b=(0,t.matchDynamicName)(u.name);if(u.name!==n.name||!s||!l||b&&u.params?.[b.name]!==n.params?.[b.name]){'tab'===p.type&&o&&f.push(n);break}f.push(n),c=s,p=l}return{actionState:c,navigationState:p,actionStateRoute:u,navigationRoutes:f}};const t=r(d[0])},572,[257]); 645__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.INTERNAL_EXPO_ROUTER_GESTURE_ENABLED_OPTION_NAME=e.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME=e.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME=e.INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME=e.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME=void 0,e.appendInternalExpoRouterParams=function(_,E){let N={},R={};_&&(N={..._},'params'in _&&'object'==typeof _.params&&_.params&&(R=_.params));R={...R,...E},N={...N,...E}
645,Object.keys(R).length>0&&(N.params=R);if(0===Object.keys(N).length&&void 0===_)return;return N},e.getInternalExpoRouterParams=function(E){const N={},R=E||{},A='params'in R&&'object'==typeof R.params&&R.params?R.params:{};for(const E of _)E in R?N[E]=R[E]:E in A&&(N[E]=A[E]);return N},e.hasParam=function _(E,N){if(E&&'object'==typeof E){const R=E;if(void 0!==R[N])return!0;if(R.params&&'object'==typeof R.params)return _(R.params,N)}return!1},e.removeParams=E,e.removeInternalExpoRouterParams=function(N){if(!N)return;return E(N,[..._,'params'])},e.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME='__internal_expo_router_no_animation',e.INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME='__internal__expo_router_is_preview_navigation',e.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME='__internal_expo_router_zoom_transition_source_id',e.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME='__internal_expo_router_zoom_transition_screen_id',e.INTERNAL_EXPO_ROUTER_GESTURE_ENABLED_OPTION_NAME='internal_gestureEnabled';const _=[e.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,e.INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME,e.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,e.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];function E(_,N){if(!_)return;const R='params'in _&&'object'==typeof _.params&&_.params?_.params:void 0,A=R?E(R,N):void 0,t=Object.fromEntries(Object.entries(_).filter(([_])=>!N.includes(_)&&'params'!==_));return Object.keys(A??{}).length>0?{...t,params:A}:t}},573,[]); 646__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.emitDomSetParams=function(o={}){return n(t.ROUTER_SET_PARAMS_TYPE,{params:o})},e.emitDomDismiss=function(o){return n(t.ROUTER_DISMISS_TYPE,{count:o})},e.emitDomGoBack=function(){return n(t.ROUTER_BACK_TYPE)},e.emitDomDismissAll=function(){return n(t.ROUTER_DISMISS_ALL_TYPE)},e.emitDomLinkEvent=function(o,u){return n(t.ROUTER_LINK_TYPE,{href:o,options:u})};const t=r(d[0]);function n(t,n={}){return'undefined'!=typeof $$EXPO_INITIAL_PROPS&&'undefined'!=typeof ReactNativeWebView&&(window.ReactNativeWebView.postMessage(JSON.stringify({type:t,data:n})),!0)}},574,[575]); 647__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ROUTER_SET_PARAMS_TYPE=e.ROUTER_BACK_TYPE=e.ROUTER_DISMISS_TYPE=e.ROUTER_DISMISS_ALL_TYPE=e.ROUTER_LINK_TYPE=void 0,e.ROUTER_LINK_TYPE='$$router_link',e.ROUTER_DISMISS_ALL_TYPE='$$router_dismissAll',e.ROUTER_DISMISS_TYPE='$$router_dismiss',e.ROUTER_BACK_TYPE='$$router_goBack',e.ROUTER_SET_PARAMS_TYPE='$$router_setParams'},575,[]); 648__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPayloadFromStateRoute=e.findDivergentState=e.prefetch=e.reload=e.linkTo=e.setParams=e.canDismiss=e.canGoBack=e.goBack=e.dismissAll=e.dismissTo=e.dismiss=e.replace=e.push=e.navigate=e.routingQueue=void 0;var t=r(d[0]);Object.defineProperty(e,"routingQueue",{enumerable:!0,get:function(){return t.routingQueue}});var n=r(d[1]);Object.defineProperty(e,"navigate",{enumerable:!0,get:function(){return n.navigate}}),Object.defineProperty(e,"push",{enumerable:!0,get:function(){return n.push}}),Object.defineProperty(e,"replace",{enumerable:!0,get:function(){return n.replace}}),Object.defineProperty(e,"dismiss",{enumerable:!0,get:function(){return n.dismiss}}),Object.defineProperty(e,"dismissTo",{enumerable:!0,get:function(){return n.dismissTo}}),Object.defineProperty(e,"dismissAll",{enumerable:!0,get:function(){return n.dismissAll}}),Object.defineProperty(e,"goBack",{enumerable:!0,get:function(){return n.goBack}}),Object.defineProperty(e,"canGoBack",{enumerable:!0,get:function(){return n.canGoBack}}),Object.defineProperty(e,"canDismiss",{enumerable:!0,get:function(){return n.canDismiss}}),Object.defineProperty(e,"setParams",{enumerable:!0,get:function(){return n.setParams}}),Object.defineProperty(e,"linkTo",{enumerable:!0,get:function(){return n.linkTo}}),Object.defineProperty(e,"reload",{enumerable:!0,get:function(){return n.reload}}),Object.defineProperty(e,"prefetch",{enumerable:!0,get:function(){return n.prefetch}});var u=r(d[2]);Object.defineProperty(e,"findDivergentState",{enumerable:!0,get:function(){return u.findDivergentState}}),Object.defineProperty(e,"getPayloadFromStateRoute",{enumerable:!0,get:function(){return u.getPayloadFromStateRoute}})},576,[570,564,572]); 649__d(function(g,r,i,a,m,e,d){"use strict";
649Object.defineProperty(e,"__esModule",{value:!0}),e.useUnstableGlobalHref=function(){return(0,t.useRouteInfo)().unstable_globalHref};const t=r(d[0])},577,[558]); 650__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useSegments=function(){return(0,t.useRouteInfo)().segments};const t=r(d[0])},578,[558]); 651__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.usePathname=function(){return(0,t.useRouteInfo)().pathname};const t=r(d[0])},579,[558]); 652__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useGlobalSearchParams=function(){return(0,t.useRouteInfo)().params};const t=r(d[0])},580,[558]); 653__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.useLocalSearchParams=function(){const t=n.default.use(u.LocalRouteParamsContext)??{},{params:c}=(0,o.usePreviewInfo)();return Object.fromEntries(Object.entries(c??t).map(([t,n])=>{if(null==n)return[t,n];if(Array.isArray(n))return[t,n.map(t=>{try{return decodeURIComponent(t)}catch{return t}})];try{return[t,decodeURIComponent(n)]}catch{return[t,n]}}))};const n=t(r(d[0])),u=r(d[1]),o=r(d[2])},581,[11,256,528]); 654__d(function(g,r,i,a,m,e,d){"use strict";var s=this&&this.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSearchParams=function({global:s=!1}={}){t.default.useRef(s);const c=s?(0,n.useGlobalSearchParams)():(0,o.useLocalSearchParams)(),h=Object.entries(c).flatMap(([t,n])=>{if(s){if('params'===t)return[];if('screen'===t)return[]}return Array.isArray(n)?n.map(s=>[t,s]):[[t,n]]});return new u(h)};const t=s(r(d[0])),n=r(d[1]),o=r(d[2]);class u extends URLSearchParams{set(){throw new Error('The URLSearchParams object return from useSearchParams is read-only')}append(){throw new Error('The URLSearchParams object return from useSearchParams is read-only')}delete(){throw new Error('The URLSearchParams object return from useSearchParams is read-only')}}},582,[11,580,581]); 655__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useLoaderData=function(){const l=(0,t.use)(_.ServerDataLoaderContext),E=(0,t.use)(n.LoaderCacheContext);(0,t.useSyncExternalStore)(E.subscribe,E.getSnapshot,E.getSnapshot);const O=(0,h.useStateForPath)(),R=(0,o.useContextKey)(),A=(0,t.useMemo)(()=>{const t=(0,s.getRouteInfoFromState)(O),o=R.startsWith('/')?R.slice(1):R,n=`/${(0,f.getSingularId)(o,{params:t.params})}`,_=t.searchParams?.toString()||'';return _?`${n}?${_}`:n},[R,O]);if(l)return l[A];if('undefined'!=typeof window&&globalThis.__EXPO_ROUTER_LOADER_DATA__&&globalThis.__EXPO_ROUTER_LOADER_DATA__[A])return globalThis.__EXPO_ROUTER_LOADER_DATA__[A];const D=(0,u.getLoaderData)({resolvedPath:A,cache:E,fetcher:c.fetchLoader});if(D instanceof Promise)return(0,t.use)(D);return D};
655const t=r(d[0]),o=r(d[1]),s=r(d[2]),n=r(d[3]),_=r(d[4]),u=r(d[5]),c=r(d[6]),h=r(d[7]),f=r(d[8])},583,[11,256,533,584,585,586,587,401,588]); 656__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LoaderCacheContext=e.defaultLoaderCache=e.LoaderCache=void 0;const t=r(d[0]);class s{data=new Map;errors=new Map;promises=new Map;version=0;listeners=new Set;subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.version;invalidateAll(){this.clear(),this.version++;for(const t of this.listeners)t()}getData(t){return this.data.get(t)}hasData(t){return this.data.has(t)}getError(t){return this.errors.get(t)}getPromise(t){return this.promises.get(t)}setData(t,s){this.data.set(t,s)}deleteData(t){this.data.delete(t)}setError(t,s){this.errors.set(t,s)}deleteError(t){this.errors.delete(t)}setPromise(t,s){this.promises.set(t,s)}deletePromise(t){this.promises.delete(t)}clear(){this.data.clear(),this.errors.clear(),this.promises.clear()}}e.LoaderCache=s,e.defaultLoaderCache=new s,e.LoaderCacheContext=(0,t.createContext)(e.defaultLoaderCache)},584,[11]); 657__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ServerDataLoaderContext=void 0;const t=r(d[0]);e.ServerDataLoaderContext=(0,t.createContext)(null)},585,[11]); 658__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLoaderData=function({resolvedPath:t,cache:o,fetcher:s}){const c=o.getError(t);if(c)throw c;if(o.hasData(t))return o.getData(t);const n=o.getPromise(t);if(n)return n;const l=s(t).then(s=>(o.setData(t,s),o.deleteError(t),o.deletePromise(t),s)).catch(s=>{const c=new Error(`Failed to load loader data for route: ${t}`,{cause:s});throw o.setError(t,c),o.deleteData(t),o.deletePromise(t),c});return o.setPromise(t,l),l}},586,[]); 659__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLoaderModulePath=o,e.fetchLoader=async function(t){const n=o(t),c=await fetch(n,{headers:{Accept:'application/json'}});if(!c.ok)throw new Error(`Failed to fetch loader data: ${c.status}`);try{return await c.json()}catch(t){throw new Error(`Failed to parse loader data: ${t}`)}};const t=r(d[0]);function o(o){const{pathname:n,search:c}=(0,t.parseUrlUsingCustomBase)(o),s='/'===n?'/':n.replace(/\/$/,'');return`/_expo/loaders${'/'===s?'/index':s}${c}`}},587,[536]); 660__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,o)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(s){if(s&&s.__esModule)return s;var o={};if(null!=s)for(var u=e(s),i=0;i<u.length;i++)"default"!==u[i]&&t(o,s,u[i]);return n(o,s),o}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};
660Object.defineProperty(_e,"__esModule",{value:!0}),_e.useSortedScreens=function(e,t,n=!1){const s=(0,c.useRouteNode)(),o=s?.children??[],u=n?o.filter(t=>e.some(e=>e.name===t.route||`${e.name}/index`===t.route)):o,i=u.length?j(u,e,s?.initialRouteName):[];return l.default.useMemo(()=>i.filter(e=>{const n=e.route.route;return!t.has(n)&&!t.has(n.replace(/\/index$/,''))}).map(e=>k(e.route,e.props)),[i,t])},_e.getQualifiedRouteComponent=N,_e.screenOptionsFactory=T,_e.routeToScreen=k,_e.getSingularId=w;const u=r(d[0]),i=r(d[1]),l=s(r(d[0])),c=r(d[2]),p=r(d[3]),m=r(d[4]),f=r(d[5]),h=o(r(d[6])),y=r(d[7]),v=r(d[8]),_=r(d[9]),b=r(d[10]),E=r(d[11]),S=r(d[12]),x=r(d[13]),I=r(d[14]),R=r(d[15]);function j(e,t=[],n){if(!t?.length)return e.sort((0,c.sortRoutesWithInitial)(n)).map(e=>({route:e,props:{}}));const s=[...e],o=t.map(({name:t,redirect:n,initialParams:o,listeners:u,options:i,getId:l,dangerouslySingular:c})=>{if(!s.length)return console.warn(`[Layout children]: Too many screens defined. Route "${t}" is extraneous.`),null;const p=s.findIndex(e=>e.route===t||e.route===`${t}/index`);if(-1===p)return console.warn(`[Layout children]: No route named "${t}" exists in nested children:`,e.map(({route:e})=>e)),null;{const e=s[p];if(s.splice(p,1),n){if('string'==typeof n)throw new Error("Redirecting to a specific route is not supported yet.");return null}return l?(console.warn(`Deprecated: prop 'getId' on screen ${t} is deprecated. Please rename the prop to 'dangerouslySingular'`),c&&console.warn(`Screen ${t} cannot use both getId and dangerouslySingular together.`)):c&&('string'==typeof c?l=()=>c:'function'==typeof c&&t?l=e=>c(t,e.params||{}):!0===c&&t&&(l=e=>w(t,e))),{route:e,props:{initialParams:o,listeners:u,options:i,getId:l}}}}).filter(Boolean);return o.push(...s.sort((0,c.sortRoutesWithInitial)(n)).map(e=>({route:e,props:{}}))),o}function O(e,{ErrorBoundary:t,SuspenseFallback:n,unstable_settings:s,...o}){const u=s?.screenErrorBoundary;if(t||'layout'===e.type&&void 0!==u){return{default:l.default.forwardRef((n,s)=>{const p=(0,l.use)(c.ScreenErrorBoundaryContext);let m=l.default.createElement(o.default||x.EmptyRoute,{...n,ref:s});return t&&(m=(0,i.jsx)(R.Try,{catch:t,children:m})),'layout'===e.type&&void 0!==u&&(m=(0,i.jsx)(c.ScreenErrorBoundaryContext,{value:u??void 0,children:m}),null===u&&p&&(m=(0,i.jsx)(R.Try,{catch:p,children:m}))),m}),SuspenseFallback:n}}return{default:o.default,SuspenseFallback:n}}const P=new WeakMap;function N(e){if(P.has(e))return P.get(e);let t,n;if('lazy'===h.default)t=l.default.lazy(()=>{const t=e.loadRoute();return'then'in t?t.then(O.bind(null,e)):{then(n){const s=O(e,t);return Promise.resolve(n?n(s):s)}}});else{const s=e.loadRoute(),o=O(e,s);t=o.default,n='layout'===e.type?o.SuspenseFallback:void 0}const s=e=>((0,m.useColorSchemeChangesIfNeeded)(),(0,i.jsx)(t,{...e}));function o({route:t,navigation:o,...u}){const m=(0,S.useStateForPath)(),f=o.isFocused(),E=(0,p.useExpoRouterStore)(),x=(0,l.use)(c.SuspenseFallbackContext),j=(0,l.use)(c.ScreenErrorBoundaryContext),O='lazy'===h.default?I.SuspenseFallback:n??x??I.SuspenseFallback,P='layout'===e.type?n??x:x;if(f){const e=o.getState();!(e&&'state'in e.routes[e.index])&&m&&E.setFocusedState(m)}(0,l.useEffect)(()=>o.addListener('focus',()=>{const e=o.getState();!(e&&'state'in e.routes[e.index])&&m&&E.setFocusedState(m)}),[o]),(0,l.useEffect)(()=>o.addListener('transitionEnd',e=>{e?.data?.closing||(0,b.hasParam)(t?.params,b.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME)&&o.replaceParams((0,b.removeParams)(t?.params,[b.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME]))}),[o]);const N='route'===e.type,T=!!t?.key,k=(0,i.jsx)(s,{...u,segment:e.route});return(0,i.jsx)(c.Route,{node:e,params:t?.params,children:(0,i.jsxs)(c.SuspenseFallbackContext,{value:P,children:[_.unstable_navigationEvents.isEnabled()&&N&&T&&(0,i.jsx)(F,{navigation:o,screenId:t.key}),(0,i.jsxs)(v.ZoomTransitionTargetContextProvider,{route:t,children:[(0,i.jsx)(y.ZoomTransitionEnabler,{route:t}),(0,i.jsx)(l.default.Suspense,{name:t?`Route(${t.name})`:void 0,fallback:(0,i.jsx)(O,{route:e.contextKey,params:t?.params??{}}),children:j&&N?(0,i.jsx)(R.Try,{catch:j,children:k}):k})]})]})})}return P.set(e,o),o}function F({navigation:e,screenId:t}){const n=l.default.useRef(!0),s=l.default.useRef(!0),o=(0,f.useCurrentRouteInfo)(),u=e.isFocused();return n.current&&(n.current=!1,o&&!u&&_.unstable_navigationEvents.emit('pagePreloaded',{pathname:o.pathname,params:o.params,segments:o.segments,screenId:t})),(0,l.useEffect)(()=>o?()=>{_.unstable_navigationEvents.emit('pageRemoved',{pathname:o.pathname,params:o.params,segments:o.segments,screenId:t})}:()=>{},[o?.params,o?.pathname,o?.segments,t]),(0,l.useEffect)(()=>{u&&o&&s.current&&(_.unstable_navigationEvents.emit('pageFocused',{pathname:o.pathname,params:o.params,segments:o.segments,screenId:t}),s.current=!1)},[u,o?.pathname,o?.params,o?.segments,t]),(0,l.useEffect)(()=>
660{if(o){const n=e.addListener('focus',()=>{s.current&&(_.unstable_navigationEvents.emit('pageFocused',{pathname:o.pathname,params:o.params,segments:o.segments,screenId:t}),s.current=!1)}),u=e.addListener('blur',()=>{_.unstable_navigationEvents.emit('pageBlurred',{pathname:o.pathname,params:o.params,segments:o.segments,screenId:t}),s.current=!0});return()=>{n(),u()}}return()=>{}},[e,o?.pathname,o?.params,o?.segments,t]),null}function T(e,t){return n=>{const s=e.generated?e.loadRoute()?.getNavOptions:null,o={...'function'==typeof s?s(n):s,...'function'==typeof t?t?.(n):t};return e.internal&&(o.tabBarItemStyle={display:'none'},o.tabBarButton=()=>null,o.drawerItemStyle={height:0,display:'none'}),o}}function k(e,{options:t,getId:n,...s}={}){return(0,u.createElement)(E.Screen,{...s,name:e.route,key:e.route,getId:n,options:T(e,t),getComponent:()=>N(e)})}function w(e,t={}){return e.split('/').map(e=>e.startsWith('[...')?t.params?.[e.slice(4,-1)]?.join('/')||e:e.startsWith('[')&&e.endsWith(']')&&t.params?.[e.slice(1,-1)]||e).join('/')}},588,[11,6,256,589,590,591,592,593,594,595,573,520,401,596,686,687]); 661__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useExpoRouterStore=e.StoreContext=void 0;const t=r(d[0]);e.StoreContext=(0,t.createContext)(null);e.useExpoRouterStore=()=>(0,t.use)(e.StoreContext)},589,[11]); 662__d(function(g,r,i,a,m,e,d){"use strict";var o=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColorSchemeChangesIfNeeded=void 0,e.shouldAppendSitemap=s,e.shouldAppendNotFound=c,e.shouldReactToColorSchemeChanges=f,e.getRootStackRouteNames=function(){const o=[u.INTERNAL_SLOT_NAME];c()&&o.push(u.NOT_FOUND_ROUTE_NAME);s()&&o.push(u.SITEMAP_ROUTE_NAME);return o};const t=o(r(d[0])),n=r(d[1]),u=r(d[2]);function s(){const o=t.default.expoConfig?.extra?.router;return!1!==o?.sitemap}function c(){const o=t.default.expoConfig?.extra?.router;return!1!==o?.notFound}function f(){const o=t.default.expoConfig?.extra?.router;return!1!==o?.adaptiveColors}e.useColorSchemeChangesIfNeeded=f()?n.useColorScheme:function(){}},590,[542,263,534]); 663__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useCurrentRouteInfo=function(){const n=(0,u.useStateForPath)();return(0,t.useMemo)(()=>n?(0,o.getCachedRouteInfo)(n):void 0,[n])};const t=r(d[0]),o=r(d[1]),u=r(d[2])},591,[11,537,401]); 664__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="sync"},592,[]); 665__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.disableZoomTransition=function(){},e.isZoomTransitionEnabled=function(){return!1},e.ZoomTransitionEnabler=function(n){return null}},593,[]); 666__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZoomTransitionSourceContextProvider=function({children:n}){return n},e.ZoomTransitionTargetContextProvider=function({children:n}){return n}},594,[]); 667__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unstable_navigationEvents=void 0,e.emit=o;const t=['pagePreloaded','pageFocused','pageBlurred','pageRemoved','actionDispatched'],n={};function o(t,o){const s=n[t];if(s)for(const t of s)t(o)}let s=!1;e.unstable_navigationEvents={addListener:function(o,s){if(!t.includes(o))throw new Error(`Unsupported event type: ${o}`);return n[o]||(n[o]=new Set),n[o].add(s),()=>{n[o].delete(s),0===n[o].size&&delete n[o]}},emit:o,enable:()=>{s=!0},isEnabled:()=>s}},595,[]); 668__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyRoute=function(){const s=(0,o.useRouteNode)();return(0,t.jsx)(n.ToastWrapper,{children:(0,t.jsx)(n.Toast,{warning:!0,filename:s?.contextKey,children:"Missing default export"})})};const t=r(d[0]),n=r(d[1]),o=r(d[2])},596,[6,597,256]); 669__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CODE_FONT=void 0,e.ToastWrapper=function({children:t}
669){const u=n.default.use(c.BottomTabBarHeightContext)?l.View:s.SafeAreaView;return(0,o.jsx)(u,{collapsable:!1,style:{flex:1},children:t})},e.Toast=function({children:t,filename:s,warning:c}){const h=n.default.useMemo(()=>{if(s)return'app'+s.replace(/^\./,'')},[s]),x=u();return(0,o.jsx)(l.View,{style:f.container,children:(0,o.jsxs)(l.Animated.View,{style:[f.toast,{position:l.Platform.select({web:'fixed',default:'absolute'}),opacity:x}],children:[!c&&(0,o.jsx)(l.ActivityIndicator,{color:"white"}),c&&(0,o.jsx)(l.Image,{source:r(d[5]),style:f.icon}),(0,o.jsxs)(l.View,{style:{marginLeft:8},children:[(0,o.jsx)(l.Text,{style:f.text,children:t}),h&&(0,o.jsx)(l.Text,{style:f.filename,children:h})]})]})})};const o=r(d[0]),n=t(r(d[1])),l=r(d[2]),s=r(d[3]),c=r(d[4]);function u(){const[t]=n.default.useState(()=>new l.Animated.Value(0));return n.default.useEffect(()=>{l.Animated.timing(t,{toValue:1,duration:200,useNativeDriver:!0}).start()},[]),t}e.CODE_FONT=l.Platform.select({default:'Courier',ios:'Courier New',android:'monospace'});const f=l.StyleSheet.create({container:{backgroundColor:'transparent',flex:1},icon:{width:20,height:20,resizeMode:'contain'},toast:{alignItems:'center',borderWidth:1,borderColor:'rgba(255,255,255,0.2)',flexDirection:'row',bottom:8,left:8,paddingVertical:8,paddingHorizontal:12,borderRadius:4,backgroundColor:'black'},text:{color:'white',fontSize:16},filename:{fontFamily:e.CODE_FONT,opacity:.8,color:'white',fontSize:12},code:{fontFamily:e.CODE_FONT}})},597,[6,11,263,105,598,685]); 670__d(function(g,r,_i,a,_m,e,d){"use strict";var t,o=this&&this.__createBinding||(Object.create?function(t,o,n,i){void 0===i&&(i=n);var u=Object.getOwnPropertyDescriptor(o,n);u&&!("get"in u?!o.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return o[n]}}),Object.defineProperty(t,i,u)}:function(t,o,n,i){void 0===i&&(i=n),t[i]=o[n]}),n=this&&this.__setModuleDefault||(Object.create?function(t,o){Object.defineProperty(t,"default",{enumerable:!0,value:o})}:function(t,o){t.default=o}),i=this&&this.__importStar||(t=function(o){return t=Object.getOwnPropertyNames||function(t){var o=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(o[o.length]=n);return o},t(o)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),b=0;b<c.length;b++)"default"!==c[b]&&o(u,i,c[b]);return n(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.useBottomTabBarHeight=e.BottomTabBarHeightContext=e.BottomTabBarHeightCallbackContext=e.BottomTabView=e.BottomTabBar=e.createBottomTabNavigator=e.TransitionSpecs=e.TransitionPresets=e.SceneStyleInterpolators=void 0;const u=i(r(d[0]));e.SceneStyleInterpolators=u;const c=i(r(d[1]));e.TransitionPresets=c;const b=i(r(d[2]));e.TransitionSpecs=b;var l=r(d[3]);Object.defineProperty(e,"createBottomTabNavigator",{enumerable:!0,get:function(){return l.createBottomTabNavigator}});var f=r(d[4]);Object.defineProperty(e,"BottomTabBar",{enumerable:!0,get:function(){return f.BottomTabBar}});var s=r(d[5]);Object.defineProperty(e,"BottomTabView",{enumerable:!0,get:function(){return s.BottomTabView}});var B=r(d[6]);Object.defineProperty(e,"BottomTabBarHeightCallbackContext",{enumerable:!0,get:function(){return B.BottomTabBarHeightCallbackContext}});var m=r(d[7]);Object.defineProperty(e,"BottomTabBarHeightContext",{enumerable:!0,get:function(){return m.BottomTabBarHeightContext}});var T=r(d[8]);Object.defineProperty(e,"useBottomTabBarHeight",{enumerable:!0,get:function(){return T.useBottomTabBarHeight}})},598,[599,600,601,602,649,603,652,682,684]); 671__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forFade=function({current:t}){return{sceneStyle:{opacity:t.progress.interpolate({inputRange:[-1,0,1],outputRange:[0,1,0]})}}},e.forShift=function({current:t}){return{sceneStyle:{opacity:t.progress.interpolate({inputRange:[-1,0,1],outputRange:[0,1,0]}),transform:[{translateX:t.progress.interpolate({inputRange:[-1,0,1],outputRange:[-50,0,50]})}]}}}},599,[]); 672__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShiftTransition=e.FadeTransition=void 0;const t=r(d[0]),n=r(d[1]);e.FadeTransition={transitionSpec:n.FadeSpec,sceneStyleInterpolator:t.forFade},e.ShiftTransition={transitionSpec:n.ShiftSpec,sceneStyleInterpolator:t.forShift}}
672,600,[599,601]); 673__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShiftSpec=e.FadeSpec=void 0;const n=r(d[0]);e.FadeSpec={animation:'timing',config:{duration:150,easing:n.Easing.in(n.Easing.linear)}},e.ShiftSpec={animation:'timing',config:{duration:150,easing:n.Easing.inOut(n.Easing.ease)}}},601,[263]); 674__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createBottomTabNavigator=function(t){return(0,o.createNavigatorFactory)(s)(t)};const t=r(d[0]),o=r(d[1]),n=r(d[2]);function s({id:s,initialRouteName:c,backBehavior:u,UNSTABLE_routeNamesChangeBehavior:N,children:v,layout:B,screenListeners:l,screenOptions:h,screenLayout:L,UNSTABLE_router:_,...T}){const{state:b,descriptors:y,navigation:p,NavigationContent:f}=(0,o.useNavigationBuilder)(o.TabRouter,{id:s,initialRouteName:c,backBehavior:u,UNSTABLE_routeNamesChangeBehavior:N,children:v,layout:B,screenListeners:l,screenOptions:h,screenLayout:L,UNSTABLE_router:_});return(0,t.jsx)(f,{children:(0,t.jsx)(n.BottomTabView,{...T,state:b,navigation:p,descriptors:y})})}},602,[6,401,603]); 675__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var s=Object.getOwnPropertyDescriptor(n,o);s&&!("get"in s?!n.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,s)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var s={};if(null!=i)for(var l=t(i),c=0;c<l.length;c++)"default"!==l[c]&&n(s,i,l[c]);return o(s,i),s});Object.defineProperty(e,"__esModule",{value:!0}),e.BottomTabView=function(t){const{tabBar:n=T,state:o,navigation:i,descriptors:h,safeAreaInsets:w,detachInactiveScreens:A='web'===c.Platform.OS||'android'===c.Platform.OS||'ios'===c.Platform.OS}=t,C=o.routes[o.index].key,[M,H]=l.useState([C]);M.includes(C)||H([...M,C]);const I=l.useRef(C),z=(0,v.useAnimatedHashMap)(o);l.useEffect(()=>{const t=I.current;let n;if(t!==C&&h[t]?.options.popToTopOnBlur){const i=o.routes.find(n=>n.key===t);'stack'===i?.state?.type&&i.state.key&&(n={...f.StackActions.popToTop(),target:i.state.key})}t!==C&&i.emit({type:'transitionStart',target:C}),c.Animated.parallel(o.routes.map((n,i)=>{const{options:s}=h[n.key],{animation:l="none",transitionSpec:u=O[l].transitionSpec}=s;let p=u;n.key!==t&&n.key!==C&&(p=O.none.transitionSpec),p=p??O.none.transitionSpec;const f=i===o.index?0:i>=o.index?1:-1;return c.Animated[p.animation](z[n.key],{...p.config,toValue:f,useNativeDriver:j})}).filter(Boolean)).start(({finished:o})=>{o&&n&&i.dispatch(n),t!==C&&i.emit({type:'transitionEnd',target:C})}),I.current=C},[h,C,i,o.index,o.routes,z]);const D=p.SafeAreaProviderCompat.initialMetrics.frame,[R,F]=l.useState(()=>(0,y.getTabBarHeight)({state:o,descriptors:h,dimensions:D,insets:{...p.SafeAreaProviderCompat.initialMetrics.insets,...t.safeAreaInsets},style:h[o.routes[o.index].key].options.tabBarStyle})),{routes:E}=o,N=!E.some(t=>P(h[t.key].options)),{tabBarPosition:V="bottom"}=h[C].options,K=(0,s.jsx)(S.BottomTabBarHeightCallbackContext.Provider,{value:F,children:(0,s.jsx)(u.SafeAreaInsetsContext.Consumer,{children:t=>n({state:o,descriptors:h,navigation:i,insets:{top:w?.top??t?.top??0,right:w?.right??t?.right??0,bottom:w?.bottom??t?.bottom??0,left:w?.left??t?.left??0}})})},"tabbar");return(0,s.jsxs)(p.SafeAreaProviderCompat,{style:{flexDirection:'left'===V||'right'===V?'row':'column'},children:['top'===V||'left'===V?K:null,(0,s.jsx)(m.MaybeScreenContainer,{enabled:A,hasTwoStates:N,style:_.screens,children:E.map((t,n)=>{const i=h[t.key],{lazy:l=!0,animation:u="none",sceneStyleInterpolator:f=O[u].sceneStyleInterpolator}=i.options,y=o.index===n,S=o.preloadedRouteKeys.includes(t.key);if(l&&!M.includes(t.key)&&!y&&!S)return null;const{freezeOnBlur:v,header:j=({layout:n,options:o})=>(0,s.jsx)(p.Header,{...o,layout:n,title:(0,p.getHeaderTitle)(o,t.name)}
675),headerShown:T,headerStatusBarHeight:_,headerTransparent:w,sceneStyle:C}=i.options,{sceneStyle:H}=f?.({current:{progress:z[t.key]}})??{},I=P(i.options),F=y?B:I?z[t.key].interpolate({inputRange:[0,.99999,1],outputRange:[k,k,x],extrapolate:'extend'}):x;return(0,s.jsx)(m.MaybeScreen,{style:[c.StyleSheet.absoluteFill,{zIndex:y?0:-1}],active:F,enabled:A,freezeOnBlur:v,shouldFreeze:F===x&&!S,children:(0,s.jsx)(b.BottomTabBarHeightContext.Provider,{value:'bottom'===V?R:0,children:(0,s.jsx)(p.Screen,{focused:y,route:i.route,navigation:i.navigation,headerShown:T,headerStatusBarHeight:_,headerTransparent:w,header:j({layout:D,route:i.route,navigation:i.navigation,options:i.options}),style:[C,I&&H],children:i.render()})})},t.key)})},"screens"),'bottom'===V||'right'===V?K:null]})};const s=r(d[0]),l=i(r(d[1])),c=r(d[2]),u=r(d[3]),p=r(d[4]),f=r(d[5]),h=r(d[6]),y=r(d[7]),m=r(d[8]),S=r(d[9]),b=r(d[10]),v=r(d[11]),x=0,k=1,B=2,O={fade:h.FadeTransition,shift:h.ShiftTransition,none:{sceneStyleInterpolator:void 0,transitionSpec:{animation:'timing',config:{duration:0}}}},j='web'!==c.Platform.OS,P=t=>{const{animation:n,transitionSpec:o}=t;return n?'none'!==n:Boolean(o)},T=t=>(0,s.jsx)(y.BottomTabBar,{...t});const _=c.StyleSheet.create({screens:{flex:1,overflow:'hidden'}})},603,[6,11,263,105,604,401,600,649,654,652,682,683]); 676__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,u,o){void 0===o&&(o=u);var c=Object.getOwnPropertyDescriptor(n,u);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,o,c)}:function(t,n,u,o){void 0===o&&(o=u),t[o]=n[u]}),n=this&&this.__exportStar||function(n,u){for(var o in n)"default"===o||Object.prototype.hasOwnProperty.call(u,o)||t(u,n,o)},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Assets=e.useFrameSize=e.Text=e.Screen=e.SafeAreaProviderCompat=e.ResourceSavingView=e.PlatformPressable=e.MissingIcon=e.Lazy=e.Label=e.getLabel=e.useHeaderHeight=e.HeaderTitle=e.HeaderShownContext=e.HeaderHeightContext=e.HeaderButton=e.HeaderBackground=e.HeaderBackContext=e.HeaderBackButton=e.Header=e.getHeaderTitle=e.getDefaultHeaderHeight=e.getDefaultSidebarWidth=e.Button=e.Badge=e.Background=void 0;const o=u(r(d[0])),c=u(r(d[1])),f=u(r(d[2])),b=u(r(d[3])),l=u(r(d[4]));var H=r(d[5]);Object.defineProperty(e,"Background",{enumerable:!0,get:function(){return H.Background}});var s=r(d[6]);Object.defineProperty(e,"Badge",{enumerable:!0,get:function(){return s.Badge}});var v=r(d[7]);Object.defineProperty(e,"Button",{enumerable:!0,get:function(){return v.Button}});var P=r(d[8]);Object.defineProperty(e,"getDefaultSidebarWidth",{enumerable:!0,get:function(){return P.getDefaultSidebarWidth}});var p=r(d[9]);Object.defineProperty(e,"getDefaultHeaderHeight",{enumerable:!0,get:function(){return p.getDefaultHeaderHeight}});var m=r(d[10]);Object.defineProperty(e,"getHeaderTitle",{enumerable:!0,get:function(){return m.getHeaderTitle}});var y=r(d[11]);Object.defineProperty(e,"Header",{enumerable:!0,get:function(){return y.Header}});var O=r(d[12]);Object.defineProperty(e,"HeaderBackButton",{enumerable:!0,get:function(){return O.HeaderBackButton}});var j=r(d[13]);Object.defineProperty(e,"HeaderBackContext",{enumerable:!0,get:function(){return j.HeaderBackContext}});var B=r(d[14]);Object.defineProperty(e,"HeaderBackground",{enumerable:!0,get:function(){return B.HeaderBackground}});var h=r(d[15]);Object.defineProperty(e,"HeaderButton",{enumerable:!0,get:function(){return h.HeaderButton}});var S=r(d[16]);Object.defineProperty(e,"HeaderHeightContext",{enumerable:!0,get:function(){return S.HeaderHeightContext}});var _=r(d[17]);Object.defineProperty(e,"HeaderShownContext",{enumerable:!0,get:function(){return _.HeaderShownContext}});var x=r(d[18]);Object.defineProperty(e,"HeaderTitle",{enumerable:!0,get:function(){return x.HeaderTitle}});var k=r(d[19]);Object.defineProperty(e,"useHeaderHeight",{enumerable:!0,get:function(){return k.useHeaderHeight}});var C=r(d[20]);Object.defineProperty(e,"getLabel",{enumerable:!0,get:function(){return C.getLabel}});
676var w=r(d[21]);Object.defineProperty(e,"Label",{enumerable:!0,get:function(){return w.Label}});var L=r(d[22]);Object.defineProperty(e,"Lazy",{enumerable:!0,get:function(){return L.Lazy}});var T=r(d[23]);Object.defineProperty(e,"MissingIcon",{enumerable:!0,get:function(){return T.MissingIcon}});var D=r(d[24]);Object.defineProperty(e,"PlatformPressable",{enumerable:!0,get:function(){return D.PlatformPressable}});var z=r(d[25]);Object.defineProperty(e,"ResourceSavingView",{enumerable:!0,get:function(){return z.ResourceSavingView}});var M=r(d[26]);Object.defineProperty(e,"SafeAreaProviderCompat",{enumerable:!0,get:function(){return M.SafeAreaProviderCompat}});var A=r(d[27]);Object.defineProperty(e,"Screen",{enumerable:!0,get:function(){return A.Screen}});var F=r(d[28]);Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return F.Text}});var I=r(d[29]);Object.defineProperty(e,"useFrameSize",{enumerable:!0,get:function(){return I.useFrameSize}}),e.Assets=[c.default,o.default,l.default,b.default,f.default],n(r(d[30]),e)},604,[605,606,607,608,609,610,611,621,624,625,626,627,629,638,633,630,639,635,637,640,641,642,643,644,622,645,646,647,623,628,648]); 677__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png",width:50,height:85,toString(){return this.uri}}},605,[]); 678__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png",width:96,height:96,toString(){return this.uri}}},606,[]); 679__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png",width:64,height:64,toString(){return this.uri}}},607,[]); 680__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png",width:96,height:96,toString(){return this.uri}}},608,[]); 681__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png",width:96,height:96,toString(){return this.uri}}},609,[]); 682__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Background=function({style:c,...s}){const{colors:u}=(0,t.useTheme)();return(0,o.jsx)(n.Animated.View,{...s,style:[{flex:1,backgroundColor:u.background},c]})};const o=r(d[0]),n=r(d[1]),t=r(d[2])},610,[6,263,401]); 683__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var l=t(o),c=0;c<l.length;c++)"default"!==l[c]&&n(u,o,l[c]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.Badge=function({children:t,style:n,visible:i=!0,size:o=18,...p}){const[v]=l.useState(()=>new c.Animated.Value(i?1:0)),[m,_]=l.useState(i),{colors:O,fonts:y}=(0,f.useTheme)();if(l.useEffect(()=>{if(m)return c.Animated.timing(v,{toValue:i?1:0,duration:150,useNativeDriver:h}).start(({finished:t})=>{t&&!i&&_(!1)}),()=>v.stopAnimation()},[v,m,i]),!m){if(!i)return null;_(!0)}const{backgroundColor:S=O.notification,...j}=c.StyleSheet.flatten(n)||{},w=(0,s.Color)(S)?.isLight()?'black':'white',P=o/2,A=Math.floor(3*o/4);return(0,u.jsx)(c.Animated.Text,{numberOfLines:1,style:[{transform:[{scale:v.interpolate({inputRange:[0,1],outputRange:[.5,1]})}],color:w,lineHeight:o-1,height:o,minWidth:o,opacity:v,backgroundColor:S,fontSize:A,borderRadius:P,borderCurve:'continuous'},y.regular,b.container,j],...p,children:t})};
vendor: 6,542 bytes, lines 683-686
683const u=r(d[0]),l=o(r(d[1])),c=r(d[2]),s=r(d[3]),f=r(d[4]),h='web'!==c.Platform.OS;const b=c.StyleSheet.create({container:{alignSelf:'flex-end',textAlign:'center',paddingHorizontal:4,overflow:'hidden'}})},611,[6,11,263,612,401]); 684__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Color=function(t){if('string'==typeof t&&!t.startsWith('var('))return(0,u.default)(t);return};const u=t(r(d[0]))},612,[613]); 685__d(function(g,r,_i,_a,_m,e,d){const t=r(d[0]),o=r(d[1]),n=['keyword','gray','hex'],s={};for(const t of Object.keys(o))s[[...o[t].labels].sort().join('')]=t;const h={};function l(i,a){if(!(this instanceof l))return new l(i,a);if(a&&a in n&&(a=null),a&&!(a in o))throw new Error('Unknown model: '+a);let c,u;if(null==i)this.model='rgb',this.color=[0,0,0],this.valpha=1;else if(i instanceof l)this.model=i.model,this.color=[...i.color],this.valpha=i.valpha;else if('string'==typeof i){const n=t.get(i);if(null===n)throw new Error('Unable to parse color from string: '+i);this.model=n.model,u=o[this.model].channels,this.color=n.value.slice(0,u),this.valpha='number'==typeof n.value[u]?n.value[u]:1}else if(i.length>0){this.model=a||'rgb',u=o[this.model].channels;const t=Array.prototype.slice.call(i,0,u);this.color=p(t,u),this.valpha='number'==typeof i[u]?i[u]:1}else if('number'==typeof i)this.model='rgb',this.color=[i>>16&255,i>>8&255,255&i],this.valpha=1;else{this.valpha=1;const t=Object.keys(i);'alpha'in i&&(t.splice(t.indexOf('alpha'),1),this.valpha='number'==typeof i.alpha?i.alpha:0);const n=t.sort().join('');if(!(n in s))throw new Error('Unable to parse color from object: '+JSON.stringify(i));this.model=s[n];const{labels:h}=o[this.model],l=[];for(c=0;c<h.length;c++)l.push(i[h[c]]);this.color=p(l)}if(h[this.model])for(u=o[this.model].channels,c=0;c<u;c++){const t=h[this.model][c];t&&(this.color[c]=t(this.color[c]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}l.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(o){let n=this.model in t.to?this:this.rgb();n=n.round('number'==typeof o?o:1);const s=1===n.valpha?n.color:[...n.color,this.valpha];return t.to[n.model](s)},percentString(o){const n=this.rgb().round('number'==typeof o?o:1),s=1===n.valpha?n.color:[...n.color,this.valpha];return t.to.rgb.percent(s)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const t={},{channels:n}=o[this.model],{labels:s}=o[this.model];for(let o=0;o<n;o++)t[s[o]]=this.color[o];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray(){const t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject(){const t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round(t){return t=Math.max(t||0,0),new l([...this.color.map(a(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new l([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},red:c('rgb',0,u(255)),green:c('rgb',1,u(255)),blue:c('rgb',2,u(255)),hue:c(['hsl','hsv','hsl','hwb','hcg'],0,t=>(t%360+360)%360),saturationl:c('hsl',1,u(100)),lightness:c('hsl',2,u(100)),saturationv:c('hsv',1,u(100)),value:c('hsv',2,u(100)),chroma:c('hcg',1,u(100)),gray:c('hcg',2,u(100)),white:c('hwb',1,u(100)),wblack:c('hwb',2,u(100)),cyan:c('cmyk',0,u(100)),magenta:c('cmyk',1,u(100)),yellow:c('cmyk',2,u(100)),black:c('cmyk',3,u(100)),x:c('xyz',0,u(95.047)),y:c('xyz',1,u(100)),z:c('xyz',2,u(108.833)),l:c('lab',0,u(100)),a:c('lab',1),b:c('lab',2),keyword(t){return void 0!==t?new l(t):o[this.model].keyword(this.color)},hex(o){return void 0!==o?new l(o):t.to.hex(this.rgb().round().color)},hexa(o){if(void 0!==o)return new l(o);const n=this.rgb().round().color;let s=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===s.length&&(s='0'+s),t.to.hex(n)+s},rgbNumber(){const t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity(){const t=this.rgb().color,o=[];for(const[n,s]of t.entries()){const t=s/255;o[n]=t<=.04045?t/12.92:((t+.055)/1.055)**2.4}return.2126*o[0]+.7152*o[1]+.0722*o[2]},contrast(t){const o=this.luminosity(),n=t.luminosity();return o>n?(o+.05)/(n+.05):(n+.05)/(o+.05)},level(t){const o=this.contrast(t);return o>=7?'AAA':o>=4.5?'AA':''},isDark(){const t=this.rgb().color;return(2126*t[0]+7152*t[1]+722*t[2])/1e4<128},isLight(){return!this.isDark()},negate(){const t=this.rgb();for(let o=0;o<3;o++)t.color[o]=255-t.color[o];return t},lighten(t){const o=this.hsl();return o.color[2]+=o.color[2]*t,o},darken(t){const o=this.hsl();return o.color[2]-=o.color[2]*t,o},saturate(t){const o=this.hsl();return o.color[1]+=o.color[1]*t,o},desaturate(t){const o=this.hsl();return o.color[1]-=o.color[1]*t,o},whiten(t){const o=this.hwb();return o.color[1]+=o.color[1]*t,o},blacken(t){const o=this.hwb();return o.color[2]+=o.color[2]*t,o},grayscale(){const t=this.rgb().color,o=.3*t[0]+.59*t[1]+.11*t[2];return l.rgb(o,o,o)},fade(t){return this.alpha(this.valpha-this.valpha*t)},opaquer(t){return this.alpha(this.valpha+this.valpha*t)},rotate(t){const o=this.hsl();let n=o.color[0];return n=(n+t)%360,n=n<0?360+n:n,o.color[0]=n,o},mix(t,o){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);const n=t.rgb(),s=this.rgb(),h=void 0===o?.5:o,i=2*h-1,a=n.alpha()-s.alpha(),c=((i*a===-1?i:(i+a)/(1+i*a))+1)/2,u=1-c;return l.rgb(c*n.red()+u*s.red(),c*n.green()+u*s.green(),c*n.blue()+u*s.blue(),n.alpha()*h+s.alpha()*(1-h))}};for(const t of Object.keys(o)){if(n.includes(t))continue;const{channels:s}=o[t];l.prototype[t]=function(...n){return this.model===t?new l(this):n.length>0?new l(n,t):new l([...(s=o[this.model][t].raw(this.color),Array.isArray(s)?s:[s]),this.valpha],t);var s},l[t]=function(...o){let n=o[0];return'number'==typeof n&&(n=p(o,s)),new l(n,t)}}function i(t,o){return Number(t.toFixed(o))}function a(t){return function(o){return i(o,t)}}function c(t,o,n){t=Array.isArray(t)?t:[t];for(const s of t)(h[s]||(h[s]=[]))[o]=n;return t=t[0],function(s){let h;return void 0!==s?(n&&(s=n(s)),h=this[t](),h.color[o]=s,h):(h=this[t]().color[o],n&&(h=n(h)),h)}}function u(t){return function(o){return Math.max(0,Math.min(t,o))}}function p(t,o){for(let n=0;n<o;n++)'number'!=typeof t[n]&&(t[n]=0);return t}_m.exports=l},613,[614,618]); 686__d(function(_g,_r,_i,_a,m,e,d){var r=_r(d[0]),t=_r(d[1]),a=Object.hasOwnProperty,n=Object.create(null);
vendor: 5,567 bytes, lines 686-687
686for(var s in r)a.call(r,s)&&(n[r[s]]=s);var o=m.exports={to:{},get:{}};function l(r,t,a){return Math.min(Math.max(t,r),a)}function u(r){var t=Math.round(r).toString(16).toUpperCase();return t.length<2?'0'+t:t}o.get=function(r){var t,a;switch(r.substring(0,3).toLowerCase()){case'hsl':t=o.get.hsl(r),a='hsl';break;case'hwb':t=o.get.hwb(r),a='hwb';break;default:t=o.get.rgb(r),a='rgb'}return t?{model:a,value:t}:null},o.get.rgb=function(t){if(!t)return null;var n,s,o,u=[0,0,0,1];if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=n[2],n=n[1],s=0;s<3;s++){var h=2*s;u[s]=parseInt(n.slice(h,h+2),16)}o&&(u[3]=parseInt(o,16)/255)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(n=n[1])[3],s=0;s<3;s++)u[s]=parseInt(n[s]+n[s],16);o&&(u[3]=parseInt(o+o,16)/255)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(s=0;s<3;s++)u[s]=parseInt(n[s+1],0);n[4]&&(n[5]?u[3]=.01*parseFloat(n[4]):u[3]=parseFloat(n[4]))}else{if(!(n=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(n=t.match(/^(\w+)$/))?'transparent'===n[1]?[0,0,0,0]:a.call(r,n[1])?((u=r[n[1]])[3]=1,u):null:null;for(s=0;s<3;s++)u[s]=Math.round(2.55*parseFloat(n[s+1]));n[4]&&(n[5]?u[3]=.01*parseFloat(n[4]):u[3]=parseFloat(n[4]))}for(s=0;s<3;s++)u[s]=l(u[s],0,255);return u[3]=l(u[3],0,1),u},o.get.hsl=function(r){if(!r)return null;var t=r.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var a=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,l(parseFloat(t[2]),0,100),l(parseFloat(t[3]),0,100),l(isNaN(a)?1:a,0,1)]}return null},o.get.hwb=function(r){if(!r)return null;var t=r.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var a=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,l(parseFloat(t[2]),0,100),l(parseFloat(t[3]),0,100),l(isNaN(a)?1:a,0,1)]}return null},o.to.hex=function(){var r=t(arguments);return'#'+u(r[0])+u(r[1])+u(r[2])+(r[3]<1?u(Math.round(255*r[3])):'')},o.to.rgb=function(){var r=t(arguments);return r.length<4||1===r[3]?'rgb('+Math.round(r[0])+', '+Math.round(r[1])+', '+Math.round(r[2])+')':'rgba('+Math.round(r[0])+', '+Math.round(r[1])+', '+Math.round(r[2])+', '+r[3]+')'},o.to.rgb.percent=function(){var r=t(arguments),a=Math.round(r[0]/255*100),n=Math.round(r[1]/255*100),s=Math.round(r[2]/255*100);return r.length<4||1===r[3]?'rgb('+a+'%, '+n+'%, '+s+'%)':'rgba('+a+'%, '+n+'%, '+s+'%, '+r[3]+')'},o.to.hsl=function(){var r=t(arguments);return r.length<4||1===r[3]?'hsl('+r[0]+', '+r[1]+'%, '+r[2]+'%)':'hsla('+r[0]+', '+r[1]+'%, '+r[2]+'%, '+r[3]+')'},o.to.hwb=function(){var r=t(arguments),a='';return r.length>=4&&1!==r[3]&&(a=', '+r[3]),'hwb('+r[0]+', '+r[1]+'%, '+r[2]+'%'+a+')'},o.to.keyword=function(r){return n[r.slice(0,3)]}},614,[615,616]); 687__d(function(g,r,i,a,m,e,d){'use strict';m.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
687ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},615,[]); 688__d(function(g,r,_i,a,m,e,d){'use strict';var t=r(d[0]),n=Array.prototype.concat,o=Array.prototype.slice,c=m.exports=function(c){for(var u=[],p=0,i=c.length;p<i;p++){var l=c[p];t(l)?u=n.call(u,o.call(l)):u.push(l)}return u};c.wrap=function(t){return function(){return t(c(arguments))}}},616,[617]); 689__d(function(g,r,i,a,m,e,d){m.exports=function(n){return!(!n||'string'==typeof n)&&(n instanceof Array||Array.isArray(n)||n.length>=0&&(n.splice instanceof Function||Object.getOwnPropertyDescriptor(n,n.length-1)&&'String'!==n.constructor.name))}},617,[]); 690__d(function(g,r,_i,a,m,e,d){const n=r(d[0]),o=r(d[1]),t={};function c(n){const o=function(...o){const t=o[0];return null==t?t:(t.length>1&&(o=t),n(o))};return'conversion'in n&&(o.conversion=n.conversion),o}function s(n){const o=function(...o){const t=o[0];if(null==t)return t;t.length>1&&(o=t);const c=n(o);if('object'==typeof c)for(let n=c.length,o=0;o<n;o++)c[o]=Math.round(c[o]);return c};return'conversion'in n&&(o.conversion=n.conversion),o}Object.keys(n).forEach(i=>{t[i]={},Object.defineProperty(t[i],'channels',{value:n[i].channels}),Object.defineProperty(t[i],'labels',{value:n[i].labels});const l=o(i);Object.keys(l).forEach(n=>{const o=l[n];t[i][n]=s(o),t[i][n].raw=c(o)})}),m.exports=t},618,[619,620]); 691__d(function(_g,_r,_i,_a,_m,e,d){const n=_r(d[0]),t={};for(const r of Object.keys(n))t[n[r]]=r;const r={rgb:{channels:3,labels:'rgb'},hsl:{channels:3,labels:'hsl'},hsv:{channels:3,labels:'hsv'},hwb:{channels:3,labels:'hwb'},cmyk:{channels:4,labels:'cmyk'},xyz:{channels:3,labels:'xyz'},lab:{channels:3,labels:'lab'},lch:{channels:3,labels:'lch'},hex:{channels:1,labels:['hex']},keyword:{channels:1,labels:['keyword']},ansi16:{channels:1,labels:['ansi16']},ansi256:{channels:1,labels:['ansi256']},hcg:{channels:3,labels:['h','c','g']},apple:{channels:3,labels:['r16','g16','b16']},gray:{channels:1,labels:['gray']}};_m.exports=r;for(const n of Object.keys(r)){if(!('channels'in r[n]))throw new Error('missing channels property: '+n);if(!('labels'in r[n]))throw new Error('missing channel labels property: '+n);if(r[n].labels.length!==r[n].channels)throw new Error('channel and label counts mismatch: '+n);const{channels:t,labels:a}=r[n];delete r[n].channels,delete r[n].labels,Object.defineProperty(r[n],'channels',{value:t}),Object.defineProperty(r[n],'labels',{value:a})}function a(n,t){return(n[0]-t[0])**2+(n[1]-t[1])**2+(n[2]-t[2])**2}r.rgb.hsl=function(n){const t=n[0]/255,r=n[1]/255,a=n[2]/255,c=Math.min(t,r,a),s=Math.max(t,r,a),o=s-c;let l,h;s===c?l=0:t===s?l=(r-a)/o:r===s?l=2+(a-t)/o:a===s&&(l=4+(t-r)/o),l=Math.min(60*l,360),l<0&&(l+=360);const u=(c+s)/2;return h=s===c?0:u<=.5?o/(s+c):o/(2-s-c),[l,100*h,100*u]},r.rgb.hsv=function(n){let t,r,a,c,s;const o=n[0]/255,l=n[1]/255,h=n[2]/255,u=Math.max(o,l,h),i=u-Math.min(o,l,h),b=function(n){return(u-n)/6/i+.5};return 0===i?(c=0,s=0):(s=i/u,t=b(o),r=b(l),a=b(h),o===u?c=a-r:l===u?c=.3333333333333333+t-a:h===u&&(c=.6666666666666666+r-t),c<0?c+=1:c>1&&(c-=1)),[360*c,100*s,100*u]},r.rgb.hwb=function(n){const t=n[0],a=n[1];let c=n[2];const s=r.rgb.hsl(n)[0],o=.00392156862745098*Math.min(t,Math.min(a,c
vendor: 7,011 bytes, lines 691-692
691));return c=1-.00392156862745098*Math.max(t,Math.max(a,c)),[s,100*o,100*c]},r.rgb.cmyk=function(n){const t=n[0]/255,r=n[1]/255,a=n[2]/255,c=Math.min(1-t,1-r,1-a);return[100*((1-t-c)/(1-c)||0),100*((1-r-c)/(1-c)||0),100*((1-a-c)/(1-c)||0),100*c]},r.rgb.keyword=function(r){const c=t[r];if(c)return c;let s,o=1/0;for(const t of Object.keys(n)){const c=a(r,n[t]);c<o&&(o=c,s=t)}return s},r.keyword.rgb=function(t){return n[t]},r.rgb.xyz=function(n){let t=n[0]/255,r=n[1]/255,a=n[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;return[100*(.4124*t+.3576*r+.1805*a),100*(.2126*t+.7152*r+.0722*a),100*(.0193*t+.1192*r+.9505*a)]},r.rgb.lab=function(n){const t=r.rgb.xyz(n);let a=t[0],c=t[1],s=t[2];a/=95.047,c/=100,s/=108.883,a=a>.008856?a**.3333333333333333:7.787*a+.13793103448275862,c=c>.008856?c**.3333333333333333:7.787*c+.13793103448275862,s=s>.008856?s**.3333333333333333:7.787*s+.13793103448275862;return[116*c-16,500*(a-c),200*(c-s)]},r.hsl.rgb=function(n){const t=n[0]/360,r=n[1]/100,a=n[2]/100;let c,s,o;if(0===r)return o=255*a,[o,o,o];c=a<.5?a*(1+r):a+r-a*r;const l=2*a-c,h=[0,0,0];for(let n=0;n<3;n++)s=t+.3333333333333333*-(n-1),s<0&&s++,s>1&&s--,o=6*s<1?l+6*(c-l)*s:2*s<1?c:3*s<2?l+(c-l)*(.6666666666666666-s)*6:l,h[n]=255*o;return h},r.hsl.hsv=function(n){const t=n[0];let r=n[1]/100,a=n[2]/100,c=r;const s=Math.max(a,.01);a*=2,r*=a<=1?a:2-a,c*=s<=1?s:2-s;return[t,100*(0===a?2*c/(s+c):2*r/(a+r)),100*((a+r)/2)]},r.hsv.rgb=function(n){const t=n[0]/60,r=n[1]/100;let a=n[2]/100;const c=Math.floor(t)%6,s=t-Math.floor(t),o=255*a*(1-r),l=255*a*(1-r*s),h=255*a*(1-r*(1-s));switch(a*=255,c){case 0:return[a,h,o];case 1:return[l,a,o];case 2:return[o,a,h];case 3:return[o,l,a];case 4:return[h,o,a];case 5:return[a,o,l]}},r.hsv.hsl=function(n){const t=n[0],r=n[1]/100,a=n[2]/100,c=Math.max(a,.01);let s,o;o=(2-r)*a;const l=(2-r)*c;return s=r*c,s/=l<=1?l:2-l,s=s||0,o/=2,[t,100*s,100*o]},r.hwb.rgb=function(n){const t=n[0]/360;let r=n[1]/100,a=n[2]/100;const c=r+a;let s;c>1&&(r/=c,a/=c);const o=Math.floor(6*t),l=1-a;s=6*t-o,1&o&&(s=1-s);const h=r+s*(l-r);let u,i,b;switch(o){default:case 6:case 0:u=l,i=h,b=r;break;case 1:u=h,i=l,b=r;break;case 2:u=r,i=l,b=h;break;case 3:u=r,i=h,b=l;break;case 4:u=h,i=r,b=l;break;case 5:u=l,i=r,b=h}return[255*u,255*i,255*b]},r.cmyk.rgb=function(n){const t=n[0]/100,r=n[1]/100,a=n[2]/100,c=n[3]/100;return[255*(1-Math.min(1,t*(1-c)+c)),255*(1-Math.min(1,r*(1-c)+c)),255*(1-Math.min(1,a*(1-c)+c))]},r.xyz.rgb=function(n){const t=n[0]/100,r=n[1]/100,a=n[2]/100;let c,s,o;return c=3.2406*t+-1.5372*r+-.4986*a,s=-.9689*t+1.8758*r+.0415*a,o=.0557*t+-.204*r+1.057*a,c=c>.0031308?1.055*c**.4166666666666667-.055:12.92*c,s=s>.0031308?1.055*s**.4166666666666667-.055:12.92*s,o=o>.0031308?1.055*o**.4166666666666667-.055:12.92*o,c=Math.min(Math.max(0,c),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[255*c,255*s,255*o]},r.xyz.lab=function(n){let t=n[0],r=n[1],a=n[2];t/=95.047,r/=100,a/=108.883,t=t>.008856?t**.3333333333333333:7.787*t+.13793103448275862,r=r>.008856?r**.3333333333333333:7.787*r+.13793103448275862,a=a>.008856?a**.3333333333333333:7.787*a+.13793103448275862;return[116*r-16,500*(t-r),200*(r-a)]},r.lab.xyz=function(n){let t,r,a;r=(n[0]+16)/116,t=n[1]/500+r,a=r-n[2]/200;const c=r**3,s=t**3,o=a**3;return r=c>.008856?c:(r-.13793103448275862)/7.787,t=s>.008856?s:(t-.13793103448275862)/7.787,a=o>.008856?o:(a-.13793103448275862)/7.787,t*=95.047,r*=100,a*=108.883,[t,r,a]},r.lab.lch=function(n){const t=n[0],r=n[1],a=n[2];let c;c=360*Math.atan2(a,r)/2/Math.PI,c<0&&(c+=360);return[t,Math.sqrt(r*r+a*a),c]},r.lch.lab=function(n){const t=n[0],r=n[1],a=n[2]/360*2*Math.PI;return[t,r*Math.cos(a),r*Math.sin(a)]},r.rgb.ansi16=function(n,t=null){const[a,c,s]=n;let o=null===t?r.rgb.hsv(n)[2]:t;if(o=Math.round(o/50),0===o)return 30;let l=30+(Math.round(s/255)<<2|Math.round(c/255)<<1|Math.round(a/255));return 2===o&&(l+=60),l},r.hsv.ansi16=function(n){return r.rgb.ansi16(r.hsv.rgb(n),n[2])},r.rgb.ansi256=function(n){const t=n[0],r=n[1],a=n[2];if(t===r&&r===a)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(a/255*5)},r.ansi16.rgb=function(n){let t=n%10;if(0===t||7===t)return n>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const r=.5*(1+~~(n>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},r.ansi256.rgb=function(n){if(n>=232){const t=10*(n-232)+8;return[t,t,t]}let t;n-=16;return[Math.floor(n/36)/5*255,Math.floor((t=n%36)/6)/5*255,t%6/5*255]},r.rgb.hex=function(n){const t=(((255&Math.round(n[0]))<<16)+((255&Math.round(n[1]))<<8)+(255&Math.round(n[2]))).toString(16).toUpperCase();return'000000'.substring(t.length)+t},r.hex.rgb=function(n){const t=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=r.split('').map(n=>n+n).join(''));const a=parseInt(r,16);return[a>>16&255,a>>8&255,255&a]},r.rgb.hcg=function(n){const t=n[0]/255,r=n[1]/255,a=n[2]/255,c=Math.max(Math.max(t,r),a),s=Math.min(Math.min(t,r),a),o=c-s;let l,h;return l=o<1?s/(1-o):0,h=o<=0?0:c===t?(r-a)/o%6:c===r?2+(a-t)/o:4+(t-r)/o,h/=6,h%=1,[360*h,100*o,100*l]},r.hsl.hcg=function(n){const t=n[1]/100,r=n[2]/100,a=r<.5?2*t*r:2*t*(1-r);let c=0;return a<1&&(c=(r-.5*a)/(1-a)),[n[0],100*a,100*c]},r.hsv.hcg=function(n){const t=n[1]/100,r=n[2]/100,a=t*r;let c=0;return a<1&&(c=(r-a)/(1-a)),[n[0],100*a,100*c]},r.hcg.rgb=function(n){const t=n[0]/360,r=n[1]/100,a=n[2]/100;if(0===r)return[255*a,255*a,255*a];const c=[0,0,0],s=t%1*6,o=s%1,l=1-o;let h=0;switch(Math.floor(s)){case 0:c[0]=1,c[1]=o,c[2]=0;break;case 1:c[0]=l,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=o;break;case 3:c[0]=0,c[1]=l,c[2]=1;break;case 4:c[0]=o,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=l}return h=(1-r)*a,[255*(r*c[0]+h),255*(r*c[1]+h),255*(r*c[2]+h)]},r.hcg.hsv=function(n){const t=n[1]/100,r=t+n[2]/100*(1-t);let a=0;return r>0&&(a=t/r),[n[0],100*a,100*r]},r.hcg.hsl=function(n){const t=n[1]/100,r=n[2]/100*(1-t)+.5*t;let a=0;return r>0&&r<.5?a=t/(2*r):r>=.5&&r<1&&(a=t/(2*(1-r))),[n[0],100*a,100*r]},r.hcg.hwb=function(n){const t=n[1]/100,r=t+n[2]/100*(1-t);return[n[0],100*(r-t),100*(1-r)]},r.hwb.hcg=function(n){const t=n[1]/100,r=1-n[2]/100,a=r-t;let c=0;return a<1&&(c=(r-a)/(1-a)),[n[0],100*a,100*c]},r.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]},r.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]},r.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]},r.gray.hsl=function(n){return[0,0,n[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(n){return[0,100,n[0]]},r.gray.cmyk=function(n){return[0,0,0,n[0]]},r.gray.lab=function(n){return[n[0],0,0]},r.gray.hex=function(n){const t=255&Math.round(n[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return'000000'.substring(r.length)+r},r.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]}},619,[615]); 692__d(function(g,r,_i,a,m,e,d){const n=r(d[0]);function t(){const t={}
692,c=Object.keys(n);for(let n=c.length,o=0;o<n;o++)t[c[o]]={distance:-1,parent:null};return t}function c(c){const o=t(),s=[c];for(o[c].distance=0;s.length;){const t=s.pop(),c=Object.keys(n[t]);for(let n=c.length,u=0;u<n;u++){const n=c[u],i=o[n];-1===i.distance&&(i.distance=o[t].distance+1,i.parent=t,s.unshift(n))}}return o}function o(n,t){return function(c){return t(n(c))}}function s(t,c){const s=[c[t].parent,t];let u=n[c[t].parent][t],i=c[t].parent;for(;c[i].parent;)s.unshift(c[i].parent),u=o(n[c[i].parent][i],u),i=c[i].parent;return u.conversion=s,u}m.exports=function(n){const t=c(n),o={},u=Object.keys(t);for(let n=u.length,c=0;c<n;c++){const n=u[c];null!==t[n].parent&&(o[n]=s(n,t))}return o}},620,[619]); 693__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Button=function(t){return'screen'in t||'action'in t?(0,n.jsx)(p,{...t}):(0,n.jsx)(h,{...t})};const n=r(d[0]),o=t(r(d[1])),s=r(d[2]),c=r(d[3]),l=r(d[4]),u=r(d[5]),f=40;function p({screen:t,params:o,action:s,href:l,...u}){const f=(0,c.useLinkProps)({screen:t,params:o,action:s,href:l});return(0,n.jsx)(h,{...u,...f})}function h({variant:t="tinted",color:p,android_ripple:h,style:b,children:x,...y}){const{colors:j,fonts:k}=(0,c.useTheme)(),v=p??j.primary;let P,S;switch(t){case'plain':P='transparent',S=v;break;case'tinted':P=(0,o.default)(v).fade(.85).string(),S=v;break;case'filled':P=v,S=(0,o.default)(v).isDark()?'white':(0,o.default)(v).darken(.71).string()}return(0,n.jsx)(l.PlatformPressable,{...y,android_ripple:{radius:f,color:(0,o.default)(S).fade(.85).string(),...h},pressOpacity:'ios'===s.Platform.OS?void 0:1,hoverEffect:{color:S},style:[{backgroundColor:P},_.button,b],children:(0,n.jsx)(u.Text,{style:[{color:S},k.regular,_.text],children:x})})}const _=s.StyleSheet.create({button:{paddingHorizontal:24,paddingVertical:10,borderRadius:f,borderCurve:'continuous'},text:{fontSize:14,lineHeight:20,letterSpacing:.1,textAlign:'center'}})},621,[6,613,263,401,622,623]); 694__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var i=Object.getOwnPropertyDescriptor(t,o);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,i)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[t.length]=o);return t},e(t)},function(n){if(n&&n.__esModule)return n;var i={};if(null!=n)for(var l=e(n),s=0;s<l.length;s++)"default"!==l[s]&&t(i,n,l[s]);return o(i,n),i});
694Object.defineProperty(_e,"__esModule",{value:!0}),_e.PlatformPressable=void 0;const i=r(d[0]),l=n(r(d[1])),s=r(d[2]),c=r(d[3]),u=s.Animated.createAnimatedComponent(s.Pressable),f='android'===s.Platform.OS&&s.Platform.Version>=21,v='web'!==s.Platform.OS;_e.PlatformPressable=function({ref:e,disabled:t,onPress:o,onPressIn:n,onPressOut:y,android_ripple:b,pressColor:p,pressOpacity:m=.3,hoverEffect:P,style:O,children:_,...j}){const{dark:w}=(0,c.useTheme)(),[S]=l.useState(()=>new s.Animated.Value(1)),K=(e,t)=>{f||s.Animated.timing(S,{toValue:e,duration:t,easing:s.Easing.inOut(s.Easing.quad),useNativeDriver:v}).start()};return(0,i.jsxs)(u,{ref:e,accessible:!0,role:'web'===s.Platform.OS&&null!=j.href?'link':'button',onPress:t?void 0:e=>{if('web'===s.Platform.OS&&null!==j.href){const t='metaKey'in e&&e.metaKey||'altKey'in e&&e.altKey||'ctrlKey'in e&&e.ctrlKey||'shiftKey'in e&&e.shiftKey,n=!('button'in e)||(null==e.button||0===e.button),i=!e.currentTarget||!('target'in e.currentTarget)||[void 0,null,'','self'].includes(e.currentTarget.target);!t&&n&&i&&(e.preventDefault(),o?.(e))}else o?.(e)},onPressIn:t?void 0:e=>{K(m,0),n?.(e)},onPressOut:t?void 0:e=>{K(1,200),y?.(e)},android_ripple:f&&!t?{color:void 0!==p?p:w?'rgba(255, 255, 255, .32)':'rgba(0, 0, 0, .32)',...b}:void 0,style:[{cursor:'web'!==s.Platform.OS&&'ios'!==s.Platform.OS||t?'auto':'pointer',opacity:f||t?1:S},O],...j,children:[t?null:(0,i.jsx)(h,{...P}),_]})};const y=String.raw,b="__react-navigation_elements_Pressable_hover",p=y` 695 .${b} { 696 position: absolute; 697 top: 0; 698 left: 0; 699 right: 0; 700 bottom: 0; 701 border-radius: inherit; 702 background-color: var(--overlay-color); 703 opacity: 0; 704 transition: opacity 0.15s; 705 pointer-events: none; 706 } 707 708 a:hover > .${b}, button:hover > .${b} { 709 opacity: var(--overlay-hover-opacity); 710 } 711 712 a:active > .${b}, button:active > .${b} { 713 opacity: var(--overlay-active-opacity); 714 } 715`,h=({color:e,hoverOpacity:t=.08,activeOpacity:o=.16})=>'web'!==s.Platform.OS||null==e?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("style",{href:b,precedence:"elements",children:p}),(0,i.jsx)("div",{className:b,style:{'--overlay-color':e,'--overlay-hover-opacity':t,'--overlay-active-opacity':o}})]})},622,[6,11,263,401]); 716__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Text=function({style:n,...c}){const{colors:u,fonts:l}=(0,s.useTheme)();return(0,t.jsx)(o.Text,{...c,style:[{color:u.text},l.regular,n]})};const t=r(d[0]),o=r(d[1]),s=r(d[2])},623,[6,263,401]); 717__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getDefaultSidebarWidth=void 0;e.getDefaultSidebarWidth=({width:t})=>t-56<=360?t-56:360},624,[]); 718__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getDefaultHeaderHeight=function(o,l,s){let f;const n='ios'===t.Platform.OS&&s>50?s-(5+1/t.PixelRatio.get()):s,u=o.width>o.height;f='ios'===t.Platform.OS?t.Platform.isPad||t.Platform.isTV?l?56:50:u?32:l?56:44:64;return f+n};const t=r(d[0])},625,[263]); 719__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getHeaderTitle=function(t,l){return'string'==typeof t.headerTitle?t.headerTitle:void 0!==t.title?t.title:l}},626,[]); 720__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var i=Object.getOwnPropertyDescriptor(t,o);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,i)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[t.length]=o);return t},e(t)},function(n){if(n&&n.__esModule)return n;var i={};if(null!=n)for(var l=e(n),s=0;s<l.length;s++)"default"!==l[s]&&t(i,n,l[s]);return o(i,n),i}
720),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_e,"__esModule",{value:!0}),_e.Header=function(e){const t=(0,b.useSafeAreaInsets)(),o=(0,p.useFrameSize)(e=>e,!0),{colors:n}=(0,f.useTheme)(),i=(0,f.useNavigation)(),j=(0,h.use)(B.HeaderShownContext),[k,O]=s.useState(!1),[T,_]=s.useState(void 0),{layout:H=o,modal:W=!1,back:L,title:P,headerTitle:M,headerTitleAlign:V="left",headerLeft:A=(L?e=>(0,l.jsx)(m.HeaderBackButton,{...e}):void 0),headerSearchBarOptions:D,headerTransparent:N,headerTintColor:F,headerBackground:I,headerRight:z,headerTitleAllowFontScaling:G,headerTitleStyle:q,headerLeftContainerStyle:J,headerRightContainerStyle:K,headerTitleContainerStyle:Q,headerBackButtonDisplayMode:U="minimal",headerBackTitleStyle:X,headerBackgroundContainerStyle:Y,headerStyle:Z,headerShadowVisible:$,headerPressColor:ee,headerPressOpacity:te,headerStatusBarHeight:re=(j?0:t.top)}=e,oe=(0,w.getDefaultHeaderHeight)(H,W,re),{height:ne=oe,maxHeight:ie,minHeight:ae,backfaceVisibility:de,backgroundColor:le,borderBlockColor:se,borderBlockEndColor:he,borderBlockStartColor:ue,borderBottomColor:be,borderBottomEndRadius:ce,borderBottomLeftRadius:fe,borderBottomRightRadius:pe,borderBottomStartRadius:ge,borderBottomWidth:me,borderColor:ye,borderCurve:Ce,borderEndColor:Se,borderEndEndRadius:xe,borderEndStartRadius:Be,borderEndWidth:Re,borderLeftColor:we,borderLeftWidth:ve,borderRadius:Ee,borderRightColor:je,borderRightWidth:ke,borderStartColor:Oe,borderStartEndRadius:Te,borderStartStartRadius:He,borderStartWidth:We,borderStyle:Le,borderTopColor:Pe,borderTopEndRadius:Me,borderTopLeftRadius:Ve,borderTopRightRadius:Ae,borderTopStartRadius:De,borderTopWidth:Ne,borderWidth:Fe,boxShadow:Ie,elevation:ze,filter:Ge,mixBlendMode:qe,opacity:Je,shadowColor:Ke,shadowOffset:Qe,shadowOpacity:Ue,shadowRadius:Xe,transform:Ye,transformOrigin:Ze,...$e}=u.StyleSheet.flatten(Z||{}),et={backfaceVisibility:de,backgroundColor:le,borderBlockColor:se,borderBlockEndColor:he,borderBlockStartColor:ue,borderBottomColor:be,borderBottomEndRadius:ce,borderBottomLeftRadius:fe,borderBottomRightRadius:pe,borderBottomStartRadius:ge,borderBottomWidth:me,borderColor:ye,borderCurve:Ce,borderEndColor:Se,borderEndEndRadius:xe,borderEndStartRadius:Be,borderEndWidth:Re,borderLeftColor:we,borderLeftWidth:ve,borderRadius:Ee,borderRightColor:je,borderRightWidth:ke,borderStartColor:Oe,borderStartEndRadius:Te,borderStartStartRadius:He,borderStartWidth:We,borderStyle:Le,borderTopColor:Pe,borderTopEndRadius:Me,borderTopLeftRadius:Ve,borderTopRightRadius:Ae,borderTopStartRadius:De,borderTopWidth:Ne,borderWidth:Fe,boxShadow:Ie,elevation:ze,filter:Ge,mixBlendMode:qe,opacity:Je,shadowColor:Ke,shadowOffset:Qe,shadowOpacity:Ue,shadowRadius:Xe,transform:Ye,transformOrigin:Ze};for(const e in et)void 0===et[e]&&delete et[e];const tt={...N&&{backgroundColor:'transparent'},...(N||!1===$)&&{borderBottomWidth:0,...u.Platform.select({android:{elevation:0},web:{boxShadow:'none'},default:{shadowOpacity:0}})},...et},rt=F??u.Platform.select({ios:n.primary,default:n.text}),ot=A?A({tintColor:rt,pressColor:ee,pressOpacity:te,displayMode:U,titleLayout:T,screenLayout:H,canGoBack:Boolean(L),onPress:L?i.goBack:void 0,label:L?.title,labelStyle:X,href:L?.href}):null,nt=z?z({tintColor:rt,pressColor:ee,pressOpacity:te,canGoBack:Boolean(L)}):null,it='function'!=typeof M?e=>(0,l.jsx)(R.HeaderTitle,{...e}):M;return(0,l.jsxs)(u.Animated.View,{style:[E.boxNone,{height:ne,minHeight:ae,maxHeight:ie,opacity:Je,transform:Ye}],children:[(0,l.jsx)(u.Animated.View,{style:[u.StyleSheet.absoluteFill,E.boxNone,Y],children:I?I({style:tt}):(0,l.jsx)(y.HeaderBackground,{style:[{pointerEvents:N&&('transparent'===tt.backgroundColor||tt.backgroundColor&&0===(0,v.Color)(tt.backgroundColor)?.alpha())?'none':'auto'},tt]})}),(0,l.jsx)(u.View,{style:[E.pointerEventsNone,{height:re}]}),(0,l.jsxs)(u.View,{style:[E.content,null],children:[(0,l.jsx)(u.Animated.View,{style:[E.start,!k&&'center'===V&&E.expand,{marginStart:t.left},J],children:ot}),k?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Animated.View,{style:[E.title,{maxWidth:'center'===V?H.width-2*((ot?'minimal'!==U?80:32:16)+(nt||D?16:0)+Math.max(t.left,t.right)):H.width-((ot?52:16)+(nt||D?52:16)+t.left-t.right)},'left'===V&&ot?{marginStart:4}:{marginHorizontal:16},Q],children:it({children:P,allowFontScaling:G,tintColor:F,onLayout:e=>{const{height:t,width:o}=e.nativeEvent.layout;_(e=>e&&t===e.height&&o===e.width?e:{height:t,width:o})},style:q})}),(0,l.jsxs)(u.Animated.View,{style:[E.end,E.expand,{marginEnd:t.right},K],children:[nt,D?(0,l.jsx)(C.HeaderButton,{tintColor:rt,pressColor:ee,pressOpacity:te,onPress:()=>{O(!0),D?.onOpen?.()},children:(0,l.jsx)(S.HeaderIcon,{source:c.default,tintColor:rt})}):null]})]}),k?(0,l.jsx)(x.HeaderSearchBar,{...D,visible:k,onClose:()=>{O(!1),D?.onClose?.()},tintColor:F,style:[!ot&&{marginStart:8}]}):null]})]})};const l=r(d[0]),s=n(r(d[1])),h=r(d[1]),u=r(d[2]),b=r(d[3]),c=i(r(d[4])),f=r(d[5]),p=r(d[6]),m=r(d[7]),y=r(d[8]),C=r(d[9]),S=r(d[10]),x=r(d[11]),B=r(d[12]),R=r(d[13]),w=r(d[14]),v=r(d[15]);const E=u.StyleSheet.create({content:{flex:1,flexDirection:'row',alignItems:'stretch',pointerEvents:'box-none'},large:{marginHorizontal:5},title:{pointerEvents:'box-none',justifyContent:'center'},start:{pointerEvents:'box-none',flexDirection:'row',alignItems:'center',justifyContent:'flex-start'},end:{pointerEvents:'box-none',flexDirection:'row',alignItems:'center',justifyContent:'flex-end'},expand:{flexGrow:1,flexBasis:0},boxNone:{pointerEvents:'box-none'},pointerEventsNone:{pointerEvents:'none'}})},627,[6,11,263,105,609,401,628,629,633,630,631,634,635,637,625,612]); 721__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,u){void 0===u&&(u=i);var o=Object.getOwnPropertyDescriptor(n,i);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,u,o)}:function(t,n,i,u){void 0===u&&(u=i),t[u]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),u=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)}
721,function(u){if(u&&u.__esModule)return u;var o={};if(null!=u)for(var c=t(u),s=0;s<c.length;s++)"default"!==c[s]&&n(o,u,c[s]);return i(o,u),o}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.useFrameSize=function(t,n){const i=(0,h.use)(w);if(null==i)throw new Error('useFrameSize must be used within a FrameSizeProvider');return(0,b.useSyncExternalStoreWithSelector)(n?i.subscribeThrottled:i.subscribe,i.getCurrent,i.getCurrent,t)},e.FrameSizeProvider=function({initialFrame:t,render:n}){const i=s.useRef({width:t.width,height:t.height}),u=s.useRef(new Set),o=(0,f.default)(()=>i.current),h=(0,f.default)(t=>(u.current.add(t),()=>{u.current.delete(t)})),b=(0,f.default)(t=>{let n,i=!1,u=!1;const o=h(()=>{clearTimeout(n),i=!0,u?n=setTimeout(()=>{i&&(i=!1,t())},100):(u=!0,setTimeout(function(){u=!1},100),i=!1,t())});return()=>{o(),clearTimeout(n)}}),m=s.useMemo(()=>({getCurrent:o,subscribe:h,subscribeThrottled:b}),[h,b,o]),_=(0,f.default)(t=>{i.current.height===t.height&&i.current.width===t.width||(i.current={width:t.width,height:t.height},u.current.forEach(t=>t()))}),p=s.useRef(null);s.useEffect(()=>{'web'!==l.Platform.OS&&p.current?.measure((t,n,i,u)=>{_({width:i,height:u})})},[_]);return(0,c.jsxs)(w.Provider,{value:m,children:['web'===l.Platform.OS?(0,c.jsx)(v,{onChange:_}):null,n({ref:p,onLayout:t=>{const{width:n,height:i}=t.nativeEvent.layout;_({width:n,height:i})}})]})};const c=r(d[0]),s=u(r(d[1])),h=r(d[1]),l=r(d[2]),f=o(r(d[3])),b=r(d[4]),w=s.createContext(void 0);function v({onChange:t}){const n=s.useRef(null);return s.useEffect(()=>{if(null==n.current)return;const i=n.current.getBoundingClientRect();t({width:i.width,height:i.height});const u=new ResizeObserver(n=>{const i=n[0];if(i){const{width:n,height:u}=i.contentRect;t({width:n,height:u})}});return u.observe(n.current),()=>{u.disconnect()}},[t]),(0,c.jsx)("div",{ref:n,style:{position:'absolute',left:0,right:0,top:0,bottom:0,pointerEvents:'none',visibility:'hidden'}})}},628,[6,11,263,405,486]); 722__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var l=Object.getOwnPropertyDescriptor(t,n);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,l)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(i){if(i&&i.__esModule)return i;var l={};if(null!=i)for(var o=e(i),s=0;s<o.length;s++)"default"!==o[s]&&t(l,i,o[s]);return n(l,i),l}),l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};
722Object.defineProperty(_e,"__esModule",{value:!0}),_e.HeaderBackButton=function({disabled:e,allowFontScaling:t,backImage:n,label:i,labelStyle:l,displayMode:O=('ios'===c.Platform.OS?'default':'minimal'),onLabelLayout:x,onPress:_,pressColor:w,pressOpacity:S,screenLayout:L,tintColor:M,titleLayout:k,truncatedLabel:v="Back",accessibilityLabel:P=(i&&'Back'!==i?`${i}, back`:'Go back'),testID:C,style:I,href:D}){const{colors:W,fonts:A}=(0,b.useTheme)(),{direction:B}=(0,b.useLocale)(),[E,F]=s.useState(null),[V,H]=s.useState(null);return(0,o.jsx)(u.HeaderButton,{disabled:e,href:D,accessibilityLabel:P,testID:C,onPress:()=>{_&&requestAnimationFrame(()=>_())},pressColor:w,pressOpacity:S,style:[j.container,I],children:(0,o.jsxs)(o.Fragment,{children:[n?n({tintColor:M??W.text}):(0,o.jsx)(f.HeaderIcon,{source:h.default,tintColor:M,style:[j.icon,'minimal'!==O&&j.iconWithLabel]}),(()=>{if('minimal'===O)return null;const e=k&&L?(L.width-k.width)/2-(p+f.ICON_MARGIN):null,s='default'===O?i:v,u=e&&E&&V?e>E?s:e>V?v:null:s,h=[A.regular,j.label,l],b=[h,{position:'absolute',top:0,left:0,opacity:0}],_=(0,o.jsxs)(c.View,{style:j.labelWrapper,children:[i&&'default'===O?(0,o.jsx)(c.Animated.Text,{style:b,numberOfLines:1,onLayout:e=>F(e.nativeEvent.layout.width),children:i}):null,v?(0,o.jsx)(c.Animated.Text,{style:b,numberOfLines:1,onLayout:e=>H(e.nativeEvent.layout.width),children:v}):null,u?(0,o.jsx)(c.Animated.Text,{accessible:!1,onLayout:x,style:[M?{color:M}:null,h],numberOfLines:1,allowFontScaling:!!t,children:u}):null]});return n||'ios'!==c.Platform.OS?_:(0,o.jsx)(y.MaskedView,{maskElement:(0,o.jsxs)(c.View,{style:[j.iconMaskContainer,L?{minWidth:L.width/2-27}:null],children:[(0,o.jsx)(c.Image,{source:m.default,resizeMode:"contain",style:[j.iconMask,'rtl'===B&&j.flip]}),(0,o.jsx)(c.View,{style:j.iconMaskFillerRect})]}),children:_})})()]})})};const o=r(d[0]),s=i(r(d[1])),c=r(d[2]),u=r(d[3]),f=r(d[4]),m=l(r(d[5])),h=l(r(d[6])),b=r(d[7]),y=r(d[8]);const p='ios'===c.Platform.OS?13:24,O='ios'===c.Platform.OS?22:3,j=c.StyleSheet.create({container:{paddingHorizontal:0,minWidth:c.StyleSheet.hairlineWidth,...c.Platform.select({ios:null,default:{marginVertical:3,marginHorizontal:11}})},label:{fontSize:17,letterSpacing:.35},labelWrapper:{flexDirection:'row',alignItems:'flex-start',marginEnd:f.ICON_MARGIN},icon:{width:p,marginEnd:O},iconWithLabel:'ios'===c.Platform.OS?{marginEnd:6}:{},iconMaskContainer:{flex:1,flexDirection:'row',justifyContent:'center'},iconMaskFillerRect:{flex:1,backgroundColor:'#000'},iconMask:{height:21,width:13,marginStart:-14.5,marginVertical:12,alignSelf:'center'},flip:{transform:'scaleX(-1)'}})},629,[6,11,263,630,631,605,606,401,632]); 723__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HeaderButton=void 0;const t=r(d[0]),o=r(d[1]),s=r(d[2]);e.HeaderButton=function({ref:c,disabled:f,onPress:u,pressColor:b,pressOpacity:p,accessibilityLabel:y,testID:P,style:h,href:_,children:v}){return(0,t.jsx)(s.PlatformPressable,{ref:c,disabled:f,href:_,"aria-label":y,testID:P,onPress:u,pressColor:b,pressOpacity:p,android_ripple:l,style:[n.container,f&&n.disabled,h],hitSlop:o.Platform.select({ios:void 0,default:{top:16,right:16,bottom:16,left:16}}),children:v})};const l={borderless:!0,foreground:'android'===o.Platform.OS&&o.Platform.Version>=23,radius:20},n=o.StyleSheet.create({container:{flexDirection:'row',alignItems:'center',paddingHorizontal:8,borderRadius:10,borderCurve:'continuous'},disabled:{opacity:.5}})},630,[6,263,622]); 724__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ICON_MARGIN=e.ICON_SIZE=void 0,e.HeaderIcon=function({source:c,style:I,...l}){const{colors:u}=(0,n.useTheme)(),{direction:_}=(0,n.useLocale)();return(0,t.jsx)(o.Image,{source:c,resizeMode:"contain",fadeDuration:0,tintColor:u.text,style:[s.icon,'rtl'===_&&s.flip,I],...l})};const t=r(d[0]),o=r(d[1]),n=r(d[2]);e.ICON_SIZE='ios'===o.Platform.OS?21:24,e.ICON_MARGIN='ios'===o.Platform.OS?8:3;const s=o.StyleSheet.create({icon:{width:e.ICON_SIZE,height:e.ICON_SIZE,margin:e.ICON_MARGIN},flip:{transform:'scaleX(-1)'}})},631,[6,263,401]); 725__d(function(g,r,i,a,m,e,d){"use strict";
725Object.defineProperty(e,"__esModule",{value:!0}),e.MaskedView=function({children:n}){return n}},632,[]); 726__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HeaderBackground=function({style:l,...c}){const{colors:h,dark:u}=(0,n.useTheme)();return(0,t.jsx)(o.Animated.View,{style:[s.container,{backgroundColor:h.card,borderBottomColor:h.border,...'ios'===o.Platform.OS&&{shadowColor:u?'rgba(255, 255, 255, 0.45)':'rgba(0, 0, 0, 1)'}},l],...c})};const t=r(d[0]),o=r(d[1]),n=r(d[2]);const s=o.StyleSheet.create({container:{flex:1,...o.Platform.select({android:{elevation:4},ios:{shadowOpacity:.3,shadowRadius:0,shadowOffset:{width:0,height:o.StyleSheet.hairlineWidth}},default:{borderBottomWidth:o.StyleSheet.hairlineWidth}})}})},633,[6,263,401]); 727__d(function(g,r,_i,a,_m,e,d){"use strict";var t,o=this&&this.__createBinding||(Object.create?function(t,o,n,i){void 0===i&&(i=n);var l=Object.getOwnPropertyDescriptor(o,n);l&&!("get"in l?!o.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return o[n]}}),Object.defineProperty(t,i,l)}:function(t,o,n,i){void 0===i&&(i=n),t[i]=o[n]}),n=this&&this.__setModuleDefault||(Object.create?function(t,o){Object.defineProperty(t,"default",{enumerable:!0,value:o})}:function(t,o){t.default=o}),i=this&&this.__importStar||(t=function(o){return t=Object.getOwnPropertyNames||function(t){var o=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(o[o.length]=n);return o},t(o)},function(i){if(i&&i.__esModule)return i;var l={};if(null!=i)for(var s=t(i),c=0;c<s.length;c++)"default"!==s[c]&&o(l,i,s[c]);return n(l,i),l}),l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.HeaderSearchBar=void 0;const s=r(d[0]),c=i(r(d[1])),u=r(d[2]),f=l(r(d[3])),h=l(r(d[4])),p=l(r(d[5])),m=r(d[6]),b=r(d[7]),y=r(d[8]),x=r(d[9]),C=r(d[10]),v=r(d[11]),P={text:'text',number:'numeric',phone:'tel',email:'email'},S='web'!==u.Platform.OS;const j=u.StyleSheet.create({container:{flex:1,flexDirection:'row',alignItems:'stretch'},inputSearchIcon:{position:'absolute',opacity:.5,left:u.Platform.select({ios:16,default:4}),top:u.Platform.select({ios:-1,default:17}),...u.Platform.select({ios:{height:18,width:18},default:{}})},closeButton:{position:'absolute',opacity:.5,right:u.Platform.select({ios:0,default:8}),top:u.Platform.select({ios:-2,default:17})},clearButton:{position:'absolute',right:0,top:-7,bottom:0,justifyContent:'center',padding:8},clearIcon:{height:16,width:16,opacity:.5},cancelButton:{alignSelf:'center',top:-4},cancelText:{fontSize:17,marginHorizontal:12},searchbarContainer:{flex:1},searchbar:u.Platform.select({ios:{flex:1,fontSize:17,paddingHorizontal:32,marginLeft:16,marginTop:-1,marginBottom:4,borderRadius:8,borderCurve:'continuous'},default:{flex:1,fontSize:18,paddingHorizontal:36,marginRight:8,marginTop:8,marginBottom:8,borderBottomWidth:1}})});e.HeaderSearchBar=function({ref:t,visible:o,inputType:n,autoFocus:i=!0,autoCapitalize:l,placeholder:_="Search",cancelButtonText:B="Cancel",enterKeyHint:O="search",onChangeText:T,onClose:w,tintColor:H,style:I,...z}){const D=(0,v.useNavigation)(),{dark:M,colors:A,fonts:V}=(0,v.useTheme)(),[k,E]=c.useState(''),[N,R]=c.useState(o),[F]=c.useState(()=>new u.Animated.Value(o?1:0)),[K]=c.useState(()=>new u.Animated.Value(0)),L=c.useRef(o),W=c.useRef(!1),q=c.useRef(null);c.useEffect(()=>{if(o!==L.current)return u.Animated.timing(F,{toValue:o?1:0,duration:100,useNativeDriver:S}).start(({finished:t})=>{t&&(R(o),L.current=o)}),()=>{F.stopAnimation()}},[o,F]);const G=''!==k;c.useEffect(()=>{W.current!==G&&u.Animated.timing(K,{toValue:G?1:0,duration:100,useNativeDriver:S}).start(({finished:t})=>{t&&(W.current=G)})},[K,G]);const J=c.useCallback(()=>{q.current?.clear(),q.current?.focus(),E('')},[]),Q=c.useCallback(()=>{J(),T?.({nativeEvent:{text:''}})},[J,T]),U=c.useCallback(()=>{Q(),w()},[Q,w]);if(c.useEffect(()=>D?.addListener('blur',U),[U,D]),c.useImperativeHandle(t,()=>({focus:()=>{q.current?.focus()},blur:()=>{q.current?.blur()},setText:t=>{q.current?.setNativeProps({text:t}),E(t)},clearText:J,cancelSearch:U}),[U,J]),!o&&!N)return null;const X=H??A.text;return(0,s.jsxs)(u.Animated.View,{"aria-live":"polite","aria-hidden":!o,style:[j.container,{pointerEvents:o?'auto':'none',opacity:F},I],children:[(0,s.jsxs)(u.View,{style:j.searchbarContainer,children:[(0,s.jsx)(C.HeaderIcon,{source:p.default,tintColor:X,style:j.inputSearchIcon}),(0,s.jsx)(u.TextInput,{...z,ref:q,onChange:T,onChangeText:E,autoFocus:i,autoCapitalize:'systemDefault'===l?void 0:l,inputMode:P[n??'text'],enterKeyHint:O,placeholder:_,placeholderTextColor:(0,m.Color)(X)?.alpha(.5).string(),cursorColor:A.primary,selectionHandleColor:A.primary,selectionColor:(0,m.Color)(A.primary)?.alpha(.3).string(),style:[
727V.regular,j.searchbar,{backgroundColor:u.Platform.select({ios:M?'rgba(255, 255, 255, 0.1)':'rgba(0, 0, 0, 0.1)',default:'transparent'}),color:X,borderBottomColor:(0,m.Color)(X)?.alpha(.2).string()??(M?'rgba(255, 255, 255, 0.2)':'rgba(0, 0, 0, 0.2)')}]}),'ios'===u.Platform.OS?(0,s.jsx)(b.PlatformPressable,{onPress:Q,style:[{opacity:K,transform:[{scale:K}]},j.clearButton],children:(0,s.jsx)(u.Image,{source:f.default,resizeMode:"contain",tintColor:X,style:j.clearIcon})}):null]}),'ios'!==u.Platform.OS?(0,s.jsx)(x.HeaderButton,{onPress:()=>{k?Q():w()},style:j.closeButton,children:(0,s.jsx)(C.HeaderIcon,{source:h.default,tintColor:X})}):null,'ios'===u.Platform.OS?(0,s.jsx)(b.PlatformPressable,{onPress:U,style:j.cancelButton,children:(0,s.jsx)(y.Text,{style:[V.regular,{color:H??A.primary},j.cancelText],children:B})}):null]})}},634,[6,11,263,607,608,609,612,622,623,630,631,401]); 728__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HeaderShownContext=void 0;const t=r(d[0]);e.HeaderShownContext=(0,t.getNamedContext)('HeaderShownContext',!1)},635,[636]); 729__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var l=t(o),c=0;c<l.length;c++)"default"!==l[c]&&n(u,o,l[c]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.getNamedContext=function(t,n){let i=globalThis[l].get(t);if(i)return i;return i=u.createContext(n),i.displayName=t,globalThis[l].set(t,i),i};const u=o(r(d[0])),l='__react_navigation__elements_contexts';globalThis[l]=globalThis[l]??new Map},636,[11]); 730__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HeaderTitle=function({tintColor:s,style:c,...f}){const{colors:u,fonts:S}=(0,l.useTheme)();return(0,t.jsx)(o.Animated.Text,{role:"heading","aria-level":"1",numberOfLines:1,...f,style:[{color:void 0===s?u.text:s},o.Platform.select({ios:S.bold,default:S.medium}),n.title,c]})};const t=r(d[0]),o=r(d[1]),l=r(d[2]);const n=o.StyleSheet.create({title:o.Platform.select({ios:{fontSize:17},android:{fontSize:20},default:{fontSize:18}})})},637,[6,263,401]); 731__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HeaderBackContext=void 0;const t=r(d[0]);e.HeaderBackContext=(0,t.getNamedContext)('HeaderBackContext',void 0)},638,[636]); 732__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HeaderHeightContext=void 0;const t=r(d[0]);e.HeaderHeightContext=(0,t.getNamedContext)('HeaderHeightContext',void 0)},639,[636]); 733__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useHeaderHeight=function(){const o=(0,t.use)(n.HeaderHeightContext);if(void 0===o)throw new Error("Couldn't find the header height. Are you inside a screen in a navigator with a header?");return o};const t=r(d[0]),n=r(d[1])},640,[11,639]); 734__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLabel=function(t,l){return void 0!==t.label?t.label:void 0!==t.title?t.title:l}},641,[]); 735__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Label=function({tintColor:n,style:c,...s}){return(0,t.jsx)(l.Text,{numberOfLines:1,...s,style:[o.label,null!=n&&{color:n},c]})};const t=r(d[0]),n=r(d[1]),l=r(d[2]);const o=n.StyleSheet.create({label:{textAlign:'center',backgroundColor:'transparent'}})},642,[6,263,623]); 736__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,i){void 0===i&&(i=u);var c=Object.getOwnPropertyDescriptor(n,u);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,i,c)}:function(t,n,u,i){void 0===i&&(i=u),t[i]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(i){if(i&&i.__esModule)return i;var c={};if(null!=i)for(var l=t(i),o=0;o<l.length;o++)"default"!==l[o]&&n(c,i,l[o]);return u(c,i),c});
736Object.defineProperty(e,"__esModule",{value:!0}),e.Lazy=function({enabled:t,visible:n,children:u}){const[i,l]=c.useState(!!t&&n),o=!(t||n||i);if(c.useEffect(()=>{if(!1===o)return;const t=requestIdleCallback(()=>{l(!0)});return()=>cancelIdleCallback(t)},[o]),n&&!1===i)return l(!0),u;if(i)return u;return null};const c=i(r(d[0]))},643,[11]); 737__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MissingIcon=function({color:n,size:s,style:l}){return(0,t.jsx)(o.Text,{style:[c.icon,{color:n,fontSize:s},l],children:"\u23f7"})};const t=r(d[0]),n=r(d[1]),o=r(d[2]);const c=n.StyleSheet.create({icon:{backgroundColor:'transparent'}})},644,[6,263,623]); 738__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ResourceSavingView=function({visible:l,children:s,style:c,...f}){if('web'===n.Platform.OS)return(0,t.jsx)(n.View,{hidden:!l,style:[{pointerEvents:l?'auto':'none',display:l?'flex':'none'},o.container,c],...f,children:s});return(0,t.jsx)(n.View,{style:[{pointerEvents:l?'auto':'none'},o.container,c],children:(0,t.jsx)(n.View,{collapsable:!1,removeClippedSubviews:'ios'!==n.Platform.OS&&'macos'!==n.Platform.OS||!l,style:[{pointerEvents:l?'auto':'none'},l?o.attached:o.detached],children:s})})};const t=r(d[0]),n=r(d[1]);const o=n.StyleSheet.create({container:{flex:1,overflow:'hidden'},attached:{flex:1},detached:{flex:1,top:3e4}})},645,[6,263]); 739__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SafeAreaProviderCompat=u;const t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]);const{width:h,height:l}=(function(){if('web'===o.Platform.OS)return{width:0,height:0};const{width:t=0,height:n=0}=o.Dimensions.get('window');return{width:t,height:n}})(),f='web'===o.Platform.OS||null==s.initialWindowMetrics?{frame:{x:0,y:0,width:h,height:l},insets:{top:0,left:0,right:0,bottom:0}}:s.initialWindowMetrics;function u({children:h,style:l}){const u=(0,n.use)(s.SafeAreaInsetsContext);return(0,t.jsx)(c.FrameSizeProvider,{initialFrame:f.frame,render:({ref:n,onLayout:c})=>u?(0,t.jsx)(o.View,{ref:n,onLayout:c,style:[w.container,l],children:h}):(0,t.jsx)(s.SafeAreaProvider,{initialMetrics:f,style:l,onLayout:c,children:h})})}u.initialMetrics=f;const w=o.StyleSheet.create({container:{flex:1}})},646,[6,11,263,105,628]); 740__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(o){if(o&&o.__esModule)return o;var i={};if(null!=o)for(var u=e(o),l=0;l<u.length;l++)"default"!==u[l]&&t(i,o,u[l]);return n(i,o),i});
740Object.defineProperty(_e,"__esModule",{value:!0}),_e.Screen=function(e){const t=(0,c.useSafeAreaInsets)(),n=(0,l.use)(b.HeaderShownContext),o=(0,l.use)(v.HeaderHeightContext),{focused:x,modal:_=!1,header:O,headerShown:S=!0,headerTransparent:w,headerStatusBarHeight:H=(n?0:t.top),navigation:P,route:m,children:C,style:M}=e,B=(0,y.useFrameSize)(e=>(0,p.getDefaultHeaderHeight)(e,_,H)),D=u.useRef(null),[E,z]=u.useState(B);return u.useLayoutEffect(()=>{D.current?.measure((e,t,n,o)=>{z(o)})},[m.name]),(0,i.jsxs)(f.Background,{"aria-hidden":!x,style:[j.container,M],collapsable:!1,children:[S?(0,i.jsx)(h.NavigationProvider,{route:m,navigation:P,children:(0,i.jsx)(s.View,{ref:D,onLayout:e=>{const{height:t}=e.nativeEvent.layout;z(t)},style:[j.header,w?j.absolute:null],children:O})}):null,(0,i.jsx)(s.View,{style:j.content,children:(0,i.jsx)(b.HeaderShownContext.Provider,{value:n||!1!==S,children:(0,i.jsx)(v.HeaderHeightContext.Provider,{value:S?E:o??0,children:C})})})]})};const i=r(d[0]),u=o(r(d[1])),l=r(d[1]),s=r(d[2]),c=r(d[3]),h=r(d[4]),f=r(d[5]),v=r(d[6]),b=r(d[7]),p=r(d[8]),y=r(d[9]);const j=s.StyleSheet.create({container:{flex:1},content:{flex:1},header:{zIndex:1,pointerEvents:'box-none'},absolute:{position:'absolute',top:0,start:0,end:0}})},647,[6,11,263,105,401,610,639,635,625,628]); 741__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},648,[]); 742__d(function(g,r,_i,a,_m,_e,d){"use strict";var t,e=this&&this.__createBinding||(Object.create?function(t,e,i,o){void 0===o&&(o=i);var n=Object.getOwnPropertyDescriptor(e,i);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,o,n)}:function(t,e,i,o){void 0===o&&(o=i),t[o]=e[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||(t=function(e){return t=Object.getOwnPropertyNames||function(t){var e=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[e.length]=i);return e},t(e)},function(o){if(o&&o.__esModule)return o;var n={};if(null!=o)for(var s=t(o),l=0;l<s.length;l++)"default"!==s[l]&&e(n,o,s[l]);return i(n,o),n});
742Object.defineProperty(_e,"__esModule",{value:!0}),_e.getTabBarHeight=void 0,_e.BottomTabBar=function({state:t,navigation:e,descriptors:i,insets:o,style:w}){const{colors:k}=(0,c.useTheme)(),{direction:P}=(0,c.useLocale)(),{buildHref:x}=(0,c.useLinkBuilder)(),C=t.routes[t.index],L=i[C.key].options,{tabBarPosition:T="bottom",tabBarShowLabel:j,tabBarLabelPosition:A,tabBarHideOnKeyboard:_=!1,tabBarVisibilityAnimationConfig:I,tabBarVariant:O="uikit",tabBarStyle:W,tabBarBackground:D,tabBarActiveTintColor:E,tabBarInactiveTintColor:V,tabBarActiveBackgroundColor:z,tabBarInactiveBackgroundColor:F}=L;if('material'===O&&'left'!==T&&'right'!==T)throw new Error("The 'material' variant for tab bar is only supported when 'tabBarPosition' is set to 'left' or 'right'.");if('below-icon'===A&&'uikit'===O&&('left'===T||'right'===T))throw new Error("The 'below-icon' label position for tab bar is only supported when 'tabBarPosition' is set to 'top' or 'bottom' when using the 'uikit' variant.");const H=(0,m.useIsKeyboardShown)(),M=(0,s.use)(h.BottomTabBarHeightCallbackContext),N=!(_&&H),R=s.default.useRef(I);s.default.useEffect(()=>{R.current=I});const[K,Y]=s.default.useState(!N),[q]=s.default.useState(()=>new l.Animated.Value(N?1:0));s.default.useEffect(()=>{const t=R.current;if(N){('spring'===t?.show?.animation?l.Animated.spring:l.Animated.timing)(q,{toValue:1,useNativeDriver:y,duration:250,...t?.show?.config}).start(({finished:t})=>{t&&Y(!1)})}else{Y(!0);('spring'===t?.hide?.animation?l.Animated.spring:l.Animated.timing)(q,{toValue:0,useNativeDriver:y,duration:200,...t?.hide?.config}).start()}return()=>q.stopAnimation()},[q,N]);const[G,J]=s.default.useState({height:0}),{routes:Q}=t,U=(0,u.useFrameSize)(e=>(0,_e.getTabBarHeight)({state:t,descriptors:i,insets:o,dimensions:e,style:[W,w]})),X=(0,u.useFrameSize)(e=>B({state:t,descriptors:i,dimensions:e})),Z=(0,u.useFrameSize)(e=>v({state:t,descriptors:i,dimensions:e})),$='left'===T||'right'===T,tt='material'===O?p:f,et=(0,u.useFrameSize)(t=>$&&X?(0,u.getDefaultSidebarWidth)(t):0),it=D?.();return(0,n.jsxs)(l.Animated.View,{style:[{pointerEvents:K?'none':'auto'},'left'===T?S.start:'right'===T?S.end:S.bottom,'right'===T?{borderLeftWidth:l.StyleSheet.hairlineWidth}:'left'===T?{borderRightWidth:l.StyleSheet.hairlineWidth}:'top'===T?{borderBottomWidth:l.StyleSheet.hairlineWidth}:{borderTopWidth:l.StyleSheet.hairlineWidth},{backgroundColor:null!=it?'transparent':k.card,borderColor:k.border},$?{paddingTop:(X?tt:tt/2)+o.top,paddingBottom:(X?tt:tt/2)+o.bottom,paddingStart:tt+('left'===T?o.left:0),paddingEnd:tt+('right'===T?o.right:0),minWidth:et}:[{transform:[{translateY:q.interpolate({inputRange:[0,1],outputRange:[G.height+o['top'===T?'top':'bottom']+l.StyleSheet.hairlineWidth,0]})}],position:K?'absolute':void 0},{height:U,paddingBottom:'bottom'===T?o.bottom:0,paddingTop:'top'===T?o.top:0,paddingHorizontal:Math.max(o.left,o.right)}],W],onLayout:$?void 0:t=>{const{height:e}=t.nativeEvent.layout;M?.(e),J(t=>e===t.height?t:{height:e})},children:[(0,n.jsx)(l.View,{style:[l.StyleSheet.absoluteFill,S.pointerEventsNone],children:it}),(0,n.jsx)(l.View,{role:"tablist",style:$?S.sideContent:S.bottomContent,children:Q.map((o,s)=>{const l=s===t.index,{options:h}=i[o.key],m='function'==typeof h.tabBarLabel?h.tabBarLabel:(0,u.getLabel)({label:h.tabBarLabel,title:h.title},o.name),f=void 0!==h.tabBarAccessibilityLabel?h.tabBarAccessibilityLabel:void 0;return(0,n.jsx)(c.NavigationProvider,{route:o,navigation:i[o.key].navigation,children:(0,n.jsx)(b.BottomTabItem,{href:x(o.name,o.params),route:o,descriptor:i[o.key],focused:l,horizontal:X,compact:Z,sidebar:$,variant:O,onPress:()=>{const i=e.emit({type:'tabPress',target:o.key,canPreventDefault:!0});l||i.defaultPrevented||e.dispatch({...c.CommonActions.navigate(o),target:t.key})},onLongPress:()=>{e.emit({type:'tabLongPress',target:o.key})},accessibilityLabel:f,testID:h.tabBarButtonTestID,allowFontScaling:h.tabBarAllowFontScaling,activeTintColor:E,inactiveTintColor:V,activeBackgroundColor:z,inactiveBackgroundColor:F,button:h.tabBarButton,icon:h.tabBarIcon??(({color:t,size:e})=>(0,n.jsx)(u.MissingIcon,{color:t,size:e})),badge:h.tabBarBadge,badgeStyle:h.tabBarBadgeStyle,label:m,showLabel:j,labelStyle:h.tabBarLabelStyle,iconStyle:h.tabBarIconStyle,style:[$?{marginVertical:X?'material'===O?0:1:tt/2}:S.bottomItem,h.tabBarItemStyle]})},o.key)})})]})};const n=r(d[0]),s=o(r(d[1])),l=r(d[2]),b=r(d[3]),u=r(d[4]),c=r(d[5]),h=r(d[6]),m=r(d[7]),f=15,p=12,y=!1,B=({state:t,descriptors:e,dimensions:i})=>{const{tabBarLabelPosition:o}=e[t.routes[t.index].key].options;if(o)switch(o){case'beside-icon':return!0;case'below-icon':return!1}if(i.width>=768){return t.routes.reduce((t,i)=>{const{tabBarItemStyle:o}=e[i.key].options,n=l.StyleSheet.flatten(o);if(n){if('number'==typeof n.width)return t+n.width;if('number'==typeof n.maxWidth)return t+n.maxWidth}return t+125},0)<=i.width}return i.width>i.height},v=({state:t,descriptors:e,dimensions:i})=>{const{tabBarPosition:o,tabBarVariant:n}=e[t.routes[t.index].key].options;if('left'===o||'right'===o||'material'===n)return!1;const s=i.width>i.height,b=B({state:t,descriptors:e,dimensions:i});return!('ios'!==l.Platform.OS||l.Platform.isPad||!s||!b)};_e.getTabBarHeight=({state:t,descriptors:e,dimensions:i,insets:o,style:n})=>{const{tabBarPosition:s}=e[t.routes[t.index].key].options,b=l.StyleSheet.flatten(n),u=b&&'height'in b?b.height:void 0;if('number'==typeof u)return u;const c=o['top'===s?'top':'bottom'];return v({state:t,descriptors:e,dimensions:i})?32+c:49+c};const S=l.StyleSheet.create({start:{top:0,bottom:0,start:0},end:{top:0,bottom:0,end:0},bottom:{start:0,end:0,bottom:0,elevation:8},bottomContent:{flex:1,flexDirection:'row'},sideContent:{flex:1,flexDirection:'column'},bottomItem:{flex:1},pointerEventsNone:{pointerEvents:'none'}})},649,[6,11,263,650,604,401,652,653]); 743__d(function(g,r,i,a,m,e,d){"use strict";
743Object.defineProperty(e,"__esModule",{value:!0}),e.BottomTabItem=function({route:p,href:S,focused:y,descriptor:h,label:C,icon:v,badge:x,badgeStyle:B,button:w=b,accessibilityLabel:U,testID:k,onPress:V,onLongPress:j,horizontal:I,compact:L,sidebar:P,variant:z,activeTintColor:K,inactiveTintColor:M,activeBackgroundColor:T,inactiveBackgroundColor:D="transparent",showLabel:O=!0,allowFontScaling:_=!u&&void 0,labelStyle:F,iconStyle:H,style:E}){const{colors:R,fonts:q}=(0,c.useTheme)(),A=K??('uikit'===z&&P&&I?(0,n.Color)(R.primary)?.isDark()?'white':(0,n.Color)(R.primary)?.darken(.71).string():void 0)??R.primary,G=M??('material'===z?(0,n.Color)(R.text)?.alpha(.68).string():(0,n.Color)(R.text)?.alpha(.5).string())??R.text,J=T??('material'===z?(0,n.Color)(A)?.alpha(.12).string():P&&I?R.primary:'transparent')??'transparent',{options:N}=h,Q=(0,s.getLabel)({label:'string'==typeof N.tabBarLabel?N.tabBarLabel:void 0,title:N.title},p.name);let W=G,X=G;'uikit'===z&&P&&I&&void 0===M&&(X=R.primary,W=R.text);const Y={route:p,focused:y},Z=y?J:D,{flex:$}=l.StyleSheet.flatten(E||{}),ee='material'===z?I?56:16:P&&I?10:0;return(0,t.jsx)(l.View,{style:[{borderRadius:ee,overflow:'material'===z?'hidden':'visible'},E],children:w({href:S,onPress:V,onLongPress:j,testID:k,'aria-label':U,accessibilityLargeContentTitle:Q,accessibilityShowsLargeContentViewer:!0,role:l.Platform.select({ios:'button',default:'tab'}),'aria-selected':y,android_ripple:{borderless:!0},hoverEffect:'material'===z||P&&I?{color:R.text}:void 0,pressOpacity:1,style:[f.tab,{flex:$,backgroundColor:Z,borderRadius:ee},P?'material'===z?I?f.tabBarSidebarMaterial:f.tabVerticalMaterial:I?f.tabBarSidebarUiKit:f.tabVerticalUiKit:'material'===z?f.tabVerticalMaterial:I?f.tabHorizontalUiKit:f.tabVerticalUiKit],children:(0,t.jsxs)(t.Fragment,{children:[(({focused:l})=>{if(void 0===v)return null;const n=l?1:0,s=l?0:1;return(0,t.jsx)(o.TabBarIcon,{route:p,variant:z,size:L?'compact':'regular',badge:x,badgeStyle:B,activeOpacity:n,allowFontScaling:_,inactiveOpacity:s,activeTintColor:A,inactiveTintColor:X,renderIcon:v,style:H})})(Y),(({focused:l})=>{if(!1===O)return null;const o=l?A:W;return'string'!=typeof C?C({focused:l,color:o,position:I?'beside-icon':'below-icon',children:Q}):(0,t.jsx)(s.Label,{style:[I?[f.labelBeside,'material'===z?f.labelSidebarMaterial:P?f.labelSidebarUiKit:L?f.labelBesideUikitCompact:f.labelBesideUikit,null==v&&{marginStart:0}]:f.labelBeneath,L||'uikit'===z&&P&&I?q.regular:q.medium,F],allowFontScaling:_,tintColor:o,children:C})})(Y)]})})})};
743const t=r(d[0]),l=r(d[1]),o=r(d[2]),n=r(d[3]),s=r(d[4]),c=r(d[5]),b=l=>(0,t.jsx)(s.PlatformPressable,{...l}),u='ios'===l.Platform.OS&&parseInt(l.Platform.Version,10)>=13;const f=l.StyleSheet.create({tab:{alignItems:'center',borderRadius:10,borderCurve:'continuous'},tabVerticalUiKit:{justifyContent:'flex-start',flexDirection:'column',padding:5},tabVerticalMaterial:{padding:10},tabHorizontalUiKit:{justifyContent:'center',alignItems:'center',flexDirection:'row',padding:5},tabBarSidebarUiKit:{justifyContent:'flex-start',alignItems:'center',flexDirection:'row',paddingVertical:7,paddingHorizontal:5},tabBarSidebarMaterial:{justifyContent:'flex-start',alignItems:'center',flexDirection:'row',paddingVertical:15,paddingStart:16,paddingEnd:24},labelSidebarMaterial:{marginStart:12},labelSidebarUiKit:{fontSize:17,marginStart:10},labelBeneath:{fontSize:10},labelBeside:{marginEnd:12,lineHeight:24},labelBesideUikit:{fontSize:13,marginStart:5},labelBesideUikitCompact:{fontSize:12,marginStart:5}})},650,[6,263,651,612,604,401]); 744__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TabBarIcon=function({route:h,variant:w,size:u,badge:y,badgeStyle:b,activeOpacity:f,inactiveOpacity:v,activeTintColor:j,inactiveTintColor:S,renderIcon:C,allowFontScaling:k,style:x}){const z='material'===w?s:'compact'===u?l:n;return(0,t.jsxs)(o.View,{style:['material'===w?p.wrapperMaterial:'compact'===u?p.wrapperUikitCompact:p.wrapperUikit,x],children:[(0,t.jsx)(o.View,{style:[p.icon,{opacity:f,minWidth:z}],children:C({focused:!0,size:z,color:j})}),(0,t.jsx)(o.View,{style:[p.icon,{opacity:v}],children:C({focused:!1,size:z,color:S})}),(0,t.jsx)(c.Badge,{visible:null!=y,size:.75*z,allowFontScaling:k,style:[p.badge,b],children:y})]})};const t=r(d[0]),o=r(d[1]),c=r(d[2]),n=25,l=18,s=24;const p=o.StyleSheet.create({icon:{position:'absolute',alignSelf:'center',alignItems:'center',justifyContent:'center',height:'100%',width:'100%'},wrapperUikit:{width:31,height:28},wrapperUikitCompact:{width:23,height:20},wrapperMaterial:{width:s,height:s},badge:{position:'absolute',end:-3,top:-3}})},651,[6,263,604]); 745__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),l=0;l<c.length;l++)"default"!==c[l]&&n(u,i,c[l]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.BottomTabBarHeightCallbackContext=void 0;const u=i(r(d[0]));e.BottomTabBarHeightCallbackContext=u.createContext(void 0)},652,[11]); 746__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),s=0;s<c.length;s++)"default"!==c[s]&&n(u,i,c[s]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.useIsKeyboardShown=function(){const[t,n]=u.useState(!1);return u.useEffect(()=>{const t=()=>n(!0),o=()=>n(!1);let i;return i='ios'===c.Platform.OS?[c.Keyboard.addListener('keyboardWillShow',t),c.Keyboard.addListener('keyboardWillHide',o)]:[c.Keyboard.addListener('keyboardDidShow',t),c.Keyboard.addListener('keyboardDidHide',o)],()=>
746{i.forEach(t=>t.remove())}},[]),t};const u=i(r(d[0])),c=r(d[1])},653,[11,263]); 747__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,"__esModule",{value:!0}),_e.MaybeScreenContainer=void 0,_e.MaybeScreen=function({enabled:c,active:s,...b}){if(t?.screensEnabled?.())return(0,e.jsx)(t.Screen,{enabled:c,activityState:s,...b});return(0,e.jsx)(n.View,{...b})};const e=r(d[0]),n=r(d[1]);let t;try{t=r(d[2],"react-native-screens")}catch(e){}_e.MaybeScreenContainer=({enabled:c,...s})=>t?.screensEnabled?.()?(0,e.jsx)(t.ScreenContainer,{enabled:c,...s}):(0,e.jsx)(n.View,{...s})},654,[6,263,655]); 748__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"enableScreens",{enumerable:!0,get:function(){return t.enableScreens}}),Object.defineProperty(_e,"enableFreeze",{enumerable:!0,get:function(){return t.enableFreeze}}),Object.defineProperty(_e,"screensEnabled",{enumerable:!0,get:function(){return t.screensEnabled}}),Object.defineProperty(_e,"freezeEnabled",{enumerable:!0,get:function(){return t.freezeEnabled}}),Object.defineProperty(_e,"Screen",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(_e,"InnerScreen",{enumerable:!0,get:function(){return n.InnerScreen}}),Object.defineProperty(_e,"ScreenContext",{enumerable:!0,get:function(){return n.ScreenContext}}),Object.defineProperty(_e,"ScreenStackHeaderConfig",{enumerable:!0,get:function(){return u.ScreenStackHeaderConfig}}),Object.defineProperty(_e,"ScreenStackHeaderSubview",{enumerable:!0,get:function(){return u.ScreenStackHeaderSubview}}),Object.defineProperty(_e,"ScreenStackHeaderLeftView",{enumerable:!0,get:function(){return u.ScreenStackHeaderLeftView}}),Object.defineProperty(_e,"ScreenStackHeaderCenterView",{enumerable:!0,get:function(){return u.ScreenStackHeaderCenterView}}),Object.defineProperty(_e,"ScreenStackHeaderRightView",{enumerable:!0,get:function(){return u.ScreenStackHeaderRightView}}),Object.defineProperty(_e,"ScreenStackHeaderBackButtonImage",{enumerable:!0,get:function(){return u.ScreenStackHeaderBackButtonImage}}),Object.defineProperty(_e,"ScreenStackHeaderSearchBarView",{enumerable:!0,get:function(){return u.ScreenStackHeaderSearchBarView}}),Object.defineProperty(_e,"SearchBar",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(_e,"ScreenContainer",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(_e,"ScreenStack",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(_e,"ScreenStackItem",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(_e,"FullWindowOverlay",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(_e,"ScreenFooter",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(_e,"ScreenContentWrapper",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(_e,"isSearchBarAvailableForCurrentPlatform",{enumerable:!0,get:function(){return P.isSearchBarAvailableForCurrentPlatform}}),Object.defineProperty(_e,"executeNativeBackPress",{enumerable:!0,get:function(){return P.executeNativeBackPress}}),Object.defineProperty(_e,"compatibilityFlags",{enumerable:!0,get:function(){return O.compatibilityFlags}}),Object.defineProperty(_e,"featureFlags",{enumerable:!0,get:function(){return O.featureFlags}}),Object.defineProperty(_e,"useTransitionProgress",{enumerable:!0,get:function(){return j.default}}),r(d[0]);var t=r(d[1]),n=r(d[2]),c=e(n),u=r(d[3]),o=e(r(d[4])),f=e(r(d[5])),b=e(r(d[6])),l=e(r(d[7])),S=e(r(d[8])),p=e(r(d[9])),y=e(r(d[10])),P=r(d[11]),O=r(d[12]),j=e(r(d[13])),s=r(d[14]);Object.keys(s).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return s[e]}})})},655,[656,657,658,659,660,661,662,663,673,668,666,674,670,675,677]); 749__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t={}},656,[]); 750__d(function(g,r,i,a,m,_e,d){"use strict";
750Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"isNativePlatformSupported",{enumerable:!0,get:function(){return t}}),_e.enableScreens=function(e=!0){return void(u=e)},_e.enableFreeze=function(e=!0){return},_e.screensEnabled=function(){return u},_e.freezeEnabled=function(){return o},r(d[0]);var e,n=r(d[1]);(e=n)&&e.__esModule;const t=!1;let u=t;let o=!1},657,[136,88]); 751__d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"InnerScreen",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"NativeScreen",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"ScreenContext",{enumerable:!0,get:function(){return s}});var t=e(_r(d[0])),n=e(_r(d[1])),r=e(_r(d[2])),u=_r(d[3]);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(null,arguments)}const c=n.default;class o extends r.default.Component{render(){let{active:e,activityState:t,style:c,enabled:o=(0,u.screensEnabled)(),...f}=this.props;return o?(void 0!==e&&void 0===t&&(t=0!==e?2:0),r.default.createElement(n.default,l({hidden:0===t,style:[c,{display:0!==t?'flex':'none'}]},f))):r.default.createElement(n.default,f)}}const f=t.default.createAnimatedComponent(o),s=r.default.createContext(f);var b=f},658,[267,13,11,657]); 752__d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ScreenStackHeaderBackButtonImage",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"ScreenStackHeaderRightView",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"ScreenStackHeaderLeftView",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"ScreenStackHeaderCenterView",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"ScreenStackHeaderSearchBarView",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"ScreenStackHeaderConfig",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"ScreenStackHeaderSubview",{enumerable:!0,get:function(){return p}});var t=e(_r(d[0])),r=e(_r(d[1])),n=e(_r(d[2]));function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(null,arguments)}const c=e=>n.default.createElement(r.default,null,n.default.createElement(t.default,u({resizeMode:"center",fadeDuration:0},e))),l=e=>n.default.createElement(r.default,e),f=e=>n.default.createElement(r.default,e),o=e=>n.default.createElement(r.default,e),b=e=>n.default.createElement(r.default,e),S=e=>n.default.createElement(r.default,e),p=r.default},659,[319,13,11]); 753__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]);var u=((e=t)&&e.__esModule?e:{default:e}).default},660,[13]); 754__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]);var u=((e=t)&&e.__esModule?e:{default:e}).default},661,[13]); 755__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]);var u=((e=t)&&e.__esModule?e:{default:e}).default},662,[13]); 756__d(function(g,_r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return E}});var t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(_r(_d[0]));_r(_d[1]);var n=e(_r(_d[2])),r=e(_r(_d[3])),l=e(_r(_d[4])),o=_r(_d[5]),s=e(_r(_d[6])),c=e(_r(_d[7])),u=_r(_d[8]),d=_r(_d[9]),f=_r(_d[10]);_r(_d[11]);var h=_r(_d[12]),p=_r(_d[13]);function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b.apply(null,arguments)}function v({children:e,headerConfig:v,activityState:E,shouldFreeze:C,stackPresentation:H,sheetAllowedDetents:k,contentStyle:I,style:w,screenId:A,onHeaderHeight
756Change:P,scrollEdgeEffects:R,unstable_sheetFooter:_,...j},x){const F=!v?.hidden,{nextContextValue:N}=(0,p.useEdgeInsetApplication)(F,v?.disableTopInsetApplication??!1,v?.disableLeftInsetApplication??!1,v?.disableRightInsetApplication??!1,v?.disableBottomInsetApplication??!1),D=t.useRef(null),L=t.useContext(u.RNSScreensRefContext);t.useImperativeHandle(x,()=>D.current);const M=H??'push',T=v?.hidden??!1,z='push'!==M&&!1===T,B=t.useRef(T);t.useEffect(()=>{(0,r.default)('push'!==M&&B.current!==T,"Dynamically changing header's visibility in modals will result in remounting the screen and losing all local state."),B.current=T},[T,M]);const V=void 0===R||Object.values(R).some(e=>'hidden'!==e),W=void 0!==v?.blurEffect&&'none'!==v.blurEffect;(0,r.default)(V&&W&&h.isIOS26OrHigher,'[RNScreens] Using both `blurEffect` and `scrollEdgeEffects` simultaneously may cause overlapping effects.');const U=y(k,M);let q;const G=h.isIOS26OrHigher,J=t.createElement(t.Fragment,null,t.createElement(p.EdgeInsetApplicationContext.Provider,{value:N},t.createElement(l.default,{contentStyle:I,style:U,stackPresentation:M},G?t.createElement(f.SafeAreaView,{edges:S(v)},e):e)),t.createElement(o.ScreenStackHeaderConfig,v),'formSheet'===M&&_&&t.createElement(d.FooterComponent,null,_()));return t.createElement(s.default,b({ref:e=>{if(D.current=e,null===L)return void console.warn('Looks like RNSScreensRefContext is missing. Make sure the ScreenStack component is wrapped in it');const t=L.current;null===e?delete t[A]:t[A]={current:e}},enabled:!0,isNativeStack:!0,activityState:E,shouldFreeze:C,screenId:A,stackPresentation:M,hasLargeHeader:v?.largeTitle??!1,sheetAllowedDetents:k,style:[w,q],scrollEdgeEffects:z?void 0:R,onHeaderHeightChange:z?void 0:P},j),z?t.createElement(c.default,{style:O.container},t.createElement(s.default,{enabled:!0,isNativeStack:!0,activityState:E,shouldFreeze:C,hasLargeHeader:v?.largeTitle??!1,scrollEdgeEffects:R,style:n.default.absoluteFill,onHeaderHeightChange:P},J)):J)}var E=t.forwardRef(v);function y(e,t){return'formSheet'!==t?O.container:'fitToContents'===e?O.absoluteWithNoBottom:O.container}function S(e){return{}}const O=n.default.create({container:{flex:1},absoluteWithNoBottom:{position:'absolute',top:0,start:0,end:0}})},663,[11,136,26,664,665,659,658,662,667,668,669,670,671,672]); 757__d(function(g,r,i,a,m,e,d){new Set;m.exports=function(n,...t){}},664,[]); 758__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}});var e,t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),n=r(_d[1]),u=(e=n)&&e.__esModule?e:{default:e};function c(e){return t.createElement(u.default,e)}},665,[11,666]); 759__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]);var u=((e=t)&&e.__esModule?e:{default:e}).default},666,[13]); 760__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"GHContext",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"RNSScreensRefContext",{enumerable:!0,get:function(){return l}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};const u=n.default.createContext(e=>n.default.createElement(n.default.Fragment,null,e.children)),l=n.default.createContext(null)},667,[11]); 761__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"FooterComponent",{enumerable:!0,get:function(){return o}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};const u=n.default,o=n.default;var f=u},668,[13]); 762__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}
762),Object.defineProperty(_e,"SafeAreaView",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]);const u=((e=t)&&e.__esModule?e:{default:e}).default},669,[13]); 763__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return H}}),Object.defineProperty(e,"compatibilityFlags",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"featureFlags",{enumerable:!0,get:function(){return U}});const t=!0,n=!0,s=!0,o=!1,c=!0,u=!1,l={isNewBackTitleImplementation:!0,usesHeaderFlexboxImplementation:!0,usesNewAndroidHeaderHeightImplementation:!0,usesStableTabsApi:!0},b={experiment:{synchronousScreenUpdatesEnabled:t,synchronousHeaderConfigUpdatesEnabled:n,synchronousHeaderSubviewUpdatesEnabled:s,androidLegacyTopInsetBehavior:o,androidResetScreenShadowStateOnOrientationChangeEnabled:c},stable:{debugLogging:u}},h=(t,n)=>({get:()=>b.experiment[t],set(s){s!==b.experiment[t]&&b.experiment[t]!==n&&console.error(`[RNScreens] ${t} feature flag modified for a second time; this might lead to unexpected effects`),b.experiment[t]=s}}),p=h('synchronousScreenUpdatesEnabled',t),f=h('synchronousHeaderConfigUpdatesEnabled',n),S=h('synchronousHeaderSubviewUpdatesEnabled',s),y=h('androidLegacyTopInsetBehavior',o),E=h('androidResetScreenShadowStateOnOrientationChangeEnabled',c),O=(v='debugLogging',w=u,{get:()=>b.stable[v],set(t){t!==b.stable[v]&&b.stable[v]!==w&&console.error(`[RNScreens] ${v} feature flag modified for a second time; this might lead to unexpected effects`),b.stable[v]=t}});var v,w;const U={experiment:{get synchronousScreenUpdatesEnabled(){return p.get()},set synchronousScreenUpdatesEnabled(t){p.set(t)},get synchronousHeaderConfigUpdatesEnabled(){return f.get()},set synchronousHeaderConfigUpdatesEnabled(t){f.set(t)},get synchronousHeaderSubviewUpdatesEnabled(){return S.get()},set synchronousHeaderSubviewUpdatesEnabled(t){S.set(t)},get androidLegacyTopInsetBehavior(){return y.get()},set androidLegacyTopInsetBehavior(t){y.set(t)},get androidResetScreenShadowStateOnOrientationChangeEnabled(){return E.get()},set androidResetScreenShadowStateOnOrientationChangeEnabled(t){E.set(t)},get iosPreventReattachmentOfDismissedScreens(){return!0},set iosPreventReattachmentOfDismissedScreens(t){},get iosPreventReattachmentOfDismissedModals(){return!0},set iosPreventReattachmentOfDismissedModals(t){},get ios26AllowInteractionsDuringTransition(){return!0},set ios26AllowInteractionsDuringTransition(t){}},stable:{get debugLogging(){return O.get()},set debugLogging(t){O.set(t)}}};var H=U},670,[]); 764__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"isIOS26OrHigher",{enumerable:!0,get:function(){return t}}),r(d[0]);const t=!1},671,[136]); 765__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"EdgeInsetApplicationContext",{enumerable:!0,get:function(){return o}}),_e.useEdgeInsetApplication=function(n,s,l,u,d){const{topAlreadyApplied:c,leftDisabled:p,rightDisabled:b,bottomDisabled:f}=e.useContext(o),y=t.featureFlags.experiment?.androidLegacyTopInsetBehavior??!1,D=y||!c&&n,A=D&&!s,h=p||l,I=b||u,v=f||d,x=e.useMemo(()=>({topAlreadyApplied:c||D,leftDisabled:h,rightDisabled:I,bottomDisabled:v}),[c,D,h,I,v]);return{appliesTopInset:A,consumeLeftInset:!h,consumeRightInset:!I,consumeBottomInset:!v,useLegacyBehavior:y,nextContextValue:x}};var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),t=r(_d[1]);const n={topAlreadyApplied:!1,leftDisabled:!1,rightDisabled:!1,bottomDisabled:!1},o=e.createContext(n)},672,[11,670]); 766__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},673,[13]); 767__d(function(g,r,i,a,m,_e,d){"use strict";
767Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"isSearchBarAvailableForCurrentPlatform",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"isHeaderBarButtonsAvailableForCurrentPlatform",{enumerable:!0,get:function(){return u}}),_e.executeNativeBackPress=function(){return n.default.exitApp(),!0},_e.parseBooleanToOptionalBooleanNativeProp=function(e){switch(e){case void 0:return'undefined';case!0:return'true';case!1:return'false'}};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};r(d[1]);const o=['ios','android'].includes("web"),u=!1},674,[349,136]); 768__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var e,t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),n=r(_d[1]),u=(e=n)&&e.__esModule?e:{default:e};function o(){const e=t.useContext(u.default);if(void 0===e)throw new Error("Couldn't find values for transition progress. Are you inside a screen in Native Stack?");return e}},675,[11,676]); 769__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return e}});var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])).createContext(void 0)},676,[11]); 770__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"Tabs",{enumerable:!0,get:function(){return s}});var t=r(d[0]),n=r(d[1]);const s={Host:t.TabsHost,Screen:n.TabsScreen}},677,[678,680]); 771__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TabsHost",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},678,[679]); 772__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]);var u=((e=t)&&e.__esModule?e:{default:e}).default},679,[13]); 773__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TabsScreen",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},680,[681]); 774__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]);var u=((e=t)&&e.__esModule?e:{default:e}).default},681,[13]); 775__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var c=t(i),f=0;f<c.length;f++)"default"!==c[f]&&n(u,i,c[f]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.BottomTabBarHeightContext=void 0;const u=i(r(d[0]));e.BottomTabBarHeightContext=u.createContext(void 0)},682,[11]); 776__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,i){void 0===i&&(i=u);var c=Object.getOwnPropertyDescriptor(n,u);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,i,c)}:function(t,n,u,i){void 0===i&&(i=u),t[i]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(i){if(i&&i.__esModule)return i;var c={};if(null!=i)for(var o=t(i),f=0;f<o.length;f++)"default"!==o[f]&&n(c,i,o[f]);return u(c,i),c});
776Object.defineProperty(e,"__esModule",{value:!0}),e.useAnimatedHashMap=function({routes:t,index:n}){const u=c.useRef({}),i=u.current,f=Object.keys(i);if(t.length===f.length&&t.every(t=>f.includes(t.key)))return i;return u.current={},t.forEach(({key:t},c)=>{u.current[t]=i[t]??new o.Animated.Value(c===n?0:c>=n?1:-1)}),u.current};const c=i(r(d[0])),o=r(d[1])},683,[11,263]); 777__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useBottomTabBarHeight=function(){const n=(0,t.use)(o.BottomTabBarHeightContext);if(void 0===n)throw new Error("Couldn't find the bottom tab bar height. Are you inside a screen in Bottom Tab Navigator?");return n};const t=r(d[0]),o=r(d[1])},684,[11,682]); 778__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png",width:48,height:48,toString(){return this.uri}}},685,[]); 779__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SuspenseFallback=function({route:u}){return null};r(d[0]),r(d[1])},686,[6,597]); 780__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var c=Object.getOwnPropertyDescriptor(n,o);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,c)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var c={};if(null!=i)for(var s=t(i),u=0;u<s.length;u++)"default"!==s[u]&&n(c,i,s[u]);return o(c,i),c});Object.defineProperty(e,"__esModule",{value:!0}),e.Try=void 0;const c=r(d[0]),s=r(d[1]),u=i(r(d[2]));r(d[3]);class l extends s.Component{state={error:void 0};static getDerivedStateFromError(t){return u.hideAsync(),{error:t}}retry=()=>new Promise(t=>{this.setState({error:void 0},()=>{t()})});render(){const{error:t}=this.state,{catch:n,children:o}=this.props;return t?(0,c.jsx)(n,{error:t,retry:this.retry}):o}}e.Try=l},687,[6,11,539,688]); 781__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkError=e.ReactServerError=e.MetroServerError=void 0;class t extends Error{code='METRO_SERVER_ERROR';constructor(t,o){super(t.message),this.url=o,this.name='MetroServerError';for(const o in t)this[o]=t[o]}}e.MetroServerError=t;class o extends Error{code='REACT_SERVER_ERROR';constructor(t,o,s,E){super(t),this.url=o,this.statusCode=s,this.headers=E,this.name='ReactServerError'}}e.ReactServerError=o;class s extends Error{code='NETWORK_ERROR';constructor(t,o){super(t),this.url=o,this.name='NetworkError'}}e.NetworkError=s},688,[]); 782__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Redirect=e.Link=void 0;const n=r(d[0]),o=r(d[1]),t=r(d[2]),c=r(d[3]),u=r(d[4]),p=r(d[5]);e.Link=Object.assign(function(t){return(0,n.jsx)(o.ExpoLink,{...t})},{resolveHref:c.resolveHref,Menu:t.LinkMenu,Trigger:t.LinkTrigger,Preview:t.LinkPreview,MenuAction:t.LinkMenuAction,AppleZoom:u.LinkAppleZoom,AppleZoomTarget:p.LinkAppleZoomTarget});var k=r(d[6]);Object.defineProperty(e,"Redirect",{enumerable:!0,get:function(){return k.Redirect}})},689,[6,690,701,538,716,722,723]); 783__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)}
783,function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),l=0;l<c.length;l++)"default"!==c[l]&&n(u,o,c[l]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.ExpoLink=function(t){return(0,u.jsx)(p.ZoomTransitionSourceContextProvider,{linkProps:t,children:(0,u.jsx)(_,{...t})})};const u=r(d[0]),c=o(r(d[1])),l=r(d[2]),f=(r(d[3]),r(d[4])),s=r(d[5]),h=r(d[6]),p=(r(d[7]),r(d[8]));function _(t){(0,s.useIsPreview)();const n=(0,h.useZoomHref)(t);let i=t.children;if(c.default.Children.count(t.children)>1){const n=c.default.Children.toArray(t.children).filter(t=>!(0,c.isValidElement)(t)||t.type!==f.LinkPreview&&t.type!==f.LinkMenu);i=1===n.length?n[0]:t.children}return(0,u.jsx)(l.BaseExpoRouterLink,{...t,href:n,children:i})}},690,[6,11,691,698,701,528,721,536,594]); 784__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(o){if(o&&o.__esModule)return o;var i={};if(null!=o)for(var s=e(o),l=0;l<s.length;l++)"default"!==s[l]&&t(i,o,s[l]);return n(i,o),i}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};
784Object.defineProperty(_e,"__esModule",{value:!0}),_e.BaseExpoRouterLink=function({href:e,replace:t,push:n,dismissTo:o,relativeToDirectory:i,asChild:P,rel:v,target:w,download:b,withAnchor:m,dangerouslySingular:y,prefetch:O,...j}){const C=(0,f.useInteropClassName)(j),M=(0,f.useHrefAttrs)({asChild:P,rel:v,target:w,download:b}),x=(0,l.useMemo)(()=>{if(null==e)throw new Error('Link: href is required');return(0,c.resolveHref)(e)},[e]);let D;n&&(D='PUSH');t&&(D='REPLACE');o&&(D='POP_TO');const E=(0,h.default)({href:x,event:D,relativeToDirectory:i,withAnchor:m,dangerouslySingular:y}),S=e=>{'onPress'in j&&j.onPress?.(e),E.onPress(e)},T=P?p.Slot:u.Text;if(P&&l.default.Children.count(j.children)>1)throw new Error('Link: When using `asChild`, you must pass a single child element that will emit the `onPress` event.');const k=(0,s.jsx)(T,{...E,...M,...j,style:C,...u.Platform.select({web:{onClick:S},default:{onPress:S}})});return O?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_.Prefetch,{href:e}),k]}):k};const s=r(d[0]),l=o(r(d[1])),u=r(d[2]),c=r(d[3]),f=r(d[4]),h=i(r(d[5])),_=r(d[6]),p=r(d[7])},691,[6,11,263,538,692,693,694,695]); 785__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useHrefAttrs=void 0,e.useInteropClassName=function(l){if('web'!==s.Platform.OS)return l.style;return(0,t.useMemo)(()=>{if(null==l.className)return l.style;const t={$$css:!0,__routerLinkClassName:l.className};return Array.isArray(l.style)?[...l.style,t]:[l.style,t]},[l.style,l.className])};const t=r(d[0]),s=r(d[1]);e.useHrefAttrs=s.Platform.select({web:function({asChild:s,rel:l,target:n,download:u}){return(0,t.useMemo)(()=>{const t={rel:l,target:n,download:u};return s?t:{hrefAttrs:t}},[s,l,n,u])},default:function(){return{}}})},692,[11,263]); 786__d(function(g,r,i,a,m,_e,d){"use strict";
786Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function({href:e,...s}){let c=(0,u.stripGroupSegmentsFromPath)(e)||'/';(0,o.shouldLinkExternally)(c)||(c=(0,n.appendBaseUrl)(c));return{href:c,role:'link',onPress:n=>{if(f(n)){if((0,t.emitDomLinkEvent)(e,s))return;(0,l.linkTo)(e,s)}}}},_e.shouldHandleMouseEvent=f;const e=r(d[0]),t=r(d[1]),n=r(d[2]),l=r(d[3]),u=r(d[4]),o=r(d[5]);function f(t){return'web'!==e.Platform.OS?!t?.defaultPrevented:!(!t||(n=t,n?.defaultPrevented||!('button'in n)||n.metaKey||n.altKey||n.ctrlKey||n.shiftKey||null!=n.button&&0!==n.button||![void 0,null,'','self'].includes(n.currentTarget.target)))&&(t.preventDefault(),!0);var n}},693,[263,574,535,576,257,536]); 787__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Prefetch=function(o){const c=(0,n.useOptionalNavigation)();return(0,t.useLayoutEffect)(()=>{c?.isFocused()&&u.router.prefetch(o.href)},[c,o.href]),null};const t=r(d[0]),u=r(d[1]),n=r(d[2])},694,[11,563,530]); 788__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var l=t(i),c=0;c<l.length;c++)"default"!==l[c]&&n(u,i,l[c]);return o(u,i),u});Object.defineProperty(e,"__esModule",{value:!0}),e.Slot=void 0;const u=r(d[0]),l=r(d[1]),c=i(r(d[2])),f=r(d[3]);var s;e.Slot=(s=l.Slot,(0,c.forwardRef)(function({style:t,...n},o){return t=(0,c.useMemo)(()=>f.StyleSheet.flatten(t),[t]),(0,u.jsx)(s,{ref:o,...n,style:t})}))},695,[6,696,11,263]); 789__d(function(g,r,i,a,m,e,d){"use strict";var t,o=Object.create,n=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,s=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,f=(t,o)=>n(t,"name",{value:o,configurable:!0}),u=(t,o,s,f)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let u of c(o))p.call(t,u)||u===s||n(t,u,{get:()=>o[u],enumerable:!(f=l(o,u))||f.enumerable});return t},b={};((t,o)=>{for(var l in o)n(t,l,{get:o[l],enumerable:!0})})(b,{Root:()=>_,Slot:()=>_,Slottable:()=>O,createSlot:()=>S,createSlottable:()=>v}),m.exports=(t=b,u(n({},"__esModule",{value:!0}),t));var y=((t,l,c)=>(c=null!=t?o(s(t)):{},u(!l&&t&&t.__esModule?c:n(c,"default",{value:t,enumerable:!0}),t)))(r(d[0])),h=r(d[1]);function S(t){const o=y.forwardRef((o,n)=>{let{children:l,...c}=o,s=null,p=!1;const f=[];x(l)&&"function"==typeof W&&(l=W(l._payload)),y.Children.forEach(l,t=>{if(w(t)){p=!0;const o=t;let n="child"in o.props?o.props.child:o.props.children;x(n)&&"function"==typeof W&&(n=W(n._payload)),s=j(o,n),f.push(s?.props?.children)}else f.push(t)}),s?s=y.cloneElement(s,void 0,f):!p&&1===y.Children.count(l)&&y.isValidElement(l)&&(s=l);const u=s?P(s):void 0,b=(0,h.useComposedRefs)(n,u);if(!s){if(l||0===l)throw new Error(p?V(t):N(t));return l}const S=R(c,s.props??{});return s.type!==y.Fragment&&(S.ref=n?b:u),y.cloneElement(s,S)});return o.displayName=`${t}.Slot`,o}f(S,"createSlot");var _=S("Slot"),E=Symbol.for("radix.slottable");function v(t){const o=f(t=>"child"in t?t.children(t.child):t.children,"Slottable");return o.displayName=`${t}.Slottable`,o.__radixId=E,o}f(v,"createSlottable");var O=v("Slottable"),j=f((t,o)=>{if("child"in t.props){const o=t.props.child;return y.isValidElement(o)?y.cloneElement(o,void 0,t.props.children(o.props.children)):null}return y.isValidElement(o)?o:null},"getSlottableElementFromSlottable");function R(t,o){const n={...o};for(const l in o){const c=t[l],s=o[l];/^on[A-Z]/.test(l)?c&&s?n[l]=(...t)=>{const o=s(...t);return c(...t),o}:c&&(n[l]=c):"style"===l?n[l]={...c,...s}
789:"className"===l&&(n[l]=[c,s].filter(Boolean).join(" "))}return{...t,...n}}function P(t){let o=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=o&&"isReactWarning"in o&&o.isReactWarning;return n?t.ref:(o=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=o&&"isReactWarning"in o&&o.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function w(t){return y.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===E}f(R,"mergeProps"),f(P,"getElementRef"),f(w,"isSlottable");var $=Symbol.for("react.lazy");function x(t){return null!=t&&"object"==typeof t&&"$$typeof"in t&&t.$$typeof===$&&"_payload"in t&&C(t._payload)}function C(t){return"object"==typeof t&&null!==t&&"then"in t}f(x,"isLazyComponent"),f(C,"isPromiseLike");var N=f(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),V=f(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),W=y[" use ".trim().toString()]},696,[11,697]); 790__d(function(g,r,_i,a,m,e,d){"use strict";var t,o=Object.create,n=Object.defineProperty,u=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,s=(t,o)=>n(t,"name",{value:o,configurable:!0}),p=(t,o,c,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let p of f(o))l.call(t,p)||p===c||n(t,p,{get:()=>o[p],enumerable:!(s=u(o,p))||s.enumerable});return t},i={};((t,o)=>{for(var u in o)n(t,u,{get:o[u],enumerable:!0})})(i,{composeRefs:()=>O,useComposedRefs:()=>j}),m.exports=(t=i,p(n({},"__esModule",{value:!0}),t));var b=((t,u,f)=>(f=null!=t?o(c(t)):{},p(!u&&t&&t.__esModule?f:n(f,"default",{value:t,enumerable:!0}),t)))(r(d[0]));function y(t,o){if("function"==typeof t)return t(o);null!=t&&(t.current=o)}function O(...t){return o=>{let n=!1;const u=t.map(t=>{const u=y(t,o);return n||"function"!=typeof u||(n=!0),u});if(n)return()=>{for(let o=0;o<u.length;o++){const n=u[o];"function"==typeof n?n():y(t[o],null)}}}}function j(...t){return b.useCallback(O(...t),t)}s(y,"setRef"),s(O,"composeRefs"),s(j,"useComposedRefs")},697,[11]); 791__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var s=Object.getOwnPropertyDescriptor(n,i);s&&!("get"in s?!n.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,s)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var s={};if(null!=o)for(var u=t(o),l=0;l<u.length;l++)"default"!==u[l]&&n(s,o,u[l]);return i(s,o),s});Object.defineProperty(e,"__esModule",{value:!0}),e.LinkWithPreview=function({children:t,...n}){const i=(0,c.useRouter)(),{setOpenPreviewKey:o}=(0,P.useLinkPreviewContext)(),[l,x]=(0,u.useState)(!1),j=(0,w.resolveHref)(n.hrefForPreviewNavigation).split('?')[0],m=(0,u.useRef)(j);(0,u.useEffect)(()=>{if(l){if(m.current!==j)throw new Error('Link does not support changing the href prop after the preview has been opened. Please ensure that the href prop is stable and does not change between renders.')}else m.current=j},[j]);const[{nextScreenId:L,tabPath:M},C]=(0,b.useNextScreenId)();(0,u.useEffect)(()=>{n.replace&&console.warn('Using replace links with preview is not supported')},[n.href,n.replace]);const F=u.default.useMemo(()=>(0,y.getFirstChildOfType)(t,p.LinkTrigger),[t]),S=u.default.useMemo(()=>(0,y.getFirstChildOfType)(t,p.LinkMenu),[t]),T=u.default.useMemo(()=>(0,y.getFirstChildOfType)(t,p.LinkPreview),[t]);!T&&!S||F||console.warn('When you use Link.Preview, you must use Link.Trigger to specify the trigger element.');const E=u.default.useMemo(()=>F??(0,s.jsx)(p.LinkTrigger,{children:t}),[F,t]),N=u.default.useMemo(()=>(0,O.shouldLinkExternally)(String(n.href))||!T?null:T,[T,n.href]),R=(0,u.useRef)(!1),I=(0,u.useMemo)(()=>({path:M}),[M]),W=!!T;if(n.replace)return(0,s.jsx)(f.BaseExpoRouterLink,{children:t,...n});return(0,s.jsx)(_.NativeLinkPreview,{nextScreenId:k?void 0:L,tabPath:k?void 0:I,onWillPreviewOpen:()=>{W&&(R.current=!1,C(n.href),x(!0))},onPreviewWillClose:()=>{W&&(x(!1),R.current&&!k||o(void 0))},onPreviewDidClose:()=>{W&&R.current&&k&&i.navigate(n.href,{__internal__PreviewKey:L})},onPreviewTapped:()=>{R.current=!0,k||i.navigate(n.href,{__internal__PreviewKey:L})},style:{display:'contents'},disableForceFlatten:!0,children:(0,s.jsx)(v.NativeMenuContext,{value:!0,children:(0,s.jsxs)(h.InternalLinkPreviewContext,{value:{isVisible:l,href:n.hrefForPreviewNavigation},children:[(0,s.jsx)(f.BaseExpoRouterLink,{...n,children:E,ref:n.ref}),N,S]})})})};const s=r(d[0]),u=o(r(d[1])),l=r(d[2]),c=r(d[3]),f=r(d[4]),h=r(d[5]),v=r(d[6]),p=r(d[7]),w=r(
791d[8]),P=r(d[9]),_=r(d[10]),b=r(d[11]),y=r(d[12]),O=r(d[13]),k='ios'===l.Platform.OS&&l.Platform.isPad},698,[6,11,263,557,691,699,700,701,538,718,715,719,527,536]); 792__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InternalLinkPreviewContext=void 0;const t=r(d[0]);e.InternalLinkPreviewContext=(0,t.createContext)(void 0)},699,[11]); 793__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeMenuContext=void 0;const t=r(d[0]);e.NativeMenuContext=(0,t.createContext)(!1)},700,[11]); 794__d(function(g,r,_i,a,_m,e,d){"use strict";var n,t=this&&this.__createBinding||(Object.create?function(n,t,i,u){void 0===u&&(u=i);var l=Object.getOwnPropertyDescriptor(t,i);l&&!("get"in l?!t.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(n,u,l)}:function(n,t,i,u){void 0===u&&(u=i),n[u]=t[i]}),i=this&&this.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),u=this&&this.__importStar||(n=function(t){return n=Object.getOwnPropertyNames||function(n){var t=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[t.length]=i);return t},n(t)},function(u){if(u&&u.__esModule)return u;var l={};if(null!=u)for(var o=n(u),s=0;s<o.length;s++)"default"!==o[s]&&t(l,u,o[s]);return i(l,u),l});Object.defineProperty(e,"__esModule",{value:!0}),e.LinkMenu=void 0,e.LinkMenuAction=w,e.LinkPreview=function(n){const{children:t,style:i}=n,u=(0,o.use)(s.InternalLinkPreviewContext);return(0,f.useIsPreview)(),null;const{isVisible:v,href:p}=u,{width:w,height:P,...b}=i??{},_={width:w??0,height:P??0};let j;j=t?v?t:null:v?(0,l.jsx)(c.HrefPreview,{href:p}):null;return(0,l.jsx)(h.NativeLinkPreviewContent,{style:b,preferredContentSize:_,children:j})},e.LinkTrigger=function({withAppleZoom:n,...t}){if(o.default.Children.count(t.children)>1||!(0,o.isValidElement)(t.children)){if(t&&'object'==typeof t&&'onPress'in t)throw new Error('When using Link.Trigger in an asChild Link, you must pass a single child element that will emit onPress event.');return t.children}const i=(0,l.jsx)(v.Slot,{...t});if(n)return(0,l.jsx)(p.LinkAppleZoom,{children:i});return i};const l=r(d[0]),o=u(r(d[1])),s=r(d[2]),c=(r(d[3]),r(d[4]),r(d[5])),f=r(d[6]),h=r(d[7]),v=r(d[8]),p=r(d[9]);r(d[10]);function w(n){(0,o.useId)();return(0,f.useIsPreview)(),null}e.LinkMenu=n=>{(0,o.useId)();return(0,f.useIsPreview)(),null}},701,[6,11,699,700,520,702,528,715,695,716,527]); 795__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HrefPreview=function({href:n}){const c=(0,o.useMemo)(()=>_(n),[n]),f=c?.index??0;let p=!1;if(c?.routes[f]?.name===u.INTERNAL_SLOT_NAME){let o=c,s=l.store.state;for(;o&&s;){const t=o.routes[0];if(!1===s.stale&&!s.routeNames?.includes(t.name)){p=!0;break}const n=s.routes.findIndex(o=>o.name===t.name);if(-1===n)break;o=t.state,s=s.routes[n]?.state}if(!p)return(0,t.jsx)(j,{hrefState:c,href:n})}const h=n.toString(),x=h.split('/').filter(Boolean);return(0,t.jsx)(s.PreviewRouteContext.Provider,{value:{params:{},pathname:h,segments:x},children:(0,t.jsx)(S,{})})};const t=r(d[0]),o=r(d[1]),n=r(d[2]),s=r(d[3]),u=r(d[4]),c=r(d[5]),l=r(d[6]),f=r(d[7]),p=r(d[8]),h=r(d[9]),x=r(d[10]),v=r(d[11]),N=r(d[12]);function j({hrefState:n,href:u}){const l=(0,x.useNavigation)(),{routeNode:f,params:p,state:j}=E(n),S=j?(0,N.getPathFromState)(j):void 0,_=(0,o.useMemo)(()=>({params:p,pathname:u.toString(),segments:S?.split('/').filter(Boolean)||[]}),[p,u]);if(!f)return null;const P=(0,v.getQualifiedRouteComponent)(f);return(0,t.jsx)(s.PreviewRouteContext,{value:_,children:(0,t.jsx)(c.CompositionContext,{value:{set:()=>{},unset:()=>{}},children:(0,t.jsx)(h.NavigationContext,{value:T,children:(0,t.jsx)(P,{navigation:l})})})})}function S(){const o=(0,p.usePathname)();return(0,t.jsxs)(n.View,{style:{flex:1,justifyContent:'center',alignItems:'center',gap:8,backgroundColor:'white'},children:[(0,t.jsx)(n.Text,{style:{fontWeight:'600',fontSize:24},children:"Invalid preview"}),(0,t.jsx)(n.Text,{style:{fontWeight:'200',fontSize:14},children:o})]})}function _(t){return l.store.getStateForHref(t)}function E(t){const o=t?.index??0;if(t?.routes[o]&&t.routes[o].name!==u.INTERNAL_SLOT_NAME){const n=t.routes[o].name;n!==u.SITEMAP_ROUTE_NAME&&n!==u.NOT_FOUND_ROUTE_NAME||(console.log(l.store.routeNode),console.log(t));const s=`Expo Router Error: Expected navigation state to begin with one of [${(0,f.getRootStackRouteNames)().join(', ')}] routes`;console.warn(s)}const n=t?.routes[o]?.state;let s=n,c=l.store.routeNode;const p={};for(;s&&c;){const t=s.routes[s.index||s.routes.length-1];Object.assign(p,t.params),s=t.state,c=c.children.find(o=>o.route===t.name)}return{params:p,routeNode:c,state:n}}const T={setParams:()=>{},setOptions:()=>{},addListener:()=>()=>{},removeListener:()=>{},isFocused:()=>!0,canGoBack:()=>!1,dispatch:()=>{},navigate:()=>{},goBack:()=>{},reset:()=>{},push:()=>{},pop:()=>{},popToTop:()=>{},navigateDeprecated:()=>{},preload:()=>{},getId:()=>'',getParent:()=>{},getState:()=>({key:'',index:0,routeNames:[],routes:[],type:'',stale:!1})}},702,[6,11,263,528,534,703,531,590,557,401,707,588,708]); 796__d(function(g,r,i,a,m,e,d){"use strict";
796Object.defineProperty(e,"__esModule",{value:!0}),e.useCompositionOption=e.useCompositionRegistry=e.CompositionContext=e.mergeOptions=void 0;var t=r(d[0]);Object.defineProperty(e,"mergeOptions",{enumerable:!0,get:function(){return t.mergeOptions}});var o=r(d[1]);Object.defineProperty(e,"CompositionContext",{enumerable:!0,get:function(){return o.CompositionContext}}),Object.defineProperty(e,"useCompositionRegistry",{enumerable:!0,get:function(){return o.useCompositionRegistry}}),Object.defineProperty(e,"useCompositionOption",{enumerable:!0,get:function(){return o.useCompositionOption}})},703,[704,705]); 797__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mergeOptions=function(n,o,t){const s={},c=t.routes[t.index]?.key;for(const u in n){const r=n[u],f=o[u];if(!f||0===f.length){s[u]=r;continue}if((t.preloadedRoutes?.some(n=>n.key===u)??!1)&&u!==c){s[u]=r;continue}const p=Object.assign({},r.options,...f),l={...r,options:p};s[u]=l}return s}},704,[]); 798__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CompositionContext=void 0,e.registryReducer=s,e.useCompositionRegistry=function(){const[o,n]=(0,t.useReducer)(s,{}),u=(0,t.useCallback)((t,o)=>{n({type:'set',routeKey:t,options:o})},[]),c=(0,t.useCallback)((t,o)=>{n({type:'unset',routeKey:t,options:o})},[]),p=(0,t.useMemo)(()=>({set:u,unset:c}),[u,c]);return{registry:o,contextValue:p}},e.useCompositionOption=function(s){const u=(0,t.use)(e.CompositionContext);if(!u)throw new Error('useCompositionOption must be used within a RouterCompositionOptionsProvider. This is likely a bug in Expo Router.');const c=(0,o.useRoute)(),{set:p,unset:y}=u;(0,n.useSafeLayoutEffect)(()=>(p(c.key,s),()=>{y(c.key,s)}),[c.key,p,y,s])};const t=r(d[0]),o=r(d[1]),n=r(d[2]);function s(t,o){if('set'===o.type){const{routeKey:n,options:s}=o;return t[n]?.includes(s)?t:{...t,[n]:[...t[n]??[],s]}}if('unset'===o.type){const{routeKey:n,options:s}=o,u=t[n],c=u?.filter(t=>t!==s);if(!u||c?.length===u.length)return t;if(!c?.length){const{[n]:o,...s}=t;return s}return{...t,[n]:c}}return t}e.CompositionContext=(0,t.createContext)(null)},705,[11,401,706]); 799__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useSafeLayoutEffect=void 0;const t=r(d[0]);e.useSafeLayoutEffect='undefined'!=typeof window?t.useLayoutEffect:function(){}},706,[11]); 800__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useNavigation=function(s){let u=(0,o.useNavigation)(),l=(0,o.useStateForPath)();if(void 0===s)return u;const c=u.getId();if(''===c||"/expo-router/build/views/Navigator"===c)return u;'object'==typeof s&&(s=(0,n.resolveHref)(s));if('/'===s)return u.getParent("/expo-router/build/views/Navigator")??u.getParent("");if(s?.startsWith('../')){const n=[];for(;l;){const t=l.routes[0];l=t.state,l&&n.push(t.name)}const o=s;s.endsWith('/')&&(s=s.slice(0,-1));const u=s.split('/');if(!u.every(t=>'..'===t))throw new Error(`Invalid parent path "${o}". Only "../" segments are allowed when using relative paths.`);const c=u.length,v=n.length-1-c;if(v<0)throw new Error(`Invalid parent path "${o}". Cannot go up ${c} levels from the current route.`);(s=n[v])&&!(0,t.getRootStackRouteNames)().includes(s)&&(s=`/${s}`)}return u=u.getParent(s),u};const t=r(d[0]),n=r(d[1]),o=r(d[2])},707,[590,538,401]); 801__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),l=0;l<c.length;l++)"default"!==c[l]&&n(u,o,c[l]);return i(u,o),u});
801Object.defineProperty(e,"__esModule",{value:!0}),e.getPathFromState=e.getStateFromPath=void 0,e.getInitialURL=function(){if('undefined'==typeof window)return'';if('web'===c.Platform.OS&&window.location?.href)return window.location.href;if('ios'===c.Platform.OS){return y(u.getLinkingURL())??b()}return Promise.resolve((0,h.getInitialURLWithTimeout)()).then(t=>y(t)??b())},e.getRootURL=b,e.subscribe=function(t,n){return i=>{let o;const c=t?.legacy_subscribe?.(i);o=m?async({url:o})=>{let u=y(o);u=(0,p.applyRedirects)(u,n),u&&t?.redirectSystemPath&&(u=await t.redirectSystemPath({path:u,initial:!1})),u&&i(u)}:async({url:o})=>{let u=(0,p.applyRedirects)(o,n);u&&t?.redirectSystemPath&&(u=await t.redirectSystemPath({path:u,initial:!1})),u&&i(u)};const l=u.addEventListener('url',o);return()=>{l?.remove?.(),c?.()}}};const u=o(r(d[0])),c=r(d[1]),l=r(d[2]),s=r(d[3]);Object.defineProperty(e,"getPathFromState",{enumerable:!0,get:function(){return s.getPathFromState}});const f=r(d[4]);Object.defineProperty(e,"getStateFromPath",{enumerable:!0,get:function(){return f.getStateFromPath}});const h=r(d[5]),p=r(d[6]),m='undefined'!=typeof expo&&globalThis.expo?.modules?.ExpoGo;let P;function b(){return void 0===P&&(P=u.createURL('/'),m&&(P=(0,l.parsePathFromExpoGoLink)(P))),P}function y(t){if(!t||!m)return t;const{pathname:n,queryString:i}=(0,l.parsePathAndParamsFromExpoGoLink)(t);return n&&'/'!==n?t:b()+i}},708,[550,263,545,709,710,712,549]); 802__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,s,i){void 0===i&&(i=s);var o=Object.getOwnPropertyDescriptor(n,s);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[s]}}),Object.defineProperty(t,i,o)}:function(t,n,s,i){void 0===i&&(i=s),t[i]=n[s]}),s=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},t(n)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var c=t(i),l=0;l<c.length;l++)"default"!==c[l]&&n(o,i,c[l]);return s(o,i),o});Object.defineProperty(e,"__esModule",{value:!0}),e.getPathFromState=function(t,n){return f(t,n).path},e.getPathDataFromState=f,e.appendBaseUrl=function(t,n=""){if(n)return`/${n.replace(/^\/+/,'').replace(/\/$/,'')}${t}`;return t};const o=i(r(d[0])),c=i(r(d[1])),l=r(d[2]),u=t=>{const n=null!=t.index?t.routes[t.index]:t.routes[t.routes.length-1];return n.state?u(n.state):n};let p=[void 0,{}];function f(t,n){if(null==t)throw Error("Got 'undefined' for the navigation state. You must pass a valid state object.");n&&c.validatePathConfig(n),p[0]!==n?.screens&&(p=[n?.screens,n?.screens?v(n.screens):{}]);const s=p[1];
802let i='/',f=t;const h={};for(;f;){let p,m,v='number'==typeof f.index?f.index:0,y=f.routes[v];const b=u(t);let j=s;const O=[];let P=!0;for(;y.name in j&&P;){if(p=j[y.name].pattern,O.push(y.name),y.params){const t=j[y.name]?.stringify,n=c.fixCurrentParams(h,y,t);b===y&&(m={...n},p?.split('/').filter(t=>c.isDynamicPart(t)).forEach(t=>{const n=c.getParamName(t);m&&delete m[n]}))}if(j[y.name].screens&&void 0!==y.state){v=null!=y.state.index?y.state.index:y.state.routes.length-1;const t=y.state.routes[v],n=j[y.name].screens;n&&t.name in n?(y=t,j=n):P=!1}else{const t=j[y.name].screens,n=y.params&&'screen'in y.params&&'string'==typeof y.params.screen?y.params.screen:'index',s=t?t[n]?n:Object.keys(t)[0]:void 0;if(s&&t&&j[y.name].screens?.[s]){const n=y.params?.params;y={...t[s],name:s,key:s,params:n},j=t}else P=!1}}if(void 0===p&&(p=O.join('/')),void 0!==j[y.name]?i+=c.getPathWithConventionsCollapsed({...n,pattern:p,route:y,params:h,initialRouteName:s[y.name]?.initialRouteName}):y.name.startsWith('+')||(i+=encodeURIComponent(y.name)),m||(m=b.params?{...b.params}:void 0),y.state)i+='/';else if(m){for(const t in m)'undefined'===m[t]&&delete m[t];delete m['#'],m=(0,l.removeInternalExpoRouterParams)(m);const t=o.stringify(m,{sort:!1});t&&(i+=`?${t}`)}f=y.state}return i=i.replace(/\/+/g,'/'),i=i.length>1?i.replace(/\/$/,''):i,n?.path&&(i=m(n.path,i)),i=c.appendBaseUrl(i),h['#']&&(i+=`#${h['#']}`),{path:i,params:h}}const m=(...t)=>[].concat(...t.map(t=>t.split('/'))).filter(Boolean).join('/'),h=(t,n)=>{if('string'==typeof t){return{pattern:n?m(n,t):t}}if(t.exact&&void 0===t.path)throw new Error("A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. `path: ''`.");const s=!0!==t.exact?m(n||'',t.path||''):t.path||'',i=t.screens?v(t.screens,s):void 0;return{pattern:s?.split('/').filter(Boolean).join('/'),stringify:t.stringify,screens:i}},v=(t,n)=>Object.fromEntries(Object.entries(t).map(([t,s])=>[t,h(s,n)]))},709,[444,535,573]); 803__d(function(g,r,_i,_a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,a,o){void 0===o&&(o=a);var s=Object.getOwnPropertyDescriptor(n,a);s&&!("get"in s?!n.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return n[a]}}),Object.defineProperty(t,o,s)}:function(t,n,a,o){void 0===o&&(o=a),t[o]=n[a]}),a=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(n[n.length]=a);return n},t(n)},function(o){if(o&&o.__esModule)return o;var s={};if(null!=o)for(var i=t(o),c=0;c<i.length;c++)"default"!==i[c]&&n(s,o,i[c]);return a(s,o),s}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.getStateFromPath=function(t,n,a=[]){const{initialRoutes:o,configs:s,configWithRegexes:i}=h(n,a),c=n?.screens,p=u.getUrlWithReactNavigationConcessions(t);let l=u.cleanPath(p.nonstandardPathname);const f=n?.path?.replace(/^\//,'');if(f){const t=f.endsWith('/')?f:`${f}/`;if(!l.startsWith(t))return;l=l.replace(t,'')}if(void 0===c){const t=l.split('/').filter(Boolean).map(t=>({name:decodeURIComponent(t)}));return t.length?E(p,t,o,[],p.hash):void 0}if('/'===l){const t=u.matchForEmptyPath(i);return t?E(p,t.routeNames.map(t=>({name:t})),o,s,p.hash):void 0}let m,b;const{routes:v,remainingPath:P}=R(l,i);void 0!==v&&(b=E(p,v,o,s,p.hash),l=P,m=b);if(null==b||null==m)return;return m};const i=s(r(d[0])),c=r(d[1]),u=o(r(d[2])),p=r(d[3]),l=r(d[4]);let f=[void 0,m()];function h(t,n){return f=[t,m(t,n)],f[1]}function m(t,n){t&&(0,l.validatePathConfig)(t);const a=b(t),o=v(a,t?.screens,n);P(o);return{initialRoutes:a,configs:o,configWithRegexes:y(o)}}function b(t){const n=[];return t?.initialRouteName&&n.push({initialRouteName:t.initialRouteName,parentScreens:[]}),n}function v(t,n={},a){return[].concat(...Object.keys(n).map(a=>N(a,n,[],t,[]))).map(u.appendIsInitial(t)).sort(u.getRouteConfigSorter(a))}function P(t){t.reduce((t,n)=>{if(t[n.pattern]){const a=t[n.pattern].routeNames,o=n.routeNames;if(!(a.length>o.length?o.every((t,n)=>a[n]===t):a.every((t,n)=>
803o[n]===t)))throw new Error(`Found conflicting screens with the same pattern. The pattern '${n.pattern}' resolves to both '${a.join(' > ')}' and '${o.join(' > ')}'. Patterns must be unique and cannot resolve to more than one screen.`)}return Object.assign(t,{[n.pattern]:n})},{})}function y(t){return t.map(t=>({...t,regex:u.configRegExp(t)}))}const j=(...t)=>[].concat(...t.map(t=>t.split('/'))).filter(Boolean).join('/'),R=(t,n)=>{let a,o=t;const s=Object.create(null);for(const t of n){if(!t.regex)continue;const c=o.match(t.regex);if(c){const p=t.pattern?.split('/').reduce((t,n,a)=>{if(!u.isDynamicPart(n))return t;t.pos+=1;const o=u.safelyDecodeURIComponent(c[2*(t.pos+1)].replace(/\/$/,''));return Object.assign(t.matchedParams,{[n]:Object.assign(t.matchedParams[n]||{},{[a]:o})}),t},{pos:-1,matchedParams:{}}),l=p.matchedParams||{};a=t.routeNames.map(a=>{const o=n.find(n=>n.screen===a&&t.pattern.startsWith(n.pattern)),c=o?.path.split('/').filter(Boolean).join('/'),p=o?.pattern.replace(new RegExp(`${(0,i.default)(c)}$`),'')?.split('/').length,f=c?.split('/').reduce((t,n,a)=>{if(!u.isDynamicPart(n))return t;const s=p?p-1:0,i=u.getParamValue(n,l[n]?.[a+s]);if(i){const a=u.replacePart(n);t[a]=o?.parse?.[a]?o.parse[a](i):i}return t},{});return f&&Object.keys(f).length?(Object.assign(s,f),{name:a,params:f}):{name:a}}),o=o.replace(c[1],'');break}}return u.populateParams(a,s),{routes:a,remainingPath:o}},N=(t,n,a=[],o,s,i)=>{const c=[];a.push(t),s.push(t);const u=n[t];if('string'==typeof u){const n=i?j(i,u):u;c.push(O(t,a,n,u))}else if('object'==typeof u){let n;if('string'==typeof u.path){if(u.exact&&void 0===u.path)throw new Error("A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. `path: ''`.");n=!0!==u.exact?j(i||'',u.path||''):u.path||'',t!==p.INTERNAL_SLOT_NAME&&c.push(O(t,a,n,u.path,u.parse,u))}u.screens&&(u.initialRouteName&&o.push({initialRouteName:u.initialRouteName,parentScreens:s}),Object.keys(u.screens).forEach(t=>{const p=N(t,u.screens,a,o,[...s],n??i);c.push(...p)}))}return a.pop(),c},O=(t,n,a,o,s=void 0,i={})=>({screen:t,regex:(a=a.split('/').filter(Boolean).join('/'))?u.routePatternToRegex(a):void 0,pattern:a,path:o,routeNames:[...n],parse:s,...u.createConfig(t,a,n,i)}),_=(t,n)=>{for(const a of n)if(t===a.routeNames[a.routeNames.length-1])return a.parse},x=(t,n,a)=>{for(const o of a)if(n.length===o.parentScreens.length){let a=!0;for(let t=0;t<n.length;t++)if(0!==n[t].localeCompare(o.parentScreens[t])){a=!1;break}if(a)return t!==o.initialRouteName?o.initialRouteName:void 0}},w=(t,n,a)=>a?t?{index:1,routes:[{name:t,params:n.params},n]}:{routes:[n]}:t?{index:1,routes:[{name:t,params:n.params},{...n,state:{routes:[]}}]}:{routes:[{...n,state:{routes:[]}}]},E=({path:t,...n},a,o,s,i)=>{let p=a.shift();const l=[];let f=x(p.name,l,o);l.push(p.name);const h=w(f,p,0===a.length);if(a.length>0){let t=h;for(;p=a.shift();){f=x(p.name,l,o);const n=t.index||t.routes.length-1;t.routes[n].state=w(f,p,0===a.length),a.length>0&&(t=t.routes[n].state),l.push(p.name)}}p=(0,c.findFocusedRoute)(h),p.path=n.pathWithoutGroups;const m=u.parseQueryParams(t,p,s?_(p.name,s):void 0,i);return m&&(p.params={...p.params,...m}),h}},710,[452,711,546,534,401]); 804__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findFocusedRoute=function(t){let n=t;for(;null!=n?.routes[n.index??0]?.state;)n=n.routes[n.index??0].state;const u=n?.routes[n?.index??0];return u}},711,[]); 805__d(function(g,_r,i,_a,m,_e,d){"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};
805Object.defineProperty(_e,"__esModule",{value:!0}),_e.series=void 0,_e.useLinking=function(e,{enabled:f=!0,config:l,getStateFromPath:p=a.getStateFromPath,getPathFromState:y=a.getPathFromState,getActionFromState:v=a.getActionFromState},R){const w=(0,a.useNavigationIndependentTree)(),S=(0,u.useExpoRouterStore)();(0,r.useEffect)(()=>{},[f,w]);const[k]=(0,r.useState)(n.createMemoryHistory),F=(0,r.useRef)(f),x=(0,r.useRef)(l),_=(0,r.useRef)(p),P=(0,r.useRef)(y),b=(0,r.useRef)(v);(0,r.useEffect)(()=>{F.current=f,x.current=l,_.current=p,P.current=y,b.current=v});const E=(0,r.useCallback)(e=>{const t=(0,c.getRootStackRouteNames)();return e?.routes.some(e=>!t.includes(e.name))},[e]),I=(0,r.use)(s.ServerContext),$=(0,r.useCallback)(()=>{let e;if(F.current){const t=I?.location??('undefined'!=typeof window?window.location:void 0),r=t?t.pathname+t.search+(t.hash??''):void 0;r&&(e=_.current(r,x.current)),R(r)}const t={then:t=>Promise.resolve(t?t(e):e),catch:()=>t};return t},[]),A=(0,r.useRef)(void 0),C=(0,r.useRef)(void 0),L=(0,r.useRef)(void 0);return(0,r.useEffect)(()=>(A.current=k.index,k.listen(()=>{const t=e.current;if(!t||!f)return;const{location:r}=window,n=r.pathname+r.search+r.hash,o=k.index,s=A.current??0;A.current=o,L.current=n;const u=k.get(o);if(u?.path===n&&u?.state)return void t.resetRoot(u.state);const c=_.current(n,x.current);if(c){if(R(n),E(c))return;if(o>s||o===s&&(!u||`${u?.path}${r.hash}`===n)){const e=b.current(c,x.current);if(void 0!==e)try{t.dispatch(e)}catch(e){console.warn(`An error occurred when trying to handle the link '${n}': ${'object'==typeof e&&null!=e&&'message'in e?e.message:e}`)}else t.resetRoot(c)}else t.resetRoot(c)}else t.resetRoot(c)})),[f,k,R,e,E]),(0,r.useEffect)(()=>{if(!f)return;const r=(e,r)=>{let n;if(e?.path){const r=_.current(e.path,x.current);if(r){const s=(0,a.findFocusedRoute)(r);s&&s.name===e.name&&(0,t.default)({...s.params},{...e.params})&&(n=(0,o.appendBaseUrl)(e.path))}}return null==n&&(n=P.current(r,x.current)),n};if(e.current){const t=e.current.getRootState(),n=S.state;if(n){const e=(0,a.findFocusedRoute)(n),o=r(e,n);void 0===C.current&&(C.current=t),k.replace({path:o,state:n})}}return e.current?.addListener('state',(0,_e.series)(async()=>{const t=e.current;if(!t||!f)return;const n=C.current,o=t.getRootState(),s=S.state;if(!s)return;const u=L.current,c=(0,a.findFocusedRoute)(s),l=r(c,s);C.current=o,L.current=void 0;const[p,y]=h(n,s);if(p&&y&&l!==u){const e=(y.history?y.history.length:y.routes.length)-(p.history?p.history.length:p.routes.length);if(e>0)k.push({path:l,state:s});else if(e<0){const t=k.backIndex({path:l}),r=k.index;try{-1!==t&&t<r&&k.get(t-r)?await k.go(t-r):await k.go(e),k.replace({path:l,state:s})}catch{}}else k.replace({path:l,state:s})}else k.replace({path:l,state:s})}))},[f,k,e]),{getInitialState:$}},_e.getInitialURLWithTimeout=function(){return'undefined'==typeof window?'':window.location.href};const t=e(_r(d[0])),r=_r(d[1]),n=_r(d[2]),o=_r(d[3]),s=_r(d[4]),u=_r(d[5]),c=_r(d[6]),a=_r(d[7]),h=(e,t)=>{if(void 0===e||void 0===t||e.key!==t.key)return[void 0,void 0];const r=e.history?e.history.length:e.routes.length,n=t.history?t.history.length:t.routes.length,o=e.routes[e.index],s=t.routes[t.index],u=o.state,c=s.state;return r!==n||o.key!==s.key||void 0===u||void 0===c||u.key!==c.key?[e,t]:h(u,c)};_e.series=e=>{let t=Promise.resolve();return()=>{t=t.then(e)}}},712,[472,11,713,709,714,589,590,401]); 806__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createMemoryHistory=function(){let n=0,i=[];const o=[],s=()=>{o.forEach(t=>{const n=t.cb;t.cb=()=>n(!0)})};return{get index(){const t=window.history.state?.id;if(t){const n=i.findIndex(n=>n.id===t);return n>-1?n:0}return 0},get:t=>i[t],backIndex({path:t}){for(let o=n-1;o>=0;o--){if(i[o].path===t)return o}return-1},push({path:o,state:c}){s();const w=(0,t.nanoid)();i=i.slice(0,n+1),i.push({path:o,state:c,id:w}),n=i.length-1,window.history.pushState({id:w},'',o)},replace({path:o,state:c}){s();const w=window.history.state?.id??(0,t.nanoid)();let h=o;const p=h.includes('#')?'':location.hash;!i.length||i.findIndex(t=>t.id===w)<0?(h+=p,i=[{path:h,state:c,id:w}],n=0):(i[n].path===o&&(h+=p),i[n]={path:o,state:c,id:w}),window.history.replaceState({id:w},'',h)},go(t){s();const c=n+t,w=i.length-1;if(t<0&&!i[c]?(t=-n,n=0):t>0&&c>w?(t=w-n,n=w):n=c,0!==t)return new Promise((s,c)=>{const w=t=>{if(clearTimeout(h),t)return void c(new Error('History was changed during navigation.'));const{title:n}=window.document;window.document.title='',window.document.title=n,s()};o.push({ref:w,cb:w});const h=setTimeout(()=>{const t=o.findIndex(t=>t.ref===w);t>
806-1&&(o[t].cb(),o.splice(t,1))},100),p=()=>{const t=window.history.state?.id,s=i.findIndex(n=>n.id===t);n=Math.max(s,0);const c=o.pop();window.removeEventListener('popstate',p),c?.cb()};window.addEventListener('popstate',p),window.history.go(t)})},listen(t){const n=()=>{o.length||t()};return window.addEventListener('popstate',n),()=>window.removeEventListener('popstate',n)}}};const t=r(d[0])},713,[260]); 807__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ServerContext=void 0;const t=r(d[0]);e.ServerContext=(0,t.createContext)(void 0)},714,[11]); 808__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeLinkPreviewAction=function(n){return null},e.NativeLinkPreview=function(n){return null},e.NativeLinkPreviewContent=function(n){return null},e.LinkZoomTransitionEnabler=function(n){return null},e.LinkZoomTransitionSource=function(n){return null},e.LinkZoomTransitionAlignmentRectDetector=function(t){if(!o)return null;return(0,n.jsx)(o,{...t,disableForceFlatten:!0,collapsable:!1,collapsableChildren:!1,style:{display:'contents'}})};const n=r(d[0]),t=(r(d[1]),r(d[2]));r(d[3]);const o=t.Fragment},715,[6,208,11,263]); 809__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinkAppleZoom=function(o){if(!(0,t.isZoomTransitionEnabled)())return(0,n.jsx)(s.Slot,{...o});return(0,n.jsx)(l,{...o})};const n=r(d[0]),o=r(d[1]),t=r(d[2]),c=r(d[3]),s=r(d[4]),u=r(d[5]);function l({children:t,alignmentRect:l,...f}){const h=(0,o.use)(c.ZoomTransitionSourceContext);if(!h)throw new Error('[expo-router] Link.ZoomTransitionSource must be used within a Link');const{identifier:S,addSource:x,removeSource:j}=h;(0,o.useEffect)(()=>(x(),j),[x,j]);const p=o.Children.count(t)>1;return(0,o.useEffect)(()=>{},[p]),p?null:(0,n.jsx)(u.LinkZoomTransitionSource,{identifier:S,alignment:l,animateAspectRatioChange:!0,children:(0,n.jsx)(s.Slot,{...f,children:t})})}},716,[6,11,593,717,695,715]); 810__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZoomTransitionTargetContext=e.ZoomTransitionSourceContext=void 0;const t=r(d[0]);e.ZoomTransitionSourceContext=(0,t.createContext)(void 0),e.ZoomTransitionTargetContext=(0,t.createContext)({identifier:null,dismissalBoundsRect:null,setDismissalBoundsRect:()=>{},addEnabler:()=>{},removeEnabler:()=>{},hasEnabler:!1})},717,[11]); 811__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useLinkPreviewContext=void 0,e.LinkPreviewContextProvider=function({children:s}){const[u,v]=(0,n.useState)(void 0),c=void 0!==u;return(0,t.jsx)(o.Provider,{value:{isStackAnimationDisabled:c,openPreviewKey:u,setOpenPreviewKey:v},children:s})};const t=r(d[0]),n=r(d[1]),o=(0,n.createContext)(void 0);e.useLinkPreviewContext=()=>{const t=(0,n.use)(o);if(null==t)throw new Error('useLinkPreviewContext must be used within a LinkPreviewContextProvider. This is likely a bug in Expo Router.');return t}},718,[6,11]); 812__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useNextScreenId=function(){const c=(0,s.useRouter)(),{setOpenPreviewKey:f}=(0,n.useLinkPreviewContext)(),[v,l]=(0,t.useState)(),P=(0,t.useRef)(void 0),[R,S]=(0,t.useState)([]);(0,t.useEffect)(()=>u.store.navigationRef.addListener('state',({data:{state:t}})=>{if(P.current&&t){const n=(0,o.getPreloadedRouteFromRootStateByHref)(P.current,t),u=n?.key,s=(0,o.getTabPathFromRootStateByHref)(P.current,t);(u||s.length)&&setTimeout(()=>{l(u),f(u),S(s)}),P.current=void 0}}),[]);const h=(0,t.useCallback)(t=>{l(void 0),c.prefetch(t),P.current=t},[c.prefetch]);return[{nextScreenId:v,tabPath:R},h]};const t=r(d[0]),n=r(d[1]),o=r(d[2]),u=r(d[3]),s=r(d[4])},719,[11,718,720,531,557]); 813__d(function(g,r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getTabPathFromRootStateByHref=function(o,s){const u=t.store.getStateForHref((0,a.resolveHref)(o)),i=s;if(!u||!i)return[];const{navigationRoutes:f}=(0,n.findDivergentState)(u,i,!0);if(!f.length)return[];const c=[];return f.forEach((t,n,o)=>
813{if('tab'===t.state?.type){const a=t.state,s=a.routes[a.index].key;if(!o[n+1])throw new Error(`New tab route is missing for ${t.key}. This is likely an internal Expo Router bug.`);const u=o[n+1].key;c.push({oldTabKey:s,newTabKey:u})}}),c},e.getPreloadedRouteFromRootStateByHref=function(u,i){const f=t.store.getStateForHref((0,a.resolveHref)(u)),c=i;if(!f||!c)return;const{navigationState:l,actionStateRoute:p}=(0,n.findDivergentState)(f,c,!0);if(!l||!p)return;if('stack'===l.type){const t=l,a=(0,n.getPayloadFromStateRoute)(p),u=t.preloadedRoutes.find(t=>t.name===p.name&&s((0,o.removeInternalExpoRouterParams)(t.params),(0,o.removeInternalExpoRouterParams)(a.params))),i=t.routes[t.index];if(i.name===u?.name&&s((0,o.removeInternalExpoRouterParams)(i.params??{}),(0,o.removeInternalExpoRouterParams)(a.params??{})))return;return u}return},e.deepEqual=s;const t=r(d[0]),n=r(d[1]),o=r(d[2]),a=r(d[3]);function s(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if('object'!=typeof t||'object'!=typeof n)return!1;const o=Object.keys(t);return o.length===Object.keys(n).length&&o.every(o=>s(t[o],n[o]))}},720,[531,576,573,538]); 814__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useZoomHref=function({href:t}){return t}},721,[]); 815__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinkAppleZoomTarget=function({children:l}){if(t.Children.count(l)>1)return console.warn('[expo-router] Link.AppleZoomTarget only accepts a single child component. Please wrap multiple children in a View or another container component.'),null;const{identifier:s}=(0,t.use)(o.ZoomTransitionTargetContext);if(!s)return l;return(0,n.jsx)(c.LinkZoomTransitionAlignmentRectDetector,{identifier:s,children:l})};const n=r(d[0]),t=r(d[1]),o=r(d[2]),c=r(d[3])},722,[6,11,717,715]); 816__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Redirect=function({href:n,relativeToDirectory:u,withAnchor:s}){const l=(0,t.useRouter)(),f=(0,o.useIsPreview)();return(0,c.useFocusEffect)(()=>{if(!f)try{l.replace(n,{relativeToDirectory:u,withAnchor:s})}catch(t){console.error(t)}}),null};const t=r(d[0]),c=r(d[1]),o=r(d[2])},723,[557,529,528]); 817__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extrapolateGroups=e.generateDynamic=void 0,e.getRoutes=n,e.getExactRoutes=function(t,o={}){return n(t,{...o,skipGenerated:!0})};const t=r(d[0]);function n(n,o={}){return(0,t.getRoutes)(n,{getSystemRoute({route:t,type:o,defaults:u,redirectConfig:l,rewriteConfig:c}){if(''===t&&'layout'===o)return{type:'layout',loadRoute:()=>({default:r(d[1]).DefaultNavigator}),contextKey:'expo-router/build/views/Navigator.js',route:'',generated:!0,dynamic:null,children:[]};if('_sitemap'===t&&'route'===o)return{loadRoute(){const{Sitemap:t,getNavOptions:n}=r(d[2]);return{default:t,getNavOptions:n}},route:'_sitemap',type:'route',contextKey:'expo-router/build/views/Sitemap.js',generated:!0,internal:!0,dynamic:null,children:[]};if('+not-found'===t&&'route'===o)return{loadRoute:()=>({default:r(d[3]).Unmatched}),type:'route',route:'+not-found',contextKey:'expo-router/build/views/Unmatched.js',generated:!0,internal:!0,dynamic:[{name:'+not-found',deep:!0,notFound:!0}],children:[]};if('redirect'===o&&l&&u)return{...u,loadRoute:()=>r(d[4]).getRedirectModule(l)};if('rewrite'===o&&c&&u)return{...u,loadRoute:()=>({default:n(c.destinationContextKey).default})};throw new Error(`Unknown system route: ${t} and type: ${o} and redirectConfig: ${l} and rewriteConfig: ${c}`)},...o})}var o=r(d[0]);Object.defineProperty(e,"generateDynamic",{enumerable:!0,get:function(){return o.generateDynamic}}),Object.defineProperty(e,"extrapolateGroups",{enumerable:!0,get:function(){return o.extrapolateGroups}})},724,[725,255,726,735,549]); 818__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRoutes=function(t,o){const n=s(t,o),l=u(t,o);if(!l)return null;const c=p(l,o);o.importMode;n&&(c.middleware=n);o.ignoreEntryPoints||$(c,o);return c},e.extrapolateGroups=y,e.generateDynamic=w;const t=r(d[0]),o=r(d[1]),n=new Set(['android','ios','native','web']);function s(t,o){const n=t.keys().filter(t=>t.includes('+middleware'));if(!o.unstable_useServerMiddleware)return n.length>0&&console.warn('Server middleware is not enabled. Add unstable_useServerMiddleware: true to your `expo-router` plugin config.\n\n'+JSON.stringify({expo:{plugins:[['expo-router',{unstable_useServerMiddleware:!0}]]}},null,2)),null;const s=n.filter(t=>/^\.\/\+middleware\.[tj]sx?$/.test(t)),u=n.filter(t=>!s.includes(t));if(u.length>0)throw new Error(`The middleware file can only be placed at the root level. Remove the following files: ${u.join(', ')}`);
818if(0===s.length)return null;s.length;const l=s[0],c={loadRoute(){if(!o.ignoreRequireErrors)return t(l);try{return t(l)}catch{return{}}},contextKey:l};return o.internal_stripLoadRoute&&delete c.loadRoute,c}function u(n,s){const u=s.importMode||"sync",p=[/^\.\/\+(html|native-intent)\.[tj]sx?$/];s.ignore&&p.push(...s.ignore),s.preserveApiRoutes||p.push(/\+api$/,/\+api\.[tj]sx?$/),p.push(/\+middleware$/,/\+middleware\.[tj]sx?$/);const w={files:new Map,subdirectories:new Map};let $=!1,b=!1;const _=n.keys(),S={},E={};let K;const L=()=>(K??=_.map(o=>({contextKey:o,nameWithoutInvisible:c((0,t.removeSupportedExtensions)(o))})),K);if(s.preserveRedirectAndRewrites){if(s.redirects)for(const t of s.redirects){const n=f(t.source),u=l(t.source),h=(0,o.shouldLinkExternally)(t.destination),y=h?t.destination:c(t.destination);if(p.some(t=>t.test(n)))continue;const w=h?void 0:L().find(t=>t.nameWithoutInvisible===y),x=h?y:w?.nameWithoutInvisible,R=h?y:w?.contextKey;if(R&&void 0!==x)_.push(n),S[u]={source:u,destination:x,destinationContextKey:R,permanent:Boolean(t.permanent),external:h,methods:t.methods};else if(s.preserveApiRoutes)throw new Error(`Redirect destination "${t.destination}" does not exist.`)}if(s.rewrites)for(const t of s.rewrites){const o=f(t.source),n=l(t.source),u=_.includes(o)?l(t.destination):c(t.destination);if(p.some(t=>t.test(o)))continue;const h=L().find(t=>t.nameWithoutInvisible===u),y=h?.nameWithoutInvisible,w=h?.contextKey;if(w&&void 0!==y)_.push(o),E[n]={source:n,destination:y,destinationContextKey:w,methods:t.methods};else if(s.preserveApiRoutes)throw new Error(`Rewrite destination "${t.destination}" does not exist.`)}}const N=new Set;for(const t of _){if(p.some(o=>o.test(t)))continue;b=!0;const o=h(t,s,S,E);if(o.specificity<0)continue;let l={type:o.isApi?'api':o.isLayout?'layout':'route',loadRoute(){let o;if(s.ignoreRequireErrors)try{o=n(t)}catch{o={}}else o=n(t);return'lazy'!==u&&'lazy-once'!==u||(o='_result'in o&&null!=o._result?o._result:o),o},contextKey:t,route:'',dynamic:null,children:[]};if(o.isRedirect){if(N.has(o.route))continue;const t=S[o.route];l.destinationContextKey=t.destinationContextKey,l.permanent=t.permanent,l.generated=!0,'route'===l.type&&(l=s.getSystemRoute({type:'redirect',route:t.destination,defaults:l,redirectConfig:t})),t.methods&&(l.methods=t.methods),l.type='redirect',N.add(o.route)}if(o.isRewrite){if(N.has(o.route))continue;const t=E[o.route];l.destinationContextKey=t.destinationContextKey,l.generated=!0,'route'===l.type&&(l=s.getSystemRoute({type:'rewrite',route:t.destination,defaults:l,rewriteConfig:t})),t.methods&&(l.methods=t.methods),l.type='rewrite',N.add(o.route)}for(const t of y(o.route)){const n=t.split('/').slice(0,-1);let u=w;for(const t of n){let o=u.subdirectories.get(t);o||(o={files:new Map,subdirectories:new Map},u.subdirectories.set(t,o)),u=o}if(l={...l,route:t},o.isLayout){u.layout??=[];u.layout[o.specificity]||(l=v(l,s),u.layout[o.specificity]=l)}else if(o.isApi){const o=`${t}+api`;let n=u.files.get(o);n||(n=[],u.files.set(o,n));n[0]||(n[0]=l)}else{let n=u.files.get(t);n||(n=[],u.files.set(t,n));n[o.specificity]||($||=!0,n[o.specificity]=l)}}}return b?(w.layout||(w.layout=[s.getSystemRoute({type:'layout',route:''})]),s.skipGenerated||($&&!1!==s.sitemap&&x(w,s),!1!==s.notFound&&R(w,s)),w):null}function l(o){return(0,t.removeFileSystemExtensions)((0,t.removeFileSystemDots)(o)).replace(/^\//,'')}function c(o){return(0,t.stripInvisibleSegmentsFromPath)(l(o))}function f(t){const o=l(t);return`./${o}${/\.[tj]sx?$/.test(o)?'':'.js'}`}function p(t,o,n,s=""){if(t.layout){const u=n;n=b(t.layout),u&&u.children.push(n),o.internal_stripLoadRoute&&delete n.loadRoute;const l=n.route.replace(s,'');s=n.route?`${n.route}/`:'',n.route=l,n.dynamic=w(n.contextKey.slice(0))}if(!n)throw new Error('Expo Router Internal Error: No nearest layout');for(const u of t.files.values()){const t=b(u);t.route=t.route.replace(s,''),t.dynamic=w(t.route),o.internal_stripLoadRoute&&delete t.loadRoute,n.children.push(t)}for(const u of t.subdirectories.values())p(u,o,n,s);return n}function h(o,s,u,l){const c=(0,t.removeSupportedExtensions)((0,t.removeFileSystemDots)(o));let f=c;const p=(0,t.removeFileSystemDots)(o).split('/'),h=p[p.length-1],y=(0,t.removeSupportedExtensions)(h).split('.'),w=y[0],x=y[1],R='_layout'===w,v=o.match(/\+api\.(\w+\.)?[jt]sx?$/);if(w.startsWith('(')&&w.endsWith(')'))throw new Error(`Invalid route ${o}. Routes cannot end with '(group)' syntax`);if(!v&&h.startsWith('+')&&'+not-found'!==w){const t=[...p.slice(0,-1),h.slice(1)].join('/');throw new Error(`Invalid route ${o}. Route nodes cannot start with the '+' character. "Rename it to ${t}"`)}let $=0;const b=n.has(x),_=s.platformRoutes??!0;if(b){if(_&&s.platform?x===s.platform?$=2:'native'===x&&'web'!==s.platform?$=1:x!==s.platform&&($=-1):$=-1,v&&0!==$)throw new Error(`API routes cannot have platform extensions. Remove '.${x}' from '${o}'`);f=f.replace(new RegExp(`.${x}$`),'')}return{route:f,specificity:$,isLayout:R,isApi:v,isRedirect:c in u,isRewrite:c in l}}function y(o,n=new Set){const s=(0,t.matchArrayGroupName)(o);if(!s)return n.add(o),n;const u=s.split(',');if(new Set(u).size!==u.length)throw new Error(`Array syntax cannot contain duplicate group name "${u}" in "${o}".`);if(1===u.length)return n.add(o),n;for(const t of u)y(o.replace(s,t.trim()),n);return n}function w(o){const n=o.split('/').map(o=>'+not-found'===o?{name:'+not-found',deep:!0,notFound:!0}:(0,t.matchDynamicName)(o)??null).filter(t=>!!t);return 0===n.length?null:n}function x(t,o){!t.files.has('_sitemap')&&o.getSystemRoute&&t.files.set('_sitemap',[o.getSystemRoute({type:'route',route:'_sitemap'})])}function R(t,o){!t.files.has('+not-found')&&o.getSystemRoute&&t.files.set('+not-found',[o.getSystemRoute({type:'route',route:'+not-found'})])}function v(o,n){const s=(0,t.matchLastGroupName)(o.route),u=o.children.find(t=>t.route.replace(/\/index$/,'')===s);let l=u?.route;const c=o.loadRoute();if(c?.unstable_settings){try{l=c.unstable_settings.anchor??c.unstable_settings.initialRouteName??l}catch(t){if(t instanceof Error&&!t.message.match(/You cannot dot into a client module/))throw t}if(s){l=c.unstable_settings?.[s]?.anchor??c.unstable_settings?.[s]?.initialRouteName??l}}return{...o,route:o.route.replace(/\/?_layout$/,''),children:[],initialRouteName:l}}function $(o,n,s=[]){if('route'===o.type)o.entryPoints=[...new Set([...s,o.contextKey])];else if('redirect'===o.type)o.entryPoints=[...new Set([...s,o.destinationContextKey])];else if('layout'===o.type){if(!o.children)throw new Error(`Layout "${o.contextKey}" does not contain any child routes`);s=[...s,o.contextKey];const u=(0,t.matchGroupName)(o.route),l=o.children.find(t=>t.route.replace(/\/index$/,'')===u);let c=l?.route;if(!n.internal_stripLoadRoute){const t=o.loadRoute();if(t?.unstable_settings){try{c=t.unstable_settings.anchor??t.unstable_settings.initialRouteName??c}catch(t){if(t instanceof Error&&!t.message.match(/You cannot dot into a client module/))throw t}if(u){const o=t.unstable_settings?.[u]?.anchor??t.unstable_settings?.[u]?.initialRouteName;c=o??c}}}if(c){const t=o.children.find(t=>t.route===c);if(!t){const t=o.children.filter(t=>!t.generated).map(t=>`'${t.route}'`).join(', ');throw u?new Error(`Layout ${o.contextKey}
818 has invalid anchor '${c}' for group '(${u})'. Valid options are: ${t}`):new Error(`Layout ${o.contextKey} has invalid anchor '${c}'. Valid options are: ${t}`)}o.initialRouteName=c,s.push(t.contextKey)}for(const t of o.children)$(t,n,s)}}function b(t){const o=t[t.length-1];if(!t[0])throw new Error(`The file ${o.contextKey} does not have a fallback sibling file without a platform extension.`);return o}},725,[257,536]); 819__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Sitemap=void 0,e.getNavOptions=function(){return{title:'sitemap',presentation:'modal',headerLargeTitle:!1,headerTitleStyle:{color:'white'},headerShown:!0,headerTintColor:'white',headerLargeTitleStyle:{color:'white'},headerStyle:{backgroundColor:'black',borderBottomColor:'#323232'},header:()=>{const t='android'===s.Platform.OS?c.SafeAreaView:s.View;return(0,n.jsx)(t,{style:D.header,children:(0,n.jsxs)(s.View,{style:D.headerContent,children:[(0,n.jsx)(s.View,{style:D.headerIcon,children:(0,n.jsx)(V,{})}),(0,n.jsx)(s.Text,{role:"heading","aria-level":1,style:D.title,children:"Sitemap"})]})})}}};const n=r(d[0]),o=t(r(d[1])),l=t(r(d[2])),s=r(d[3]),c=r(d[4]),u=r(d[5]),h=r(d[6]),f=r(d[7]),x=r(d[8]);function y(){const t=(0,f.useSitemap)(),o=l.default.useMemo(()=>t?.children.filter(({isInternal:t})=>!t)??[],[t]),u='android'===s.Platform.OS?c.SafeAreaView:s.View;return(0,n.jsx)(u,{style:D.container,testID:"expo-router-sitemap",children:(0,n.jsxs)(s.ScrollView,{contentContainerStyle:D.scroll,automaticallyAdjustContentInsets:!0,contentInsetAdjustmentBehavior:"automatic",children:[o.map(t=>(0,n.jsx)(s.View,{testID:"sitemap-item-container",style:D.itemContainer,children:(0,n.jsx)(p,{node:t})},t.contextKey)),(0,n.jsx)(k,{})]})})}function p({node:t,level:o=0}){const s=l.default.useMemo(()=>t.children.length>0||t.contextKey.match(/_layout\.[jt]sx?$/),[t]),c=t.isInitial?'Initial':t.isGenerated?'Generated':'';return s?(0,n.jsx)(j,{node:t,level:o,info:c}):(0,n.jsx)(I,{node:t,level:o,info:c})}function j({node:t,level:o,info:c}){const[u,h]=l.default.useState(!0);return(0,n.jsxs)(s.View,{style:D.itemInnerContainer,children:[(0,n.jsx)(b,{style:{opacity:.4},leftIcon:(0,n.jsx)(C,{}),rightIcon:(0,n.jsx)(v,{rotation:u?0:180}),filename:t.filename,level:o,info:c,onPress:()=>h(t=>!t)}),!u&&t.children.map(l=>(0,n.jsx)(p,{node:l,level:o+(t.isGenerated?0:1)},l.contextKey))]})}function I({node:t,info:o,level:l}){return(0,n.jsx)(x.Link,{accessibilityLabel:t.contextKey,href:t.href,asChild:!0,replace:!0,children:(0,n.jsx)(b,{leftIcon:(0,n.jsx)(w,{}),rightIcon:(0,n.jsx)(S,{}),filename:t.filename,level:l,info:o})})}function b({style:t,leftIcon:o,rightIcon:l,filename:c,level:u,info:f,...x}){return(0,n.jsx)(h.Pressable,{...x,children:({pressed:h,hovered:x})=>(0,n.jsxs)(s.View,{testID:"sitemap-item",style:[D.itemInnerContainer,D.itemPressable,{paddingLeft:20+20*u,backgroundColor:x?'#202425':'#151718'},h&&{backgroundColor:'#26292b'},t],children:[(0,n.jsxs)(s.View,{style:{flexDirection:'row',alignItems:'center'},children:[o,(0,n.jsx)(s.Text,{style:D.filename,children:c})]}),(0,n.jsxs)(s.View,{style:{flexDirection:'row',alignItems:'center'},children:[!!f&&(0,n.jsx)(s.Text,{style:[D.virtual,{marginRight:8}],children:f}),l]})]})})}function w(){return(0,n.jsx)(s.Image,{style:D.image,source:r(d[9])})}function C(){return(0,n.jsx)(s.Image,{style:D.image,source:r(d[10])})}function S(){return(0,n.jsx)(s.Image,{style:D.image,source:r(d[11])})}function V(){return(0,n.jsx)(s.Image,{style:D.image,source:r(d[12])})}function v({rotation:t=0}){return(0,n.jsx)(s.Image,{style:[D.image,{transform:[{rotate:`${t}deg`}]}],source:r(d[13])})}function k(){const t=window.location.origin,l=o.default.expoConfig?.sdkVersion||'Unknown',c=(()=>{if(!g.HermesInternal)return null;const t=g.HermesInternal?.getRuntimeProperties?.()??{},n=t['OSS Release Version'],o=t['Static Hermes'];return t?o?`${n} (shermes)`:n:null})();return(0,n.jsxs)(s.View,{testID:"sitemap-system-info",style:{gap:8,marginTop:16},children:[(0,n.jsx)(s.Text,{style:D.systemInfoTitle,children:"System Information"}),(0,n.jsxs)(s.View,{style:D.systemInfoContainer,children:[(0,n.jsx)(z,{right:"production",children:"Mode"}),(0,n.jsx)(z,{right:l,children:"Expo SDK"}),c&&(0,n.jsx)(z,{right:c,children:"Hermes version"}),t&&(0,n.jsx)(z,{right:t,children:"Location origin"})]})]})}function z({children:t,right:o}){return(0,n.jsxs)(s.View,{style:D.systemInfoItem,children:[(0,n.jsx)(s.Text,{style:D.systemInfoLabel,numberOfLines:1,ellipsizeMode:"tail",children:t}),(0,n.jsx)(s.View,{style:{flex:1}}),(0,n.jsx)(s.Text,{selectable:!0,style:[D.systemInfoValue,D.code],numberOfLines:1,ellipsizeMode:"tail",children:o})]})}e.Sitemap=()=>(0,n.jsx)(u.NoSSR,{children:(0,n.jsx)(y,{})});const D=s.StyleSheet.create({container:{backgroundColor:'black',flex:1,alignItems:'stretch'},header:{backgroundColor:'#151718',paddingVertical:16,borderBottomWidth:1,borderColor:'#313538',boxShadow:'0px 3px 3px rgba(0, 0, 0, 0.33)'},headerContent:{flexDirection:'row',alignItems:'center',gap:14,paddingHorizontal:'5%',...s.Platform.select({web:{width:'100%',maxWidth:960,marginHorizontal:'auto'}})},title:{color:'white',fontSize:28,fontWeight:'bold'},scroll:{gap:12,paddingHorizontal:'5%',paddingVertical:16,...s.Platform.select({ios:{paddingBottom:24},web:{width:'100%',maxWidth:960,marginHorizontal:'auto',paddingBottom:24},default:{paddingBottom:12}})},itemContainer:{borderWidth:1,borderColor:'#313538',backgroundColor:'#151718',borderRadius:12,borderCurve:'continuous'},itemInnerContainer:{backgroundColor:'#151718',borderRadius:12,borderCurve:'continuous',gap:12},itemPressable:{paddingHorizontal:20,paddingVertical:16,flexDirection:'row',justifyContent:'space-between',alignItems:'center',...s.Platform.select({web:{transitionDuration:'100ms'}})},filename:{color:'white',fontSize:20,marginLeft:12},virtual:{textAlign:'right',color:'white'}
819,image:{width:24,height:24,resizeMode:'contain',opacity:.6},headerIcon:{width:40,height:40,backgroundColor:'#202425',borderRadius:8,flexDirection:'row',alignItems:'center',justifyContent:'center'},systemInfoContainer:{borderWidth:1,borderColor:'#313538',backgroundColor:'#151718',borderRadius:12,gap:8,borderCurve:'continuous',padding:20},systemInfoTitle:{color:'white',fontSize:18,fontWeight:'600',marginBottom:12,paddingHorizontal:20},systemInfoItem:{flexDirection:'row',gap:8,alignItems:'center',flexWrap:'wrap'},systemInfoLabel:{color:'white',fontSize:16,lineHeight:24},systemInfoValue:{color:'white',fontSize:16,opacity:.7,flexShrink:1,letterSpacing:.5},code:{fontVariant:['tabular-nums'],fontFamily:s.Platform.select({default:"SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace",ios:'ui-monospace',android:'monospace'}),fontWeight:'500'}})},726,[6,542,11,263,105,727,728,729,689,730,731,732,733,734]); 820__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NoSSR=function({children:t}){const[f,l]=n.default.useState(!1);if(n.default.useEffect(()=>{l(!0)},[]),!f)return null;return(0,u.jsx)(u.Fragment,{children:t})};const u=r(d[0]),n=t(r(d[1]))},727,[6,11]); 821__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Pressable=void 0;const s=r(d[0]);e.Pressable=s.Pressable},728,[263]); 822__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useSitemap=function(){return(0,t.useMemo)(()=>o.store.routeNode?h(o.store.routeNode,[]):null,[o.store.routeNode])};const t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),l=(t,n)=>[...n,...t.route.split('/')],u=(t,n)=>'/'+l(t,n).map(t=>(0,s.matchDynamicName)(t)?.deep?t+'/'+Date.now():'index'===t?'':t).filter(Boolean).join('/'),c=t=>{const n=t.contextKey.split('/');if(t.contextKey.match(/_layout\.[jt]sx?$/))return n[n.length-2]+'/'+n[n.length-1];const o=t.route.split('/').length;return n.slice(-o).join('/')},h=(t,o)=>({contextKey:t.contextKey,filename:c(t),href:u(t,o),isInitial:t.initialRouteName===t.route,isInternal:t.internal??!1,isGenerated:t.generated??!1,children:[...t.children].sort(n.sortRoutes).map(n=>h(n,l(t,o)))})},729,[11,256,531,257]); 823__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png",width:48,height:48,toString(){return this.uri}}},730,[]); 824__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png",width:48,height:48,toString(){return this.uri}}},731,[]); 825__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png",width:48,height:48,toString(){return this.uri}}},732,[]); 826__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png",width:48,height:48,toString(){return this.uri}}},733,[]); 827__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png",width:48,height:48,toString(){return this.uri}}},734,[]); 828__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Unmatched=function(){return(0,n.jsx)(u.NoSSR,{children:(0,n.jsx)(b,{})})};const n=r(d[0]),o=r(d[1]),l=t(r(d[2])),s=r(d[3]),c=r(d[4]),u=r(d[5]),h=r(d[6]),f=r(d[7]),x=r(d[8]),p=r(d[9]),y=r(d[10]),j=r(d[11]);function b(){const[t,u]=l.default.useState(!1),b=(0,c.useRouter)(),P=(0,p.useRoute)(),T=(0,f.useNavigation)(),v=(0,c.usePathname)(),L=(0,o.createURL)(v);l.default.useEffect(()=>{u(!0)},[]);const w=T.isFocused(),D=(0,y.isRoutePreloadedInStack)(T.getState(),P);return(0,x.useSafeLayoutEffect)(()=>{(!D||D&&w)&&T.setOptions({title:'Not Found'})},[w,D,T]),(0,n.jsxs)(s.View,{testID:"expo-router-unmatched",style:S.container,children:[(0,n.jsx)(k,{}),(0,n.jsx)(s.Text,{role:"heading","aria-level":1,style:S.title,children:"Unmatched Route"}),(0,n.jsx)(s.Text,{role:"heading","aria-level":2,style:[S.subtitle,S.secondaryText],children:"Page could not be found."}),t?(0,n.jsx)(h.Link,{href:v,replace:!0,...s.Platform.select({native:{asChild:!0}}),children:(0,n.jsx)(j.Pressable,{children:({hovered:t,pressed:o})=>(0,n.jsx)(s.Text,{style:[S.pageLink,S.secondaryText,s.Platform.select({web:{transitionDuration:'200ms',opacity:1}}),t&&{opacity:.8,textDecorationLine:'underline'},o&&{opacity:.8}],children:L})})}):(0,n.jsx)(s.View,{style:[S.pageLink,S.placeholder]}),(0,n.jsxs)(s.View,{style:S.linkContainer,children:[(0,n.jsx)(j.Pressable,{children:({hovered:t,pressed:o})=>(0,n.jsx)(s.Text,{onPress:()=>{b.canGoBack()?b.back():b.replace('/')},style:[S.link,s.Platform.select({web:{transitionDuration:'200ms',opacity:1}}),t&&{opacity:.8,textDecorationLine:'underline'},o&&{opacity:.8}],children:"Go back"})}),(0,n.jsx)(s.Text,{style:[S.linkSeparator,S.secondaryText],children:"\u2022"}),(0,n.jsx)(h.Link,{href:"/_sitemap",replace:!0,...s.Platform.select({native:{asChild:!0}}),children:(0,n.jsx)(j.Pressable,{children:({hovered:t,pressed:o})=>(0,n.jsx)(s.Text,{style:[S.link,s.Platform.select({web:{transitionDuration:'200ms',opacity:1}}),t&&{opacity:.8,textDecorationLine:'underline'},o&&{opacity:.8}],children:"Sitemap"})})})]})]})}function k(){return(0,n.jsx)(s.Image,{source:r(d[12]),style:S.image})}const S=s.StyleSheet.create({container:{flex:1,backgroundColor:'black',padding:24,paddingBottom:64,alignItems:'center',justifyContent:'center'}
828,image:{width:270,height:168,resizeMode:'contain',marginBottom:28},title:{...s.Platform.select({web:{fontSize:64,lineHeight:64},default:{fontSize:56,lineHeight:56}}),color:'#fff',fontWeight:'800',textAlign:'center'},subtitle:{fontSize:34,marginTop:4,marginBottom:12,fontWeight:'200',textAlign:'center'},pageLink:{minHeight:20},secondaryText:{color:'#9ba1a6'},placeholder:{backgroundColor:'#9ba1a644',minWidth:180,borderRadius:5},linkContainer:{marginTop:28,flexDirection:'row',gap:12},link:{fontSize:20,textAlign:'center',color:'#52a9ff'},linkSeparator:{fontSize:20}})},735,[6,550,11,263,557,727,689,707,706,401,736,728,737]); 829__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isRoutePreloadedInStack=function(t,o){if(!t||'stack'!==t.type)return!1;return t.preloadedRoutes.some(t=>t.key===o.key)}},736,[]); 830__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png",width:436,height:266,toString(){return this.uri}}},737,[]); 831__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IsWithinLayoutContext=void 0;const t=r(d[0]);e.IsWithinLayoutContext=(0,t.createContext)(!1)},738,[11]); 832__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Protected=void 0,e.isProtectedReactElement=function(n){return Boolean((0,t.isValidElement)(n)&&n.type===o.Group&&n.props&&'guard'in n.props)};const t=r(d[0]),o=r(d[1]);e.Protected=o.Group},739,[11,520]); 833__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Screen=p,e.isScreen=function(n,o){if((0,t.isValidElement)(n)&&n&&n.type===p){if('object'==typeof n.props&&n.props&&'name'in n.props&&!n.props.name)throw new Error(`<Screen /> component in \`default export\` at \`app${o}/_layout\` must have a \`name\` prop when used as a child of a Layout Route.`);return!0}return!1};const t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),u=r(d[4]);function p({name:t,options:p}){if(t)throw new Error("The name prop on the Screen component may only be used when it is inside a Layout route");const c=(0,n.useRoute)(),f=(0,o.useNavigation)(),l=f.isFocused(),y=(0,u.isRoutePreloadedInStack)(f.getState(),c);return(0,s.useSafeLayoutEffect)(()=>{p&&Object.keys(p).length&&(!y||y&&l)&&f.setOptions(p)},[l,y,f,p]),null}},740,[11,401,707,706,736]); 834__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var s=e(i),c=0;c<s.length;c++)"default"!==s[c]&&t(o,i,s[c]);return n(o,i),o});
834Object.defineProperty(_e,"__esModule",{value:!0}),_e.createNativeStackNavigator=function(e){return(0,v.createNavigatorFactory)(h)(e)};const o=r(d[0]),s=r(d[1]),c=i(r(d[2])),u=r(d[3]),l=r(d[4]),p=r(d[5]),f=r(d[6]),v=r(d[7]),_=r(d[8]),b=(0,s.isLiquidGlassAvailable)();function h({id:e,initialRouteName:t,children:n,layout:i,screenListeners:s,screenOptions:h,screenLayout:y,UNSTABLE_router:O,...m}){const{state:N,describe:j,descriptors:S,navigation:T,NavigationContent:E}=(0,v.useNavigationBuilder)(v.StackRouter,{id:e,initialRouteName:t,children:n,layout:i,screenListeners:s,screenOptions:h,screenLayout:y,UNSTABLE_router:O});c.useEffect(()=>T?.addListener?.('tabPress',e=>{const t=T.isFocused();requestAnimationFrame(()=>{N.index>0&&t&&!e.defaultPrevented&&'native'!==e.data?.__internalTabsType&&T.dispatch({...v.StackActions.popToTop(),target:N.key})})}),[T,N.index,N.key]);const{computedState:L,computedDescriptors:P,navigationWrapper:x}=(0,p.usePreviewTransition)(N,T,S,j),k=c.useMemo(()=>{let e=!1;const t={};for(const n of Object.keys(P)){const i=P[n],o=i.options,s=o?.[f.INTERNAL_EXPO_ROUTER_GESTURE_ENABLED_OPTION_NAME],c=void 0!==s,u=b&&'formSheet'===o?.presentation;if(c||u){e=!0;const l={...o};c&&(l.gestureEnabled=s),u&&(l.headerTransparent??=!0,l.contentStyle??={backgroundColor:'transparent'},l.headerShadowVisible??=!1,l.headerLargeTitleShadowVisible??=!1),t[n]={...i,options:l}}else t[n]=i}return e?t:P},[P]),{registry:w,contextValue:A}=(0,u.useCompositionRegistry)(),R=c.useMemo(()=>(0,u.mergeOptions)(k,w,L),[k,L,w]);return(0,o.jsx)(l.DescriptorsContext,{value:S,children:(0,o.jsx)(E,{children:(0,o.jsx)(u.CompositionContext,{value:A,children:(0,o.jsx)(_.NativeStackView,{...m,state:L,navigation:x,descriptors:R,describe:j})})})})}},741,[6,742,11,703,747,748,573,401,749]); 835__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"GlassView",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(_e,"GlassContainer",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(_e,"isLiquidGlassAvailable",{enumerable:!0,get:function(){return l.isLiquidGlassAvailable}}),Object.defineProperty(_e,"isGlassEffectAPIAvailable",{enumerable:!0,get:function(){return u.isGlassEffectAPIAvailable}});var t=e(r(d[0])),n=e(r(d[1])),l=r(d[2]),u=r(d[3])},742,[743,744,745,746]); 836__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var e,t=r(d[0]),u=r(d[1]),n=(e=u)&&e.__esModule?e:{default:e};function f(e){return(0,t.jsx)(n.default,{...e})}},743,[6,13]); 837__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var e,t=r(d[0]),u=r(d[1]),n=(e=u)&&e.__esModule?e:{default:e};function f(e){return(0,t.jsx)(n.default,{...e})}},744,[6,13]); 838__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isLiquidGlassAvailable=function(){return!1}},745,[]); 839__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isGlassEffectAPIAvailable=function(){return!1}},746,[]); 840__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DescriptorsContext=void 0;const t=r(d[0]);e.DescriptorsContext=(0,t.createContext)({})},747,[11]); 841__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,u)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var u={};if(null!=i)for(var s=t(i),c=0;c<s.length;c++)"default"!==s[c]&&n(u,i,s[c]);return o(u,i),u});
841Object.defineProperty(e,"__esModule",{value:!0}),e.usePreviewTransition=function(t,n,o,i){const{openPreviewKey:c,setOpenPreviewKey:p}=(0,s.useLinkPreviewContext)(),[f,l]=u.useState();u.useEffect(()=>{f&&t.routes.some(t=>t.key===f)&&l(void 0)},[t,f]);const m=u.useMemo(()=>{if(c){const t=(...t)=>{const{target:o,type:i,data:u}=t[0];return o===c&&u&&'closing'in u&&!u.closing&&('transitionStart'===i?l(c):'transitionEnd'===i&&p(void 0)),n.emit(...t)};return{...n,emit:t}}return n},[n,c,p]),{computedState:v,computedDescriptors:_}=u.useMemo(()=>{if(f){const n=t.preloadedRoutes.find(t=>t.key===f);if(n){return{computedState:{...t,preloadedRoutes:t.preloadedRoutes.filter(t=>t.key!==f),routes:[...t.routes,n],index:t.index+1},computedDescriptors:f in o?o:{...o,[f]:i(n,!0)}}}}return{computedState:t,computedDescriptors:o}},[t,f,i,o]);return{computedState:v,computedDescriptors:_,navigationWrapper:m}};const u=i(r(d[0])),s=r(d[1])},748,[11,718]); 842__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useAnimatedHeaderHeight=e.NativeStackView=e.createNativeStackNavigator=void 0;var t=r(d[0]);Object.defineProperty(e,"createNativeStackNavigator",{enumerable:!0,get:function(){return t.createNativeStackNavigator}});var n=r(d[1]);Object.defineProperty(e,"NativeStackView",{enumerable:!0,get:function(){return n.NativeStackView}});var c=r(d[2]);Object.defineProperty(e,"useAnimatedHeaderHeight",{enumerable:!0,get:function(){return c.useAnimatedHeaderHeight}})},749,[750,751,752]); 843__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var s=e(i),c=0;c<s.length;c++)"default"!==s[c]&&t(o,i,s[c]);return n(o,i),o});
843Object.defineProperty(_e,"__esModule",{value:!0}),_e.createNativeStackNavigator=function(e){return(0,u.createNavigatorFactory)(f)(e)};const o=r(d[0]),s=i(r(d[1])),c=r(d[1]),u=r(d[2]),l=r(d[3]);function f({id:e,initialRouteName:t,UNSTABLE_routeNamesChangeBehavior:n,children:i,layout:f,screenListeners:v,screenOptions:p,screenLayout:_,UNSTABLE_router:h,...b}){const{state:y,describe:N,descriptors:O,navigation:j,NavigationContent:m}=(0,u.useNavigationBuilder)(u.StackRouter,{id:e,initialRouteName:t,UNSTABLE_routeNamesChangeBehavior:n,children:i,layout:f,screenListeners:v,screenOptions:p,screenLayout:_,UNSTABLE_router:h}),L=(0,c.use)(u.NavigationMetaContext);return s.useEffect(()=>{if(!L||!('type'in L)||'native-tabs'!==L.type)return j?.addListener?.('tabPress',e=>{const t=j.isFocused();requestAnimationFrame(()=>{y.index>0&&t&&!e.defaultPrevented&&j.dispatch({...u.StackActions.popToTop(),target:y.key})})})},[L,j,y.index,y.key]),(0,o.jsx)(m,{children:(0,o.jsx)(l.NativeStackView,{...b,state:y,navigation:j,descriptors:O,describe:N})})}},750,[6,11,401,751]); 844__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var l=Object.getOwnPropertyDescriptor(n,o);l&&!("get"in l?!n.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,l)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var l={};if(null!=i)for(var c=t(i),s=0;s<c.length;s++)"default"!==c[s]&&n(l,i,c[s]);return o(l,i),l});Object.defineProperty(e,"__esModule",{value:!0}),e.NativeStackView=function({state:t,descriptors:n,describe:o}){const i=(0,s.use)(h.HeaderBackContext),{buildHref:c}=(0,f.useLinkBuilder)(),p=t.preloadedRoutes.reduce((t,n)=>(t[n.key]=t[n.key]||o(n,!0),t),{});return(0,l.jsx)(h.SafeAreaProviderCompat,{children:t.routes.concat(t.preloadedRoutes).map((o,s)=>{const f=t.index===s,y=t.routes[s-1]?.key,m=t.routes[s+1]?.key,j=y?n[y]:void 0,x=m?n[m]:void 0,{options:_,navigation:S,render:H}=n[o.key]??p[o.key],O=j?{title:(0,h.getHeaderTitle)(j.options,j.route.name),href:c(j.route.name,j.route.params)}:i,w=null!=O,{header:B,headerShown:C,headerBackIcon:P,headerBackImageSource:M,headerLeft:T,headerTransparent:I,headerBackTitle:V,presentation:A,contentStyle:L,...D}=_,N=x?.options.presentation,R=void 0!==p[o.key]&&void 0===n[o.key];return(0,l.jsx)(h.Screen,{focused:f,route:o,navigation:S,headerShown:C,headerTransparent:I,header:void 0!==B?B({back:O,options:_,route:o,navigation:S}):(0,l.jsx)(h.Header,{...D,back:O,title:(0,h.getHeaderTitle)(_,o.name),headerLeft:'function'==typeof T?({label:t,...n})=>T({...n,label:V??t}):void 0===T&&w?({tintColor:t,label:n,...o})=>(0,l.jsx)(h.HeaderBackButton,{...o,label:V??n,tintColor:t,backImage:void 0!==P||void 0!==M?()=>(0,l.jsx)(u.Image,{source:P?.source??M,resizeMode:"contain",tintColor:t,style:k.backImage}):void 0,onPress:S.goBack}):T,headerTransparent:I}),style:[u.StyleSheet.absoluteFill,{display:(f||null!=N&&v.includes(N))&&!R?'flex':'none'},null!=A&&v.includes(A)?{backgroundColor:'transparent'}:null],children:(0,l.jsx)(h.HeaderBackContext.Provider,{value:O,children:(0,l.jsx)(b,{children:(0,l.jsx)(u.View,{style:[k.contentContainer,L],children:H()})})})},o.key)})})};const l=r(d[0]),c=i(r(d[1])),s=r(d[1]),u=r(d[2]),h=r(d[3]),f=r(d[4]),p=r(d[5]),v=['transparentModal','containedTransparentModal'];const b=({children:t})=>{const n=(0,h.useHeaderHeight)(),[o]=c.useState(()=>new u.Animated.Value(n));return c.useEffect(()=>{o.setValue(n)},[o,n]),(0,l.jsx)(p.AnimatedHeaderHeightContext.Provider,{value:o,children:t})},k=u.StyleSheet.create({contentContainer:{flex:1},backImage:{height:24,width:24,margin:3}})},751,[6,11,263,604,401,752]); 845__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)}
845,function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),f=0;f<c.length;f++)"default"!==c[f]&&n(u,o,c[f]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.AnimatedHeaderHeightContext=void 0,e.useAnimatedHeaderHeight=function(){const t=u.useContext(e.AnimatedHeaderHeightContext);if(void 0===t)throw new Error("Couldn't find the header height. Are you inside a screen in a native stack navigator?");return t};const u=o(r(d[0]));e.AnimatedHeaderHeightContext=u.createContext(void 0)},752,[11]); 846__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,c,o){void 0===o&&(o=c);var p=Object.getOwnPropertyDescriptor(n,c);p&&!("get"in p?!n.__esModule:p.writable||p.configurable)||(p={enumerable:!0,get:function(){return n[c]}}),Object.defineProperty(t,o,p)}:function(t,n,c,o){void 0===o&&(o=c),t[o]=n[c]}),n=this&&this.__exportStar||function(n,c){for(var o in n)"default"===o||Object.prototype.hasOwnProperty.call(c,o)||t(c,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.mapProtectedScreen=e.validateStackPresentation=e.appendScreenStackPropsToOptions=e.StackScreen=e.appendStackTitlePropsToOptions=e.StackTitle=e.StackSearchBar=e.StackHeader=void 0;const c=r(d[0]);e.StackHeader=c.StackHeaderComponent;var o=r(d[1]);Object.defineProperty(e,"StackSearchBar",{enumerable:!0,get:function(){return o.StackSearchBar}}),n(r(d[2]),e),n(r(d[3]),e);var p=r(d[4]);Object.defineProperty(e,"StackTitle",{enumerable:!0,get:function(){return p.StackTitle}}),Object.defineProperty(e,"appendStackTitlePropsToOptions",{enumerable:!0,get:function(){return p.appendStackTitlePropsToOptions}});var u=r(d[5]);Object.defineProperty(e,"StackScreen",{enumerable:!0,get:function(){return u.StackScreen}}),Object.defineProperty(e,"appendScreenStackPropsToOptions",{enumerable:!0,get:function(){return u.appendScreenStackPropsToOptions}}),Object.defineProperty(e,"validateStackPresentation",{enumerable:!0,get:function(){return u.validateStackPresentation}});var S=r(d[6]);Object.defineProperty(e,"mapProtectedScreen",{enumerable:!0,get:function(){return S.mapProtectedScreen}})},753,[754,755,756,775,777,780,781]); 847__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackHeaderComponent=function({children:n,hidden:s,asChild:c,transparent:h,blurEffect:u,style:f,largeStyle:p}){const S=(0,t.useMemo)(()=>l({},{children:n,hidden:s,asChild:c,transparent:h,blurEffect:u,style:f,largeStyle:p}),[n,s,c,h,u,f,p]);return(0,o.useCompositionOption)(S),null},e.appendStackHeaderPropsToOptions=l;const t=r(d[0]),n=r(d[1]),o=r(d[2]);function l(t,o){const l=n.StyleSheet.flatten(o.style),s=n.StyleSheet.flatten(o.largeStyle);if(o.hidden)return{...t,headerShown:!1};if(o.asChild)return{...t,header:()=>o.children};o.children&&!o.asChild&&console.warn("To render a custom header, set the 'asChild' prop to true on Stack.Header.");const c='transparent'===l?.backgroundColor,h=void 0!==o.blurEffect,u=!0===o.transparent||!1!==o.transparent&&(c||h);return o.blurEffect&&!1===o.transparent&&console.warn("Stack.Header: 'blurEffect' requires 'transparent' to be enabled."),{...t,headerShown:!o.hidden,headerBlurEffect:o.blurEffect,...u&&{headerTransparent:!0},...!1===o.transparent&&{headerTransparent:!1},...l?.color&&{headerTintColor:l.color},headerStyle:{backgroundColor:l?.backgroundColor},headerLargeStyle:{backgroundColor:s?.backgroundColor},...'transparent'===l?.shadowColor&&{headerShadowVisible:!1},...'transparent'===s?.shadowColor&&{headerLargeTitleShadowVisible:!1}}}},754,[11,263,703]); 848__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackSearchBar=function({ref:l,autoCapitalize:c,autoFocus:u,barTintColor:s,tintColor:h,cancelButtonText:p,disableBackButtonOverride:B,hideNavigationBar:C,hideWhenScrolling:S,inputType:T,obscureBackground:b,onBlur:x,onCancelButtonPress:O,onChangeText:f,onClose:k,onFocus:I,onOpen:P,onSearchButtonPress:v,placeholder:w,placement:F,allowToolbarIntegration:_,textColor:y,hintTextColor:z,headerIconColor:H,shouldShowHintSearchIcon:M}){const N=(0,o.useMemo)(()=>t({},{ref:l,autoCapitalize:c,autoFocus:u,barTintColor:s,tintColor:h,cancelButtonText:p,disableBackButtonOverride:B,hideNavigationBar:C,hideWhenScrolling:S,inputType:T,obscureBackgroun
848d:b,onBlur:x,onCancelButtonPress:O,onChangeText:f,onClose:k,onFocus:I,onOpen:P,onSearchButtonPress:v,placeholder:w,placement:F,allowToolbarIntegration:_,textColor:y,hintTextColor:z,headerIconColor:H,shouldShowHintSearchIcon:M}),[l,c,u,s,h,p,B,C,S,T,b,x,O,f,k,I,P,v,w,F,_,y,z,H,M]);return(0,n.useCompositionOption)(N),null},e.appendStackSearchBarPropsToOptions=t;const o=r(d[0]),n=r(d[1]);function t(o,n){return{...o,headerShown:!0,headerSearchBarOptions:{...n}}}},755,[11,703]); 849__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackToolbarView=e.StackToolbarSpacer=e.StackToolbarSearchBarSlot=e.StackToolbarMenuAction=e.StackToolbarMenu=e.StackToolbarButton=e.appendStackToolbarPropsToOptions=e.StackToolbar=e.StackToolbarLabel=e.StackToolbarIcon=e.StackToolbarBadge=void 0;var o=r(d[0]);Object.defineProperty(e,"StackToolbarBadge",{enumerable:!0,get:function(){return o.StackToolbarBadge}}),Object.defineProperty(e,"StackToolbarIcon",{enumerable:!0,get:function(){return o.StackToolbarIcon}}),Object.defineProperty(e,"StackToolbarLabel",{enumerable:!0,get:function(){return o.StackToolbarLabel}}
849);var t=r(d[1]);Object.defineProperty(e,"StackToolbar",{enumerable:!0,get:function(){return t.StackToolbar}});var n=r(d[2]);Object.defineProperty(e,"appendStackToolbarPropsToOptions",{enumerable:!0,get:function(){return n.appendStackToolbarPropsToOptions}});var c=r(d[3]);Object.defineProperty(e,"StackToolbarButton",{enumerable:!0,get:function(){return c.StackToolbarButton}});var b=r(d[4]);Object.defineProperty(e,"StackToolbarMenu",{enumerable:!0,get:function(){return b.StackToolbarMenu}}),Object.defineProperty(e,"StackToolbarMenuAction",{enumerable:!0,get:function(){return b.StackToolbarMenuAction}});var l=r(d[5]);Object.defineProperty(e,"StackToolbarSearchBarSlot",{enumerable:!0,get:function(){return l.StackToolbarSearchBarSlot}});var u=r(d[6]);Object.defineProperty(e,"StackToolbarSpacer",{enumerable:!0,get:function(){return u.StackToolbarSpacer}});var S=r(d[7]);Object.defineProperty(e,"StackToolbarView",{enumerable:!0,get:function(){return S.StackToolbarView}})},756,[757,758,764,759,765,767,769,771]); 850__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackToolbarBadge=e.StackToolbarIcon=e.StackToolbarLabel=void 0;const o=r(d[0]);e.StackToolbarLabel=o.Label,e.StackToolbarIcon=o.Icon,e.StackToolbarBadge=o.Badge},757,[520]); 851__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.StackToolbar=void 0;const o=r(d[0]),l=t(r(d[1]));e.StackToolbar=l.default;const c=r(d[2]),u=r(d[3]),n=r(d[4]),S=r(d[5]),f=r(d[6]);l.default.Button=o.StackToolbarButton,l.default.Menu=c.StackToolbarMenu,l.default.MenuAction=c.StackToolbarMenuAction,l.default.SearchBarSlot=u.StackToolbarSearchBarSlot,l.default.Spacer=n.StackToolbarSpacer,l.default.View=S.StackToolbarView,l.default.Label=f.StackToolbarLabel,l.default.Icon=f.StackToolbarIcon,l.default.Badge=f.StackToolbarBadge},758,[759,764,765,767,769,771,757]); 852__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackToolbarButton=void 0,e.convertStackToolbarButtonPropsToRNHeaderItem=function(o){if(o.hidden)return;return{...(0,l.convertStackHeaderSharedPropsToRNSharedHeaderItem)(o),type:'button',onPress:o.onPress??(()=>{}),selected:!!o.selected}};const o=r(d[0]),t=r(d[1]),n=r(d[2]),c=r(d[3]),s=r(d[4]),l=r(d[5]),u=r(d[6]);e.StackToolbarButton=u=>{const S=(0,s.useToolbarPlacement)();(0,t.useMemo)(()=>(0,c.filterAllowedChildrenElements)(u.children,b),[u.children]);if(null==S)throw new Error('Stack.Toolbar.Button must be used inside a Stack.Toolbar');const T=(0,l.convertStackHeaderSharedPropsToRNSharedHeaderItem)(u,!0),k='sfSymbol'===T?.icon?.type?T.icon.name:void 0,h='image'===T?.icon?.type?T.icon.source:void 0,v=(0,l.extractXcassetName)(u),f=(0,l.extractIconRenderingMode)(u)??u.iconRenderingMode;return(0,o.jsx)(n.NativeToolbarButton,{...T,icon:k,source:h,xcassetName:v,image:u.image,imageRenderingMode:f})};const b=[u.StackToolbarLabel,u.StackToolbarIcon,u.StackToolbarBadge]},759,[6,11,760,527,761,762,757]); 853__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeToolbarButton=void 0;e.NativeToolbarButton=()=>null},760,[]); 854__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ToolbarColorContext=e.ToolbarPlacementContext=void 0,e.useToolbarPlacement=function(){return(0,o.useContext)(e.ToolbarPlacementContext)},e.useToolbarColors=function(){return(0,o.useContext)(e.ToolbarColorContext)};const o=r(d[0]);e.ToolbarPlacementContext=(0,o.createContext)(null),e.ToolbarColorContext=(0,o.createContext)({})},761,[11]); 855__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractXcassetName=function(t){const c=(0,o.getFirstChildOfType)(t.children,n.StackToolbarIcon)?.props;if(c&&'xcasset'in c)return c.xcasset;return},e.extractIconRenderingMode=function(t){const c=(0,o.getFirstChildOfType)(t.children,n.StackToolbarIcon)?.props;if(c&&'renderingMode'in c)return c.renderingMode;return},e.areAllChildrenPrimitiveValues=function(n){const o=t.Children.toArray(n);return o.filter(t=>s.includes(typeof t)).length===o.length},e.convertChildrenToString=l,e.convertStackHeaderSharedPropsToRNSharedHeaderItem=function(t,s=!1){const{children:p,style:u,separateBackgroun
855d:f,icon:y,...h}=t,T=l(p),S=(0,o.getFirstChildOfType)(p,n.StackToolbarLabel),b=t.icon?'string'==typeof t.icon?{sf:t.icon}:{src:t.icon}:void 0,x=(0,o.getFirstChildOfType)(p,n.StackToolbarIcon)?.props??b,C=(0,o.getFirstChildOfType)(p,n.StackToolbarBadge),v=(()=>{if(x){if('xcasset'in x&&s)return{type:'xcasset',name:x.xcasset};if('src'in x||'xcasset'in x){return{type:'image',source:'src'in x?x.src:{uri:x.xcasset},tinted:'template'===(('renderingMode'in x?x.renderingMode:void 0)??t.iconRenderingMode??(t.tintColor?'template':'original'))}}return{type:'sfSymbol',name:x.sf}}})(),k={...h,label:S?.props.children??T,sharesBackground:!f};if(u){const t=(0,c.convertTextStyleToRNTextStyle)(u)??{};k.labelStyle=t}if(C){k.badge={value:C.props.children??''};const t=(0,c.convertTextStyleToRNTextStyle)(C.props.style);t&&(k.badge.style=t)}v&&(k.icon=v);return k};const t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3]);const s=['string','number'];function l(n){return t.Children.toArray(n).filter(t=>s.includes(typeof t)).join('')}},762,[11,757,527,763]); 856__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.convertTextStyleToRNTextStyle=function(n){const o=t.StyleSheet.flatten(n);if(!o)return;if('fontWeight'in o)return{...o,fontWeight:'number'==typeof o.fontWeight?String(o.fontWeight):o.fontWeight};return o},e.convertFontWeightToComposeFontWeight=function(t){if(null==t)return;const o=String(t);if(!n.has(o))return;return o};const t=r(d[0]);const n=new Set(['100','200','300','400','500','600','700','800','900','normal','bold'])},763,[263]); 857__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackToolbar=void 0,e.appendStackToolbarPropsToOptions=v;const o=r(d[0]),t=r(d[1]),l=r(d[0]),n=r(d[2]),c=r(d[3]),b=r(d[4]),u=r(d[5]),s=r(d[6]),k=r(d[7]),S=r(d[8]),T=r(d[9]),h=r(d[10]),C=r(d[11]),p=r(d[12]);e.StackToolbar=l=>{if((0,k.useToolbarPlacement)())throw new Error("Stack.Toolbar cannot be nested inside another Stack.Toolbar.");return'bottom'!==l.placement&&l.placement?(0,o.createElement)(P,{...l,key:l.placement}):(0,t.jsx)(f,{...l})};const f=({children:o,disableImePadding:n,tintColor:c,backgroundColor:b})=>{const u=(0,l.useMemo)(()=>({tintColor:c,backgroundColor:b}),[c,b]);return(0,t.jsx)(k.ToolbarPlacementContext.Provider,{value:"bottom",children:(0,t.jsx)(k.ToolbarColorContext.Provider,{value:u,children:(0,t.jsx)(C.NativeMenuContext,{value:!0,children:(0,t.jsx)(p.RouterToolbarHost,{withImePadding:!n,backgroundColor:b,children:o})})})})},P=({children:o,placement:t,asChild:n,disableImePadding:c,tintColor:b,backgroundColor:u})=>{if('left'!==t&&'right'!==t)throw new Error(`Invalid placement "${t}" for Stack.Toolbar. Expected "left" or "right".`);const s=(0,l.useMemo)(()=>v({},{children:o,placement:t,asChild:n,disableImePadding:c,tintColor:b,backgroundColor:u}),[o,t,n,c,b,u]);return(0,h.useCompositionOption)(s),null};function v(o,l){const{children:n,placement:c="bottom",asChild:b}=l;if('bottom'===c)return o;const u={tintColor:l.tintColor,backgroundColor:l.backgroundColor};if(b){const l=(0,t.jsx)(k.ToolbarColorContext.Provider,{value:u,children:n});return'left'===c?{...o,headerShown:!0,headerLeft:()=>l}:{...o,headerShown:!0,headerRight:()=>l}}return{...o,...(0,S.processHeaderItemsForPlatform)(n,c,u)??{}}}e.StackToolbar.Button=n.StackToolbarButton,e.StackToolbar.Menu=c.StackToolbarMenu,e.StackToolbar.MenuAction=c.StackToolbarMenuAction,e.StackToolbar.SearchBarSlot=b.StackToolbarSearchBarSlot,e.StackToolbar.Spacer=u.StackToolbarSpacer,e.StackToolbar.View=s.StackToolbarView,e.StackToolbar.Label=T.StackToolbarLabel,e.StackToolbar.Icon=T.StackToolbarIcon,e.StackToolbar.Badge=T.StackToolbarBadge,e.default=e.StackToolbar},764,[11,6,759,765,767,769,771,761,773,757,703,700,774]); 858__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackToolbarMenuAction=e.StackToolbarMenu=void 0,e.convertStackToolbarMenuPropsToRNHeaderItem=function(o,n=!1){if(o.hidden)return;const{title:c,...s}=o,b=t.Children.toArray(o.children).filter(o=>(0,i.isChildOfType)(o,e.StackToolbarMenuAction)||(0,i.isChildOfType)(o,e.StackToolbarMenu)),{label:S,menuTitle:f}=u(o.children,c),h={...(0,l.convertStackHeaderSharedPropsToRNSharedHeaderItem)(s,n),label:S,type:'menu',menu:{multiselectable:!0,items:b.map(o=>(0,i.isChildOfType)(o,e.StackToolbarMenu)?p(o.props):T(o.props)).filter(o=>!!o)}};f&&(h.menu.title=f);return h},e.convertStackToolbarMenuActionPropsToRNHeaderItem=T;const o=r(d[0]),t=r(d[1]),n=r(d[2]),i=r(d[3]),c=r(d[4]),l=r(d[5]),s=r(d[6]);function u(o,t){const n=(0,i.getFirstChildOfType)(o,s.StackToolbarLabel),c=n?.props.children;return{label:c??t??'',menuTitle:t??''}}function b(o){return o.tinted?{type:'templateSource',templateSource:o.source}:{type:'imageSource',imageSource:o.source}}
858function p(o){if(o.hidden)return;const n=(0,l.convertStackHeaderSharedPropsToRNSharedHeaderItem)(o),c={type:'submenu',items:t.Children.toArray(o.children).filter(o=>(0,i.isChildOfType)(o,e.StackToolbarMenuAction)||(0,i.isChildOfType)(o,e.StackToolbarMenu)).map(o=>(0,i.isChildOfType)(o,e.StackToolbarMenu)?p(o.props):T(o.props)).filter(o=>!!o),label:n.label||o.title||'',multiselectable:!0};return void 0!==o.inline&&(c.inline=o.inline),void 0!==o.palette&&(c.layout=o.palette?'palette':'default'),void 0!==o.destructive&&(c.destructive=o.destructive),n.icon&&('sfSymbol'===n.icon.type?c.icon=n.icon:c.icon=b(n.icon)),c}e.StackToolbarMenu=s=>{if(null==(0,c.useToolbarPlacement)())throw new Error('Stack.Toolbar.Menu must be used inside a Stack.Toolbar');const b=(0,t.useMemo)(()=>(0,i.filterAllowedChildrenElements)(s.children,S),[s.children]),p=(0,l.convertStackHeaderSharedPropsToRNSharedHeaderItem)(s,!0),{label:T,menuTitle:f}=u(s.children,s.title),h='sfSymbol'===p?.icon?.type?p.icon.name:void 0,M='image'===p?.icon?.type?p.icon.source:void 0,k=(0,l.extractXcassetName)(s),y=(0,l.extractIconRenderingMode)(s)??s.iconRenderingMode;return(0,o.jsx)(n.NativeToolbarMenu,{...s,icon:h,source:M,xcassetName:k,image:s.image,imageRenderingMode:y,label:T,title:f,badge:p?.badge,children:b})};function T(o){const{children:t,isOn:n,unstable_keepPresented:i,icon:c,...s}=o,u=(0,l.convertStackHeaderSharedPropsToRNSharedHeaderItem)(o),p={...s,description:o.subtitle,type:'action',label:u.label,state:n?'on':'off',onPress:o.onPress??(()=>{})};return void 0!==i&&(p.keepsMenuPresented=i),u.icon&&('sfSymbol'===u.icon.type?p.icon=u.icon:p.icon=b(u.icon)),p}e.StackToolbarMenuAction=t=>{(0,c.useToolbarPlacement)();const i='string'==typeof t.icon?t.icon:void 0,l='string'!=typeof t.icon?t.icon:void 0;return(0,o.jsx)(n.NativeToolbarMenuAction,{...t,icon:i,source:l,image:t.image,imageRenderingMode:t.iconRenderingMode})};const S=[e.StackToolbarMenu,e.StackToolbarMenuAction,n.NativeToolbarMenu,n.NativeToolbarMenuAction,s.StackToolbarLabel,s.StackToolbarIcon,s.StackToolbarBadge]},765,[6,11,766,527,761,762,757]); 859__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeToolbarMenuAction=e.NativeToolbarMenu=void 0;e.NativeToolbarMenu=()=>null;e.NativeToolbarMenuAction=()=>null},766,[]); 860__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackToolbarSearchBarSlot=void 0;const o=r(d[0]),t=r(d[1]),c=r(d[2]);e.StackToolbarSearchBarSlot=l=>{if('bottom'!==(0,c.useToolbarPlacement)())throw new Error('Stack.Toolbar.SearchBarSlot must be used inside a Stack.Toolbar');return(0,o.jsx)(t.NativeToolbarSearchBarSlot,{...l})}},767,[6,768,761]); 861__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeToolbarSearchBarSlot=void 0;e.NativeToolbarSearchBarSlot=()=>null},768,[]); 862__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackToolbarSpacer=void 0,e.convertStackToolbarSpacerPropsToRNHeaderItem=function(o){const{hidden:t,width:c}=o;if(t)return;if(void 0===c)return;return{type:'spacing',spacing:c??0}};const o=r(d[0]),t=r(d[1]),c=r(d[2]);e.StackToolbarSpacer=n=>{if(null==(0,c.useToolbarPlacement)())throw new Error('Stack.Toolbar.Spacer must be used inside a Stack.Toolbar');return(0,o.jsx)(t.NativeToolbarSpacer,{...n,hidesSharedBackground:!n.sharesBackground})}},769,[6,770,761]); 863__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeToolbarSpacer=void 0;e.NativeToolbarSpacer=()=>null},770,[]); 864__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackToolbarView=void 0,e.convertStackToolbarViewPropsToRNHeaderItem=function(t){if(t.hidden)return;const{children:n,hidesSharedBackground:c}=t;n||console.warn('Stack.Toolbar.View requires a child element to render custom content in the toolbar.');return{type:'custom',element:n||(0,o.jsx)(o.Fragment,{}),hidesSharedBackground:c}};const o=r(d[0]),t=r(d[1]),n=r(d[2]);e.StackToolbarView=c=>{if(null==(0,n.useToolbarPlacement)())throw new Error('Stack.Toolbar.Vie
864w must be used inside a Stack.Toolbar');return(0,o.jsx)(t.NativeToolbarView,{...c,children:c.children})}},771,[6,772,761]); 865__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeToolbarView=void 0;e.NativeToolbarView=()=>null},772,[]); 866__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.processHeaderItemsForPlatform=function(t,n,o){return null}},773,[]); 867__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RouterToolbarHost=function(t){return null},e.RouterToolbarItem=function(t){return null}},774,[]); 868__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.appendStackScreenBackButtonPropsToOptions=e.StackScreenBackButton=e.appendStackScreenTitlePropsToOptions=e.StackScreenTitle=void 0;var t=r(d[0]);Object.defineProperty(e,"StackScreenTitle",{enumerable:!0,get:function(){return t.StackScreenTitle}}),Object.defineProperty(e,"appendStackScreenTitlePropsToOptions",{enumerable:!0,get:function(){return t.appendStackScreenTitlePropsToOptions}});var n=r(d[1]);Object.defineProperty(e,"StackScreenBackButton",{enumerable:!0,get:function(){return n.StackScreenBackButton}}),Object.defineProperty(e,"appendStackScreenBackButtonPropsToOptions",{enumerable:!0,get:function(){return n.appendStackScreenBackButtonPropsToOptions}})},775,[776,779]); 869__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.appendStackScreenTitlePropsToOptions=e.StackScreenTitle=void 0;const t=r(d[0]);e.StackScreenTitle=t.StackTitle,e.appendStackScreenTitlePropsToOptions=t.appendStackTitlePropsToOptions},776,[777]); 870__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackTitle=function({children:t,asChild:n,style:o,largeStyle:s,large:S}){const f=(0,l.useMemo)(()=>c({},{children:t,asChild:n,style:o,largeStyle:s,large:S}),[t,n,o,s,S]);return(0,h.useCompositionOption)(f),null},e.appendStackTitlePropsToOptions=c;const t=r(d[0]),l=r(d[1]),n=r(d[2]),o=r(d[3]),h=r(d[4]),s=r(d[5]);function c(l,h){const c=n.StyleSheet.flatten(h.style),S=n.StyleSheet.flatten(h.largeStyle);let f=h.asChild?{headerTitle:()=>(0,t.jsx)(t.Fragment,{children:h.children})}:{title:(0,o.convertChildrenToString)(h.children)};return h.asChild&&'string'==typeof h.children&&(f={}),h.asChild||null==h.children||(0,o.areAllChildrenPrimitiveValues)(h.children)||(f={}),{...l,...f,headerLargeTitle:h.large,...void 0!==c?.textAlign?{headerTitleAlign:c.textAlign}:{},headerTitleStyle:{...c,...c?.fontWeight?{fontWeight:(0,s.convertFontWeightToStringFontWeight)(c?.fontWeight)}:{}},headerLargeTitleStyle:{...S,...S?.fontWeight?{fontWeight:(0,s.convertFontWeightToStringFontWeight)(S?.fontWeight)}:{}}}}},777,[6,11,263,762,703,778]); 871__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.convertFontWeightToStringFontWeight=function(t){if('number'==typeof t)return String(t);return t}},778,[]); 872__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackScreenBackButton=function({children:o,style:s,withMenu:u,displayMode:l,hidden:h,src:B}){const p=(0,n.useMemo)(()=>c({},{children:o,style:s,withMenu:u,displayMode:l,hidden:h,src:B}),[o,s,u,l,h,B]);return(0,t.useCompositionOption)(p),null},e.appendStackScreenBackButtonPropsToOptions=c;const n=r(d[0]),t=r(d[1]);function c(n,t){return{...n,headerBackTitle:t.children,headerBackTitleStyle:t.style,headerBackImageSource:t.src,headerBackButtonDisplayMode:t.displayMode,headerBackButtonMenuEnabled:t.withMenu,headerBackVisible:!t.hidden}}},779,[11,703]); 873__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StackScreen=void 0,e.validateStackPresentation=f,e.appendScreenStackPropsToOptions=function(t,S){let u={...t,...S.options};function k(t,n){if((0,l.isChildOfType)(t,o.StackHeaderComponent))return(0,o.appendStackHeaderPropsToOptions)(n,t.props);if((0,l.isChildOfType)(t,c.StackTitle))return(0,c.appendStackTitlePropsToOptions)(n,t.props);if((0,l.isChildOfType)(t,p.StackScreenBackButton))return(0,p.appendStackScreenBackButtonPropsToOptions)(n,t.props);if((0,l.isChildOfType)(t,s.StackToolbar)){if('bottom'===(t.props.placement??'bottom'))throw new Error("Stack.Toolbar with placement=\"bottom\" cannot be used inside Stack.Screen.");return(0,s.appendStackToolbarPropsToOptions)(n,t.props)}
873const S='function'==typeof t.type?t.type.name||'Unknown':String(t.type);return console.warn(`Unknown child element passed to Stack.Screen: ${S}`),n}return f(u),n.Children.forEach(S.children,t=>{(0,n.isValidElement)(t)&&(u=k(t,u))}),u};const t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3]),p=r(d[4]),s=r(d[5]),l=r(d[6]),S=r(d[7]);e.StackScreen=Object.assign(function({children:o,options:c,...p}){const s=(0,n.useMemo)(()=>f('function'==typeof c?{}:c??{}),[c]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.Screen,{...p,options:s}),o]})},{Title:c.StackTitle,BackButton:p.StackScreenBackButton});const u=['card','modal','transparentModal','containedModal','containedTransparentModal','fullScreenModal','formSheet','pageSheet'];function f(t){if('function'==typeof t)return(...n)=>{const o=t(...n);return f(o),o};const n=t.presentation;if(n&&!u.includes(n))throw new Error(`Invalid presentation value "${n}" passed to Stack.Screen. Valid values are: ${u.map(t=>`"${t}"`).join(', ')}.`);return t}},780,[6,11,754,777,775,756,527,740]); 874__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var c=Object.getOwnPropertyDescriptor(n,o);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,c)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var c={};if(null!=i)for(var l=t(i),s=0;s<l.length;s++)"default"!==l[s]&&n(c,i,l[s]);return o(c,i),c});Object.defineProperty(e,"__esModule",{value:!0}),e.mapProtectedScreen=function t(n){return{...n,children:l.Children.toArray(n.children).map((o,i)=>{if((0,p.isChildOfType)(o,u.StackScreen)){const{children:t,options:n,...i}=o.props,l='function'==typeof n?(...o)=>(0,u.appendScreenStackPropsToOptions)(n(...o),{children:t}):(0,u.appendScreenStackPropsToOptions)(n??{},{children:t});return(0,c.jsx)(h.Screen,{...i,options:l},i.name)}return(0,p.isChildOfType)(o,f.Protected)?(0,c.jsx)(f.Protected,{...t(o.props)},`${i}-${n.guard}`):((0,p.isChildOfType)(o,s.StackHeaderComponent)||(l.default.isValidElement(o)?console.warn(`Unknown child element passed to Stack: ${o.type}`):console.warn(`Unknown child element passed to Stack: ${o}`)),null)}).filter(Boolean)}};const c=r(d[0]),l=i(r(d[1])),s=r(d[2]),u=r(d[3]),p=r(d[4]),f=r(d[5]),h=r(d[6])},781,[6,11,754,780,527,739,740]); 875__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,o,i){void 0===i&&(i=o);var c=Object.getOwnPropertyDescriptor(n,o);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,i,c)}:function(t,n,o,i){void 0===i&&(i=o),t[i]=n[o]}),o=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[n.length]=o);return n},t(n)},function(i){if(i&&i.__esModule)return i;var c={};if(null!=i)for(var s=t(i),l=0;l<s.length;l++)"default"!==s[l]&&n(c,i,s[l]);return o(c,i),c});Object.defineProperty(e,"__esModule",{value:!0}),e.ExpoRoot=function({wrapper:t=s.Fragment,...n}){(0,N.initScreensFeatureFlags)();const o=(0,s.useMemo)(()=>({children:n})=>(0,c.jsx)(t,{children:(0,c.jsx)(S.LinkPreviewContextProvider,{children:(0,c.jsx)(u.SafeAreaProvider,{initialMetrics:A,children:n})})}),[t]);return(0,c.jsx)(T,{...n,wrapper:o})};const c=r(d[0]),s=r(d[1]),l=r(d[2]),u=r(d[3]),h=r(d[4]),f=r(d[5]),p=r(d[6]),m=r(d[7]),v=r(d[8]),_=r(d[9]),j=r(d[10]),S=r(d[11]),x=r(d[12]),O=r(d[13]),w=r(d[14]),N=r(d[15]),b=r(d[16]),y=r(d[17]),P=r(d[18]),R=i(r(
875d[19])),A='web'===l.Platform.OS?{frame:{x:0,y:0,width:0,height:0},insets:{top:0,left:0,right:0,bottom:0}}:void 0,M={enabled:!1};const C='web'===l.Platform.OS&&'undefined'!=typeof window?new URL(window.location.href):void 0;function E(){(0,x.handleNavigationOnReady)(),m.store.onReady()}function T({context:t,location:n=C,wrapper:o=s.Fragment,linking:i={}}){const l=(0,s.useMemo)(()=>{let t={};const o='string'==typeof n?(0,b.parseUrlUsingCustomBase)(n):n;return o&&o instanceof URL&&(t={location:{pathname:o.pathname,search:o.search,hash:o.hash}}),t},[]),u=l.location?`${l.location.pathname}${l.location.search}${l.location.hash??''}`:void 0,h=(0,m.useStore)(t,i,u);return(0,f.useDomComponentNavigation)(),h.shouldShowTutorial()?(R.hideAsync(),null):(0,c.jsx)(_.StoreContext.Provider,{value:h,children:(0,c.jsx)(p.NavigationContainer,{ref:h.navigationRef,initialState:h.state,linking:h.linking,onUnhandledAction:L,onStateChange:h.onStateChange,documentTitle:M,onReady:E,children:(0,c.jsx)(v.ServerContext.Provider,{value:l,children:(0,c.jsx)(o,{children:(0,c.jsx)(U,{})})})})})}function U(){const t=[(0,c.jsx)(O.Screen,{name:h.INTERNAL_SLOT_NAME,component:m.store.rootComponent})];(0,j.shouldAppendNotFound)()&&t.push((0,c.jsx)(O.Screen,{name:h.NOT_FOUND_ROUTE_NAME,component:y.RootUnmatched})),(0,j.shouldAppendSitemap)()&&t.push((0,c.jsx)(O.Screen,{name:h.SITEMAP_ROUTE_NAME,component:P.Sitemap}));const{state:n,descriptors:o,NavigationContent:i}=(0,w.useNavigationBuilder)(w.StackRouter,{children:t,id:h.INTERNAL_SLOT_NAME});return(0,c.jsx)(i,{children:o[n.routes[n.index].key].render()})}let L;L=function(){}},782,[6,11,263,105,534,783,786,531,714,589,590,718,790,520,401,791,536,792,726,539]); 876__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.useDomComponentNavigation=function(){u.default.useEffect(()=>()=>{},[])};r(d[0]);const u=t(r(d[1]));r(d[2]),r(d[3])},783,[784,11,575,576]); 877__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},784,[785]); 878__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e._emitGlobalEvent=function(n){t.forEach(t=>t(n))},Object.defineProperty(e,"addGlobalDomEventListener",{enumerable:!0,get:function(){return n}});const t=new Set;const n=n=>(t.add(n),()=>{t.delete(n)})},785,[]); 879__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NavigationContainer=void 0;const n=r(d[0]),o=t(r(d[1])),l=r(d[2]),u=r(d[3]),s=r(d[4]),c=r(d[5]),f=r(d[6]),h=r(d[7]),S=r(d[8]),v=t(r(d[9]));globalThis.REACT_NAVIGATION_DEVTOOLS=new WeakMap,e.NavigationContainer=o.default.forwardRef(function({direction:t=(l.I18nManager.getConstants().isRTL?'rtl':'ltr'),theme:C=S.DefaultTheme,linking:T,fallback:_=null,documentTitle:p,onReady:P,onStateChange:x,...A},L){const k=!!T&&!1!==T.enabled;T?.config&&(0,S.validatePathConfig)(T.config);const F=o.default.useRef(null);(0,u.useBackButton)(F),(0,s.useDocumentTitle)(F,p),(0,h.useImperativeApiEmitter)(F);const[R,I]=o.default.useState(),{getInitialState:N}=(0,c.useLinking)(F,{enabled:k,prefixes:[],...T},I),b=o.default.useMemo(()=>({options:T}),[T]),E=o.default.useMemo(()=>({lastUnhandledLink:R,setLastUnhandledLink:I}),[R,I]),O=(0,v.default)(()=>{const t=F.current?.getCurrentRoute()?.path;I(n=>{if(n!==t)return n}),P?.()}),j=(0,v.default)(t=>{const n=F.current?.getCurrentRoute()?.path;I(t=>{if(t!==n)return t}),x?.(t)});o.default.useEffect(()=>{F.current&&REACT_NAVIGATION_DEVTOOLS.set(F.current,{get linking(){return{...T,enabled:k,prefixes:T?.prefixes??[],getStateFromPath:T?.getStateFromPath??S.getStateFromPath,getPathFromState:T?.getPathFromState??S.getPathFromState,getActionFromState:T?.getActionFromState??S.getActionFromState}}})});const[D,M]=(0,f.useThenable)(N);return o.default.useImperativeHandle(L,()=>F.current),null!=A.initialState||!k||D?(0,n.jsx)(S.LocaleDirContext.Provider,{value:t,children:(0,n.jsx)(S.UNSTABLE_UnhandledLinkingContext.Provider,{value:E,children:(0,n.jsx)(S.LinkingContext.Provider,{value:b,children:(0,n.jsx)(S.BaseNavigationContainer,{...A,theme:C,onReady:O,onStateChange:j,initialState:null==A.initialState?M:A.initialState,ref:F})})})}):(0,n.jsx)(S.ThemeProvider,{value:C,children:_})})},786,[6,11,263,787,788,712,789,563,401,405]); 880__d(function(g,r,i,a,m,e,d){"use strict";
880Object.defineProperty(e,"__esModule",{value:!0}),e.useBackButton=function(t){}},787,[]); 881__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,u)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var i=e(o),c=0;c<i.length;c++)"default"!==i[c]&&t(u,o,i[c]);return n(u,o),u});Object.defineProperty(_e,"__esModule",{value:!0}),_e.useDocumentTitle=function(e,{enabled:t=!0,formatter:n=(e,t)=>e?.title??t?.name}={}){u.useEffect(()=>{if(!t)return;const o=e.current;if(o){const e=n(o.getCurrentOptions(),o.getCurrentRoute());document.title=e}return o?.addListener('options',e=>{const t=n(e.data.options,o?.getCurrentRoute());document.title=t})})};const u=o(r(d[0]))},788,[11]); 882__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,u,i){void 0===i&&(i=u);var o=Object.getOwnPropertyDescriptor(n,u);o&&!("get"in o?!n.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,i,o)}:function(t,n,u,i){void 0===i&&(i=u),t[i]=n[u]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[n.length]=u);return n},t(n)},function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var c=t(i),l=0;l<c.length;l++)"default"!==c[l]&&n(o,i,c[l]);return u(o,i),o});Object.defineProperty(e,"__esModule",{value:!0}),e.useThenable=function(t){const[n]=o.useState(t);let u=[!1,void 0];n.then(t=>{u=[!0,t]});const[i,c]=o.useState(u),[l]=i;return o.useEffect(()=>{let t=!1;return l||(async()=>{let u;try{u=await n}finally{t||c([!0,u])}})(),()=>{t=!0}},[n,l]),i};const o=i(r(d[0]))},789,[11]); 883__d(function(g,r,i,a,m,_e,d){"use strict";
883Object.defineProperty(_e,"__esModule",{value:!0}),_e.handleNavigationOnReady=function(){n&&n();n=e.storeRef.current.navigationRef.addListener('__unsafe_action__',n=>{if(!n.data.noop&&e.storeRef.current.state){const o=n.data.action;(0,t.emit)('actionDispatched',{actionType:o.type,payload:o.payload,state:e.storeRef.current.state})}})};const t=r(d[0]),e=r(d[1]);let n},790,[595,532]); 884__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.initScreensFeatureFlags=function(){o||(o=!0,s.featureFlags.experiment.synchronousScreenUpdatesEnabled=!u,s.featureFlags.experiment.synchronousHeaderConfigUpdatesEnabled=!u,s.featureFlags.experiment.synchronousHeaderSubviewUpdatesEnabled=!u)};const n=t(r(d[0])),s=r(d[1]),u=!!n.default.expoConfig?.extra?.router?.disableSynchronousScreensUpdates;let o=!1;s.featureFlags.experiment.iosPreventReattachmentOfDismissedScreens=!0},791,[542,655]); 885__d(function(g,r,_i,a,_m,e,d){"use strict";var t,n=this&&this.__createBinding||(Object.create?function(t,n,i,o){void 0===o&&(o=i);var u=Object.getOwnPropertyDescriptor(n,i);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,o,u)}:function(t,n,i,o){void 0===o&&(o=i),t[o]=n[i]}),i=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||(t=function(n){return t=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},t(n)},function(o){if(o&&o.__esModule)return o;var u={};if(null!=o)for(var c=t(o),f=0;f<c.length;f++)"default"!==c[f]&&n(u,o,c[f]);return i(u,o),u});Object.defineProperty(e,"__esModule",{value:!0}),e.RootUnmatched=function(){return(0,c.useEffect)(()=>{l.hideAsync()},[]),(0,u.jsx)(f.Unmatched,{})};const u=r(d[0]),c=r(d[1]),f=r(d[2]),l=o(r(d[3]))},792,[6,11,735,540]); 886__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorBoundary=function({error:u,retry:w}){const y=(0,o.use)(c.BottomTabBarHeightContext)?l.View:n.SafeAreaView,S=u instanceof h.ReactServerError;return(0,t.jsx)(l.View,{style:b.container,children:(0,t.jsxs)(y,{style:{flex:1,gap:8,maxWidth:720,marginHorizontal:'auto'},children:[S?(0,t.jsx)(f,{error:u}):(0,t.jsx)(x,{error:u}),(0,t.jsx)(l.View,{style:{flex:1}}),!1,(0,t.jsx)(s.Pressable,{testID:"router_error_retry",onPress:w,children:({hovered:o,pressed:n})=>(0,t.jsx)(l.View,{style:[b.buttonInner,(o||n)&&{backgroundColor:'white'}],children:(0,t.jsx)(l.Text,{style:[b.buttonText,{color:o||n?'black':'white'}],children:"Retry"})})})]})})};
886const t=r(d[0]),o=r(d[1]),l=r(d[2]),n=r(d[3]),s=r(d[4]),c=(r(d[5]),r(d[6])),h=r(d[7]);function x({error:o}){return(0,t.jsxs)(l.View,{style:{marginBottom:12,gap:4,flexWrap:'wrap'},children:[(0,t.jsx)(l.Text,{role:"heading","aria-level":1,style:b.title,children:"Something went wrong"}),(0,t.jsxs)(l.Text,{testID:"router_error_message",role:"heading","aria-level":2,style:b.errorMessage,children:["Error: ",o.message]})]})}const u={404:'NOT_FOUND',500:'INTERNAL_SERVER_ERROR',503:'SERVICE_UNAVAILABLE',504:'GATEWAY_TIMEOUT'};function f({error:o}){let n=String(o.statusCode);n+=': '+(u[o.statusCode]??'Server Error');const s=o.headers.get('cf-ray'),c=o.headers.get('Date');return(0,t.jsxs)(l.View,{style:{padding:12,gap:8},children:[(0,t.jsx)(l.Text,{selectable:!0,allowFontScaling:!0,style:{fontSize:l.Platform.select({web:24,default:16}),fontWeight:'bold',marginBottom:4,color:'white'},children:n}),(0,t.jsx)(l.ScrollView,{style:{borderColor:'rgba(255,255,255,0.5)',borderTopWidth:l.StyleSheet.hairlineWidth,borderBottomWidth:l.StyleSheet.hairlineWidth,maxHeight:150},contentContainerStyle:{paddingVertical:4},children:(0,t.jsx)(l.Text,{testID:"router_error_message",selectable:!0,allowFontScaling:!0,style:{color:'white'},children:o.message})}),(0,t.jsx)(w,{title:"Code",right:o.statusCode}),s&&(0,t.jsx)(w,{title:"ID",right:s}),c&&(0,t.jsx)(w,{title:"Date",right:c}),o.url&&(0,t.jsx)(l.Text,{selectable:!0,allowFontScaling:!0,style:{fontSize:14,opacity:.5,color:'white'},children:o.url})]})}function w({title:o,right:n}){const s={fontSize:16,color:'white'};return(0,t.jsxs)(l.View,{style:{flexDirection:'row',justifyContent:'space-between'},children:[(0,t.jsx)(l.Text,{selectable:!0,allowFontScaling:!0,style:s,children:o}),n&&(0,t.jsx)(l.Text,{selectable:!0,allowFontScaling:!0,style:[s,b.code],children:n})]})}const b=l.StyleSheet.create({container:{flex:1,backgroundColor:'black',padding:24,alignItems:'stretch',justifyContent:'center'},title:{color:'white',fontSize:l.Platform.select({web:32,default:24}),fontWeight:'bold'},buttonText:{fontSize:18,fontWeight:'bold',color:'black',...l.Platform.select({web:{transitionDuration:'100ms'}})},buttonInner:{...l.Platform.select({web:{transitionDuration:'100ms'}}),paddingVertical:12,paddingHorizontal:24,borderColor:'white',borderWidth:2,marginLeft:8,justifyContent:'center',alignItems:'center'},code:{fontFamily:l.Platform.select({default:'Courier',ios:'Courier New',android:'monospace'}),fontWeight:'500'},errorMessage:{color:'white',fontSize:16},subtitle:{color:'white',fontSize:14,marginBottom:12},link:{color:'rgba(255,255,255,0.4)',textDecorationStyle:'solid',textDecorationLine:'underline',fontSize:14,textAlign:'center'}})},793,[6,11,263,105,728,689,598,688]); 887__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useIsFocused=void 0;var u=r(d[0]);Object.defineProperty(e,"useIsFocused",{enumerable:!0,get:function(){return u.useIsFocused}})},794,[401]); 888__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LocaleProvider=function({direction:t,children:c}){return(0,n.jsx)(o.LocaleDirContext.Provider,{value:t,children:c})};const n=r(d[0]),o=r(d[1])},795,[6,499]); 889__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unstable_createStandardRouterNavigator=function(t,n,...s){return f((0,o.createStandardNavigator)(t),n,...s)},e.unstable_integrateWithRouter=f;const t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),u=r(d[4]),c=r(d[5]),v=r(d[6]),l=r(d[7]),h=r(d[8]),p=r(d[9]),N=1,y='standard';function f(o,N,...[y]){b(o);const{NavigatorContent:f}=o;return(0,h.withLayoutContext)(function(o){const{unstable_screenErrorBoundary:h,...b}=o,_=b,{extraProps:w,useNavigationBuilderProps:B}=S(_),{state:C,navigation:x,descriptors:E,describe:L,NavigationContent:P}=(0,p.useNavigationBuilder)(N,B),{dispatch:j}=x,k=(0,n.useMemo)(()=>y?.createProps?.({state:C,dispatch:j,navigation:x})??{},[C,j,x,y]),R={state:(0,l.useStandardState)(C),descriptors:(0,u.useProjectedDescriptors)(C,E,L),actions:(0,c.useStandardActions)(x,C.key),emitter:(0,v.useStandardEmitter)(x)},T=(0,t.jsx)(P,{children:(0,t.jsx)(f,{...w,...k,...R})});return h?(0,t.jsx)(s.ScreenErrorBoundaryContext,{value:h,children:T}):T},void 0,y?.useOnlyUserDefinedScreens)}function S(t){const{id:n,children:o,initialRouteName:s,layout:u,ref:c,screenLayout:v,screenListeners:l,screenOptions:h,UNSTABLE_routeNamesChangeBehavior:p,UNSTABLE_router:N,...y}=t,f={id:n,children:o,initialRouteName:s,layout:u,screenLayout:v,screenListeners:l,screenOptions:h,UNSTABLE_routeNamesChangeBehavior:p,UNSTABLE_router:N};return{extraProps:y,useNavigationBuilderProps:{...y,...f}}}function b(t){if(null==t)throw new Error("Could not integrate a standard navigator because no navigator was provided. Pass the object returned by `createStandardNavigator(...)` from the `standard-navigation` package, or use `unstable_createStandardRouterNavigator(NavigatorContent, router)` which creates it for you.");const{type:n,version:o}=t;if(n!==y)throw new Error(`Could not integrate a standard navigator because its \`type\` is ${JSON.stringify(n)}, not "standard". This value is likely not a standard-navigation navigator. Create it with \`createStandardNavigator(...)\` from the \`standard-navigation\` package, or use \`unstable_createStandardRouterNavigator(NavigatorContent, router)\`.`);o!==N&&console.warn(`This standard navigator targets the standard-navigation v${o} contract, but this version of expo-router was built against v${N}. Integration may still work, but if you hit unexpected navigation behavior, align the installed \`standard-navigation\` version with your expo-router version, or check the standard-navigation release notes for migration steps.`)}},796,[6,11,797,256,798,800,801,802,261,401]); 890__d(function(g,r,i,a,m,e,d){"use strict";
890Object.defineProperty(e,'__esModule',{value:!0}),e.createStandardNavigator=function(t){return{type:'standard',version:1,NavigatorContent:t}},r(d[0])},797,[11]); 891__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useProjectedDescriptors=function(n,s,u){const c=(0,o.getPreloadedRoutes)(n);return(0,t.useMemo)(()=>{if(0===c.length)return s;const t={...s};for(const o of c)t[o.key]=t[o.key]??u(o,!0);return t},[s,c,u])};const t=r(d[0]),o=r(d[1])},798,[11,799]); 892__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPreloadedRoutes=function(o){if('stack'===o.type&&'preloadedRoutes'in o&&Array.isArray(o.preloadedRoutes))return o.preloadedRoutes;return t};const t=[]},799,[]); 893__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useStandardActions=function(n,s){return(0,t.useMemo)(()=>({back:()=>{n.dispatch({type:'GO_BACK',target:s})},navigate:(t,c)=>{n.dispatch({type:'NAVIGATE',payload:{name:t,params:c},target:s})}}),[n,s])};const t=r(d[0])},800,[11]); 894__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useStandardEmitter=function(n){return(0,t.useMemo)(()=>({emit(t){const u=n.emit(t),l={type:t.type,data:t.data,target:t.target};return'defaultPrevented'in u?Object.defineProperties(l,{defaultPrevented:{enumerable:!0,get:()=>u.defaultPrevented},preventDefault:{enumerable:!0,value:u.preventDefault}}):l}}),[n])};const t=r(d[0])},801,[11]); 895__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useStandardState=function(u){const o=(0,s.useBuildHref)();return(0,t.useMemo)(()=>{const t=[...u.routes,...(0,n.getPreloadedRoutes)(u)];return{index:u.index,routes:t.map(t=>({href:o(t),key:t.key,name:t.name,params:t.params}))}},[u,o])};const t=r(d[0]),n=r(d[1]),s=r(d[2])},802,[11,799,803]); 896__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useBuildHref=function(){const o=(0,s.useStateForPath)();return(0,t.useMemo)(()=>{const t=new WeakMap;return s=>{const u=t.get(s);if(void 0!==u)return u;const c={routes:[{name:s.name,params:s.params}]},f=t=>{const n=t?.routes[0];return n?{routes:[{...n,state:f(n.state)}]}:c},p=(0,n.getRouteInfoFromState)(f(o)).pathnameWithParams;return t.set(s,p),p}},[o])};const t=r(d[0]),n=r(d[1]),s=r(d[2])},803,[11,533,403]); 897__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,o,u){void 0===u&&(u=o);var c=Object.getOwnPropertyDescriptor(n,o);c&&!("get"in c?!n.__esModule:c.writable||c.configurable)||(c={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,u,c)}:function(t,n,o,u){void 0===u&&(u=o),t[u]=n[o]}),n=this&&this.__exportStar||function(n,o){for(var u in n)"default"===u||Object.prototype.hasOwnProperty.call(o,u)||t(o,n,u)},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Tabs=void 0;const u=o(r(d[0]));e.Tabs=u.default;const c=r(d[1]);n(r(d[2]),e),u.default.Screen=c.Screen,e.default=u.default},804,[805,740,598]); 898__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),s=r(d[4]),u=r(d[5]),c=(0,s.createBottomTabNavigator)().Navigator,f=(0,o.withLayoutContext)(c,o=>o.map(o=>{if('function'!=typeof o.options&&void 0!==o.options?.href){const{href:s,...u}=o.options;if(u.tabBarButton)throw new Error('Cannot use `href` and `tabBarButton` together.');return{...o,options:{...u,tabBarItemStyle:null==s?{display:'none'}:u.tabBarItemStyle,tabBarButton:o=>{if(null==s)return null;const u='web'===n.Platform.OS?o.children:(0,t.jsx)(n.Pressable,{children:o.children});return(0,t.jsx)(l.Link,{...o,style:[{display:'flex'},o.style],href:s,asChild:'web'!==n.Platform.OS,children:u})}}}}return o})),h=Object.assign(n=>(0,t.jsx)(f,{...n}),{Screen:f.Screen,Protected:u.Protected});e.default=h},805,[6,263,261,689,598,739]); 899__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};
899Object.defineProperty(e,"__esModule",{value:!0}),e.ExperimentalStack=void 0;const u=r(d[0]),c=t(r(d[1])),n=Object.assign(t=>(0,u.jsx)(c.default,{...t}),{Screen:c.default.Screen,Protected:c.default.Protected});e.ExperimentalStack=n,e.default=n},806,[6,807]); 900__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Stack=void 0;const l=t(r(d[0]));e.Stack=l.default;const u=r(d[1]);l.default.Screen=u.StackScreen,l.default.Header=u.StackHeader,l.default.Title=u.StackTitle,l.default.Toolbar=u.StackToolbar,e.default=l.default},807,[808,753]); 901__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const u=t(r(d[0]));e.default=u.default},808,[809]); 902__d(function(g,r,i,a,m,e,d){"use strict";var t=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const u=t(r(d[0]));e.default=u.default},809,[259]); 903__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Stack=void 0;var t=r(d[0]);Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return t.Stack}})},810,[807]); 904__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,o,s){void 0===s&&(s=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,s,u)}:function(t,n,o,s){void 0===s&&(s=o),t[s]=n[o]}),n=this&&this.__exportStar||function(n,o){for(var s in n)"default"===s||Object.prototype.hasOwnProperty.call(o,s)||t(o,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.useIsPreview=e.usePreventZoomTransitionDismissal=void 0,n(r(d[0]),e);var o=r(d[1]);Object.defineProperty(e,"usePreventZoomTransitionDismissal",{enumerable:!0,get:function(){return o.usePreventZoomTransitionDismissal}});var s=r(d[2]);Object.defineProperty(e,"useIsPreview",{enumerable:!0,get:function(){return s.useIsPreview}})},811,[689,812,528]); 905__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.usePreventZoomTransitionDismissal=function(n){}},812,[]); 906__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,o,u){void 0===u&&(u=o);var l=Object.getOwnPropertyDescriptor(n,o);l&&!("get"in l?!n.__esModule:l.writable||l.configurable)||(l={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,u,l)}:function(t,n,o,u){void 0===u&&(u=o),t[u]=n[o]}),n=this&&this.__exportStar||function(n,o){for(var u in n)"default"===u||Object.prototype.hasOwnProperty.call(o,u)||t(o,n,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.Color=void 0;r(d[0]),r(d[1]);n(r(d[2]),e),n(r(d[3]),e),n(r(d[4]),e),n(r(d[5]),e),n(r(d[6]),e);const o=new Proxy({},{get:(t,n)=>null}),u=new Proxy({},{get:(t,n)=>null}),l=new Proxy({},{get:(t,n)=>null}),c=new Proxy({},{get:(t,n)=>null}),s=new Proxy({get attr(){return u},get material(){return l},get dynamic(){return c}},{get:(t,n)=>n in t?t[n]:null});e.Color={get ios(){return o},get android(){return s}}},813,[263,814,815,816,817,818,819]); 907__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Material3DynamicColor=function(n){return null},e.Material3Color=function(n){return null}},814,[]); 908__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},815,[]); 909__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},816,[]); 910__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},817,[]); 911__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},818,[]); 912__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},819,[]); 913__d(function(g,r,i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NOT_DEPLOYED_CODE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"NOT_DEPLOYED_FALLBACK",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"COMING_SOON_HEADLINE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"FEATURE_ABSENT_HEADLINES",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"STRATEGY_BUILDER_LABEL",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"STRATEGY_BUILDER_ROUTE",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"SCANS_ROUTE",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"RESEARCH_POLL_MS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"NOT_DEPLOYED_POLL_MS",{enumerable:!0,get:function(){return f}}),e.isNotDeployed=m,e.notDeployedMessage=p,e.researchInfo=function(o,s={}){if(m(o))return{status:'not_deployed',message:p(o)};if(s.errorCode===t){return{status:'not_deployed',message:String(s.error||'').trim()||n}}if(_(o)){const t=o.research_status,n='on'===o.research_studies||'off'===o.research_studies?{studies:o.research_studies}:{};return'string'==typeof t&&y.includes(t)?{status:t,message:'',...n}:!0===o.served_from_cache||!0===o.unreachable?{status:'unreachable',message:'',...n}:{status:'ok',message:'',...n}}return s.error?{status:'unreachable',message:''}:{status:null,message:''}},Object.defineProperty(e,"shouldPollScanner",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"statusPollMs",{enumerable:!0,get:function(){return O}}),e.pollDue=function(t,n,o){return!n||o-n>=O(t)-1e3},Object.defineProperty(e,"showsOutage",{enumerable:!0,get:function(){return h}}),e.comingSoonView=function(t,s){const c=String(t||'').trim()||n,l=String(s||'').trim()||o;return{tone:'info',headline:l,message:c,action:{label:u,route:a},a11y:`${l}. ${c}`}},e.featureAbsentHeadline=function(t,u,a){const c=u?.status;return'not_deployed'===c?o:null!=c||String(a||'').trim()&&String(a).trim()!==n?s[t]:o},e.navTag=function(t,n){return t===c&&'not_deployed'===n?{text:'Soon',a11y:'coming soon'}:null},e.notDeployedPill=function(t,o=!1){const s=String(t||'').trim()||n;return{text:o?'Scans soon':'Chart scans: coming soon',line:'Chart-pattern scans: coming to the cloud',label:`Chart-pattern scans: coming soon. ${s}`}},e.pageNotDeployed=function(t,...o){if('not_deployed'===t?.status)return String(t.message||'').trim()||n;for(const t of o)if(m(t))return p(t);return null},Object.defineProperty(e,"asList",{enumerable:!0,get:function(){return E}}),e.refusedNotDeployed=function(n){return _(n)&&n.code===t?p({code:t,message:n.message,error:n.error}):null},Object.defineProperty(e,"NOT_AVAILABLE_CODE",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"STUDIES_OFF_TEXT",{enumerable:!0,get:function(){return S}}),e.studiesOff=function(t){return _(t)&&(t.code===P||m(t))?S:null},e.studiesOffFor=function(t,n){return n||('not_deployed'===t?.status||'off'===t?.studies?S:null)};const t='NOT_DEPLOYED',n='Chart-pattern scans are not on the cloud yet. F&O strategies, option chains and the Strategy Builder work normally.',o='Chart-pattern scans are coming to the cloud',s={history:'Pattern history isn\u2019t available on this server yet',drawings:'Drawing review isn\u2019t available on this server yet'},u='Open the Strategy Builder',a='/strategies',c='/discover',l=6e4,f=3e5,y=['ok','starting','unreachable','not_deployed'],_=t=>!!t&&'object'==typeof t;function m(n){return!!_(n)&&('not_deployed'===n.research_status||n.code===t)}function p(t){if(_(t)&&m(t))for(const n of['message','research_message','error']){const o='string'==typeof t[n]?t[n].trim():'';if(o)return o}return n}const b=t=>'not_deployed'!==t,O=t=>'not_deployed'===t?f:l;const h=t=>'not_deployed'!==t;const E=t=>Array.isArray(t)?t:[];const P='NOT_AVAILABLE',S='Replay and simulation are not available on this server yet.'},820,[]); 914__d(function(g,r,i,a,_m,_e,d){"use strict";
914function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"NIGHT",{enumerable:!0,get:function(){return F}}),Object.defineProperty(_e,"DAY",{enumerable:!0,get:function(){return x}}),_e.readTheme=B,Object.defineProperty(_e,"THEME",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"C",{enumerable:!0,get:function(){return j}}),_e.setTheme=function(e){if(!A)return;try{window.localStorage.setItem(C,e)}catch{}window.location.reload()},Object.defineProperty(_e,"s",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"BREAKPOINTS",{enumerable:!0,get:function(){return S}}),_e.layoutMode=k,_e.useLayoutMode=function(){const{width:e}=(0,h.default)();return k(e)},_e.T=w,_e.Icon=z,_e.Button=H,_e.Chip=function({label:e,active:t,onPress:n,icon:o}){const s=!!t;return(0,y.jsxs)(l.default,{accessibilityRole:"button",accessibilityState:{selected:s},'aria-pressed':s,accessibilityLabel:e,onPress:n,style:({pressed:e})=>[D.row,{minHeight:44,borderRadius:11,paddingHorizontal:14,paddingVertical:9,borderWidth:1,borderColor:t?j.green:j.line,backgroundColor:t?j.soft:j.paper,opacity:e?.7:1,gap:7}],children:[o&&(0,y.jsx)(z,{name:o,size:15,color:t?j.green:j.muted}),(0,y.jsx)(w,{style:{fontSize:12,fontFamily:'InterMedium',color:t?j.green:j.muted},children:e})]})},_e.Checkbox=function({checked:e,onChange:t,label:o,detail:s,children:c,disabled:u=!1,tone:f=j.green,style:h}){return(0,y.jsxs)(l.default,{role:"checkbox","aria-checked":e,"aria-disabled":u,accessibilityState:{checked:e,disabled:u},accessibilityLabel:o,disabled:u,onPress:()=>t(!e),style:({pressed:e})=>[D.row,{minHeight:44,paddingVertical:8,alignItems:'flex-start',opacity:u?.42:e?.72:1},h],children:[(0,y.jsx)(n.default,{style:{width:20,height:20,marginTop:1,borderRadius:5,borderWidth:1.5,borderColor:e?f:j.muted,backgroundColor:e?f:'transparent',alignItems:'center',justifyContent:'center'},children:e&&(0,y.jsx)(z,{name:"check",size:14,color:j.onGreen})}),(0,y.jsxs)(n.default,{style:{flex:1,gap:2},children:[c??(0,y.jsx)(w,{style:{fontSize:12,lineHeight:20,color:e?f:j.ink},children:o}),!!s&&(0,y.jsx)(w,{style:{fontSize:11,color:j.muted},children:s})]})]})},_e.Badge=function({label:e,tone:t="green",dot:o=!1}){const l='amber'===t?j.amber:'red'===t?j.red:'neutral'===t?j.muted:j.green;return(0,y.jsxs)(n.default,{style:[D.row,{alignSelf:'flex-start',maxWidth:'100%',gap:5,backgroundColor:'amber'===t?j.amberBg:'neutral'===t?j.bg:j.soft,borderRadius:6,paddingHorizontal:8,paddingVertical:4}],children:[o&&(0,y.jsx)(n.default,{style:{width:5,height:5,borderRadius:3,backgroundColor:l}}),(0,y.jsx)(w,{style:{fontSize:10,lineHeight:15,fontFamily:'InterSemi',color:l,flexShrink:1},children:e})]})},_e.Stat=function({label:e,value:t,note:o,color:l,size:s=24}){return(0,y.jsxs)(n.default,{style:{gap:4,flex:1,minWidth:95},children:[(0,y.jsx)(w,{style:{fontSize:11,color:j.muted},children:e}),(0,y.jsx)(w,{style:{fontFamily:'ManropeBold',fontSize:s,lineHeight:s+7,letterSpacing:-.5,color:l||j.ink},children:t}),o&&(0,y.jsx)(w,{style:{fontSize:10,color:j.muted,lineHeight:16},children:o})]})},_e.Empty=function({icon:e="search",title:t,detail:o,action:l}){return(0,y.jsxs)(n.default,{style:[D.card,{alignItems:'center',paddingVertical:40}],children:[(0,y.jsx)(n.default,{style:{padding:18,backgroundColor:j.soft,borderRadius:22},children:(0,y.jsx)(z,{name:e,size:25,color:j.green})}),(0,y.jsx)(w,{style:{fontFamily:'ManropeBold',fontSize:20,textAlign:'center'},children:t}),(0,y.jsx)(w,{style:{color:j.muted,textAlign:'center',maxWidth:420},children:o}),l]})},_e.Loading=function(){return(0,y.jsxs)(n.default,{style:{padding:60,alignItems:'center',gap:15},children:[(0,y.jsx)(c.default,{color:j.green}),(0,y.jsx)(w,{style:D.muted,children:"Reading your market\u2026"})]})},_e.Sheet=function({visible:e,onClose:o,title:c,subtitle:b,children:m,footer:F,wide:x=!1,inline:C=!1}){const{width:A,height:B}=(0,h.default)(),E=(0,p.useSafeAreaInsets)();if(C)return e?(0,y.jsxs)(n.default,{role:"region","aria-label":'string'==typeof c?c:'Panel',style:{backgroundColor:j.paper,borderWidth:1,borderColor:j.line,borderRadius:14,overflow:'hidden'},children:[(0,y.jsx)(n.default,{style:[D.between,{paddingHorizontal:22,paddingVertical:14,borderBottomWidth:1,borderColor:j.line}],children:(0,y.jsxs)(n.default,{style:{flex:1,gap:4},children:[(0,y.jsx)(w,{role:"heading","aria-level":2,style:{fontFamily:'ManropeBold',fontSize:20,lineHeight:27},children:c}),b&&(0,y.jsx)(w,{style:{fontSize:12,color:j.muted},children:b})]})}),(0,y.jsx)(n.default,{style:{padding:22,gap:18},children:m}),F&&(0,y.jsx)(n.default,{style:{padding:16,backgroundColor:j.dark,borderTopWidth:1,borderColor:j.line},children:F})]}):null;
914const k=t.default.useRef(null);t.default.useEffect(()=>{if('undefined'==typeof document)return;if(e)return void(k.current=document.activeElement);const t=k.current;k.current=null,t&&'function'==typeof t.focus&&document.contains(t)&&setTimeout(()=>{try{t.focus()}catch{}},0)},[e]);const z=A<S.sheet,v='string'==typeof c?c:'Panel';return(0,y.jsx)(u.default,{visible:e,onRequestClose:o,transparent:!0,animationType:"fade",children:(0,y.jsxs)(n.default,{style:{flex:1,backgroundColor:j.scrim,alignItems:z?'stretch':'flex-end',justifyContent:z?'flex-end':'center'},children:[(0,y.jsx)(l.default,{"aria-hidden":!0,accessible:!1,importantForAccessibility:"no-hide-descendants",focusable:!1,onPress:o,style:s.default.absoluteFill}),(0,y.jsxs)(n.default,{role:"dialog","aria-modal":!0,"aria-label":v,accessibilityViewIsModal:!0,importantForAccessibility:"yes",style:{backgroundColor:j.bg,width:z?'100%':x?Math.min(A-80,900):600,height:z?B-E.top-12:'100%',borderTopLeftRadius:24,borderTopRightRadius:z?24:0,paddingTop:z?8:E.top,minHeight:200},children:[(0,y.jsxs)(n.default,{style:[D.between,{paddingHorizontal:24,paddingVertical:18,borderBottomWidth:1,borderColor:j.line}],children:[(0,y.jsxs)(n.default,{style:{flex:1,gap:4},children:[(0,y.jsx)(w,{role:"heading","aria-level":2,style:{fontFamily:'ManropeBold',fontSize:23,lineHeight:31},children:c}),b&&(0,y.jsx)(w,{style:{fontSize:12,color:j.muted},children:b})]}),(0,y.jsx)(H,{label:"Close",accessibilityLabel:`Close ${v}`,icon:"x",kind:"outline",onPress:o})]}),(0,y.jsx)(f.default,{automaticallyAdjustKeyboardInsets:!0,keyboardDismissMode:"on-drag",keyboardShouldPersistTaps:"handled",contentContainerStyle:{padding:z?18:26,gap:20,paddingBottom:30},children:m},c+b),F&&(0,y.jsx)(n.default,{style:{padding:18,paddingBottom:Math.max(E.bottom,18),backgroundColor:j.paper,borderTopWidth:1,borderColor:j.line},children:F})]})]})})};var t=e(r(d[0])),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=e(r(d[5])),u=e(r(d[6])),f=e(r(d[7]));r(d[8]);var h=e(r(d[9])),b=e(r(d[10])),p=r(d[11]),m=r(d[12]),y=r(d[13]);const F={bg:'#050C11',paper:'#0B151C',ink:'#E9F1F5',muted:'#90A2AD',line:'#1B2B35',green:'#39E5A3',mint:'#B7F5DD',soft:'#0D2B25',amber:'#EBC66B',amberBg:'#282315',red:'#F17D87',dark:'#071219',onGreen:'#041B12',greenHover:'#5AF0B6',greenPress:'#2BC48A',redBg:'#2A1519',redLine:'#5A2A30',amberLine:'#4A3E1E',tealBg:'#0B1E22',greenLine:'#20413E',greenLine2:'#2D7158',greenFill:'#163E32',hoverBg:'#0F1F28',lineSoft:'#0F1B22',lineHover:'#2A4150',scrim:'#00070DD9',scrimStrong:'#00070DE6',shadow:'#000000',glass:'#0B151CB8',glassLine:'#FFFFFF1F',heatUp0:'#093128',heatUp1:'#0A7C48',heatUp2:'#51E293',heatUp3:'#60E9A4',heatDn0:'#1A151B',heatDn1:'#A63233',heatDn2:'#CC3D3B',heatDn3:'#FC9392',heatFlat:'#1B202A',heading:'#B9C6D3',ivLine:'#FF8A3D',refSpot:'#18E590',refUp:'#16F49C',refMp:'#F3D02F',refFut:'#69ACEC',blue:'#7FB7FF',blueBg:'#102334',purple:'#C9A2FF',curve:'#B4E6FF',boundary:'#68F2C2',swing:'#DFE8AA',heroA:'#10332F',heroB:'#0A171F',candleUp:'#26D69C',candleDn:'#E76A78',volUp:'#176A55',volDn:'#6D3440'},x={bg:'#F6F4EF',paper:'#FFFFFF',ink:'#1F1D1A',muted:'#5F5B54',line:'#E3DED4',green:'#0B6F50',mint:'#085A40',soft:'#E2F1EA',amber:'#7A5200',amberBg:'#FBF0D6',red:'#B72A37',dark:'#EEEAE1',onGreen:'#FFFFFF',greenHover:'#0A5F44',greenPress:'#084E39',redBg:'#FBE9EA',redLine:'#EBBFC3',amberLine:'#E5CF98',tealBg:'#E6F2EF',greenLine:'#BFD9CC',greenLine2:'#8FC2AC',greenFill:'#D3EBDF',hoverBg:'#F0ECE3',lineSoft:'#EFEAE0',lineHover:'#CFC8B9',scrim:'#1F1D1AB3',scrimStrong:'#1F1D1AD9',shadow:'#2B2418',glass:'#FFFFFFC2',glassLine:'#00000014',heatUp0:'#DDF3E8',heatUp1:'#9FE0C0',heatUp2:'#3FBF80',heatUp3:'#16935A',heatDn0:'#F8E2E2',heatDn1:'#F0A9A8',heatDn2:'#DE5A58',heatDn3:'#B8302E',heatFlat:'#EEEAE1',heading:'#4A5A6A',ivLine:'#C2560F',refSpot:'#0E9A5C',refUp:'#0B8A55',refMp:'#9A7A00',refFut:'#2F6FB0',blue:'#1F5FBF',blueBg:'#E3ECF8',purple:'#7440C2',curve:'#0B6A88',boundary:'#0A7A62',swing:'#6B6208',heroA:'#D6EBE1',heroB:'#EEF5F0',candleUp:'#0E8A62',candleDn:'#D0414F',volUp:'#8CCDB5',volDn:'#E9A7AE'},C='kanida/theme',A='undefined'!=typeof window&&'undefined'!=typeof document;function B(){try{if(A&&'day'===window.localStorage.getItem(C))return'day'}catch{}return'night'}const E=B(),j={...F};if(Object.assign(j,'day'===E?x:F),A)try{document.body.style.background=j.bg,document.documentElement.style.colorScheme='day'===E?'light':'dark';let e=document.querySelector('meta[name="theme-color"]');e||(e=document.createElement('meta'),e.setAttribute('name','theme-color'),document.head.appendChild(e)),e.setAttribute('content',j.bg)}catch{}const D=s.default.create({row:{flexDirection:'row',alignItems:'center',gap:10},between:{flexDirection:'row',alignItems:'center',justifyContent:'space-between',gap:12},card:{backgroundColor:j.paper,borderWidth:1,borderColor:j.line,borderRadius:14,padding:20,gap:16},line:{height:1,backgroundColor:j.line},muted:{color:j.muted},label:{fontFamily:'InterMedium',fontSize:11,letterSpacing:1.5,textTransform:'uppercase',color:j.muted},title:{fontFamily:'ManropeBold',fontSize:30,lineHeight:39,letterSpacing:-1,color:j.ink}
914,input:{fontFamily:'Inter',color:j.ink,fontSize:15,minHeight:48,paddingHorizontal:14,borderWidth:1,borderColor:j.line,borderRadius:12,backgroundColor:j.paper}}),S={desktop:1050,tablet:760,sheet:700};function k(e){return e>=S.desktop?'desktop':e>=S.tablet?'tablet':'phone'}function w({children:e,style:t,...n}){return(0,y.jsx)(o.default,{...n,style:[{fontFamily:'Inter',fontSize:14,lineHeight:21,color:j.ink},t],children:e})}function z({name:e,size:t=19,color:n=j.ink}){return(0,y.jsx)(b.default,{name:e,size:t,color:n})}const v={position:'absolute',width:1,height:1,overflow:'hidden',opacity:0};function H({label:e,onPress:n,kind:o="primary",icon:s,disabled:u=!1,loading:f=!1,style:h,accessibilityLabel:b,accessibilityState:p,accessibilityHint:F}){const x='primary'===o,C=t.default.useId(),A=(0,m.styleSlop)(h,{h:46}),B={};return null!=p?.selected&&(B['aria-pressed']=!!p.selected),null!=p?.expanded&&(B['aria-expanded']=!!p.expanded),F&&(B['aria-describedby']=C),(0,y.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:b||e,accessibilityState:p,accessibilityHint:F,...B,disabled:u||f,onPress:n,hitSlop:A,style:({pressed:e})=>[{minHeight:46,paddingHorizontal:17,paddingVertical:11,borderRadius:12,backgroundColor:x?j.green:'soft'===o?j.soft:'transparent',borderWidth:'outline'===o?1:0,borderColor:j.line,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:9,opacity:u?.42:e?.72:1},h],children:[(0,y.jsx)(m.HitArea,{slop:A}),f?(0,y.jsx)(c.default,{color:x?j.onGreen:j.green}):s?(0,y.jsx)(z,{name:s,size:17,color:x?j.onGreen:j.green}):null,(0,y.jsx)(w,{style:{fontFamily:'InterSemi',fontSize:13,color:x?j.onGreen:j.ink},children:e}),!!F&&(0,y.jsx)(w,{nativeID:C,style:v,children:F})]})}},821,[11,13,327,375,26,360,368,278,136,400,822,105,832,6]); 915__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},822,[823]); 916__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}});var t=e(r(d[0])),u=e(r(d[1])),f=e(r(d[2])),n=(0,t.default)(f.default,'feather',u.default)},823,[824,830,831]); 917__d(function(g,r,i,a,m,_e,_d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEFAULT_ICON_COLOR",{enumerable:!0,get:function(){return u.DEFAULT_ICON_COLOR}}),Object.defineProperty(_e,"DEFAULT_ICON_SIZE",{enumerable:!0,get:function(){return u.DEFAULT_ICON_SIZE}}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var e=(function(t){if(t&&t.__esModule)return t;var e={};return t&&Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),e.default=t,e})(r(_d[0])),n=t(r(_d[1])),o=t(r(_d[2])),s=t(r(_d[3])),u=r(_d[4]),c=t(u),d=t(r(_d[5])),f=r(_d[6]);function l(t,u,l,p){const _={[u]:l},y=(0,c.default)(t,u,null,p);return class c extends n.default.Component{static defaultProps=y.defaultProps;static Button=(0,d.default)(c);static glyphMap=t;static getRawGlyphMap=()=>t;static getFontFamily=()=>u;static loadFont=()=>e.loadAsync(_);static font=_;static getImageSource=async(n,o,c)=>{if('function'!=typeof e.renderToImageAsync)return console.warn("Font.renderToImageAsync is not available. Please update expo-font."),null;await e.loadAsync(_);const d=await e.renderToImageAsync(String.fromCodePoint(t[n]),{fontFamily:u,color:c,size:o});if('string'==typeof d){return{uri:d,width:o,height:o,scale:s.default.get()}}{const t=d;return{scale:s.default.get(),...t}}};_mounted=!1;state={fontIsLoaded:e.isLoaded(u)};async componentDidMount(){this._mounted=!0,this.state.fontIsLoaded||(await e.loadAsync(_),this._mounted&&this.setState({fontIsLoaded:!0}))}componentWillUnmount(){this._mounted=!1}setNativeProps(t){this._icon&&this._icon.setNativeProps(t)}render(){return this.state.fontIsLoaded?(0,f.jsx)(y,{ref:t=>{this._icon=t},...this.props}):(0,f.jsx)(o.default,{})}}}},824,[113,11,327,169,825,828,6]); 918__d(function(g,r,i,a,m,_e,d){"use strict";
918function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"NativeIconAPI",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"DEFAULT_ICON_SIZE",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"DEFAULT_ICON_COLOR",{enumerable:!0,get:function(){return h}});var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),u=e(r(d[4])),c=e(r(d[5])),l=e(r(d[6])),f=e(r(d[7])),s=e(r(d[8])),y=r(d[9]);const p=c.default.RNVectorIconsManager||c.default.RNVectorIconsModule,b=12,h='black';function I(e,c,I,F){const O=I?I.replace(/\.(otf|ttf)$/,''):c;class P extends t.PureComponent{root=null;static defaultProps={size:b,allowFontScaling:!1};render(){const{name:t,size:n,color:o,style:c,children:l,...f}=this.props;let s=t?e[t]||'?':'';'number'==typeof s&&(s=String.fromCodePoint(s));const p={fontSize:n,color:o},b={fontFamily:O,fontWeight:'normal',fontStyle:'normal'};return f.style=[p,c,b,F||{}],(0,y.jsxs)(u.default,{selectable:!1,...f,children:[s,l]})}}const S=(0,f.default)();function _(t){const n=e[t]||'?';return'number'==typeof n?String.fromCodePoint(n):n}return P.Button=(0,s.default)(P),P.getImageSource=async function(e,t=b,u=h){(0,l.default)();const c=_(e),f=(0,o.default)(u),s=`${c}:${t}:${f}`;if(S.has(s))return S.get(s);try{const e={uri:await p.getImageForFont(O,c,t,f),scale:n.default.get()};return S.setValue(s,e),e}catch(e){throw S.setError(s,e),e}},P.getImageSourceSync=function(e,t=b,u=h){(0,l.default)();const c=_(e),f=(0,o.default)(u),s=`${c}:${t}:${f}`;if(S.has(s))return S.get(s);try{const e={uri:p.getImageForFontSync(O,c,t,f),scale:n.default.get()};return S.setValue(s,e),e}catch(e){throw S.setError(s,e),e}},P.loadFont=async function(e=I){},P.hasIcon=function(t){return Object.prototype.hasOwnProperty.call(e,t)},P.getRawGlyphMap=function(){return e},P.getFontFamily=function(){return O},P}},825,[11,136,169,33,327,170,826,827,828,6]); 919__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),o=(e=t)&&e.__esModule?e:{default:e};const n=o.default.RNVectorIconsManager||o.default.RNVectorIconsModule;function u(){if(!n)throw new Error('The native RNVectorIcons API is not available, did you properly integrate the module? Please verify your autolinking setup and recompile.')}},826,[170]); 920__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});const t='value',n='error';function u(){const u=new Map;return{setValue:(n,s)=>u.set(n,{type:t,data:s}),setError:(t,s)=>u.set(t,{type:n,data:s}),has:t=>u.has(t),get:t=>{if(!u.has(t))return;const{type:s,data:o}=u.get(t);if(s===n)throw o;return o}}}},827,[]); 921__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}});var t=r(d[0]),s=e(r(d[1])),o=e(r(d[2])),n=e(r(d[3])),l=e(r(d[4])),c=r(d[5]),u=r(d[6]);const y=s.default.create({container:{flexDirection:'row',justifyContent:'flex-start',alignItems:'center',padding:8},touchable:{overflow:'hidden'},icon:{marginRight:10},text:{fontWeight:'600',backgroundColor:'transparent'}}),b='#007AFF',p=['ellipsizeMode','numberOfLines','textBreakStrategy','selectable','suppressHighlighting','allowFontScaling','adjustsFontSizeToFit','minimumFontScale'],f=['accessible','accessibilityLabel','accessibilityHint','accessibilityComponentType','accessibilityRole','accessibilityStates','accessibilityTraits','onFocus','onBlur','disabled','onPress','onPressIn','onPressOut','onLayout','onLongPress','nativeID','testID','delayPressIn','delayPressOut','delayLongPress','activeOpacity','underlayColor','selectionColor','onShowUnderlay','onHideUnderlay','hasTVPreferredFocus','tvParallaxProperties'];function h(e){return class extends t.PureComponent{static defaultProps={backgroundColor:b,borderRadius:5,color:'white',size:20};render(){const{style:t,iconStyle:s,children:b,...h}=this.props,P=(0,c.pick)(h,p,'style','name','size','color'),k=(0,c.pick)(h,f),x=(0,c.omit)(h,Object.keys(P),Object.keys(k),'iconStyle','borderRadius','backgroundColor');P.style=s?[y.icon,s]:y.icon;const j=(0,c.pick)(this.props,'color'),C=(0,c.pick)(this.props,'backgroundColor','borderRadius');return(0,u.jsx)(n.default,{style:[y.touchable,C],...k,children:(0,u.jsxs)(l.default,{style:[y.container,C,t],...x,children:[(0,u.jsx)(e,{...P}),'string'==typeof b?(0,u.jsx)(o.default,{style:[y.text,j],selectable:!1,
921children:b}):b]})})}}}},828,[11,26,327,390,13,829,6]); 922__d(function(g,r,i,a,m,e,d){m.exports={pick:(t,...c)=>c.flat().filter(c=>Object.prototype.hasOwnProperty.call(t,c)).reduce((c,o)=>(c[o]=t[o],c),{}),omit:(t,...c)=>{const o=new Set(c.flat());return Object.getOwnPropertyNames(t).filter(t=>!o.has(t)).reduce((c,o)=>(c[o]=t[o],c),{})}}},829,[]); 923__d(function(g,r,i,a,m,e,d){m.exports="/assets/node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Feather.ca4b48e04dc1ce10bfbddb262c8b835f.ttf"},830,[]); 924__d(function(e,r,o,i,a,l,t){a.exports={activity:61696,airplay:61697,"alert-circle":61698,"alert-octagon":61699,"alert-triangle":61700,"align-center":61701,"align-justify":61702,"align-left":61703,"align-right":61704,anchor:61705,aperture:61706,archive:61707,"arrow-down":61708,"arrow-down-circle":61709,"arrow-down-left":61710,"arrow-down-right":61711,"arrow-left":61712,"arrow-left-circle":61713,"arrow-right":61714,"arrow-right-circle":61715,"arrow-up":61716,"arrow-up-circle":61717,"arrow-up-left":61718,"arrow-up-right":61719,"at-sign":61720,award:61721,"bar-chart":61722,"bar-chart-2":61723,battery:61724,"battery-charging":61725,bell:61726,"bell-off":61727,bluetooth:61728,bold:61729,book:61730,"book-open":61731,bookmark:61732,box:61733,briefcase:61734,calendar:61735,camera:61736,"camera-off":61737,cast:61738,check:61739,"check-circle":61740,"check-square":61741,"chevron-down":61742,"chevron-left":61743,"chevron-right":61744,"chevron-up":61745,"chevrons-down":61746,"chevrons-left":61747,"chevrons-right":61748,"chevrons-up":61749,chrome:61750,circle:61751,clipboard:61752,clock:61753,cloud:61754,"cloud-drizzle":61755,"cloud-lightning":61756,"cloud-off":61757,"cloud-rain":61758,"cloud-snow":61759,code:61760,codepen:61761,codesandbox:61762,coffee:61763,columns:61764,command:61765,compass:61766,copy:61767,"corner-down-left":61768,"corner-down-right":61769,"corner-left-down":61770,"corner-left-up":61771,"corner-right-down":61772,"corner-right-up":61773,"corner-up-left":61774,"corner-up-right":61775,cpu:61776,"credit-card":61777,crop:61778,crosshair:61779,database:61780,delete:61781,disc:61782,divide:61783,"divide-circle":61784,"divide-square":61785,"dollar-sign":61786,download:61787,"download-cloud":61788,dribbble:61789,droplet:61790,edit:61791,"edit-2":61792,"edit-3":61793,"external-link":61794,eye:61795,"eye-off":61796,facebook:61797,"fast-forward":61798,feather:61799,figma:61800,file:61801,"file-minus":61802,"file-plus":61803,"file-text":61804,film:61805,filter:61806,flag:61807,folder:61808,"folder-minus":61809,"folder-plus":61810,framer:61811,frown:61812,gift:61813,"git-branch":61814,"git-commit":61815,"git-merge":61816,"git-pull-request":61817,github:61818,gitlab:61819,globe:61820,grid:61821,"hard-drive":61822,hash:61823,headphones:61824,heart:61825,"help-circle":61826,hexagon:61827,home:61828,image:61829,inbox:61830,info:61831,instagram:61832,italic:61833,key:61834,layers:61835,layout:61836,"life-buoy":61837,link:61838,"link-2":61839,linkedin:61840,list:61841,loader:61842,lock:61843,"log-in":61844,"log-out":61845,mail:61846,map:61847,"map-pin":61848,maximize:61849,"maximize-2":61850,meh:61851,menu:61852,"message-circle":61853,"message-square":61854,mic:61855,"mic-off":61856,minimize:61857,"minimize-2":61858,minus:61859,"minus-circle":61860,"minus-square":61861,monitor:61862,moon:61863,"more-horizontal":61864,"more-vertical":61865,"mouse-pointer":61866,move:61867,music:61868,navigation:61869,"navigation-2":61870,octagon:61871,package:61872,paperclip:61873,pause:61874,"pause-circle":61875,"pen-tool":61876,percent:61877,phone:61878,"phone-call":61879,"phone-forwarded":61880,"phone-incoming":61881,"phone-missed":61882,"phone-off":61883,"phone-outgoing":61884,"pie-chart":61885,play:61886,"play-circle":61887,plus:61888,"plus-circle":61889,"plus-square":61890,pocket:61891,power:61892,printer:61893,radio:61894,"refresh-ccw":61895,"refresh-cw":61896,repeat:61897,rewind:61898,"rotate-ccw":61899,"rotate-cw":61900,rss:61901,save:61902,scissors:61903,search:61904,send:61905,server:61906,settings:61907,share:61908,"share-2":61909,shield:61910,"shield-off":61911,"shopping-bag":61912,"shopping-cart":61913,shuffle:61914,sidebar:61915,"skip-back":61916,"skip-forward":61917,slack:61918,slash:61919,sliders:61920,smartphone:61921,smile:61922,speaker:61923,square:61924,star:61925,"stop-circle":61926,sun:61927,sunrise:61928,sunset:61929,table:61930,tablet:61931,tag:61932,target:61933,terminal:61934,thermometer:61935,"thumbs-down":61936,"thumbs-up":61937,"toggle-left":61938,"toggle-right":61939,tool:61940,trash:61941,"trash-2":61942,trello:61943,"trending-down":61944,"trending-up":61945,triangle:61946,truck:61947,tv:61948,twitch:61949,twitter:61950,type:61951,umbrella:61952,underline:61953,unlock:61954,upload:61955,"upload-cloud":61956,user:61957,"user-check":61958,"user-minus":61959,"user-plus":61960,"user-x":61961,users:61962,video:61963,"video-off":61964,voicemail:61965,volume:61966,"volume-1":61967,"volume-2":61968,"volume-x":61969,watch:61970,wifi:61971,"wifi-off":61972,wind:61973,x:61974,"x-circle":61975,"x-octagon":61976,"x-square":61977,youtube:61978,za
924p:61979,"zap-off":61980,"zoom-in":61981,"zoom-out":61982}},831,[]); 925__d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TOUCH_MIN",{enumerable:!0,get:function(){return u}}),_e.touchSlop=f,_e.styleSlop=function(t,n={}){const o=e.default.flatten(t)||{},l=(...t)=>t.find(t=>'number'==typeof t&&t>0);return f(l(o.height,o.minHeight,n.h)??u,l(o.width,o.minWidth,n.w)??u)},Object.defineProperty(_e,"slopIsZero",{enumerable:!0,get:function(){return c}}),_e.HitArea=function({slop:t}){return c(t)?null:(0,o.jsx)(n.default,{"aria-hidden":!0,style:{position:'absolute',top:-t.top,bottom:-t.bottom,left:-t.left,right:-t.right}})},r(d[0]),r(d[1]);var e=t(r(d[2])),n=t(r(d[3])),o=r(d[4]);const u=44,l=t=>Number.isFinite(t)&&t>0&&t<u?Math.ceil((u-t)/2):0;function f(t,e=u){const n=l(t),o=l(e);return{top:n,bottom:n,left:o,right:o}}const c=t=>!(t.top||t.bottom||t.left||t.right)},832,[11,136,26,13,6]); 926__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PilotShell=function(){const e=(0,x.useLayoutMode)(),D='phone'===e,{width:E}=(0,l.default)(),L=(0,c.usePathname)(),z=(0,c.useGlobalSearchParams)(),F=(0,h.useSafeAreaInsets)(),K=(0,p.useAuth)(),{toast:N,state:W,loading:G,error:O,research:U}=(0,f.useProduct)(),V='not_deployed'===U?.status?U.message:null,q=M.includes(L),[J,Q]=t.default.useState(!1),X=t.default.useRef(null);if('/'===L&&w(z.s)){const e={};for(const t of['s','tf','m','tab']){const s=w(z[t]);s&&(e[t]=s)}return(0,v.jsx)(c.Redirect,{href:{pathname:C.CHART_PATH,params:e}})}if(!K.ready)return(0,v.jsx)(x.Loading,{});if(K.error)return(0,v.jsxs)(s.default,{style:{flex:1,backgroundColor:x.C.bg,justifyContent:'center',padding:28,gap:18},children:[(0,v.jsx)(x.T,{children:K.error}),(0,v.jsx)(x.Button,{label:"Reconnect to KANIDA",onPress:K.refresh})]});if(!q&&!K.user)return(0,v.jsx)(c.Redirect,{href:"/welcome"});if(K.user&&!K.user.onboarded&&!q&&'/onboarding'!==L)return(0,v.jsx)(c.Redirect,{href:"/onboarding"});if(K.user?.onboarded&&!K.billing?.access&&!q&&!['/account','/billing','/onboarding'].includes(L))return(0,v.jsx)(c.Redirect,{href:"/billing"});const Y=!!K.user?.onboarded&&!q,Z=!!N&&(0,v.jsx)(s.default,{pointerEvents:"none",style:{position:'absolute',left:20,right:20,bottom:D&&Y?90:20,alignItems:'center',zIndex:40},children:(0,v.jsx)(s.default,{style:{backgroundColor:x.C.greenFill,borderWidth:1,borderColor:x.C.greenLine2,borderRadius:12,padding:16},children:(0,v.jsx)(x.T,{style:{color:x.C.mint,fontSize:13},children:N})})});if(Y&&(0,C.isWorkspacePath)(L))return(0,v.jsxs)(s.default,{style:{flex:1,backgroundColor:x.C.bg},children:[(0,v.jsx)(u.StatusBar,{style:'day'===x.THEME?'dark':'light'}),(0,v.jsx)(s.default,{"aria-hidden":!0,style:{display:'none'},children:(0,v.jsx)(c.Slot,{})}),(0,v.jsx)(k.ScreenErrorBoundary,{resetKey:L,children:(0,v.jsx)(b.MainWorkspace,{})}),(0,v.jsx)(_.DisclaimerBar,{compact:D}),Z,(0,v.jsx)(j.ProductSheets,{})]});const $=(0,v.jsx)(s.default,{style:{backgroundColor:x.C.bg,borderBottomWidth:1,borderColor:x.C.line,paddingTop:F.top},children:(0,v.jsxs)(s.default,{style:[x.s.between,{width:'100%',maxWidth:1500,alignSelf:'center',paddingHorizontal:D?18:30,height:D?56:64}],children:[(0,v.jsxs)(o.default,{accessibilityRole:"link",accessibilityLabel:"KANIDA home",onPress:()=>c.router.push(K.user?.onboarded?'/':'/welcome'),hitSlop:B,style:[x.s.row,{gap:10}],children:[(0,v.jsx)(H.HitArea,{slop:B}),(0,v.jsx)(y.AgentMark,{size:36}),(0,v.jsxs)(x.T,{style:{fontFamily:'InterMedium',fontSize:20,letterSpacing:2},children:["KANIDA",(0,v.jsx)(x.T,{style:{fontSize:12,color:x.C.muted},children:".AI"})]})]}),(0,v.jsxs)(s.default,{style:x.s.row,children:[K.user?(0,v.jsx)(x.T,{style:{fontSize:12,color:x.C.muted},children:"Private pilot"}):(0,v.jsx)(x.Button,{label:"Sign in",kind:"outline",onPress:()=>c.router.push('/signin')}),!!K.user&&(0,v.jsxs)(o.default,{accessibilityRole:"button",accessibilityLabel:'/account'===L?'Account, current page':'Account',onPress:()=>c.router.push('/account'),hitSlop:I,style:{padding:12},children:[(0,v.jsx)(H.HitArea,{slop:I}),(0,v.jsx)(x.Icon,{name:"user",color:'/account'===L?x.C.green:x.C.muted,size:19})]}),(0,v.jsxs)(o.default,{accessibilityRole:"button",accessibilityLabel:"Open on iPhone",onPress:()=>c.router.push('/connect'),hitSlop:R,style:{padding:12},children:[(0,v.jsx)(H.HitArea,{slop:R}),(0,v.jsx)(x.Icon,{name:"smartphone",color:x.C.muted,size:18})]})]})]})}),ee=G?null:(0,v.jsx)(S.DataAgePill,{dataEnd:W?.source_latest,status:W?.data_status,cache:W,error:W?'':O,notDeployed:V,compact:E<A.NAV_FULL_WIDTH,expanded:J,onPress:()=>Q(e=>!e)}),te=Y?(0,v.jsx)(S.TopBar,{label:"Top bar",style:{paddingTop:F.top+6}
926,left:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(T.ShellMark,{compact:'desktop'!==e,markOnly:'tablet'===e}),!D&&(0,v.jsx)(A.MainNav,{})]}),center:(0,v.jsx)(P.SymbolSearch,{compact:D}),right:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(s.default,{ref:X,children:ee}),(0,v.jsx)(T.AccountButton,{connect:!0})]})}):$;return(0,v.jsxs)(s.default,{style:{flex:1,backgroundColor:x.C.bg},children:[(0,v.jsx)(u.StatusBar,{style:'day'===x.THEME?'dark':'light'}),te,(0,v.jsx)(S.DataStatusPopover,{open:J,onClose:()=>Q(!1),anchor:X,status:W?.data_status,dataEnd:W?.source_latest,cache:W,error:W?'':O,notDeployed:V,routeKey:L}),!q&&(0,v.jsx)(T.ResearchBanner,{}),(0,v.jsx)(k.ScreenErrorBoundary,{resetKey:L,children:C.FULL_HEIGHT_PATHS.includes(L)?(0,v.jsx)(s.default,{style:{flex:1,minHeight:0,overflow:'hidden'},children:(0,v.jsx)(c.Slot,{})}):(0,v.jsx)(n.default,{keyboardShouldPersistTaps:"handled",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1},children:(0,v.jsx)(c.Slot,{})},L)}),(0,v.jsx)(_.DisclaimerBar,{compact:D}),D&&Y&&(0,v.jsx)(A.MainNav,{variant:"tabs"}),Z,K.user&&(0,v.jsx)(j.ProductSheets,{})]})};var t=e(r(d[0])),s=e(r(d[1])),o=e(r(d[2])),n=e(r(d[3])),l=e(r(d[4])),c=r(d[5]),u=r(d[6]),h=r(d[7]),x=r(d[8]),f=r(d[9]),p=r(d[10]),j=r(d[11]),y=r(d[12]),b=r(d[13]),S=r(d[14]),C=r(d[15]),A=r(d[16]),P=r(d[17]),T=r(d[18]),k=r(d[19]),_=r(d[20]),H=r(d[21]),v=r(d[22]);const B=(0,H.touchSlop)(36),I=(0,H.touchSlop)(43,43),R=(0,H.touchSlop)(42,42),M=['/welcome','/signin','/signup','/connect','/terms','/privacy','/device','/recover'],w=e=>'string'==typeof e?e:Array.isArray(e)&&'string'==typeof e[0]?e[0]:''},833,[11,13,375,278,400,252,834,105,821,196,198,836,839,861,871,896,899,895,897,900,901,832,6]); 927__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"StatusBar",{enumerable:!0,get:function(){return t.StatusBar}}),Object.defineProperty(e,"setStatusBarStyle",{enumerable:!0,get:function(){return t.setStatusBarStyle}}),Object.defineProperty(e,"setStatusBarHidden",{enumerable:!0,get:function(){return t.setStatusBarHidden}});var t=r(d[0])},834,[835]); 928__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.StatusBar=s,Object.defineProperty(_e,"setStatusBarStyle",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"setStatusBarHidden",{enumerable:!0,get:function(){return f}});var t=e(r(d[0])),n=e(r(d[1])),u=e(r(d[2])),l=e(r(d[3])),o=r(d[4]);function s({style:e,hideTransitionAnimation:n,animated:s,hidden:c}){const f=(0,l.default)(),y=t.default.useMemo(()=>h(e,f),[e,f]);return(0,o.jsx)(u.default,{animated:s,hidden:c,barStyle:y,showHideTransition:'none'===n?void 0:n})}s.setStyle=(e,t)=>u.default.setBarStyle(h(e),t);const c=s.setStyle;s.setHidden=(e,t)=>u.default.setHidden(e,t);const f=s.setHidden;function h(e="auto",t=n.default?.getColorScheme()??'light'){t||(t='light');let u=e;return'auto'===e?u='light'===t?'dark':'light':'inverted'===e&&(u='light'===t?'light':'dark'),'light'===u?'light-content':'dark-content'}},835,[11,348,382,398,6]); 929__d(function(g,r,i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.FilterSheet=f,_e.Rule=function({n:e,title:t,text:l}){return(0,p.jsxs)(s.default,{style:[c.s.row,{alignItems:'flex-start'}],children:[(0,p.jsx)(s.default,{style:{width:26,height:26,alignItems:'center',justifyContent:'center',borderRadius:8,backgroundColor:c.C.soft},children:(0,p.jsx)(c.T,{style:{fontSize:11,fontFamily:'InterSemi',color:c.C.green},children:e})}),(0,p.jsxs)(s.default,{style:{flex:1,gap:5},children:[(0,p.jsx)(c.T,{style:{fontFamily:'InterSemi',fontSize:13},children:t}),(0,p.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:l})]})]})},_e.ProductSheets=function(){const e=(0,o.useProduct)(),{detail:s,setDetail:l,plan:d,setPlan:m,stock:h,setStock:y}=e;return(0,t.useEffect)(()=>{s&&(e.setWorkspace(e=>({...e,selected:s.id,tab:'history'})),l(null),n.router.push('/chart'))},[s]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(f,{}),(0,p.jsx)(c.Sheet,{visible:!!d||!!h,title:d?'Your AutoTrade plan':h?.symbol||'Stock',subtitle:d?'A clear plan, with you in control.':h?.company,wide:!d,onClose:()=>{l(null),m(null),y(null)},children:d?(0,p.jsx)(u.PlanReview,{selection:d},d.match.id+d.side):h?(0,p.jsx)(x,{stock:h},h.symbol):null})]})};var t=r(_d[0]),s=e(r(_d[1])),l=e(r(_d[2])),n=r(_d[3]),o=r(_d[4]),c=r(_d[5]),d=r(_d[6]),u=r(_d[7]),m=r(_d[8]),h=r(_d[9]),p=r(_d[10]);function f(){const{filterOpen:e,setFilterOpen:n,filters:u,setFilters:f,options:x,matches:y,query:b,state:j,defaultFilters:S}=(0,o.useProduct)(),T=S||(0,m.discoverDefaults)(),v=T.frames||[],[C,A]=(0,t.useState)(''),[_,w]=(0,t.useState)(u),[P,E]=(0,t.useState)(String(h.MIN_TRADES_DEFAULT));(0,t.useEffect)(()=>{e&&(w(u),E(String(u.minimum)))},[e]);const M=/^\d+$/.test(P)&&Number(P)<=1e5,k={..._,minimum:M?Number(P):h.MIN_TRADES_DEFAULT},F=(0,m.historyScreenOff)(j?.pattern_set),R=(0,m.appliedFilters)(k,F),I=(0,d.filterMatches)(y,R,b).filter(e=>(0,m.frameMatch)(e,R)).length,N=(e,t)=>w({..._,[e]:t});return(0,p.jsxs)(c.Sheet,{visible:e,title:"Make the market yours",subtitle:"Cho
929ose the history you want to see.",onClose:()=>n(!1),footer:(0,p.jsxs)(s.default,{style:c.s.row,children:[(0,p.jsx)(c.Button,{label:"Reset to defaults",kind:"outline",onPress:()=>{w(T),E(String(T.minimum))}}),(0,p.jsx)(c.Button,{label:`Show ${I} setups`,style:{flex:1},disabled:!M&&!F,onPress:()=>{f(k),n(!1)}})]}),children:[(0,p.jsxs)(c.T,{style:c.s.label,children:["Patterns \xb7 ",(_.patterns||[]).length||'All']}),(0,p.jsx)(l.default,{accessibilityLabel:"Search patterns",placeholder:"Find any approved pattern",placeholderTextColor:c.C.muted,value:C,onChangeText:A,style:c.s.input}),(0,p.jsxs)(s.default,{style:[c.s.row,{flexWrap:'wrap'}],children:[(0,p.jsx)(c.Chip,{label:"All patterns",active:!_.patterns?.length,onPress:()=>N('patterns',[])}),(j?.patterns||[]).filter(e=>e.name.toLowerCase().includes(C.toLowerCase())).map(e=>(0,p.jsx)(c.Chip,{label:e.name,active:_.patterns?.includes(e.id),onPress:()=>N('patterns',_.patterns?.includes(e.id)?_.patterns.filter(t=>t!==e.id):[..._.patterns||[],e.id])},e.id))]}),(0,p.jsx)(c.T,{style:c.s.label,children:"Past average return per trade"}),(0,p.jsx)(s.default,{style:[c.s.row,{flexWrap:'wrap'}],children:d.bands.map(([e,t])=>(0,p.jsx)(c.Chip,{label:t,active:_.band===e,onPress:()=>N('band',e)},e))}),!F&&(0,p.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:`After the research\u2019s ${h.ROUND_TRIP_COST_PCT.toFixed(2)}% assumed costs. These ranges describe past averages, not a promised next return. Range upper bounds belong to the next band, except 10% stays in 5\u201310%.`}),(0,p.jsx)(c.T,{style:c.s.label,children:"Minimum historical trades"}),(0,p.jsx)(l.default,{accessibilityLabel:"Minimum historical trades",value:P,onChangeText:E,keyboardType:"number-pad",style:c.s.input}),(0,p.jsx)(c.T,{style:{fontSize:12,color:F?c.C.amber:M?Number(P)<m.SAMPLE_MODERATE_MIN?c.C.amber:c.C.muted:c.C.red},children:F?m.NO_HISTORY_SCREEN_PAIR_NOTE:M?`Active: at least ${Number(P)} trades. Default is ${h.MIN_TRADES_DEFAULT}; samples under ${m.SAMPLE_MODERATE_MIN} trades are labelled Small sample. Enter 0 to include any sample size.`:'Enter a whole number from 0 to 100,000.'}),(0,p.jsx)(c.T,{style:c.s.label,children:"Timeframe"}),(0,p.jsxs)(s.default,{style:[c.s.row,{flexWrap:'wrap'}],children:[!!v.length&&(0,p.jsx)(c.Chip,{label:`My timeframes \xb7 ${v.join(' ')}`,active:'All'===_.timeframe&&!!_.frames?.length,onPress:()=>w({..._,timeframe:'All',frames:v})}),['All',...m.ALL_FRAMES].map(e=>(0,p.jsx)(c.Chip,{label:'All'===e?'All timeframes':e,active:_.timeframe===e&&('All'!==e||!_.frames?.length),onPress:()=>w({..._,timeframe:e,frames:[]})},e))]}),(0,p.jsx)(c.T,{style:c.s.label,children:"Direction"}),(0,p.jsx)(s.default,{style:[c.s.row,{flexWrap:'wrap'}],children:[['all','Any direction'],['bullish','Bullish'],['bearish','Bearish'],['neutral','Awaiting direction']].map(([e,t])=>(0,p.jsx)(c.Chip,{label:t,active:_.direction===e,onPress:()=>N('direction',e)},e))}),(0,p.jsx)(c.T,{style:c.s.label,children:"Market coverage"}),(0,p.jsxs)(s.default,{style:[c.s.row,{flexWrap:'wrap'}],children:[(0,p.jsx)(c.Chip,{label:"All stocks",active:!_.universe,onPress:()=>N('universe','')}),x?.universes?.map(e=>(0,p.jsx)(c.Chip,{label:e.label,active:_.universe===e.value,onPress:()=>N('universe',e.value)},e.value))]}),(0,p.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:"Index membership uses the supplied July labels; coverage is incomplete. Large, mid and small cap labels are unavailable."}),(0,p.jsx)(c.T,{style:c.s.label,children:"Sector"}),(0,p.jsxs)(s.default,{style:[c.s.row,{flexWrap:'wrap'}],children:[(0,p.jsx)(c.Chip,{label:"All sectors",active:!_.sector,onPress:()=>N('sector','')}),Array.from(new Set((x?.sectors||[]).map(e=>(0,d.sectorName)(e.value)))).map(e=>(0,p.jsx)(c.Chip,{label:e,active:_.sector===e,onPress:()=>N('sector',e)},e))]})]})}function x({stock:e}){const{matches:l,setStock:n,setDetail:u}=(0,o.useProduct)(),[m,f]=(0,t.useState)(null),[x,y]=(0,t.useState)('');return(0,t.useEffect)(()=>{let t=!0;return(0,d.api)('/api/stock?symbol='+encodeURIComponent(e.symbol)).then(e=>{t&&f(e)}).catch(e=>{t&&y(e.message)}),()=>{t=!1}},[e.symbol]),x?(0,p.jsx)(c.Empty,{title:"Stock unavailable",detail:x}):m?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(c.Badge,{label:e.sector,tone:"neutral"}),(0,p.jsx)(c.T,{style:{fontSize:13,color:c.C.muted},children:"Every timeframe, independently scanned. This stock view shows all stored detections, including studies below your current trade-count filter."}),h.TIMEFRAMES.map(t=>{const o=m.timeframes?.[t],h=l.filter(s=>s.symbol===e.symbol&&s.timeframe===t);return(0,p.jsxs)(s.default,{style:c.s.card,children:[(0,p.jsxs)(s.default,{style:c.s.between,children:[(0,p.jsx)(c.T,{style:{fontFamily:'ManropeBold',fontSize:22},children:t}),(0,p.jsx)(c.Badge,{label:o?.current?'Current':'Historical',tone
929:o?.current?'green':'amber'})]}),(0,p.jsxs)(c.T,{style:{fontSize:11,color:c.C.muted},children:["Last candle: ",(0,d.dateText)(o?.last_candle)]}),h.length?h.map(e=>(0,p.jsxs)(s.default,{style:{gap:9},children:[(0,p.jsx)(c.T,{style:{fontFamily:'InterSemi'},children:e.pattern_name}),(0,p.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:e.history.map(e=>`${e.side}: ${(0,d.pct)(e.reference.display_return_pct)} past average \xb7 ${e.reference.n} trades`).join('\n')}),(0,p.jsx)(c.Button,{label:`See ${e.pattern_name} evidence`,kind:"outline",onPress:()=>{n(null),u(e)}})]},e.id)):(0,p.jsx)(c.T,{style:{color:c.C.muted,fontSize:13},children:'scanned'===o?.status?'No qualified pattern in this stored chart.':'Not enough usable candle history to qualify a pattern.'})]},t)})]}):(0,p.jsx)(c.Loading,{})}},836,[11,13,385,252,196,821,197,837,248,249,6]); 930__d(function(g,_r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PlanReview=function({selection:e}){const{setPlan:p,refreshProduct:f,setToast:y,filters:b}=(0,a.useProduct)(),{match:j,side:S,study:C}=e,v=(0,n.useExitPlan)(j,S),T=v.data,[_,P]=(0,t.useState)(!1),[w,k]=(0,t.useState)('6'),[z,E]=(0,t.useState)('100000'),[N,I]=(0,t.useState)('10000'),[B,F]=(0,t.useState)('0.5'),[A,$]=(0,t.useState)('2.5'),[R,D]=(0,t.useState)('2'),[H,M]=(0,t.useState)(!1),[O,L]=(0,t.useState)(!1),[Y,q]=(0,t.useState)(!1),[W,V]=(0,t.useState)(''),[G,U]=(0,t.useState)(''),[X,J]=(0,t.useState)(!1),K=(0,t.useRef)(`${Date.now()}-${Math.random().toString(36).slice(2)}`),[Q,Z,ee]=[z,N,B].map(Number),te=_?Number(A):T?.stop_pct||0,se=_?Number(R):T?.reward||2,ie=_?Number(w):T?.rule.hold||6,re=(0,u.sizing)(j.price,Q,Z,ee,te,T?.cost_pct??h.ROUND_TRIP_COST_PCT),le=!!T&&Number.isInteger(ie)&&ie>=1&&ie<=260&&('short'!==S||te*se<100)&&[Q,Z,ee,te,se].every(Number.isFinite)&&Q>=1e3&&Q<=1e7&&Z>=100&&Z<=Q&&ee>=.1&&ee<=2&&te>=(_?.25:.001)&&te<=20&&se>=.5&&se<=5&&re.shares>0,ae=(j.history.find(e=>e.side===S),!_&&!X&&!0===T?.tradable_evidence),oe=_?'Custom exits are untested: no historical replay of this exact rule exists.':X?'The server found no current tested evidence for this exact exit rule.':T?.tradable_reason||'No historical replay of this exact exit rule meets the sample requirement.';function ne(){T&&($(T.stop_pct.toFixed(4)),D(String(T.reward)),k(String(T.rule.hold)),P(!1),L(!1),J(!1),K.current=`${Date.now()}-${Math.random().toString(36).slice(2)}`)}(0,t.useEffect)(()=>{ne()},[T?.id]);const de=e=>t=>{e(t),[$,D,k].includes(e)&&P(!0),L(!1),V(''),K.current=`${Date.now()}-${Math.random().toString(36).slice(2)}`};async function ce(e=!1){if(ae||e){q(!0),V('');try{await(0,u.api)('/api/product/plans',{match_id:j.id,side:S,account:Q,allocation:Z,risk_pct:ee,stop_pct:te,reward:se,hold:ie,trigger:T.rule.trigger,suggestion_id:T.id,exit_mode:_?'custom':'suggested',request_id:K.current,minimum_history:b.minimum,...e?{illustrative:!0}:{},...C?{study_context:{id:C.id,trade_id:C.trade_id}}:{}}),await f(),p(null),l.router.push('/autotrade'),y(e?'Illustrative draft saved. It cannot be simulated. No order placed.':'Your paper plan is saved. No order placed.')}catch(e){const t=(0,o.refusedNotDeployed)(e);U(t||''),V(t||(0,n.planError)(e)),'EXIT_EVIDENCE'!==e?.code&&'EXIT_EVIDENCE_CHANGED'!==e?.code||(J(!0),v.retry())}finally{q(!1)}}}return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(s.default,{style:c.s.between,children:[(0,x.jsx)(c.Badge,{label:O?'REVIEW YOUR PLAN':'PREPARE A PLAN'}),(0,x.jsx)(c.Badge,{label:"PAPER ONLY",tone:"amber"})]}),(0,x.jsxs)(s.default,{style:{gap:7},children:[(0,x.jsx)(c.T,{style:{fontFamily:'ManropeBold',fontSize:27,lineHeight:35},children:j.symbol}),(0,x.jsxs)(c.T,{style:{fontSize:12,color:c.C.muted},children:[j.pattern_name," \xb7 ",j.timeframe," \xb7 ",'short'===S?'Sell / short':'Buy / long']}),(0,x.jsxs)(c.T,{style:{fontSize:11,color:c.C.muted},children:["Snapshot ",(0,u.money)(j.price)," \xb7 ",(0,u.dateText)(j.candle_end)]})]}),C&&(0,x.jsxs)(s.default,{style:[c.s.card,{backgroundColor:c.C.dark}],children:[(0,x.jsx)(c.T,{style:{fontFamily:'InterSemi'},children:"Historical study attached"}),(0,x.jsxs)(c.T,{style:{fontSize:12,color:c.C.muted},children:[C.validation," \xb7 Study ",C.id.slice(0,6)," \xb7 Hold up to ",C.rule?.hold," candles. The plan below uses the exit rules shown for this setup. A historical study does not enable live orders or validate different exits."]})]}),O?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(c.Badge,{label:_?'Custom \xb7 untested':T.label,tone:!_&&T.evidence_applies?'green':'amber'}),(0,x.jsxs)(s.default,{style:c.s.card,children:[(0,x.jsx)(c.T,{style:{fontFamily:'InterSemi',fontSize:16},children:"One plan. Every rule visible."}),[['Position',`${re.shares} shares \xb7 ${(0,u.money)(re.notional)}`],['Entry',T.entry],['Stop',`${te.toFixed(2)}% preview distance`],['Target',`${(te*se).toFixed(2)}% \xb7 risk 1 to seek ${se}`],['Maximum hold',_?`${ie} ${j.timeframe} candles`:T.holding.label],['Planned risk + costs',(0,u.money)(re.loss)]].map(([e,t])=>(0,x.jsxs)(s.default,{style:[c.s.between,{alignItems:'flex-start'}],children:[(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted,flex:1},children:e}),(0,x.jsx)(c.T,{style:{fontSize:12,textAlign:'right',flex:1.5},children:t})]},e)),(0,x.jsxs)(c.T,{style:{fontSize:11,color:c.C.muted},children:[_?'Custom percentage exits.':T.stop_basis+'.'," Recalculate the levels and quantity at the actual next-open entry. Exit at the first stop, target or holding limit. Stop first if both barriers are hit in one candle. Reserved costs: ",(0,u.money)(re.cost),"."]})]}),(0,x.jsxs)(s.default,{style:[c.s.card,{backgroundColor:c.C.amberBg}],children:[(0,x.jsxs)(c.T,{style:{fontSize:12,color:c.C.amber},children:["This saves a draft. Fresh prices and an execution connection are required. ",_?'Custom exits need a separate historical test.':T.evidence_applies?'The attached results belong to this exact tested rule.':'This benchmark has no supported historical win rate. The baseline uses different exits.']}),'short'===S&&(0,x.jsx)(c.T,{style:{fontSize:11,color:c.C.amber},children:"Borrow and instrument eligibility must be verified for short trades."})]}),!ae&&(0,x.jsxs)(s.default,{style:[c.s.card,{borderColor:c.C.red}
930],children:[(0,x.jsxs)(c.T,{style:{fontSize:12,color:c.C.red},children:["Saving a paper plan is blocked. ",oe]}),(0,x.jsx)(c.T,{style:{fontSize:11,color:c.C.muted},children:"You can keep it as an illustrative draft. Illustrative drafts cannot be simulated or executed."})]}),(0,x.jsx)(c.Button,{label:"Save paper plan",icon:"check",loading:Y&&ae,disabled:!ae||Y,onPress:()=>ce()}),!ae&&(0,x.jsx)(c.Button,{label:"Save as illustrative draft",icon:"bookmark",kind:"outline",loading:Y,onPress:()=>ce(!0)}),(0,x.jsx)(c.Button,{label:"Adjust the plan",kind:"outline",disabled:Y,onPress:()=>L(!1)})]}):(0,x.jsxs)(x.Fragment,{children:[_?(0,x.jsxs)(s.default,{style:[c.s.card,{backgroundColor:c.C.amberBg}],children:[(0,x.jsx)(c.Badge,{label:"Custom \xb7 untested",tone:"amber"}),(0,x.jsx)(c.T,{style:{fontSize:12},children:"You changed the exits. Historical rule evidence no longer applies."}),(0,x.jsx)(c.Button,{label:"Restore suggested exits",kind:"outline",onPress:ne})]}):(0,x.jsx)(n.ExitBrief,{...v,compact:!0}),(0,x.jsxs)(s.default,{style:c.s.card,children:[(0,x.jsx)(c.T,{style:{fontFamily:'InterSemi',fontSize:14},children:"Capital for this idea"}),(0,x.jsx)(s.default,{style:[c.s.row,{flexWrap:'wrap'}],children:h.CAPITAL_CHOICES.map(String).map(e=>(0,x.jsx)(c.Chip,{label:(0,u.money)(Number(e)),active:N===e,onPress:()=>de(I)(e)},e))}),(0,x.jsx)(c.T,{style:{fontFamily:'InterSemi',fontSize:14},children:"Paper account risk budget"}),(0,x.jsx)(s.default,{style:[c.s.row,{flexWrap:'wrap'}],children:['0.5','1','2'].map(e=>(0,x.jsx)(c.Chip,{label:`${e}% \xb7 ${(0,u.money)(Q*Number(e)/100)}`,active:B===e,onPress:()=>de(F)(e)},e))}),(0,x.jsx)(c.Button,{label:H?'Hide detailed settings':'Adjust account & exit rules',kind:"ghost",icon:"sliders",onPress:()=>M(!H)}),H&&[['Paper account (\u20b9)',z,E],['Capital per setup (\u20b9)',N,I],['Account risk limit (%) \xb7 0.1\u20132',B,F],['Stop distance (%) \xb7 0.25\u201320',A,$],['Target / stop multiple \xb7 0.5\u20135',R,D],['Maximum holding candles \xb7 1\u2013260',w,k]].map(([e,t,l])=>(0,x.jsxs)(s.default,{style:{gap:5},children:[(0,x.jsx)(c.T,{style:{fontSize:11,color:c.C.muted},children:e}),(0,x.jsx)(r.default,{accessibilityLabel:e,keyboardType:"decimal-pad",value:t,onChangeText:de(l),style:c.s.input})]},e))]}),(0,x.jsxs)(s.default,{style:[c.s.card,{backgroundColor:c.C.tealBg,borderColor:c.C.greenLine}],children:[(0,x.jsxs)(s.default,{style:c.s.row,children:[(0,x.jsx)(c.Icon,{name:"aperture",color:c.C.green}),(0,x.jsx)(c.T,{style:{fontFamily:'InterSemi',fontSize:13},children:"Here\u2019s the position that fits."})]}),(0,x.jsxs)(s.default,{style:c.s.row,children:[(0,x.jsx)(c.Stat,{label:"Whole shares",value:le?re.shares:'\u2014'}),(0,x.jsx)(c.Stat,{label:"Capital used",value:le?(0,u.money)(re.notional):'\u2014'})]}),(0,x.jsxs)(c.T,{style:{fontSize:12,color:c.C.muted},children:["Planned stop loss + costs: ",le?(0,u.money)(re.loss):'\u2014',". Both your capital and account-risk budgets limit the size. Gaps can exceed the stop."]})]}),(0,x.jsx)(c.Button,{label:"Review paper plan",icon:"arrow-right",disabled:!le,onPress:()=>L(!0)})]}),!le&&(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.red},children:"Adjust the settings to cover at least one share within your account, allocation and risk limits."}),W&&(0,x.jsx)(c.T,{style:{fontSize:12,color:W===G?c.C.muted:c.C.red},children:W}),!O&&(0,x.jsxs)(c.T,{style:{fontSize:11,color:c.C.muted},children:["A size preview using the stored close, not a live fill. Preview exits: ",te.toFixed(2),"% stop / ",le?(te*se).toFixed(2):'\u2014',"% target. Editing exits removes their evidence label. No cash is committed.",T&&!ae?' These exits are illustrative, not tradable evidence.':'']})]})};var t=_r(d[0]),s=e(_r(d[1])),r=e(_r(d[2])),l=_r(d[3]),a=_r(d[4]),o=_r(d[5]),n=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),x=_r(d[10])},837,[11,13,385,252,196,820,838,821,197,249,6]); 931__d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PRICE_ADJUSTMENT_NOTE",{enumerable:!0,get:function(){return u}}),_e.planError=function(e){const t=String(e?.message||'Something went wrong.'),r=String(e?.code||''),n={EXIT_EVIDENCE:'No tested evidence for this exact exit rule. It can only be saved as an illustrative draft, which can\u2019t be simulated.',EXIT_EVIDENCE_CHANGED:'The evidence for this exit rule changed or no longer passes since you saved the plan. Prepare the plan again from Discover and review it.',DATA_STALE:'Stored market data is older than the allowed age. Fresh prices are needed before simulating. Your plan stays saved and research remains available.',PLAN_REQUIRED:'Only a draft plan with tested evidence for its exact exit rule can be simulated. Illustrative, paused and archived plans can\u2019t.',PLAN_CHANGED:'This plan changed while its evidence was being checked. Open it again and review it before continuing.',EVIDENCE_UNAVAILABLE:'The evidence for this plan can\u2019t be re-checked right now, so nothing was submitted. Try again when research is available.'}[r];return n?t&&t!==n&&'PLAN_REQUIRED'!==r?`${n} ${t}`:n:t},_e.prepareBlock=function({stale:e,age:t,match:r,history:n,exit:s}){return e?`Fresh prices are needed. ${null!=t&&t<=o.DATA_STALE_DAYS?'Stored prices are marked stale.':`Stored market data is ${null==t?'of unknown age':t+' days old'} (limit ${o.DATA_STALE_DAYS} days).`}
931 Research and evidence remain available.`:r.current?n?s.error?'Exit-rule evidence could not load.':s.data?!0!==s.data.tradable_evidence?'No tested evidence for this exit rule yet.':'':'Checking exit-rule evidence\u2026':'No historical evidence for this setup.':'Fresh prices are needed. This stored setup is not on a current candle.'},_e.useExitPlan=function(e,r){const n=e.history.find(e=>e.side===r)?.run||'',l=[e.id,r,n,e.candle_end].join('|'),[o,c]=(0,t.useState)({key:'',data:null}),[h,u]=(0,t.useState)(''),[y,x]=(0,t.useState)(0),m=(e.history||[]).length>0;(0,t.useEffect)(()=>{let t=!0;if(u(''),!m)return void c({key:l,data:null});const o=p.get(l);if(o)return void c({key:l,data:o});let h=f.get(l);return h||(h=(0,s.api)('/api/product/exit-plan?'+new URLSearchParams({match_id:e.id,side:r,run:n,snapshot:e.candle_end})),f.set(l,h)),h.then(e=>{p.set(l,e),p.size>128&&p.delete(p.keys().next().value),t&&c({key:l,data:e})}).catch(e=>{t&&u(e.message)}).finally(()=>f.delete(l)),()=>{t=!1}},[l,y,m]);const b=m?o.key===l?o.data:p.get(l)||null:null;return{data:b,error:h,retry:()=>{p.delete(l),x(e=>e+1)},tradable_evidence:!0===b?.tradable_evidence,tradable_reason:String(b?.tradable_reason||''),history_label:String(b?.history_label||'Pattern hold-period history, not this exit rule')}},_e.ExitBrief=function({data:e,error:r,retry:p,compact:f=!1}){const[y,x]=(0,t.useState)(!1);if(r)return(0,c.jsxs)(n.default,{style:l.s.card,children:[(0,c.jsx)(l.T,{style:{color:l.C.amber,fontSize:12},children:r}),(0,c.jsx)(l.Button,{label:"Retry exit evidence",onPress:p,kind:"outline"})]});if(!e)return(0,c.jsx)(n.default,{style:{padding:12},children:(0,c.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:"Checking this stock\u2019s exit rules\u2026"})});const m=e.evidence,b=e.evidence_applies,_=m.test;return(0,c.jsxs)(n.default,{style:[l.s.card,{padding:17,backgroundColor:l.C.tealBg,borderColor:l.C.greenLine}],children:[(0,c.jsxs)(n.default,{style:[l.s.between,{flexWrap:'wrap'}],children:[(0,c.jsx)(l.T,{style:{fontFamily:'InterSemi',fontSize:14},children:"Your exit plan"}),(0,c.jsx)(l.Badge,{label:e.label,tone:b?'green':'failed'===e.status?'red':'amber'})]}),(0,c.jsx)(l.T,{style:{fontSize:11,fontFamily:'InterMedium',color:!0===e.tradable_evidence?l.C.green:l.C.amber},children:!0===e.tradable_evidence?'Evidence below belongs to this exact exit rule':'Illustrative exit rule \xb7 no historical stats for this exact rule'}),(0,c.jsxs)(n.default,{style:l.s.row,children:[(0,c.jsx)(l.Stat,{label:b?'Tested risk / reward':'Paper benchmark',value:`1 : ${e.reward}`,size:24}),(0,c.jsx)(l.Stat,{label:"Maximum hold",value:e.holding.duration,size:15})]}),(0,c.jsx)(l.T,{style:{fontSize:12,color:l.C.muted,lineHeight:20},children:e.why}),(0,c.jsxs)(l.T,{style:{fontSize:11,color:l.C.ink},children:[e.stop_basis,". Stop ",e.stop_pct.toFixed(2),"% \xb7 target ",e.target_pct.toFixed(2),"%, before costs."]}),b?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(n.default,{style:l.s.row,children:[(0,c.jsx)(l.Stat,{label:"This rule \xb7 later net avg. / trade",value:(0,s.pct)(e.rule_metrics.expectancy_pct),size:20}),(0,c.jsx)(l.Stat,{label:`Win rate \xb7 ${e.rule_metrics.n} later trades`,value:`${e.rule_metrics.win_rate.toFixed(0)}%`,size:20})]}),(0,c.jsx)(l.T,{style:{fontSize:11,color:l.C.amber},children:h})]}):(0,c.jsxs)(n.default,{style:{gap:4,borderTopWidth:1,borderColor:l.C.line,paddingTop:8},children:[(0,c.jsx)(l.T,{style:{fontSize:11,fontFamily:'InterMedium',color:l.C.amber},children:e.history_label||'Pattern hold-period history, not this exit rule'}),(0,c.jsxs)(l.T,{style:{fontSize:11,color:l.C.muted},children:[m.baseline_n," baseline trades used a fixed holding-period exit. Their average and win rate do not describe this stop, target and hold."]})]}),!0!==e.tradable_evidence&&!!e.tradable_reason&&(0,c.jsx)(l.T,{style:{fontSize:11,color:l.C.amber},children:e.tradable_reason}),!e.usable&&(0,c.jsx)(l.T,{style:{fontSize:12,color:l.C.red},children:"The stop is too wide or the target is invalid for this planner. Review the setup; the levels have not been clipped to fit."}
931),(0,c.jsx)(l.T,{style:{fontSize:10,color:l.C.muted},children:u}),!f&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.Button,{label:y?'Hide exit evidence':'Why this exit plan?',kind:"ghost",onPress:()=>x(!y)}),y&&(0,c.jsxs)(n.default,{style:{gap:12},children:[(0,c.jsxs)(l.T,{style:{fontSize:11,color:l.C.muted},children:["The original research compared ",m.candidates_tested," entry, volatility-stop, target and holding combinations for this stock only. The chosen rule was frozen before its later test. Support also requires positive results in both halves of that test and an uncertainty check adjusted for the search."]}),m.selected_rule&&(0,c.jsxs)(n.default,{style:{gap:6},children:[(0,c.jsxs)(l.T,{style:{fontFamily:'InterMedium',fontSize:12},children:["Frozen candidate: ",m.selected_description]}),(0,c.jsxs)(l.T,{style:{fontSize:11,color:l.C.muted},children:[_.n||0," later trades \xb7 ",(0,s.pct)(_.expectancy_pct)," average \xb7 ",null==_.win_rate?'\u2014':_.win_rate.toFixed(0)+'%'," won"]}),(0,c.jsxs)(l.T,{style:{fontSize:10,color:l.C.amber},children:[h,null!=m.search_adjusted_lower_pct?` Search-adjusted lower bound (this stock\u2019s ${m.candidates_tested} candidates only, not other stocks): ${(0,s.pct)(m.search_adjusted_lower_pct)}.`:'']}),(0,c.jsxs)(l.T,{style:{fontSize:10,color:l.C.muted},children:["Later period halves: ",m.period_means.map(e=>(0,s.pct)(e)).join(' / '),". A negative or inconclusive later test cannot be replaced by another candidate chosen on that same test."]})]}),!!m.candidates.length&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.T,{style:{fontSize:12,fontFamily:'InterSemi'},children:"Earlier candidates \xb7 training results only"}),m.candidates.map(e=>(0,c.jsxs)(n.default,{style:{gap:3,borderTopWidth:1,borderColor:l.C.line,paddingTop:8},children:[(0,c.jsxs)(l.T,{style:{fontSize:11},children:[e.rule.stop_atr?`1:${e.rule.target_r} \xb7 ${e.rule.stop_atr}\xd7 candle range stop`:'Time exit without a stop/target'," \xb7 ",e.rule.hold," candles"]}),(0,c.jsxs)(l.T,{style:{fontSize:10,color:l.C.muted},children:[e.train.n," training trades \xb7 ",(0,s.pct)(e.train.expectancy_pct)," net average"]})]},e.id))]}),(0,c.jsxs)(l.T,{style:{fontSize:10,color:l.C.muted},children:["The minimum-trades browsing filter (default ",o.MIN_TRADES_DEFAULT,") remains independent of exit validation. Structural benchmarks are not mined rules. Cash sizing and stops must be refreshed at entry. Run ",e.run,"."]})]})]})]})};var e,t=_r(d[0]),r=_r(d[1]),n=(e=r)&&e.__esModule?e:{default:e},s=_r(d[2]),l=_r(d[3]),o=_r(d[4]),c=_r(d[5]);const h='Selected from many stocks and rules; later-test average may still be optimistic.',u='Prices not adjusted for splits, bonuses or dividends; costs are assumed.';const p=new Map,f=new Map},838,[11,13,197,821,248,6]); 932__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AgentMark=function({size:e=36,color:c=l.C.green}){return(0,o.jsxs)(s.default,{width:e,height:e,viewBox:"0 0 40 40",children:[(0,o.jsx)(t.Circle,{cx:"20",cy:"20",r:"18",fill:"none",stroke:c,strokeOpacity:".35",strokeWidth:".7"}),(0,o.jsx)(t.Path,{d:"M20 6L23 17L34 20L23 23L20 34L17 23L6 20L17 17Z",fill:c}),(0,o.jsx)(t.Circle,{cx:"20",cy:"20",r:"3",fill:l.C.bg}),(0,o.jsx)(t.Path,{d:"M10 10L15 14M27 27L30 30M30 10L27 13M10 30L13 27",stroke:c,strokeWidth:".8"})]})},r(d[0]);var e,t=r(d[1]),s=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),o=r(d[3])},839,[11,840,821,6]); 933__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n.default}});var e=r(d[0]);Object.keys(e).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(_e,t)||Object.defineProperty(_e,t,{enumerable:!0,get:function(){return e[t]}})});var t,n=(t=e)&&t.__esModule?t:{default:t}},840,[841]); 934__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"inlineStyles",{enumerable:!0,get:function(){return n.inlineStyles}}),Object.defineProperty(_e,"loadLocalRawResource",{enumerable:!0,get:function(){return n.loadLocalRawResource}}),Object.defineProperty(_e,"LocalSvg",{enumerable:!0,get:function(){return n.LocalSvg}}),Object.defineProperty(_e,"SvgCss",{enumerable:!0,get:function(){return n.SvgCss}}),Object.defineProperty(_e,"SvgCssUri",{enumerable:!0,get:function(){return n.SvgCssUri}}),Object.defineProperty(_e,"SvgWithCss",{enumerable:!0,get:function(){return n.SvgWithCss}}),Object.defineProperty(_e,"SvgWithCssUri",{enumerable:!0,get:function(){return n.SvgWithCssUri}}),Object.defineProperty(_e,"WithLocalSvg",{enumerable:!0,get:function(){return n.WithLocalSvg}}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(_e,"camelCase",{enumerable:!0,get:function(){return e.camelCase}}),Object.defineProperty(_e,"fetchText",{enumerable:!0,get:function(){return t.fetchText}}),Object.defineProperty(_e,"parse",{enumerable:!0,get:function(){return e.parse}}),Object.defineProperty(_e,"SvgAst",{enumerable:!0,get:function(){return e.SvgAst}}),Object.defineProperty(_e,"SvgFromUri",{enumerable:!0,get:function(){return e.SvgFromUri}}),Object.defineProperty(_e,"SvgFromXml",{enumerable:!0,get:function(){return e.SvgFromXml}}),Object.defineProperty(_e,"SvgUri",{enumerable:!0,get:function(){return e.SvgUri}}),Object.defineProperty(_e,"SvgXml",{enumerable:!0,get:function(){return e.SvgXml}});var e=r(d[0]),t=r(d[1]),n=r(d[2]),u=r(d[3]);Object.keys(u).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return u[e]}})});var o=r(d[4]);
934Object.keys(o).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return o[e]}})});var c,f=(c=o)&&c.__esModule?c:{default:c}},841,[842,843,859,860,845]); 935__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.SvgAst=c,_e.SvgXml=l,_e.SvgUri=function(r){const{onError:o=i,uri:s,onLoad:c,fallback:u}=r,[f,p]=(0,t.useState)(null),[d,h]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{s?(0,n.fetchText)(s).then(t=>{p(t),d&&h(!1),null==c||c()}).catch(t=>{o(t),h(!0)}):p(null)},[o,s,c]),d)return u??null;return e.createElement(l,{xml:f,override:r,fallback:u})},Object.defineProperty(_e,"SvgFromXml",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"SvgFromUri",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"camelCase",{enumerable:!0,get:function(){return d}}),_e.getStyle=h,_e.astToReact=x,_e.parse=j,Object.defineProperty(_e,"tags",{enumerable:!0,get:function(){return r.tags}});var t=_r(_d[0]),e=(function(t){if(t&&t.__esModule)return t;var e={};return t&&Object.keys(t).forEach(function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}),e.default=t,e})(t),n=_r(_d[1]),r=_r(_d[2]);function o(){return o=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o.apply(null,arguments)}function s(){return null}function c({ast:t,override:n}){if(!t)return null;const{props:s,children:c}=t,i=r.tags.svg;return e.createElement(i,o({},s,n),c)}const i=console.error.bind(console);function l(n){const{onError:r=i,xml:o,override:s,fallback:l}=n;try{const r=(0,t.useMemo)(()=>null!==o?j(o):null,[o]);return e.createElement(c,{ast:r,override:s||n})}catch(t){return r(t),l??null}}class u extends t.Component{state={ast:null};componentDidMount(){this.parse(this.props.xml)}componentDidUpdate(t){const{xml:e}=this.props;e!==t.xml&&this.parse(e)}parse(t){const{onError:e=i}=this.props;try{this.setState({ast:t?j(t):null})}catch(t){const n=t;e({...n,message:`[RNSVG] Couldn't parse SVG, reason: ${n.message}`})}}render(){const{props:t,state:{ast:n}}=this;return e.createElement(c,{ast:n,override:t.override||t})}}class f extends t.Component{state={xml:null};componentDidMount(){this.fetch(this.props.uri)}componentDidUpdate(t){const{uri:e}=this.props;e!==t.uri&&this.fetch(e)}async fetch(t){try{this.setState({xml:t?await(0,n.fetchText)(t):null})}catch(t){console.error(t)}}render(){const{props:t,state:{xml:n}}=this;return e.createElement(u,{xml:n,override:t,onError:t.onError})}}const p=(t,e)=>e.toUpperCase(),d=t=>t.replace(/[:-]([a-z])/g,p);function h(t){const e={},n=t.split(';').filter(t=>t.trim()),{length:r}=n;for(let t=0;t<r;t++){const r=n[t];if(0!==r.length){const t=r.split(':'),n=t[0],o=t[1];e[d(n.trim())]=o.trim()}}return e}function x(t,n){if('object'==typeof t){const{Tag:r,props:s,children:c}=t;return null!=s&&s.class&&(s.className=s.class,delete s.class),e.createElement(r,o({key:n},s),c.map(x))}return t}function b(t,e){let n='';for(;e--;)n+=t;return n}const y=t=>b(' ',t.length);function v(t,e){const n=t.split('\n'),r=n.length;let o=e,s=0;for(;s<r;s++){const{length:t}=n[s];if(!(o>=t))break;o-=t}const c=t.slice(0,e).replace(/^\t+/,y),i=/(^|\n).*$/.exec(c),l=i&&i[0]||'',u=t.slice(e),f=/.*(\n|$)/.exec(u);return{line:s,column:o,snippet:`${l}${f&&f[0]}\n${b(' ',l.length)}^`}}const E=/[a-zA-Z0-9:_-]/,O=/<!--/,S=/[\s\t\r\n]/,$=/['"]/;function j(t,e){const n=t.length;let o,c=null,i=function(){for(;M+1<n&&('<'!==t[M]||!E.test(t[M+1])&&!O.test(t.slice(M,M+4)));)M++;return p()},l=null;const u=[];function f(e){const{line:n,column:r,snippet:o}=v(t,M);throw new Error(`${e} (${n}:${r}). If this is valid SVG, it's probably a bug. Please raise an issue\n\n${o}`)}function p(){let e,r='';for(;M<n&&'<'!==(e=t[M]);)r+=e,M+=1;return/\S/.test(r)&&l.push(r),'<'===t[M]?b:p}function b(){const e=t[M];if('?'===e)return p;if('!'===e){const e=M+1;if('--'===t.slice(e,M+3))return y;const n=M+8;if('[CDATA['===t.slice(e,n))return j;if(/doctype/i.test(t.slice(e,n)))return P}if('/'===e)return U;const n=_(),i={},d={tag:n,props:i,children:[],parent:c,Tag:r.tags[n]||s};c?l.push(d):o=d,k(i);const{style:x}=i;'string'==typeof x&&(d.styles=x,i.style=h(x));let b=!1;return'/'===t[M]&&(M+=1,b=!0),'>'!==t[M]&&f('Expected >'),b||(c=d,({children:l}=d),u.push(d)),p}function y(){const e=t.indexOf('--\x3e',M);return~e||f('expected --\x3e'),M=e+2,p}function j(){const e=t.indexOf(']]>',M);return~e||f('expected ]]>'),l.push(t.slice(M+7,e)),M=e+2,p}function P(){const e=t.indexOf('>',M);return-1===e&&f('expected >'),M=e,p}function U(){const e=_();return e||f('Expected tag name'),c&&e!==c.tag&&f(`Expected closing tag </${e}> to match opening tag <${c.tag}>`),T(),'>'!==t[M]&&f('Expected >'),u.pop(),c=u[u.length-1],c&&({children:l}=c),p}function _(){let e,r='';for(;M<n&&E.test(e=t[M]);)r+=e,M+=1;return r}function k(e){for(;M<n;){if(!S.test(t[M]))return;T();const n=_();if(!n)return;let r=!0;T(),'='===t[M]&&(M+=1,T(),r=w(),'id'===n||isNaN(+r)||''===r.trim()||(r=+r)),e[d(n)]=r}}function w(){return $.test(t[M])?D():C()}function C(){let e='';do{const n=t[M];if(' '===n||'>'===n||'/'===n)return e;e+=n,M+=1}while(M<n);return e}function D(){const e=t[M++];let r='',o=!1;for(;M<n;){const n=t[M++];if(n===e&&!o)return r;'\\'!==n||o||(o=!0),r+=o?`\\${n}`:n,o=!1}return r}function T(){for(;M<n&&S.test(t[M]);)M+=1}let M=0;for(;M<n;)i||f('Unexpected character'),i=i(),M+=1;if(i!==p&&f('Unexpected end of input'),o){const t=(e?e(o):o)||o,n=t.children.map(x),r=t;return r.children=n,r}return null}},842,[11,843,844]); 936__d(function(g,r,i,a,m,e,d){"use strict";
936Object.defineProperty(e,'__esModule',{value:!0}),e.fetchText=async function(n){if(!n)return null;return n.startsWith('data:image/svg+xml;utf8'),n.startsWith('data:image/svg+xml;base64')?t(n):s(n)},r(d[0]);const t=t=>{const s=decodeURIComponent(t).split(';')[1].split(',').slice(1).join(',');return atob(s)};async function s(t){const s=await fetch(t);if(s.ok||0===s.status&&t.startsWith('file://'))return await s.text();throw new Error(`Fetching ${t} failed with status ${s.status}`)}},843,[136]); 937__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tags",{enumerable:!0,get:function(){return o}});var t=r(d[0]);const o={circle:t.Circle,clipPath:t.ClipPath,defs:t.Defs,ellipse:t.Ellipse,filter:t.Filter,feBlend:t.FeBlend,feColorMatrix:t.FeColorMatrix,feComponentTransfer:t.FeComponentTransfer,feComposite:t.FeComposite,feConvolveMatrix:t.FeConvolveMatrix,feDiffuseLighting:t.FeDiffuseLighting,feDisplacementMap:t.FeDisplacementMap,feDistantLight:t.FeDistantLight,feDropShadow:t.FeDropShadow,feFlood:t.FeFlood,feGaussianBlur:t.FeGaussianBlur,feImage:t.FeImage,feMerge:t.FeMerge,feMergeNode:t.FeMergeNode,feMorphology:t.FeMorphology,feOffset:t.FeOffset,fePointLight:t.FePointLight,feSpecularLighting:t.FeSpecularLighting,feSpotLight:t.FeSpotLight,feTile:t.FeTile,feTurbulence:t.FeTurbulence,foreignObject:t.ForeignObject,g:t.G,image:t.Image,line:t.Line,linearGradient:t.LinearGradient,marker:t.Marker,mask:t.Mask,path:t.Path,pattern:t.Pattern,polygon:t.Polygon,polyline:t.Polyline,radialGradient:t.RadialGradient,rect:t.Rect,stop:t.Stop,svg:t.Svg,symbol:t.Symbol,text:t.Text,textPath:t.TextPath,tspan:t.TSpan,use:t.Use}},844,[845]); 938__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return se}}),Object.defineProperty(e,"Circle",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"ClipPath",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"Defs",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"Ellipse",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"FeBlend",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"FeColorMatrix",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"FeComponentTransfer",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"FeComposite",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"FeConvolveMatrix",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"FeDiffuseLighting",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"FeDisplacementMap",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"FeDistantLight",{enumerable:!0,get:function(){return x}}),Object.defineProperty(e,"FeDropShadow",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"FeFlood",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"FeFuncA",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"FeFuncB",{enumerable:!0,get:function(){return W}}),Object.defineProperty(e,"FeFuncG",{enumerable:!0,get:function(){return F}}),Object.defineProperty(e,"FeFuncR",{enumerable:!0,get:function(){return w}}),Object.defineProperty(e,"FeGaussianBlur",{enumerable:!0,get:function(){return M}}),Object.defineProperty(e,"FeImage",{enumerable:!0,get:function(){return v}}),Object.defineProperty(e,"FeMerge",{enumerable:!0,get:function(){return L}}),Object.defineProperty(e,"FeMergeNode",{enumerable:!0,get:function(){return C}}),Object.defineProperty(e,"FeMorphology",{enumerable:!0,get:function(){return D}}),Object.defineProperty(e,"FeOffset",{enumerable:!0,get:function(){return T}}),Object.defineProperty(e,"FePointLight",{enumerable:!0,get:function(){return G}}),Object.defineProperty(e,"FeSpecularLighting",{enumerable:!0,get:function(){return B}}),Object.defineProperty(e,"FeSpotLight",{enumerable:!0,get:function(){return R}}),Object.defineProperty(e,"FeTile",{enumerable:!0,get:function(){return N}}),Object.defineProperty(e,"FeTurbulence",{enumerable:!0,get:function(){return A}}),Object.defineProperty(e,"Filter",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"ForeignObject",{enumerable:!0,get:function(){return $}}),Object.defineProperty(e,"G",{enumerable:!0,get:function(){return k}}),Object.defineProperty(e,"Image",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"Line",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"LinearGradient",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"Marker",{enumerable:!0,get:function(){return z}}),Object.defineProperty(e,"Mask",{enumerable:!0,get:function(){return X}}),Object.defineProperty(e,"Path",{enumerable:!0,get:function(){return q}}),Object.defineProperty(e,"Pattern",{enumerable:!0,get:function(){return H}}),Object.defineProperty(e,"Polygon",{enumerable:!0,get:function(){return J}}),Object.defineProperty(e,"Polyline",{enumerable:!0,get:function(){return K}}),Object.defineProperty(e,"RadialGradient",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(e,"Rect",{enumerable:!0,get:function(){return V}}),Object.defineProperty(e,"Stop",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(e,"Svg",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(e,"Symbol",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(e,"TSpan",{enumerable:!0,get:function(){return te}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(e,"TextPath",{enumerable:!0,get:function(){return re}}),Object.defineProperty(e,"Use",{enumerable:!0,get:function(){return ae}});var t=r(d[0]),n=r(d[1]);class s extends n.WebShape{tag='circle'}class c extends n.WebShape{tag='clipPath'}class u extends n.WebShape{tag='defs'}class o extends n.WebShape{tag='ellipse'}class b extends n.WebShape{tag='feBlend'}class l extends n.WebShape{tag='feColorMatrix'}class f extends n.WebShape{tag='feComponentTransfer'}class p extends n.WebShape{tag='feComposite'}class h extends n.WebShape{tag='feConvolveMatrix'}class S extends n.WebShape{tag='feDiffuseLighting'}class P extends n.WebShape{tag='feDisplacementMap'}class x extends n.WebShape{tag='feDistantLight'}class y extends n.WebShape{tag='feDropShadow'}class O extends n.WebShape{tag='feFlood'}class j extends n.WebShape{tag='feFuncA'}class W extends n.WebShape{tag='feFuncB'}class F extends n.WebShape{tag='feFuncG'}class w extends n.WebShape{tag='feFuncR'}class M extends n.WebShape{tag='feGaussianBlur'}class v extends n.WebShape{tag='feImage'}class L extends n.WebShape{tag='feMerge'}class C extends n.WebShape{tag='feMergeNode'}class D extends n.WebShape{tag='feMorphology'}class T extends n.WebShape{tag='feOffset'}class G extends n.WebShape{tag='fePointLight'}class B extends n.WebShape{tag='feSpecularLighting'}class R extends n.WebShape{tag='feSpotLight'}class N extends n.WebShape{tag='feTile'}class A extends n.WebShape{tag='feTurbulence'}class I extends n.WebShape{tag='filter'}class $ extends n.WebShape{tag='foreignObject'}class k extends n.WebShape{tag='g';prepareProps(t){const{x:n,y:s,...c}=t;return!n&&!s||c.translate||(c.translate=`${n||0}, ${s||0}`),c}}class _ extends n.WebShape{tag='image'}class E extends n.WebShape{tag='line'}class U extends n.WebShape{tag='linearGradient'}class z extends n.WebShape{tag='marker'}class X extends n.WebShape{tag='mask'}class q extends n.WebShape{tag='path'}class H extends n.WebShape{tag='pattern'}class J extends n.WebShape{tag='polygon'}class K extends n.WebShape{tag='polyline'}class Q extends n.WebShape{tag='radialGradient'}class V extends n.WebShape{tag='rect'}class Y extends n.WebShape{tag='stop'}class Z extends n.WebShape{tag='svg';toDataURL(n,s={}){const c=this.elementRef.current;if(null===c)return;const u=(0,t.getBoundingClientRect)(c),o=Number(s.width)||u.width,b=Number(s.height)||u.height,l=document.createElementNS('http://www.w3.org/2000/svg','svg');l.setAttribute('viewBox',`0 0 ${u.width} ${u.height}`),l.setAttribute('width',String(o)),l.setAttribute('height',String(b)),l.appendChild(c.cloneNode(!0));const f=new window.Image;f.onload=()=>{const t=document.createElement('canvas');t.width=o,t.height=b;const s=t.getContext('2d');null==s||s.drawImage(f,0,0),n(t.toDataURL().replace('data:image/png;base64,',''))},f.src=`data:image/svg+xml;utf8,${(0,t.encodeSvg)((new window.XMLSerializer).serializeToString(l))}`}}class ee extends n.WebShape{tag='symbol'}class te extends n.WebShape{tag='tspan'}class ne extends n.WebShape{tag='text'}class re extends n.WebShape{tag='textPath'}class ae extends n.WebShape{tag='use'}var se=Z},845,[846,847]); 939__d(function(g,r,i,a,_m,e,d){"use strict";
939Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"camelCaseToDashed",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"getBoundingClientRect",{enumerable:!0,get:function(){return n}}),e.remeasure=function(){const t=this.state.touchable.responderID;if(null===t)return;o(t,this._handleQueryLayout)},e.encodeSvg=function(t){return t.replace('<svg',~t.indexOf('xmlns')?'<svg':'<svg xmlns="http://www.w3.org/2000/svg"').replace(/"/g,"'").replace(/%/g,'%25').replace(/#/g,'%23').replace(/{/g,'%7B').replace(/}/g,'%7D').replace(/</g,'%3C').replace(/>/g,'%3E').replace(/\s+/g,' ')},Object.defineProperty(e,"getAttributeName",{enumerable:!0,get:function(){return c}});const t=t=>t.replace(/[A-Z]/g,t=>'-'+t.toLowerCase()),n=t=>{if(t){if(1===t.nodeType&&'function'==typeof t.getBoundingClientRect)return t.getBoundingClientRect()}throw new Error('Can not get boundingClientRect of '+t||'undefined')},o=(t,o)=>{const s=null==t?void 0:t.parentNode;s&&setTimeout(()=>{const c=n(s),{height:l,left:u,top:p,width:f}=n(t),h=u-c.left,m=p-c.top;o(h,m,f,l,u,p)},0)};const s=new Set(['stdDeviation','edgeMode','kernelMatrix','kernelUnitLength','preserveAlpha','baseFrequency','targetX','targetY','numOctaves','stitchTiles','filterUnits','primitiveUnits','pathLength','gradientUnits','gradientTransform','spreadMethod','markerHeight','markerUnits','markerWidth','viewBox','refX','refY','maskContentUnits','maskUnits','patternContentUnits','patternTransform','patternUnits','textLength','lengthAdjust','startOffset','clipPathUnits']),c=n=>s.has(n)?n:t(n)},846,[]); 940__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WebShape",{enumerable:!0,get:function(){return u}});
940var t=e(r(d[0])),s=e(r(d[1])),o=r(d[2]),n=r(d[3]),c=r(d[4]),p=r(d[5]),l=e(r(d[6]));class u extends t.default.Component{prepareProps(e){return e}elementRef=t.default.createRef();lastMergedProps={};setNativeProps(e){const t=Object.assign({},this.props,this.lastMergedProps,e.style);this.lastMergedProps=t;const s=(0,o.prepare)(this,this.prepareProps(t)),p=this.elementRef.current;if(p)for(const e of Object.keys(s)){const t=s[e];switch(e){case'ref':case'children':break;case'style':for(const e of[].concat(s.style??[]))Object.assign(p.style,e);break;case'fill':if(t&&'object'==typeof t){const e=t;p.setAttribute('fill',(0,n.convertInt32ColorToRGBA)(e.payload))}break;case'stroke':if(t&&'object'==typeof t){const e=t;p.setAttribute('stroke',(0,n.convertInt32ColorToRGBA)(e.payload))}break;default:p.setAttribute((0,c.getAttributeName)(e),t)}}}constructor(e){super(e),(0,p.hasTouchableProperty)(e)&&(0,l.default)(this),this._remeasureMetricsOnActivation=c.remeasure.bind(this)}render(){if(!this.tag)throw new Error('When extending `WebShape` you need to overwrite either `tag` or `render`!');return this.lastMergedProps={},(0,s.default)(this.tag,(0,o.prepare)(this,this.prepareProps(this.props)))}}},847,[11,15,848,857,846,849,858]); 941__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"prepare",{enumerable:!0,get:function(){return s}});var n=r(d[0]),o=r(d[1]),t=r(d[2]),l=r(d[3]);const s=(s,u=s.props)=>{const{transform:f,origin:p,originX:c,originY:R,fontFamily:h,fontSize:T,fontWeight:S,fontStyle:b,style:v,forwardedRef:y,gradientTransform:P,patternTransform:H,onPress:_,...M}=u,j={...(0,n.hasTouchableProperty)(u)?{onStartShouldSetResponder:s.touchableHandleStartShouldSetResponder,onResponderTerminationRequest:s.touchableHandleResponderTerminationRequest,onResponderGrant:s.touchableHandleResponderGrant,onResponderMove:s.touchableHandleResponderMove,onResponderRelease:s.touchableHandleResponderRelease,onResponderTerminate:s.touchableHandleResponderTerminate}:null,...M};null!=p?j['transform-origin']=p.toString().replace(',',' '):null==c&&null==R||(j['transform-origin']=`${c||0} ${R||0}`);const q=(0,o.parseTransformProp)(f,u);q&&(j.transform=q);const z=(0,o.parseTransformProp)(P);z&&(j.gradientTransform=z);const F=(0,o.parseTransformProp)(H);F&&(j.patternTransform=F),j.ref=n=>{s.elementRef.current=n,'function'==typeof y?y(n):y&&(y.current=n)};const G={};var O;(null!=h&&(G.fontFamily=h),null!=T&&(G.fontSize=T),null!=S&&(G.fontWeight=S),null!=b&&(G.fontStyle=b),j.style=(0,t.resolve)(v,G),null!==_&&(j.onClick=u.onPress),null!==u.href&&void 0!==u.href)&&(j.href=null===(O=(0,l.resolveAssetUri)(u.href))||void 0===O?void 0:O.uri);return j}},848,[849,850,855,856]); 942__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.hasTouchableProperty=function(n){return!!(n.onPress||n.onPressIn||n.onPressOut||n.onLongPress)}},849,[]); 943__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseTransformProp=function(n,l){const u=[];if(l&&u.push(...t(l)),Array.isArray(n))if('number'==typeof n[0])u.push(`matrix(${n.join(' ')})`);else{const t=(0,s.stringifyTransformArrayProps)(n).split(' ');u.push(...t)}else'string'==typeof n&&u.push(n);return u.length?u.join(' '):void 0},e.stringifyTransformProps=t;var s=r(d[0]);function t(s){const t=[];return null!=s.translate&&t.push(`translate(${s.translate})`),null==s.translateX&&null==s.translateY||t.push(`translate(${s.translateX||0}, ${s.translateY||0})`),null!=s.scale&&t.push(`scale(${s.scale})`),null==s.scaleX&&null==s.scaleY||t.push(`scale(${s.scaleX||1}, ${s.scaleY||1})`),null!=s.rotation&&t.push(`rotate(${s.rotation})`),null!=s.skewX&&t.push(`skewX(${s.skewX})`),null!=s.skewY&&t.push(`skewY(${s.skewY})`),t}},850,[851]); 944__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}}),_e.props2transform=o,_e.transformToMatrix=u,_e.extractTransformSvgView=function(e){if('string'==typeof e.transform)return(0,t.parse)(e.transform);return e.transform},_e.stringifyTransformArrayProps=y;var e=r(d[0]),n=r(d[1]),t=r(d[2]);function s(n){const{x:t,y:s,originX:l,originY:o,scaleX:u,scaleY:c,rotation:f,skewX:y,skewY:p}=n;(0,e.appendTransform)(t+l,s+o,u,c,f,y,p,l,o)}function l(e,n,t,s){let l,o;if('number'==typeof e)l=o=e;else if('string'==typeof e){const n=e.split(/\s*,\s*/);2===n.length?(l=+n[0],o=+n[1]):1===n.length&&(l=o=+n[0])}else Array.isArray(e)&&(2===e.length?(l=+e[0],o=+e[1]):1===e.length&&(l=o=+e[0]));return n=+n,isNaN(n)||(l=n),t=+t,isNaN(t)||(o=t),[l||s||0,o||s||0]}function o(e){if(!e)return null;const{rotation:n,translate:t,translateX:s,translateY:o,origin:u,originX:c,originY:f,scale:y,scaleX:p,scaleY:A,skew:w,skewX:X,skewY:Y,x:h,y:k}=e;if(null==n&&null==t&&null==s&&null==o&&null==u&&null==c&&null==f&&null==y&&null==p&&null==A&&null==w&&null==X&&null==Y&&null==h&&null==k)return null;(Array.isArray(h)||Array.isArray(k))&&console.warn('Passing SvgLengthList to x or y attribute where SvgLength expected');const x=l(t,s||(Array.isArray(h)?h[0]:h),o||(Array.isArray(k)?k[0]:k)),$=l(u,c,f),b=l(y,p,A,1),v=l(w,X,Y);return{rotation:null==n?0:+n||0,originX:$[0],originY:$[1],scaleX:b[0],scaleY:b[1],skewX:v[0],skewY:v[1],x:x[0],y:x[1]}}function u(t,l){if(!t&&!l)return null;if((0,e.reset)(),t&&s(t),l)if(Array.isArray(l))if('number'==typeof l[0]){const n=l;(0,e.append)(n[0],n[1],n[2],n[3],n[4],n[5])}else{const t=y(l),s=(0,n.parse)(t);(0,e.append)(s[0],s[3],s[1],s[4],s[2],s[5])}else if('string'==typeof l)try{const t=(0,n.parse)(l);(0,e.append)(t[0],t[3],t[1],t[4],t[2],t[5])}catch(e){console.error(e)}else{const e=o(l);e&&s(e)}return(0,e.toArray)()}function c(t){if(Array.isArray(t)&&'number'==typeof t[0])return t;if('string'==typeof t)try{const e=(0,n.parse)(t);return[e[0],e[3],e[1],e[4],e[2],e[5]]}catch(n){return console.error(n),e.identity}const s=t;return u(o(s),null==s?void 0:s.transform)}const f=e=>e.endsWith('rad')?parseFloat(e)*(180/Math.PI):e.endsWith('deg')?parseFloat(e):void 0;function y(e){return e?e.map(e=>{const[n,t]=Object.entries(e)[0];switch(n){case'translateX':return`translate(${t}, 0)`;case'translateY':return`translate(0, ${t})`;case'rotate':return`rotate(${f(t)})`;case'scale':return`scale(${t})`;case'scaleX':return`scale(${t}, 1)`;case'scaleY':return`scale(1, ${t})`;case'skewX':return`skewX(${f(t)})`;case'skewY':return`skewY(${f(t)})`;case'matrix':return`matrix(${t.join(', ')})`;default:return''}}).join(' '):''}},851,[852,853,854]); 945__d(function(g,_r,i,_a,m,e,_d){"use strict";
945Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"identity",{enumerable:!0,get:function(){return n}}),e.reset=function(){if(a)return;r=c=1,o=u=f=s=0,a=!0},e.toArray=function(){if(a)return n;return[r,o,u,c,f,s]},e.append=d,e.appendTransform=function(n,l,p,M,h,y,_,b,P){if(0===n&&0===l&&1===p&&1===M&&0===h&&0===y&&0===_&&0===b&&0===P)return;let j,v;if(h%360){const n=h*t;j=Math.cos(n),v=Math.sin(n)}else j=1,v=0;const O=j*p,A=v*p,I=-v*M,T=j*M;if(y||_){const r=Math.tan(_*t),o=Math.tan(y*t);d(O+o*A,r*O+A,I+o*T,r*I+T,n,l)}else d(O,A,I,T,n,l);(b||P)&&(f-=b*r+P*u,s-=b*o+P*c,a=!1)};const t=Math.PI/180,n=[1,0,0,1,0,0];let r=1,o=0,u=0,c=1,f=0,s=0,a=!0;function d(t,n,d,l,p,M){const h=1!==t||0!==n||0!==d||1!==l,y=0!==p||0!==M;if(!h&&!y)return;if(a)return a=!1,r=t,o=n,u=d,c=l,f=p,void(s=M);const _=r,b=o,P=u,j=c;h&&(r=_*t+P*n,o=b*t+j*n,u=_*d+P*l,c=b*d+j*l),y&&(f=_*p+P*M+f,s=b*p+j*M+s)}},852,[]); 946__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(r,n,t,u){this.message=r,this.expected=n,this.found=t,this.location=u,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}!(function(e,r){function n(){this.constructor=e}n.prototype=r.prototype,e.prototype=new n})(e,Error),e.buildMessage=function(e,r){var n={literal:function(e){return"\""+u(e.text)+"\""},class:function(e){var r,n="";for(r=0;r<e.parts.length;r++)n+=e.parts[r]instanceof Array?o(e.parts[r][0])+"-"+o(e.parts[r][1]):o(e.parts[r]);return"["+(e.inverted?"^":"")+n+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}function u(e){return e.replace(/\\/g,'\\\\').replace(/"/g,'\\"').replace(/\0/g,'\\0').replace(/\t/g,'\\t').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/[\x00-\x0F]/g,function(e){return'\\x0'+t(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return'\\x'+t(e)})}function o(e){return e.replace(/\\/g,'\\\\').replace(/\]/g,'\\]').replace(/\^/g,'\\^').replace(/-/g,'\\-').replace(/\0/g,'\\0').replace(/\t/g,'\\t').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/[\x00-\x0F]/g,function(e){return'\\x0'+t(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return'\\x'+t(e)})}function i(e){return n[e.type](e)}return"Expected "+(function(e){var r,n,t=new Array(e.length);for(r=0;r<e.length;r++)t[r]=i(e[r]);if(t.sort(),t.length>0){for(r=1,n=1;r<t.length;r++)t[r-1]!==t[r]&&(t[n]=t[r],n++);t.length=n}switch(t.length){case 1:return t[0];case 2:return t[0]+" or "+t[1];default:return t.slice(0,-1).join(", ")+", or "+t[t.length-1]}})(e)+" but "+(function(e){return e?"\""+u(e)+"\"":"end of input"})(r)+" found."},m.exports={SyntaxError:e,parse:function(r,n){n=void 0!==n?n:{};var t,u={},o={transformList:ae},i=ae,f=function(e){return e},s=function(e,r){return t=r,u=(n=e)[0],o=n[1],i=n[2],f=n[3],s=n[4],l=n[5],c=t[0],a=t[1],h=t[2],p=t[3],d=t[4],v=t[5],[u*c+o*p,u*a+o*d,u*h+o*v+i,f*c+s*p,f*a+s*d,f*h+s*v+l];var n,t,u,o,i,f,s,l,c,a,h,p,d,v},l="matrix",c=ie("matrix",!1),a="(",h=ie("(",!1),p=")",d=ie(")",!1),v=function(e,r,n,t,u,o){return[e,n,u,r,t,o]},A="translate",x=ie("translate",!1),C=function(e,r){return[1,0,e,0,1,r||0]},y="scale",j=ie("scale",!1),w=function(e,r){return[e,0,0,0,null===r?e:r,0]},b="rotate",E=ie("rotate",!1),F=function(e,r){var n=Math.cos(Pe*e),t=Math.sin(Pe*e);if(null!==r){var u=r[0],o=r[1];return[n,-t,n*-u+-t*-o+u,t,n,t*-u+n*-o+o]}return[n,-t,0,t,n,0]},M="skewX",k=ie("skewX",!1),S=function(e){return[1,Math.tan(Pe*e),0,0,1,0]},R="skewY",I=ie("skewY",!1),T=function(e){return[1,0,0,Math.tan(Pe*e),1,0]},X=function(e){return parseFloat(e.join(""))},Y=function(e){return parseInt(e.join(""))},_=function(e){return e},L=function(e,r){return[e,r]},P=",",U=ie(",",!1),q=function(e){return e.join("")},z=function(e){return e.join("")},B=function(e){return e.join("")},D={type:"other",description:"fractionalConstant"},G=".",H=ie(".",!1),J=function(e,r){return[e?e.join(""):null,".",r.join("")].join("")},K=/^[eE]/,N=fe(["e","E"],!1,!1),O=function(e){return[e[0],e[1],e[2].join("")].join("")},Q=/^[+\-]/,V=fe(["+","-"],!1,!1),W=/^[0-9]/,Z=fe([["0","9"]],!1,!1),$=/^[ \t\r\n]/,ee=fe([" ","\t","\r","\n"],!1,!1),re=0,ne=[{line:1,column:1}],te=0,ue=[],oe=0;if("startRule"in n){if(!(n.startRule in o))throw new Error("Can't start parsing from rule \""+n.startRule+"\".");i=o[n.startRule]}function ie(e,r){return{type:"literal",text:e,ignoreCase:r}}function fe(e,r,n){return{type:"class",parts:e,inverted:r,ignoreCase:n}}function se(e){var n,t=ne[e];
vendor: 5,534 bytes, line 946
946if(t)return t;for(n=e-1;!ne[n];)n--;for(t={line:(t=ne[n]).line,column:t.column};n<e;)10===r.charCodeAt(n)?(t.line++,t.column=1):t.column++,n++;return ne[e]=t,t}function le(e,r){var n=se(e),t=se(r);return{start:{offset:e,line:n.line,column:n.column},end:{offset:r,line:t.line,column:t.column}}}function ce(e){re<te||(re>te&&(te=re,ue=[]),ue.push(e))}function ae(){var e,r,n,t,o;for(e=re,r=[],n=Te();n!==u;)r.push(n),n=Te();if(r!==u)if((n=he())===u&&(n=null),n!==u){for(t=[],o=Te();o!==u;)t.push(o),o=Te();t!==u?e=r=f(n):(re=e,e=u)}else re=e,e=u;else re=e,e=u;return e}function he(){var e,r,n,t;if(e=re,(r=pe())!==u){for(n=[],t=we();t!==u;)n.push(t),t=we();n!==u&&(t=he())!==u?e=r=s(r,t):(re=e,e=u)}else re=e,e=u;return e===u&&(e=pe()),e}function pe(){var e;return(e=ge())===u&&(e=de())===u&&(e=ve())===u&&(e=Ae())===u&&(e=xe())===u&&(e=Ce()),e}function ge(){var e,n,t,o,i,f,s,A,x,C,y,j,w;if(e=re,r.substr(re,6)===l?(n=l,re+=6):(n=u,0===oe&&ce(c)),n!==u){for(t=[],o=Te();o!==u;)t.push(o),o=Te();if(t!==u)if(40===r.charCodeAt(re)?(o=a,re++):(o=u,0===oe&&ce(h)),o!==u){for(i=[],f=Te();f!==u;)i.push(f),f=Te();if(i!==u)if((f=me())!==u)if(we()!==u)if((s=me())!==u)if(we()!==u)if((A=me())!==u)if(we()!==u)if((x=me())!==u)if(we()!==u)if((C=me())!==u)if(we()!==u)if((y=me())!==u){for(j=[],w=Te();w!==u;)j.push(w),w=Te();j!==u?(41===r.charCodeAt(re)?(w=p,re++):(w=u,0===oe&&ce(d)),w!==u?e=n=v(f,s,A,x,C,y):(re=e,e=u)):(re=e,e=u)}else re=e,e=u;else re=e,e=u;else re=e,e=u;else re=e,e=u;else re=e,e=u;else re=e,e=u;else re=e,e=u;else re=e,e=u;else re=e,e=u;else re=e,e=u;else re=e,e=u;else re=e,e=u}else re=e,e=u;else re=e,e=u}else re=e,e=u;return e}function de(){var e,n,t,o,i,f,s,l,c;if(e=re,r.substr(re,9)===A?(n=A,re+=9):(n=u,0===oe&&ce(x)),n!==u){for(t=[],o=Te();o!==u;)t.push(o),o=Te();if(t!==u)if(40===r.charCodeAt(re)?(o=a,re++):(o=u,0===oe&&ce(h)),o!==u){for(i=[],f=Te();f!==u;)i.push(f),f=Te();if(i!==u)if((f=me())!==u)if((s=ye())===u&&(s=null),s!==u){for(l=[],c=Te();c!==u;)l.push(c),c=Te();l!==u?(41===r.charCodeAt(re)?(c=p,re++):(c=u,0===oe&&ce(d)),c!==u?e=n=C(f,s):(re=e,e=u)):(re=e,e=u)}else re=e,e=u;else re=e,e=u;else re=e,e=u}else re=e,e=u;else re=e,e=u}else re=e,e=u;return e}function ve(){var e,n,t,o,i,f,s,l,c;if(e=re,r.substr(re,5)===y?(n=y,re+=5):(n=u,0===oe&&ce(j)),n!==u){for(t=[],o=Te();o!==u;)t.push(o),o=Te();if(t!==u)if(40===r.charCodeAt(re)?(o=a,re++):(o=u,0===oe&&ce(h)),o!==u){for(i=[],f=Te();f!==u;)i.push(f),f=Te();if(i!==u)if((f=me())!==u)if((s=ye())===u&&(s=null),s!==u){for(l=[],c=Te();c!==u;)l.push(c),c=Te();l!==u?(41===r.charCodeAt(re)?(c=p,re++):(c=u,0===oe&&ce(d)),c!==u?e=n=w(f,s):(re=e,e=u)):(re=e,e=u)}else re=e,e=u;else re=e,e=u;else re=e,e=u}else re=e,e=u;else re=e,e=u}else re=e,e=u;return e}function Ae(){var e,n,t,o,i,f,s,l,c;if(e=re,r.substr(re,6)===b?(n=b,re+=6):(n=u,0===oe&&ce(E)),n!==u){for(t=[],o=Te();o!==u;)t.push(o),o=Te();if(t!==u)if(40===r.charCodeAt(re)?(o=a,re++):(o=u,0===oe&&ce(h)),o!==u){for(i=[],f=Te();f!==u;)i.push(f),f=Te();if(i!==u)if((f=me())!==u)if((s=je())===u&&(s=null),s!==u){for(l=[],c=Te();c!==u;)l.push(c),c=Te();l!==u?(41===r.charCodeAt(re)?(c=p,re++):(c=u,0===oe&&ce(d)),c!==u?e=n=F(f,s):(re=e,e=u)):(re=e,e=u)}else re=e,e=u;else re=e,e=u;else re=e,e=u}else re=e,e=u;else re=e,e=u}else re=e,e=u;return e}function xe(){var e,n,t,o,i,f,s,l;if(e=re,r.substr(re,5)===M?(n=M,re+=5):(n=u,0===oe&&ce(k)),n!==u){for(t=[],o=Te();o!==u;)t.push(o),o=Te();if(t!==u)if(40===r.charCodeAt(re)?(o=a,re++):(o=u,0===oe&&ce(h)),o!==u){for(i=[],f=Te();f!==u;)i.push(f),f=Te();if(i!==u)if((f=me())!==u){for(s=[],l=Te();l!==u;)s.push(l),l=Te();s!==u?(41===r.charCodeAt(re)?(l=p,re++):(l=u,0===oe&&ce(d)),l!==u?e=n=S(f):(re=e,e=u)):(re=e,e=u)}else re=e,e=u;else re=e,e=u}else re=e,e=u;else re=e,e=u}else re=e,e=u;return e}function Ce(){var e,n,t,o,i,f,s,l;if(e=re,r.substr(re,5)===R?(n=R,re+=5):(n=u,0===oe&&ce(I)),n!==u){for(t=[],o=Te();o!==u;)t.push(o),o=Te();if(t!==u)if(40===r.charCodeAt(re)?(o=a,re++):(o=u,0===oe&&ce(h)),o!==u){for(i=[],f=Te();f!==u;)i.push(f),f=Te();if(i!==u)if((f=me())!==u){for(s=[],l=Te();l!==u;)s.push(l),l=Te();s!==u?(41===r.charCodeAt(re)?(l=p,re++):(l=u,0===oe&&ce(d)),l!==u?e=n=T(f):(re=e,e=u)):(re=e,e=u)}else re=e,e=u;else re=e,e=u}else re=e,e=u;else re=e,e=u}else re=e,e=u;return e}function me(){var e,r,n,t;return e=re,r=re,(n=Se())===u&&(n=null),n!==u&&(t=Fe())!==u?r=n=[n,t]:(re=r,r=u),r!==u&&(r=X(r)),(e=r)===u&&(e=re,r=re,(n=Se())===u&&(n=null),n!==u&&(t=Ee())!==u?r=n=[n,t]:(re=r,r=u),r!==u&&(r=Y(r)),e=r),e}function ye(){var e,r;return e=re,we()!==u&&(r=me())!==u?e=_(r):(re=e,e=u),e}function je(){var e,r,n;return e=re,we()!==u&&(r=me())!==u&&we()!==u&&(n=me())!==u?e=L(r,n):(re=e,e=u),e}function we(){var e,r,n,t,o;if(e=re,r=[],(n=Te())!==u)for(;n!==u;)r.push(n),n=Te();else r=u;if(r!==u)if((n=be())===u&&(n=null),n!==u){for(t=[],o=Te();o!==u;)t.push(o),o=Te();t!==u?e=r=[r,n,t]:(re=e,e=u)}else re=e,e=u;else re=e,e=u;if(e===u)if(e=re,(r=be())!==u){for(n=[],t=Te();t!==u;)n.push(t),t=Te();n!==u?e=r=[r,n]:(re=e,e=u)}else re=e,e=u;return e}function be(){var e;return 44===r.charCodeAt(re)?(e=P,re++):(e=u,0===oe&&ce(U)),e}function Ee(){var e,r;return e=re,(r=Re())!==u&&(r=q(r)),e=r}function Fe(){var e,r,n,t;return e=re,r=re,(n=Me())!==u?((t=ke())===u&&(t=null),t!==u?r=n=[n,t]:(re=r,r=u)):(re=r,r=u),r!==u&&(r=z(r)),(e=r)===u&&(e=re,r=re,(n=Re())!==u&&(t=ke())!==u?r=n=[n,t]:(re=r,r=u),r!==u&&(r=B(r)),e=r),e}function Me(){var e,n,t,o;return oe++,e=re,(n=Re())===u&&(n=null),n!==u?(46===r.charCodeAt(re)?(t=G,re++):(t=u,0===oe&&ce(H)),t!==u&&(
946o=Re())!==u?e=n=J(n,o):(re=e,e=u)):(re=e,e=u),e===u&&(e=re,(n=Re())!==u?(46===r.charCodeAt(re)?(t=G,re++):(t=u,0===oe&&ce(H)),t!==u?e=n=B(n):(re=e,e=u)):(re=e,e=u)),oe--,e===u&&(n=u,0===oe&&ce(D)),e}function ke(){var e,n,t,o,i;return e=re,n=re,K.test(r.charAt(re))?(t=r.charAt(re),re++):(t=u,0===oe&&ce(N)),t!==u?((o=Se())===u&&(o=null),o!==u&&(i=Re())!==u?n=t=[t,o,i]:(re=n,n=u)):(re=n,n=u),n!==u&&(n=O(n)),e=n}function Se(){var e;return Q.test(r.charAt(re))?(e=r.charAt(re),re++):(e=u,0===oe&&ce(V)),e}function Re(){var e,r;if(e=[],(r=Ie())!==u)for(;r!==u;)e.push(r),r=Ie();else e=u;return e}function Ie(){var e;return W.test(r.charAt(re))?(e=r.charAt(re),re++):(e=u,0===oe&&ce(Z)),e}function Te(){var e;return $.test(r.charAt(re))?(e=r.charAt(re),re++):(e=u,0===oe&&ce(ee)),e}var Xe,Ye,Le,Pe=Math.PI/180;if((t=i())!==u&&re===r.length)return t;throw t!==u&&re<r.length&&ce({type:"end"}),Xe=ue,Ye=te<r.length?r.charAt(te):null,Le=te<r.length?le(te,te+1):le(te,te),new e(e.buildMessage(Xe,Ye),Xe,Ye,Le)}}},853,[]); 947__d(function(_g,r,_i,_a,m,_e,_d){'use strict';function t(e,n,o,u){var a=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(a,t.prototype),a.expected=n,a.found=o,a.location=u,a.name='SyntaxError',a}function e(t,e,n){return n=n||' ',t.length>e?t:(e-=t.length,t+(n+=n.repeat(e)).slice(0,e))}!(function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n})(t,Error),t.prototype.format=function(t){var n='Error: '+this.message;if(this.location){var o,u=null;for(o=0;o<t.length;o++)if(t[o].source===this.location.source){u=t[o].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,c=this.location.source&&'function'==typeof this.location.source.offset?this.location.source.offset(a):a,s=this.location.source+':'+c.line+':'+c.column;if(u){var i=this.location.end,l=e('',c.line.toString().length,' '),f=u[a.line-1],p=(a.line===i.line?i.column:f.length+1)-a.column||1;n+='\n --\x3e '+s+'\n'+l+' |\n'+c.line+' | '+f+'\n'+l+' | '+e('',a.column-1,' ')+e('',p,'^')}else n+='\n at '+s}return n},t.buildMessage=function(t,e){var n={literal:function(t){return'"'+u(t.text)+'"'},class:function(t){var e=t.parts.map(function(t){return Array.isArray(t)?a(t[0])+'-'+a(t[1]):a(t)});return'['+(t.inverted?'^':'')+e.join('')+']'},any:function(){return'any character'},end:function(){return'end of input'},other:function(t){return t.description}};function o(t){return t.charCodeAt(0).toString(16).toUpperCase()}function u(t){return t.replace(/\\/g,'\\\\').replace(/"/g,'\\"').replace(/\0/g,'\\0').replace(/\t/g,'\\t').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/[\x00-\x0F]/g,function(t){return'\\x0'+o(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return'\\x'+o(t)})}function a(t){return t.replace(/\\/g,'\\\\').replace(/\]/g,'\\]').replace(/\^/g,'\\^').replace(/-/g,'\\-').replace(/\0/g,'\\0').replace(/\t/g,'\\t').replace(/\n/g,'\\n').replace(/\r/g,'\\r').replace(/[\x00-\x0F]/g,function(t){return'\\x0'+o(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return'\\x'+o(t)})}function c(t){return n[t.type](t)}return'Expected '+(function(t){var e,n,o=t.map(c);if(o.sort(),o.length>0){for(e=1,n=1;e<o.length;e++)o[e-1]!==o[e]&&(o[n]=o[e],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+' or '+o[1];default:return o.slice(0,-1).join(', ')+', or '+o[o.length-1]}})(t)+' but '+(function(t){return t?'"'+u(t)+'"':'end of input'})(e)+' found.'},m.exports={StartRules:['start'],SyntaxError:t,parse:function(e,n){var o,u,a,c,s={},i=(n=void 0!==n?n:{}).grammarSource,l={start:At},f=At,p='matrix(',h=')',g='translate(',d='scale(',x='rotate(',A='skewX(',v='skewY(',y='.',w='e',F=/^[ \t\n\r,]/,b=/^[ \t\n\r]/,C=/^[+\-]/,$=/^[0-9]/,E=gt('transform functions'),k=gt('transformFunctions'),S=gt('transform function'),P=gt('matrix'),R=pt('matrix(',!1),X=pt(')',!1),Y=gt('translate'),j=pt('translate(',!1),O=gt('scale'),M=pt('scale(',!1),_=gt('rotate'),D=pt('rotate(',!1),I=gt('x, y'),L=gt('skewX'),U=pt('skewX(',!1),q=gt('skewY'),z=pt('skewY(',!1),B=gt('space or comma'),G=ht([' ','\t','\n','\r',','],!1,!1),H=gt('whitespace'),J=ht([' ','\t','\n','\r'],!1,!1),K=ht(['+','-'],!1,!1),N=ht([['0','9']],!1,!1),Q=pt('.',!1),T=pt
947('e',!1),V=function(t,e){const n=Array.isArray(t)?t:[t];return e.forEach(t=>{Array.isArray(t[1])?n.push(...t[1]):n.push(t[1])}),n},W=function(t,e,n,o,u,a,c,s,i){return{matrix:[t,e,n,o,u,a,c,s,i]}},Z=function(t,e){return null==e?{translate:t}:{translate:[t,e]}},tt=function(t,e){return null==e?{scale:t}:[{scaleX:t},{scaleY:e}]},rt=function(t,e){return null!==e?{rotate:`${t}deg`}:[{rotate:`${t}deg`}]},et=function(t,e){return[t,e]},nt=function(t){return[{skewX:`${t}deg`}]},ot=function(t){return[{skewY:`${t}deg`}]},ut=function(){return parseFloat(e.substring(ct,at))},at=0|n.peg$currPos,ct=at,st=[{line:1,column:1}],it=at,lt=n.peg$maxFailExpected||[],ft=0|n.peg$silentFails;if(n.startRule){if(!(n.startRule in l))throw new Error('Can\'t start parsing from rule "'+n.startRule+'".');f=l[n.startRule]}function pt(t,e){return{type:'literal',text:t,ignoreCase:e}}function ht(t,e,n){return{type:'class',parts:t,inverted:e,ignoreCase:n}}function gt(t){return{type:'other',description:t}}function dt(t){var n,o=st[t];if(o)return o;if(t>=st.length)n=st.length-1;else for(n=t;!st[--n];);for(o={line:(o=st[n]).line,column:o.column};n<t;)10===e.charCodeAt(n)?(o.line++,o.column=1):o.column++,n++;return st[t]=o,o}function xt(t,e,n){var o=dt(t),u=dt(e),a={source:i,start:{offset:t,line:o.line,column:o.column},end:{offset:e,line:u.line,column:u.column}};return n&&i&&'function'==typeof i.offset&&(a.start=i.offset(a.start),a.end=i.offset(a.end)),a}function mt(t){at<it||(at>it&&(it=at,lt=[]),lt.push(t))}function At(){var t;return ft++,t=vt(),ft--,t===s&&(0===ft&&mt(E)),t}function vt(){var t,e,n,o,u,a;if(ft++,t=at,(e=yt())!==s){for(n=[],o=at,u=Pt(),(a=yt())!==s?o=u=[u,a]:(at=o,o=s);o!==s;)n.push(o),o=at,u=Pt(),(a=yt())!==s?o=u=[u,a]:(at=o,o=s);ct=t,t=V(e,n)}else at=t,t=s;return ft--,t===s&&(e=s,0===ft&&mt(k)),t}function yt(){var t;return ft++,(t=wt())===s&&(t=Ft())===s&&(t=bt())===s&&(t=Ct())===s&&(t=Et())===s&&(t=kt()),ft--,t===s&&(0===ft&&mt(S)),t}function wt(){var t,n,o,u,a,c,i,l,f,g,d,x;return ft++,t=at,Pt(),e.substr(at,7)===p?(n=p,at+=7):(n=s,0===ft&&mt(R)),n!==s?(Pt(),(o=Rt())!==s?(St(),(u=Rt())!==s?(St(),(a=Rt())!==s?(St(),(c=Rt())!==s?(St(),(i=Rt())!==s?(St(),(l=Rt())!==s?(St(),(f=Rt())!==s?(St(),(g=Rt())!==s?(St(),(d=Rt())!==s?(Pt(),41===e.charCodeAt(at)?(x=h,at++):(x=s,0===ft&&mt(X)),x!==s?(Pt(),ct=t,t=W(o,u,a,c,i,l,f,g,d)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s),ft--,t===s&&(0===ft&&mt(P)),t}function Ft(){var t,n,o,u,a;return ft++,t=at,Pt(),e.substr(at,10)===g?(n=g,at+=10):(n=s,0===ft&&mt(j)),n!==s?(Pt(),(o=Rt())!==s?(St(),(u=Rt())===s&&(u=null),Pt(),41===e.charCodeAt(at)?(a=h,at++):(a=s,0===ft&&mt(X)),a!==s?(Pt(),ct=t,t=Z(o,u)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s),ft--,t===s&&(0===ft&&mt(Y)),t}function bt(){var t,n,o,u,a;return ft++,t=at,Pt(),e.substr(at,6)===d?(n=d,at+=6):(n=s,0===ft&&mt(M)),n!==s?(Pt(),(o=Rt())!==s?(St(),(u=Rt())===s&&(u=null),Pt(),41===e.charCodeAt(at)?(a=h,at++):(a=s,0===ft&&mt(X)),a!==s?(Pt(),ct=t,t=tt(o,u)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s),ft--,t===s&&(0===ft&&mt(O)),t}function Ct(){var t,n,o,u,a;return ft++,t=at,Pt(),e.substr(at,7)===x?(n=x,at+=7):(n=s,0===ft&&mt(D)),n!==s?(Pt(),(o=Rt())!==s?((u=$t())===s&&(u=null),Pt(),41===e.charCodeAt(at)?(a=h,at++):(a=s,0===ft&&mt(X)),a!==s?(Pt(),ct=t,t=rt(o,u)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s),ft--,t===s&&(0===ft&&mt(_)),t}function $t(){var t,e,n;return ft++,t=at,St(),(e=Rt())!==s?(St(),(n=Rt())!==s?(ct=t,t=et(e,n)):(at=t,t=s)):(at=t,t=s),ft--,t===s&&(0===ft&&mt(I)),t}function Et(){var t,n,o,u;return ft++,t=at,Pt(),e.substr(at,6)===A?(n=A,at+=6):(n=s,0===ft&&mt(U)),n!==s?(Pt(),(o=Rt())!==s?(Pt(),41===e.charCodeAt(at)?(u=h,at++):(u=s,0===ft&&mt(X)),u!==s?(Pt(),ct=t,t=nt(o)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s),ft--,t===s&&(0===ft&&mt(L)),t}function kt(){var t,n,o,u;return ft++,t=at,Pt(),e.substr(at,6)===v?(n=v,at+=6):(n=s,0===ft&&mt(z)),n!==s?(Pt(),(o=Rt())!==s?(Pt(),41===e.charCodeAt(at)?(u=h,at++):(u=s,0===ft&&mt(X)),u!==s?(Pt(),ct=t,t=ot(o)):(at=t,t=s)):(at=t,t=s)):(at=t,t=s),ft--,t===s&&(0===ft&&mt(q)),t}function St(){var t,n;for(ft++,t=[],n=e.charAt(at),F.test(n)?at++:(n=s,0===ft&&mt(G));n!==s;)t.push(n),n=e.charAt(at),F.test(n)?at++:(n=s,0===ft&&mt(G));return ft--,n=s,0===ft&&mt(B),t}function Pt(){var t,n;for(ft++,t=[],n=e.charAt(at),b.test(n)?at++:(n=s,0===ft&&mt(J));n!==s;)t.push(n),n=e.charAt(at),b.test(n)?at++:(n=s,0===ft&&mt(J));return ft--,n=s,0===ft&&mt(H),t}function Rt(){var t,n,o,u,a,c,i,l;for(t=at,n=e.charAt(at),C.test(n)?at++:(n=s,0===ft&&mt(K)),n===s&&(n=null),o=at,u=[],a=e.charAt(at),$.test(a)?at++:(a=s,0===ft&&mt(N));a!==s;)u.push(a),a=e.charAt(at),$.test(a)?at++:(a=s,0===ft&&mt(N));if(46===e.charCodeAt(at)?(a=y,at++):(a=s,0===ft&&mt(Q)),a!==s){if(c=[],i=e.charAt(at),$.test(i)?at++:(i=s,0===ft&&mt(N)),i!==s)for(;i!==s;)c.push(i),i=e.charAt(at),$.test(i)?at++:(i=s,0===ft&&mt(N));else c=s;c!==s?o=u=[u,a,c]:(at=o,o=s)}else at=o,o=s;if(o===s)if(o=[],u=e.charAt(at),$.test(u)?at++:(u=s,0===ft&&mt(N)),u!==s)for(;u!==s;)o.push(u),u=e.charAt(at),$.test(u)?at++:(u=s,0===ft&&mt(N));else o=s;
947if(o!==s){if(u=at,101===e.charCodeAt(at)?(a=w,at++):(a=s,0===ft&&mt(T)),a!==s){if(c=e.charAt(at),C.test(c)?at++:(c=s,0===ft&&mt(K)),c===s&&(c=null),i=[],l=e.charAt(at),$.test(l)?at++:(l=s,0===ft&&mt(N)),l!==s)for(;l!==s;)i.push(l),l=e.charAt(at),$.test(l)?at++:(l=s,0===ft&&mt(N));else i=s;i!==s?u=a=[a,c,i]:(at=u,u=s)}else at=u,u=s;u===s&&(u=null),ct=t,t=ut()}else at=t,t=s;return t}if(o=f(),n.peg$library)return{peg$result:o,peg$currPos:at,peg$FAILED:s,peg$maxFailExpected:lt,peg$maxFailPos:it};if(o!==s&&at===e.length)return o;throw o!==s&&at<e.length&&mt({type:'end'}),u=lt,a=it<e.length?e.charAt(it):null,c=it<e.length?xt(it,it+1):xt(it,it),new t(t.buildMessage(u,a),u,a,c)}}},854,[]); 948__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.resolve=function(e,t){return e?s.default?[e,t]:e[Symbol.iterator]?Object.assign({},...e,t):Object.assign({},e,t):t};var e,t=r(d[0]),s=(e=t)&&e.__esModule?e:{default:e}},855,[26]); 949__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.resolveAssetUri=function(e){let t={};if('number'==typeof e){const n=(0,o.getAssetByID)(e);if(null==n)throw new Error(`Image: asset with ID "${e}" could not be found. Please check the image source or packager.`);if(t={width:n.width,height:n.height,scale:n.scales[0]},n.scales.length>1){const e=s.default.get();t.scale=n.scales.reduce((t,s)=>Math.abs(s-e)<Math.abs(t-e)?s:t)}const u=1!==t.scale?`@${t.scale}x`:'';t.uri=n?`${n.httpServerLocation}/${n.name}${u}.${n.type}`:''}else'string'==typeof e?t.uri=e:e&&!Array.isArray(e)&&'string'==typeof e.uri&&(t.uri=e.uri);if(t.uri){var u;const e=null===(u=t)||void 0===u||null===(u=u.uri)||void 0===u?void 0:u.match(n);if(e){const[,s,o]=e,n=encodeURIComponent(o);return t.uri=`${s}${n}`,t}}return t};var e,t=r(d[0]),s=(e=t)&&e.__esModule?e:{default:e},o=r(d[1]);const n=/^(data:image\/svg\+xml;utf8,)(.*)/},856,[169,167]); 950__d(function(_g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.convertInt32ColorToRGBA=function(t){const o=t>>16&255,n=t>>8&255,r=255&t,c=((t>>24&255)/255).toFixed(2);return`rgba(${o},${n},${r},${c})`}},857,[]); 951__d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return S}});var e,t=r(d[0]),s=(e=t)&&e.__esModule?e:{default:e};const o={top:20,left:20,right:20,bottom:30},{Mixin:n}=s.default,{touchableHandleStartShouldSetResponder:l,touchableHandleResponderTerminationRequest:p,touchableHandleResponderGrant:c,touchableHandleResponderMove:u,touchableHandleResponderRelease:h,touchableHandleResponderTerminate:i,touchableGetInitialState:b}=n,R={...n,touchableHandleStartShouldSetResponder(e){const{onStartShouldSetResponder:t}=this.props;return t?t(e):l.call(this,e)},touchableHandleResponderTerminationRequest(e){const{onResponderTerminationRequest:t}=this.props;return t?t(e):p.call(this,e)},touchableHandleResponderGrant(e){const{onResponderGrant:t}=this.props;return t?t(e):c.call(this,e)},touchableHandleResponderMove(e){const{onResponderMove:t}=this.props;return t?t(e):u.call(this,e)},touchableHandleResponderRelease(e){const{onResponderRelease:t}=this.props;return t?t(e):h.call(this,e)},touchableHandleResponderTerminate(e){const{onResponderTerminate:t}=this.props;return t?t(e):i.call(this,e)},touchableHandlePress(e){const{onPress:t}=this.props;t&&t(e)},touchableHandleActivePressIn(e){const{onPressIn:t}=this.props;t&&t(e)},touchableHandleActivePressOut(e){const{onPressOut:t}=this.props;t&&t(e)},touchableHandleLongPress(e){const{onLongPress:t}=this.props;t&&t(e)},touchableGetPressRectOffset(){const{pressRetentionOffset:e}=this.props;return e||o},touchableGetHitSlop(){const{hitSlop:e}=this.props;return e},touchableGetHighlightDelayMS(){const{delayPressIn:e}=this.props;return e||0},touchableGetLongPressDelayMS(){const{delayLongPress:e}=this.props;return 0===e?0:e||500},touchableGetPressOutDelayMS(){const{delayPressOut:e}=this.props;return e||0}},H=Object.keys(R),P=H.map(e=>R[e]),f=H.length;var S=e=>{for(let t=0;t<f;t++){const s=H[t],o=P[t];e[s]='function'==typeof o?o.bind(e):o}e.state=b()}},858,[386]); 952__d(function(g,r,i,a,m,e,d){"use strict";function o(o,n){throw Error(`[react-native-svg] You are trying to import a ${n} \`${o}\` that has been moved to a sub-package. Change your import from \`react-native-svg\` to \`react-native-svg/css\`.`)}
952Object.defineProperty(e,'__esModule',{value:!0}),e.showErrorCSS=o,e.SvgCss=function(){o('SvgCss','component')},e.SvgCssUri=function(){o('SvgCssUri','component')},e.SvgWithCss=function(){o('SvgWithCss','component')},e.SvgWithCssUri=function(){o('SvgWithCssUri','component')},e.inlineStyles=function(){o('inlineStyles','function')},e.LocalSvg=function(){o('LocalSvg','component')},e.WithLocalSvg=function(){o('WithLocalSvg','component')},e.loadLocalRawResource=function(){o('loadLocalRawResource','function')}},859,[]); 953__d(function(g,r,i,a,m,e,d){},860,[]); 954__d(function(g,r,i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.dockSizes=Y,_e.MainWorkspace=function(){const e=(0,f.useLayoutMode)(),s='desktop'===e,v='phone'===e,O=(0,d.usePathname)(),B=String((0,d.useGlobalSearchParams)().tab||''),K=(0,h.useProduct)(),{active:N,setActive:F}=(0,m.useActiveSymbol)(),{height:G,width:$}=(0,c.default)(),q=(0,u.useSafeAreaInsets)(),[J,Q]=(0,t.useState)(()=>L(O,B)),[X,Z]=(0,t.useState)(()=>_.ROUTE_TAB[O]?'full':O===_.CHART_PATH&&'evidence'===B?'half':'peek'),[ee,te]=(0,t.useState)(0),[ae,se]=(0,t.useState)(!1),[le,ne]=(0,t.useState)(!1),re=(0,t.useMemo)(()=>Y(G,q.top),[G,q.top]),ie=(0,t.useRef)(O),oe=(0,t.useRef)(O),ce=(0,t.useRef)(N),de=(0,t.useRef)(K.studyDraft),ue=(0,t.useRef)(null);ie.current=O,ce.current=N,de.current=K.studyDraft;const he=(0,t.useCallback)((e,t={})=>{Q(s=>s.tab!==e||null!=t.full&&t.full!==s.full?{tab:e,full:t.full??s.full}:s),t.snap&&Z(t.snap);const s=_.TAB_ROUTE[e];if(s===ie.current)return;oe.current=s,ie.current=s;const l=s===_.CHART_PATH?Object.fromEntries(Object.entries((0,m.serializeActiveParams)(ce.current)).filter(([,e])=>!!e)):{};try{d.router.replace(Object.keys(l).length?{pathname:_.CHART_PATH,params:l}:s)}catch{}},[]);(0,t.useEffect)(()=>{if(O===oe.current)return;oe.current=O;const e=_.ROUTE_TAB[O];if(e)return Q({tab:e,full:!0}),Z('full'),void('simulate'===e&&te(e=>e+1));O===_.CHART_PATH&&(Q(e=>_.TAB_ROUTE[e.tab]===_.CHART_PATH?e.full?{...e,full:!1}:e:{tab:'discover',full:!1}),Z(e=>'full'===e?'half':e))},[O]);const fe=K.studyDraft?.origin,me=(0,t.useRef)(fe);(0,t.useEffect)(()=>{fe!==me.current&&(me.current=fe,fe&&te(e=>e+1))},[fe]);const be=(0,t.useCallback)(()=>he('evidence',{full:!1,snap:'half'}),[he]);(0,t.useEffect)(()=>{if(O===_.CHART_PATH&&'evidence'===B){be();try{d.router.setParams({tab:void 0})}catch{}}},[O,B]);const ve=(0,t.useCallback)(()=>he('discover',{full:!1,snap:'half'}),[he]),pe=(0,t.useCallback)(()=>he('watch',{full:!0,snap:'full'}),[he]),xe=K.workspace?.tab,ye=K.setWorkspace;(0,t.useEffect)(()=>{'history'===xe&&(ye(e=>({...e,tab:'setup'})),be())},[xe]);const Ce=(0,b.useDiscoverRows)(),ge=(0,b.useWorkspaceMatch)(Ce),Ee=Ce.rows[0]?.id||'',ke=fe?.matchId||'',je=K.workspace?.selected||'';(0,t.useEffect)(()=>{K.loading||N||je||ke||!Ee||ye(e=>({...e,selected:Ee}))},[K.loading,N,je,ke,Ee]);const Te=(0,t.useCallback)(()=>{const e=de.current?.origin;e?.symbol&&e?.timeframe&&F({symbol:e.symbol,timeframe:e.timeframe,matchId:e.matchId,source:'simulate'}),he('discover',{full:!1,snap:'peek'})},[he,F]),Ae=(0,t.useCallback)(e=>he(e),[he]),Se=(0,t.useCallback)(()=>Q(e=>({...e,full:!e.full})),[]),He=(0,t.useCallback)(()=>Z('peek'),[]),We=(0,t.useCallback)(()=>{Q(e=>e.full?{...e,full:!1}:e),Z(e=>'full'===e?'half':e)},[]),De=(0,t.useCallback)(()=>(0,S.jsx)(b.DiscoverPanel,{layout:"dock"}),[]),Pe=(0,t.useCallback)(()=>(0,S.jsx)(b.DiscoverPanel,{layout:"sheet",onSelect:He}),[He]),Re=(0,t.useCallback)(()=>(0,S.jsx)(b.EvidencePanel,{}),[]),Ie=(0,t.useCallback)(()=>(0,S.jsx)(y.SimulationDesk,{onBack:Te},ee),[ee,Te]),Me=(0,t.useCallback)(()=>(0,S.jsx)(z,{children:(0,S.jsx)(C.AutoTrade,{})}),[]),we=(0,t.useCallback)(()=>(0,S.jsx)(z,{children:(0,S.jsx)(C.Activity,{})}),[]),Oe=(0,t.useCallback)(()=>(0,S.jsx)(z,{children:(0,S.jsx)(E.WatchDesk,{})}),[]),Be=(0,t.useMemo)(()=>({discover:De,evidence:Re,simulate:Ie,autotrade:Me,activity:we,watch:Oe}),[De,Re,Ie,Me,we,Oe]),Ke=(0,t.useMemo)(()=>D.map(e=>({key:e,label:R[e],render:Be[e]})),[Be]),[Ne,Fe]=(0,t.useState)(()=>{const e=(0,x.readStore)('widgets',H).keys;return Array.isArray(e)?M.filter(t=>e.includes(t)):M});(0,t.useEffect)(()=>{(0,x.writeStore)('widgets',H,{keys:Ne})},[Ne]);const[Ge,Ye]=(0,t.useState)(!1),Le=(0,t.useRef)(Ge);Le.current=Ge;const Ve=(0,t.useCallback)(()=>Ye(e=>!e),[]),ze=(0,t.useCallback)(e=>Fe(t=>t.filter(t=>t!==e)),[]),Ue=(0,t.useCallback)(e=>{const t=t=>M.filter(s=>s===e||t.includes(s));if(Le.current)return Ye(!1),void Fe(t);Fe(s=>s.includes(e)?s.filter(t=>t!==e):t(s))},[]),$e=(0,t.useMemo)(()=>(0,p.watchWidget)({onOpenFull:pe,onDiscover:ve,onClose:()=>ze(p.WATCH_WIDGET_KEY)}),[pe,ve,ze]),qe=(0,t.useMemo)(()=>(0,p.evidenceSummaryWidget)({onOpenEvidence:be,onClose:()=>ze(p.EVIDENCE_WIDGET_KEY)}),[be,ze]),Je=(0,t.useMemo)(()=>[$e,qe].filter(e=>
954Ne.includes(e.key)),[$e,qe,Ne]),Qe=(0,t.useMemo)(()=>[(0,p.watchWidget)({onOpenFull:pe,onDiscover:ve}),(0,p.evidenceSummaryWidget)({onOpenEvidence:be})],[pe,ve,be]),Xe=(0,t.useMemo)(()=>[{key:p.WATCH_WIDGET_KEY,label:'Watch',icon:'eye',active:Ne.includes(p.WATCH_WIDGET_KEY),onPress:()=>Ue(p.WATCH_WIDGET_KEY)},{key:p.EVIDENCE_WIDGET_KEY,label:'Evidence',icon:'bar-chart-2',active:Ne.includes(p.EVIDENCE_WIDGET_KEY),onPress:()=>Ue(p.EVIDENCE_WIDGET_KEY)}],[Ne,Ue]),Ze=(0,t.useMemo)(()=>Ce.rows.map(e=>({symbol:e.symbol,timeframe:e.timeframe,matchId:e.id})),[Ce.rows]),et=(0,m.useActiveNavigation)(Ze,'nav'),tt='match'===ge.kind?ge.match:void 0,at=(0,t.useMemo)(()=>[{key:'prev',label:'Prev stock',icon:'chevron-up',disabled:!et.hasPrev,onPress:()=>{et.prev()}},{key:'next',label:'Next stock',icon:'chevron-down',disabled:!et.hasNext,onPress:()=>{et.next()}},{key:'evidence',label:'See evidence',icon:'bar-chart-2',disabled:!tt,active:'evidence'===J.tab,onPress:be}],[et.prev,et.next,et.hasPrev,et.hasNext,tt,J.tab,be]),st=(0,t.useCallback)(()=>se(!1),[]),lt=(0,t.useCallback)(()=>{se(!1),be()},[be]),nt=(0,t.useCallback)(()=>{se(!1),pe()},[pe]),rt=(0,t.useCallback)(()=>{se(!1),ve()},[ve]),it=(0,t.useRef)(new Set).current;it.add(J.tab);const ot=(0,t.useRef)(!1);'evidence'===J.tab&&(ot.current=!0);const ct={paddingTop:q.top+6},dt=K.loading?null:(0,S.jsx)(x.DataAgePill,{dataEnd:K.state?.source_latest,status:K.state?.data_status,cache:K.state,error:K.state?'':K.error,notDeployed:'not_deployed'===K.research?.status?K.research.message:null,compact:v||$<T.NAV_FULL_WIDTH,expanded:le,onPress:()=>ne(e=>!e)}),ut=(0,S.jsx)(l.default,{ref:ue,children:dt}),ht=(0,S.jsx)(x.DataStatusPopover,{open:le,onClose:()=>ne(!1),anchor:ue,status:K.state?.data_status,dataEnd:K.state?.source_latest,cache:K.state,error:K.state?'':K.error,notDeployed:'not_deployed'===K.research?.status?K.research.message:null,routeKey:O});if(v){const e=ot.current?[...P,'evidence']:P,t={...Be,discover:Pe},s=(0,S.jsx)(n.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{alignItems:'center'},children:(0,S.jsx)(l.default,{role:"tablist","aria-label":"Workspace panels",style:{flexDirection:'row'},children:e.map(e=>{const t=e===J.tab;return(0,S.jsx)(o.default,{role:"tab","aria-selected":t,accessibilityState:{selected:t},accessibilityLabel:I[e],onPress:()=>he(e,{snap:'peek'===X?'half':void 0}),style:{minHeight:44,paddingHorizontal:9,justifyContent:'center',borderBottomWidth:2,borderBottomColor:t?f.C.green:'transparent'},children:(0,S.jsx)(f.T,{numberOfLines:1,style:{fontSize:13,fontFamily:'InterSemi',color:t?f.C.ink:f.C.muted},children:I[e]})},e)})})});return(0,S.jsxs)(l.default,{style:{flex:1,minHeight:0,backgroundColor:f.C.bg},children:[(0,S.jsx)(x.TopBar,{style:ct,left:(0,S.jsx)(j.ShellMark,{compact:!0}),center:(0,S.jsx)(k.SymbolSearch,{compact:!0,onPicked:We}),right:(0,S.jsxs)(S.Fragment,{children:[ut,(0,S.jsx)(j.AccountButton,{connect:!0})]})}),ht,(0,S.jsx)(j.ResearchBanner,{}),(0,S.jsxs)(l.default,{style:{flex:1,minHeight:0},children:[(0,S.jsxs)(n.default,{style:{flex:1,minHeight:0},keyboardShouldPersistTaps:"handled",contentContainerStyle:{paddingBottom:W+q.bottom+16},children:[(0,S.jsx)(l.default,{style:{height:Math.max(280,Math.round(.45*G)),borderBottomWidth:1,borderColor:f.C.line},children:(0,S.jsx)(V,{phone:!0,onOpenEvidence:be})}),(0,S.jsx)(l.default,{style:{paddingTop:10},children:(0,S.jsx)(x.Sidebar,{widgets:Qe,railItems:[],layout:"cards",label:"Widgets"})})]}),(0,S.jsx)(x.BottomSheet,{snap:X,onSnapChange:Z,peekHeight:W,label:`${I[J.tab]} panel`,header:s,children:e.filter(e=>it.has(e)).map(e=>(0,S.jsx)(U,{visible:e===J.tab,open:'peek'!==X,label:I[e],render:t[e]},e))})]}),(0,S.jsx)(T.MainNav,{variant:"tabs"})]})}const ft=(0,S.jsx)(l.default,{style:{flex:1,minWidth:0,minHeight:0},children:(0,S.jsx)(V,{onOpenEvidence:be,minChartHeight:re.chartFloor})});return(0,S.jsxs)(l.default,{style:[{flex:1,minHeight:0,backgroundColor:f.C.bg},{height:G,maxHeight:G,overflow:'hidden'}],children:[(0,S.jsx)(x.TopBar,{style:ct,left:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(j.ShellMark,{compact:!s,markOnly:!s}),(0,S.jsx)(T.MainNav,{fullFrom:T.NAV_FULL_WIDTH_WORKSPACE,moreBelow:_.NAV_MORE_BELOW_WORKSPACE})]}),center:(0,S.jsx)(k.SymbolSearch,{onPicked:We}),right:(0,S.jsxs)(S.Fragment,{children:[ut,(0,S.jsx)(j.WatchToggle,{match:tt}),!s&&(0,S.jsx)(A.IconButton,{icon:"sidebar",label:"Open widgets: Watch and Evidence summary",tooltip:"Widgets",expanded:ae,haspopup:"dialog",onPress:()=>se(!0),size:17}),s&&(0,S.jsx)(j.ConnectButton,{}),(0,S.jsx)(j.AccountButton,{connect:!s})]})}),ht,(0,S.jsx)(j.ResearchBanner,{}),(0,S.jsxs)(l.default,{style:{flex:1,minHeight:0},children:[(0,S.jsxs)(l.default,{style:{flex:1,minHeight:0,flexDirection:'row',display:J.full?'none':'flex'},children:[(0,S.jsx)(x.ToolRail,{items:at,label:"Chart tools",orientation:"vertical",compact:!s,style:{borderRightWidth:1,borderColor:f.C.line}}),ft,s&&(0,S.jsx)(x.Sidebar,{widgets:Je,railItems:Xe,collapsed:Ge,onToggleCollapsed:Ve,persistKey:H,label:"Widgets",layout:"column"})]}),(0,S.jsx)(x.Dock,{tabs:Ke,active:J.tab,onChange:Ae,fullScreen:J.full,onToggleFullScreen:Se,persistKey:H,restoreActive:!1,label:"Workspace dock",height:w.includes(J.tab)?re.tall:re.base,minHeight:re.min,maxHeight:re.max})]}),!s&&(0,S.jsxs)(f.Sheet,{visible:ae,onClose:st,title:"Widgets",subtitle:"Your watch and the evidence summary for the active setup.",children:[(0,S.jsx)(p.WatchWidget,{framed:!0,onOpenFull:nt,onDiscover:rt}),(0,S.jsx)(p.EvidenceSummaryWidget,{framed:!0,onOpenEvidence:lt})]})]})};var t=r(_d[0]),s=e(t),l=e(r(_d[1])),n=e(r(_d[2])),o=e(r(_d[3]));r(_d[4]);var c=e(r(_d[5])),d=r(_d[6]),u=r(_d[7]),h=r(_d[8]),f=r(_d[9]),m=r(_d[10]),b=r(_d[11]),v=r(_d[12]),p=r(_d[13]),x=r(_d[14]),y=r(_d[15]),C=r(_d[16]),E=r(_d[17]),k=r(_d[18]),j=r(_d[19]),T=r(_d[20]),_=r(_d[21]),A=r(_d[22]),S=r(_d[23]);const H='main',W=64,D=['discover','evidence','simulate','autotrade','activity','watch'],P=['discover','watch','simulate','autotrade','activity'],R={discover:'Discover',evidence:'Evidence/Replay',simulate:'Simulate',autotrade:'Plans/AutoTrade',activity:'Activity',watch:'Watch'},I={...R,evidence:'Evidence',autotrade:'AutoTrade'},M=[p.WATCH_WIDGET_KEY,p.EVIDENCE_WIDGET_KEY],w=['simulate','autotrade','activity','watch','evidence'],O=57,B=98,K=650,N=190,F=.34,G=.6;function Y(e,t=0){const s=Math.max(0,e-O-t),l=x.DOCK_TAB_BAR+x.DOCK_HANDLE+2,n=s<K?v.CHART_MIN_HEIGHT_SHORT:v.CHART_MIN_HEIGHT,o=Math.max(l+60,Math.min(Math.round(.7*s),s-B-n)),c=Math.min(l+N,o),d=e=>Math.max(c,Math.min(o,Math.round(s*e)));return{min:c,max:o,base:d(F),tall:d(G),chartFloor:n}}function L(e,t=""){const s=_.ROUTE_TAB[e];return s?{tab:s,full:!0}:e===_.CHART_PATH&&'evidence'===t?{tab:'evidence',full:!1}:{tab:'evidence'===(0,x.readStore)('dock',H).active?'evidence':'discover',full:!1}}const V=s.default.memo(function({phone:e=!1,onOpenEvidence:t,minChartHeight:s}){return(0,S.jsx)(b.ChartCentre,{phone:e,compactLegend:e,onOpenEvidence:t,minChartHeight:s})});function z({children:e}){return(0,S.jsx)(E.DeskEmbedded.Provider,{value:!0,children:(0,S.jsx)(n.default,{keyboardShouldPersistTaps:"handled",style:{flex:1,minHeight:0},contentContainerStyle:{flexGrow:1},children:e})})}const U=s.default.memo(function({visible:e,open:t=!0,label:s,render:n}){return(0,S.jsx)(l.default,{role:"tabpanel","aria-label":s,"aria-hidden":!e,importantForAccessibility:e?'auto':'no-hide-descendants',style:{flex:1,minHeight:0,display:e?'flex':'none'},children:(0,S.jsx)(x.PanelVisible.Provider,{value:e&&t,children:n()})})})},861,[11,13,278,375,136,400,252,105,196,821,251,862,863,887,871,891,892,893,895,897,899,896,869,6]); 955__d(function(g,r,i,a,m,e,d){"use strict";
955Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ChartCentre",{enumerable:!0,get:function(){return t.ChartCentre}}),Object.defineProperty(e,"SetupSummary",{enumerable:!0,get:function(){return t.SetupSummary}}),Object.defineProperty(e,"matchKey",{enumerable:!0,get:function(){return t.matchKey}}),Object.defineProperty(e,"openSimulate",{enumerable:!0,get:function(){return t.openSimulate}}),Object.defineProperty(e,"DiscoverPanel",{enumerable:!0,get:function(){return n.DiscoverPanel}}),Object.defineProperty(e,"useDiscoverRows",{enumerable:!0,get:function(){return n.useDiscoverRows}}),Object.defineProperty(e,"useWorkspaceMatch",{enumerable:!0,get:function(){return n.useWorkspaceMatch}}),Object.defineProperty(e,"resolveSymbolMatch",{enumerable:!0,get:function(){return n.resolveSymbolMatch}}),Object.defineProperty(e,"historyFor",{enumerable:!0,get:function(){return n.historyFor}}),Object.defineProperty(e,"discoverSort",{enumerable:!0,get:function(){return n.discoverSort}}),Object.defineProperty(e,"verdictTone",{enumerable:!0,get:function(){return n.verdictTone}}),Object.defineProperty(e,"EvidencePanel",{enumerable:!0,get:function(){return o.EvidencePanel}});var t=r(d[0]),n=r(d[1]),o=r(d[2])},862,[863,870,885]); 956__d(function(g,r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CHART_MIN_HEIGHT",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"CHART_MIN_HEIGHT_SHORT",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"CHART_MIN_HEIGHT_PHONE",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"LEGEND_AUTO_COLLAPSE",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"ACTIONS_WIDE",{enumerable:!0,get:function(){return T}}),_e.matchKey=R,_e.openSimulate=L,_e.ChartCentre=function({phone:e=!1,onOpenEvidence:i,onPrepare:o,minChartHeight:l}){const h=(0,d.useProduct)(),u=(0,x.useDiscoverRows)(),m=(0,x.useWorkspaceMatch)(u),{width:p}=(0,s.default)(),f=!e&&p>=c.BREAKPOINTS.desktop,y=(0,t.useMemo)(()=>u.rows.map(e=>({symbol:e.symbol,timeframe:e.timeframe,matchId:e.id})),[u.rows]),C=(0,b.useActiveNavigation)(y,'nav'),[j,S]=(0,t.useState)(!1),w=e?H:l??k,$={phone:e,nav:C,age:m.age,stale:m.stale,onOpenEvidence:i,onPrepare:o,chartMin:w};return'loading'===m.kind?(0,v.jsx)(c.Loading,{}):'error'===m.kind?(0,v.jsx)(n.default,{style:{flex:1,padding:f?30:16},children:(0,v.jsx)(c.Empty,{title:"Research couldn\u2019t load",detail:m.error||h.error,action:(0,v.jsx)(c.Button,{label:"Retry",icon:"rotate-ccw",loading:j,onPress:async()=>{S(!0);try{m.retry?m.retry():await h.refresh()}finally{S(!1)}}})})}):'empty'===m.kind?(0,v.jsx)(n.default,{style:{flex:1,padding:f?30:16},children:(0,v.jsx)(c.Empty,{icon:"bar-chart-2",title:"Choose a setup from Discover",detail:"Select a Discover result, or pick a stock from search or Watch, to see its chart, legend and evidence."})}):'none'===m.kind&&m.active?.detectionId?(0,v.jsx)(n.default,{style:{padding:16},children:(0,v.jsx)(c.Empty,{title:"Selected detection unavailable",detail:`The exact selected occurrence for ${m.symbol} ${m.timeframe} is no longer in the current chart. Return to Discover to choose a current detection.`})}):'none'!==m.kind&&m.match?(0,v.jsx)(F,{match:m.match,snapshot:m.chartSnapshot,detectionId:m.active?.detectionId||m.match.detection_id,history:m.history,outside:m.outside,replaced:m.replaced,auto:m.auto,...$},R(m.match,m.history)):(0,v.jsx)(D,{symbol:m.symbol,timeframe:m.timeframe,replaced:m.replaced,outsideSetups:m.outsideSetups,...$},m.symbol+'|'+m.timeframe)},_e.SetupSummary=function({column:e=!1}){const t=(0,x.useDiscoverRows)(),n=(0,x.useWorkspaceMatch)(t);return'match'===n.kind&&n.match?(0,v.jsx)(o.default,{showsVerticalScrollIndicator:!1,style:e?{width:220,flexGrow:0,borderLeftWidth:1,borderColor:c.C.line}:{flex:1,minHeight:0},contentContainerStyle:e?{padding:12,gap:12}:{gap:18,padding:12},children:(0,v.jsx)(V,{match:n.match,history:n.history},R(n.match,n.history))}):null};var t=r(_d[0]),n=e(r(_d[1])),i=e(r(_d[2])),o=e(r(_d[3])),s=e(r(_d[4])),l=r(_d[5]),d=r(_d[6]),c=r(_d[7]),h=r(_d[8]),u=r(_d[9]),m=r(_d[10]),p=r(_d[11]),f=r(_d[12]),y=r(_d[13]),b=r(_d[14]),x=r
956(_d[15]),C=r(_d[16]),j=r(_d[17]),S=r(_d[18]),v=r(_d[19]);const k=220,w=190,H=180,$=360,T=880,P=6,z=5,_=6,I=32;function R(e,t){const n=(0,b.evidenceKey)({symbol:e.symbol,pattern:e.pattern,timeframe:e.timeframe,side:t?.side,rule:t?.run,dataEnd:e.candle_end})||`${e.id}|${e.candle_end}`;return e.detection_id?`${n}|${e.detection_id}`:n}function L(e,t,n){e.setWorkspace(e=>({...e,selected:t.id})),e.setStudyDraft({symbols:[t.symbol],patterns:[t.pattern],timeframes:[t.timeframe],side:n||'long',product:'short'===n?'MIS':'CNC',start:'',origin:{symbol:t.symbol,pattern:t.pattern,timeframe:t.timeframe,matchId:t.id}}),l.router.push('/simulate')}function O({text:e,amber:n,iconOnly:o=!1,label:s}){const[l,d]=(0,t.useState)(!1),h=(0,C.useTitle)(e),u=n?c.C.amber:c.C.muted;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(i.default,{ref:h,accessibilityRole:"button",accessibilityLabel:`${e}. Show the full note`,accessibilityState:{expanded:l},...(0,j.webOnly)({'aria-expanded':l}),onPress:()=>d(!0),style:{flexShrink:1,minWidth:o?36:0,maxWidth:o?36:300,minHeight:o?36:26,flexDirection:'row',alignItems:'center',justifyContent:'center',gap:5,borderRadius:7,paddingHorizontal:o?0:7,backgroundColor:o?'transparent':n?c.C.amberBg:c.C.paper,borderWidth:o?0:1,borderColor:c.C.line},children:[(0,v.jsx)(c.Icon,{name:n?'alert-circle':'clock',size:13,color:u}),!o&&(0,v.jsx)(c.T,{numberOfLines:1,style:{flexShrink:1,minWidth:0,fontSize:11,lineHeight:16,color:u},children:e})]}),(0,v.jsx)(C.Popover,{open:l,onClose:()=>d(!1),anchor:h,placement:"bottom-end",label:s,width:300,children:(0,v.jsx)(c.T,{style:{fontSize:12,lineHeight:18,color:u,paddingHorizontal:12,paddingVertical:6},children:e})})]})}function M({symbol:e,timeframe:t,line:i,label:o,auto:s,meta:l,metaAmber:d,nav:h,phone:u,actions:m,watch:p}){return(0,v.jsxs)(n.default,{style:[c.s.row,{minHeight:u?44:46,paddingLeft:u?10:12,paddingRight:u?2:8,paddingVertical:3,gap:u?6:8,borderBottomWidth:1,borderColor:c.C.line}],children:[(0,v.jsxs)(n.default,{accessibilityRole:"header",accessibilityLabel:o,...(0,j.webOnly)({'aria-level':2}),style:[c.s.row,{flex:1,minWidth:0,gap:u?6:8}],children:[(0,v.jsx)(c.T,{numberOfLines:1,style:{fontFamily:'ManropeBold',fontSize:u?16:18,lineHeight:24,flexShrink:0},children:e}),(0,v.jsx)(c.T,{style:{color:c.C.muted,fontSize:12,lineHeight:18,flexShrink:0},children:t}),(0,v.jsx)(c.T,{numberOfLines:1,style:{flex:1,minWidth:0,fontSize:12,lineHeight:18,color:c.C.muted},children:i})]}),!!s&&(0,v.jsx)(n.default,{accessible:!0,accessibilityLabel:s,style:{flexShrink:1,minWidth:0,maxWidth:u?120:240,minHeight:22,justifyContent:'center',borderRadius:7,borderWidth:1,borderColor:c.C.line,paddingHorizontal:6},children:(0,v.jsx)(c.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16,color:c.C.muted},children:s})}),!!l&&(0,v.jsx)(O,{text:l,amber:d,iconOnly:u,label:"Chart data note"}),m,u&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(C.IconButton,{icon:"chevron-left",label:"Previous stock",disabled:!h.hasPrev,color:c.C.ink,onPress:()=>{h.prev()}}),(0,v.jsx)(C.IconButton,{icon:"chevron-right",label:"Next stock",disabled:!h.hasNext,color:c.C.ink,onPress:()=>{h.next()}})]}),p]})}function W({phone:e,wide:o,symbol:s,blocked:l,onEvidence:d,onPrepare:h,onSimulate:u,onRetry:m}){const[p,f]=(0,t.useState)(!1),y=(0,t.useRef)(null),b=l?`Prepare trade unavailable: ${l}`:'',x=(0,C.useTitle)(b||void 0),S=e?40:34,k={minHeight:S,paddingVertical:5,paddingHorizontal:e?12:11,borderRadius:9},w=(e,t,n,o="link")=>(0,v.jsx)(i.default,{accessibilityRole:o,accessibilityLabel:t,onPress:n,style:{minHeight:S,paddingHorizontal:6,justifyContent:'center'},children:(0,v.jsx)(c.T,{numberOfLines:1,style:{fontSize:12,color:c.C.green},children:e})});return(0,v.jsxs)(n.default,{style:[c.s.row,{gap:e?4:6,flexShrink:0}],children:[!!d&&(o||e?(0,v.jsx)(c.Button,{label:"See evidence",kind:"soft",icon:"bar-chart-2",onPress:d,style:k}):(0,v.jsx)(C.IconButton,{icon:"bar-chart-2",label:"See evidence",color:c.C.green,onPress:d})),(0,v.jsx)(n.default,{ref:x,children:(0,v.jsx)(c.Button,{label:e?'Plan':'Prepare trade',icon:"zap",disabled:!!l,accessibilityLabel:l?`Prepare trade, unavailable: ${l}`:'Prepare trade',accessibilityHint:b||void 0,onPress:h,style:k})}),!!l&&(0,v.jsxs)(i.default,{ref:y,accessibilityRole:"button",accessibilityLabel:`Why is Prepare trade unavailable? ${l}`,accessibilityState:{expanded:p},...(0,j.webOnly)({'aria-expanded':p,title:b}),onPress:()=>f(!0),style:[c.s.row,{gap:3,minHeight:S,minWidth:34,paddingHorizontal:4}],children:[(0,v.jsx)(c.Icon,{name:"help-circle",size:14,color:c.C.amber}),(0,v.jsx)(c.T,{style:{fontSize:11,color:c.C.amber},children:"why?"})]}),!!m&&w('Retry','Retry exit evidence',m,'button'),!!u&&w(o?'Test in Simulate \u2192':'Simulate \u2192',`Test these rules in Simulate for ${s}`,u),(0,v.jsx)(C.Popover,{open:p,onClose:()=>f(!1),anchor:y,placement:e?'top-end':'bottom-end',label:"Why Prepare trade is unavailable",width:320,children:(0,v.jsxs)(n.default,{style:{paddingHorizontal:12,paddingVertical:6,gap:4},children:[(0,v.jsx)(c.T,{accessibilityRole:"alert",style:{fontSize:12,lineHeight:18,color:c.C.amber},children:b}),!!m&&w('Retry exit evidence','Retry exit evidence',()=>{f(!1),m()},'button')]})})]})}function E({children:e}){return(0,v.jsx)(n.default,{style:{borderTopWidth:1,borderColor:c.C.line,backgroundColor:c.C.paper},children:(0,v.jsx)(o.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{flexGrow:1,justifyContent:'flex-end',alignItems:'center',paddingHorizontal:6,paddingVertical:3},children:e})})}function N(e,n){const i=(0,d.useProduct)(),{setActive:o}=(0,b.useActiveSymbol)(),[s,l]=(0,t.useState)(null),[c,h]=(0,t.useState)(null),[u,m]=(0,t.useState)([]),f=(0,t.useCallback)(e=>l(e),[]),y=(0,t.useCallback)(e=>h(e),[]),x=(0,t.useMemo)(()=>(0,p.legendRowsFromChart)(s,e,{enabledPatterns:i.filters?.patterns,catalogue:i.state?.patterns,cursor:c,hidden:u}),[s,e,i.filters?.patterns,i.state?.patterns,c,u]),j=(0,p.chartKeyMatches)(s,e.symbol,e.timeframe),S=j?s.bars:[],v=(0,t.useCallback)(e=>m(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),[]),k=(0,t.useCallback)(t=>{if(t===(0,p.chartMatchKey)(e))return;const n=[...(0,p.chartKeyMatches)(s,e.symbol,e.timeframe)&&Array.isArray(s.matches)?s.matches:[],...i.matches].find(e=>(0,p.chartMatchKey)(e)===t);
956n&&o({symbol:n.symbol||e.symbol,timeframe:n.timeframe||e.timeframe,matchId:n.id,detectionId:n.detection_id,source:'nav'})},[s,i.matches,e.symbol,e.timeframe,e.id,e.detection_id,o]),w=n?'phone':'main',[H,T]=(0,t.useState)(()=>{const e=(0,C.readStore)('legend',w).collapsed;return'boolean'==typeof e?e:null}),[P,R]=(0,t.useState)({w:0,h:0}),[L,O]=(0,t.useState)({text:'',done:!1}),[M,W]=(0,t.useState)([]),[E,N]=(0,t.useState)(0),A=(0,t.useCallback)(e=>{const t=Math.round(e.nativeEvent.layout.height);N(e=>Math.abs(e-t)<2?e:t)},[]),B=(0,t.useCallback)(e=>{const t=e.nativeEvent.layout,n=Math.round(t.width),i=Math.round(t.height);R(e=>Math.abs(e.w-n)<2&&Math.abs(e.h-i)<2?e:{w:n,h:i})},[]),F=(0,t.useCallback)((e,t)=>O(n=>n.text===e&&n.done===t?n:{text:e,done:t}),[]),K=(0,t.useCallback)(e=>W(t=>t.length===e.length&&t.every((t,n)=>t.text===e[n].text&&t.tone===e[n].tone)?t:e),[]),D=(0,t.useCallback)(e=>{T(e),(0,C.writeStore)('legend',w,{collapsed:e})},[w]),V=(0,t.useCallback)(()=>D(!1),[D]),G=H??(!(P.h>0)||P.h<$),U=G?z+Math.max(E,I)+_:0;return{snapshot:s,onSnapshot:f,cursor:c,onCursor:y,hidden:u,rows:x,bars:S,keyOk:j,toggle:v,pick:k,collapsed:G,setCollapsed:D,expand:V,pane:P,onPane:B,status:L,onStatus:F,notes:M,onNotes:K,overlayH:E,onOverlay:A,topInset:U}}function A({L:e,symbol:s,timeframe:l,selectedKey:d,evidence:h,onOpenEvidence:u,note:m,extra:f}){const{w:y,h:b}=e.pane,x=e.collapsed,S=e.status.text||'Loading chart\u2026',k=(0,C.useTitle)(S),w=(0,C.useTitle)(x?'Expand legend':'Collapse legend'),[H,$]=(0,t.useState)(!1),T=(0,t.useRef)(null),P=e.notes.map(e=>e.text).join('|'),z=(0,t.useRef)(P);(0,t.useEffect)(()=>{z.current!==P&&(z.current=P,$(!1))},[P]);const _=y>0?Math.max(0,Math.min(y-12-12,Math.max(Math.round(.55*y),x?560:420))):void 0,I=(0,v.jsx)(c.Icon,{name:e.status.done?'check-circle':'edit-3',size:13,color:c.C.green}),R=(0,v.jsxs)(i.default,{ref:w,accessibilityRole:"button",accessibilityLabel:x?'Expand legend':'Collapse legend',accessibilityState:{expanded:!x},...(0,j.webOnly)({'aria-expanded':!x}),onPress:()=>e.setCollapsed(!x),style:[c.s.row,{gap:3,minHeight:30,minWidth:30,paddingHorizontal:6,justifyContent:'center',flexShrink:0}],children:[!x&&(0,v.jsx)(c.T,{style:{fontSize:11,color:c.C.green},children:"Collapse legend"}),(0,v.jsx)(c.Icon,{name:x?'chevron-down':'chevron-up',size:14,color:c.C.green})]}),L=(0,v.jsx)(p.ChartLegend,{bars:e.bars,cursor:e.cursor,symbol:s,timeframe:l,dataEnd:e.keyOk?e.snapshot.last_candle:void 0,rows:e.rows,selectedKey:d,evidence:h,onToggleVisible:e.toggle,onSelect:x?e.expand:e.pick,onOpenEvidence:u,compact:x}),O=e.notes.length,M=e.notes.some(e=>'amber'===e.tone),W=`${O} note${1===O?'':'s'} about this chart`,E=(0,C.useTitle)(O?W:void 0),N=O?(0,v.jsxs)(i.default,{ref:e=>{T.current=e,E.current=e},accessibilityRole:"button",accessibilityLabel:`${W}. ${H?'Hide them':'Read them'}`,accessibilityState:{expanded:H},...(0,j.webOnly)({'aria-expanded':H,'aria-haspopup':'dialog'}),onPress:()=>$(e=>!e),style:e=>[c.s.row,{gap:4,minHeight:30,minWidth:30,paddingHorizontal:6,flexShrink:0,justifyContent:'center',borderRadius:7,backgroundColor:e.hovered||e.focused||e.pressed?c.C.soft:'transparent'}],children:[(0,v.jsx)(c.Icon,{name:"info",size:13,color:M?c.C.amber:c.C.muted}),(0,v.jsxs)(c.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16,color:M?c.C.amber:c.C.muted},children:[O," note",1===O?'':'s']})]}):null,A=O?(0,v.jsx)(C.Popover,{open:H,onClose:()=>$(!1),anchor:T,placement:"bottom-start",label:`${W}: ${s} ${l}`,width:340,children:(0,v.jsx)(o.default,{contentContainerStyle:{paddingHorizontal:12,paddingVertical:6,gap:8},children:e.notes.map((e,t)=>(0,v.jsx)(c.T,{accessibilityRole:"text",style:{fontSize:12,lineHeight:18,color:'amber'===e.tone?c.C.amber:c.C.ink},children:e.text},t))})}):null;return(0,v.jsx)(n.default,{role:"group",accessibilityLabel:`Chart legend for ${s} ${l}, ${x?'collapsed':'expanded'}`,onLayout:e.onOverlay,style:{position:'absolute',top:12,left:12,zIndex:5,maxWidth:_,backgroundColor:c.C.bg+'D6',borderWidth:1,borderColor:c.C.line,borderRadius:8},children:x?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(n.default,{style:[c.s.row,{gap:0,paddingLeft:6}],children:[(0,v.jsx)(n.default,{ref:k,accessible:!0,role:"img",accessibilityLabel:S,style:{flexShrink:0},children:I}),(0,v.jsx)(n.default,{style:{flexShrink:1,minWidth:0},children:L}),N,R]}),f,A]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(n.default,{style:[c.s.between,{gap:6,paddingLeft:8,borderBottomWidth:1,borderColor:c.C.line}],children:[(0,v.jsxs)(n.default,{style:[c.s.row,{gap:5,flexShrink:1,minWidth:0}],children:[I,(0,v.jsx)(c.T,{numberOfLines:1,accessibilityLiveRegion:"polite",style:{fontSize:11,lineHeight:16,color:c.C.green,flexShrink:1,minWidth:0},children:S})]}),(0,v.jsxs)(n.default,{style:[c.s.row,{gap:0,flexShrink:0}],children:[N,R]})]}),(0,v.jsxs)(o.default,{style:{maxHeight:b>0?Math.max(80,Math.round(.6*b)-32):240},contentContainerStyle:{paddingBottom:2},children:[!!m&&(0,v.jsx)(c.T,{accessibilityRole:"text",style:{fontSize:11,lineHeight:16,color:c.C.muted,paddingHorizontal:8,paddingTop:5},children:m}),f,L]}),A]})})}function B({L:e,phone:t,children:i,overlay:o}){return(0,v.jsxs)(n.default,{style:{flex:1,minHeight:0,paddingHorizontal:P,paddingTop:P,paddingBottom:t?2:4,overflow:'hidden'},onLayout:e.onPane,children:[i,o]})}function F({match:e,detectionId:i,snapshot:o,history:s,outside:l,replaced:y,auto:b,phone:x,nav:j,age:k,stale:w,onOpenEvidence:H,onPrepare:$,chartMin:P}){const z=(0,d.useProduct)(),_=(0,m.useExitPlan)(e,s?.side||'long'),I=N(e,x),R=(0,S.useStudiesOff)(),[O,F]=(0,t.useState)(!1),K=!!z.product.wat
956chlist?.some(t=>t.id===e.id),D=(0,m.prepareBlock)({stale:w,age:k,match:e,history:s,exit:_}),V=(0,p.evidenceFromWorkspace)({match:e,history:s,exit:_,chartData:I.snapshot,legendKey:{symbol:e.symbol,timeframe:e.timeframe,selectedKey:(0,p.chartMatchKey)(e)},age:k,stale:w});const G=(0,v.jsx)(W,{phone:x,wide:I.pane.w>=T,symbol:e.symbol,blocked:D?String(D):'',onEvidence:H,onPrepare:()=>{z.setPlan({match:e,side:s?.side}),$?.()},onSimulate:R?void 0:()=>L(z,e,s?.side),onRetry:D&&_.error&&!w?_.retry:void 0});return(0,v.jsxs)(n.default,{style:{flex:1,minHeight:0},children:[(0,v.jsx)(M,{symbol:e.symbol,timeframe:e.timeframe,phone:x,nav:j,metaAmber:w,label:`Chart header for ${e.symbol}, ${e.timeframe}, ${e.company}, ${e.pattern_name}`,auto:b?`Auto-selected: top setup for ${e.symbol}`:void 0,line:`${e.company} \xb7 ${e.pattern_name}${x?'':` \xb7 ${(0,h.money)(e.price)} \xb7 ${(0,h.dateText)(e.candle_end)}`}`,meta:`${(0,f.dataAgeText)(k)}${w?' \xb7 fresh prices needed':''}${l?' \xb7 outside your current filters':''}${y?' \xb7 the requested setup is no longer listed':''}`,actions:x?void 0:G,watch:x?(0,v.jsx)(C.IconButton,{icon:"eye",label:K?'Watching':'Watch',pressed:K,disabled:O,color:K?c.C.green:c.C.ink,onPress:async function(){F(!0);try{await(0,h.api)('/api/product/watch',{action:K?'remove':'add',match_id:e.id}),await z.refreshProduct()}catch(e){z.setToast(e.message)}finally{F(!1)}}}):void 0}),(0,v.jsx)(B,{L:I,phone:x,overlay:(0,v.jsx)(A,{L:I,symbol:e.symbol,timeframe:e.timeframe,selectedKey:(0,p.chartMatchKey)(e),evidence:V,onOpenEvidence:H}),children:(0,v.jsx)(u.PatternCanvas,{match:e,detectionId:i,snapshot:o,side:s?.side,exitPlan:_.data,compact:!0,fill:!0,chartHeight:P,onSnapshot:I.onSnapshot,onCursor:I.onCursor,onStatus:I.onStatus,onNotes:I.onNotes,topInset:I.topInset,hideHeader:!0,hiddenPatterns:I.hidden})}),x&&(0,v.jsx)(E,{children:G})]})}const K=()=>{};function D({symbol:e,timeframe:o,replaced:s,outsideSetups:l=[],phone:h,nav:m,age:p,stale:y,chartMin:x}){const C=(0,d.useProduct)(),{active:j,setActive:S}=(0,b.useActiveSymbol)(),k=l.length>0,w=(0,t.useMemo)(()=>({id:`${e}:${o}
956:`,symbol:e,company:'',price:NaN,pattern:'',pattern_name:'price',timeframe:o,direction:'neutral',state:'',current:!1,candle_end:'',score:0,sector:'',universes:[],history:[],start_index:NaN}),[e,o]),H=N(w,h),$=k?'No setup within your filters is selected.':'No stored setup for this stock and timeframe.',P=k?`No setup for ${e} on ${o} within your filters. Stored candles only: no pattern evidence, exit rule or trade preparation until you pick one. ${l.length} stored ${1===l.length?'setup is':'setups are'} outside your filters:`:`No stored setup for ${e} on ${o}. Stored candles only: no pattern evidence, exit rule or trade preparation. Change the timeframe or pick a Discover result.`,z=k?(0,v.jsx)(n.default,{accessibilityLabel:`Stored setups for ${e} ${o} outside your filters`,style:{paddingHorizontal:8,paddingTop:3,paddingBottom:5,gap:3},children:l.slice(0,4).map(e=>(0,v.jsx)(i.default,{accessibilityRole:"button",accessibilityLabel:`Select ${e.pattern_name} ${e.timeframe} for ${e.symbol}, outside your filters`,onPress:()=>S({symbol:e.symbol,timeframe:e.timeframe,matchId:e.id,source:j?.source||'nav'}),style:e=>({minHeight:28,justifyContent:'center',paddingHorizontal:7,borderRadius:6,borderWidth:1,borderColor:c.C.line,backgroundColor:e.hovered||e.pressed?c.C.soft:'transparent'}),children:(0,v.jsxs)(c.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16},children:[e.pattern_name," \xb7 ",(0,v.jsx)(c.T,{style:{fontSize:11,color:c.C.muted},children:(0,f.decision)(e,C.filters).title})," \xb7 ",(0,v.jsx)(c.T,{style:{fontSize:11,color:c.C.amber},children:"outside your filters"})]})},e.id))}):void 0,_=(0,v.jsx)(W,{phone:h,wide:H.pane.w>=T,symbol:e,blocked:$,onPrepare:K});return(0,v.jsxs)(n.default,{style:{flex:1,minHeight:0},children:[(0,v.jsx)(M,{symbol:e,timeframe:o,phone:h,nav:m,metaAmber:y,label:`Chart header for ${e}, ${o}, ${k?'no setup within your filters':'no stored setup'}`,line:k?`No setup for ${e} within your filters`:`No stored setup for ${e} on ${o}`,meta:`${(0,f.dataAgeText)(p)}${y?' \xb7 fresh prices needed':''}${s?' \xb7 the requested setup is no longer listed':''}`,actions:h?void 0:_}),(0,v.jsx)(B,{L:H,phone:h,overlay:(0,v.jsx)(A,{L:H,symbol:e,timeframe:o,evidence:null,note:P,extra:z}),children:(0,v.jsx)(u.PatternCanvas,{match:w,compact:!0,fill:!0,chartHeight:x,onSnapshot:H.onSnapshot,onCursor:H.onCursor,onStatus:H.onStatus,onNotes:H.onNotes,topInset:H.topInset,hideHeader:!0})}),h&&(0,v.jsx)(E,{children:_})]})}function V({match:e,history:t}){const i=(0,m.useExitPlan)(e,t?.side||'long'),o=t?.reference;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(c.T,{accessibilityRole:"header",style:{fontSize:11,lineHeight:16,fontFamily:'InterMedium',color:c.C.amber},children:i.data?.history_label||i.history_label}),(0,v.jsx)(n.default,{style:[c.s.row,{flexWrap:'wrap',gap:18}],children:[['Hold-period avg. net / trade',(0,h.pct)(o?.display_return_pct)],['95% range \xb7 this result alone',o?.expectancy_ci95?`${(0,h.pct)(o.expectancy_ci95[0])} to ${(0,h.pct)(o.expectancy_ci95[1])}`:'\u2014'],['Profitable trades',null==o?.win_rate?'\u2014':`${Math.round(o.win_rate*o.n/100)} of ${o.n}`],['Fixed hold',o?.holding?.duration||'Unavailable']].map(([e,t])=>(0,v.jsxs)(n.default,{style:{flex:1,minWidth:130,gap:5},children:[(0,v.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:e}),(0,v.jsx)(c.T,{style:{fontFamily:'InterSemi',fontSize:18},children:t})]},e))}),(0,v.jsxs)(c.T,{style:{fontSize:12,color:c.C.muted},children:[o?.n||0," historical trades \xb7 ",(0,f.sampleSize)(o?.n).label," \xb7 ",'short'===t?.side?y.SHORT_STUDY_LINE:'After assumed costs'," \xb7 fixed holding-period exit, not the exit rule below. Picked from many stock \xd7 pattern results: top averages are partly luck and usually shrink, and the range does not correct for that."]}),!!t&&(0,v.jsx)(c.T,{style:{fontSize:11,lineHeight:16,color:c.C.muted},children:(0,y.backtestRunLine)(t)}),(0,v.jsx)(n.default,{style:{height:1,backgroundColor:c.C.line}}),(0,v.jsx)(c.T,{style:{fontSize:14,fontFamily:'InterSemi'},children:'setup'===e.state?'Waiting for breakout':'Breakout recorded'}),(0,v.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:e.current?'Review the historical evidence before preparing a trade.':'Fresh prices are needed before this stored setup can become a current trade.'}),i.data&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(c.T,{style:{fontSize:14,fontFamily:'InterSemi'},children:"Exit rule"}),(0,v.jsxs)(c.T,{style:{fontSize:13,color:!0===i.data.tradable_evidence?c.C.ink:c.C.amber},children:[!0===i.data.tradable_evidence?'Tested on later data \xb7 this exact rule':'Illustrative \xb7 no tested evidence for this exact rule'," \xb7 1:",i.data.reward]}),(0,v.jsxs)(c.T,{style:{fontSize:12,color:c.C.muted},children:[i.data.holding?.duration," maximum hold. ",!0===i.data.tradable_evidence?'':'The history above does not describe this stop, target and hold.']})]})]})}},863,[11,13,375,278,400,252,196,821,197,864,838,868,248,250,251,870,871,869,884,6]); 957__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";
957function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TracedLine",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"PatternCanvas",{enumerable:!0,get:function(){return P}});var t=_r(_d[0]),n=e(t),r=e(_r(_d[1])),s=e(_r(_d[2])),o=e(_r(_d[3])),a=e(_r(_d[4])),i=e(_r(_d[5])),l=e(_r(_d[6]));_r(_d[7]);var c=_r(_d[8]),d=e(c),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),x=_r(_d[12]),m=_r(_d[13]),f=_r(_d[14]);const g=a.default.createAnimatedComponent(c.Path),y=a.default.createAnimatedComponent(c.G),b=e=>e.map((e,t)=>`${t?'L':'M'}${e.x.toFixed(2)},${e.y.toFixed(2)}`).join(' '),j=3300,C=l.default.inOut(l.default.ease),v=e=>{if(e<=0)return 0;if(e>=1)return 1;let t=0,n=1;for(let r=0;r<32;r++){const r=(t+n)/2;C(r)<e?t=r:n=r}return(t+n)/2},w=(e,t)=>{const n=v(e),r=v(t),s=Math.max(r-n,1e-6);return{from:e,to:t,t0:n,t1:r,value:new a.default.Value(e),easing:r=>(C(n+r*s)-e)/(t-e||1)}},S=(0,t.memo)(function({points:e,progress:n,start:r,end:s,color:o,pen:a=!0}){const i=(0,t.useMemo)(()=>{if(e.length<2)return null;let t=0;const o=e.map((n,r)=>(r&&(t+=Math.hypot(n.x-e[r-1].x,n.y-e[r-1].y)),t)),i=t||1,l=o.map(e=>r+(s-r)*e/i),c=n.interpolate({inputRange:[r,s],outputRange:[i,0],extrapolate:'clamp'});if(!a)return{d:b(e),length:i,offset:c};const d=n.interpolate({inputRange:[r,r+.001,s,s+.001],outputRange:[0,1,1,0],extrapolate:'clamp'}),u=Math.ceil(e.length/24),h=e.map((e,t)=>t).filter(t=>t%u===0||t===e.length-1),p=n.interpolate({inputRange:h.map(e=>l[e]),outputRange:h.map(t=>`translate(${e[t].x.toFixed(2)},${e[t].y.toFixed(2)})`),extrapolate:'clamp'});return{d:b(e),length:i,offset:c,visible:d,tip:p}},[e,n,r,s,a]);return i?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(g,{d:i.d,stroke:o,strokeWidth:1.65,strokeDasharray:`${i.length} ${i.length}`,strokeDashoffset:i.offset,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),a&&(0,f.jsxs)(y,{opacity:i.visible,transform:i.tip,children:[(0,f.jsx)(c.Circle,{r:5,fill:o,opacity:.2}),(0,f.jsx)(c.Circle,{r:2,fill:h.C.ink}),(0,f.jsx)(c.Line,{x1:1,x2:8,y1:-1,y2:-8,stroke:h.C.ink,strokeWidth:2.4,strokeLinecap:"round"})]})]}):null});function k(){let e=null;const t=new Set;return{get:()=>e,set:n=>{n!==e&&(e=n,t.forEach(e=>e()))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}}const M=e=>(0,t.useSyncExternalStore)(e.subscribe,e.get,e.get),R='undefined'!=typeof document?t.useLayoutEffect:t.useEffect,L=(0,t.memo)(function({store:e,chart:t}){const n=M(e),{x:r,y:s,all:o,top:a,H:i,bottom:l}=t;return null!=n&&o[n]?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(c.Line,{x1:r(n),x2:r(n),y1:a,y2:i-l,stroke:h.C.muted,strokeDasharray:"2 3"}),(0,f.jsx)(c.Circle,{cx:r(n),cy:s(o[n].close),r:3,fill:"white"})]}):null}),H=(0,t.memo)(function({store:e,chart:t,compact:n,hideText:s,window:o,setCursor:a}){const i=M(e),{all:l,start:c,last:d}=t,p=(null==i?d:l[i])||d;return(0,f.jsxs)(r.default,{style:{gap:5},children:[!s&&(0,f.jsxs)(h.T,{accessibilityLiveRegion:"polite",style:{fontSize:12,color:h.C.ink},children:[(0,u.dateText)(p.time)," \xb7 ",p.time.slice(11,16)," IST \xb7 Close ",(0,u.money)(p.close)]}),!n&&(0,f.jsxs)(f.Fragment,{children:[!s&&(0,f.jsxs)(h.T,{style:{fontSize:11,color:h.C.muted},children:["Open ",(0,u.money)(p.open)," \xb7 High ",(0,u.money)(p.high)," \xb7 Low ",(0,u.money)(p.low)]}),(0,f.jsxs)(r.default,{style:[h.s.row,{flexWrap:'wrap',gap:4}],children:[(0,f.jsx)(h.Button,{label:"Previous candle",kind:"ghost",icon:"chevron-left",disabled:(i??l.length-1)<=c,onPress:()=>a(Math.max(c,(i??l.length-1)-1))}),(0,f.jsx)(h.Button,{label:"Next candle",kind:"ghost",icon:"chevron-right",disabled:null==i||i>=l.length-1,onPress:()=>a(Math.min(l.length-1,(i??l.length-1)+1))})]}),(0,f.jsx)(h.T,{style:{fontSize:11,color:h.C.muted},children:'recent'===o?'Recent candles may crop the pattern. Choose Fit pattern to see its full structure.':'Tap a candle, or use Previous / Next to inspect its exact date and price.'})]})]})}),P=(0,t.memo)(function({match:e,side:l,onSnapshot:g,exitPlan:C,compact:M=!1,chartHeight:P,cursor:$,onCursor:T,onGeometry:E,hideHeader:z=!1,hiddenPatterns:W,fill:F=!1,onStatus:_,onNotes:D,controls:B=!0,detectionId:A,snapshot:N,topInset:O}){const G=n.default.useCallback(t=>{const n=t||[];if(A)return n.find(e=>e.detection_id===A)||null;return n.find(t=>
957t.id&&t.id===e.id)||((0,m.isResearchPattern)(e.pattern)?null:n.find(t=>t.pattern===e.pattern))||null},[A,e.id,e.pattern]),[I,X]=(0,t.useState)('pattern');(0,t.useEffect)(()=>X('pattern'),[e.id,e.candle_end,A]);const[V,U]=(0,t.useState)(null),[Z,q]=(0,t.useState)(''),[K,Y]=(0,t.useState)(0),[J,Q]=(0,t.useState)(600),[ee,te]=(0,t.useState)(!0),[ne,re]=(0,t.useState)(0),[se,oe]=(0,t.useState)('structure'),[ae,ie]=(0,t.useState)(!1),[le,ce]=(0,t.useState)(!0),de=(0,t.useMemo)(k,[]),ue=void 0!==$,he=(0,t.useRef)({controlled:ue,onCursor:T,onGeometry:E}),pe=(0,t.useRef)(null);he.current={controlled:ue,onCursor:T,onGeometry:E},R(()=>{if(ue){const e=$??null;pe.current=e,de.set(e)}},[ue,$,de]);const xe=(0,t.useCallback)(e=>{const t=null!=e&&Number.isFinite(e)?e:null;t!==(he.current.controlled?pe.current:de.get())&&(pe.current=t,he.current.controlled||de.set(t),he.current.onCursor?.(t))},[de]),me=(0,t.useId)().replace(/\W/g,'');(0,t.useEffect)(()=>{i.default.isReduceMotionEnabled().then(ie);const e=i.default.addEventListener('reduceMotionChanged',ie);return()=>e.remove()},[]),(0,t.useEffect)(()=>{let t=!0;return U(null),q(''),xe(null),N?(U(N),g?.(N),()=>{t=!1}):((0,u.api)(`/api/chart?symbol=${encodeURIComponent(e.symbol)}&timeframe=${e.timeframe}`).then(e=>{t&&(U(e),g?.(e))}).catch(e=>{t&&q(e.message)}),()=>{t=!1})},[e.id,e.candle_end,A,K,N]);const[fe,ge]=(0,t.useState)(0),ye=(0,t.useRef)(F);ye.current=F;const be=(0,t.useCallback)(e=>{const t=Math.round(e.nativeEvent.layout.width-2);if(Q(e=>Math.abs(e-t)<2?e:t),ye.current){const t=Math.round(e.nativeEvent.layout.height-2);ge(e=>Math.abs(e-t)<2?e:t)}},[]),je=F?fe:0,Ce=G(V?.matches),ve=Ce?.detection_id||Ce?.id,we=!!W?.length&&W.some(t=>!!ve&&t===ve||!Ce?.detection_id&&(t===e.id||t===`${e.symbol}:${e.timeframe}:${e.pattern}`)),Se=(0,t.useMemo)(()=>{const t=V?.bars||[];if(!t.length)return null;const n=G(V.matches),r=(0,m.candleRanges)(n),s='pattern'===I&&r.length?Math.max(0,Math.min(t.length-24,Math.min(...r.map(e=>e.first))-8)):(0,x.chartStart)(t.length,I,n?.start_index??e.start_index,(n?.lines||[]).flatMap(e=>(e.points||[]).map(e=>e.index))),o=t.slice(s),a=t[t.length-1],i=Math.max(280,J),c=F?Math.max(P||180,je):P||(i<450?320:365),d=c-27-57,u=(0,p.patternGeometry)(n,t),h=ee&&!!n&&!!C?.usable&&(!n.detection_id||C?.detection_id===n.detection_id),f=le&&u.apex?u.apex.index-t.length+3:0,g=f>0?(i-62-7)*f/(o.length+f):0,y=Math.max(h?Math.max(75,.27*(i-62-7)):5,g),b=i-62-7-y,j=b/o.length,v=e=>7+(e-s+.5)*j,w='short'===(l||('bearish'===e.direction?'short':'long')),S=w?-1:1,k=a.close,M=C?.stop??k,R=C?.target??k,L=o.flatMap(e=>[e.low,e.high]);L.push(...(0,m.visibleDrawingValues)(n,s,t.length-1)),h&&L.push(M,R),le&&u.apex&&L.push(u.apex.value);const H=Math.min(...L),$=Math.max(...L),T=$-H,E=.06*T||1,z=Math.max(0,Math.min((O||0)-27,.45*d)),W=d>0?z/d:0,_=W>0?Math.max(E,W*(T+E)/(1-W)):E,D=e=>27+($+_-e)/(T+_+E)*d,B=(0,m.drawingLines)(n),A=le&&u.swings.length>1,N=A?.42:.64,X=Math.max(...o.map(e=>e.volume||0),1),U=7+b+7,Z=i-62-5,q=[s,Math.floor((s+t.length-1)/2),t.length-1],K=[{x:v(t.length-1),y:D(k)},{x:U+.22*y,y:D(k+.22*(R-k))},{x:U+.4*y,y:D(k+.12*(R-k))},{x:Z,y:D(R)}],Y=[{x:v(t.length-1),y:D(k)},{x:U+.25*y,y:D(k+.28*(M-k))},{x:U+.45*y,y:D(k+.16*(M-k))},{x:Z,y:D(M)}];return{all:t,found:n,start:s,bars:o,last:a,W:i,H:c,L:7,R:62,top:27,bottom:57,plotH:d,geometry:u,showScenario:h,histW:b,step:j,x:v,y:D,short:w,sign:S,entry:k,stop:M,target:R,lo:H,hi:$,lines:B,swings:A,split:N,volume:X,futureX:U,futureEnd:Z,axisIndexes:q,trend:K,failure:Y}},[V,I,J,P,F,je,O,e.pattern,e.start_index,e.direction,l,C,ee,le,G]),ke=(0,t.useRef)(Se);ke.current=Se,(0,t.useEffect)(()=>{const t=ke.current;he.current.onGeometry?.(V&&t?{symbol:V.symbol||e.symbol,timeframe:V.timeframe||e.timeframe,pattern:e.pattern,dataEnd:V.last_candle??null,start:t.start,end:t.all.length-1,bars:t.all,found:t.found||null,geometry:t.geometry}:null)},[V,Se?.start,Se?.found,e.pattern]);const Me=(0,t.useCallback)((e,t)=>{const n=ke.current;if(!n||!Number.isFinite(e))return null;const r=e*(t>0?n.W/t:1),s=n.start+Math.floor((r-n.L)/n.step);return Number.isFinite(s)?Math.min(n.all.length-1,Math.max(n.start,s)):null},[]),Re=(0,t.useRef)(0),Le=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{Re.current&&cancelAnimationFrame(Re.current)},[]);const He=(0,t.useMemo)(()=>({onPointerMove:e=>{const t=e?.nativeEvent||e;'touch'!==t?.pointerType&&(Le.current={target:e.currentTarget,clientX:t.clientX},Re.current||(Re.current=requestAnimationFrame(()=>{Re.current=0;const e=Le.current,t=e?.target?.getBoundingClientRect?.();if(!e||!t||!Number.isFinite(e.clientX))return;const n=Me(e.clientX-t.left,t.width);null!=n&&xe(n)})))},onPointerLeave:e=>{const t=e?.nativeEvent||e;'touch'!==t?.pointerType&&(Re.current&&(cancelAnimationFrame(Re.current),Re.current=0),Le.current=null,xe(null))}}),[Me,xe]),Pe=(0,t.useMemo)(()=>
957{if(!Se)return null;const e=Math.max(1,Se.lines.length),t=Se.split,n=w(.63,.82),r=Se.showScenario?w(.81,1):null;return{lines:Se.lines.map((n,r)=>w(r/e*t,(r+1)/e*t+.002)),swings:Se.swings?w(.42,.642):null,levels:n,zones:r,paths:Se.showScenario?w(.82,1):null,reveal:n.value.interpolate({inputRange:[.63,.82],outputRange:[0,1],extrapolate:'clamp'}),zoneReveal:r?.value.interpolate({inputRange:[.81,1],outputRange:[0,1],extrapolate:'clamp'})}},[V,Se?.lines.length,Se?.split,Se?.swings,Se?.showScenario]);(0,t.useEffect)(()=>{if(!Pe)return;const e=[...Pe.lines,Pe.swings,Pe.levels,Pe.zones,Pe.paths].filter(Boolean),t=[],n='undefined'!=typeof document;let r=null;const s=()=>{t.forEach(clearTimeout),t.length=0,n&&(document.removeEventListener('pointerdown',o,!0),document.removeEventListener('keydown',o,!0))};function o(){s(),r?.stop(),e.forEach(e=>e.value.setValue(e.to)),oe('complete')}if(!ae)return e.forEach(e=>e.value.setValue(e.from)),oe('structure'),r=a.default.parallel(e.map(e=>a.default.timing(e.value,{toValue:e.to,duration:Math.max(1,(e.t1-e.t0)*j),delay:e.t0*j,easing:e.easing,useNativeDriver:!1}))),r.start(({finished:e})=>{e&&(s(),oe('complete'))}),t.push(setTimeout(()=>oe('levels'),v(.64)*j),setTimeout(()=>oe('scenarios'),v(.82)*j),setTimeout(()=>oe('complete'),v(.999)*j)),n&&(document.addEventListener('pointerdown',o,!0),document.addEventListener('keydown',o,!0)),()=>{s(),r?.stop()};o()},[Pe,ne,ae,ee,le,l]);const $e=(0,t.useMemo)(()=>{if(!Se)return null;const{W:t,H:n,L:r,R:s,top:o,bottom:a,plotH:i,lo:l,hi:d,x:u,y:p,all:x,start:m,last:g,histW:y,axisIndexes:b}=Se;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(c.Defs,{children:[(0,f.jsx)(c.ClipPath,{id:me+'plot',children:(0,f.jsx)(c.Rect,{x:0,y:o-14,width:t-s,height:i+28})}),(0,f.jsxs)(c.LinearGradient,{id:me+'profitWash',x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,f.jsx)(c.Stop,{offset:"0",stopColor:h.C.green,stopOpacity:.01}),(0,f.jsx)(c.Stop,{offset:"1",stopColor:h.C.green,stopOpacity:.17})]}),(0,f.jsxs)(c.LinearGradient,{id:me+'riskWash',x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,f.jsx)(c.Stop,{offset:"0",stopColor:h.C.red,stopOpacity:.01}),(0,f.jsx)(c.Stop,{offset:"1",stopColor:h.C.red,stopOpacity:.15})]})]}),[0,1,2,3,4].map(e=>{const n=l+(d-l)*e/4;return(0,f.jsxs)(c.G,{children:[(0,f.jsx)(c.Line,{x1:r,x2:t-s,y1:p(n),y2:p(n),stroke:h.C.line,strokeWidth:.6,strokeDasharray:"2 5"}),(0,f.jsx)(c.Text,{x:t-s+8,y:p(n)+4,fill:h.C.muted,fontSize:10,children:n.toLocaleString('en-IN',{maximumFractionDigits:n<100?1:0})})]},e)}),b.map((t,s)=>(0,f.jsxs)(c.G,{children:[(0,f.jsx)(c.Line,{x1:u(t),x2:u(t),y1:o,y2:n-a+24,stroke:h.C.line,strokeWidth:.7}),(0,f.jsx)(c.Text,{x:0===s?r+1:2===s?r+y:u(t),y:n-15,textAnchor:0===s?'start':2===s?'end':'middle',fill:h.C.muted,fontSize:11,children:new Date(x[t].time.slice(0,10)+'T12:00:00').toLocaleDateString('en-GB',{day:'numeric',month:'short',...'1W'===e.timeframe||x[m].time.slice(0,4)!==g.time.slice(0,4)?{year:'2-digit'}:{}})})]},t))]})},[Se,me,e.timeframe]),Te=(0,t.useMemo)(()=>{if(!Se)return null;const{x:e,y:t,bars:n,start:r,step:s,geometry:o,found:a}=Se,i=we?[]:(0,m.candleRanges)(a);return(0,f.jsxs)(f.Fragment,{children:[le&&!we&&o.envelope.length>0&&(0,f.jsx)(c.Path,{d:b(o.envelope.map(n=>({x:e(n.index),y:t(n.value)})))+' Z',fill:h.C.green,opacity:.055}),i.map((n,r)=>(0,f.jsx)(c.Rect,{x:e(n.first)-.48*s,y:t(n.high)-5,width:Math.max(.96*s,(n.last-n.first+.96)*s),height:Math.max(12,t(n.low)-t(n.high)+10),fill:h.C.amber,fillOpacity:.075,stroke:h.C.amber,strokeOpacity:.7,strokeWidth:1,strokeDasharray:"3 3"},'range'+r)),n.map((n,o)=>{const a=e(r+o),l=n.close>=n.open?h.C.candleUp:h.C.candleDn,d=i.some(e=>r+o>=e.first&&r+o<=e.last);return(0,f.jsxs)(c.G,{children:[(0,f.jsx)(c.Line,{x1:a,x2:a,y1:t(n.high),y2:t(n.low),stroke:l,strokeWidth:d?1.6:.8}),(0,f.jsx)(c.Rect,{x:a-s*(d?.34:.28),y:Math.min(t(n.open),t(n.close)),width:Math.max(.75,s*(d?.68:.56)),height:Math.max(1,Math.abs(t(n.close)-t(n.open))),fill:l,stroke:d?h.C.ink:'none',strokeWidth:d?.6:0})]},o)})]})},[Se,le,we]),Ee=(0,t.useMemo)(()=>{if(!Se||!Pe)return null;const{x:e,y:t,W:n,L:r,R:s,lines:o,geometry:a,found:i,showScenario:l,futureX:d,futureEnd:u,entry:p,stop:x,target:g,short:j,sign:v,trend:w,failure:k,split:M}=Se;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(c.G,{opacity:we?0:1,children:[o.map((n,r)=>(0,f.jsx)(S,{points:n.points.map(n=>({x:e(n.index),y:t(n.value)})),progress:Pe.lines[r].value,start:r/Math.max(1,o.length)*M,end:(r+1)/Math.max(1,o.length)*M,color:(0,m.isResearchPattern)(i?.pattern)?(0,m.drawingColor)(n):'curve'===n.role?h.C.curve:'boundary'===n.role?h.C.boundary:h.C.swing},r)),Pe.swings&&(0,f.jsx)(S,{points:a.swings.map(n=>({x:e(n.index),y:t(n.value)})),progress:Pe.swings.value,start:.42,end:.64,color:h.C.swing}
957),le&&(0,f.jsxs)(y,{opacity:Pe.reveal,children:[a.projection.map((n,r)=>(0,f.jsx)(c.Path,{d:b(n.map(n=>({x:e(n.index),y:t(n.value)}))),fill:"none",stroke:h.C.boundary,strokeOpacity:.55,strokeWidth:1,strokeDasharray:"3 4"},r)),a.apex&&(0,f.jsx)(c.Circle,{cx:e(a.apex.index),cy:t(a.apex.value),r:3,fill:h.C.bg,stroke:h.C.boundary}),((0,m.isResearchPattern)(i?.pattern)&&!(0,m.isOriginalChart)(i?.pattern)?(0,m.placedLabels)(a.shapeLabels.filter(e=>!/^HA/.test(i.pattern)||/^[OXABCD]$/.test(e.label)),e,t,r,n-s,Se.top,Se.H-Se.bottom):a.shapeLabels.map(n=>({label:n.label,x:e(n.point.index),y:t(n.point.value)-9}))).filter(e=>!e.hidden).map((e,t)=>(0,f.jsxs)(c.G,{children:[e.moved&&(0,f.jsx)(c.Line,{x1:e.x,y1:e.y+3,x2:e.anchorX,y2:e.anchorY,stroke:h.C.muted,strokeOpacity:.65,strokeWidth:.6}),(0,f.jsx)(c.Text,{x:e.x,y:e.y,textAnchor:"middle",fill:h.C.ink,fontSize:9,children:e.label.replace('Left shoulder','L shoulder').replace('Right shoulder','R shoulder')})]},e.label+t))]})]}),(0,f.jsxs)(y,{opacity:Pe.reveal,children:[!we&&(i?.lines||[]).filter(e=>'anchors'===e.role).flatMap(n=>n.points.map((r,s)=>(0,f.jsx)(c.Circle,{cx:e(r.index),cy:t(r.value),r:3.5,fill:h.C.green+'26',stroke:h.C.green,strokeWidth:.8},n.label+s))),(0,f.jsx)(c.Line,{x1:r,x2:n-s,y1:t(p),y2:t(p),stroke:h.C.mint,strokeDasharray:"3 4",strokeWidth:.8})]}),l&&Pe.paths&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(y,{opacity:Pe.zoneReveal,children:[(0,f.jsx)(c.Rect,{x:d,y:Math.min(t(p),t(g)),width:Math.max(10,u-d),height:Math.abs(t(g)-t(p)),fill:`url(#${me}profitWash)`}),(0,f.jsx)(c.Rect,{x:d,y:Math.min(t(p),t(x)),width:Math.max(10,u-d),height:Math.abs(t(x)-t(p)),fill:`url(#${me}riskWash)`}),(0,f.jsx)(c.Line,{x1:d,x2:u,y1:t(g),y2:t(g),stroke:h.C.green,strokeDasharray:"3 3",strokeWidth:.8}),(0,f.jsx)(c.Line,{x1:d,x2:u,y1:t(x),y2:t(x),stroke:h.C.red,strokeDasharray:"3 3",strokeWidth:.8}),(0,f.jsxs)(c.Text,{x:d+3,y:t(g)+(j?14:-7),fill:h.C.green,fontSize:10,children:[C?.target_pct.toFixed(1),"% target"]}),(0,f.jsxs)(c.Text,{x:d+3,y:t(x)+(j?-7:14),fill:h.C.red,fontSize:10,children:[C?.stop_pct.toFixed(1),"% stop"]})]}),(0,f.jsx)(S,{points:w,progress:Pe.paths.value,start:.82,end:1,color:h.C.green,pen:!1}),(0,f.jsx)(S,{points:k,progress:Pe.paths.value,start:.82,end:1,color:h.C.red,pen:!1}),(0,f.jsx)(y,{opacity:Pe.zoneReveal,children:(0,f.jsx)(c.Path,{d:`M${u-5},${t(g)+8*v}L${u},${t(g)}L${u-7},${t(g)+2*v}`,stroke:h.C.green,strokeWidth:1.4,fill:"none"})})]})]})},[Se,Pe,le,me,C,we]),ze=(0,t.useMemo)(()=>{if(!Se)return null;const{x:e,H:t,bottom:n,top:r,bars:s,start:o,step:a,volume:i,showScenario:l,futureX:d}=Se;return(0,f.jsxs)(f.Fragment,{children:[s.map((r,s)=>(0,f.jsx)(c.Rect,{x:e(o+s)-.3*a,y:t-n+23-r.volume/i*22,width:Math.max(.8,.6*a),height:r.volume/i*22,fill:r.close>=r.open?h.C.volUp:h.C.volDn,opacity:.9},s)),l&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(c.Line,{x1:d-4,x2:d-4,y1:r-7,y2:t-n+24,stroke:h.C.lineHover,strokeWidth:.8,strokeDasharray:"2 3"}),(0,f.jsx)(c.Text,{x:d+2,y:16,fill:h.C.muted,fontSize:9,children:C?.evidence_applies?'TESTED RULE':'BENCHMARK'}),(0,f.jsx)(c.Text,{x:d+1,y:t-15,fill:h.C.muted,fontSize:9,children:"Scenario only"})]})]})},[Se,C]),We=(0,t.useMemo)(()=>{if(!Se)return null;const{W:e,H:t}=Se;return(0,f.jsxs)(d.default,{pointerEvents:"none",width:"100%",height:t,viewBox:`0 0 ${e} ${t}`,children:[$e,(0,f.jsxs)(c.G,{clipPath:`url(#${me}plot)`,children:[Te,Ee,(0,f.jsx)(L,{store:de,chart:Se})]}),ze]})},[Se,$e,Te,Ee,ze,de,me]),Fe=Se?Se.found?(0,m.hasDrawing)(Se.found)?'structure'===se?'Agent tracing the pattern\u2026':'levels'===se?'Marking the decision levels\u2026':'scenarios'===se&&Se.showScenario?'Illustrating the conditional paths\u2026':Se.showScenario?'Structure drawn. Scenarios illustrated.':['CH19','CH20','CH21'].includes(Se.found.pattern)?'Structure guides drawn.':'Pattern outline shown.':'Pattern geometry unavailable':'Stored candles':'',De=!!Se&&'complete'===se;(0,t.useEffect)(()=>{_?.(Fe,De)},[Fe,De,_]);const Be=(0,t.useMemo)(()=>{if(!Se)return[];const{found:e,geometry:t}=Se,n=[];return e&&!(0,m.hasDrawing)(e)&&n.push({text:e.geometry_note||'This occurrence has no usable stored geometry. Candles are shown without a pattern outline.',tone
957:'amber',fontSize:11,lineHeight:16}),e&&(0,m.isResearchPattern)(e.pattern)&&(0,m.hasDrawing)(e)&&!we&&n.push({text:((0,m.candleRanges)(e).length?`Amber box: ${[...new Set((0,m.candleRanges)(e).map(e=>e.label))].join(' / ')} \xb7 `:'')+"Structure from stored detection points \xb7 amber: trigger \xb7 red: failure level",tone:'muted',fontSize:10,lineHeight:14,cap:!0}),t.apex&&!we&&le&&n.push({text:'Dashed extensions show the mathematical line intersection, not a price forecast.',tone:'muted',fontSize:10,lineHeight:14}),e&&!we&&(e.lines||[]).some(e=>'Projection target'===e.label)&&n.push({text:'Blue: measured-move projection (drawn from the pattern, not an observed outcome).',tone:'muted',fontSize:10,lineHeight:14}),e&&['CH19','CH20','CH21'].includes(e.pattern)&&n.push({text:'Straight guides connect stored rim and extreme points; no fitted curve was saved for this occurrence.',tone:'amber',fontSize:10,lineHeight:14}),e&&/^HA/.test(e.pattern)&&!we&&le&&n.push({text:`Blue levels: projected potential reversal zone (PRZ). Measured ratios: ${t.shapeLabels.filter(t=>!(/^[OXABCD]$/.test(t.label)||'HA10'===e.pattern&&/^AD\/XA /.test(t.label))).map(e=>e.label.replace(/_/g,' ')).join(' \xb7 ')}`,tone:'muted',fontSize:10,lineHeight:15}),n},[Se,we,le]);if((0,t.useEffect)(()=>{D?.(Be)},[Be,D]),Z)return(0,f.jsxs)(r.default,{style:{gap:10},children:[(0,f.jsx)(h.T,{style:{color:h.C.red},children:Z}),(0,f.jsx)(h.Button,{label:"Retry chart",onPress:()=>Y(K+1)})]});if(!V)return(0,f.jsx)(h.Loading,{});if(!Se)return(0,f.jsx)(h.T,{children:"No completed candles available."});const{all:Ae,found:Ne,start:Oe,bars:Ge,last:Ie,showScenario:Xe,short:Ve,stop:Ue,target:Ze}=Se,qe=`${e.symbol} ${e.pattern_name||e.pattern} chart, ${e.timeframe} candles, NSE, INR. ${Ne?we?'Pattern outline hidden from the legend. ':'':'Pattern outline not available; stored candles only. '}Showing ${Ge.length} candles from ${(0,u.dateText)(Ae[Oe].time)} to ${(0,u.dateText)(Ie.time)}. Last close ${(0,u.money)(Ie.close,2)}.${Xe?` Illustrated ${Ve?'short':'long'} scenario from the stored close: target ${(0,u.money)(Ze,2)} (${C.target_pct.toFixed(2)}%), stop ${(0,u.money)(Ue,2)} (${C.stop_pct.toFixed(2)}%), before costs. Scenario paths are not price forecasts.`:''}`,Ke={minHeight:34,paddingVertical:5,paddingHorizontal:10,borderRadius:9};return(0,f.jsxs)(r.default,{style:F?{flex:1,minHeight:0,gap:4}:{gap:10},children:[!M&&(0,f.jsxs)(r.default,{style:[h.s.between,{flexWrap:'wrap',gap:5}],children:[z?(0,f.jsx)(r.default,{}):(0,f.jsxs)(h.T,{style:{fontSize:11,color:h.C.muted},children:["Chart view \xb7 ",Ge.length," candles"]}),(0,f.jsx)(r.default,{role:"group",accessibilityLabel:"Chart window",style:[h.s.row,{gap:3}],children:[['pattern','Fit pattern'],['recent','Recent 40'],['all','All history']].map(([e,t])=>(0,f.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:t,accessibilityHint:"Changes which candles the chart shows",accessibilityState:{selected:I===e},onPress:()=>{X(e),xe(null)},style:{minHeight:44,paddingHorizontal:10,justifyContent:'center',borderRadius:8,backgroundColor:I===e?h.C.soft:'transparent'},children:(0,f.jsx)(h.T,{style:{fontSize:11,color:I===e?h.C.green:h.C.muted},children:t})},e))})]}),!_&&(0,f.jsxs)(r.default,{style:[h.s.between,{flexWrap:'wrap',gap:3}],children:[(0,f.jsxs)(r.default,{style:h.s.row,children:[(0,f.jsx)(h.Icon,{name:'complete'===se?'check-circle':'edit-3',size:14,color:h.C.green}),(0,f.jsx)(h.T,{style:{fontSize:11,color:h.C.green},children:Fe})]}),!z&&(0,f.jsxs)(h.T,{style:{fontSize:10,color:h.C.muted},children:[e.timeframe," \xb7 NSE / INR"]})]}),!D&&Be.map((e,t)=>(0,f.jsx)(h.T,{numberOfLines:e.cap&&M?2:void 0,style:{fontSize:e.fontSize,lineHeight:e.lineHeight,color:'amber'===e.tone?h.C.amber:h.C.muted},children:e.text},t)),(0,f.jsx)(r.default,{role:"group",accessibilityLabel:qe,style:[{backgroundColor:h.C.bg,borderWidth:1,borderColor:h.C.line,borderRadius:11,overflow:'hidden'},F&&{flex:1,minHeight:0}],onLayout:be,children:(0,f.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Inspect candle date and closing price",accessibilityHint:"Selects the candle under the pointer. Previous and Next candle buttons do the same from the keyboard.",onPress:e=>{const t=e.nativeEvent,n=e.currentTarget?.getBoundingClientRect?.(),r=Number.isFinite(t.locationX)?t.locationX:n&&Number.isFinite(t.clientX)?t.clientX-n.left:null;if(null==r)return;const s=Me(r,n?.width||J);null!=s&&xe(s)},...He,children:We})}),!(F&&M&&z)&&(0,f.jsx)(H,{store:de,chart:Se,compact:M,hideText:z,window:I,setCursor:xe}),M&&B&&(F?(0,f.jsxs)(o.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:{flexGrow:0,flexShrink:0},contentContainerStyle:{gap:4,alignItems:'center'},children:[(0,f.jsx)(h.Button,{label:"Replay drawing",kind:"ghost",icon:"edit-3",onPress:()=>re(ne+1),style:Ke}),(0,f.jsx)(h.Button,{label:ee?'Hide scenarios':'Show scenarios',kind:"ghost",onPress:()=>te(!ee),disabled:!Ne||!C?.usable,style:Ke}),(0,f.jsx)(h.Button,{label:le?'Hide inner swings':'Show full pattern',kind:"ghost",onPress:()=>ce(!le),style:Ke})]}):(0,f.jsxs)(r.default,{style:[h.s.row,{flexWrap:'wrap',gap:4}],children:[(0,f.jsx)(h.Button,{label:"Replay drawing",kind:"ghost",icon:"edit-3",onPress:()=>re(ne+1)}),(0,f.jsx)(h.Button,{label:ee?'Hide scenarios':'Show scenarios',kind:"ghost",onPress:()=>te(!ee),disabled:!Ne||!C?.usable}),(0,f.jsx)(h.Button,{label:le?'Hide inner swings':'Show full pattern',kind:"ghost",onPress:()=>ce(!le)})]})),!M&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(r.default,{style:h.s.row,children:[(0,f.jsx)(h.Button,{label:"Replay drawing",kind:"outline",icon:"edit-3",onPress:()=>re(ne+1),style:{flex:1}}),(0,f.jsx)(h.Button,{label:ee?'Hide scenarios':'Show scenarios',kind:"soft",icon:"git-branch",onPress:()=>te(!ee),disabled:!Ne||!C?.usable,style:{flex:1}})]}),(0,f.jsx)(h.Button,{label:le?'Hide inner swings':'Show full pattern',kind:"ghost",icon:"activity",onPress:()=>ce(!le)}
957),le&&(0,f.jsxs)(h.T,{style:{fontSize:10,color:h.C.muted},children:["Connected swings follow observed pivots. ",Se.geometry.apex?'Dotted edges extend the boundaries to a geometric apex; they are not future prices.':'The shape is an outline of observed price movement.']}),Xe&&(0,f.jsxs)(h.T,{style:{fontSize:10,lineHeight:17,color:h.C.muted},children:[C.label," \xb7 ",Ve?'Short':'Long'," from the stored close \xb7 ",C.stop_pct.toFixed(2),"% stop / ",C.target_pct.toFixed(2),"% target, before costs. ",C.stop_basis,". Paths illustrate the rule, not future prices or timing."]})]})]})})},864,[11,13,375,278,267,265,345,136,840,197,821,865,867,866,6]); 958__d(function(g,r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.patternGeometry=function(t,l){const a=t?.lines||[],u=a.filter(n=>'boundary'===n.role&&n.points.length>1),s=u.find(n=>/resistance/i.test(n.label)),o=u.find(n=>/support/i.test(n.label)),x=Math.max(t?.start_index||0,...u.map(n=>n.points[0].index)),p=(0,n.drawingEnd)(t,l.length),h=(0,n.visualPattern)(t?.pattern);let f=a.filter(n=>'anchors'===n.role).flatMap(n=>n.points.map(i=>({...i,kind:/lower/i.test(n.label)?'low':'high'})));const c=['symmetrical_triangle','descending_triangle','falling_wedge','rising_wedge','channel','flag_pole','horizontal_breakout'].includes(h);f=f.filter(n=>Number.isFinite(n.value)&&n.index>=x&&n.index<=p-3).sort((n,i)=>n.index-i.index);const v=[];for(const n of f){const i=v[v.length-1];i?.index!==n.index&&(i?.kind===n.kind?('high'===n.kind?n.value>i.value:n.value<i.value)&&(v[v.length-1]=n):v.push(n))}let b=[],_=[],N=null;if(s&&o){const n=Number.isFinite(t?.end_index),a=n?Math.min(p,s.points[s.points.length-1].index,o.points[o.points.length-1].index):p;b=a>=x?[{index:x,value:i(s,x)},{index:a,value:i(s,a)},{index:a,value:i(o,a)},{index:x,value:i(o,x)}]:[];const u=i(s,p)-i(o,p),f=i(s,p)-i(s,p-1)-(i(o,p)-i(o,p-1)),c=f<0?p-u/f:NaN;(!n||p===l.length-1)&&'channel'!==h&&'flag_pole'!==h&&Number.isFinite(c)&&c>p&&c-p<=Math.max(12,.7*(p-x+10))&&(N={index:c,value:i(s,c)},_=[[{index:p,value:i(s,p)},N],[{index:p,value:i(o,p)},N]])}const F=a.filter(n=>'label'===n.role).map(n=>({label:n.label,point:n.points[0]}));return{swings:c?v:[],envelope:b,projection:_,apex:N,shapeLabels:F}},e.lineValueAt=t,e.boundaryConfirmIndex=function(n){const i=(n?.lines||[]).flatMap(n=>(n?.points||[]).map(n=>n?.index)).filter(n=>Number.isFinite(n));Number.isFinite(n?.end_index)&&i.push(n.end_index);return i.length?Math.max(...i):null},e.boundaryValuesAt=function(n,i){const l=n?.lines||[],a=l.filter(n=>'boundary'===n?.role&&n.points?.length>1).map(n=>({label:String(n.label),value:t(n,i)})),u=l.find(n=>'Handle'===n?.label&&n.points?.length>=3);if(u){const n=u.points[1];a.push({label:'Handle low',value:Number.isFinite(n?.value)&&Number.isFinite(i)&&i>=n.index&&i<=u.points[u.points.length-1].index?n.value:null})}return a};var n=r(d[0]);const i=(n,i)=>{const[t,l]=[n.points[0],n.points[n.points.length-1]];return t.value+(l.value-t.value)*(i-t.index)/(l.index-t.index||1)};function t(n,i){const t=(n?.points||[]).filter(n=>Number.isFinite(n?.index)&&Number.isFinite(n?.value));if(!t.length||!Number.isFinite(i))return null;if(1===t.length)return t[0].index===i?t[0].value:null;if(i<t[0].index||i>t[t.length-1].index)return null;for(let n=1;n<t.length;n++){const l=t[n-1],a=t[n];if(i<=a.index)return a.index===l.index?a.value:l.value+(a.value-l.value)*(i-l.index)/(a.index-l.index)}return null}},865,[866]); 959__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"visualPattern",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"isResearchPattern",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"isOriginalChart",{enumerable:!0,get:function(){return o}}),e.drawingEnd=function(n,t){return Number.isFinite(n?.end_index)?Math.max(0,Math.min(t-1,n.end_index)):t-1},e.visibleDrawingValues=function(n,t,i){return(n?.lines||[]).flatMap(n=>(n.points||[]).filter(n=>Number.isFinite(n.index)&&n.index>=t&&n.index<=i&&Number.isFinite(n.value)).map(n=>n.value))},e.candleRanges=function(n){return(n?.lines||[]).filter(n=>'candle_range'===n.role&&2===n.points?.length&&n.points.every(n=>Number.isFinite(n.index)&&Number.isFinite(n.value))).map(n=>({label:n.label,first:Math.min(n.points[0].index,n.points[1].index),last:Math.max(n.points[0].index,n.points[1].index),low:Math.min(n.points[0].value,n.points[1].value),high:Math.max(n.points[0].value,n.points[1].value)}))},e.drawingColor=function(t){return/failure|invalid|stop/i.test(t.label)?n.C.red:/trigger|confirm/i.test(t.label)?n.C.amber:/target|PRZ/i.test(t.label)?n.C.blue:'curve'===t.role?n.C.curve:'boundary'===t.role?n.C.boundary:n.C.swing},e.hasDrawing=function(n){return!!n?.lines?.some(n=>n.points?.length>0)},e.placedLabels=function(n,t,i,l,o,c,h=c+Math.max(140,16*n.length)){const f=[],b=c+11,p=h-3,x=o-l;for(const c of n){if(!c.point||!Number.isFinite(c.point.index)||!Number.isFinite(c.point.value))continue;const n=t(c.point.index),h=i(c.point.value);if(!Number.isFinite(n)||!Number.isFinite(h))continue;const C=String(c.label),v=u(C),M=s(v),y=l+M/2,_=o-M/2,w=Math.max(y,Math.min(_,n)),H=Math.max(b,Math.min(p,h-10)),P={label:v,fullLabel:C,width:M,anchorX:n,anchorY:h},F=f.filter(n=>!n.hidden);let N;if(M<=x&&p>=b){const n=[w,y,_,...F.flatMap(n=>[n.x-(n.width+M)/2-4,n.x+(n.width+M)/2+4])].filter(n=>n>=y&&n<=_),t=[H,...Array.from({length:Math.floor((p-b)/14)+1},(n,t)=>b+14*t),...F.flatMap(n=>[n.y-14,n.y+14])].filter(n=>n>=b&&n<=p);for(const i of t)for(const t of n){if(F.some(n=>Math.abs(n.x-t)<(n.width+M)/2+4-.001&&Math.abs(n.y-i)<13.999))continue;const n=(t-w)**2+(i-H)**2;(!N||n<N.distance)&&(N={x:t,y:i,distance:n})}}N?f.push({...P,x:N.x,y:N.y,moved:Math.abs(N.x-n)>4||Math.abs(N.y-(h-10))>4,hidden:!1}):f.push({...P,x:n,y:h,moved:!1,hidden:!0})}return f},Object.defineProperty(e,"drawingLines",{enumerable:!0,get:function(){return c}});var n=r(d[0]);const t={CH01:'cup_handle',CH02:'horizontal_breakout',CH03:'flag_pole',CH04:'symmetrical_triangle',CH05:'falling_wedge',CH06:'rising_wedge',CH07:'channel',CH08:'descending_triangle',CH09:'head_shoulders',CH10:'inverse_head_shoulders'},i=n=>t[n]||n,l=n=>/^(CH\d{2}|HA\d{2}|PA\d{2}|CDL[A-Z0-9]+)$/.test(n||''),o=n=>!!t[n]||Object.values(t).includes(n);const s=n=>6+[...n].reduce((n,t)=>n+(/[MW@%]/.test(t)?8.5:/[ilI1.,: '\/]/.test(t)?3:/[A-Z0-9]/.test(t)?6.5:5.5),0),u=n=>'Pattern recognized'===n?'Recognized':'Confirmation'===n?'Confirmed':n.replace('Left shoulder','L shoulder').replace('Right shoulder','R shoulder');const c=n=>(n?.lines||[]).filter(n=>!['anchors','candle_range'].includes(n.role)&&n.points?.length>1)},866,[821]); 960__d(function(g,r,_i,a,m,e,d){"use strict";
960Object.defineProperty(e,'__esModule',{value:!0}),e.chartStart=function(t,n,i,u=[]){if(t<=0||'all'===n)return 0;if('recent'===n)return Math.max(0,t-40);const c=[i,...u].filter(n=>Number.isFinite(n)&&Number(n)>=0&&Number(n)<t),f=c.length?Math.floor(Math.min(...c)):t-50;return Math.max(0,Math.min(t-50,f-8))}},867,[]); 961__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"legendPrice",{enumerable:!0,get:function(){return h}}),_e.legendBarTime=f,_e.barReadout=b,_e.chartKeyMatches=y,Object.defineProperty(_e,"chartMatchKey",{enumerable:!0,get:function(){return p}}),_e.legendRowsFromChart=function(e,t,n={}){if(!t||!y(e,t.symbol,t.timeframe))return[];const{symbol:r,timeframe:i}=t,a=Array.isArray(e.bars)?e.bars:[],l=null!=n.cursor&&a[n.cursor]?n.cursor:a.length-1,s=new Set(n.hidden||[]),d=e=>`${r}:${i}:${e}`,c=Array.isArray(e.matches)?e.matches:[],u=c.map(e=>{const t=String(p(e)||d(e.pattern)),n=(0,o.boundaryConfirmIndex)(e),r=null==n||l<n,a=(0,o.boundaryValuesAt)(e,l);return{key:t,name:String(e.pattern_name||e.pattern),timeframe:i,direction:e.direction,found:!0,boundaries:r?a.map(e=>({...e,value:null})):a,beforeConfirm:r,confirmIndex:n,visible:!s.has(t)}});u.sort((e,n)=>Number(n.key===p(t))-Number(e.key===p(t)));const h=new Set(c.map(e=>e.pattern)),m=(n.enabledPatterns||[]).filter((e,t,n)=>!h.has(e)&&n.indexOf(e)===t).map(e=>{const t=d(e);return{key:t,name:n.catalogue?.find(t=>t.id===e)?.name||e,timeframe:i,found:!1,visible:!s.has(t)}});return[...u,...m]},Object.defineProperty(_e,"HOLD_PERIOD_HISTORY_LABEL",{enumerable:!0,get:function(){return x}}),_e.evidenceFromWorkspace=function({match:e,history:t,exit:n,chartData:r,legendKey:i,age:a,stale:o}){if(e&&!t&&!e.history.length)return null;const l=n?.data,c=!n||!!l||!!n.error,h=!e?.detection_id||(r?.matches||[]).some(t=>t.detection_id===e.detection_id&&t.id===e.id)&&(!l||l.detection_id===e.detection_id);if(!(h&&e&&t&&e.history.includes(t))||i&&(i.symbol!==e.symbol||i.timeframe!==e.timeframe||null!=i.selectedKey&&i.selectedKey!==p(e))||void 0!==r&&(!y(r,e.symbol,e.timeframe)||r.last_candle&&r.last_candle!==e.candle_end)||l?.side&&l.side!==t.side||!c)return{keyMatches:!1,nextOpen:!1};const m=t.reference,f=l?.status,b=m?.expectancy_ci95,$=u(l?.cost_pct)?l.cost_pct:null,v=u(m?.win_rate)&&u(m?.n)?Math.round(m.win_rate*m.n/100):null,j=l?`${!0===l.tradable_evidence?'Tested on later data \xb7 this exact rule':'Illustrative \xb7 no tested evidence for this exact rule'} \xb7 1:${l.reward} \xb7 ${l.holding?.duration||'n/a'} maximum hold`:void 0;return{keyMatches:!0,avg:m?.display_return_pct??null,low95:u(b?.[0])?b[0]:null,high95:u(b?.[1])?b[1]:null,n:u(m?.n)?m.n:null,sampleLabel:m?(0,s.sampleSize)(m.n).label:void 0,costPct:$??d.ROUND_TRIP_COST_PCT,costAssumed:null==$,nextOpen:!0,historyLabel:String(l?.history_label||x),exitState:'default'===f?'default_benchmark':'limited'===f||'supported'===f||'failed'===f?f:'unknown',tradable:l?!0===l.tradable_evidence:void 0,tradableReason:l?String(l.tradable_reason||''):n?.error?'Exit-rule evidence could not load.':void 0,dataAgeDays:a,stale:o,side:t.side,wins:v,testedHold:m?.holding?.duration,breakout:'setup'===e.state?'waiting':'recorded',current:!!e.current,exitRule:j}},Object.defineProperty(_e,"ChartLegend",{enumerable:!0,get:function(){return w}});var t=_r(_d[0]),n=e(_r(_d[1])),r=e(_r(_d[2]));_r(_d[3]);var i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),l=_r(_d[7]),s=_r(_d[8]),d=_r(_d[9]),c=_r(_d[10]);const u=e=>'number'==typeof e&&Number.isFinite(e),h=e=>u(e)?e.toLocaleString('en-IN',{minimumFractionDigits:2,maximumFractionDigits:2}):'n/a',m=e=>u(e)?(0,a.pct)(e):'n/a';function f(e,t){if(!e?.time)return'n/a';const n=(0,a.dateText)(e.time),r=e.time.slice(11,16);return/H$/i.test(t)&&/^\d{2}:\d{2}$/.test(r)?`${n} \xb7 ${r} IST`:n}function b(e,t){const n=Array.isArray(e)?e:[],r=null!=t&&!!n[t],i=r?t:n.length-1,a=n[i],o=i>0?n[i-1]:void 0,l=u(a?.close)&&u(o?.close)?a.close-o.close:null;return{index:i,bar:a,change:l,changePct:null!=l&&o.close?l/o.close*100:null,hovered:r}}function y(e,t,n){return!!e&&!!t&&!!n&&e.symbol===t&&e.timeframe===n}const p=e=>e.detection_id||e.id||'';const x='Pattern hold-period history, not this exit rule';const $={default_benchmark:['OOS: Default benchmark','amber'],limited:['OOS: Limited evidence','amber'],supported:['OO
961S: History supported','green'],failed:['OOS: Exit test failed','red'],unknown:['OOS: n/a','neutral']},v=e=>/larger/i.test(e||'')?'green':/moderate/i.test(e||'')?'neutral':'amber',j=e=>({'aria-pressed':e});function C({label:e,tone:t="neutral"}){return(0,c.jsx)(n.default,{style:{borderRadius:5,paddingHorizontal:6,paddingVertical:1,backgroundColor:'amber'===t?i.C.amberBg:'neutral'===t?i.C.bg:i.C.soft,borderWidth:1,borderColor:'red'===t?i.C.redLine:i.C.line},children:(0,c.jsx)(i.T,{style:{fontSize:10,lineHeight:15,color:(r=t,'green'===r?i.C.green:'amber'===r?i.C.amber:'red'===r?i.C.red:i.C.muted)},children:e})});var r}const S=(0,t.memo)(function({bars:e,cursor:t,symbol:r,timeframe:o,dataEnd:l}){const s=b(e,t),d=s.bar,u=null==s.change?i.C.muted:s.change>=0?i.C.green:i.C.red,y={fontSize:11,color:i.C.ink};return(0,c.jsxs)(n.default,{style:[i.s.row,{flexWrap:'wrap',gap:8,rowGap:0}],children:[(0,c.jsxs)(i.T,{style:{fontSize:12,lineHeight:18,fontFamily:'InterSemi'},children:[r||'n/a'," \xb7 ",o||'n/a'," \xb7 NSE"]}),(0,c.jsxs)(i.T,{style:{fontSize:11,lineHeight:18,color:i.C.muted},children:["O ",(0,c.jsx)(i.T,{style:y,children:h(d?.open)})," H ",(0,c.jsx)(i.T,{style:y,children:h(d?.high)})," L ",(0,c.jsx)(i.T,{style:y,children:h(d?.low)})," C ",(0,c.jsx)(i.T,{style:y,children:h(d?.close)})]}),(0,c.jsx)(i.T,{style:{fontSize:11,lineHeight:18,color:u},children:null==s.change?'n/a':`${s.change>0?'+':''}${h(s.change)} (${m(s.changePct)})`}),(0,c.jsxs)(i.T,{style:{fontSize:11,lineHeight:18,color:i.C.muted},children:[f(d,o),d&&!s.hovered?' \xb7 last bar':'',l?` \xb7 data to ${(0,a.dateText)(l)}`:'']})]})}),k=(0,t.memo)(function({row:e,selected:t,onToggleVisible:a,onSelect:o,onHide:s}){const d=e.found?e.boundaries?.length?e.boundaries.map(t=>`${t.label} ${e.beforeConfirm?'\u2014':h(t.value)}`).join(' \xb7 '):'boundaries n/a':'',u=e.found&&e.boundaries?.length?"Line fitted as of data end"+(e.beforeConfirm?'; values shown only from the pattern\u2019s confirmation bar (its last line point) onward':''):void 0,m=(0,l.useTitle)(u),f={minWidth:30,minHeight:30,alignItems:'center',justifyContent:'center',borderRadius:6};return(0,c.jsxs)(n.default,{style:[i.s.row,{gap:2,opacity:e.visible?1:.55}],children:[(0,c.jsx)(r.default,{ref:m,accessibilityRole:"button",accessibilityLabel:`${e.name}, ${e.timeframe}. ${e.found?`Found on this chart. ${d}.${u?` ${u}.`:''}`:'Not found on this chart.'}${t?' Selected.':' Select this pattern.'}`,accessibilityState:{selected:t},...j(t),disabled:!o,onPress:()=>o?.(e.key),style:{flex:1,minWidth:0,minHeight:30,justifyContent:'center',paddingHorizontal:6,borderRadius:6,borderLeftWidth:2,borderLeftColor:t?i.C.green:'transparent',backgroundColor:t?i.C.soft:'transparent'},children:(0,c.jsxs)(i.T,{numberOfLines:t?2:1,style:{fontSize:11,lineHeight:16,color:i.C.muted},children:[(0,c.jsx)(i.T,{style:{fontSize:11,fontFamily:'InterSemi',color:t?i.C.green:i.C.ink},children:e.name})," \xb7 ",e.timeframe,e.direction?` \xb7 ${e.direction}`:''," \xb7 ",e.found?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.green},children:"Found"}),d?` ${d}`:'']}):(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.amber,opacity:.78},children:"Not found on this chart"})]})}),e.found&&!!a&&(0,c.jsx)(r.default,{accessibilityRole:"button",accessibilityLabel:`${e.visible?'Hide':'Show'} ${e.name} outline on the chart`,accessibilityState:{checked:e.visible},...j(e.visible),onPress:()=>a(e.key),style:f,children:(0,c.jsx)(i.Icon,{name:e.visible?'eye':'eye-off',size:14,color:e.visible?i.C.ink:i.C.muted})}),!!s&&(0,c.jsx)(r.default,{accessibilityRole:"button",accessibilityLabel:`Remove ${e.name} from the legend`,onPress:()=>s(e.key),style:f,children:(0,c.jsx)(i.Icon,{name:"x",size:14,color:i.C.muted})})]})}),T=(0,t.memo)(function({evidence:e,onOpenEvidence:t}){if(void 0===e)return null;if(!e||!e.keyMatches)return(0,c.jsx)(n.default,{style:{paddingLeft:10,paddingBottom:2},children:(0,c.jsx)(i.T,{accessibilityLiveRegion:"polite",style:{fontSize:11,color:i.C.muted},children:e?'Loading evidence\u2026':'Evidence n/a'})});const a=e,o=$[a.exitState||'unknown'],l=a.sampleLabel,d=u(a.n)?String(a.n):'n/a',h=`${void 0===a.dataAgeDays?'Data age unknown':(0,s.dataAgeText)(a.dataAgeDays)}${a.stale?' \xb7 stale':''}`,f=[[`avg ${m(a.avg)}/trade`,u(a.avg)&&a.avg>0?'green':'neutral'],[`95% low ${m(a.low95)}`,'neutral'],[`n ${d}${l?` \xb7 ${l}`:''}
961`,v(l)],[u(a.costPct)?`costs ${a.costPct.toFixed(2)}% incl.${a.costAssumed?' (assumed)':''}`:'costs n/a',u(a.costPct)&&!a.costAssumed?'neutral':'amber'],[a.nextOpen?'next-open entry':'entry basis n/a',a.nextOpen?'neutral':'amber'],o,[h,a.stale?'amber':'neutral']];'short'===a.side&&f.push(['hypothetical short study','amber']),!0===a.tradable&&f.push(['exact exit rule tested','green']);const b={fontSize:10,lineHeight:14,color:i.C.muted},y=`Profitable ${u(a.wins)&&u(a.n)?`${a.wins} of ${a.n}`:'n/a'} \xb7 fixed hold ${a.testedHold||'n/a'}`,p=`${'waiting'===a.breakout?'Waiting for breakout':'Breakout recorded'}${!1===a.current?' \xb7 Fresh prices are needed before this stored setup can become a current trade.':''}`,x=a.exitRule?`Exit rule: ${a.exitRule}${!0===a.tradable?'':' \xb7 the history above does not describe this stop, target and hold'}`:'',j='Picked from many results: partly luck; the range doesn\u2019t correct for that.',S=`Evidence for the selected pattern. ${a.historyLabel||''}. Average ${m(a.avg)} per trade, 95% range ${m(a.low95)} to ${m(a.high95)}, ${d} trades${l?`, ${l}`:''}. ${f.slice(3).map(e=>e[0]).join(', ')}. ${y}. ${p}${x?` ${x}.`:''} ${j}`;return(0,c.jsxs)(n.default,{role:"group",accessibilityLabel:S,style:{gap:3,paddingLeft:10,paddingBottom:3},children:[!!a.historyLabel&&(0,c.jsx)(i.T,{style:{fontSize:10,lineHeight:14,fontFamily:'InterMedium',color:i.C.amber},children:a.historyLabel}),(0,c.jsx)(n.default,{style:[i.s.row,{flexWrap:'wrap',gap:3}],children:f.map(([e,t])=>(0,c.jsx)(C,{label:e,tone:t},e))}),(0,c.jsx)(i.T,{style:b,children:y}),(0,c.jsx)(i.T,{style:{...b,color:!1===a.current?i.C.amber:i.C.muted},children:p}),!!x&&(0,c.jsx)(i.T,{style:{...b,color:!0===a.tradable?i.C.ink:i.C.amber},children:x}),(0,c.jsx)(i.T,{style:b,children:j}),!1===a.tradable&&(0,c.jsx)(i.T,{style:{fontSize:10,lineHeight:14,color:i.C.amber},children:a.tradableReason||'Exit rule illustrative \xb7 no tested evidence for this exact rule.'}),!!t&&(0,c.jsx)(r.default,{accessibilityRole:"link",accessibilityLabel:"Show evidence for the selected pattern",onPress:t,style:{alignSelf:'flex-start',minHeight:26,justifyContent:'center'},children:(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.green},children:"Show evidence \u203a"})})]})}),w=(0,t.memo)(function({bars:e,cursor:t,symbol:a,timeframe:o,dataEnd:l,rows:s,selectedKey:d,evidence:f,onToggleVisible:y,onSelect:p,onOpenEvidence:x,onHide:$,compact:v=!1}){if(v){const l=s.find(e=>e.key===d)||s.find(e=>e.found)||s[0],y=b(e,t).bar,x=y?` \xb7 O ${h(y.open)} H ${h(y.high)} L ${h(y.low)} C ${h(y.close)}`:'',$={fontSize:11,lineHeight:16,color:i.C.muted,minWidth:0},v=(0,c.jsxs)(i.T,{numberOfLines:1,style:[$,{flexShrink:3}],children:[(0,c.jsxs)(i.T,{style:{fontSize:11,fontFamily:'InterSemi',color:i.C.ink},children:[a||'n/a'," \xb7 ",o||'n/a']}),x]}),j=`${a||'n/a'} ${o||'n/a'}${x.replace(/ \xb7 /g,', ')}`;if(!l)return(0,c.jsxs)(n.default,{accessibilityLabel:`Chart legend for ${a||'n/a'} ${o||''}. No patterns listed for this chart`,style:[i.s.row,{minHeight:30,gap:6,paddingHorizontal:6}],children:[v,(0,c.jsx)(i.T,{numberOfLines:1,style:[$,{flexShrink:1}],children:"No patterns listed for this chart"})]});const C=l.key===d&&l.found?f:void 0,S=void 0===C?'':C?C.keyMatches?` \xb7 hold-period avg ${m(C.avg)} \xb7 95% low ${m(C.low95)} \xb7 n ${u(C.n)?C.n:'n/a'}${C.sampleLabel?` ${C.sampleLabel}`:''}`:' \xb7 Loading evidence\u2026':' \xb7 Evidence n/a';return(0,c.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`Chart legend for ${a||'n/a'} ${o||''}. ${j}. ${l.name}, ${l.found?'found':'not found on this chart'}${S.replace(/ \xb7 /g,', ')}. Expand legend`,disabled:!p,onPress:()=>p?.(l.key),style:[i.s.row,{minHeight:30,gap:6,paddingHorizontal:6,minWidth:0}],children:[v,(0,c.jsxs)(i.T,{numberOfLines:1,style:[$,{flexShrink:1}],children:[(0,c.jsx)(i.T,{style:{fontSize:11,fontFamily:'InterSemi',color:i.C.ink},children:l.name})," \xb7 ",l.found?(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.green},children:"Found"}):(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.amber,opacity:.78},children:"Not found on this chart"}),S]})]})}return(0,c.jsxs)(n.default,{role:"group",accessibilityLabel:`Chart legend for ${a||'n/a'} ${o||''}`,style:{gap:2,paddingVertical:5,paddingHorizontal:6},children:[(0,c.jsx)(S,{bars:e,cursor:t,symbol:a,timeframe:o,dataEnd:l}),s.length?s.map(e=>{const t=e.key===d;return(0,c.jsxs)(n.default,{children:[(0,c.jsx)(k,{row:e,selected:t,onToggleVisible:y,onSelect:p,onHide:$}),t&&e.found&&(0,c.jsx)(T,{evidence:f,onOpenEvidence:x})]},e.key)}):(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.muted,paddingHorizontal:6},children:"No patterns detected or enabled for this chart."})]})})},868,[11,13,375,136,821,197,865,869,248,249,6]); 962__d(function(_g,_r,_i,a,m,_e,_d){"use strict";
962function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"web",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"clamp",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"domId",{enumerable:!0,get:function(){return f}}),_e.webOnly=d,Object.defineProperty(_e,"storeKey",{enumerable:!0,get:function(){return p}}),_e.readStore=function(e,t){if(!t)return{};try{const n=globalThis.localStorage?.getItem(p(e,t)),r=n?JSON.parse(n):null;return r&&'object'==typeof r?r:{}}catch{return{}}},_e.writeStore=function(e,t,n){if(!t)return;try{globalThis.localStorage?.setItem(p(e,t),JSON.stringify(n))}catch{}},_e.useMergedRef=b,_e.useTitle=h,_e.useRoving=function(e,n){const r=t.default.useRef([]),o=t.default.useCallback((t,o,u)=>{const i=o?.key??o?.nativeEvent?.key;let s=-1;i===('horizontal'===n?'ArrowRight':'ArrowDown')?s=(t+1)%e:i===('horizontal'===n?'ArrowLeft':'ArrowUp')?s=(t-1+e)%e:'Home'===i?s=0:'End'===i&&(s=e-1),s<0||!e||(o.preventDefault?.(),r.current[s]?.focus?.(),u?.(s))},[e,n]);return{refs:r,onKeyDown:o}},Object.defineProperty(_e,"IconButton",{enumerable:!0,get:function(){return y}}),_e.useDragResize=function(e){const n=t.default.useRef(e);n.current=e;const i=t.default.useRef(new r.default.Value(0)).current,s=t.default.useRef(new r.default.Value(0)).current,l=t.default.useRef({on:!1,origin:0,start:0,next:0}),f=t.default.useRef({begin(e){const t=n.current;l.current={on:!0,origin:e,start:t.value,next:t.value},i.setValue(0),s.setValue(1)},move(e){const t=l.current;if(!t.on)return;const r=n.current;t.next=c(t.start-(e-t.origin),r.min,r.max),i.setValue(t.start-t.next)},end(){const e=l.current;if(!e.on)return;e.on=!1,s.setValue(0),i.setValue(0);const t=Math.round(e.next);t!==Math.round(n.current.value)&&n.current.onCommit(t)}}).current,{axis:d,value:p,min:b,max:h,label:y,step:g=24}=(t.default.useRef(o.default.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderTerminationRequest:()=>!1,onPanResponderGrant:()=>f.begin(0),onPanResponderMove:(e,t)=>f.move('y'===n.current.axis?t.dy:t.dx),onPanResponderRelease:()=>f.end(),onPanResponderTerminate:()=>f.end()})).current,e),v=Math.round(p),R=e=>{const t=n.current,r=Math.round(c(t.value+e,t.min,t.max));r!==Math.round(t.value)&&t.onCommit(r)},w=e=>'y'===d?e.clientY:e.clientX,x='y'===d?'ArrowUp':'ArrowLeft',P='y'===d?'ArrowDown':'ArrowRight',S={role:'separator','aria-orientation':'y'===d?'horizontal':'vertical',tabIndex:0,'aria-label':y,'aria-valuenow':v,'aria-valuemin':b,'aria-valuemax':h,'aria-valuetext':`${v} pixels`,onPointerDown:e=>{if(!(e.button>0)){e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}f.begin(w(e))}},onPointerMove:e=>f.move(w(e)),onPointerUp:()=>f.end(),onPointerCancel:()=>f.end(),onLostPointerCapture:()=>f.end(),onKeyDown:e=>{const t=e.key,r=e.shiftKey?4*g:g;if(t===x)R(r);else if(t===P)R(-r);else if('Home'===t)R(b-p);else if('End'===t)R(h-p);else{if('Enter'!==t&&' '!==t||!n.current.onEnter)return;n.current.onEnter()}e.preventDefault()}},A={position:'absolute',zIndex:50,pointerEvents:'none',backgroundColor:u.C.green,opacity:s,...'y'===d?{left:0,right:0,top:-1,height:2,transform:[{translateY:i}]}:{top:0,bottom:0,left:-1,width:2,transform:[{translateX:i}]}};return{handleProps:S,handleStyle:{cursor:'y'===d?'row-resize':'col-resize',touchAction:'none',userSelect:'none'},ghostStyle:A}};var t=e(_r(_d[0]));_r(_d[1]);var n=e(_r(_d[2])),r=e(_r(_d[3])),o=e(_r(_d[4])),u=_r(_d[5]),i=_r(_d[6]),s=_r(_d[7]);const l=!0,c=(e,t,n)=>Math.max(t,Math.min(n,e)),f=e=>e.replace(/[^a-zA-Z0-9_-]/g,'_');function d(e){const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}const p=(e,t)=>`kanida.layout.${e}.${t}`;function b(...e){return t.default.useCallback(t=>{for(const n of e)'function'==typeof n?n(t):n&&(n.current=t)},e)}function h(e){const n=t.default.useRef(null);return t.default.useEffect(()=>{const t=n.current;if(!t||'function'!=typeof t.setAttribute)return;const r=t.getAttribute('title');e&&r!==e?t.setAttribute('title',e):e||null==r||t.removeAttribute('title')}
962),n}const y=t.default.forwardRef(function({icon:e,label:t,onPress:r,tooltip:o,pressed:l,expanded:c,haspopup:f,controls:p,disabled:y=!1,color:g,size:v=16,style:R,slop:w},x){const P=b(x,h(o??t)),S={disabled:y};null!=l&&(S.selected=l),null!=c&&(S.expanded=c);const A=(0,i.styleSlop)(R,{w:36,h:36}),C=w??{...A,left:Math.min(4,A.left),right:Math.min(4,A.right)};return(0,s.jsxs)(n.default,{ref:P,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:S,disabled:y,...d({'aria-pressed':l,'aria-expanded':c,'aria-haspopup':f,'aria-controls':p}),onPress:r,hitSlop:C,style:e=>[{width:36,height:36,alignItems:'center',justifyContent:'center',borderRadius:8,backgroundColor:l?u.C.soft:e.hovered||e.focused?u.C.paper:'transparent',opacity:y?.4:e.pressed?.7:1},R],children:[(0,s.jsx)(i.HitArea,{slop:C}),(0,s.jsx)(u.Icon,{name:e,size:v,color:g??(l?u.C.green:u.C.muted)})]})})},869,[11,136,375,267,355,821,832,6]); 963__d(function(g,r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"verdictTone",{enumerable:!0,get:function(){return C}}),_e.discoverSort=P,_e.useDiscoverRows=_,_e.historyFor=A,_e.resolveSymbolMatch=$,_e.outsideSetups=M,_e.useWorkspaceMatch=function(e){const s=(0,d.useProduct)(),{active:i,setActive:l}=(0,f.useActiveSymbol)(),n=s.studyDraft?.origin?.matchId||'',a=s.workspace.selected||'',o=s.setWorkspace,c=s.autoPick,m=s.setAutoPick,h=i?.detectionId?[i.symbol,i.timeframe,i.matchId,i.detectionId,s.state?.source_latest||''].join('|'):'',y=(0,f.useKeyedValue)(h,()=>(0,u.api)(`/api/chart?symbol=${encodeURIComponent(i.symbol)}&timeframe=${encodeURIComponent(i.timeframe)}`));(0,t.useEffect)(()=>{i||a||!n||o(e=>({...e,selected:n}))},[i,a,n,o]);const p=(0,t.useMemo)(()=>{const t={active:i,symbol:i?.symbol||'',timeframe:i?.timeframe||'',outside:!1,replaced:!1,auto:!1,outsideSetups:[],age:e.age,stale:e.stale};if(i?.detectionId){if(y.loading)return{...t,kind:'loading'};if(y.error)return{...t,kind:'error',error:y.error,retry:y.reload};const e=(0,f.selectedChartDetection)(i,y.value);return e?{...t,kind:'match',match:e,chartSnapshot:y.value}:{...t,kind:'none',replaced:!0}}if(s.loading)return{...t,kind:'loading'};if(s.error&&!s.state)return{...t,kind:'error'};const l=s.matches||[];if(!i){const i=a?(n=a,e.rows.find(e=>e.id===n)||l.find(e=>e.id===n)):void 0;return i?{...t,kind:'match',match:i,history:A(i,s.filters),symbol:i.symbol,timeframe:i.timeframe,outside:!e.rows.includes(i)}:{...t,kind:'empty'}}var n;let o=(0,f.selectedActiveMatch)(i,[...e.rows,...l]);if(o){const l=!!c&&c.matchId===o.id&&c.symbol===i.symbol&&c.timeframe===i.timeframe&&c.source===i.source;return{...t,kind:'match',match:o,history:A(o,s.filters,i.side),outside:!e.rows.includes(o),auto:l,replaced:l&&!!c.replaced}}if(i.detectionId)return{...t,kind:'none',replaced:!0};const d=!!i.matchId;return o=$({rows:e.rows,symbol:i.symbol,timeframe:i.timeframe,side:i.side}),o?{...t,kind:'match',match:o,history:A(o,s.filters,i.side),auto:!0,replaced:d}:{...t,kind:'none',replaced:d,outsideSetups:M({rows:e.rows,matches:l,filters:s.filters,sort:e.sort,symbol:i.symbol,timeframe:i.timeframe})}},[s.loading,s.error,s.state,s.matches,s.filters,i,a,e.rows,e.sort,e.age,e.stale,c,y.loading,y.error,y.value,y.reload]),b='match'===p.kind&&i&&p.match&&i.matchId!==p.match.id?p.match.id:'',x=p.replaced;return(0,t.useEffect)(()=>{if(!b||!i)return;const e={symbol:i.symbol,timeframe:i.timeframe,matchId:b,source:i.source,replaced:x};m?.(t=>t&&t.symbol===e.symbol&&t.timeframe===e.timeframe&&t.matchId===e.matchId&&t.source===e.source&&t.replaced===e.replaced?t:e),l({symbol:i.symbol,timeframe:i.timeframe,matchId:b,side:i.side,asOf:i.asOf,source:i.source},{replace:!0})},[b,i,x,l,m]),p},_e.DiscoverPanel=function({layout:e,onSelect:P}){const A=(0,d.useProduct)(),{rows:M,losers:O,counts:I,decisions:E,age:W,stale:F,sort:B,positive:N,verdict:D,setWs:U,noAverages:V,noHistoryScreen:q,applied:K}=_(),{active:Q,setActive:G}=(0,f.useActiveSymbol)(),Y='sheet'===e,X=v[e],Z=S[e],J=(0,p.pageNotDeployed)(A.research),ee=(0,x.useStudiesOff)(),[te,se]=(0,t.useState)(A.query),[ie,re]=(0,t.useState)([]),[le,ne]=(0,t.useState)(!1),[ae,oe]=(0,t.useState)(!1),ce=(0,t.useRef)(null),{height:de}
963=(0,o.default)(),[me,ue]=(0,t.useState)(0),he=(0,p.useTitle)(R),fe=(0,t.useCallback)(e=>{const t=Math.round(e?.nativeEvent?.layout?.height||0);ue(e=>Math.abs(e-t)<2?e:t)},[]),ye=!Y&&(me>0?me<z:de<707),pe=M.length-O,be=O?[...M.slice(0,pe),{id:'__losers__',header:!0},...M.slice(pe)]:M,ge=e=>O&&e>=pe?e+1:e,xe=(0,t.useMemo)(()=>M.map(e=>({symbol:e.symbol,timeframe:e.timeframe,matchId:e.id})),[M]),je=(0,f.useActiveNavigation)(xe,'discover'),Ce=A.defaultFilters||{},Se=Ce.frames||[],ve=A.filters,we=Number(!!ve.patterns?.length)+Number(!q&&!!ve.band)+Number(!!ve.sector)+Number(!!ve.universe)+Number('all'!==ve.direction)+Number(!q&&ve.minimum!==Ce.minimum),ke=!!Q&&H.includes(Q.source),Te=(0,t.useMemo)(()=>Q&&!Q.matchId?$({rows:M,matches:[],filters:ve,sort:B,symbol:Q.symbol,timeframe:Q.timeframe,side:Q.side})?.id:void 0,[Q,M,ve,B]);(0,t.useEffect)(()=>{let e=!0;if(re([]),te.trim().length<2)return;const t=setTimeout(()=>(0,u.api)('/api/stocks?q='+encodeURIComponent(te.trim())).then(t=>{e&&re((0,p.asList)(t))}).catch(()=>{}),240);return()=>{e=!1,clearTimeout(t)}},[te]);const Re=(0,t.useRef)(!1),ze=(0,t.useRef)(!1),Le=(0,t.useRef)(0),He=(0,t.useRef)(0),Pe=(0,t.useCallback)(e=>{Re.current=!0;try{e()}catch{}},[]),Ae=(0,t.useCallback)(e=>{const t=O?pe:-1;return e===t?{length:Z,offset:X*e,index:e}:{length:X,offset:t>=0&&e>t?X*(e-1)+Z:X*e,index:e}},[O,pe,X,Z]),$e=(0,t.useCallback)(()=>{if(je.index<0||!He.current)return;const{offset:e,length:t}=Ae(ge(je.index)),s=Le.current,i=e<s?e:e+t>s+He.current?e+t-He.current:null;if(null===i||Math.round(i)===Math.round(s))return;const l=Math.max(0,i);Le.current=l,Pe(()=>ce.current?.scrollToOffset({offset:l,animated:!1}))},[je.index,Ae,ge,Pe]),Me=Q?`${Q.symbol}|${Q.timeframe}|${Q.matchId||''}`:'',Oe=(0,t.useRef)(Me);(0,t.useEffect)(()=>{Me!==Oe.current&&(Oe.current=Me,$e())},[Me]);const Ie=(0,t.useCallback)(e=>{const t=Math.round(e?.nativeEvent?.contentOffset?.y||0);Le.current=t,Re.current?Re.current=!1:ze.current&&U({listOffset:t})},[U]),Ee=(0,t.useCallback)(e=>{if(He.current=Math.round(e?.nativeEvent?.layout?.height||0),ze.current)return;ze.current=!0;const t=Number(A.workspace.listOffset)||0;t>0&&(Le.current=t,Pe(()=>ce.current?.scrollToOffset({offset:t,animated:!1}))),$e()},[A.workspace.listOffset,$e,Pe]);function We(e){G({symbol:e.symbol,timeframe:e.timeframe,matchId:e.id,source:'discover'}),P?.(e)}function Fe(e){const t=e.trim();if(!ee&&/\b(pnl|p&l|profit|simulation|backtest)\b/i.test(t))return A.setQuery(''),se(''),void c.router.push('/simulate');A.setQuery(t),se(t)}function Be(){A.setFilters(A.defaultFilters),A.setQuery(''),se(''),U({sort:'return',positive:!0,verdict:'all'})}async function Ne(){ne(!0);try{await A.refresh()}finally{ne(!1)}}const De=(0,t.useCallback)(e=>{const t=e?.key??e?.nativeEvent?.key;if('ArrowDown'!==t&&'ArrowUp'!==t)return;const s=String(e?.target?.tagName||'').toUpperCase();'INPUT'===s||'TEXTAREA'===s||e?.altKey||e?.ctrlKey||e?.metaKey||(e.preventDefault?.(),'ArrowDown'===t?je.next():je.prev())},[je.next,je.prev]);if(A.loading)return(0,j.jsx)(m.Loading,{});if(A.error&&!A.state)return(0,j.jsx)(s.default,{style:{flex:1,padding:16},children:(0,j.jsx)(m.Empty,{title:"Research couldn\u2019t load",detail:A.error,action:(0,j.jsx)(m.Button,{label:"Retry",icon:"rotate-ccw",loading:le,onPress:Ne})})});const Ue=[...Se.length?['Mine']:[],'All',...h.ALL_FRAMES],Ve=e=>'Mine'===e?'All'===ve.timeframe&&!!ve.frames?.length:'All'===e?'All'===ve.timeframe&&!ve.frames?.length:ve.timeframe===e,qe=[['all',`All ${I.review+I.history+I.watch+I.pass}`],['review',`For review ${I.review}`],['history',`History only ${I.history}`],['watch',`Watch ${I.watch}`],['pass',`Pass ${I.pass}`]],Ke=new Set(M.map(e=>e.symbol)).size,Qe=(e,t=!0)=>({minHeight:28,paddingHorizontal:8,justifyContent:'center',borderRadius:7,borderWidth:t?1:0,borderColor:e?m.C.green:m.C.line,backgroundColor:e?m.C.soft:'transparent'}),Ge=e=>({fontSize:12,lineHeight:16,color:e?m.C.green:m.C.muted}),Ye=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(i.default,{accessibilityLabel:"Search stocks or patterns",value:te,onChangeText:e=>{se(e),A.setQuery(e)},onSubmitEditing:()=>Fe(te),returnKeyType:"search",placeholder:"Stock, pattern or P&L\u2026",placeholderTextColor:m.C.muted,style:[m.s.input,ye?{width:170,flexShrink:0}:{flexGrow:1,flexBasis:150,minWidth:120,maxWidth:240},{height:30,minHeight:30,paddingVertical:0,paddingHorizontal:9,fontSize:13}]}),(0,j.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:"Filters"+(we?`, ${we} changed`:''),onPress:()=>A.setFilterOpen(!0),style:[m.s.row,Qe(!!we),{gap:4}],children:[(0,j.jsx)(m.Icon,{name:"sliders",size:12,color:we?m.C.green:m.C.muted}),(0,j.jsx)(m.T,{style:Ge(!!we),children:"Filters"+(we?` (${we} changed)`:'')})]}),Ue.map(e=>{const t=Ve(e);return(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityState:{selected:t},accessibilityLabel:'Mine'===e?`My timeframes: ${Se.join(', ')}`:'All'===e?'All timeframes':e,onPress:()=>A.setFilters({...ve,timeframe:'Mine'===e?'All':e,frames:'Mine'===e?Se:[]}),style:Qe(t,!1),children:(0,j.jsx)(m.T,{style:Ge(t),children:'Mine'===e?`Mine \xb7 ${Se.join(' ')}`:e})},e)}),qe.map(([e,t])=>(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:`Show ${t}`,accessibilityState:{selected:D===e},onPress:()=>U({verdict:e}),style:Qe(D===e),children:(0,j.jsx)(m.T,{style:Ge(D===e),children:t})},e)),(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:'fit'===B?'Sorted by pattern fit. Sort by the 95% lower bound of hold-period average net per trade':'Sorted by the 95% lower bound of hold-period average net per trade. Sort by pattern fit',onPress:()=>U({sort:'fit'===B?'return':'fit'}),style:Qe(!0,!1),children:(0,j.jsx)(m.T,{style:Ge(!0),children:'fit'===B?'Pattern fit \u2193':'95% low of avg \u2193'})}),(0,j.jsxs)(l.default,{accessibilityRole:"checkbox",accessibilityState:{checked:N,disabled:V},...(0,y.webOnly)({'aria-checked':N,'aria-disabled':V}),disabled:V,accessibilityLabel:V?'Positive average only is unavailable: these detections carry no per-match average':'Positive average only',onPress:()=>U({positive:!N}),style:[m.s.row,Qe(N),{gap:4,opacity:V?.45:1}],children:[(0,j.jsx)(m.Icon,{name:N?'check-square':'square',size:12,color:N?m.C.green:m.C.muted}),(0,j.jsx)(m.T,{style:Ge(N),children:"Positive average only"})]}),q?(0,j.jsx)(s.default,{accessibilityRole:"text",accessibilityLabel:h.NO_HISTORY_SCREEN_NOTE,style:[Qe(!1),{opacity:.45}],children:(0,j.jsx)(m.T,{style:{fontSize:12,lineHeight:16,color:m.C.amber},children:h.NO_HISTORY_SCREEN_LABEL})}):(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:ve.minimum>0?`Minimum ${ve.minimum} historical trades is on. Change in Filters`:'Any sample size. Change in Filters',onPress:()=>A.setFilterOpen(!0),style:Qe(ve.minimum>0),children:(0,j.jsx)(m.T,{style:{fontSize:12,lineHeight:16,color:ve.minimum>0?m.C.green:m.C.amber},children:ve.minimum>0?`Min ${ve.minimum} trades \u203a`:'Any sample size \u203a'})}),(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"Reset filters to the safe defaults",onPress:Be,style:Qe(!1,!1),children:(0,j.jsx)(m.T,{style:Ge(!1),children:"Reset"})}),(0,j.jsxs)(m.T,{style:{fontSize:11,lineHeight:16,color:m.C.muted},children:[M.length," ",1===M.length?'setup':'setups'," \xb7 ",Ke," ",1===Ke?'stock':'stocks']}),(0,j.jsxs)(s.default,{style:[m.s.row,{gap:6,marginLeft:'auto'}],children:[(0,j.jsx)(m.T,{accessibilityLabel:`Stored market ${(0,u.dateText)(A.state?.source_latest)}, ${(0,h.dataAgeText)(W)}`,style:{fontSize:11,lineHeight:16,color:F?m.C.amber:m.C.muted},children:(0,h.dataAgeText)(W)}),!!A.error&&(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"Research refresh failed. Retry",onPress:Ne,style:{minHeight:28,justifyContent:'center'},children:(0,j.jsx)(m.T,{style:{fontSize:11,color:m.C.red},children:le?'Retrying\u2026':'Refresh failed \xb7 Retry'})})]})]}),Xe=!!te&&(/pnl|p&l|backtest|profit|simulat/i.test(te)||ie.length>0)||!!ve.patterns?.length,Ze=(0,j.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`${R} ${ae?'Collapse':'Show'} the full note`,accessibilityState:{expanded:ae},...(0,y.webOnly)({'aria-expanded':ae}),onPress:()=>oe(e=>!e),style:[m.s.row,{gap:5,minHeight:20,alignItems:'flex-start'}],children:[(0,j.jsx)(m.T,{numberOfLines:ae?void 0:1,style:{flexShrink:1,minWidth:0,fontSize:11,lineHeight:16,color:ae?m.C.amber:m.C.muted},children:ae?R:T}),(0,j.jsx)(m.T,{style:{fontSize:11,lineHeight:16,color:m.C.green},children:"\u24d8"})]}),Je=(0,j.jsxs)(l.default,{ref:he,accessibilityRole:"button",accessibilityLabel:`${R} Show the full note`,accessibilityState:{expanded:ae},...(0,y.webOnly)({'aria-expanded':ae}),onPress:()=>oe(!0),style:[m.s.row,Qe(!1),{gap:4,flexShrink:0}],children:[(0,j.jsx)(m.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16,color:m.C.amber},children:L}),(0,j.jsx)(m.T,{style:{fontSize:11,lineHeight:16,color:m.C.green},children:"\u24d8"})]}),et=(0,j.jsxs)(j.Fragment,{children:[!!te&&(!ee&&/pnl|p&l|backtest|profit|simulat/i.test(te)||ie.length>0)&&(0,j.jsxs)(s.default,{style:[m.s.row,{flexWrap:'wrap',gap:4}],children:[!ee&&/pnl|p&l|backtest|profit|simulat/i.test(te)&&(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"Open historical P&L simulation",onPress:()=>c.router.push('/simulate'),style:Qe(!0),children:(0,j.jsx)(m.T,{style:Ge(!0),children:"Open historical P&L simulation"})}),ie.slice(0,3).map(e=>(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:`Search ${e.symbol}`,onPress:()=>{(0,u.filterMatches)(A.matches,A.filters,e.symbol).length?Fe(e.symbol):A.setStock(e)},style:[Qe(!1),{maxWidth:260}],children:(0,j.jsxs)(m.T,{numberOfLines:1,style:Ge(!1),children:[(0,j.jsx)(m.T,{style:{fontSize:12,color:m.C.ink},children:e.symbol})," ",e.company]})},e.symbol))]}),!!ve.patterns?.length&&(0,j.jsx)(m.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:m.C.green},children:A.state?.patterns?.filter(e=>ve.patterns.includes(e.id)).map(e=>e.name).join(' \xb7 ')})]}),tt=ye?(0,j.jsxs)(s.default,{style:{borderBottomWidth:1,borderColor:m.C.line},children:[(0,j.jsxs)(s.default,{style:[m.s.row,{gap:4,paddingLeft:8,paddingRight:6,paddingTop:5,paddingBottom:4}],children:[(0,j.jsx)(a.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,keyboardShouldPersistTaps:"handled",style:{flex:1,minWidth:0},contentContainerStyle:{flexGrow:1,alignItems:'center'},children:(0,j.jsx)(s.default,{accessibilityRole:"toolbar",accessibilityLabel:"Discover search, filters and sort",style:[m.s.row,{flexGrow:1,gap:4}],children:Ye})}),Je]}),Xe&&(0,j.jsx)(s.default,{style:{paddingHorizontal:8,paddingBottom:4,gap:3},children:et}),(0,j.jsx)(p.Popover,{open:ye&&ae,onClose:()=>oe(!1),anchor:he,placement:"top-end",label:"Discover caveat: top averages are partly luck",width:320,children:(0,j.jsx)(m.T,{style:{fontSize:12,lineHeight:18,color:m.C.amber,paddingHorizontal:12,paddingVertical:6},children:R})})]}):(0,j.jsxs)(s.default,{style:{paddingHorizontal:8,paddingTop:6,paddingBottom:3,gap:3,borderBottomWidth:1,borderColor:m.C.line},children:[(0,j.jsx)(s.default,{accessibilityRole:"toolbar",accessibilityLabel:"Discover search, filters and sort",style:[m.s.row,{flexWrap:'wrap',gap:4,rowGap:4}],children:Ye}),et,Ze]});return(0,j.jsxs)(s.default,{accessibilityLabel:"Discover results. Up and down arrow keys change the active stock.",onLayout:fe,
963style:{flex:1,minHeight:0},...(0,y.webOnly)({tabIndex:0,onKeyDown:De}),children:[Y?(0,j.jsxs)(s.default,{style:{padding:10,gap:Y?4:6},children:[(0,j.jsxs)(s.default,{style:[m.s.between,{gap:8,flexWrap:'wrap'}],children:[(0,j.jsxs)(m.T,{style:{fontSize:12,color:F?m.C.amber:m.C.muted,flexShrink:1},children:["Stored market \xb7 ",(0,u.dateText)(A.state?.source_latest)," \xb7 ",(0,h.dataAgeText)(W)]}),!!A.error&&(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"Research refresh failed. Retry",onPress:Ne,style:{minHeight:32,justifyContent:'center'},children:(0,j.jsx)(m.T,{style:{fontSize:12,color:m.C.red},children:le?'Retrying\u2026':'Refresh failed \xb7 Retry'})})]}),(0,j.jsxs)(s.default,{style:[m.s.row,{gap:4}],children:[(0,j.jsx)(i.default,{accessibilityLabel:"Search stocks or patterns",value:te,onChangeText:e=>{se(e),A.setQuery(e)},onSubmitEditing:()=>Fe(te),placeholder:"Stock, pattern or P&L\u2026",placeholderTextColor:m.C.muted,style:[m.s.input,{flex:1,minWidth:0,fontSize:14}]}),(0,j.jsx)(m.Button,{label:"Search",icon:"search",kind:"ghost",onPress:()=>Fe(te),style:{paddingHorizontal:10}})]}),!!te&&(0,j.jsxs)(s.default,{style:{gap:6},children:[!ee&&/pnl|p&l|backtest|profit|simulat/i.test(te)&&(0,j.jsx)(m.Button,{label:"Open historical P&L simulation",kind:"soft",onPress:()=>c.router.push('/simulate')}),ie.slice(0,3).map(e=>(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:`Search ${e.symbol}`,onPress:()=>{(0,u.filterMatches)(A.matches,A.filters,e.symbol).length?Fe(e.symbol):A.setStock(e)},style:{paddingVertical:5},children:(0,j.jsxs)(m.T,{children:[e.symbol," ",(0,j.jsx)(m.T,{style:{fontSize:12,color:m.C.muted},children:e.company})]})},e.symbol))]}),(0,j.jsxs)(s.default,{style:m.s.between,children:[(0,j.jsx)(m.Button,{label:"Filters"+(we?` \xb7 ${we} changed`:''),icon:"sliders",kind:"outline",onPress:()=>A.setFilterOpen(!0),style:{flex:1}}),(0,j.jsx)(m.Button,{label:"Reset",kind:"ghost",onPress:Be})]}),(0,j.jsx)(s.default,{style:[m.s.row,{gap:4,flexWrap:'wrap'}],children:[...Se.length?['Mine']:[],'All',...h.ALL_FRAMES].map(e=>{const t='Mine'===e?'All'===ve.timeframe&&!!ve.frames?.length:'All'===e?'All'===ve.timeframe&&!ve.frames?.length:ve.timeframe===e;return(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityState:{selected:t},accessibilityLabel:'Mine'===e?`My timeframes: ${Se.join(', ')}`:'All'===e?'All timeframes':e,onPress:()=>A.setFilters({...ve,timeframe:'Mine'===e?'All':e,frames:'Mine'===e?Se:[]}),style:{minHeight:Y?36:40,paddingHorizontal:'Mine'===e?8:12,justifyContent:'center',borderRadius:7,backgroundColor:t?m.C.soft:'transparent'},children:(0,j.jsx)(m.T,{style:{color:t?m.C.green:m.C.muted,fontSize:13},children:'Mine'===e?`Mine \xb7 ${Se.join(' ')}`:e})},e)})}),!!ve.patterns?.length&&(0,j.jsx)(m.T,{style:{fontSize:12,color:m.C.green},children:A.state?.patterns?.filter(e=>ve.patterns.includes(e.id)).map(e=>e.name).join(' \xb7 ')}),(0,j.jsxs)(s.default,{style:m.s.between,children:[(0,j.jsxs)(m.T,{style:{fontSize:12,color:m.C.muted},children:[M.length," ",1===M.length?'setup':'setups'," \xb7 ",new Set(M.map(e=>e.symbol)).size," ",1===new Set(M.map(e=>e.symbol)).size?'stock':'stocks']}),(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:'fit'===B?'Sorted by pattern fit. Sort by the 95% lower bound of hold-period average net per trade':'Sorted by the 95% lower bound of hold-period average net per trade. Sort by pattern fit',onPress:()=>U({sort:'fit'===B?'return':'fit'}),style:{minHeight:32,justifyContent:'center'},children:(0,j.jsx)(m.T,{style:{fontSize:12,color:m.C.green},children:'fit'===B?'Pattern fit \u2193':'95% low of avg \u2193'})})]}),(0,j.jsxs)(s.default,{style:m.s.between,children:[(0,j.jsx)(m.Checkbox,{checked:N,disabled:V,onChange:e=>U({positive:e}),label:V?'Positive average only (no per-match average)':'Positive average only',style:{minHeight:32,paddingVertical:6,flexShrink:1}}),q?(0,j.jsx)(s.default,{accessibilityRole:"text",accessibilityLabel:h.NO_HISTORY_SCREEN_NOTE,style:{minHeight:32,justifyContent:'center',opacity:.45},children:(0,j.jsx)(m.T,{style:{fontSize:12,color:m.C.amber},children:h.NO_HISTORY_SCREEN_LABEL})}):(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:ve.minimum>0?`Minimum ${ve.minimum} historical trades is on. Change in Filters`:'Any sample size. Change in Filters',onPress:()=>A.setFilterOpen(!0),style:{minHeight:32,justifyContent:'center'},children:(0,j.jsx)(m.T,{style:{fontSize:12,color:ve.minimum>0?m.C.green:m.C.amber},children:ve.minimum>0?`Min ${ve.minimum} trades \u203a`:'Any sample size \u203a'})})]}),(0,j.jsx)(m.T,{accessibilityRole:"text",style:{fontSize:11,lineHeight:15,color:m.C.amber},children:"Listed from many stock \xd7 pattern results. Top averages are partly luck and usually shrink. Each 95% range covers one result alone and does not correct for comparing many stocks."}),(0,j.jsx)(s.default,{style:[m.s.row,{gap:4,flexWrap:'wrap'}],children:[['all',`All ${I.review+I.history+I.watch+I.pass}`],['review',`For review ${I.review}`],['history',`History only ${I.history}`],['watch',`Watch ${I.watch}`],['pass',`Pass ${I.pass}`]].map(([e,t])=>(0,j.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:`Show ${t}`,accessibilityState:{selected:D===e},onPress:()=>U({verdict:e}),style:{minHeight:Y?32:36,paddingHorizontal:8,justifyContent:'center',borderRadius:7,borderWidth:1,borderColor:D===e?m.C.green:m.C.line,backgroundColor:D===e?m.C.soft:'transparent'},children:(0,j.jsx)(m.T,{style:{fontSize:12,color:D===e?m.C.green:m.C.muted},children:t})},e))})]}):tt,(0,j.jsx)(n.default,{showsVerticalScrollIndicator:!1,getItemLayout:(e,t)=>Ae(t),ref:ce,data:be,keyExtractor:e=>e.id,style:{flex:1,minHeight:0},initialNumToRender:12,keyboardShouldPersistTaps:"handled",onScroll:Ie,scrollEventThrottle:150,onLayout:Ee,renderItem:({item:e})=>
963{if(e.header)return(0,j.jsx)(s.default,{accessibilityRole:"header",style:{height:Z,paddingHorizontal:10,justifyContent:'center',borderBottomWidth:1,borderColor:m.C.line,backgroundColor:m.C.bg},children:(0,j.jsxs)(m.T,{style:{fontSize:12,fontFamily:'InterSemi',color:m.C.amber},children:["Zero or negative average (",O,")"]})});const t=e,i=E.get(t.id)||(0,h.decision)(t,A.filters),n=i.stats,a=Q?.matchId===t.id,o=a&&ke,c=!o&&(a||t.id===Te),d={fontSize:12,lineHeight:Y?16:17,color:m.C.muted},f=`Inspect ${t.symbol} ${t.timeframe} ${t.pattern_name}. ${i.title}. ${(0,u.pct)(n?.display_return_pct)} hold-period average net per trade${n?.expectancy_ci95?`, 95% low ${(0,u.pct)(n.expectancy_ci95[0])}`:''}, ${n?.n||0} trades, ${i.sample.label}. ${(0,h.dataAgeText)(W)}${c?'. Active stock':''}`;return Y?(0,j.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:f,accessibilityState:{selected:o},onPress:()=>We(t),style:{height:X,paddingHorizontal:10,paddingVertical:Y?5:8,gap:Y?1:3,borderLeftWidth:3,borderLeftColor:o?m.C.green:c?m.C.green+'66':'transparent',borderBottomWidth:1,borderBottomColor:m.C.line,backgroundColor:o?m.C.soft:'transparent'},children:[(0,j.jsxs)(s.default,{style:m.s.between,children:[(0,j.jsxs)(s.default,{style:[m.s.row,{gap:6,flex:1,minWidth:0}],children:[(0,j.jsx)(m.T,{style:{fontFamily:'InterSemi',fontSize:Y?14:15},children:t.symbol}),(0,j.jsx)(m.Badge,{label:i.title,tone:C(i.verdict)}),c&&(0,j.jsx)(m.T,{style:{fontSize:10,lineHeight:14,color:m.C.green,opacity:.75},children:"active"})]}),(0,j.jsxs)(m.T,{style:{fontSize:13,color:(n?.expectancy_pct||0)>0?m.C.green:m.C.muted},children:[(0,j.jsx)(m.T,{style:{fontSize:10,color:m.C.muted},children:"hold-period avg "}),(0,u.pct)(n?.display_return_pct)]})]}),(0,j.jsxs)(m.T,{numberOfLines:1,style:d,children:[t.pattern_name," \xb7 ",t.timeframe," \xb7 ",(0,j.jsx)(m.T,{style:{...d,color:F?m.C.amber:m.C.muted},children:(0,h.dataAgeText)(W)})]}),(0,j.jsxs)(s.default,{style:[m.s.row,{gap:6}],children:[(0,j.jsxs)(m.T,{numberOfLines:1,style:{...d,flexShrink:1},children:[n?.n||0," trades \xb7 ",n?.expectancy_ci95?`95% low ${(0,u.pct)(n.expectancy_ci95[0])} \xb7 `:'',n?.holding?.duration||'Hold unavailable']}),(0,j.jsx)(m.Badge,{label:i.sample.label,tone:i.sample.tone})]})]}):(0,j.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:f,accessibilityState:{selected:o},onPress:()=>We(t),style:{height:X,paddingHorizontal:10,justifyContent:'center',gap:1,borderLeftWidth:3,borderLeftColor:o?m.C.green:c?m.C.green+'66':'transparent',borderBottomWidth:1,borderBottomColor:m.C.line,backgroundColor:o?m.C.soft:'transparent'},children:[(0,j.jsxs)(s.default,{style:[m.s.row,{gap:6,minWidth:0}],children:[(0,j.jsx)(m.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:13,lineHeight:18,flexShrink:0},children:t.symbol}),(0,j.jsx)(s.default,{style:{flexShrink:0,borderRadius:4,paddingHorizontal:5,backgroundColor:k(C(i.verdict))},children:(0,j.jsx)(m.T,{style:{fontSize:10,lineHeight:16,color:w(C(i.verdict))},children:i.title})}),c&&(0,j.jsx)(m.T,{style:{fontSize:10,lineHeight:14,color:m.C.green,opacity:.75,flexShrink:0},children:"active"}),(0,j.jsxs)(m.T,{numberOfLines:1,style:{flex:1,minWidth:0,fontSize:12,lineHeight:18,color:m.C.muted,textAlign:'right'},children:[(0,j.jsx)(m.T,{style:{fontSize:10,color:m.C.muted},children:"hold-period avg "}),(0,j.jsx)(m.T,{style:{fontSize:12,color:(n?.expectancy_pct||0)>0?m.C.green:m.C.muted},children:(0,u.pct)(n?.display_return_pct)}),n?.expectancy_ci95?` \xb7 95% low ${(0,u.pct)(n.expectancy_ci95[0])}`:''," \xb7 n ",n?.n||0," \xb7 ",(0,j.jsx)(m.T,{style:{fontSize:11,color:w(i.sample.tone)},children:i.sample.label})]})]}),(0,j.jsxs)(m.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:m.C.muted},children:[t.pattern_name," \xb7 ",t.timeframe," \xb7 ",(0,j.jsx)(m.T,{style:{fontSize:11,color:F?m.C.amber:m.C.muted},children:(0,h.dataAgeText)(W)})," \xb7 ",n?.holding?.duration||'Hold unavailable']})]})},ListEmptyComponent:null!=J?(0,j.jsx)(s.default,{style:{padding:Y?12:10},children:(0,j.jsx)(b.ComingSoonPanel,{message:J,compact:!0})}):A.error?(0,j.jsxs)(s.default,{style:{padding:20,gap:15},children:[(0,j.jsx)(m.T,{children:"Research couldn\u2019t refresh."}),(0,j.jsx)(m.T,{style:m.s.muted,children:A.error}),(0,j.jsx)(m.Button,{label:"Retry",loading:le,onPress:Ne})]}):(0,j.jsxs)(s.default,{style:{padding:20,gap:15},children:[(0,j.jsx)(m.T,{children:"No setups match these filters."}),(0,j.jsxs)(m.T,{style:m.s.muted,children:[[K.minimum>0?`Minimum ${K.minimum} trades`:'',N?'positive average only':'','all'!==D?(st=D,'review'===st?'For review':'history'===st?'History only':'watch'===st?'Watch':'Pass')+" only":''].filter(
963Boolean).join(' \xb7 ')||'Try another pattern or clear your search.',". Change them in Filters, or reset to the safe defaults."]}),(0,j.jsx)(m.Button,{label:"Reset to defaults",onPress:Be})]})})]});var st};var t=r(_d[0]),s=e(r(_d[1])),i=e(r(_d[2])),l=e(r(_d[3])),n=e(r(_d[4])),a=e(r(_d[5])),o=e(r(_d[6])),c=r(_d[7]),d=r(_d[8]),m=r(_d[9]),u=r(_d[10]),h=r(_d[11]),f=r(_d[12]),y=r(_d[13]),p=r(_d[14]),b=r(_d[15]),x=r(_d[16]),j=r(_d[17]);const C=e=>'review'===e?'green':'watch'===e?'amber':'neutral',S={dock:30,sheet:40},v={dock:46,sheet:74},w=e=>'green'===e?m.C.green:'amber'===e?m.C.amber:'red'===e?m.C.red:m.C.muted,k=e=>'amber'===e?m.C.amberBg:'neutral'===e?m.C.bg:m.C.soft,T='Top averages are partly luck: listed from many stock \xd7 pattern results.',R='Listed from many stock \xd7 pattern results. Top averages are partly luck and usually shrink. Each 95% range covers one result alone and does not correct for comparing many stocks.',z=230,L='Top averages partly luck',H=['discover','nav','url','restore'];function P(e,t){const s=e=>e.d.stats?.expectancy_pct,i=e=>e.d.stats?.expectancy_ci95?.[0],l=e=>(s(e)??0)>0,n=(e,l)=>'fit'===t?l.m.score-e.m.score:(i(l)??-1/0)-(i(e)??-1/0)||(s(l)??-1/0)-(s(e)??-1/0)||0;return{good:e.filter(l).sort(n),bad:e.filter(e=>!l(e)).sort(n)}}function _(){const e=(0,d.useProduct)(),s={...d.initialWorkspace,...e.workspace},i=s.sort,l=s.verdict,n='research'===e.state?.pattern_set,a=s.positive&&!n,o=(0,h.historyScreenOff)(e.state?.pattern_set),c=(0,t.useMemo)(()=>(0,h.appliedFilters)(e.filters,o),[e.filters,o]),m=e.setWorkspace,f=(0,t.useCallback)(e=>m(t=>({...t,...e})),[m]),y=(0,h.dataAgeDays)(e.state?.source_latest),p=(0,h.isStale)(y,e.state?.source_stale),b=(0,t.useMemo)(()=>(0,u.filterMatches)(e.matches,c,e.query).filter(e=>(0,h.frameMatch)(e,c)).map(e=>({m:e,d:(0,h.decision)(e,c)})),[e.matches,c,e.query]);return{...(0,t.useMemo)(()=>{const e=a?b.filter(e=>(e.d.stats?.expectancy_pct??0)>0):b,t={review:0,history:0,watch:0,pass:0};e.forEach(e=>t[e.d.verdict]++);const s=e.filter(e=>'all'===l||e.d.verdict===l),{good:o,bad:c}=P(s,i);return{rows:[...o,...c].map(e=>e.m),losers:n?0:c.length,counts:t,decisions:new Map(s.map(e=>[e.m.id,e.d]))}},[b,a,i,l,n]),age:y,stale:p,sort:i,positive:a,verdict:l,setWs:f,noAverages:n,noHistoryScreen:o,applied:c}}function A(e,t,s){return(s?e.history.find(e=>e.side===s):void 0)||(0,u.histories)(e,t)[0]||e.history[0]}function $({rows:e,symbol:t,timeframe:s,side:i}){const l=e.filter(e=>e.symbol===t&&e.timeframe===s);if(l.length)return(i?l.find(e=>e.history.some(e=>e.side===i)):void 0)||l[0]}function M({rows:e,matches:t,filters:s,sort:i,symbol:l,timeframe:n}){const a=new Set(e.map(e=>e.id)),o=(t||[]).filter(e=>e.symbol===l&&e.timeframe===n&&!a.has(e.id)).map(e=>({m:e,d:(0,h.decision)(e,s)})),{good:c,bad:d}=P(o,i);return[...c,...d].map(e=>e.m)}},870,[11,13,385,375,270,278,400,252,196,821,197,248,251,869,871,883,884,6]); 964__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"Dock",{enumerable:!0,get:function(){return t.Dock}}),Object.defineProperty(e,"DOCK_TAB_BAR",{enumerable:!0,get:function(){return t.DOCK_TAB_BAR}}),Object.defineProperty(e,"DOCK_HANDLE",{enumerable:!0,get:function(){return t.DOCK_HANDLE}}),Object.defineProperty(e,"DOCK_DEFAULT_HEIGHT",{enumerable:!0,get:function(){return t.DOCK_DEFAULT_HEIGHT}}),Object.defineProperty(e,"PanelVisible",{enumerable:!0,get:function(){return t.PanelVisible}}),Object.defineProperty(e,"usePanelVisible",{enumerable:!0,get:function(){return t.usePanelVisible}}),Object.defineProperty(e,"Sidebar",{enumerable:!0,get:function(){return n.Sidebar}}),Object.defineProperty(e,"SIDEBAR_DEFAULT_WIDTH",{enumerable:!0,get:function(){return n.SIDEBAR_DEFAULT_WIDTH}}),Object.defineProperty(e,"Widget",{enumerable:!0,get:function(){return u.Widget}}),Object.defineProperty(e,"WidgetError",{enumerable:!0,get:function(){return u.WidgetError}}),Object.defineProperty(e,"Popover",{enumerable:!0,get:function(){return o.Popover}}),Object.defineProperty(e,"MenuList",{enumerable:!0,get:function(){return o.MenuList}}),Object.defineProperty(e,"useDismiss",{enumerable:!0,get:function(){return o.useDismiss}}),Object.defineProperty(e,"BottomSheet",{enumerable:!0,get:function(){return f.BottomSheet}}),Object.defineProperty(e,"SHEET_SNAPS",{enumerable:!0,get:function(){return f.SHEET_SNAPS}}),Object.defineProperty(e,"TopBar",{enumerable:!0,get:function(){return c.TopBar}}),Object.defineProperty(e,"DataAgePill",{enumerable:!0,get:function(){return c.DataAgePill}}),Object.defineProperty(e,"dataAgeDays",{enumerable:!0,get:function(){return c.dataAgeDays}}),Object.defineProperty(e,"dataAgeTone",{enumerable:!0,get:function(){return c.dataAgeTone}}),Object.defineProperty(e,"formatDataDate",{enumerable:!0,get:function(){return c.formatDataDate}}),Object.defineProperty(e,"DataStatusPanel",{enumerable:!0,get:function(){return b.DataStatusPanel}}),Object.defineProperty(e,"DataStatusPopover",{enumerable:!0,get:function(){return b.DataStatusPopover}}),Object.defineProperty(e,"FNO_POLL_MS",{enumerable:!0,get:function(){return l.FNO_POLL_MS}}),Object.defineProperty(e,"FNO_SEPARATE_TEXT",{enumerable:!0,get:function(){return l.FNO_SEPARATE_TEXT}}),Object.defineProperty(e,"fnoCaptureView",{enumerable:!0,get:function(){return l.fnoCaptureView}}),Object.defineProperty(e,"useFnoCapture",{enumerable:!0,get:function(){return l.useFnoCapture}}),Object.defineProperty(e,"resetFnoCapture",{enumerable:!0,get:function(){return l.resetFnoCapture}}),Object.defineProperty(e,"dataStatusView",{enumerable:!0,get:function(){return O.dataStatusView}}),Object.defineProperty(e,"dataStatusTone",{enumerable:!0,get:function(){return O.dataStatusTone}}),Object.defineProperty(e,"pillContent",{enumerable:!0,get:function(){return O.pillContent}}),Object.defineProperty(e,"connectionView",{enumerable:!0,get:function(){return O.connectionView}}),Object.defineProperty(e,"RECONNECT_GRACE_SECONDS",{enumerable:!0,get:function(){return O.RECONNECT_GRACE_SECONDS}}),Object.defineProperty(e,"barLagSeconds",{enumerable:!0,get:function(){return O.barLagSeconds}}),Object.defineProperty(e,"formatIst",{enumerable:!0,get:function(){return O.formatIst}}),Object.defineProperty(e,"agoText",{enumerable:!0,get:function(){return O.agoText}}),Object.defineProperty(e,"inText",{enumerable:!0,get:function(){return O.inText}}),Object.defineProperty(e,"istMs",{enumerable:!0,get:function(){return O.istMs}}),Object.defineProperty(e,"pageNotDeployed",{enumerable:!0,get:function(){return P.pageNotDeployed}}),Object.defineProperty(e,"asList",{enumerable:!0,get:function(){return P.asList}}),Object.defineProperty(e,"refusedNotDeployed",{enumerable:!0,get:function(){return P.refusedNotDeployed}}),Object.defineProperty(e,"studiesOff",{enumerable:!0,get:function(){return P.studiesOff}}),Object.defineProperty(e,"studiesOffFor",{enumerable:!0,get:function(){return P.studiesOffFor}}),Object.defineProperty(e,"NOT_AVAILABLE_CODE",{enumerable:!0,get:function(){return P.NOT_AVAILABLE_CODE}}),Object.defineProperty(e,"STUDIES_OFF_TEXT",{enumerable:!0,get:function(){return P.
964STUDIES_OFF_TEXT}}),Object.defineProperty(e,"researchInfo",{enumerable:!0,get:function(){return P.researchInfo}}),Object.defineProperty(e,"isNotDeployed",{enumerable:!0,get:function(){return P.isNotDeployed}}),Object.defineProperty(e,"notDeployedMessage",{enumerable:!0,get:function(){return P.notDeployedMessage}}),Object.defineProperty(e,"comingSoonView",{enumerable:!0,get:function(){return P.comingSoonView}}),Object.defineProperty(e,"featureAbsentHeadline",{enumerable:!0,get:function(){return P.featureAbsentHeadline}}),Object.defineProperty(e,"FEATURE_ABSENT_HEADLINES",{enumerable:!0,get:function(){return P.FEATURE_ABSENT_HEADLINES}}),Object.defineProperty(e,"navTag",{enumerable:!0,get:function(){return P.navTag}}),Object.defineProperty(e,"notDeployedPill",{enumerable:!0,get:function(){return P.notDeployedPill}}),Object.defineProperty(e,"shouldPollScanner",{enumerable:!0,get:function(){return P.shouldPollScanner}}),Object.defineProperty(e,"showsOutage",{enumerable:!0,get:function(){return P.showsOutage}}),Object.defineProperty(e,"statusPollMs",{enumerable:!0,get:function(){return P.statusPollMs}}),Object.defineProperty(e,"pollDue",{enumerable:!0,get:function(){return P.pollDue}}),Object.defineProperty(e,"NOT_DEPLOYED_CODE",{enumerable:!0,get:function(){return P.NOT_DEPLOYED_CODE}}),Object.defineProperty(e,"NOT_DEPLOYED_FALLBACK",{enumerable:!0,get:function(){return P.NOT_DEPLOYED_FALLBACK}}),Object.defineProperty(e,"NOT_DEPLOYED_POLL_MS",{enumerable:!0,get:function(){return P.NOT_DEPLOYED_POLL_MS}}),Object.defineProperty(e,"RESEARCH_POLL_MS",{enumerable:!0,get:function(){return P.RESEARCH_POLL_MS}}),Object.defineProperty(e,"COMING_SOON_HEADLINE",{enumerable:!0,get:function(){return P.COMING_SOON_HEADLINE}}),Object.defineProperty(e,"STRATEGY_BUILDER_LABEL",{enumerable:!0,get:function(){return P.STRATEGY_BUILDER_LABEL}}),Object.defineProperty(e,"STRATEGY_BUILDER_ROUTE",{enumerable:!0,get:function(){return P.STRATEGY_BUILDER_ROUTE}}),Object.defineProperty(e,"ToolRail",{enumerable:!0,get:function(){return p.ToolRail}}),Object.defineProperty(e,"IconButton",{enumerable:!0,get:function(){return s.IconButton}}),Object.defineProperty(e,"useDragResize",{enumerable:!0,get:function(){return s.useDragResize}}),Object.defineProperty(e,"useTitle",{enumerable:!0,get:function(){return s.useTitle}}),Object.defineProperty(e,"useRoving",{enumerable:!0,get:function(){return s.useRoving}}),Object.defineProperty(e,"readStore",{enumerable:!0,get:function(){return s.readStore}}),Object.defineProperty(e,"writeStore",{enumerable:!0,get:function(){return s.writeStore}}),Object.defineProperty(e,"storeKey",{enumerable:!0,get:function(){return s.storeKey}});var t=r(d[0]),n=r(d[1]),u=r(d[2]),o=r(d[3]),f=r(d[4]),c=r(d[5]),b=r(d[6]),l=r(d[7]),O=r(d[8]),P=r(d[9]),p=r(d[10]),s=r(d[11])},871,[872,873,874,875,877,878,882,880,879,820,876,869]); 965__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DOCK_TAB_BAR",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"DOCK_HANDLE",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"DOCK_DEFAULT_HEIGHT",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"PanelVisible",{enumerable:!0,get:function(){return C}}),_e.usePanelVisible=function(){return t.default.useContext(C)},_e.Dock=function(e){const{tabs:C,active:S,onChange:v,minHeight:k=120,fullScreen:D=!1,onToggleFullScreen:z,onToggleCollapsed:$,rightSlot:w,persistKey:H,label:R="Dock",restoreActive:P=!0}=e,{height:O}=(0,s.default)(),E='phone'===(0,c.useLayoutMode)(),_=Math.max(k,Math.round(e.maxHeight??.85*O)),[T]=t.default.useState(()=>(0,u.readStore)('dock',H)),[F,K]=t.default.useState(()=>!0===T.userSized&&'number'==typeof T.height),L=t.default.useRef(F);L.current=F;const[A,B]=t.default.useState(()=>F&&'number'==typeof T.height?(0,u.clamp)(T.height,k,_):e.height??x),M=t.default.useRef(e.height);t.default.useEffect(()=>{null==e.height||e.height===M.current||L.current||B(e.height),M.current=e.height},[e.height]);const V=(0,u.clamp)(A,k,_),W=null!=e.collapsed,[G,N]=t.default.useState(()=>'boolean'==typeof T.collapsed?T.collapsed:!!e.collapsed),U=W?!!e.collapsed:G,q=t.default.useCallback(()=>{W||N(e=>!e),$?.()},[W,$]),J=t.default.useRef(!1);t.default.useEffect(()=>{J.current||(J.current=!0,P&&'string'==typeof T.active&&T.active!==S&&C.some(e=>e.key===T.active)&&v(T.active),W&&'boolean'==typeof T.collapsed&&T.collapsed!==!!e.collapsed&&$?.())},[]),t.default.useEffect(()=>{J.current&&(0,u.writeStore)('dock',H,{height:A,active:S,collapsed:U,userSized:F})},[H,A,S,U,F]);const Q=t.default.useRef(new Set).current;Q.add(S);const X=(0,u.domId)(t.default.useId()),Y=`${X}-body`,Z=(0,u.useRoving)(C.length,'horizontal'),ee=(0,u.useDragResize)({axis:'y',value:V,min:k,max:_,label:`Resize ${R}`,onCommit:t=>{B(t),K(!0),e.onResize?.(t)},onEnter:q}),te=D||!U,ne=te&&!D&&!E,le=O<650&&!E;return(0,h.jsxs)(n.default,{role:"region","aria-label":R,style:[{backgroundColor:c.C.bg,borderTopWidth:1,borderColor:c.C.line},D?{flex:1,minHeight:0}:{height:te?V:45}],children:[ne&&(0,h.jsx)(i.default.View,{"aria-hidden":!0,style:ee.ghostStyle}),ne&&(0,h.jsx)(n.default,{...ee.handleProps,style:[{height:y,alignItems:'center',justifyContent:'center'},ee.handleStyle],children:(0,h.jsx)(n.default,{style:{width:44,height:4,borderRadius:2,backgroundColor:c.C.line}})}),(0,h.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',minHeight:p,borderBottomWidth:te?1:0,borderColor:c.C.line,paddingRight:4},children:[(0,h.jsx)(o.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:{flex:1},contentContainerStyle:{flexGrow:1},children:(0,h.jsx)(n.default,{role:"tablist","aria-label":`${R} tabs`,style:{flexDirection:'row'},children:C.map((e,t)=>
965(0,h.jsx)(I,{tab:e,on:e.key===S,tabId:`${X}-tab-${(0,u.domId)(e.key)}`,panelId:`${X}-panel-${(0,u.domId)(e.key)}`,compact:E,onPress:()=>{return(t=e.key)!==S&&v(t),void(U&&!D&&q());var t},onKeyDown:e=>Z.onKeyDown(t,e,e=>v(C[e].key)),setRef:e=>{Z.refs.current[t]=e}},e.key))})}),(0,h.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:2,paddingLeft:6},children:[w,!!z&&le&&(0,h.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:D?`Exit full screen ${R}`:`Open ${R} full screen`,accessibilityState:{selected:D},...(0,u.webOnly)({'aria-pressed':D}),onPress:z,hitSlop:b,style:e=>[{minHeight:32,flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:10,marginRight:2,borderRadius:8,borderWidth:1,borderColor:D?c.C.green:c.C.line,backgroundColor:D||e.hovered||e.focused?c.C.soft:'transparent',opacity:e.pressed?.7:1}],children:[(0,h.jsx)(f.HitArea,{slop:b}),(0,h.jsx)(c.Icon,{name:D?'minimize-2':'maximize-2',size:14,color:c.C.green}),(0,h.jsx)(c.T,{numberOfLines:1,style:{fontSize:12,fontFamily:'InterSemi',color:c.C.green},children:D?'Exit full screen':'Full screen'})]}),!!z&&!le&&(0,h.jsx)(u.IconButton,{icon:D?'minimize-2':'maximize-2',label:D?`Exit full screen ${R}`:`Open ${R} full screen`,tooltip:D?'Exit full screen':'Full screen',pressed:D,onPress:z}),!D&&(0,h.jsx)(u.IconButton,{icon:U?'chevron-up':'chevron-down',label:U?`Expand ${R}`:`Collapse ${R} to tab bar`,tooltip:U?'Expand':'Collapse to tab bar',expanded:!U,controls:Y,onPress:q})]})]}),(0,h.jsx)(n.default,{nativeID:Y,style:{flex:1,minHeight:0,display:te?'flex':'none'},children:C.filter(e=>Q.has(e.key)).map(e=>(0,h.jsx)(j,{id:`${X}-panel-${(0,u.domId)(e.key)}`,tabId:`${X}-tab-${(0,u.domId)(e.key)}`,visible:e.key===S&&te,render:e.render},e.key))})]})};var t=e(r(d[0])),n=e(r(d[1])),l=e(r(d[2])),o=e(r(d[3])),i=e(r(d[4])),s=e(r(d[5])),c=r(d[6]),u=r(d[7]),f=r(d[8]),h=r(d[9]);const b=(0,f.touchSlop)(32),p=44,y=10,x=300,C=t.default.createContext(!0);const j=t.default.memo(function({id:e,tabId:t,visible:l,render:o}){return(0,h.jsx)(n.default,{role:"tabpanel",nativeID:e,"aria-labelledby":t,"aria-hidden":!l,importantForAccessibility:l?'auto':'no-hide-descendants',style:{flex:1,minHeight:0,display:l?'flex':'none'},children:(0,h.jsx)(C.Provider,{value:l,children:o()})})});function I({tab:e,on:t,tabId:o,panelId:i,compact:s,onPress:f,onKeyDown:b,setRef:y}){return(0,h.jsxs)(l.default,{ref:y,role:"tab",nativeID:o,"aria-selected":t,accessibilityState:{selected:t},accessibilityLabel:e.badge?`${e.label}, ${e.badge}`:e.label,...(0,u.webOnly)({'aria-controls':i,tabIndex:t?0:-1,onKeyDown:b}),onPress:f,style:e=>[{minHeight:p,flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:s?11:15,borderBottomWidth:2,borderBottomColor:t?c.C.green:'transparent',backgroundColor:t||!e.hovered&&!e.focused?'transparent':c.C.paper,opacity:e.pressed?.7:1}],children:[(0,h.jsx)(c.T,{numberOfLines:1,style:{fontSize:13,fontFamily:'InterSemi',color:t?c.C.ink:c.C.muted},children:e.label}),!!e.badge&&(0,h.jsx)(n.default,{style:{backgroundColor:t?c.C.soft:c.C.paper,borderRadius:6,paddingHorizontal:6,paddingVertical:1},children:(0,h.jsx)(c.T,{style:{fontSize:10,lineHeight:15,fontFamily:'InterSemi',color:c.C.green},children:e.badge})})]})}},872,[11,13,375,278,267,400,821,869,832,6]); 966__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SIDEBAR_DEFAULT_WIDTH",{enumerable:!0,get:function(){return b}}),_e.Sidebar=function({widgets:e,railItems:h,minWidth:w=240,maxWidth:y=520,onResize:j,onToggleCollapsed:C,persistKey:S,label:I="Sidebar",layout:R,...z}){const{width:v}=(0,s.default)(),M='phone'===(0,u.useLayoutMode)(),D='cards'===(R??(M?'cards':'column')),[E]=t.default.useState(()=>(0,c.readStore)('sidebar',S)),[_,T]=t.default.useState(()=>'number'==typeof E.width?E.width:z.width??b),W=t.default.useRef(z.width);t.default.useEffect(()=>{null!=z.width&&z.width!==W.current&&T(z.width),W.current=z.width},[z.width]);const $=null!=z.collapsed,[k,H]=t.default.useState(()=>'boolean'==typeof E.collapsed?E.collapsed:!!z.collapsed),L=$?!!z.collapsed:k,P=t.default.useCallback(()=>{$||H(e=>!e),C?.()},[$,C]),A=t.default.useRef(!1);t.default.useEffect(()=>{A.current||(A.current=!0,$&&'boolean'==typeof E.collapsed&&E.collapsed!==!!z.collapsed&&C?.())},[]),t.default.useEffect(()=>{A.current&&(0,c.writeStore)('sidebar',S,{width:_,collapsed:L})},[S,_,L]);const B=Math.max(w,Math.min(y,v-360)),O=(0,c.clamp)(_,w,B),V=`${(0,c.domId)(t.default.useId())}-widgets`,F=(0,c.useDragResize)({axis:'x',value:O,min:w,max:B,label:`Resize ${I}`,onCommit:e=>{T(e),j?.(e)},onEnter:P}),K=(0,p.jsx)(u.T,{style:{fontSize:12,color:u.C.muted,padding:12},children:"No widgets open. Add one from the rail."});if(D){const t=Math.max(220,Math.min(v-48,340));return(0,p.jsxs)(l.default,{role:"complementary","aria-label":I,style:{gap:8},children:[h.length>0&&(0,p.jsx)(f.ToolRail,{items:h,label:`${I} widgets`,orientation:"horizontal"}),e.length?(0,p.jsx)(o.default,{nativeID:V,horizontal:!0,showsHorizontalScrollIndicator:!1,snapToInterval:t+10,decelerationRate:"fast",contentContainerStyle:{paddingHorizontal:12,gap:10},children:e.map(e=>(0,p.jsx)(l.default,{style:{width:t},children:(0,p.jsx)(x,{wd:e})},e.key))}):K]})}const N=(0,p.jsx)(c.IconButton,{icon:L?'chevrons-left':'chevrons-right',label:L?`Expand ${I}`:`Collapse ${I}`,tooltip:L?'Expand sidebar':'Collapse sidebar',expanded:!L,controls:V,onPress:P});return(0,p.jsxs)(l.default,{role:"complementary","aria-label":I,style:{flexDirection:'row',height:'100%',minHeight:0,backgroundColor:u.C.bg,borderLeftWidth:1,borderColor:u.C.line},children:[!L&&(0,p.jsxs)(l.default,{style:{flexDirection:'row',minHeight:0},children:[(0,p.jsx)(n.default.View,{"aria-hidden":!0,style:F.ghostStyle}),(0,p.jsx)(l.default,{...F.handleProps,style:[{width:8,alignItems:'center',justifyContent:'center'},F.handleStyle],children:(0,p.jsx)(l.default,{style:{width:3,height:36,borderRadius:2,backgroundColor:u.C.line}})}),(0,p.jsx)(o.default,{nativeID:V,style:{width:O},contentContainerStyle:{paddingVertical:10,paddingRight:10,gap:10},children:e.length?e.map(e=>(0,p.jsx)(x,{wd:e},e.key)):K})]}),(0,p.jsx)(f.ToolRail,{items:h,label:`${I} widgets`,orientation:"vertical",header:N,style:{borderLeftWidth:1,borderColor:u.C.line}})]})};var t=e(r(d[0])),l=e(r(d[1])),o=e(r(d[2])),n=e(r(d[3])),s=e(r(d[4])),u=r(d[5]),c=r(d[6]),h=r(d[7]),f=r(d[8]),p=r(d[9]);const b=320,x=t.default.memo(function({wd:e}){return(0,p.jsx)(h.Widget,{title:e.title,subtitle:e.subtitle,menu:e.menu,onMaximize:e.onMaximize,onClose:e.onClose,errorState:e.errorState,children:e.render()})})},873,[11,13,278,267,400,821,869,874,876,6]); 967__d(function(g,r,i,a,m,_e,d){"use strict";
967function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.WidgetError=b,_e.Widget=function({title:e,subtitle:o,onMaximize:n,maximized:f=!1,onClose:p,menu:x,children:y,errorState:j,emptyText:C="Nothing to show yet.",style:S,bodyStyle:z}){const[v,w]=t.default.useState(!1),P=t.default.useRef(null),R=t.default.useId(),I=!!x?.length,L=t.default.useCallback(()=>w(!1),[]);return(0,h.jsxs)(l.default,{role:"region","aria-labelledby":R,style:[{backgroundColor:s.C.paper,borderWidth:1,borderColor:s.C.line,borderRadius:12,overflow:'hidden'},S],children:[(0,h.jsxs)(l.default,{style:[s.s.row,{paddingLeft:12,paddingRight:2,minHeight:42,borderBottomWidth:1,borderColor:s.C.line,gap:4}],children:[(0,h.jsxs)(l.default,{style:{flex:1,minWidth:0},children:[(0,h.jsx)(s.T,{nativeID:R,role:"heading","aria-level":3,numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:11,lineHeight:16,letterSpacing:1,textTransform:'uppercase'},children:e}),!!o&&(0,h.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:s.C.muted},children:o})]}),I&&(0,h.jsx)(c.IconButton,{ref:P,icon:"more-vertical",label:`${e} options`,tooltip:"Options",haspopup:"menu",expanded:v,onPress:()=>w(e=>!e)}),!!n&&(0,h.jsx)(c.IconButton,{icon:f?'minimize-2':'maximize-2',label:`${f?'Restore':'Maximize'} ${e}`,tooltip:f?'Restore':'Maximize',pressed:f,onPress:n}),!!p&&(0,h.jsx)(c.IconButton,{icon:"x",label:`Close ${e}`,tooltip:"Close",onPress:p})]}),(0,h.jsx)(l.default,{style:[{padding:12,gap:10},z],children:j?(0,h.jsx)(b,{...j}):null==y||!1===y?(0,h.jsx)(s.T,{style:{fontSize:12,color:s.C.muted},children:C}):y}),I&&(0,h.jsx)(u.Popover,{open:v,onClose:L,anchor:P,placement:"bottom-end",label:`${e} options`,role:"none",width:220,children:(0,h.jsx)(u.MenuList,{items:x,onClose:L,label:`${e} options`})})]})};var t=e(r(d[0])),l=e(r(d[1])),o=e(r(d[2])),n=e(r(d[3])),s=r(d[4]),c=r(d[5]),u=r(d[6]),f=r(d[7]),h=r(d[8]);const p=(0,f.touchSlop)(36);function b({message:e,onRetry:t,statusLink:u,title:b="Could not load"}){const x='string'==typeof u?{label:'Service status',href:u}:u,y=c.web&&!!x?.href&&!x?.onPress;return(0,h.jsxs)(l.default,{role:"alert",style:{gap:10,padding:12,borderRadius:10,backgroundColor:s.C.amberBg,borderWidth:1,borderColor:s.C.amberLine},children:[(0,h.jsxs)(l.default,{style:[s.s.row,{alignItems:'flex-start',gap:8}],children:[(0,h.jsx)(s.Icon,{name:"alert-triangle",size:16,color:s.C.amber}),(0,h.jsxs)(l.default,{style:{flex:1,gap:2},children:[(0,h.jsx)(s.T,{style:{fontFamily:'InterSemi',fontSize:13,color:s.C.amber},children:b}),(0,h.jsx)(s.T,{style:{fontSize:12,lineHeight:18},children:e})]})]}),(!!t||!!x)&&(0,h.jsxs)(l.default,{style:[s.s.row,{flexWrap:'wrap',gap:12}],children:[!!t&&(0,h.jsx)(s.Button,{label:"Retry",icon:"refresh-cw",kind:"outline",onPress:t,style:{minHeight:36,paddingVertical:6}}),!!x&&(0,h.jsxs)(o.default,{accessibilityRole:"link",accessibilityLabel:x.label||'Service status',...(0,c.webOnly)(y?{href:x.href,hrefAttrs:{target:'_blank',rel:'noopener noreferrer'}}:{}),onPress:y?void 0:()=>{x?.onPress?x.onPress():x?.href&&n.default.openURL(x.href).catch(()=>{})},hitSlop:p,style:{minHeight:36,justifyContent:'center'},children:[(0,h.jsx)(f.HitArea,{slop:p}),(0,h.jsx)(s.T,{style:{fontSize:12,color:s.C.green,textDecorationLine:'underline'},children:x.label||'Service status'})]})]})]})}},874,[11,13,375,199,821,869,875,832,6]); 968__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.useDismiss=h,_e.Popover=function({open:e,onClose:c,anchor:f,children:b,placement:y="bottom-start",label:m,width:v=240,routeKey:x,role:C="dialog"}){const{width:E,height:R}=(0,r.default)();h(e,c,{routeKey:x});const[L,j]=t.default.useState(null),[M,k]=t.default.useState(null),K=w(f)?f:null,P=w(f)?null:f,O=P?.x,_=P?.y,I=P?.width??0,T=P?.height??0;t.default.useEffect(()=>{if(e)if(K){const e=K.current;if(!e)return void j(null);if(a.web&&'function'==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect();j({x:t.left,y:t.top,width:t.width,height:t.height})}else'function'==typeof e.measureInWindow?e.measureInWindow((e,t,n,o)=>j({x:e,y:t,width:n,height:o})):j(null)}else j(null==O||null==_?null:{x:O,y:_,width:I,height:T});else k(null)},[e,K,O,_,I,T,E,R]);const D=t.default.useRef(e);if(t.default.useEffect(()=>{D.current&&!e&&a.web&&K&&K.current?.focus?.(),D.current=e},[e]),!e)return null;const S=M?.w??v,W=M?.h??0;let z=(E-S)/2,B=R/3,F=R-16;if(L){const[e,t]=y.split('-');if('bottom'===e||'top'===e){z='end'===t?L.x+L.width-S:L.x;const n=L.y+L.height+6,o=R-8-n,i=L.y-6-8,s='bottom'===e?W>=o-1&&i>=o*p:!(W>=i-1&&o>=i*p);F=Math.max(96,s?i:o),B=s?L.y-6-Math.min(W,F):n}else{B=L.y;const t=L.x+L.width+6,n=L.x-S-6;z='right'===e?t+S>E-8&&n>=8?n:t:n<8?t:n}}return z=(0,a.clamp)(z,8,Math.max(8,E-S-8)),B=(0,a.clamp)(B,8,Math.max(8,R-W-8)),(0,u.jsx)(i.default,{visible:!0,transparent:!0,animationType:"none",onRequestClose:c,statusBarTranslucent:!0,children:(0,u.jsxs)(n.default,{style:s.default.absoluteFill,children:[(0,u.jsx)(o.default,{"aria-hidden":!0,accessible:!1,importantForAccessibility:"no-hide-descendants",focusable:!1,onPress:c,style:s.default.absoluteFill}),(0,u.jsx)(n.default,{role:C,"aria-label":'none'===C?void 0:m,accessibilityViewIsModal:!0,onLayout:e=>{const{width:t,height:n}=e.nativeEvent.layout;(!M||Math.abs(M.w-t)>1||Math.abs(M.h-n)>1)&&k({w:t,h:n})},style:{position:'absolute',left:z,top:B,opacity:M?1:0,width:v,maxWidth:E-16,maxHeight:F,backgroundColor:l.C.paper,borderWidth:1,borderColor:l.C.line,borderRadius:12,paddingVertical:6,overflow:'hidden',shadowColor:l.C.shadow,shadowOpacity:.45,shadowRadius:18,shadowOffset:{width:0,height:8},elevation:12},children:b})]})})},_e.MenuList=function({items:e,onClose:i,label:s}){const r=(0,a.useRoving)(e.length,'vertical');return t.default.useEffect(()=>{if(!a.web)return;const e=setTimeout(()=>
968r.refs.current[0]?.focus?.(),0);return()=>clearTimeout(e)},[]),(0,u.jsx)(n.default,{role:"menu","aria-label":s,...(0,a.webOnly)({'aria-orientation':'vertical'}),children:e.map((e,t)=>(0,u.jsxs)(o.default,{ref:e=>{r.refs.current[t]=e},role:"menuitem","aria-disabled":!!e.disabled,accessibilityState:{disabled:!!e.disabled},accessibilityLabel:e.label,disabled:e.disabled,...(0,a.webOnly)({tabIndex:0===t?0:-1,onKeyDown:e=>r.onKeyDown(t,e)}),onPress:()=>{i?.(),e.onPress()},style:t=>[l.s.row,{minHeight:44,paddingHorizontal:14,gap:10,backgroundColor:t.hovered||t.focused||t.pressed?l.C.soft:'transparent',opacity:e.disabled?.45:1}],children:[!!e.icon&&(0,u.jsx)(l.Icon,{name:e.icon,size:15,color:e.danger?l.C.red:l.C.muted}),(0,u.jsx)(l.T,{style:{fontSize:13,color:e.danger?l.C.red:l.C.ink},children:e.label})]},e.label+t))})};var t=e(_r(d[0])),n=e(_r(d[1])),o=e(_r(d[2])),i=e(_r(d[3])),s=e(_r(d[4])),r=e(_r(d[5])),l=_r(d[6]),a=_r(d[7]),u=_r(d[8]);const c=[];let f=0;function h(e,n,o={}){const i=t.default.useRef(n);i.current=n;const s=t.default.useRef(o.insideRefs);s.current=o.insideRefs;const r=!!o.insideRefs?.length,l=!1!==o.escape;t.default.useEffect(()=>{if(!e||!a.web||'undefined'==typeof window)return;const t=++f;c.push(t);let n=!1;const o=()=>c[c.length-1]===t,u=e=>{l&&'Escape'===e.key&&o()&&(n=!0,e.preventDefault(),e.stopPropagation())},h=e=>{l&&'Escape'===e.key&&o()&&(e.stopPropagation(),n&&(n=!1,i.current()))},w=e=>{const t=e.target;s.current?.some(e=>e.current?.contains?.(t))||o()&&i.current()},p=()=>i.current();return window.addEventListener('keydown',u,!0),window.addEventListener('keyup',h,!0),window.addEventListener('popstate',p),r&&window.addEventListener('pointerdown',w,!0),()=>{const e=c.indexOf(t);e>=0&&c.splice(e,1),window.removeEventListener('keydown',u,!0),window.removeEventListener('keyup',h,!0),window.removeEventListener('popstate',p),window.removeEventListener('pointerdown',w,!0)}},[e,r,l]);const u=t.default.useRef(o.routeKey);t.default.useEffect(()=>{u.current!==o.routeKey&&(u.current=o.routeKey,e&&i.current())},[o.routeKey,e])}const w=e=>!!e&&'object'==typeof e&&'current'in e,p=1.5},875,[11,13,375,368,26,400,821,869,6]); 969__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ToolRail=function({items:e,label:t="Tools",orientation:i,compact:c=!1,header:h,footer:f,style:y}){const p='phone'===(0,o.useLayoutMode)(),x=i??(p?'horizontal':'vertical'),j='vertical'===x,C=(0,s.useRoving)(e.length,x),v=Math.max(0,e.findIndex(e=>e.active)),w=(0,u.jsx)(l.default,{role:"toolbar","aria-label":t,...(0,s.webOnly)({'aria-orientation':x}),style:j?{gap:4}:{flexDirection:'row',gap:4},children:e.map((e,t)=>(0,u.jsx)(b,{item:e,index:t,vertical:j,compact:c,tabbable:t===v,onKeyDown:C.onKeyDown,refs:C.refs},e.key))});return j?(0,u.jsxs)(l.default,{style:[{width:c?50:70,backgroundColor:o.C.bg,paddingVertical:6,paddingHorizontal:4,gap:6,alignItems:'stretch'},y],children:[!!h&&(0,u.jsx)(l.default,{style:{alignItems:'center'},children:h}),(0,u.jsx)(n.default,{style:{flex:1},showsVerticalScrollIndicator:!1,children:w}),!!f&&(0,u.jsx)(l.default,{style:{alignItems:'center'},children:f})]}):(0,u.jsxs)(l.default,{style:[{flexDirection:'row',alignItems:'center',gap:4},y],children:[h,(0,u.jsx)(n.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:{flex:1},contentContainerStyle:{paddingHorizontal:8},children:w}),f]})};var t=e(r(d[0])),l=e(r(d[1])),i=e(r(d[2])),n=e(r(d[3])),o=r(d[4]),s=r(d[5]),c=r(d[6]),u=r(d[7]);function b({item:e,index:l,vertical:n,compact:b,tabbable:h,onKeyDown:f,refs:y}){const p=e.shortcut?`${e.label} (${e.shortcut})`:e.label,x=(0,s.useTitle)(p),j=!!e.active,C=t.default.useCallback(e=>{x.current=e,y.current[l]=e},[l]),v=b?(0,c.touchSlop)(40,n?42:44):(0,c.touchSlop)(54);return(0,u.jsxs)(i.default,{ref:C,accessibilityRole:"button",accessibilityLabel:e.label,accessibilityHint:e.shortcut?`Shortcut ${e.shortcut}`:void 0,accessibilityState:{selected:j,disabled:!!e.disabled},disabled:e.disabled,...(0,s.webOnly)({'aria-pressed':j,'aria-keyshortcuts':e.shortcut,tabIndex:h?0:-1,onKeyDown:e=>f(l,e)}),onPress:e.onPress,hitSlop:v,style:t=>[{alignItems:'center',justifyContent:'center',gap:3,minHeight:b?40:54,minWidth:n?void 0:b?44:64,paddingHorizontal:4,paddingVertical:6,borderRadius:10,borderWidth:1,borderColor:j?o.C.green:'transparent',backgroundColor:j?o.C.soft:t.hovered||t.focu
969sed?o.C.paper:'transparent',opacity:e.disabled?.4:t.pressed?.7:1}],children:[(0,u.jsx)(c.HitArea,{slop:v}),(0,u.jsx)(o.Icon,{name:e.icon,size:18,color:j?o.C.green:o.C.muted}),!b&&(0,u.jsx)(o.T,{numberOfLines:2,style:{fontSize:10,lineHeight:12,textAlign:'center',fontFamily:'InterMedium',color:j?o.C.green:o.C.muted},children:e.label})]})}},876,[11,13,375,278,821,869,832,6]); 970__d(function(_g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SHEET_SNAPS",{enumerable:!0,get:function(){return h}}),_e.BottomSheet=function({snap:e,onSnapChange:v,header:g,children:w,peekHeight:y=64,label:R="Panel",halfRatio:x=.5,fullRatio:M=.92}){const{height:C}=(0,l.default)(),S=(0,i.useSafeAreaInsets)(),E=Math.round(C*M),k=t.default.useCallback(e=>'peek'===e?y+S.bottom:'half'===e?Math.round(C*x):E,[y,S.bottom,C,x,E]),P=t.default.useRef(new o.default.Value(E-k(e))).current,L=t.default.useRef({fullH:E,shown:k,snap:e,onSnapChange:v});L.current={fullH:E,shown:k,snap:e,onSnapChange:v};const H=t.default.useCallback(e=>{o.default.spring(P,{toValue:L.current.fullH-L.current.shown(e),useNativeDriver:!d.web,bounciness:0,speed:20}).start()},[P]);t.default.useEffect(()=>{H(e)},[e,k,H]);const j=t.default.useRef({armed:!1,on:!1,origin:0,start:0,last:0,t:0,v:0}),T=t.default.useRef({arm(e){j.current={armed:!0,on:!1,origin:e,start:0,last:e,t:Date.now(),v:0}},begin(){const e=j.current,t=L.current;e.on=!0,e.start=t.fullH-t.shown(t.snap),P.stopAnimation(t=>{Number.isFinite(t)&&(e.start=t)})},move(e){const t=j.current;if(!t.on)return;const n=L.current,o=Date.now();t.v=(e-t.last)/Math.max(1,o-t.t),t.last=e,t.t=o,P.setValue((0,d.clamp)(t.start+e-t.origin,0,n.fullH-n.shown('peek')))},end(e,t){const n=j.current;if(n.armed=!1,!n.on)return;n.on=!1;const o=L.current,s=o.fullH-(0,d.clamp)(n.start+e-n.origin,0,o.fullH-o.shown('peek')),l=t??n.v;let i=h.reduce((e,t)=>Math.abs(o.shown(t)-s)<Math.abs(o.shown(e)-s)?t:e,o.snap);l<-.5?i=h.find(e=>o.shown(e)>s+8)??'full':l>b&&(i=[...h].reverse().find(e=>o.shown(e)<s-8)??'peek'),H(i),i!==o.snap&&o.onSnapChange(i)}}).current,I=t.default.useRef(s.default.create({onStartShouldSetPanResponder:()=>!1,onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dy)>p&&Math.abs(t.dy)>Math.abs(t.dx),onPanResponderGrant:()=>{T.arm(0),T.begin()},onPanResponderMove:(e,t)=>T.move(t.dy),onPanResponderRelease:(e,t)=>T.end(t.dy,t.vy),onPanResponderTerminate:(e,t)=>T.end(t.dy,t.vy)})).current,_=t.default.useRef(null);t.default.useEffect(()=>()=>_.current?.(),[]);const D=(0,d.webOnly)({onPointerDown:e=>{if(e.button>0)return;_.current?.(),T.arm(e.clientY);const t=globalThis.window,n=t?.document;if(!t||'function'!=typeof t.addEventListener)return;const o=e.pointerId,s=e.currentTarget,l=n?.body,i=l?.style?.userSelect??'',u=e=>{const t=j.current;if(e.pointerId===o&&t.armed)if('mouse'!==e.pointerType||0!==e.buttons){if(!t.on){if(Math.abs(e.clientY-t.origin)<p)return;try{s?.setPointerCapture?.(o)}catch{}l&&(l.style.userSelect='none'),T.begin()}e.cancelable&&e.preventDefault(),T.move(e.clientY)}else d(e)},d=e=>{if(e.pointerId!==o)return;const n=j.current.on;if(c(),T.end(e.clientY),n&&'pointerup'===e.type){const e=n=>{n.stopPropagation(),n.preventDefault(),t.removeEventListener('click',e,!0)};t.addEventListener('click',e,!0),setTimeout(()=>t.removeEventListener('click',e,!0),0)}},c=()=>{t.removeEventListener('pointermove',u),t.removeEventListener('pointerup',d),t.removeEventListener('pointercancel',d),l&&(l.style.userSelect=i);try{s?.releasePointerCapture?.(o)}catch{}_.current=null};t.addEventListener('pointermove',u,{passive:!1}),t.addEventListener('pointerup',d),t.addEventListener('pointercancel',d),_.current=()=>{c(),j.current.armed=!1,j.current.on=!1}}}),O=h.indexOf(e),[A,Y]=t.default.useState(y),V='peek'===e?'collapsed':'half'===e?'half open':'full screen';return(0,c.jsxs)(o.default.View,{role:"region","aria-label":`${R}, ${V}`,style:{position:'absolute',left:0,right:0,bottom:0,height:E,transform:[{translateY:P}],backgroundColor:u.C.bg,borderTopLeftRadius:20,borderTopRightRadius:20,borderTopWidth:1,borderColor:u.C.line,shadowColor:u.C.shadow,shadowOpacity:.5,shadowRadius:20,shadowOffset:{width:0,height:-6},elevation:16,zIndex:30},children:[(0,c.jsxs)(n.default,{onLayout:e=>{const t=Math.round(e.nativeEvent.layout.height);Math.abs(t-A)>1&&Y(t)},...D,...d.web?{}:I.panHandlers,style:d.web?{touchAction:'pan-x',cursor:'grab'}:void 0,children:[(0,c.jsx)(n.default,{"aria-hidden":!0,style:{alignItems:'center',paddingTop:6,height:f},children:(0,c.jsx)(n.default,{style:{width:40,height:4,borderRadius:2,backgroundColor:u.C.line}})}),(0,c.jsxs)(n.default,{style:[u.s.row,{minHeight:Math.max(40,y-f),paddingLeft:16,paddingRight:6,gap:2}],children:[(0,c.jsx)(n.default,{style:{flex:1,minWidth:0},children:g}),(0,c.jsx)(d.IconButton,{icon:"chevron-down",label:`Collapse ${R}
970`,tooltip:"Collapse",disabled:O<=0,onPress:()=>v(h[Math.max(0,O-1)])}),(0,c.jsx)(d.IconButton,{icon:"chevron-up",label:`Expand ${R}`,tooltip:"Expand",disabled:O>=2,onPress:()=>v(h[Math.min(2,O+1)])})]})]}),(0,c.jsx)(n.default,{"aria-hidden":'peek'===e,importantForAccessibility:'peek'===e?'no-hide-descendants':'auto',style:{height:Math.max(0,k(e)-A),minHeight:0,overflow:'hidden'},children:w})]})};var t=e(r(_d[0])),n=e(r(_d[1])),o=e(r(_d[2])),s=e(r(_d[3])),l=e(r(_d[4])),i=r(_d[5]),u=r(_d[6]),d=r(_d[7]),c=r(_d[8]);const h=['peek','half','full'],f=14,p=6,b=.5},877,[11,13,267,355,400,105,821,869,6]); 971__d(function(g,r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"dataAgeDays",{enumerable:!0,get:function(){return b.dataAgeDays}}),Object.defineProperty(_e,"formatDataDate",{enumerable:!0,get:function(){return b.formatDataDate}}),Object.defineProperty(_e,"TOPBAR_DOTS_BELOW",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"TopBarDots",{enumerable:!0,get:function(){return j}}),_e.TopBar=function({left:e,center:n,right:c,below:u,label:f="Workspace top bar",style:b}){const h='phone'===(0,s.useLayoutMode)(),{width:p}=(0,o.default)(),[y,m]=t.default.useState(0),[S,D]=t.default.useState(0),[k,L]=t.default.useState(0),I=t.default.useRef(0),O=h||p<C,v=h?6:12,A=!h&&y>0&&S+(I.current||k)+w+2*v>y,H=O||A,T=e=>t=>{const l=Math.round(t?.nativeEvent?.layout?.width||0);e(l)};return(0,x.jsxs)(l.default,{role:"group","aria-label":f,style:[{backgroundColor:s.C.bg,borderBottomWidth:1,borderColor:s.C.line,paddingHorizontal:h?10:14,paddingVertical:6,gap:6},b],children:[(0,x.jsxs)(l.default,{onLayout:T(m),style:[s.s.row,{minHeight:44,columnGap:v,rowGap:6,flexWrap:'wrap'}],children:[(0,x.jsx)(l.default,{onLayout:T(D),style:[s.s.row,{flexShrink:0,gap:8}],children:e}),h?(0,x.jsx)(l.default,{style:{flex:1}}):(0,x.jsx)(l.default,{style:[s.s.row,{flex:1,minWidth:w,gap:8}],children:n}),(0,x.jsx)(j.Provider,{value:H,children:(0,x.jsx)(l.default,{onLayout:T(e=>{L(e),H||(I.current=e)}),style:[s.s.row,{flexShrink:0,marginLeft:'auto',gap:6,justifyContent:'flex-end'}],children:c})})]}),h&&null!=n&&!1!==n&&(0,x.jsx)(l.default,{style:[s.s.row,{gap:6}],children:n}),null!=u&&!1!==u&&(0,x.jsx)(l.default,{style:[s.s.row,{flexWrap:'wrap',gap:6}],children:u})]})},_e.previewDataLabel=D,_e.dataAgeTone=L,_e.DataAgePill=function({dataEnd:e,ageDays:o,staleLimit:C=c.DATA_STALE_DAYS,redAfterDays:w,onPress:D,compact:I=!1,status:O,expanded:v,cache:A,error:H,notDeployed:T,variant:W="pill"}){const[,z]=t.default.useState(0);t.default.useEffect(()=>{const e=setInterval(()=>z(e=>e+1),6e4);return()=>clearInterval(e)},[]);const _='line'===W,P=null!=o&&Number.isFinite(o)?Math.max(0,Math.round(o)):(0,b.dataAgeDays)(e),F=(0,b.pillContent)(O,{dataEnd:e,ageDays:P,staleLimit:C,compact:I,cache:A,error:H,notDeployed:T}),M=!0===F.neutral,R=!0===A?.served_from_cache||!0===A?.unreachable||!!H,B=M||R||O&&!O.error?F.tone:L(P,C,w??5*C),E=!M&&('stale'===B||'very-stale'===B),N=M?s.C.muted:'fresh'===B?s.C.green:'very-stale'===B?s.C.red:s.C.amber,$=M?s.C.paper:'fresh'===B?s.C.soft:'very-stale'===B?s.C.redBg:s.C.amberBg,J=F.label,G=(0,u.useTitle)(J),U=(0,h.fnoCaptureView)((0,h.useFnoCapture)()),V=(0,h.useFnoCapture)(),Y=(0,y.uxPreview)((0,p.useAuth)()?.config)?(0,x.jsx)(k,{at:V?.at,compact:!1}):null,q=t.default.useContext(j)&&!_,[K,Q]=t.default.useState(!1),[X,Z]=t.default.useState(!1),ee=(0,u.useTitle)(U?.a11y);if(q){const e={alignItems:'center',justifyContent:'center',alignSelf:'center',minWidth:30,height:30,flexShrink:0,flexDirection:'row',gap:6,paddingHorizontal:K?9:0,borderRadius:15,backgroundColor:$,borderWidth:1,borderColor:M||'fresh'===B?s.C.line:N+'55'},t=(0,x.jsx)(s.Icon,{name:M?'info':E||'unknown'===B?'alert-circle':'database',size:14,color:N}),o=(0,x.jsx)(l.default,{ref:G,role:"status","aria-label":J,accessibilityLabel:J,style:{alignSelf:'center',flexShrink:1,minWidth:30},children:(0,x.jsxs)(n.default,{accessibilityRole:"button",accessibilityLabel:D?`${J}. Open data status`:J,accessibilityState:D?{expanded:!!v}:{expanded:K},...(0,u.webOnly)(D?{'aria-expanded':!!v,'aria-haspopup':'dialog'}:{'aria-expanded':K}),onPress:D||(()=>Q(e=>
971!e)),hitSlop:m,style:({pressed:t,hovered:l,focused:n})=>[e,{opacity:t?.7:1,borderColor:l||n?N:e.borderColor}],children:[(0,x.jsx)(f.HitArea,{slop:m}),t,K&&!D&&(0,x.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16,fontFamily:'InterSemi',color:N,flexShrink:1},children:F.text})]})});if(!U)return Y?(0,x.jsxs)(l.default,{style:{flexDirection:'row',alignItems:'center',gap:f.TOUCH_MIN-30,flexShrink:1,minWidth:0},children:[o,(0,x.jsx)(k,{at:V?.at,compact:!0})]}):o;const c=(0,x.jsx)(l.default,{ref:ee,role:"status","aria-label":U.a11y,accessibilityLabel:U.a11y,style:{alignSelf:'center',flexShrink:1,minWidth:30},children:(0,x.jsxs)(n.default,{accessibilityRole:"button",accessibilityLabel:U.a11y,accessibilityState:{expanded:X},...(0,u.webOnly)({'aria-expanded':X}),onPress:()=>Z(e=>!e),hitSlop:m,style:({pressed:e,hovered:t,focused:l})=>[{alignItems:'center',justifyContent:'center',alignSelf:'center',minWidth:30,height:30,flexDirection:'row',gap:5,paddingHorizontal:X?8:0,borderRadius:15,backgroundColor:s.C.amberBg,borderWidth:1,borderColor:t||l?s.C.amber:s.C.amber+'55',opacity:e?.7:1}],children:[(0,x.jsx)(f.HitArea,{slop:m}),(0,x.jsx)(s.Icon,{name:"alert-triangle",size:13,color:s.C.amber}),X&&(0,x.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16,fontFamily:'InterSemi',color:s.C.amber,flexShrink:1},children:U.label})]})});return(0,x.jsxs)(l.default,{style:{flexDirection:'row',alignItems:'center',gap:f.TOUCH_MIN-30,flexShrink:1,minWidth:0},children:[o,c,Y&&(0,x.jsx)(k,{at:V?.at,compact:!0})]})}const te=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s.Icon,{name:M?'info':E||'unknown'===B?'alert-circle':'database',size:13,color:N}),(0,x.jsx)(s.T,{numberOfLines:_?2:1,style:{fontSize:_?12:11,lineHeight:_?17:16,fontFamily:_?'InterMedium':'InterSemi',color:N,flexShrink:1},children:_?F.line:F.text})]}),re={flexDirection:'row',alignItems:'center',gap:6,alignSelf:'center',minHeight:28,flexShrink:1,maxWidth:'100%',paddingHorizontal:9,borderRadius:8,backgroundColor:$,borderWidth:1,borderColor:M||'fresh'===B?s.C.line:N+'55'},ae=U?(0,x.jsxs)(l.default,{role:"status","aria-label":U.a11y,accessibilityLabel:U.a11y,style:{flexDirection:'row',alignItems:'center',gap:5,alignSelf:'center',minHeight:28,flexShrink:1,paddingHorizontal:8,borderRadius:8,backgroundColor:s.C.amberBg,borderWidth:1,borderColor:s.C.amber+'55'},children:[(0,x.jsx)(s.Icon,{name:"alert-triangle",size:12,color:s.C.amber}),(0,x.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16,fontFamily:'InterSemi',color:s.C.amber,flexShrink:1},children:U.label})]}):null,le=e=>ae||Y?(0,x.jsxs)(l.default,{style:{flexDirection:'row',alignItems:'center',gap:6,flexShrink:1,maxWidth:'100%'},children:[e,ae,Y]}):e;return le(D?(0,x.jsx)(l.default,{ref:G,role:"status","aria-label":J,accessibilityLabel:J,style:{alignSelf:'center'},children:(0,x.jsxs)(n.default,{accessibilityRole:"button",accessibilityLabel:`${J}. Open data status`,accessibilityState:{expanded:!!v},...(0,u.webOnly)({'aria-expanded':!!v,'aria-haspopup':'dialog'}),onPress:D,hitSlop:S,style:({pressed:e,hovered:t,focused:l})=>[re,{opacity:e?.7:1,borderColor:t||l?N:M||'fresh'===B?s.C.line:N+'55'}],children:[(0,x.jsx)(f.HitArea,{slop:S}),te]})}):(0,x.jsx)(l.default,{ref:G,role:"status","aria-label":J,accessibilityLabel:J,style:re,children:te}))};var t=e(r(d[0])),l=e(r(d[1])),n=e(r(d[2])),o=e(r(d[3])),s=r(d[4]),c=r(d[5]),u=r(d[6]),f=r(d[7]),b=r(d[8]),h=r(d[9]),p=r(d[10]),y=r(d[11]),x=r(d[12]);const m=(0,f.touchSlop)(30,30),S=(0,f.touchSlop)(28),C=1024,j=t.default.createContext(!1),w=40;function D(e){const t=/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})/.exec(String(e||''));if(!t)return null;return`Data ${Number(t[3])} ${['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'][Number(t[2])-1]} \xb7 ${t[4]}:${t[5]}`}function k({at:e,compact:t}){const n=D(e);if(!n)return null;const o=`${n}. The newest F&O reading in this preview's data copy.`;return(0,x.jsxs)(l.default,{role:"status","aria-label":o,accessibilityLabel:o,...(0,u.webOnly)({title:o}),style:{flexDirection:'row',alignItems:'center',gap:5,alignSelf:'center',minHeight:t?30:28,flexShrink:0,paddingHorizontal:8,borderRadius:t?15:8,backgroundColor:s.C.paper,borderWidth:1,borderColor:s.C.line},children:[(0,x.jsx)(s.Icon,{name:"clock",size:12,color:s.C.muted}),(0,x.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16,fontFamily:'InterSemi',color:s.C.muted},children:n})]})}function L(e,t=c.DATA_STALE_DAYS,l=5*t){return null!=e&&Number.isFinite(e)?e>l?'very-stale':e>t?'stale':'fresh':'unknown'}},878,[11,13,375,400,821,249,869,832,879,880,198,881,6]); 972__d(function(g,r,_i,_a,_m,e,d){"use strict";
972Object.defineProperty(e,'__esModule',{value:!0}),e.istMs=i,e.formatIst=l,e.agoText=c,e.inText=u,Object.defineProperty(e,"SESSION_TEXT",{enumerable:!0,get:function(){return h}}),e.barLagSeconds=p,Object.defineProperty(e,"stallLimitMinutes",{enumerable:!0,get:function(){return $}}),e.pricesLagging=b,e.dataStatusTone=y,Object.defineProperty(e,"RECONNECT_GRACE_SECONDS",{enumerable:!0,get:function(){return w}}),e.connectionView=v,e.clockText=k,e.dataStory=T,e.pillContent=function(a,s={}){const o=s.now||new Date,i=s.staleLimit??t.DATA_STALE_DAYS,l=!!s.compact,c=_(s.cache,s.notDeployed);if(null!=c){const t=(0,n.notDeployedPill)(c,l);return{text:t.text,label:t.label,tone:'unknown',stale:!1,line:t.line,neutral:!0}}const u=v(s.cache,{error:s.error,now:o});if(u)return{text:l?u.short:u.text,label:u.a11y,tone:u.tone,stale:!0,line:u.text};const h=s.ageDays,p=S(s.dataEnd),$=y(a,h,i,o),f='stale'===$||'very-stale'===$;if(a&&!a.error&&!0===a.source?.live){const t=T(a,o,h,i);return{text:l?t.compact:t.pill,label:t.label,tone:t.tone,stale:'stale'===t.tone||'very-stale'===t.tone,line:t.line}}return{text:null==h?l?'Data ?':p?`Data: ${p} \xb7 age unknown`:'Data age unknown':l?`${f?'STALE ':''}${h}d`:`Data: ${p?`${p} \xb7 `:''}${f?'STALE ':''}${h}d`,label:null==h?"Market data age unknown"+(p?`, data ends ${p}`:''):`Market data ${p?`ends ${p}, `:''}${h} day${1===h?'':'s'} old${f?`, stale, limit ${i} days`:''}`,tone:$,stale:f,line:null==h?p?`Data to ${p} \xb7 age unknown`:'Data age unknown':`Data to ${p||'an unknown date'} \xb7 ${f?'STALE \xb7 ':''}${h} day${1===h?'':'s'} old`}},e.cardWarning=function(t,n={}){const a=n.now||new Date;if(t&&!t.error&&!0===t.source?.live){const s=T(t,a,n.ageDays??void 0),o=t.latest_bar?.end||t.latest_bar?.start;return s.pricesBehind?!0===t.stalled?.value?"Price feed stalled"+(o?` \xb7 newest prices ${k(o,a)}`:''):"Prices behind"+(o?` \xb7 newest ${k(o,a)}`:''):s.patternsBehind?"Patterns behind"+(t.patterns?.latest?` \xb7 last updated ${k(t.patterns.latest,a)}`:''):null}return n.stale?"Research only \u2014 prices "+(null!=n.ageDays?`${n.ageDays} days old`:'of unknown age'):null},e.cardDataLine=function(t,n,a=new Date){if(t&&!t.error&&!0===t.source?.live){const s=t.latest_bar?.end||t.latest_bar?.start;return[`Pattern as of ${n?k(n,a):'an unknown candle'}`,s?`prices ${k(s,a)}`:'newest prices unknown'].join(' \xb7 ')}return`Data to ${n?l(n,a):'unknown date'}`},e.dataAgeDays=function(t,n=new Date){const a=o.exec(String(t||''));if(!a)return;const i=Date.UTC(+a[1],+a[2]-1,+a[3]),l=new Date(n.getTime()+s),c=Date.UTC(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate());return Math.max(0,Math.round((c-i)/864e5))},e.formatDataDate=S,e.dataStatusView=function(a,s={}){const o=s.now||new Date,h=s.staleLimit??t.DATA_STALE_DAYS,f=_(s.cache,s.notDeployed);if(null!=f)return{tone:'unknown',neutral:!0,live:!1,kind:'Not on the cloud yet',headline:n.COMING_SOON_HEADLINE,detail:f,rows:[{key:'scanner',label:'Chart scans',value:'Not on the cloud yet',note:f}],warning:null,expectation:'This is planned, not a fault. Use Strategies to open the Strategy Builder in the meantime.',a11y:`Data status: ${n.COMING_SOON_HEADLINE}. ${f}`};const b=y(a,s.ageDays,h,o),w=v(s.cache,{error:s.error,now:o});if(w&&'offline'===w.mode)return{tone:w.tone,live:!1,kind:'No scan',headline:w.text,detail:w.detail,rows:[{key:'connection',label:'Connection',value:'Not answering',note:w.detail,tone:w.tone}],warning:{tone:w.tone,text:w.detail},expectation:'The page fills in as soon as the scanner answers. Nothing you have saved is affected.',a11y:w.a11y};if(!a||a.error){const t=a?.error?`Data provenance is unavailable: ${a.error}`:'This build of the scanner does not report where its prices come from.';return{tone:b,live:!1,kind:'Unknown',headline:'Data source unknown',detail:t,rows:[{key:'source',label:'Source',value:'Unknown',note:t}],warning:null,expectation:'Ask the operator to restart the scanner if this does not clear.',a11y:`Data status: source unknown. ${t}`}}const m=!0===a.source?.live,D=Number(a.provider?.delay_seconds)||0,x=a.provider?.label||a.provider?.id||'unknown provider',L=a.latest_bar?.end||a.latest_bar?.start||'',P=p(a,o),A=!0===a.stalled?.value,C=!0===a.stale?.value,E=m?T(a,o,s.ageDays,h):null,B=!!E&&!!E.pricesBehind,j=m?A?'Stalled':B||C?'Behind':E&&!E.open?'Closed':D?`Live \xb7 ${Math.round(D/60)} min delayed`:'Live':'Historical',O=E?E.open?`${E.prices} \xb7 ${E.patterns}`:`Market closed \xb7 ${E.prices} \xb7 ${E.patterns}`:`Historical \xb7 data to ${S(L||s.dataEnd)||'an unknown date'}${null!=s.ageDays?` (${s.ageDays} day${1===s.ageDays?'':'s'} old)`:''}`,U=E?[E.next?`Patterns ${E.next}`:E.missing.includes('when patterns next update')?'The scanner does not report when patterns next update':'',`prices from ${x}${null!=P?`, ${c(P+D)}`:''}${D?`, published ${Math.round(D/60)} min late by design`:''}
972`].filter(Boolean).map((t,n)=>n?t:t[0].toUpperCase()+t.slice(1)).join(' \xb7 '):a.source?.note||'Prices come from a stored research scan, not a live feed.',I=a.patterns,F=I?.by_timeframe||{},H=Object.keys(F).length?Object.keys(F):Object.keys(a.latest_bar?.by_timeframe||{}),Y=[{key:'source',label:'Source',value:m?`${a.source?.label||'Live store'} \xb7 ${x}`:`${a.source?.label||'Stored scan'}${a.source?.store?` (${a.source.store})`:''}`,note:a.source?.note||void 0},{key:'bar',label:m?'Prices':'Newest bar',value:L?`${l(L,o)} IST${null!=P?` \xb7 ${c(P+D)}`:''}`:'Unknown',note:(m?void 0:a.latest_bar?.note)||void 0,tone:E?.pricesBehind?'stale':void 0}];E&&(Y.push({key:'patterns',label:'Patterns',value:E.patterns.replace(/^Patterns:? ?/,'').replace(/^./,t=>t.toUpperCase())+(I?.latest&&!/\d{2}:\d{2}/.test(E.patterns)?` \xb7 ${l(I.latest,o)} candle`:''),note:I?.error?`${I.note||''} (${I.error})`.trim():I?.note||void 0,tone:E.patternsBehind?'stale':void 0}),Y.push({key:'patterns-next',label:'Next pattern update',value:'updating now'===E.next?'Updating now':I?.next_update?`${l(I.next_update,o)} IST${null!=i(I.next_update)?` \xb7 ${u((i(I.next_update)-o.getTime())/1e3)}`:''}`:'Unknown',note:I?'1-hour patterns update when each hourly candle completes (from 10:15), 4-hour at 13:15 and the close, daily and weekly after the close.':'This scanner build does not report its pattern schedule; restarting the scanner adds it.'}),H.length&&Y.push({key:'timeframes',label:'By timeframe',value:H.map(t=>{const n=F[t]?.scanned??a.latest_bar?.by_timeframe?.[t];return`${t} ${n?k(n,o):'not scanned'}${F[t]?.behind?' (behind)':''}`}).join(' \xb7 ')}));Y.push(N(a)),Y.push({key:'next',label:m?'Next price bar':'Next refresh',value:a.next_refresh?.at?`${l(a.next_refresh.at,o)} IST${null!=a.next_refresh.in_seconds?` \xb7 ${u(a.next_refresh.in_seconds)}`:''}`:'Not scheduled',note:a.next_refresh?.note||void 0}),Y.push(M(a)),D&&Y.push({key:'delay',label:'Vendor delay',value:`${Math.round(D/60)} min, by design`,note:'A published delay is not staleness: the bar is correct, it simply arrives late.'});let R=null;if(E){const t=[E.pricesBehind,E.patternsBehind].filter(Boolean);t.length?R={tone:A?'very-stale':'stale',text:t.join(' ')}:a.last_run?.errors&&(R={tone:'stale',text:`The last price refresh finished with ${a.last_run.errors} error${1===a.last_run.errors?'':'s'}; some symbols may be behind.`})}else A?R={tone:'very-stale',text:`Ingestion looks stalled. ${a.stalled?.note||`No ingest cycle has finished in the last ${$(a)} minutes while the market is open.`}`}:C?R={tone:'stale',text:`Data is behind the market. ${a.stale?.note||'The newest bar is behind the newest completed session.'}`}:(s.ageDays??0)>h&&(R={tone:'very-stale'===b?'very-stale':'stale',text:`These prices are ${s.ageDays} days old. Lists are stored scans, not current signals.`});const G=m?'open'===a.session?.state?'Prices update every 15 minutes. Patterns update only when a candle completes, so the pattern time trails the price time between candles; that is normal.':'Prices and patterns update again once the market opens.':'A stored scan only changes when the research data is refreshed.',J=`Data status: ${O}. ${U}. ${R?R.text+' ':''}${G}`;return w?{tone:w.tone,live:m,kind:'Last scan',headline:w.text,detail:w.detail,rows:[{key:'connection',label:'Connection',value:'lost'===w.mode?'Not answering':'Reconnecting\u2026',note:w.detail,tone:w.tone},{key:'taken',label:'Last scan',value:`${l(s.cache?.cached_at,o)} IST`,note:s.cache?.cached_as_of?`The scan itself is as of ${l(s.cache.cached_as_of,o)}.`:void 0},...Y],warning:{tone:w.tone,text:w.detail},expectation:'Nothing on this screen changes until the scanner answers again. Your account and saved plans are unaffected, and nothing can be simulated or sent live on a scan this old.',a11y:w.a11y}:{tone:E?E.tone:b,live:m,kind:j,headline:O,detail:U,rows:Y,warning:R,expectation:G,a11y:J}};var t=r(d[0]),n=r(d[1]);const a=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],s=198e5,o=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?/;function i(t){const n=o.exec(String(t||''));if(n)return Date.UTC(+n[1],+n[2]-1,+n[3],+(n[4]||0),+(n[5]||0),+(n[6]||0))-s}function l(t,n=new Date){const i=o.exec(String(t||''));if(!i)return'\u2014';const l=new Date(n.getTime()+s),c=+i[1]===l.getUTCFullYear()?'':` ${i[1]}`,u=`${+i[3]} ${a[+i[2]-1]}${c}`;return i[4]?`${u} ${i[4]}:${i[5]}`:u}function c(t){if(null==t||!Number.isFinite(t))return'\u2014';const n=Math.max(0,Math.round(t));if(n<90)return'just now';const a=Math.round(n/60);if(a<60)return`${a} min ago`;const s=Math.floor(a/60),o=a%60;if(s<24)return o?`${s}h ${o}m ago`:`${s}h ago`;const i=Math.round(s/24);return`${i} day${1===i?'':'s'} ago`}function u(t){if(null==t||!Number.isFinite(t))return'';const n=Math.max(0,Math.round(t));if(n<60)return'in under a minute';const a=Math.round(n/60);if(a<60)return`in ${a} min`;const s=Math.floor(a/60),o=a%60;return s<24?o?`in ${s}h ${o}m`:`in ${s}h`:`in ${Math.round(s/24)} days`}const h={pre_open:'Pre-open',open:'Open',closed:'Closed',holiday:'Closed'};function p(t,n=new Date){const a=i(t?.latest_bar?.end||t?.latest_bar?.start);if(null==a)return;const s=Number(t?.provider?.delay_seconds)||0;return Math.max(0,Math.round((n.getTime()-a)/1e3)-s)}const $=t=>{const n=Number(t?.stalled?.after_minutes);return Number.isFinite(n)&&n>0?n:20},f=900;function b(t,n=new Date){if(!0!==t?.source?.live||'open'!==t?.session?.state)return!1;const a=p(t,n);return null!=a&&a>f+60*$(t)}function y(n,a,s=t.DATA_STALE_DAYS,o=new Date){const i=5*s,l=null!=a&&Number.isFinite(a)?a>i?'very-stale':a>s?'stale':'fresh':'unknown';if(!n||n.error)return l;if(!0===n.stalled?.value)return'very-stale';const c=!0===n.source?.live;return c||'very-stale'!==l?!0===n.stale?.value||b(n,o)?'stale':c?'fresh':l:l}const w=300;function m(t){const n=Math.max(0,Math.round(t));if(n<90)return'under a minute';const a=Math.round(n/60);if(a<60)return`${a} min`;const s=Math.floor(a/60),o=a%60;if(s<24)return o?`${s}h ${o}m`:`${s}h`;const i=Math.round(s/24);return`${i} day${1===i?'':'s'}`}function v(t,a={}){const s=a.now||new Date;if((0,n.isNotDeployed)(t))return null;const o=Number(t?.upstream_down_seconds),i=Number.isFinite(o)?Math.max(0,o):0,c=String(t?.upstream_error||'').trim();if(!0===t?.served_from_cache){const n=l(t?.cached_at,s),a=!1===t?.reconnecting||i>w,o=a?`Showing the last scan \xb7 ${n} \xb7 not reconnected for ${m(i)}`:`Showing the last scan \xb7 ${n} \xb7 reconnecting\u2026`,u=a?`${c||'The scanner is not answering.'} Nothing here has changed since ${n}.`:`${c||'The scanner is not answering.'} The page keeps showing the last scan while it comes back.`;return{mode:a?'lost':'reconnecting',tone:a?'very-stale':'stale',text:o,short:a?`Last scan ${
972k(t?.cached_at,s)}`:`Last scan ${k(t?.cached_at,s)} \xb7 reconnecting`,detail:u,retry:!0,a11y:`${o}. ${u}`}}if(a.error||!0===t?.unreachable){const t=c||a.error||'The scanner is not answering.',n='The scanner is not answering and there is no earlier scan to show.';return{mode:'offline',tone:'very-stale',text:n,short:'No scan',detail:t,retry:!0,a11y:`${n} ${t}`}}return null}function _(t,a){return null!=a?String(a).trim()||(0,n.notDeployedMessage)(null):(0,n.isNotDeployed)(t)?(0,n.notDeployedMessage)(t):null}function k(t,n=new Date){const a=o.exec(String(t||''));if(!a)return'\u2014';const i=new Date(n.getTime()+s);return+a[1]===i.getUTCFullYear()&&+a[2]===i.getUTCMonth()+1&&+a[3]===i.getUTCDate()&&a[4]?`${a[4]}:${a[5]}`:l(t,n)}const D=t=>t?t[0].toLowerCase()+t.slice(1):t,x=t=>t.length<2?t.join(''):`${t.slice(0,-1).join(', ')} and ${t[t.length-1]}`;function T(n,a=new Date,s,o=t.DATA_STALE_DAYS){const i='open'===n.session?.state||!n.session?.state,u=n.latest_bar?.end||n.latest_bar?.start||'',h=Number(n.provider?.delay_seconds)||0,f=p(n,a),w=n.patterns,m=w?.by_timeframe||{},v=[],_=[...Object.values(m).map(t=>t?.scanned),...Object.values(n.latest_bar?.by_timeframe||{})].filter(t=>!!t),T=w?.latest||(_.length?_.reduce((t,n)=>t>n?t:n):''),S=!0===n.stalled?.value,N=!0===n.stale?.value,M=b(n,a);u||v.push('the newest price bar'),T||v.push('the newest candle the pattern scan covered'),w&&!w.error||v.push('when patterns next update');const L=S?`The price feed looks stalled. ${n.stalled?.note||`No price refresh has finished in the last ${$(n)} minutes while the market is open.`}`:N?`Prices are behind the market. ${n.stale?.note||'The newest bar is behind the newest completed session.'}`:M?`The market is open but the newest price bar is ${c((f||0)+h)}${h?' (the vendor delay is already allowed for)':''}.`:null,P=(w?.behind||[]).filter(Boolean),A=(w?.updating||[]).filter(Boolean),C=P.length?`Patterns are behind: ${x(P.map(t=>{const n=m[t]||{};return n.expected?`the ${t} candle that closed ${k(n.expected,a)}${null!=n.overdue_seconds?` (${c(n.overdue_seconds)})`:''}`:`the ${t} candle`}))} ${1===P.length?'has':'have'} not been scanned yet.`:null,E=S?'STALLED':N||M?'BEHIND':'',B=P.length?'behind':A.length?'updating':!0===w?.up_to_date?'current':'unknown',j=u?`Prices ${i?k(u,a):`to ${l(u,a)}`}`:'Prices: newest bar unknown',O='behind'===B?"Patterns BEHIND"+(T?` \xb7 last updated ${k(T,a)}`:''):i||'current'!==B?i||'updating'!==B?T?`Patterns updated ${k(T,a)}`:'Patterns: last scan unknown':'Patterns updating':'Patterns up to date',U='behind'===B?'':'updating'===B?'updating now':w?.next_update?`next update ${k(w.next_update,a)}`:'',I=i?[`${j}${E?` (${E.toLowerCase()})`:''}`,D(O),U].filter(Boolean).join(' \xb7 '):['Market closed',D(j),D(O)].join(' \xb7 '),F='behind'===B?'Patterns BEHIND':i?T?`Patterns ${k(T,a)}`:'Patterns ?':O,H=[i?'Live':'Closed',E,u?`Prices ${i?k(u,a):l(u,a)}`:'Prices ?',F].filter(Boolean).join(' \xb7 '),Y=S?'STALLED':N||M||P.length?'BEHIND':i?u?`Live ${k(u,a)}`:'Live ?':'Closed',R=`Market data ${i?'live':'closed'} from ${n.provider?.label||n.provider?.id||'the live feed'}: prices ${u?`${l(u,a)} IST`:'unknown'}, ${D(O)}${U?`, ${U}`:''}`+(S?', ingestion stalled':N||M?', prices behind the market':'')+(P.length?', patterns behind':'');let G=y(n,s,o,a);return'fresh'===G&&P.length&&(G='stale'),{open:i,tone:G,prices:j,patterns:O,next:U,line:I,pill:H,compact:Y,label:R,pricesBehind:L,patternsBehind:C,missing:v}}function S(t){const n=o.exec(String(t||''));return n?`${+n[3]} ${a[+n[2]-1]} ${n[1]}`:t||void 0}function N(t){const n=t.last_run;if(!n)return{key:'refresh',label:'Last price refresh',value:'Never',note:t.last_run_note||void 0,tone:t.source?.live?'stale':void 0};const a=[];n.running?(a.push(`running now, started ${l(n.started_at)}`),n.last_success_at&&a.push(`last finished ${l(n.last_success_at)}`)):(n.finished_at?a.push(l(n.finished_at)):n.started_at&&a.push(`started ${l(n.started_at)}`),null!=n.age_seconds&&a.push(c(n.age_seconds)));const s=[];return null!=n.bars_written&&s.push(`${n.bars_written} bar${1===n.bars_written?'':'s'} written`),null!=n.symbols&&s.push(`${n.symbols} symbols`),n.errors&&s.push(`${n.errors} error${1===n.errors?'':'s'}`),{key:'refresh',label:'Last price refresh',value:[a.join(' \xb7 '),s.join(', ')].filter(
972Boolean).join(' \u2014 ')||'\u2014',note:n.note||void 0,tone:n.errors?'stale':void 0}}function M(t){const n=t.session;if(!n?.state)return{key:'session',label:'Market',value:'Unknown',note:'The scanner did not report a session state.'};const a=h[n.state]||n.state,s='open'===n.state&&n.close?`closes ${l(n.close)}`:'pre_open'===n.state&&n.open?`opens ${l(n.open)}`:n.next_open?`next open ${l(n.next_open)}`:'';return{key:'session',label:'Market',value:`${a}${'holiday'===n.state?'weekend'===n.reason?' (weekend)':' (exchange holiday)':''}${s?` \xb7 ${s}`:''}`,note:n.note||void 0}}},879,[249,820]); 973__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"FNO_SEPARATE_TEXT",{enumerable:!0,get:function(){return o}}),_e.fnoCaptureView=function(e){if(!e)return null;const t=String(e.state||'').trim();if(!t)return null;const n=l[t];if(!n&&!1!==e.healthy)return null;const u=n||'F&O capture unrecognised',c=String(e.state_text||'').trim()||'The F&O store reported a capture state this app does not recognise.',s=String(e.at||'').trim(),d=s?`${u} at the ${s.slice(11,16)} reading`:u;return{label:u,headline:d,detail:c,a11y:`${d}. ${c} ${o}`}},Object.defineProperty(_e,"FNO_POLL_MS",{enumerable:!0,get:function(){return p}}),_e.useFnoCapture=function(){const[e,t]=n.default.useState(c);return n.default.useEffect(()=>{f.add(t),O();const e=setInterval(()=>O(!0),p);return()=>{f.delete(t),clearInterval(e)}},[]),e},_e.resetFnoCapture=function(){c=null,d=0,s=null,h(null)};var e,t=r(_d[0]),n=(e=t)&&e.__esModule?e:{default:e},u=r(_d[1]);const l={missing_capture:'F&O not captured',partial_capture:'F&O partly captured',failed:'F&O store unreadable'},o="This describes F&O capture only. Prices and patterns are a different feed and are reported above; one can be healthy while the other is not.";let c=null,s=null,d=0;const f=new Set,p=3e5;function h(e){c=e;for(const t of f)t(e)}const _=3e4;function O(e=!1){return s||(e&&d&&Date.now()-d<_||!e&&c&&Date.now()-d<p?Promise.resolve():(s=(0,u.api)('/api/derivatives/capture').then(e=>{d=Date.now(),h(e||null)}).catch(()=>{d=Date.now()}).finally(()=>{s=null}),s))}},880,[11,197]); 974__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.uxPreview=function(t){return!!t&&'object'==typeof t&&!0===t.ux_preview}},881,[]); 975__d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DataStatusPanel=C,_e.DataStatusPopover=function({open:e,onClose:n,anchor:r,status:h,dataEnd:y,ageDays:x,staleLimit:b,placement:p="bottom-end",routeKey:j,cache:w,error:S,notDeployed:T}){const z=t.default.useMemo(()=>(0,c.dataStatusView)(h,{dataEnd:y,ageDays:x,staleLimit:b,cache:w,error:S,notDeployed:T}),[h,y,x,b,w,S,T,e]),v=(0,u.fnoCaptureView)((0,u.useFnoCapture)()),H=t.default.useRef(null);return t.default.useEffect(()=>{e&&s.web&&setTimeout(()=>H.current?.focus?.(),0)},[e]),e?(0,f.jsx)(o.Popover,{open:e,onClose:n,anchor:r,placement:p,label:"Data status",width:330,routeKey:j,children:(0,f.jsx)(l.default,{ref:H,...(0,s.webOnly)({tabIndex:-1}),style:{flexShrink:1}
975,children:(0,f.jsx)(C,{view:z,fno:v})})}):null};var t=e(_r(d[0])),l=e(_r(d[1])),n=e(_r(d[2])),r=_r(d[3]),o=_r(d[4]),s=_r(d[5]),c=_r(d[6]),u=_r(d[7]),f=_r(d[8]);const h={fresh:r.C.green,stale:r.C.amber,'very-stale':r.C.red,unknown:r.C.amber},y={fresh:r.C.soft,stale:r.C.amberBg,'very-stale':r.C.redBg,unknown:r.C.amberBg};function x({label:e,value:t,note:n,tone:o}){return(0,f.jsxs)(l.default,{style:{gap:2,paddingVertical:5},children:[(0,f.jsxs)(l.default,{style:[r.s.row,{gap:8,alignItems:'flex-start'}],children:[(0,f.jsx)(r.T,{style:{fontSize:11,lineHeight:17,color:r.C.muted,width:92},children:e}),(0,f.jsx)(r.T,{style:{flex:1,fontSize:12,lineHeight:18,fontFamily:'InterMedium',color:o?h[o]:r.C.ink},children:t})]}),!!n&&(0,f.jsx)(r.T,{style:{fontSize:10,lineHeight:15,color:r.C.muted,marginLeft:100},children:n})]})}function C({view:e,fno:t}){const o=e.neutral?r.C.ink:h[e.tone];return(0,f.jsxs)(n.default,{style:{maxHeight:460},contentContainerStyle:{paddingHorizontal:14,paddingVertical:10,gap:4},children:[(0,f.jsx)(r.T,{role:"heading","aria-level":2,style:{fontSize:11,lineHeight:16,fontFamily:'InterSemi',letterSpacing:1.2,textTransform:'uppercase',color:r.C.muted},children:"Data status"}),(0,f.jsxs)(l.default,{role:"status",...(0,s.webOnly)({'aria-live':'polite'}),accessibilityLiveRegion:"polite",accessibilityLabel:e.a11y,style:{gap:4,paddingBottom:4},children:[(0,f.jsxs)(l.default,{style:[r.s.row,{gap:8,alignItems:'flex-start'}],children:[(0,f.jsx)(r.Icon,{name:e.neutral?'info':'fresh'===e.tone?'database':'alert-circle',size:15,color:e.neutral?r.C.muted:o}),(0,f.jsx)(r.T,{style:{flex:1,fontSize:13,lineHeight:19,fontFamily:'InterSemi',color:o},children:e.headline})]}),(0,f.jsx)(r.T,{style:{fontSize:11,lineHeight:17,color:r.C.muted},children:e.detail})]}),!!e.warning&&(0,f.jsxs)(l.default,{style:[r.s.row,{gap:8,alignItems:'flex-start',padding:9,borderRadius:9,backgroundColor:y[e.warning.tone],borderWidth:1,borderColor:h[e.warning.tone]+'55'}],children:[(0,f.jsx)(r.Icon,{name:"alert-triangle",size:14,color:h[e.warning.tone]}),(0,f.jsx)(r.T,{style:{flex:1,fontSize:11,lineHeight:17,color:h[e.warning.tone]},children:e.warning.text})]}),(0,f.jsx)(l.default,{style:{height:1,backgroundColor:r.C.line,marginVertical:6}}),e.rows.map(e=>(0,f.jsx)(x,{label:e.label,value:e.value,note:e.note,tone:e.tone},e.key)),(0,f.jsx)(l.default,{style:{height:1,backgroundColor:r.C.line,marginVertical:6}}),(0,f.jsx)(r.T,{style:{fontSize:11,lineHeight:17,color:r.C.muted},children:e.expectation}),!!t&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(l.default,{style:{height:1,backgroundColor:r.C.line,marginVertical:6}}),(0,f.jsxs)(l.default,{role:"status",accessibilityLabel:t.a11y,style:{gap:4,padding:9,borderRadius:9,backgroundColor:r.C.amberBg,borderWidth:1,borderColor:r.C.amber+'55'},children:[(0,f.jsxs)(l.default,{style:[r.s.row,{gap:8,alignItems:'flex-start'}],children:[(0,f.jsx)(r.Icon,{name:"alert-triangle",size:14,color:r.C.amber}),(0,f.jsx)(r.T,{style:{flex:1,fontSize:12,lineHeight:18,fontFamily:'InterSemi',color:r.C.amber},children:t.headline})]}),(0,f.jsx)(r.T,{style:{fontSize:11,lineHeight:17,color:r.C.amber},children:t.detail}),(0,f.jsx)(r.T,{style:{fontSize:10,lineHeight:15,color:r.C.muted},children:u.FNO_SEPARATE_TEXT})]})]})]})}},882,[11,13,278,821,875,869,879,880,6]); 976__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ComingSoonPanel=function({message:e,headline:o,compact:u=!1}){const h=(0,s.comingSoonView)(e,o);return(0,c.jsxs)(l.default,{role:"status",accessibilityLabel:h.a11y,style:{alignItems:'flex-start',gap:12,padding:u?16:24,borderRadius:14,borderWidth:1,borderColor:t.C.line,backgroundColor:t.C.paper,maxWidth:720},children:[(0,c.jsxs)(l.default,{style:{flexDirection:'row',alignItems:'center',gap:10},children:[(0,c.jsx)(t.Icon,{name:"info",size:18,color:t.C.muted}),(0,c.jsx)(t.T,{role:"heading","aria-level":2,style:{fontFamily:'ManropeBold',fontSize:u?16:18,lineHeight:u?22:26,color:t.C.ink,flexShrink:1},children:h.headline})]}),(0,c.jsx)(t.T,{style:{fontSize:14,lineHeight:21,color:t.C.muted},children:h.message}),(0,c.jsx)(t.Button,{label:h.action.label,kind:"outline",icon:"sliders",onPress:()=>{try{n.router.push(h.action.route)}catch{}}})]})},r(d[0]);
976var e,o=r(d[1]),l=(e=o)&&e.__esModule?e:{default:e},n=r(d[2]),t=r(d[3]),s=r(d[4]),c=r(d[5])},883,[11,13,252,821,820,6]); 977__d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.noteStudiesOff=function(e){const t=(0,c.studiesOff)(e);t&&f!==t&&(f=t,h.forEach(e=>e()));return t},_e.useStudiesOff=function(){const e=(0,u.useProduct)()?.research,[n,s]=(0,t.useState)(f);return(0,t.useEffect)(()=>{const e=()=>s(f);return h.add(e),e(),()=>{h.delete(e)}},[]),(0,c.studiesOffFor)(e,n)},_e.StudiesOffPanel=function({message:e,compact:t=!1}){return(0,l.jsxs)(s.default,{role:"status",accessibilityLabel:e,style:{flexDirection:'row',alignItems:'center',gap:10,padding:t?14:20,borderRadius:12,borderWidth:1,borderColor:o.C.line,backgroundColor:o.C.paper,maxWidth:640},children:[(0,l.jsx)(o.Icon,{name:"info",size:16,color:o.C.muted}),(0,l.jsx)(o.T,{style:{fontSize:14,lineHeight:21,color:o.C.muted,flexShrink:1},children:e})]})};var e,t=r(d[0]),n=r(d[1]),s=(e=n)&&e.__esModule?e:{default:e},o=r(d[2]),u=r(d[3]),c=r(d[4]),l=r(d[5]);let f=null;const h=new Set},884,[11,13,821,196,820,6]); 978__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.EvidencePanel=function(){const e=(0,d.useDiscoverRows)(),s=(0,d.useWorkspaceMatch)(e),n=(0,l.useProduct)();return'loading'===s.kind?(0,h.jsx)(o.Loading,{}):'error'===s.kind?(0,h.jsx)(t.default,{style:{flex:1,padding:16},children:(0,h.jsx)(o.Empty,{title:"Research couldn\u2019t load",detail:n.error})}):'empty'===s.kind?(0,h.jsx)(t.default,{style:{flex:1,padding:16},children:(0,h.jsx)(o.Empty,{icon:"bar-chart-2",title:"Choose a setup from Discover",detail:"Historical replay follows the active setup."})}):'none'!==s.kind&&s.match?(0,h.jsx)(f,{match:s.match,history:s.history},(0,c.matchKey)(s.match,s.history)):(0,h.jsxs)(t.default,{style:{flex:1,padding:16,gap:6},children:[(0,h.jsx)(o.T,{style:{fontFamily:'InterSemi'},children:s.outsideSetups.length?`No setup for ${s.symbol} within your filters`:`No stored setup for ${s.symbol} on ${s.timeframe}`}),(0,h.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:s.outsideSetups.length?`${s.outsideSetups.length} stored ${1===s.outsideSetups.length?'setup is':'setups are'} outside your filters. Pick one from the chart legend to replay its history.`:'There is no historical replay for this stock and timeframe. Pick a Discover result to replay its history.'})]})},r(_d[0]);var t=e(r(_d[1])),s=e(r(_d[2])),l=r(_d[3]),o=r(_d[4]),n=r(_d[5]),d=r(_d[6]),c=r(_d[7]),u=r(_d[8]),h=r(_d[9]);function f({match:e,history:d}){const f=(0,l.useProduct)(),y=(0,u.useStudiesOff)();return(0,h.jsxs)(t.default,{style:{flex:1,minHeight:0,paddingHorizontal:12},children:[(0,h.jsxs)(t.default,{style:[o.s.between,{paddingVertical:6,gap:8,flexWrap:'wrap'}],children:[(0,h.jsxs)(o.T,{numberOfLines:1,style:{fontSize:13,flexShrink:1},children:[(0,h.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:13},children:e.symbol})," \xb7 ",e.timeframe," \xb7 ",e.pattern_name," \xb7 historical replay"]}),!y&&(0,h.jsx)(s.default,{accessibilityRole:"link",accessibilityLabel:`Test these rules in Simulate for ${e.symbol}`,onPress:()=>(0,c.openSimulate)(f,e,d?.side),style:{minHeight:32,justifyContent:'center'},children:(0,h.jsx)(o.T,{style:{fontSize:12,color:o.C.green},children:"Test these rules in Simulate \u2192"})})]}),(0,h.jsx)(n.StockReplay,{match:e,onTest:y?void 0:()=>(0,c.openSimulate)(f,e,d?.side)})]})}},885,[11,13,375,196,821,886,870,863,884,6]); 979__d(function(g,r,_i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Metric=M,_e.EquityPlot=z,_e.HistoryChart=L,_e.exportStudy=$,_e.ReplayStudio=R,_e.StockReplay=function({match:e,onTest:n}){const i=(0,j.useStudiesOff)(),a='phone'!==(0,x.useLayoutMode)(),[l,o]=(0,t.useState)(null),[c,u]=(0,t.useState)(''),[h,p]=(0,t.useState)(S),[f,b]=(0,t.useState)(e.history[0]?.side||'long'),T=(0,_.jsxs)(_.Fragment,{children:[v.map(e=>(0,_.jsx)(x.Chip,{label:(0,y.money)(e),active:h===e,onPress:()=>p(e)},e)),e.history.length>1&&e.history.map(e=>(0,_.jsx)(x.Chip,{label:'long'===e.side?'Long history':'Short price history',active:f===e.side,onPress:()=>b(e.side)},e.side))]}),C=(e.history||[]).length>0;return(0,t.useEffect)(()=>{let t=!0;if(o(null),u(''),!i){if(C)return(0,y.api)('/api/replay?'+(0,y.cellQuery)(e,f)+'&capital='+h).then(e=>{t&&!(0,j.noteStudiesOff)(e)&&o(e)}).catch(e=>{t&&!(0,j.noteStudiesOff)(e)&&u(e.message)}),()=>{t=!1};u('No historical evidence for this setup, so there is nothing to replay.')}},[e.id,f,h,C,!!i]),i?(0,_.jsx)(s.default,{style:{flex:1,minHeight:0,paddingVertical:8},children:(0,_.jsx)(j.StudiesOffPanel,{message:i,compact:!0})}):(0,_.jsxs)(s.default,{style:{flex:1,minHeight:0},children:[a&&!l&&(0,_.jsx)(s.default,{style:[x.s.row,{gap:5,flexWrap:'wrap'}],children:T}),!a&&e.history.length>1&&(0,_.jsx)(s.default,{style:x.s.row,children:e.history.map(e=>(0,_.jsx)(x.Chip,{label:'long'===e.side?'Long history':'Short history',active:f===e.side,onPress:()=>b(e.side)},e.side))}),c?(0,_.jsx)(x.T,{style:{color:x.C.red},children:c}):l?(0,_.jsx)(R,{result:l,onTest:n,embedded:!0,capital:h,onCapital:p,toolbar:a?T:void 0}):(0,_.jsx)(x.Loading,{})]})};var t=r(d[0]),n=e(t),s=e(r(d[1])),i=e(r(d[2])),a=e(r(d[3])),l=e(r(d[4])),o=e(r(d[5]));r(d[6]),r(d[7]);var c=e(r(d[8])),u=r(d[9]),h=e(u),x=r(d[10]),y=r(d[11]),p=r(d[12]),f=r(d[13]),b=r(d[14]),j=r(d[15]),_=r(d[16]);const v=b.CAPITAL_CHOICES,S=b.DEFAULT_CAPITAL,T=240,C=420,k=720,w=200,P=e=>new Date((e||'').replace(' ','T')+'+05:30').getTime();function M({label:e,value:t}){return(0,_.jsxs)(s.default,{style:{flex:1,minWidth:120,gap:3},children:[(0,_.jsx)(x.T,{style:{fontSize:12,color:x.C.muted},children:e}),(0,_.jsx)(x.T,{style:{fontSize:18,fontFamily:'InterSemi'},children:t})]})}function z({curve:e=[],time:n,onTime:i,benchmark:l=[],height:o=250,normalized:c=!1}){const[p,f]=(0,t.useState)(500),[b,j]=(0,t.useState)('');if((0,t.useEffect)(()=>j(''),[e[0]?.time,e[e.length-1]?.time]),!e.length)return(0,_.jsx)(x.T,{children:"No account observations yet."});const v=Math.max(280,p),S=o,T=62,C=n||b||[e[e.length-1].time,l[l.length-1]?.time||''].sort().at(-1),k=e.map(e=>e.equity),w=Math.min(...k,...l.map(e=>e.equity)),M=Math.max(...k,...l.map(e=>e.equity)),z=.08*(M-w)||100,L=Math.min(P(e[0].time),l.length?P(l[0].time):1/0),$=Math.max(P(e[e.length-1].time),l.length?P(l[l.length-1].time):0),R=$-L||1,I=e=>T+(P(e)-L)/R*(v-T-14),E=e=>20+(M+z-e)/(M-w+2*z)*(S-36-20),B=e.filter(e=>e.time<=C),F=B[B.length-1]||e[0],N=e=>e.map((e,t)=>`${t?'L':'M'}${I(e.time)},${E(e.equity)}`).join(' ');return(0,_.jsxs)(s.default,{onLayout:e=>f(e.nativeEvent.layout.width),style:{gap:6},children:[(0,_.jsxs)(s.default,{style:x.s.between,children:[(0,_.jsx)(x.T,{style:{fontSize:12,color:x.C.muted},children:"Account equity \xb7 INR"}),(0,_.jsx)(x.T,{style:{fontFamily:'InterSemi',color:F.equity>=e[0].equity?x.C.green:x.C.red},children:(0,y.money)(F.equity,2)})]}),(0,_.jsx)(a.default,{accessibilityRole:"button",accessibilityLabel:"Inspect a date on the account curve",onPress:t=>{const n=t.nativeEvent,s=t.currentTarget?.getBoundingClientRect?.(),a=Number.isFinite(n.locationX)?n.locationX:n.clientX-s.left,l=L+Math.max(0,Math.min(1,(a-T)/(v-T-14)))*R;let o=0;for(;o<e.length-1&&P(e[o].time)<l;)o++;i?i(e[o].time):j(e[o].time)},children:(0,_.jsxs)(h.default,{width:"100%",height:S,viewBox:`0 0 ${v} ${S}`,pointerEvents:"none",children:[[0,1,2,3].map(e=>{const t=w+(M-w)*e/3;return(0,_.jsxs)(u.G,{children:[(0,_.jsx)(u.Line,{x1:T,x2:v-14,y1:E(t),y2:E(t),stroke:x.C.line}),(0,_.jsx)(u.Text,{x:54,y:E(t)+4,textAnchor:"end",fill:x.C.muted,fontSize:11,children:Math.round(t).toLocaleStr
979ing('en-IN')})]},e)}),!!l.length&&(0,_.jsx)(u.Path,{d:N(l.filter(e=>e.time<=C)),stroke:x.C.muted,strokeWidth:1,strokeDasharray:"4 4",fill:"none"}),B.length>1&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u.Path,{d:N(B)+`L${I(F.time)},${S-36}L${I(B[0].time)},${S-36}Z`,fill:x.C.green,opacity:.07}),(0,_.jsx)(u.Path,{d:N(B),stroke:x.C.green,strokeWidth:2,fill:"none"})]}),(0,_.jsx)(u.Line,{x1:I(F.time),x2:I(F.time),y1:20,y2:S-36,stroke:x.C.green,opacity:.35}),(0,_.jsx)(u.Circle,{cx:I(F.time),cy:E(F.equity),r:3.5,fill:x.C.green}),[L,L+($-L)/2,$].map(e=>({time:new Date(e+198e5).toISOString().slice(0,10)+' 00:00:00'})).map((e,t)=>(0,_.jsx)(u.Text,{x:0===t?T:2===t?v-14:I(e.time),y:S-10,textAnchor:0===t?'start':2===t?'end':'middle',fill:x.C.muted,fontSize:11,children:(0,y.dateText)(e.time)},t))]})}),(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:[(0,y.dateText)(C||''),!c&&` \xb7 Cash ${(0,y.money)(F.cash,2)} \xb7 Open P&L ${(0,y.money)(F.unrealized,2)} \xb7 Decline ${F.drawdown_pct?.toFixed(2)}%`]})]})}function L({bundle:e,cursor:n,height:i=270}){const[a,c]=(0,t.useState)(500),[b,j]=(0,t.useState)(!1),v=(0,t.useRef)(new l.default.Value(0)).current,S=e?.bars||[],T=Math.max(0,Math.min(n??S.length-1,S.length-1)),C=S.slice(0,T+1),k=T>=e?.signal_index,w=k?e?.shape:null;if((0,t.useEffect)(()=>{o.default.isReduceMotionEnabled().then(j)},[]),(0,t.useEffect)(()=>{v.setValue(0);const e=l.default.timing(v,{toValue:1,duration:b?0:1300,useNativeDriver:!1});return k&&e.start(),()=>e.stop()},[e,k,b]),!C.length)return(0,_.jsx)(x.T,{children:"No chart candles available."});const P=Math.max(280,a),M=i,z=62,L=Math.max(0,Math.min(w?.start_index??e?.shape?.start_index??0,T)-8),$=C.slice(L),R=Math.min(...$.map(e=>e.low)),I=Math.max(...$.map(e=>e.high)),E=.1*(I-R)||1,B=(P-8-z)/Math.max(15,$.length),F=e=>8+(e-L+.5)*B,N=e=>22+(I+E-e)/(I-R+2*E)*(M-38-22),q=(0,p.patternGeometry)(w,S.slice(0,e.signal_index+1)),W=(w?.lines||[]).filter(e=>'anchors'!==e.role&&e.points?.length>1),O=e.trade,A=C[C.length-1];return(0,_.jsxs)(s.default,{style:{gap:6},onLayout:e=>c(e.nativeEvent.layout.width),children:[(0,_.jsxs)(s.default,{style:x.s.between,children:[(0,_.jsx)(x.T,{style:{fontSize:12,color:x.C.green},children:k?'Pattern qualified \xb7 historical drawing':'Formation in progress'}),(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:[e.timeframe," \xb7 INR"]})]}),(0,_.jsxs)(h.default,{width:"100%",height:M,viewBox:`0 0 ${P} ${M}`,children:[[0,1,2,3].map(e=>{const t=R+(I-R)*e/3;return(0,_.jsxs)(u.G,{children:[(0,_.jsx)(u.Line,{x1:8,x2:P-z,y1:N(t),y2:N(t),stroke:x.C.line}),(0,_.jsx)(u.Text,{x:P-z+8,y:N(t)+4,fontSize:11,fill:x.C.muted,children:Math.round(t).toLocaleString('en-IN')})]},e)}),$.map((e,t)=>{const n=e.close>=e.open?x.C.green:x.C.red;return(0,_.jsxs)(u.G,{children:[(0,_.jsx)(u.Line,{x1:F(L+t),x2:F(L+t),y1:N(e.high),y2:N(e.low),stroke:n,strokeWidth:1}),(0,_.jsx)(u.Rect,{x:F(L+t)-.28*B,y:Math.min(N(e.open),N(e.close)),width:Math.max(.8,.56*B),height:Math.max(1,Math.abs(N(e.close)-N(e.open))),fill:n})]},t)}),W.map((e,t)=>(0,_.jsx)(f.TracedLine,{points:e.points.map(e=>({x:F(e.index),y:N(e.value)})),progress:v,start:t/Math.max(1,W.length)*.7,end:(t+1)/Math.max(1,W.length)*.7,color:'curve'===e.role?x.C.curve:x.C.green},t)),q.swings.length>1&&(0,_.jsx)(f.TracedLine,{points:q.swings.map(e=>({x:F(e.index),y:N(e.value)})),progress:v,start:.7,end:1,color:x.C.amber}),O&&T>=e.entry_index&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u.Line,{x1:F(e.entry_index),x2:F(e.entry_index),y1:22,y2:M-38,stroke:x.C.amber,strokeDasharray:"3 3"}),(0,_.jsx)(u.Text,{x:Math.min(P-z-35,F(e.entry_index)+5),y:32,fontSize:11,fill:x.C.amber,children:"Entry"})]}),O&&T>=e.exit_index&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u.Circle,{cx:F(e.exit_index),cy:N(O.raw_exit??O.exit),r:5,fill:x.C.bg,stroke:x.C.ink}),(0,_.jsx)(u.Text,{x:Math.min(P-z-28,F(e.exit_index)+5),y:M-38-10,fontSize:11,fill:x.C.ink,children:"Exit"})]}),(0,_.jsx)(u.Text,{x:8,y:M-10,fontSize:11,fill:x.C.muted,children:(0,y.dateText)($[0].time)}),(0,_.jsx)(u.Text,{x:P-z,y:M-10,textAnchor:"end",fontSize:11,fill:x.C.muted,children:(0,y.dateText)(A.end)})]}),(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:[(0,y.dateText)(A.time)," \xb7 ",A.time.slice(11,16)," IST \xb7 Close ",(0,y.money)(A.close)]})]})}async function $(e){const t=['study_id','assumptions','rule','study_version','evidence_run','validation','symbol','timeframe','pattern','side','entry_time','exit_time','quantity','entry','exit','costs','net_pnl','net_return_pct','exit_reason'],n=[t.join(','),...e.trades.map(n=>t.map(t=>{return s='study_id'===t?e.study_id||'original-baseline':'assumptions'===t?JSON.stringify(e.settings):'rule'===t?JSON.stringify(n.rule):'study_version'===t?e.engine_version||'legacy':'evidence_run'===t?e.run:'validation'===t?e.validation:n[t],'"'+String(s??'').replace(/"/g,'""')+'"';var s}).join(','))].join('\r\n');{const e=document.createElement('a'),t=URL.createObjectURL(new Blob([n],{type:'text/csv;charset=utf-8'}));e.href=t,e.download='kanida-historical-trades.csv',e.click(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}}function R({result:e,jobId:l,onTest:o,actionLabel:u="Test these stocks and rules",embedded:h=!1,capital:p,onCapital:f,onPlan:b,toolbar:S}){const[P,R]=(0,t.useState)(0),[I,E]=(0,t.useState)('replay'),[B,F]=(0,t.useState)(!1),[N,q]=(0,t.useState)(!1),[W,O]=(0,t.useState)(e.f
979irst_chart),[A,H]=(0,t.useState)(e.first_chart?.signal_index||0),[V,D]=(0,t.useState)(!1),[U,G]=(0,t.useState)(1),[J,X]=(0,t.useState)(''),[K,Q]=(0,t.useState)(900),[Z,Y]=(0,t.useState)('pattern'),[ee,te]=(0,t.useState)(e.first_chart?.bars?.[e.first_chart.signal_index]?.end||e.curve?.[0]?.time),[ne,se]=(0,t.useState)(!1),ie=(0,t.useRef)(0),re=(0,t.useRef)(null),ae=(0,t.useRef)(!1),le=N?e.skipped:B?e.occurrences:e.trades,oe=le?.[P],[de,ce]=(0,t.useState)(!1),[ue,he]=(0,t.useState)(100),[me,xe]=(0,t.useState)(50),[ye,pe]=(0,t.useState)(500),[fe,ge]=(0,t.useState)(!1);function be(e){ae.current=!1,re.current=null,D(!1),R(Math.max(0,Math.min(le.length-1,e)))}function je(t){ae.current=!1,D(!1),te(t);const n=e.trades.findIndex(e=>e.entry_time<=t&&e.exit_time>=t);if(n>=0&&(B||N||n!==P))re.current=t,q(!1),F(!1),R(n);else if(W){let e=W.bars.findIndex(e=>e.end>=t);H(e<0?W.bars.length-1:e)}}(0,t.useEffect)(()=>{R(0),F(!1),q(!1),ae.current=!1,re.current=null,O(e.first_chart),H(e.first_chart?.signal_index||0),te(e.first_chart?.bars?.[e.first_chart.signal_index]?.end||e.curve?.[0]?.time),D(!1)},[e]),(0,t.useEffect)(()=>{if(!oe)return void O(null);const t=++ie.current;X(''),ce(!0),O(null);const n=l?`/api/studies/${l}/chart?${B?'occurrence':'trade'}=${oe.id}`:'/api/replay/chart?'+new URLSearchParams({symbol:oe.symbol,timeframe:oe.timeframe,pattern:oe.pattern,side:oe.side,signal:String(oe.signal_index),run:e.run});return(0,y.api)(n).then(e=>{if(t!==ie.current)return;if((0,j.noteStudiesOff)(e))return D(!1),void ce(!1);const n=re.current;re.current=null;let s=n?e.bars.findIndex(e=>e.end>=n):ae.current?Math.max(0,(e.shape?.start_index||0)-3):e.signal_index;s<0&&(s=e.bars.length-1),ae.current&&(s=Math.max(s,Math.max(0,(e.shape?.start_index||0)-3))),O(e),H(s),te(n&&n>e.bars[s]?.end?n:e.bars[s]?.end),ce(!1)}).catch(e=>{t===ie.current&&((0,j.noteStudiesOff)(e)||X(e.message),D(!1),ce(!1))}),()=>{ie.current++}},[oe?.id,B,N,l,e.run]),(0,t.useEffect)(()=>{if(!V||!W||de)return;const e=setTimeout(()=>{if(A>=W.bars.length-1)return void(ae.current&&P<le.length-1?(re.current=ee,R(P+1)):(D(!1),ae.current=!1));const e=Math.min(W.bars.length-1,A+U);H(e),te(t=>ae.current&&t>W.bars[e].end?t:W.bars[e].end)},400);return()=>clearTimeout(e)},[V,W,U,A,de,P]);const ve=!!W&&W.symbol===oe?.symbol&&W.pattern===oe?.pattern&&W.timeframe===oe?.timeframe&&W.signal_index+W.offset===oe?.signal_index,{height:Se}=(0,c.default)(),Te=K>=x.BREAKPOINTS.tablet,Ce=Se<k,ke=Te&&Ce,we=Te?Ce?270:282:398,Pe=e.summary||{},Me=e.curve?.[e.curve.length-1],ze=Math.max(T,Math.min(C,ye-we)),Le='replay'!==I||ke||ye<we+T,$e=Le?i.default:s.default,Re=t=>(0,_.jsx)(z,{height:t,curve:e.curve,time:ee,onTime:je,benchmark:ne?e.benchmark?.curve:[]});return(0,_.jsxs)(s.default,{style:{flex:1,minHeight:0},onLayout:e=>{Q(e.nativeEvent.layout.width),pe(e.nativeEvent.layout.height)},children:[(0,_.jsxs)(i.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:{flexGrow:0,minHeight:52,maxHeight:52},contentContainerStyle:{alignItems:'center',gap:6,paddingVertical:4},children:[[['replay','Visual replay'],['results','Results'],['trades','Trades'],['stocks','Stock comparison'],['rules','Rules & data'],...e.folds?.length?[['walkforward','Walk-forward periods']]:[]].map(([e,t])=>(0,_.jsx)(x.Chip,{label:t,active:I===e,onPress:()=>{E(e),D(!1)}},e)),!!S&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(s.default,{style:{width:1,height:28,backgroundColor:x.C.line,marginHorizontal:4}}),S]})]}),(0,_.jsxs)($e,{...Le?{showsVerticalScrollIndicator:!1,contentContainerStyle:{gap:'replay'===I?6:14,paddingBottom:12}}:{},style:{flex:1,minHeight:0,...Le?{}:{gap:6}},children:['replay'!==I&&(0,_.jsxs)(s.default,{style:x.s.between,children:[(0,_.jsx)(x.T,{style:{fontSize:12,color:e.legacy?x.C.amber:x.C.green},children:e.validation}),(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:[Pe.trades||0," executed \xb7 ",Pe.skipped||0," skipped"]})]}),'replay'===I&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(s.default,{style:[x.s.between,{flexWrap:'wrap'}],children:[(0,_.jsxs)(s.default,{style:{flex:1,minWidth:170},children:[(!h||Te)&&(0,_.jsxs)(x.T,{style:{fontFamily:'InterSemi',fontSize:16},children:[oe?.symbol||'No historical trades'," ",oe?.timeframe," \xb7 ",oe?.pattern_name||W?.pattern_name]}),(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:["Formation ",(0,y.dateText)(oe?.formation_start)," \u2192 ",(0,y.dateText)(oe?.signal_time||oe?.time)," \xb7 ",N?'Skipped signal':B?'Occurrence':'Trade'," ",le?.length?P+1:0," / ",le?.length||0]})]}),(0,_.jsxs)(s.default,{style:[x.s.row,{gap:0}],children:[(0,_.jsx)(a.default,{accessibilityRole:"button",accessibilityLabel:"Previous instance",onPress:()=>be(P-1),disabled:0===P,style:{padding:12,opacity:0===P?.3:1},children:(0,_.jsx)(x.Icon,{name:"chevron-left"})}),(0,_.jsx)(a.default,{accessibilityRole:"button",accessibilityLabel:"Next instance",onPress:()=>be(P+1),disabled:P>=le.length-1,style:{padding:12,opacity:P>=le.length-1?.3:1},children:(0,_.jsx)(x.Icon,{name:"chevron-right"})})]})]}),l&&Te&&!Ce&&(0,_.jsx)(x.Checkbox,{checked:B,label:"Include every detected occurrence, including untraded signals",onChange:e=>{q(!1),F(e),R(0),D(!1)}}),!Te&&(0,_.jsxs)(s.default,{style:x.s.row,children:[(0,_.jsx)(x.Chip,{label:"Pattern",active:'pattern'===Z,onPress:()=>Y('pattern')}),(0,_.jsx)(x.Chip,{label:"Money curve",active:'equity'===Z,onPress:()=>Y('equity')})]}),N&&(0,_.jsx)(x.T,{style:{fontSize:12,color:x.C.amber},children:oe?.skipped_reason}),!!J&&(0,_.jsx)(x.T,{style:{color:x.C.red},children:J}),(0,_.jsxs)(s.default,{style:{flexDirection:Te&&!ke?'row':'column',gap:18},children:[(Te||'pattern'===Z)&&(0,_.jsx)(s.default,{style:{flex:1,minWidth:0,backgroundColor:x.C.dark,padding:10,borderRadius:10},children:!oe||!de&&ve?W?(0,_.jsx)(L,{bundle:W,cursor:A,height:ze}):(0,_.jsx)(x.T,{children:"No entry matched these rules. Inspect all occurrences or change the study settings."}):(0,_.jsx)(x.Loading,{})}),(Te&&!ke||!Te&&'equity'===Z)&&(0,_.jsx)(s.default,{style:{flex:1,minWidth:0,backgroundColor:x.C.dark,padding:10,borderRadius:10},children:Re(ze)})]}),(0,_.jsxs)(s.default,{style:[x.s.row,{flexWrap:'wrap',gap:5}],children:[(0,_.jsx)(x.Button,{label:V?'Pause':Te?'Play this instance':'Play',icon:V?'pause':'play',kind:"soft",disabled:!W,onPress:()=>
979{if(ae.current=!1,!V&&W){const e=Math.max(0,(W.shape?.start_index||0)-3);H(e),te(W.bars[e]?.end)}D(!V)}}),Te&&(0,_.jsx)(x.Button,{label:B?"Play all occurrences":N?"Play skipped signals":"Play all trades",kind:"outline",disabled:!W||!le.length,onPress:()=>{if(ae.current=!0,re.current=null,0!==P)R(0);else{const e=Math.max(0,(W.shape?.start_index||0)-3);H(e),te(W.bars[e]?.end)}D(!0)}}),(0,_.jsx)(x.Button,{label:`${U}\xd7 speed`,kind:"ghost",onPress:()=>G(1===U?3:3===U?8:1)}),Te&&!Ce?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(x.Button,{label:"Step candle",kind:"ghost",disabled:!W||A>=W.bars.length-1,onPress:()=>{D(!1),H(A+1),te(W.bars[A+1].end)}}),(0,_.jsx)(x.Button,{label:"Show final account",kind:"ghost",onPress:()=>{D(!1),te(Me?.time),W&&H(W.bars.length-1)}}),e.benchmark&&(0,_.jsx)(x.Button,{label:ne?'Hide benchmark':'Compare buy & hold',kind:"ghost",onPress:()=>se(!ne)})]}):(0,_.jsx)(x.Button,{label:"More",kind:"outline",icon:"more-horizontal",onPress:()=>ge(!0)})]}),W&&n.default.createElement('input',{type:'range','aria-label':'Historical candle timeline',min:0,max:W.bars.length-1,value:A,onChange:e=>{ae.current=!1,D(!1);const t=Number(e.target.value);H(t),te(W.bars[t].end)},style:{width:'100%',minHeight:22,accentColor:x.C.green,cursor:'pointer'}}),oe?.entry_time&&!N&&(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:["Entry ",(0,y.dateText)(oe.entry_time)," ",oe.entry_time.slice(11,16)," \u2192 Exit ",(0,y.dateText)(oe.exit_time||oe.exit_candle_end)," \xb7 ",oe.quantity," shares \xb7 ",(0,y.money)(oe.net_pnl,2)," net \xb7 ",oe.exit_reason?.replaceAll('_',' ')]}),ke&&(0,_.jsx)(s.default,{style:{backgroundColor:x.C.dark,padding:10,borderRadius:10},children:Re(w)})]}),'results'===I&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(s.default,{style:[x.s.row,{flexWrap:'wrap',gap:20}],children:[(0,_.jsx)(M,{label:"Starting capital",value:(0,y.money)(Pe.starting_capital)}),(0,_.jsx)(M,{label:"Ending account",value:(0,y.money)(Pe.ending_equity,2)}),(0,_.jsx)(M,{label:"Net profit / loss",value:(0,y.money)(Pe.net_profit,2)}),(0,_.jsx)(M,{label:"Average net / trade",value:(0,y.pct)(Pe.average_return_pct)}),(0,_.jsx)(M,{label:"Profitable trades",value:`${Pe.wins||0} of ${Pe.trades||0}`}),(0,_.jsx)(M,{label:"Maximum equity decline",value:(0,y.pct)(-Pe.max_drawdown_pct)}),(0,_.jsx)(M,{label:"Best completed trade",value:(0,y.pct)(Pe.best_trade_pct)}),(0,_.jsx)(M,{label:"Worst completed trade",value:(0,y.pct)(Pe.worst_trade_pct)}),(0,_.jsx)(M,{label:"Median hold",value:`${Pe.median_holding_days??'\u2014'} calendar ${1===Pe.median_holding_days?'day':'days'}`}),(0,_.jsx)(M,{label:"Median hold in candles",value:String(Pe.median_holding_bars??'\u2014')}),(0,_.jsx)(M,{label:"Largest favorable move",value:(0,y.pct)(Pe.max_favorable_pct)}),(0,_.jsx)(M,{label:"Largest adverse move",value:null==Pe.max_adverse_pct?'\u2014':(0,y.pct)(-Pe.max_adverse_pct)}),(0,_.jsx)(M,{label:"Total fees assumed",value:(0,y.money)(Pe.total_costs,2)})]}),(0,_.jsx)(z,{curve:e.curve,benchmark:e.benchmark?.curve,onTime:e=>{E('replay'),je(e)}}),e.benchmark&&(0,_.jsx)(x.T,{style:{fontSize:12,color:x.C.muted},children:e.benchmark.label}),(0,_.jsx)(x.T,{style:{fontFamily:'InterSemi'},children:"What the evidence says"}),(0,_.jsxs)(x.T,{children:[Pe.trades?`${Pe.wins} of ${Pe.trades} completed trades were profitable. The average net result was ${(0,y.pct)(Pe.average_return_pct)} per trade.`:'No trades met the execution and evidence rules in this period.'," ",Pe.trades<20?'This is a small sample. A few trades can change the result.':'']}),e.contributions?.slice(0,8).map(t=>(0,_.jsxs)(a.default,{accessibilityRole:"button",accessibilityLabel:`Replay ${t.symbol} trades`,onPress:()=>{R(e.trades.findIndex(e=>e.symbol===t.symbol)),F(!1),E('replay')},style:[x.s.between,{paddingVertical:10,borderBottomWidth:1,borderColor:x.C.line}],children:[(0,_.jsx)(x.T,{children:t.symbol}),(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:[t.wins," / ",t.trades," wins \xb7 ",(0,y.pct)(t.average_return_pct)," avg."]}),(0,_.jsx)(x.T,{children:(0,y.money)(t.net_pnl,2)})]},t.symbol))]}),'trades'===I&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(s.default,{style:x.s.between,children:[(0,_.jsx)(x.T,{children:"Every executed trade"}),(0,_.jsx)(x.Button,{label:"Export CSV",kind:"outline",onPress:()=>$({...e,study_id:l})})]}),e.trades.slice(0,ue).map((e,t)=>(0,_.jsxs)(a.default,{accessibilityRole:"button",accessibilityLabel:`Replay trade ${t+1} ${e.symbol}`,onPress:()=>{q(!1),F(!1),R(t),E('replay')},style:{paddingVertical:13,borderBottomWidth:1,borderColor:x.C.line,ga
979p:4},children:[(0,_.jsxs)(s.default,{style:x.s.between,children:[(0,_.jsxs)(x.T,{children:[e.symbol," \xb7 ",e.pattern_name||W?.pattern_name," \xb7 ",e.timeframe]}),(0,_.jsx)(x.T,{style:{color:e.net_pnl>=0?x.C.green:x.C.red},children:(0,y.money)(e.net_pnl,2)})]}),(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:[(0,y.dateText)(e.entry_time)," \u2192 ",(0,y.dateText)(e.exit_time)," \xb7 ",e.quantity," shares \xb7 ",(0,y.pct)(e.net_return_pct)," \xb7 ",e.holding_bars," candles"]})]},e.id)),e.trades.length>ue&&(0,_.jsx)(x.Button,{label:"Show 100 more trades",kind:"outline",onPress:()=>he(ue+100)}),(0,_.jsx)(x.T,{children:"Skipped signals"}),e.skipped.slice(0,me).map((e,t)=>(0,_.jsxs)(a.default,{accessibilityRole:"button",accessibilityLabel:`Inspect skipped signal ${t+1} ${e.symbol}`,onPress:()=>{q(!0),F(!1),R(t),E('replay')},style:{paddingVertical:8},children:[(0,_.jsxs)(x.T,{children:[e.symbol," \xb7 ",e.timeframe]}),(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:[(0,y.dateText)(e.entry_time||e.signal_time)," \xb7 ",e.skipped_reason]})]},e.id)),e.skipped.length>me&&(0,_.jsx)(x.Button,{label:"Show 50 more skipped signals",kind:"outline",onPress:()=>xe(me+50)})]}),'stocks'===I&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(x.T,{children:"Each stock keeps its own results. These are contributions to the same shared account."}),(e.contributions||[]).map(t=>(0,_.jsxs)(a.default,{accessibilityRole:"button",accessibilityLabel:`Replay ${t.symbol} contribution`,onPress:()=>{q(!1),be(e.trades.findIndex(e=>e.symbol===t.symbol)),F(!1),E('replay')},style:{padding:14,borderBottomWidth:1,borderColor:x.C.line,gap:7},children:[(0,_.jsxs)(s.default,{style:x.s.between,children:[(0,_.jsx)(x.T,{children:t.symbol}),(0,_.jsx)(x.T,{style:{color:t.net_pnl>=0?x.C.green:x.C.red},children:(0,y.money)(t.net_pnl,2)})]}),(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:[t.wins," of ",t.trades," profitable \xb7 ",(0,y.pct)(t.average_return_pct)," average per trade",t.trades<20?' \xb7 Small sample':'']})]},t.symbol)),!e.contributions?.length&&(0,_.jsxs)(x.T,{children:["This replay contains ",oe?.symbol||'no executed stock trades'," only."]})]}),'rules'===I&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(x.T,{style:{fontFamily:'InterSemi'},children:"Settings saved with this study"}),Object.entries(e.settings||{}).filter(([e])=>!['run','symbols','candidate_family'].includes(e)).map(([e,t])=>(0,_.jsxs)(s.default,{style:[x.s.between,{alignItems:'flex-start',gap:16,paddingVertical:6}],children:[(0,_.jsx)(x.T,{style:{fontSize:12,color:x.C.muted,flex:1},children:e.replaceAll('_',' ')}),(0,_.jsx)(x.T,{style:{fontSize:12,flex:2},children:'object'==typeof t?JSON.stringify(t):String(t)})]},e)),(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:["Study ",l||'original baseline'," \xb7 Evidence ",e.run," \xb7 Engine ",e.engine_version||'original research']}),e.curve_sampled&&(0,_.jsx)(x.T,{style:{fontSize:12,color:x.C.muted},children:"The curve is sampled for display. Maximum decline uses every available account observation."}),e.settings?.candidate_family&&(0,_.jsx)(x.T,{style:{fontSize:12,color:x.C.muted},children:"The candidate rule family is frozen with the saved study and included in its CSV assumptions."}),e.coverage?.map(e=>(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:[e.symbol," \xb7 ",e.timeframe," \xb7 ",(0,y.dateText)(e.first)," \u2192 ",(0,y.dateText)(e.last)," ",e.message||'']},e.symbol+e.timeframe))]}),'walkforward'===I&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(x.T,{children:"Each rule was selected using earlier completed trades. Cash continues across test periods."}),e.folds.map((e,t)=>(0,_.jsxs)(s.default,{style:{padding:14,gap:5,borderBottomWidth:1,borderColor:x.C.line},children:[(0,_.jsxs)(x.T,{children:[e.symbol," \xb7 ",e.timeframe," \xb7 ",e.pattern.replaceAll('_',' ')]}),(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:["Learn from ",e.learning_start," \xb7 Test ",e.test_start," to ",e.test_end]}),(0,_.jsx)(x.T,{children:e.rule?`${e.training_trades} learning trades \xb7 ${e.test_trades} executed test trades \xb7 ${(0,y.money)(e.net_pnl,2)}`:'No rule met the minimum positive learning evidence. No new trades in this period.'}),e.rule&&(0,_.jsxs)(x.T,{style:{fontSize:12,color:x.C.muted},children:["Hold \u2264 ",e.rule.hold," candles \xb7 ",e.rule.stop_atr?`${e.rule.stop_atr} ATR stop / ${e.rule.target_r}R target`:'Time exit']})]},t))]}),'replay'!==I&&(0,_.jsx)(x.T,{style:{fontSize:12,color:x.C.muted},children:e.note}),b&&'results'===I&&oe&&!N&&!B&&(0,_.jsx)(x.Button,{label:`Review ${oe.symbol} for AutoTrade`,icon:"zap",onPress:()=>b(oe)}),o&&'replay'!==I&&(0,_.jsx)(x.Button,{label:u,kind:"outline",icon:"sliders",onPress:o})]}),(0,_.jsxs)(x.Sheet,{visible:fe,title:"Replay controls",onClose:()=>ge(!1),children:[l&&(0,_.jsx)(x.Button,{label:B?"Show executed trades":"Include all detected occurrences",kind:"outline",onPress:()=>{q(!1),F(!B),R(0),D(!1),ge(!1)}}),f&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(x.T,{children:"Starting capital"}),(0,_.jsx)(s.default,{style:[x.s.row,{flexWrap:'wrap'}],children:v.map(e=>(0,_.jsx)(x.Chip,{label:(0,y.money)(e),active:p===e,onPress:()=>{f(e),ge(!1)}},e))})]}),(0,_.jsx)(x.Button,{label:B?"Play all occurrences":N?"Play skipped signals":"Play all historical trades",disabled:!W,onPress:()=>
979{if(ae.current=!0,re.current=null,R(0),0===P){const e=Math.max(0,(W.shape?.start_index||0)-3);H(e),te(W.bars[e]?.end)}D(!0),ge(!1)}}),(0,_.jsx)(x.Button,{label:"Step one candle",kind:"outline",disabled:!W||A>=W.bars.length-1,onPress:()=>{D(!1),H(A+1),te(W.bars[A+1].end),ge(!1)}}),(0,_.jsx)(x.Button,{label:"Show final account",kind:"outline",onPress:()=>{D(!1),te(Me?.time),W&&H(W.bars.length-1),Y('equity'),ge(!1)}}),e.benchmark&&(0,_.jsx)(x.Button,{label:ne?'Hide benchmark':'Compare buy & hold',kind:"outline",onPress:()=>{se(!ne),ge(!1)}})]})]})}},886,[11,13,278,375,267,265,136,358,400,840,821,197,865,864,249,884,6]); 980__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"WatchWidget",{enumerable:!0,get:function(){return t.WatchWidget}}),Object.defineProperty(e,"WatchRow",{enumerable:!0,get:function(){return t.WatchRow}}),Object.defineProperty(e,"watchWidget",{enumerable:!0,get:function(){return t.watchWidget}}),Object.defineProperty(e,"watchWidgetMenu",{enumerable:!0,get:function(){return t.watchWidgetMenu}}),Object.defineProperty(e,"watchStatus",{enumerable:!0,get:function(){return t.watchStatus}}),Object.defineProperty(e,"useWatchRemoval",{enumerable:!0,get:function(){return t.useWatchRemoval}}),Object.defineProperty(e,"WATCH_WIDGET_KEY",{enumerable:!0,get:function(){return t.WATCH_WIDGET_KEY}}),Object.defineProperty(e,"WATCH_WIDGET_TITLE",{enumerable:!0,get:function(){return t.WATCH_WIDGET_TITLE}}),Object.defineProperty(e,"WATCH_WIDGET_SUBTITLE",{enumerable:!0,get:function(){return t.WATCH_WIDGET_SUBTITLE}}),Object.defineProperty(e,"EvidenceSummaryWidget",{enumerable:!0,get:function(){return n.EvidenceSummaryWidget}}),Object.defineProperty(e,"evidenceSummaryWidget",{enumerable:!0,get:function(){return n.evidenceSummaryWidget}}),Object.defineProperty(e,"EVIDENCE_WIDGET_KEY",{enumerable:!0,get:function(){return n.EVIDENCE_WIDGET_KEY}}),Object.defineProperty(e,"EVIDENCE_WIDGET_TITLE",{enumerable:!0,get:function(){return n.EVIDENCE_WIDGET_TITLE}});var t=r(d[0]),n=r(d[1])},887,[888,889]); 981__d(function(g,r,i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.watchStatus=y,_e.useWatchRemoval=b,_e.WatchRow=v,Object.defineProperty(_e,"WATCH_WIDGET_KEY",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"WATCH_WIDGET_TITLE",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"WATCH_WIDGET_SUBTITLE",{enumerable:!0,get:function(){return w}}),_e.watchWidgetMenu=C,_e.watchWidget=function(e={}){return{key:x,title:j,subtitle:w,menu:C(e),onClose:e.onClose,onMaximize:e.onMaximize,render:()=>(0,f.jsx)(R,{onOpenFull:e.onOpenFull,onDiscover:e.onDiscover})}},_e.WatchWidget=R;var t=r(_d[0]),n=e(r(_d[1])),s=e(r(_d[2])),o=r(_d[3]),l=r(_d[4]),c=r(_d[5]),d=r(_d[6]),u=r(_d[7]),m=r(_d[8]),h=r(_d[9]),f=r(_d[10]);function y(e,t){const n=(t||[]).find(t=>t.id===e.id);return{match:n,badge:n?n.candle_end!==e.candle_end?'NEW SNAPSHOT':'WAITING':'PATTERN ABSENT',tone:n?'amber':'red',detail:n?n.candle_end===e.candle_end?'The source candle has not changed since you added this setup.':'A new stored candle is available. Review the updated structure and history.':'This pattern is no longer in the latest stored scan.'}}function b(){const{refreshProduct:e,setToast:n}=(0,l.useProduct)(),[s,o]=(0,t.useState)(null),[u,m]=(0,t.useState)(!1);const h=(0,f.jsxs)(c.Sheet,{visible:!!s,onClose:()=>{u||o(null)},title:`Remove ${s?.symbol||''} from watch?`,children:[(0,f.jsxs)(c.T,{style:{fontSize:16,lineHeight:26},children:[s?.pattern_name," \xb7 ",s?.timeframe," will leave your watch. Its stored history is not changed, and
981you can add it again while the setup appears in Discover."]}),(0,f.jsx)(c.Button,{label:"Remove from watch",loading:u,onPress:async function(){if(s){m(!0);try{await(0,d.api)('/api/product/watch',{action:'remove',match_id:s.id}),await e(),n('Removed from your watchlist.'),o(null)}catch(e){n(e.message)}finally{m(!1)}}}}),(0,f.jsx)(c.Button,{label:"Keep watching",kind:"outline",disabled:u,onPress:()=>o(null)})]});return{removing:s,setRemoving:o,busy:u,sheet:h}}const p=c.C.green+'66';function v({item:e,variant:t="card",onRemove:o,onReview:d,onSelect:m,selected:b=!1,marker:v=!1}){const{matches:x,filters:j,state:w}=(0,l.useProduct)(),T=y(e,x),S=T.match;if('card'===t)return(0,f.jsxs)(n.default,{style:c.s.card,children:[(0,f.jsxs)(n.default,{style:c.s.between,children:[(0,f.jsx)(c.T,{style:{fontFamily:'ManropeBold',fontSize:22},children:e.symbol}),(0,f.jsx)(c.Badge,{label:T.badge,tone:T.tone})]}),(0,f.jsxs)(c.T,{style:{fontSize:12,color:c.C.muted},children:[e.pattern_name," \xb7 ",e.timeframe]}),(0,f.jsx)(c.T,{style:{fontSize:13},children:T.detail}),(0,f.jsxs)(n.default,{style:c.s.row,children:[S&&!!d&&(0,f.jsx)(c.Button,{label:`Review ${e.symbol}`,kind:"soft",onPress:()=>d(S)}),(0,f.jsx)(c.Button,{label:"Remove from watch",accessibilityLabel:`Remove ${e.symbol} ${e.pattern_name} ${e.timeframe} from watch`,kind:"outline",onPress:o})]})]});const C=S?(0,u.decision)(S,j):null,R=C?C.title.toUpperCase():T.badge,_=C?'review'===C.verdict?'green':'pass'===C.verdict?'red':'history'===C.verdict?'neutral':'amber':T.tone,W=(0,u.dataAgeDays)(S?.candle_end||e.candle_end),P=(0,u.isStale)(W,w?.source_stale),O=(0,u.dataAgeText)(W),A=`Open ${e.symbol} ${e.pattern_name} ${e.timeframe} on the chart. ${C?C.title:'Pattern absent from the latest stored scan'}. ${O}${P?', stale':''}.${'NEW SNAPSHOT'===T.badge?' New stored snapshot.':''}${b?' Active selection.':v?' Active symbol, selected elsewhere.':''}`;return(0,f.jsxs)(n.default,{style:[c.s.row,{gap:0,borderBottomWidth:1,borderColor:c.C.line}],children:[(0,f.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:A,accessibilityState:{selected:b},disabled:!m,onPress:()=>m?.(e,S),style:({pressed:e})=>({flex:1,minWidth:0,minHeight:48,justifyContent:'center',gap:2,paddingVertical:6,paddingLeft:9,paddingRight:4,borderLeftWidth:2,borderLeftColor:b?c.C.green:v?p:'transparent',backgroundColor:b?c.C.soft:e?c.C.paper:'transparent'}),children:[(0,f.jsxs)(n.default,{style:[c.s.row,{gap:6}],children:[(0,f.jsx)(c.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:13,flexShrink:1},children:e.symbol}),v&&(0,f.jsx)(n.default,{accessibilityElementsHidden:!0,importantForAccessibility:"no",style:{width:6,height:6,borderRadius:3,backgroundColor:p}}),(0,f.jsx)(n.default,{style:{flex:1}}),(0,f.jsx)(c.Badge,{label:R,tone:_})]}),(0,f.jsxs)(c.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16,color:c.C.muted},children:[e.pattern_name," \xb7 ",e.timeframe," \xb7 ",(0,f.jsxs)(c.T,{style:{fontSize:11,color:P?c.C.amber:c.C.muted},children:[O,P?' \xb7 stale':'']}),'NEW SNAPSHOT'===T.badge?' \xb7 new snapshot':'']})]}),(0,f.jsx)(h.IconButton,{icon:"x",label:`Remove ${e.symbol} ${e.pattern_name} ${e.timeframe} from watch`,tooltip:"Remove from watch",onPress:o})]})}const x='watch',j='Watch',w='My watch',T=e=>e||(()=>o.router.push('/watch')),S=e=>e||(()=>o.router.push('/chart'));function C({onOpenFull:e,onDiscover:t}={}){return[{label:'Open full view',icon:'maximize-2',onPress:T(e)},{label:'Discover setups',icon:'search',onPress:S(t)}]}function R({onOpenFull:e,onDiscover:t,framed:n=!1,limit:s=8}){const o=(0,f.jsx)(_,{onOpenFull:e,onDiscover:t,limit:s});return n?(0,f.jsx)(h.Widget,{title:j,subtitle:w,menu:C({onOpenFull:e,onDiscover:t}),children:o}):o}function _({onOpenFull:e,onDiscover:t,limit:o}){const{product:d,matches:u,loading:p,error:x,refresh:j,state:w}=(0,l.useProduct)(),{active:C,setActive:R,isActive:_}=(0,m.useActiveSymbol)(),W=b(),P=d?.watchlist||[],O=P.slice(0,o),A=(e,t)=>{R({symbol:e.symbol,timeframe:e.timeframe,matchId:t?e.id:void 0,source:'watch'})};let $;return $=p&&!P.length?(0,f.jsx)(c.T,{accessibilityLiveRegion:"polite",style:{fontSize:12,color:c.C.muted},children:"Loading your watch\u2026"}):x&&!w?(0,f.jsx)(h.WidgetError,{title:"Could not load your watch",message:x,onRetry:j}):P.length?(0,f.jsxs)(n.default,{style:{gap:8},children:[!!x&&(0,f.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Watch refresh failed. Retry",onPress:j,style:{minHeight:32,justifyContent:'center'},children:(0,f.jsx)(c.T,{style:{fontSize:11,color:c.C.amber},children:"Refresh failed \xb7 showing the last loaded watch \xb7 Retry"})}),(0,f.jsx)(n.default,{style:{borderWidth:1,borderColor:c.C.line,borderRadius:10,overflow:'hidden'},children:O.map(e=>{const t=y(e,u).match,n=!!C&&_(e.symbol,t?e.id:void 0)&&C.timeframe===e.timeframe&&(!!t||!C.matchId)&&'watch'===C.source,s=!n&&!!C&&C.symbol===String(e.symbol).toUpperCase();return(0,f.jsx)(v,{item:e,variant:"compact",selected:n,marker:s,onSelect:A,onRemove:()=>W.setRemoving(e)}
981,e.id)})}),P.length>o&&(0,f.jsx)(c.Button,{label:`Open full view \xb7 ${P.length-o} more`,kind:"ghost",onPress:T(e),style:{minHeight:36,paddingVertical:4}})]}):(0,f.jsxs)(n.default,{style:{gap:8},children:[(0,f.jsx)(c.T,{style:{fontFamily:'InterMedium',fontSize:13},children:"Add a setup from Discover"}),(0,f.jsx)(c.T,{style:{fontSize:12,lineHeight:18,color:c.C.muted},children:"Open a setup and choose Watch. Its pattern, timeframe and next conditions stay together here."}),(0,f.jsx)(c.Button,{label:"Discover setups",icon:"arrow-right",kind:"outline",onPress:S(t),style:{minHeight:38,paddingVertical:6}})]}),(0,f.jsxs)(f.Fragment,{children:[$,W.sheet]})}},888,[11,13,375,252,196,821,197,248,251,871,6]); 982__d(function(g,r,i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"EVIDENCE_WIDGET_KEY",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"EVIDENCE_WIDGET_TITLE",{enumerable:!0,get:function(){return v}}),_e.evidenceSummaryWidget=function(e={}){return{key:j,title:v,menu:e.onOpenEvidence?[{label:'Show evidence',icon:'bar-chart-2',onPress:e.onOpenEvidence}]:void 0,onClose:e.onClose,onMaximize:e.onMaximize,render:()=>(0,x.jsx)(S,{onOpenEvidence:e.onOpenEvidence,onPrepare:e.onPrepare})}},_e.EvidenceSummaryWidget=S;var t=r(_d[0]),n=e(r(_d[1])),s=e(r(_d[2])),o=r(_d[3]),l=r(_d[4]),d=r(_d[5]),c=r(_d[6]),u=r(_d[7]),m=r(_d[8]),y=r(_d[9]),f=r(_d[10]),h=r(_d[11]),p=r(_d[12]),b=r(_d[13]),x=r(_d[14]);const j='evidence',v='Evidence summary';function S({onOpenEvidence:e,onPrepare:t,framed:n=!1}){const s=(0,x.jsx)(C,{onOpenEvidence:e,onPrepare:t});return n?(0,x.jsx)(h.Widget,{title:v,children:s}):s}const E={fontSize:12,lineHeight:18,color:l.C.muted},T=(0,x.jsx)(l.T,{accessibilityLiveRegion:"polite",style:E,children:"Loading evidence\u2026"});function C({onOpenEvidence:e,onPrepare:t}){const d=(0,o.useProduct)(),{active:m,setActive:y}=(0,u.useActiveSymbol)(),f=(0,b.useDiscoverRows)().rows;if(!m)return(0,x.jsx)(l.T,{style:E,children:"Pick a setup to see its evidence"});const p=m.matchId?d.matches.find(e=>e.id===m.matchId):void 0;if(p&&p.symbol===m.symbol&&p.timeframe===m.timeframe){const n=(0,c.decision)(p,d.filters,m.side),s=p.history.find(e=>e.side===(m.side||n.history?.side))||n.history;return(0,x.jsx)(P,{match:p,active:m,onOpenEvidence:e,onPrepare:t},(0,b.matchKey)(p,s))}if(d.loading)return T;if(d.error&&!d.state)return(0,x.jsx)(h.WidgetError,{title:"Could not load evidence",message:d.error,onRetry:d.refresh});const j=d.matches.filter(e=>e.symbol===m.symbol&&e.timeframe===m.timeframe).slice(0,4);return(0,x.jsxs)(n.default,{style:{gap:8},children:[(0,x.jsxs)(l.T,{style:{fontFamily:'InterMedium',fontSize:13},children:["No stored setup selected for ",m.symbol]}),(0,x.jsx)(l.T,{style:E,children:m.matchId?'The selected setup is not in the latest stored scan, so no evidence is shown.':`Evidence belongs to one stored setup (pattern, side, exit rule and data end), not to the ${m.timeframe} chart as a whole.`}),j.length?(0,x.jsxs)(n.default,{style:{gap:4},children:[(0,x.jsxs)(l.T,{style:{fontSize:11,color:l.C.muted},children:["Stored setups for ",m.symbol," \xb7 ",m.timeframe]}),j.map(e=>{const t=!f.includes(e);return(0,x.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:`Select ${e.pattern_name} ${e.timeframe} for ${e.symbol}${t?', outside your filters':''}`,onPress:()=>y({symbol:e.symbol,timeframe:e.timeframe,matchId:e.id,source:m.source}),style:({pressed:e})=>({minHeight:36,justifyContent:'center',paddingHorizontal:8,borderRadius:8,borderWidth:1,borderColor:l.C.line,backgroundColor:e?l.C.paper:'transparent'}),children:(0,x.jsxs)(l.T,{numberOfLines:1,style:{fontSize:12},children:[e.pattern_name," \xb7 ",(0,x.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:(0,c.decision)(e,d.filters).title}),t&&(0,x.jsx)(l.T,{style:{fontSize:11,color:l.C.amber},children:" \xb7 outside your filters"})]})},e.id)})]}):(0,x.jsxs)(l.T,{style:E,children:["No stored setups for ",m.symbol," on ",m.timeframe,"."]})]})}function P({match:e,active:s,onOpenEvidence:h,onPrepare:b}){const j=(0,o.useProduct)(),{d:v,history:S,exit:C,age:P,stale:O}
982=(0,f.useCaseEvidence)(e,s.side),z=(0,u.evidenceKey)({symbol:e.symbol,pattern:e.pattern,timeframe:e.timeframe,side:S?.side,rule:S?.run,dataEnd:e.candle_end}),k=(0,t.useRef)({key:'',error:''});C.error!==k.current.error&&(k.current={key:z,error:C.error});const I=k.current.key===z?C.error:'',_={data:C.data,error:I},H=z?(0,m.evidenceFromWorkspace)({match:e,history:S,exit:_,legendKey:{symbol:s.symbol,timeframe:s.timeframe,selectedKey:s.matchId},age:P,stale:O}):null,N=(0,y.prepareBlock)({stale:O,age:P,match:e,history:S,exit:_}),w=!!H?.keyMatches;const L=(0,p.knownBacktestRunLine)(S),$='review'===v.verdict?'green':'pass'===v.verdict?'red':'history'===v.verdict?'neutral':'amber',B='short'===S?.side,R={flex:1,minHeight:38,paddingVertical:6,paddingHorizontal:8};return(0,x.jsxs)(n.default,{style:{gap:10},children:[(0,x.jsxs)(n.default,{style:{gap:3},children:[(0,x.jsxs)(n.default,{style:[l.s.row,{gap:6}],children:[(0,x.jsx)(l.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:15,flexShrink:1},children:e.symbol}),(0,x.jsx)(n.default,{style:{flex:1}}),w&&(0,x.jsx)(l.Badge,{label:v.title.toUpperCase(),tone:$})]}),(0,x.jsxs)(l.T,{numberOfLines:2,style:{fontSize:12,lineHeight:17,color:l.C.muted},children:[e.pattern_name," \xb7 ",e.timeframe,S?" \xb7 "+(B?'Short':'Long'):'']})]}),z?w?(0,x.jsxs)(n.default,{role:"group",accessibilityLabel:`Evidence summary for ${e.symbol} ${e.pattern_name} ${e.timeframe}`,style:{gap:8},children:[(0,x.jsx)(l.T,{style:{fontSize:11,lineHeight:16,fontFamily:'InterMedium',color:l.C.amber},children:H.historyLabel}),(0,x.jsxs)(n.default,{style:[l.s.row,{gap:10,alignItems:'flex-start'}],children:[(0,x.jsx)(l.Stat,{label:"Hold-period avg \xb7 not this exit rule",value:(0,d.pct)(H.avg),size:18,color:(S?.reference?.expectancy_pct||0)>0?l.C.green:l.C.ink}),(0,x.jsx)(l.Stat,{label:"95% range \xb7 this result alone",value:null!=H.low95&&null!=H.high95?`${(0,d.pct)(H.low95)} to ${(0,d.pct)(H.high95)}`:'\u2014',size:13})]}),(0,x.jsxs)(n.default,{style:[l.s.row,{flexWrap:'wrap',gap:4}],children:[(0,x.jsx)(l.Badge,{label:`N ${H.n??'n/a'}`,tone:"neutral"}),(0,x.jsx)(l.Badge,{label:(H.sampleLabel||'Sample n/a').toUpperCase(),tone:(0,c.sampleSize)(H.n).tone}),(0,x.jsx)(l.Badge,{label:null!=H.costPct?`COSTS ${H.costPct.toFixed(2)}% INCL.${H.costAssumed?' (ASSUMED)':''}`:'COSTS N/A',tone:null==H.costPct||H.costAssumed?'amber':'neutral'}),(0,x.jsx)(l.Badge,{label:H.nextOpen?'NEXT-OPEN ENTRY':'ENTRY BASIS N/A',tone:H.nextOpen?'neutral':'amber'}),(0,x.jsx)(l.Badge,{label:`${(0,c.dataAgeText)(P).toUpperCase()}${O?' \xb7 STALE':''}`,tone:O?'amber':'neutral'}),B&&(0,x.jsx)(l.Badge,{label:"HYPOTHETICAL SHORT STUDY",tone:"amber"}),!!v.ruleNote&&(0,x.jsx)(l.Badge,{label:v.ruleNote.toUpperCase(),tone:"neutral"})]}),(0,x.jsxs)(l.T,{style:{fontSize:10,lineHeight:15,color:l.C.muted},children:[B?'Hypothetical short price study':'After assumed costs'," \xb7 fixed holding-period exit, not the exit rule below. Picked from many stock \xd7 pattern results: top averages are partly luck and usually shrink, and the range does not correct for that."]}),!!L&&(0,x.jsx)(l.T,{style:{fontSize:10,lineHeight:15,color:l.C.muted},children:L}),I?(0,x.jsxs)(n.default,{style:{gap:6},children:[(0,x.jsxs)(l.T,{accessibilityRole:"alert",style:{fontSize:11,lineHeight:16,color:l.C.amber},children:["Exit-rule evidence could not load. ",I]}),(0,x.jsx)(l.Button,{label:"Retry exit evidence",kind:"outline",onPress:C.retry,style:{minHeight:36,paddingVertical:4}}),(0,x.jsx)(l.T,{style:{fontSize:10,color:l.C.muted},children:y.PRICE_ADJUSTMENT_NOTE})]}):(0,x.jsx)(y.ExitBrief,{data:C.data,error:"",retry:C.retry,compact:!0})]}):T:(0,x.jsx)(l.T,{style:E,children:"No historical evidence for this setup."}),(0,x.jsxs)(n.default,{style:[l.s.row,{gap:6}],children:[(0,x.jsx)(l.Button,{label:"Show evidence",icon:"bar-chart-2",kind:"soft",onPress:h||(()=>j.setDetail(e)),style:R}),(0,x.jsx)(l.Button,{label:"Prepare trade",icon:"zap",disabled:!!N,accessibilityLabel:N?`Prepare trade unavailable: ${N}`:'Prepare trade',onPress:function(){N||(j.setPlan({match:e,side:S?.side}),b?.())},style:R})]}),!!N&&(0,x.jsxs)(l.T,{accessibilityRole:"alert",style:{fontSize:11,lineHeight:16,color:l.C.amber},children:["Prepare trade unavailable: ",N]})]})}},889,[11,13,375,196,821,197,248,251,868,838,890,871,250,862,6]); 983__d(function(g,r,i,a,_m,_e,_d){"use strict";
983function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.useCaseEvidence=x,_e.AgentCase=function({match:e,side:h,heading:p=!0,onHistory:m}){const{setDetail:j,setPlan:b,product:S,refreshProduct:T,setToast:C}=(0,f.useProduct)(),{width:w}=(0,l.default)(),{d:v,history:z,stats:_,exit:I,blocked:P}=x(e,h),[k,F]=(0,t.useState)(null),[A,B]=(0,t.useState)(null),[W,M]=(0,t.useState)(!1);(0,t.useEffect)(()=>{let t=!0;return B(null),z&&(0,c.api)('/api/backtests/cell?'+(0,c.cellQuery)(e,z.side)).then(e=>{t&&e.run_id===z.run&&B(e)}).catch(()=>{}),()=>{t=!1}},[e.id,z?.side,z?.run]),(0,t.useEffect)(()=>F(null),[e.id,e.candle_end]);const H=k?.matches?.find(t=>t.pattern===e.pattern),L=(H?.lines||[]).filter(e=>'boundary'===e.role),R=S.watchlist?.some(t=>t.id===e.id);return(0,y.jsxs)(s.default,{style:{gap:18},children:[p&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(s.default,{style:n.s.between,children:[(0,y.jsxs)(s.default,{style:{gap:4},children:[(0,y.jsx)(n.T,{style:{fontFamily:'ManropeBold',fontSize:27,lineHeight:35},children:e.symbol}),(0,y.jsxs)(n.T,{style:{fontSize:11,color:n.C.muted},children:[e.company," \xb7 NSE"]})]}),(0,y.jsxs)(s.default,{style:{alignItems:'flex-end',gap:4},children:[(0,y.jsx)(n.Badge,{label:v.title.toUpperCase(),tone:'review'===v.verdict?'green':'pass'===v.verdict?'red':'history'===v.verdict?'neutral':'amber'}),!!v.ruleNote&&(0,y.jsx)(n.Badge,{label:v.ruleNote,tone:"neutral"})]})]}),(0,y.jsxs)(s.default,{style:n.s.between,children:[(0,y.jsx)(n.T,{style:{fontSize:13,fontFamily:'InterMedium'},children:e.pattern_name}),(0,y.jsx)(n.Badge,{label:e.timeframe,tone:"neutral"})]}),(0,y.jsxs)(s.default,{style:n.s.between,children:[(0,y.jsx)(n.T,{style:{fontFamily:'ManropeBold',fontSize:26,lineHeight:33},children:(0,c.money)(e.price)}),(0,y.jsxs)(n.T,{style:{fontSize:10,color:n.C.muted},children:["Snapshot \xb7 ",(0,c.dateText)(e.candle_end)]})]})]}),(0,y.jsx)(o.PatternCanvas,{match:e,side:z?.side,onSnapshot:F,exitPlan:I.data}),(0,y.jsx)(d.ExitBrief,{...I}),(0,y.jsxs)(s.default,{style:{borderLeftWidth:2,borderColor:'pass'===v.verdict?n.C.red:'review'===v.verdict?n.C.green:n.C.line,paddingLeft:15,gap:7},children:[(0,y.jsxs)(s.default,{style:n.s.row,children:[(0,y.jsx)(n.Icon,{name:"aperture",size:15,color:n.C.green}),(0,y.jsx)(n.T,{style:{fontFamily:'InterSemi',fontSize:13},children:'pass'===v.verdict?"Why I\u2019m passing":'watch'===v.verdict?"Why I\u2019m waiting":'history'===v.verdict?"What the history shows":"Why this made the list"})]}),(0,y.jsxs)(n.T,{style:{fontSize:13,color:n.C.muted,lineHeight:22},children:[v.why," ",v.caution]}),H?.evidence?.slice(0,2).map(e=>(0,y.jsxs)(n.T,{style:{fontSize:11,color:n.C.muted},children:["\xb7 ",e]},e))]}),(0,y.jsxs)(s.default,{style:[n.s.card,{padding:17,gap:14}],children:[(0,y.jsxs)(s.default,{style:n.s.between,children:[(0,y.jsx)(n.T,{style:{fontFamily:'InterSemi',fontSize:12},children:"Time-exit history"}),(0,y.jsxs)(n.T,{style:{fontSize:10,color:n.C.muted},children:['short'===z?.side?'SHORT':'LONG'," \xb7 ",_?.n||0," trades"]})]}),(0,y.jsxs)(n.T,{accessibilityRole:"text",style:{fontSize:11,fontFamily:'InterMedium',color:n.C.amber,marginTop:-6},children:[I.history_label,". These stats come from a fixed holding-period exit, not the stop, target and hold in Your exit plan above."]}),(0,y.jsxs)(s.default,{style:n.s.row,children:[(0,y.jsx)(n.Stat,{label:"Avg. net / trade",value:(0,c.pct)(_?.display_return_pct),size:23,color:(_?.expectancy_pct||0)>=0?n.C.green:n.C.red}),(0,y.jsx)(n.Stat,{label:"Trades that won",value:null==_?.win_rate?'\u2014':`${_.win_rate.toFixed(0)}%`,size:23})]}),(0,y.jsxs)(s.default,{style:[n.s.between,{borderTopWidth:1,borderColor:n.C.line,paddingTop:12}],children:[(0,y.jsxs)(s.default,{style:[n.s.row,{flex:1}],children:[(0,y.jsx)(n.Icon,{name:"clock",size:13,color:n.C.muted}),(0,y.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:"Fixed hold"})]}),(0,y.jsx)(n.T,{style:{fontSize:11},children:_?.holding?.duration||'Unavailable'})]}),!!_?.expectancy_ci95&&(0,y.jsxs)(n.T,{style:{fontSize:10,color:n.C.muted},children:["95% range for this result alone: ",(0,c.pct)(_.expectancy_ci95[0])," to ",(0,c.pct)(_.expectancy_ci95[1]),". It does not correct for comparing many stocks and patterns; top-ranked averages usually shrink."]}
983),(0,y.jsxs)(n.T,{style:{fontSize:10,color:n.C.muted},children:['short'===z?.side?`${u.SHORT_STUDY_LINE}. `:'',"After assumed costs. May carry overnight. Past average, not a forecast."]}),!!z&&(0,y.jsx)(n.T,{style:{fontSize:10,color:n.C.muted},children:(0,u.backtestRunLine)(z)})]}),A?.reference?.n>0&&(0,y.jsxs)(s.default,{style:{gap:10},children:[(0,y.jsx)(n.T,{style:{fontFamily:'InterMedium',fontSize:12},children:"What happened in past trades"}),(0,y.jsxs)(s.default,{style:n.s.row,children:[(0,y.jsxs)(s.default,{style:{flex:1,backgroundColor:n.C.soft,borderRadius:9,padding:13,gap:5},children:[(0,y.jsx)(n.T,{style:{fontSize:10,color:n.C.green},children:"When it won"}),(0,y.jsx)(n.T,{style:{fontFamily:'ManropeBold',fontSize:19,color:n.C.green},children:(0,c.pct)(A.reference.avg_win_pct)}),(0,y.jsxs)(n.T,{style:{fontSize:10,color:n.C.muted},children:["Average of ",A.reference.wins," winners"]})]}),(0,y.jsxs)(s.default,{style:{flex:1,backgroundColor:n.C.redBg,borderRadius:9,padding:13,gap:5},children:[(0,y.jsx)(n.T,{style:{fontSize:10,color:n.C.red},children:"When it lost"}),(0,y.jsx)(n.T,{style:{fontFamily:'ManropeBold',fontSize:19,color:n.C.red},children:(0,c.pct)(A.reference.avg_loss_pct)}),(0,y.jsxs)(n.T,{style:{fontSize:10,color:n.C.muted},children:["Average of ",A.reference.losses," losers"]})]})]})]}),(0,y.jsxs)(s.default,{style:[n.s.card,{backgroundColor:n.C.tealBg,borderColor:n.C.greenLine,padding:17}],children:[(0,y.jsxs)(s.default,{style:n.s.row,children:[(0,y.jsx)(n.Icon,{name:"eye",color:n.C.green,size:16}),(0,y.jsx)(n.T,{style:{fontFamily:'InterSemi',fontSize:13},children:"What I need to see next"})]}),(0,y.jsx)(n.T,{style:{fontSize:12,color:n.C.muted,lineHeight:21},children:v.next}),L.length>0&&(0,y.jsx)(s.default,{style:[n.s.row,{flexWrap:'wrap'}],children:L.slice(0,2).map(e=>(0,y.jsxs)(s.default,{style:{flex:1,minWidth:100,gap:4},children:[(0,y.jsx)(n.T,{style:{fontSize:10,color:n.C.muted},children:e.label}),(0,y.jsx)(n.T,{style:{fontFamily:'InterSemi',fontSize:16},children:(0,c.money)(e.points[e.points.length-1]?.value)})]},e.label))}),(0,y.jsx)(n.T,{style:{fontSize:10,color:n.C.muted},children:"Levels belong to the stored pattern. They are not live entry, stop or target prices."})]}),(0,y.jsxs)(s.default,{style:n.s.row,children:[(0,y.jsx)(n.Button,{label:R?'Watching':'Add to watch',icon:R?'check':'eye',kind:"outline",loading:W,onPress:async function(){M(!0);try{await(0,c.api)('/api/product/watch',{action:R?'remove':'add',match_id:e.id}),await T(),C(R?'Removed from your watchlist.':'Added to your watch. I\u2019ll compare it with refreshed scans while KANIDA is open.')}catch(e){C(e.message)}finally{M(!1)}},style:{flex:1}}),(0,y.jsx)(n.Button,{label:"See evidence",kind:"soft",icon:"bar-chart-2",style:{flex:1},onPress:m||(()=>j(e))})]}),p&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(n.Button,{label:"Prepare AutoTrade",icon:"zap",disabled:!!P,accessibilityLabel:P?`Prepare AutoTrade unavailable: ${P}`:'Prepare AutoTrade',onPress:()=>b({match:e,side:z?.side})}),!!P&&(0,y.jsxs)(n.T,{accessibilityRole:"alert",style:{fontSize:11,lineHeight:16,color:n.C.amber},children:["Prepare AutoTrade unavailable: ",P]})]})]})};var t=r(_d[0]),s=e(r(_d[1])),l=e(r(_d[2])),n=r(_d[3]),o=r(_d[4]),d=r(_d[5]),c=r(_d[6]),h=r(_d[7]),u=r(_d[8]),f=r(_d[9]),y=r(_d[10]);function x(e,t){const{filters:s,state:l}=(0,f.useProduct)(),n=(0,h.decision)(e,s,t),o=e.history.find(e=>e.side===(t||n.history?.side))||n.history,c=o?.reference,u=(0,d.useExitPlan)(e,o?.side||'long'),y=(0,h.dataAgeDays)(l?.source_latest),x=(0,h.isStale)(y,l?.source_stale),p=(0,d.prepareBlock)({stale:x,age:y,match:e,history:o,exit:u});return{d:n,history:o,stats:c,exit:u,age:y,stale:x,blocked:p}}},890,[11,13,400,821,864,838,197,248,250,196,6]); 984__d(function(g,r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.SimulationDesk=function({onBack:e}={}){const s=(0,h.useProduct)(),w='desktop'===(0,c.useLayoutMode)(),_=s.studyDraft,P=(0,m.useStudiesOff)(),[A,B]=(0,t.useState)(_.method||'backtest'),[z,E]=(0,t.useState)((_.symbols||[]).join(', ')),[L,R]=(0,t.useState)(_.universe??(_.symbols?.length?'':T)),[I,F]=(0,t.useState)(_.sector||''),[N,D]=(0,t.useState)(_.patterns||[...C]),[M,O]=(0,t.useState)(_.timeframes||[...v]),[U,W]=(0,t.useState)(!1),[$,H]=(0,t.useState)(''),[q,Y]=(0,t.useState)(!1),[V,J]=(0,t.useState)(_.start??(_.origin?'':S)),[Q,K]=(0,t.useState)(_.end||s.state?.source_latest?.slice(0,10)||j),[G,X]=(0,t.useState)(String(_.capital||b.DEFAULT_CAPITAL)),[Z,ee]=(0,t.useState)(String(_.max_positions??(1===_.symbols?.length?1:5))),[te,se]=(0,t.useState)(String(_.allocation_pct??(1===_.symbols?.length?100:20))),[ie,ae]=(0,t.useState)(_.product||'CNC'),[ne,le]=(0,t.useState)(_.side||'long'),[re,oe]=(0,t.useState)(_.trigger||'setup'),[de,ue]=(0,t.useState)(_.hold||{'1H':'6','4H':'6','1D':'10','1W':'4'}),[ce,he]=(0,t.useState)(String(_.stop_atr??0)),[pe,me]=(0,t.useState)(String(_.target_r??2)),[ge,fe]=(0,t.useState)(String(_.risk_pct??2)),[ye,be]=(0,t.useState)(String(_.fee_bps??30)),[xe,Se]=(0,t.useState)(String(_.slippage_bps??5)),[je,Ce]=(0,t.useState)(!1!==_.reinvest),[ve,Te]=(0,t.useState)(String(_.training_months??36)),[ke,we]=(0,t.useState)(String(_.test_months??6)),[Pe,Ae]=(0,t.useState)(String(_.minimum_training??20)),[Be,ze]=(0,t.useState)(!1),[Ee,Le]=(0,t.useState)(_.jobId?'results':'settings'),[Re,Ie]=(0,t.useState)(null),[Fe,Ne]=(0,t.useState)([]),[De,Me]=(0,t.useState)(!1),[Oe,Ue]=(0,t.useState)(!1),[We,$e]=(0,t.useState)(''),[He,qe]=(0,t.useState)([]),[Ye,Ve]=(0,t.useState)([]),[Je,Qe]=(0,t.useState)([]),[Ke,Ge]=(0,t.useState)(!1),[Xe,Ze]=(0,t.useState)(!1),[et,tt]=(0,t.useState)(!1),[st,it]=(0,t.useState)(null),at=z.split(',').map(e=>
984e.trim().toUpperCase()).filter(Boolean),nt=1===at.length&&1===M.length&&1===N.length?{symbol:at[0],timeframe:M[0],pattern:N[0],side:'short'===ne?'short':'long'}:null,lt=nt?[nt.symbol,nt.timeframe,nt.pattern,nt.side].join('|'):'',rt='research'!==s.state?.pattern_set;(0,t.useEffect)(()=>{if(V||!nt||!rt||P)return void it(null);let e=!0;return it({key:lt,loading:!0}),(0,f.api)('/api/replay?'+new URLSearchParams({...nt,capital:String(b.DEFAULT_CAPITAL)})).then(t=>{e&&!(0,m.noteStudiesOff)(t)&&it({key:lt,date:t?.settings?.start||'',error:t?.settings?.start?'':'The earliest stored date is unavailable for this selection.'})}).catch(t=>{e&&!(0,m.noteStudiesOff)(t)&&it({key:lt,date:'',error:t.message})}),()=>{e=!1}},[!V,lt,!!P]);const ot=!V,dt=st?.key===lt&&!st?.loading,ut=V||(dt?st.date:'')||'',ct=ot?rt?nt?dt?st.date?`Blank start = full available history, from ${st.date} (first stored ${nt.timeframe} candle for ${nt.symbol}, same history as the stock replay).`:`${st.error} Choose a start date.`:'Blank start = full available history. Finding the earliest stored candle\u2026':'A blank start date needs exactly one stock, pattern and timeframe. Choose a start date for wider studies.':'Blank start = full available history. The earliest stored candle is not available while the scanner runs the researched pattern set.':'',ht=_.origin,pt=ht?[ht.symbol,(s.state?.patterns||[]).find(e=>e.id===ht.pattern)?.name||String(ht.pattern||'').replaceAll('_',' '),ht.timeframe].filter(
984Boolean).join(' \xb7 '):'';(0,t.useEffect)(()=>{P||(gt(),_.jobId&&(0,f.api)('/api/studies/'+_.jobId).then(e=>{(0,m.noteStudiesOff)(e)||Ie(e)}).catch(m.noteStudiesOff))},[]),(0,t.useEffect)(()=>{let e=!0;const t=z.split(',').pop()?.trim();if(!t||t.length<2)return void qe([]);const s=setTimeout(()=>(0,f.api)('/api/stocks?q='+encodeURIComponent(t)).then(t=>{e&&qe(t.slice(0,4))}).catch(()=>{}),240);return()=>{e=!1,clearTimeout(s)}},[z]),(0,t.useEffect)(()=>{if(!Re?.id||Re.result||P)return;let e,t=!0,s=!1;async function i(){if(!s){s=!0;try{const s=await(0,f.api)('/api/studies/'+Re.id);if(!t)return;if((0,m.noteStudiesOff)(s))return void clearInterval(e);Ie(s),['queued','running'].includes(s.status)||(clearInterval(e),gt())}catch(s){if(!t)return;if((0,m.noteStudiesOff)(s))return void clearInterval(e);$e(s.message)}finally{s=!1}}}return e=setInterval(i,2200),i(),()=>{t=!1,clearInterval(e)}},[Re?.id,!!Re?.result,!!P]);const mt=()=>({agent:'chart',symbols:z.split(',').map(e=>e.trim().toUpperCase()).filter(Boolean),universe:L,sector:I,patterns:N,timeframes:M,method:A,product:ie,side:ne,trigger:re,start:ut,end:Q,capital:Number(G),max_positions:Number(Z),allocation_pct:Number(te),risk_pct:Number(ge),stop_atr:Number(ce),target_r:Number(pe),fee_bps:Number(ye),slippage_bps:Number(xe),hold:Object.fromEntries(Object.entries(de).map(([e,t])=>[e,Number(t)])),training_months:Number(ve),test_months:Number(ke),minimum_training:Number(Pe),reinvest:je,benchmark:!0});function gt(){(0,f.api)('/api/studies').then(e=>{(0,m.noteStudiesOff)(e)||Ne((0,p.asList)(e))}).catch(m.noteStudiesOff)}const ft=(e,t)=>e.includes(t)?e.filter(e=>e!==t):[...e,t];function yt(e){B(e.method),E(e.symbols.join(', ')),R(e.universe),F(e.sector),D(e.patterns),O(e.timeframes),J(e.start),K(e.end),X(String(e.capital)),ee(String(e.max_positions)),se(String(e.allocation_pct)),ae(e.product),le(e.side),oe(e.trigger),ue(e.hold),he(String(e.stop_atr)),me(String(e.target_r)),fe(String(e.risk_pct)),be(String(e.fee_bps)),Se(String(e.slippage_bps)),Te(String(e.training_months)),we(String(e.test_months)),Ae(String(e.minimum_training)),Ce(e.reinvest),Le('settings')}const bt=!!Re?.result&&Object.entries(mt()).some(([e,t])=>{if('symbols'===e&&!z.trim()||'patterns'===e&&!N.length)return!1;const s=Re.settings[e];return JSON.stringify(Array.isArray(t)?[...t].sort():t)!==JSON.stringify(Array.isArray(s)?[...s].sort():s)}),xt=!!ht&&(0,x.jsx)(o.default,{accessibilityRole:"link",accessibilityLabel:`Back to ${pt} chart`,onPress:()=>e?e():u.router.push('/chart'),style:{alignSelf:'flex-start',paddingVertical:4},children:(0,x.jsxs)(c.T,{style:{fontSize:13,fontFamily:'InterSemi',color:c.C.green},children:["\u2190 Back to ",pt," chart"]})});if(P)return(0,x.jsxs)(i.default,{style:{flex:1,minHeight:0},children:[(0,x.jsxs)(i.default,{style:{paddingHorizontal:18,paddingVertical:12,borderBottomWidth:1,borderColor:c.C.line},children:[(0,x.jsx)(c.T,{style:{fontSize:19,fontFamily:'ManropeBold'},children:"Simulation"}),xt]}),(0,x.jsx)(i.default,{style:{padding:18},children:(0,x.jsx)(m.StudiesOffPanel,{message:P})})]});const St=(s.state?.patterns||[]).filter(e=>N.includes(e.id)).map(e=>e.name);return(0,x.jsxs)(i.default,{style:{flex:1,minHeight:0},children:[(0,x.jsxs)(i.default,{style:[c.s.between,{paddingHorizontal:18,paddingVertical:12,borderBottomWidth:1,borderColor:c.C.line}],children:[(0,x.jsxs)(i.default,{style:{flex:1},children:[(0,x.jsx)(c.T,{style:{fontSize:19,fontFamily:'ManropeBold'},children:"Simulation"}),(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:"Chart Agent \xb7 one stock or a shared portfolio"}),xt]}),(0,x.jsx)(c.Button,{label:"Saved studies",kind:"outline",icon:"folder",onPress:()=>{gt(),Me(!0)}})]}),!!We&&(0,x.jsx)(c.T,{accessibilityRole:"alert",style:{fontSize:12,color:c.C.red,padding:10},children:We}),!w&&(0,x.jsxs)(i.default,{style:[c.s.row,{padding:10}],children:[(0,x.jsx)(c.Chip,{label:"Study settings",active:'settings'===Ee,onPress:()=>Le('settings')}),(0,x.jsx)(c.Chip,{label:"Results & replay",active:'results'===Ee,onPress:()=>Le('results')})]}),(0,x.jsxs)(i.default,{style:{flex:1,minHeight:0,flexDirection:w?'row':'column'},children:[(w||'settings'===Ee)&&(0,x.jsxs)(i.default,{style:{width:w?330:'100%',flex:w?void 0:1,minHeight:0,borderRightWidth:1,borderColor:c.C.line,backgroundColor:c.C.paper},children:[(0,x.jsxs)(n.default,{showsVerticalScrollIndicator:!1,keyboardShouldPersistTaps:"handled",contentContainerStyle:{padding:16,gap:16},children:[(0,x.jsxs)(i.default,{style:[c.s.row,{gap:4}],children:[(0,x.jsx)(c.Chip,{label:"Backtest",active:'backtest'===A,onPress:()=>B('backtest')}),(0,x.jsx)(c.Chip,{label:"Walk-forward",active:'walkforward'===A,onPress:()=>B('walkforward')})]}),(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:'walkforward'===A?'Learn on earlier completed trades, freeze a rule, then test the next period.':'Replay the same declared entry and exit rules throughout the selected dates.'}),(0,x.jsx)(c.T,{style:{fontFamily:'InterSemi'},children:"Stocks & universe"}),(0,x.jsx)(l.default,{accessibilityLabel:"Stocks to simulate",value:z,onChangeText:E,placeholder:"All selected stocks, or TITAN, BEL\u2026",placeholderTextColor:c.C.muted,autoCapitalize:"characters",style:c.s.input}),!!z&&He.map(e=>(0,x.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:`Add ${e.symbol}, ${e.company}`,onPress:()=>{E([...z.split(',').slice(0,-1),e.symbol].map(e=>e.trim()).join(', ')),qe([])},children:(0,x.jsxs)(c.T,{style:{fontSize:12},children:[e.symbol," \xb7 ",e.company]})},e.symbol)),(0,x.jsxs)(i.default,{style:[c.s.row,{flexWrap:'wrap',gap:5}],children:[(0,x.jsx)(c.Chip,{label:"All stocks",active:!L,onPress:()=>R('')}),s.options?.universes?.map(e=>(0,x.jsx)(c.Chip,{label:e.label,active:L===e.value,onPress:()=>R(e.value)},e.value))]}),(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:"Uses the supplied membership snapshot, not historical index membership. Leave stocks blank to include the whole selected universe."}),(0,x.jsx)(c.Button,{label:I||"All sectors",kind:"outline",icon:"layers",onPress:()=>Y(!0)}),(0,x.jsx)(c.Button,{label:`${N.length?N.length:'All'} patterns \xb7 ${St.slice(0,2).join(', ')}`,icon:"sliders",kind:"outline",onPress:()=>W(!0)}),(0,x.jsx)(i.default,{style:[c.s.row,{flexWrap:'wrap',gap:4}
984],children:b.TIMEFRAMES.map(e=>(0,x.jsx)(c.Chip,{label:e,active:M.includes(e),onPress:()=>O(1===M.length&&M[0]===e?M:ft(M,e))},e))}),(0,x.jsxs)(i.default,{style:c.s.row,children:[(0,x.jsx)(k,{label:"Start date",value:V,onChange:J,date:!0}),(0,x.jsx)(k,{label:"End date",value:Q,onChange:K,date:!0})]}),!!ct&&(0,x.jsx)(c.T,{accessibilityLiveRegion:"polite",style:{fontSize:12,color:dt&&!st?.date||!nt?c.C.amber:c.C.muted},children:ct}),!!ht&&!ot&&!!nt&&(0,x.jsx)(c.Button,{label:"Use full available history",kind:"ghost",onPress:()=>J('')}),(0,x.jsx)(k,{label:"Starting capital (\u20b9)",value:G,onChange:X}),(0,x.jsx)(i.default,{style:[c.s.row,{gap:5,flexWrap:'wrap'}],children:b.CAPITAL_CHOICES.map(e=>(0,x.jsx)(c.Chip,{label:(0,f.money)(e),active:Number(G)===e,onPress:()=>X(String(e))},e))}),(0,x.jsxs)(i.default,{style:c.s.row,children:[(0,x.jsx)(k,{label:"Maximum positions",value:Z,onChange:ee}),(0,x.jsx)(k,{label:"Allocation per trade (%)",value:te,onChange:se})]}),(0,x.jsx)(c.T,{style:{fontFamily:'InterSemi'},children:"Execution model"}),(0,x.jsxs)(i.default,{style:[c.s.row,{flexWrap:'wrap',gap:4}],children:[(0,x.jsx)(c.Chip,{label:"CNC delivery",active:'CNC'===ie,onPress:()=>{ae('CNC'),le('long')}}),(0,x.jsx)(c.Chip,{label:"MIS intraday",active:'MIS'===ie,onPress:()=>{ae('MIS'),M.some(e=>'1D'===e||'1W'===e)&&O(['1H'])}})]}),(0,x.jsx)(i.default,{style:[c.s.row,{flexWrap:'wrap',gap:4}],children:('MIS'===ie?['long','short','both']:['long']).map(e=>(0,x.jsx)(c.Chip,{label:'both'===e?'Both directions':'long'===e?'Long':'Short',active:ne===e,onPress:()=>le(e)},e))}),(0,x.jsxs)(c.T,{style:{fontSize:12,color:c.C.muted},children:['CNC'===ie?'Unleveraged cash-equity buying. Overnight holds allowed.':'Unleveraged intraday simulation. Exit by the last completed candle at or before 15:15.'," NRML needs actual derivative contracts and history."]}),(0,x.jsx)(c.Button,{label:Be?'Hide detailed rules':'Entry, exits, costs & learning',kind:"ghost",icon:"settings",onPress:()=>ze(!Be)}),Be&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(i.default,{style:c.s.row,children:[(0,x.jsx)(c.Chip,{label:"Qualified setup",active:'setup'===re,onPress:()=>oe('setup')}),(0,x.jsx)(c.Chip,{label:"Breakout",active:'confirmed'===re,onPress:()=>oe('confirmed')})]}),(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:"Entry is at the next candle open, with the chosen slippage."}),'backtest'===A?(0,x.jsxs)(x.Fragment,{children:[M.map(e=>(0,x.jsx)(k,{label:`${e} maximum holding candles`,value:de[e],onChange:t=>ue({...de,[e]:t})},e)),(0,x.jsx)(k,{label:"Stop distance (ATR; 0 = time exit)",value:ce,onChange:he}),(0,x.jsx)(k,{label:"Target in multiples of stop",value:pe,onChange:me})]}):(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:"Holding periods and stop/target rules are learned separately for each stock from a frozen candidate family. Inspect the chosen rule in each walk-forward period."}),(0,x.jsx)(k,{label:"Risk per trade with a stop (%)",value:ge,onChange:fe}),(0,x.jsx)(k,{label:"Round-trip fees (basis points)",value:ye,onChange:be}),(0,x.jsx)(k,{label:"Slippage each side (basis points)",value:xe,onChange:Se}),(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:"100 basis points = 1%. These are declared cost assumptions, not broker-specific charges."}),(0,x.jsx)(c.Checkbox,{checked:je,onChange:Ce,label:"Reinvest available capital"})]}),'walkforward'===A&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(k,{label:"Learning window (months)",value:ve,onChange:Te}),(0,x.jsx)(k,{label:"Next test window (months)",value:ke,onChange:we}),(0,x.jsx)(k,{label:"Minimum completed learning trades",value:Pe,onChange:Ae}),(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:"A separate learning threshold, not your Discover history filter. Cells without a positive supported rule do not open new trades. The engine tests its declared holding/stop/target family per stock."})]}),!!We&&(0,x.jsx)(c.T,{accessibilityRole:"alert",style:{color:c.C.red},children:We})]}),(0,x.jsx)(i.default,{style:{padding:14,borderTopWidth:1,borderColor:c.C.line},children:(0,x.jsx)(c.Button,{label:'walkforward'===A?'Run walk-forward study':'Run historical simulation',icon:"play",loading:Oe,onPress:async function(){if(ut){Ue(!0),$e(''),Ie(null);try{const e=mt();s.setStudyDraft({...e,origin:_.origin});const t=await(0,f.api)('/api/studies',e);Ie(t),s.setStudyDraft({...e,origin:_.origin,jobId:t.id}),Le('results')}catch(e){(0,m.noteStudiesOff)(e)||$e(e.message)}finally{Ue(!1)}}else $e(ct||'Choose a start date.')}})})]}),(w||'results'===Ee)&&(0,x.jsx)(i.default,{style:{flex:1,minWidth:0,minHeight:0,padding:w?18:12},children:Re?.result?(0,x.jsxs)(x.Fragment,{children:[bt&&w&&(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.amber,paddingBottom:8},children:"Settings changed. These results belong to the saved study; run again to test your changes."}),w&&(0,x.jsxs)(i.default,{style:[c.s.between,{flexWrap:'wrap'}],children:[(0,x.jsxs)(c.T,{style:{fontSize:12,color:c.C.muted},children:[Re.settings.symbols.length," stocks \xb7 ",Re.settings.start," \u2192 ",Re.settings.end," \xb7 ",Re.settings.product]}),(0,x.jsx)(c.Button,{label:"Edit these settings",kind:"ghost",onPress:()=>yt(Re.settings)})]}),(0,x.jsx)(y.ReplayStudio,{result:Re.result,jobId:Re.id,actionLabel:"Discover matching setups",onPlan:function(e){const t=s.matches.find(t=>t.symbol===e.symbol&&t.pattern===e.pattern&&t.timeframe===e.timeframe&&t.history.some(t=>t.side===e.side));t?s.setPlan({match:t,side:e.side,study:{id:Re.id,trade_id:e.id,rule:e.rule,validation:Re.result.validation}}):s.setToast('There is no matching setup in the latest scan. This historical study remains available.')},onTest:()=>{s.setFilters({...f.initialFilters,patterns:Re.settings.patterns,timeframe:1===Re.settings.timeframes.length?Re.settings.timeframes[0]:'All',universe:Re.settings.universe}),s.setQuery(1===Re.settings.symbols.length?Re.settings.symbols[0]:''),u.router.push('/chart')}},Re.id)]}):Re?(0,x.jsxs)(i.default,{style:{padding:20,gap:16},children:[(0,x.jsx)(c.T,{style:{fontSize:22,fontFamily:'ManropeBold'},children:'running'===Re.status||'queued'===Re.status?'Replaying your selected market':'cancelled'===Re.status?'Study cancelled':'Study needs attention'}),(0,x.jsx)(c.T,{children:Re.message}),['error','cancelled','interrupted'].includes(Re.status)&&(0,x.jsx)(c.Button,{label:"Review saved settings and retry",kind:"outline",onPress:()=>yt(Re.settings)}),(0,x.jsx)(i.default,{style:{height:6,backgroundColor:c.C.line,borderRadius:6},children:(0,x.jsx)(i.default,{style:{height:6,backgroundColor:c.C.green,width:`${Math.min(100,100*Re.done/Math.max(1,Re.total))}%`,borderRadius:6}})}),(0,x.jsxs)(c.T,{style:c.s.muted,children:[Re.done," / ",Re.total," stock\u2013timeframe histories prepared. You can continue exploring while this runs."]}),['queued','running'].includes(Re.status)&&(0,x.jsx)(c.Button,{label:"Cancel study",kind:"outline",onPress:()=>Ze(!0)})]}):(0,x.jsxs)(i.default,{style:{padding:24,gap:20,justifyContent:'center',flex:1,maxWidth:650,alignSelf:'center'},children:[(0,x.jsx)(c.T,{style:{fontSize:27,fontFamily:'ManropeBold',lineHeight:35},children:"What would your money have done?"}),(0,x.jsx)(c.T,{children:"Choose a stock or a universe, select the patterns and dates, and replay one shared account."}),(0,x.jsxs)(i.default,{style:{gap:9,borderLeftWidth:2,borderColor:c.C.green,paddingLeft:16},children:[(0,x.jsx)(c.T,{children:St.join(' \xb7 ')||'All approved patterns'}),(0,x.jsxs)(c.T,{style:c.s.muted,children:[M.join(' \xb7 ')," \xb7 ",z||s.options?.universes?.find(e=>e.value===L)?.label||'All stocks']}),(0,x.jsxs)(c.T,{children:[(0,f.money)(Number(G))," \xb7 ",ut||(ot?'Full available history':'Start date needed')," \u2192 ",Q,ot&&!!ut&&' \xb7 full available history']})]}),(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:"Results include actual historical pattern drawings, costs, skipped trades, portfolio drawdown and the selected stock\u2019s contribution."}),!w&&(0,x.jsx)(c.Button,{label:"Configure study",onPress:()=>Le('settings')})]})})]}),(0,x.jsxs)(c.Sheet,{visible:Xe,title:"Cancel this study?",onClose:()=>Ze(!1),children:[(0,x.jsx)(c.T,{style:{fontSize:16,lineHeight:26},children:"The replay stops before any results are produced. The study's settings stay in Saved studies so you can review them and run again."}),(0,x.jsx)(c.Button,{label:"Cancel study",loading:et,disabled:!Re||!['queued','running'].includes(Re.status),onPress:async function(){if(!Re)return;const e=Re.id;tt(!0);try{await(0,f.api)('/api/studies/'+e+'/cancel',{}),Ie(t=>t?.id===e?{...t,message:'Cancellation requested\u2026'}:t)}catch(e){(0,m.noteStudiesOff)(e)||$e(e.message)}finally{tt(!1),Ze(!1)}}}),(0,x.jsx)(c.Button,{label:"Keep running",kind:"outline",onPress:()=>Ze(!1)})]}
984),(0,x.jsxs)(c.Sheet,{visible:q,title:"Choose a sector",onClose:()=>Y(!1),children:[(0,x.jsx)(c.Chip,{label:"All sectors",active:!I,onPress:()=>{F(''),Y(!1)}}),Array.from(new Set((s.options?.sectors||[]).map(e=>(0,f.sectorName)(e.value)))).map(e=>(0,x.jsx)(c.Chip,{label:e,active:I===e,onPress:()=>{F(e),Y(!1)}},e))]}),(0,x.jsxs)(c.Sheet,{visible:U,title:"Patterns to test",subtitle:"Each detector runs independently on each selected timeframe.",onClose:()=>W(!1),footer:(0,x.jsx)(c.Button,{label:"Use these patterns",onPress:()=>W(!1)}),children:[(0,x.jsx)(l.default,{accessibilityLabel:"Find pattern to simulate",value:$,onChangeText:H,style:c.s.input,placeholder:"Search all approved patterns",placeholderTextColor:c.C.muted}),(0,x.jsx)(c.Button,{label:"Select all patterns",kind:"outline",onPress:()=>D((Array.isArray(s.state?.patterns)?s.state.patterns:[]).map(e=>e.id))}),s.state?.patterns?.filter(e=>e.name.toLowerCase().includes($.toLowerCase())).map(e=>(0,x.jsx)(c.Chip,{label:e.name,active:N.includes(e.id),onPress:()=>D(ft(N,e.id))},e.id)),(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:"No individual selection means all approved patterns."})]}),(0,x.jsx)(c.Sheet,{visible:De,title:"Saved studies",subtitle:"Every run retains its settings and evidence version.",footer:(0,x.jsx)(c.Button,{label:2===Ye.length?'Compare selected studies':'Select two studies to compare',disabled:2!==Ye.length,onPress:async function(){$e('');try{const e=await Promise.all(Ye.map(e=>(0,f.api)('/api/studies/'+e)));Qe(e),Me(!1),Ge(!0)}catch(e){(0,m.noteStudiesOff)(e)||$e(e.message)}}}),onClose:()=>Me(!1),children:Fe.length?Fe.map(e=>(0,x.jsxs)(i.default,{style:{gap:4},children:['complete'===e.status&&(0,x.jsx)(c.Checkbox,{checked:Ye.includes(e.id),label:`Compare study ${e.id.slice(0,6)}`,onChange:()=>Ve(Ye.includes(e.id)?Ye.filter(t=>t!==e.id):[...Ye.slice(-1),e.id]),children:(0,x.jsxs)(c.T,{style:{fontSize:12,color:c.C.green},children:["Compare \xb7 ",e.id.slice(0,6)]})}),(0,x.jsxs)(o.default,{accessibilityRole:"button",accessibilityLabel:`Open saved ${e.settings.method} study`,onPress:()=>{yt(e.settings),Ie(e),s.setStudyDraft({...e.settings,origin:_.origin,jobId:e.id}),Le('results'),Me(!1)},style:{gap:6,paddingVertical:16,borderBottomWidth:1,borderColor:c.C.line},children:[(0,x.jsx)(c.T,{children:e.settings.name||`${1===e.settings.symbols.length?e.settings.symbols[0]:e.settings.symbols.length+' stocks'} \xb7 ${'walkforward'===e.settings.method?'Walk-forward':'Backtest'}`}),(0,x.jsxs)(c.T,{style:{fontSize:12,color:c.C.muted},children:[e.settings.timeframes.join(', ')," \xb7 ",e.settings.start," \u2192 ",e.settings.end," \xb7 ",e.status]})]})]},e.id)):(0,x.jsx)(c.T,{children:"Your completed and running studies will appear here."})}),(0,x.jsxs)(c.Sheet,{visible:Ke,title:"Compare saved studies",subtitle:"Different dates, stock selections or rules change the comparison. Repeatedly choosing winners from these results is research, not an untouched test.",wide:!0,onClose:()=>Ge(!1),children:[2===Je.length&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(y.EquityPlot,{normalized:!0,curve:Je[0].result.curve.map(e=>({...e,equity:1e4*e.equity/Je[0].settings.capital})),benchmark:Je[1].result.curve.map(e=>({...e,equity:1e4*e.equity/Je[1].settings.capital}))}),(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:"Both curves rebased to \u20b910,000. Solid: first study. Dashed: second. Dates use the same calendar scale."})]}),Je.map((e,t)=>(0,x.jsxs)(i.default,{style:c.s.card,children:[(0,x.jsxs)(c.T,{style:{fontFamily:'InterSemi'},children:["Study ",t+1," \xb7 ",e.id.slice(0,6)," \xb7 ",e.settings.method]}),(0,x.jsxs)(c.T,{style:{fontSize:12,color:c.C.muted},children:[e.settings.symbols.join(', ')," \xb7 ",e.settings.timeframes.join(', ')," \xb7 ",e.settings.start," \u2192 ",e.settings.end]}),(0,x.jsxs)(c.T,{style:{fontSize:12,color:c.C.muted},children:[e.settings.patterns.join(', ')," \xb7 ",e.settings.product," \xb7 ",e.settings.trigger]}),(0,x.jsxs)(i.default,{style:[c.s.row,{flexWrap:'wrap',gap:15}],children:[(0,x.jsx)(y.Metric,{label:"Starting capital",value:(0,f.money)(e.settings.capital)}),(0,x.jsx)(y.Metric,{label:"Ending equity",value:(0,f.money)(e.result.summary.ending_equity)}),(0,x.jsx)(y.Metric,{label:"Average per trade",value:`${e.result.summary.average_return_pct?.toFixed(2)??'\u2014'}%`}),(0,x.jsx)(y.Metric,{label:"Wins / trades",value:`${e.result.summary.wins} / ${e.result.summary.trades}`}),(0,x.jsx)(y.Metric,{label:"Equity decline",value:`${e.result.summary.max_drawdown_pct.toFixed(2)}%`})]})]},e.id))]})]})};var t=r(d[0]),s=e(t),i=e(r(d[1])),n=e(r(d[2])),l=e(r(d[3])),o=e(r(d[4]));r(d[5]);var u=r(d[6]),c=r(d[7]),h=r(d[8]),p=r(d[9]),m=r(d[10]),f=r(d[11]),y=r(d[12]),b=r(d[13]),x=r(d[14]);const S=b.DEFAULT_STUDY_START,j=b.DEFAULT_STUDY_END,C=b.DEFAULT_STUDY_PATTERNS,v=b.DEFAULT_STUDY_TIMEFRAMES,T=b.DEFAULT_STUDY_UNIVERSE;function k({label:e,value:t,onChange:n,date:o=!1}){return(0,x.jsxs)(i.default,{style:{gap:5,flex:1,minWidth:110},children:[(0,x.jsx)(c.T,{style:{fontSize:12,color:c.C.muted},children:e}),o?s.default.createElement('input',{type:'date','aria-label':e,value:t,onChange:e=>n(e.target.value),style:{color:c.C.ink,background:c.C.paper,border:'1px solid '+c.C.line,borderRadius:9,minHeight:44,width:'100%',boxSizing:'border-box',padding:'8px',fontSize:14,colorScheme:'dark'}}):(0,x.jsx)(l.default,{accessibilityLabel:e,value:String(t),onChangeText:n,placeholder:o?'YYYY-MM-DD':void 0,placeholderTextColor:c.C.muted,style:[c.s.input,{fontSize:14}],keyboardType:o?'default':'decimal-pad'})]})}},891,[11,13,278,385,375,136,252,821,196,820,884,197,886,249,6]); 985__d(function(g,r,i,a,m,_e,_d){"use strict";
985function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"planError",{enumerable:!0,get:function(){return p.planError}}),_e.Account=function(){const e=(0,d.useAuth)(),n=(0,o.useLocalSearchParams)(),[l,c]=(0,t.useState)(null),[u,p]=(0,t.useState)(null),[y,j]=(0,t.useState)(n.error?'Broker connection was not completed. Please reconnect.':''),[w,z]=(0,t.useState)(n.broker?'Kite is connected. Live orders remain disabled.':''),[P,_]=(0,t.useState)(''),[B,R]=(0,t.useState)(''),[A,F]=(0,t.useState)(''),[I,L]=(0,t.useState)('');async function O(){c(await(0,h.api)('/api/account')),'owner'===e.user?.role&&p(await(0,h.api)('/api/admin/readiness'))}async function E(e,t){_(e),j('');try{await t(),await O()}catch(e){j(e.message)}finally{_(''),L('')}}async function H(){const e=await(0,h.api)('/api/broker/kite/start',{});await(0,d.openExternal)(e.url)}(0,t.useEffect)(()=>{O().catch(e=>j(e.message))},[e.user?.id]);const D={sessions:['Sign out every device?','You will need to sign in again on the web and mobile app.','Sign out all devices'],disconnect:['Disconnect Kite?','This revokes the stored authorization. It does not close broker positions or cancel existing broker orders.','Disconnect Kite'],access:[`Grant pilot access to ${B}?`,`${B} will receive 14 days of included pilot access, starting now, with no payment requested. Check that this is the intended person.`,'Grant 14 days of access'],recovery:[`Create a recovery link for ${B}?`,`Any earlier recovery links for ${B} stop working. When this link is used, every signed-in session for that account is revoked. It expires in 30 minutes, and no email is sent; share it privately.`,'Create recovery link']},$=D[I]||D.disconnect;return l?(0,v.jsxs)(x.DeskPage,{children:[(0,v.jsx)(k,{title:`Your workspace, ${l.user.name.split(' ')[0]}.`,detail:"One account for your research, broker connection and plans."}),(0,v.jsx)(C,{error:y,notice:w}),(0,v.jsxs)(s.default,{style:b.s.card,children:[(0,v.jsxs)(s.default,{style:b.s.between,children:[(0,v.jsx)(b.T,{style:{fontFamily:'InterSemi',fontSize:19},children:"Zerodha Kite"}),(0,v.jsx)(b.Badge,{label:l.broker.status.replace(/_/g,' ').toUpperCase(),tone:'connected'===l.broker.status?'green':'amber'})]}),(0,v.jsx)(b.T,{style:{fontSize:15,lineHeight:25,color:b.C.muted},children:"Connect through Kite\u2019s own login. Authorization expires daily; reconnect when prompted. Connecting your account does not enable live orders."}),l.broker.account&&(0,v.jsx)(T,{label:"Connected account",value:l.broker.account}),(0,v.jsx)(T,{label:"Session expires",value:S(l.broker.expires)}),(0,v.jsxs)(s.default,{style:[b.s.row,{flexWrap:'wrap'}],children:[(0,v.jsx)(b.Button,{label:'connected'===l.broker.status?'Reconnect Kite':'Connect Kite',disabled:!l.broker.configured||!e.billing?.access,loading:'connect'===P,onPress:()=>E('connect',H)}),(0,v.jsx)(b.Button,{label:"Refresh status",kind:"outline",onPress:()=>E('refresh',O)}),'connected'===l.broker.status&&(0,v.jsx)(b.Button,{label:"Disconnect",kind:"ghost",onPress:()=>L('disconnect')})]}),!e.billing?.access&&(0,v.jsx)(b.T,{style:{color:b.C.amber},children:"Complete billing setup to connect a broker."}),!l.broker.configured&&(0,v.jsx)(b.T,{style:{color:b.C.amber},children:"The owner needs to configure the Kite Connect app."})]}),(0,v.jsxs)(s.default,{style:b.s.card,children:[(0,v.jsx)(b.T,{style:{fontFamily:'InterSemi',fontSize:19},children:"Your pilot membership"}),(0,v.jsx)(T,{label:"Account",value:l.user.email}),(0,v.jsx)(T,{label:"Access",value:l.billing.access_reason}),(0,v.jsx)(T,{label:"Payments",value:"Razorpay \xb7 test mode"}),(0,v.jsx)(b.Button,{label:"Manage membership",kind:"outline",onPress:()=>o.router.push('/billing')})]}),(0,v.jsxs)(s.default,{style:b.s.card,children:[(0,v.jsx)(b.T,{style:{fontFamily:'InterSemi',fontSize:19},children:"Security & devices"}),(0,v.jsx)(T,{label:"Active sessions",value:l.devices}),(0,v.jsx)(b.T,{style:{fontSize:14,lineHeight:23,color:b.C.muted},children:"Signing out of all devices also revokes the mobile app\u2019s session. Broker authorization is managed separately."}),(0,v.jsxs)(s.default,{style:[b.s.row,{flexWrap:'wrap'}],children:[(0,v.jsx)(b.Button,{label:"Sign out",kind:"outline",onPress:()=>E('logout',async()=>{await e.signOut(),o.router.replace('/welcome')})}),(0,v.jsx)(b.Button,{label:"Sign out all devices",kind:"ghost",onPress:()=>L('sessions')})]})]}),u&&(0,v.jsxs)(s.default,{style:b.s.card,children:[(0,v.jsx)(b.T,{style:{fontFamily:'InterSemi',fontSize:19},children:"Pilot owner controls"}),(0,v.jsx)(b.T,{style:{fontSize:14,color:b.C.muted},children:"Invitations are private, single-use and expire in 72 hours. Recovery links expire in 30 minutes and revoke all sessions when used."}),(0,v.jsx)(f.Field,{label:"Invite or recover an email",value:B,onChangeText:R,keyboardType:"email-address"}),(0,v.jsxs)(s.default,{style:[b.s.row,{flexWrap:'wrap'}],children:[(0,v.jsx)(b.Button,{label:"Open admin panel",icon:"shield",onPress:()=>o.router.push('/admin')}),(0,v.jsx)(b.Button,{label:"Create invitation",kind:"soft",disabled:!B,loading:'invite'===P,onPress:()=>E('invite',async()=>F((await(0,h.api)('/api/admin/invites',{email:B})).url))}),(0,v.jsx)(b.Button,{label:"Grant 14 days of pilot access",kind:"outline",disabled:!B,loading:'access'===P,onPress:()=>L('access')}),(0,v.jsx)(b.Button,{label:"Create recovery link",kind:"outline",disabled:!B,loading:'recovery'===P,onPress:()=>L('recovery')})]}),!!A&&(0,v.jsxs)(s.default,{style:{gap:8},children:[(0,v.jsx)(b.T,{style:{fontSize:13,color:b.C.amber},children:"Share this link privately with the intended person. No email has been sent."}),(0,v.jsx)(b.T,{selectable:!0,style:{fontSize:13,lineHeight:23},children:A})]}),(0,v.jsx)(s.default,{style:b.s.line}),[['Google sign-in',u.google],['Razorpay test billing',u.razorpay],['Kite credentials',u.kite],['Live execution',!1]].map(([e,t])=>(0,v.jsx)(T,{label:e,value:t?'Configured':'Live execution'===e?'Disabled':'Awaiting setup'},String(e))),(0,v.jsx)(b.T,{style:{fontSize:14,color:b.C.muted},children:"Callback URLs for this environment"}),Object.entries(u.callbacks).map(([e,t])=>(0,v.jsxs)(s.default,{style:{gap:5},children:[(0,v.jsx)(b.T,{style:{fontSize:13,color:b.C.green},children:e}),(0,v.jsx)(b.T,{selectable:!0,style:{fontSize:13,lineHeight:21},children:String(t)})]},e))]}),(0,v.jsxs)(s.default,{style:[b.s.row,{flexWrap:'wrap'}],children:[(0,v.jsx)(b.Button,{label:"Pilot terms",kind:"ghost",onPress:()=>o.router.push('/terms')}),(0,v.jsx)(b.Button,{label:"Privacy",kind:"ghost",onPress:()=>o.router.push('/privacy')}),(0,v.jsx)(b.Button,{label:"Open on my phone",kind:"ghost",onPress:()=>o.router.push('/connect')})]}),(0,v.jsxs)(b.Sheet,{visible:!!I,onClose:()=>L(''),title:$[0],children:[(0,v.jsx)(b.T,{style:{fontSize:16,lineHeight:26},children:$[1]}),(0,v.jsx)(b.Button,{label:$[2],loading:!!P,onPress:()=>E(I,async()=>{'sessions'===I?(await e.signOut(!0),o.router.replace('/signin')):'access'===I?(await(0,h.api)('/api/admin/access',{email:B}),z(`Included pilot access granted to ${B} for 14 days.`)):'recovery'===I?F((await(0,h.api)('/api/admin/recovery',{email:B})).url):await(0,h.api)('/api/broker/disconnect',{})})})]})]}):y?(0,v.jsxs)(x.DeskPage,{children:[(0,v.jsx)(C,{error:y}),(0,v.jsx)(b.Button,{label:"Retry",onPress:()=>O().catch(e=>j(e.message))})]}):(0,v.jsx)(b.Loading,{})},_e.BillingScreen=function(){const e=(0,d.useAuth)(),[n,c]=(0,t.useState)(null),[u,p]=(0,t.useState)(!1),[y,x]=(0,t.useState)(!1),[j,w]=(0,t.useState)(''),[k,z]=(0,t.useState)(!1);async function P(){c(await(0,h.api)('/api/billing/status')),await e.refresh()}async function _(e){z(!0),w('');try{await e(),await P()}catch(e){w(e.message)}finally{z(!1),x(!1)}}return(0,t.useEffect)(()=>{P().catch(e=>w(e.message))},[]),(0,v.jsxs)(f.FormPage,{title:"One membership. Your full workspace.",detail:"Chart research, personal watchlists, plan review and a virtual workflow account, together.",children:[(0,v.jsx)(C,{error:j}),(0,v.jsxs)(s.default,{style:b.s.card,children:[(0,v.jsx)(b.Badge,{label:"RAZORPAY TEST MODE",tone:"amber"}),(0,v.jsx)(b.T,{style:{fontFamily:'ManropeBold',fontSize:26},children:"Private pilot"}),(0,v.jsx)(b.T,{style:{fontSize:15,lineHeight:25,color:b.C.muted},children:"Invite-only access. The owner has included access. Other members use the test subscription plan once it is configured. Pricing is shown by Razorpay before authorization."}),(0,v.jsx)(T,{label:"Your access",value:n?.access_reason||'Loading'}),n?.subscription&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(T,{label:"Subscription",value:n.subscription.status}),(0,v.jsx)(T,{label:"Current period ends",value:S(n.subscription.current_end)}),n.subscription.cancel_at_end&&(0,v.jsx)(b.T,{style:{color:b.C.amber},children:"Cancellation is scheduled at the end of the current period."})]})]}),n?n.configured?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(f.Consent,{value:u,onChange:p,children:"I understand this is a Razorpay test subscription. I will use test payment details."}),(0,v.jsx)(b.Button,{label:n?.subscription?'Continue test checkout':'Open test checkout',disabled:!u||!!n?.access,loading:k,onPress:()=>_(async()=>{const e=await(0,h.api)('/api/billing/checkout',{acknowledge_test:!0});await(0,d.openExternal)(e.url)})}),(0,v.jsx)(b.Button,{label:"I\u2019ve completed checkout \xb7 refresh access",kind:"outline",loading:k,onPress:()=>_(async()=>{await(0,h.api)('/api/billing/refresh',{})})})]}):(0,v.jsxs)(s.default,{style:b.s.card,children:[(0,v.jsx)(b.T,{style:{fontSize:17,fontFamily:'InterSemi'},children:"Checkout is awaiting setup."}),(0,v.jsx)(b.T,{style:{fontSize:15,lineHeight:25,color:b.C.muted},children:"The owner needs a Razorpay test account and subscription plan. No payment has been requested. Your account remains saved."})]}):j?(0,v.jsx)(b.Button,{label:"Retry billing status",kind:"outline",onPress:()=>{w(''),P().catch(e=>w(e.message))}}):(0,v.jsxs)(s.default,{accessibilityLiveRegion:"polite",style:[b.s.card,b.s.row],children:[(0,v.jsx)(l.default,{color:b.C.green}),(0,v.jsx)(b.T,{style:{fontSize:15,color:b.C.muted},children:"Checking checkout setup\u2026"})]}),n?.subscription&&!n.subscription.cancel_at_end&&(0,v.jsx)(b.Button,{label:"Cancel test subscription",kind:"ghost",onPress:()=>x(!0)}),(0,v.jsx)(b.Button,{label:n?.access?'Open my workspace':'Back to my account',kind:"outline",onPress:()=>o.router.push(n?.access?'/':'/account')}),(0,v.jsxs)(b.Sheet,{visible:y,onClose:()=>x(!1),title:"Cancel this subscription?",children:[(0,v.jsx)(b.T,{style:{fontSize:16,lineHeight:26},children:"Cancellation is requested for the end of the current billing cycle. Your account and saved plans remain available for later use."}),(0,v.jsx)(b.Button,{label:"Confirm cancellation",loading:k,onPress:()=>_(async()=>{await(0,h.api)('/api/billing/cancel',{})})})]})]})},_e.Activity=function(){const{product:e,refreshProduct:n,loading:l}=(0,u.useProduct)(),[o,c]=(0,t.useState)('all'),[d,h]=(0,t.useState)(''),p=(e.events||[]).filter(e=>'all'===o||e.kind===o);return(0,v.jsxs)(x.DeskPage,{children:[(0,v.jsx)(k,{title:"Every decision has a trail.",detail:"Your account, research plans and order events in one timeline."}),(0,v.jsxs)(s.default,{style:[b.s.row,{flexWrap:'wrap'}],children:[['all','plan','simulation','broker','billing','session'].map(e=>(0,v.jsx)(b.Chip,{label:'all'===e?'Everything':e[0].toUpperCase()+e.slice(1),active:o===e,onPress:()=>c(e)},e)),(0,v.jsx)(b.Button,{label:"Refresh",kind:"ghost",onPress:()=>n().catch(e=>h(e.message))})]}),(0,v.jsx)(C,{error:d}),l&&!(e.events||[]).length?(0,v.jsx)(b.Loading,{}):p.length?p.map(e=>(0,v.jsxs)(s.default,{style:[b.s.card,{borderLeftColor:'simulation'===e.kind?b.C.amber:b.C.green,borderLeftWidth:2}],children:[(0,v.jsxs)(s.default,{style:[b.s.between,{flexWrap:'wrap'}],children:[(0,v.jsx)(b.T,{style:{fontSize:17,fontFamily:'InterSemi'},children:e.title}),(0,v.jsx)(b.T,{style:{fontSize:12,color:b.C.muted},children:S(e.created)})]}),(0,v.jsx)(b.T,{style:{fontSize:15,lineHeight:25,color:b.C.muted},children:e.detail}),(0,v.jsxs)(b.T,{selectable:!0,style:{fontSize:12,color:b.C.muted},children:["Reference ",e.id.slice(0,12)]})]},e.id)):(0,v.jsx)(b.Empty,{title:"Your timeline starts here",detail:"Save a setup or make a plan to see the next step recorded here."})]})},_e.AutoTrade=function(){const{product:e,refreshProduct:l,setStudyDraft:d,loading:z,state:P}=(0,u.useProduct)(),{width:_}=(0,n.default)(),[B,R]=(0,t.useState)(!1),A=(0,y.dataAgeDays)(P?.source_latest),F=(0,y.isStale)(A,P?.source_stale)||B,[I,L]=(0,t.useState)(null),[O,E]=(0,t.useState)(''),[H,D]=(0,t.useState)(null),[$,W]=(0,t.useState)('target'),[M,Y]=(0,t.useState)(!1),[q,N]=(0,t.useState)(!1),[K,U]=(0,t.useState)(null),G=(0,t.useRef)('');async function V(){L(await(0,h.api)('/api/trading')),await l()}const Q=(0,j.usePanelVisible)(),[Z,J]=(0,t.useState)(()=>'hidden'!==globalThis.document?.visibilityState),X=Q&&Z;async function ee(e){N(!0),E('');try{await e(),await V(),U(null)}catch(e){E((0,p.planError)(e)),'DATA_STALE'===e?.code&&R(!0)}finally{N(!1)}}function te(e){G.current=c.randomUUID(),D(e),Y(!1),W('target'),E('')}(0,t.useEffect)(()=>{const e=globalThis.document;if(!e?.addEventListener)return;const t=()=>J('hidden'!==e.visibilityState);return e.addEventListener('visibilitychange',t),()=>e.removeEventListener('visibilitychange',t)},[]),(0,t.useEffect)(()=>
985{if(!X)return;let e=!0;const t=()=>(0,h.api)('/api/trading').then(t=>{e&&L(t)}).catch(t=>{e&&E(t.message)});t();const s=setInterval(t,5e3);return()=>{e=!1,clearInterval(s)}},[X]);const se=(e.plans||[]).filter(e=>'draft'===e.status||'illustrative'===e.status),ie=I?.wallet,ae=(I?.orders||[]).filter(e=>['queued','partial','open'].includes(e.status));return(0,v.jsxs)(x.DeskPage,{children:[(0,v.jsx)(k,{title:"A plan. A controlled next step.",detail:"Review your setup, test the order journey and follow every outcome."}),(0,v.jsx)(C,{error:O}),(0,v.jsxs)(s.default,{style:[b.s.card,{borderColor:b.C.greenLine2}],children:[(0,v.jsxs)(s.default,{style:[b.s.between,{flexWrap:'wrap'}],children:[(0,v.jsx)(b.Badge,{label:"VIRTUAL WORKFLOW ACCOUNT",tone:"amber"}),(0,v.jsx)(b.Badge,{label:"LIVE ORDERS DISABLED",tone:"neutral"})]}),(0,v.jsx)(b.T,{style:{fontSize:15,lineHeight:25,color:b.C.muted},children:"These are artificial price scenarios for testing entry, risk and exit handling. The virtual results are separate from your stock\u2019s historical backtest. Capital figures exclude scenario outcomes."}),(0,v.jsx)(s.default,{style:{flexDirection:'phone'!==(0,b.layoutMode)(_)?'row':'column',gap:22},children:[['Starting capital',ie?.initial_paise],['Available virtual cash',ie?ie.available_capital_paise??ie.initial_paise-ie.reserved_paise:void 0],['Reserved for open simulations',ie?.reserved_paise]].map(([e,t])=>(0,v.jsxs)(s.default,{style:{flex:1,gap:7},children:[(0,v.jsx)(b.T,{style:{fontSize:13,color:b.C.muted},children:e}),(0,v.jsx)(b.T,{style:{fontSize:26,fontFamily:'ManropeBold'},children:null==t?'\u2014':(0,h.money)(Number(t)/100)})]},String(e)))}),null!=ie?.loss_limit_paise&&(0,v.jsxs)(b.T,{style:{fontSize:13,lineHeight:20,color:ie.loss_limit_reached?b.C.red:b.C.muted},children:[ie.loss_limit_reached?'Loss limit reached - new simulated entries are blocked. ':'',"Realized scenario losses ",(0,h.money
985)(Number(ie.realized_loss_paise||0)/100)," of ",(0,h.money)(Number(ie.loss_limit_paise)/100)," limit. Scenario gains do not offset this limit."]}),(0,v.jsxs)(s.default,{style:{gap:6,borderTopWidth:1,borderColor:b.C.line,paddingTop:14},children:[(0,v.jsxs)(s.default,{style:[b.s.between,{flexWrap:'wrap'}],children:[(0,v.jsx)(b.T,{style:{fontSize:13,color:b.C.muted},children:"Chosen-scenario outcome (synthetic)"}),(0,v.jsx)(b.Badge,{label:"NOT CAPITAL \xb7 NOT MARKET RESULT",tone:"amber"})]}),(0,v.jsx)(b.T,{style:{fontSize:20,fontFamily:'ManropeBold',color:b.C.muted},children:ie?(0,h.money)((ie.scenario_outcome_total_paise??ie.realized_paise)/100):'\u2014'}),(0,v.jsxs)(b.T,{style:{fontSize:13,lineHeight:21,color:b.C.muted},children:[ie?`${ie.scenario_outcome_count??0} closed simulation${1===ie.scenario_outcome_count?'':'s'}. `:'',"You picked each price scenario in Review test order. Outcomes are after assumed costs, are not market, historical or broker results, and are not added to your capital."]})]}),(0,v.jsxs)(s.default,{style:[b.s.row,{flexWrap:'wrap'}],children:[(0,v.jsx)(b.Button,{label:ie?.paused?'Resume new entries':'Pause new entries',kind:"outline",disabled:!ie,loading:q,onPress:()=>ie?.paused?ee(()=>(0,h.api)('/api/trading/pause',{paused:!1})):U({kind:'pause'})}),(0,v.jsx)(b.T,{style:{fontSize:13,color:b.C.muted},children:"Open simulations can still exit while paused."})]})]}),F&&(0,v.jsxs)(s.default,{accessibilityLiveRegion:"polite",style:[b.s.card,{backgroundColor:b.C.amberBg}],children:[(0,v.jsx)(b.T,{style:{fontSize:16,fontFamily:'InterSemi',color:b.C.amber},children:"Fresh prices are needed before new simulations"}),(0,v.jsxs)(b.T,{style:{fontSize:14,lineHeight:23,color:b.C.muted},children:["Stored market data ends ",(0,h.dateText)(P?.source_latest)," \xb7 ",(0,y.dataAgeText)(A),". New simulations are refused while stored prices are older than the allowed age. Your plans stay saved and research remains available; simulations can start again once prices are refreshed."]})]}),(0,v.jsxs)(b.T,{style:{fontSize:22,fontFamily:'ManropeBold'},children:["Ready for your review ",(0,v.jsxs)(b.T,{style:{color:b.C.muted},children:["(",se.length,")"]})]}),z&&!se.length?(0,v.jsx)(b.Loading,{}):se.length?se.map(e=>{const t='illustrative'===e.status||!0===e.illustrative,n='legacy'===e.evidence_check,l=w(e);return(0,v.jsxs)(s.default,{style:b.s.card,children:[(0,v.jsxs)(s.default,{style:[b.s.between,{flexWrap:'wrap'}],children:[(0,v.jsxs)(s.default,{style:{gap:5},children:[(0,v.jsx)(b.T,{style:{fontFamily:'InterSemi',fontSize:19},children:e.symbol}),(0,v.jsxs)(b.T,{style:{fontSize:14,color:b.C.muted},children:[e.pattern_name," \xb7 ",e.timeframe," \xb7 ",e.side]})]}),(0,v.jsx)(b.Badge,{label:t?'ILLUSTRATIVE':'DRAFT',tone:t?'amber':'neutral'})]}),t&&(0,v.jsx)(b.T,{style:{fontSize:13,lineHeight:21,fontFamily:'InterMedium',color:b.C.amber},children:"Illustrative \xb7 no tested evidence for this exit rule \xb7 can\u2019t be simulated"}),n&&(0,v.jsxs)(b.T,{style:{fontSize:13,lineHeight:21,color:b.C.amber},children:["Saved before evidence checks. ",!0===e.tradable_evidence?'Its rule was the frozen tested rule.':'Its exits have no exact-rule evidence; prepare it again before relying on it.']}),!n&&!0!==e.tradable_evidence&&!!e.tradable_reason&&(0,v.jsx)(b.T,{style:{fontSize:12,lineHeight:19,color:b.C.muted},children:e.tradable_reason}),(0,v.jsx)(T,{label:"Planned capital",value:(0,h.money)(e.notional)}),(0,v.jsx)(T,{label:"Stop / reward to risk",value:`${e.stop_pct?.toFixed(2)}% / ${e.reward?.toFixed(2)}:1`}),(0,v.jsx)(T,{label:"Planned maximum hold",value:e.exit_evidence?.holding?.label||`${e.hold} completed ${e.timeframe} candles`}),(0,v.jsxs)(s.default,{style:[b.s.row,{flexWrap:'wrap'}],children:[l&&(0,v.jsx)(b.Button,{label:"Review test order",disabled:ie?.paused,onPress:()=>te(e)}),e.research_context&&(0,v.jsx)(b.Button,{label:"Source historical study",kind:"outline",onPress:()=>{d({...e.research_context.settings,jobId:e.research_context.id}),o.router.push('/simulate')}}),(0,v.jsx)(b.Button,{label:t?'Archive plan':'Archive draft',kind:"ghost",onPress:()=>U({kind:'archive',id:e.id,symbol:e.symbol})})]}),!l&&!t&&(0,v.jsx)(b.T,{style:{fontSize:12,color:b.C.muted},children:"Test orders need tested evidence for this exact exit rule. Prepare the plan again from Discover."})]},e.id)}):(0,v.jsx)(b.Empty,{title:"Start with a chart you understand",detail
985:"Open a setup, review its evidence and save a plan. It will arrive here for your next step.",action:(0,v.jsx)(b.Button,{label:"Discover setups",onPress:()=>o.router.push('/chart')})}),(0,v.jsxs)(s.default,{style:b.s.between,children:[(0,v.jsx)(b.T,{style:{fontSize:22,fontFamily:'ManropeBold'},children:"Orders & outcomes"}),(0,v.jsx)(b.T,{style:{fontSize:13,color:b.C.muted},children:I?`${ae.length} active`:''})]}),I?!I.orders?.length&&(0,v.jsx)(b.T,{style:{fontSize:15,color:b.C.muted},children:"Your first simulated order will appear here."}):(0,v.jsx)(b.T,{style:{fontSize:15,color:b.C.muted},children:O?'Orders could not be loaded yet. This page retries every few seconds.':'Loading your simulated orders\u2026'}),(I?.orders||[]).map(e=>(0,v.jsxs)(s.default,{style:b.s.card,children:[(0,v.jsxs)(s.default,{style:[b.s.between,{flexWrap:'wrap'}],children:[(0,v.jsxs)(b.T,{style:{fontSize:18,fontFamily:'InterSemi'},children:[e.symbol," ",(0,v.jsxs)(b.T,{style:{fontSize:13,color:b.C.muted},children:[e.product," \xb7 ",e.mode]})]}),(0,v.jsx)(b.Badge,{label:e.status.toUpperCase(),tone:'rejected'===e.status?'red':'closed'===e.status?'green':'amber'})]}),(0,v.jsx)(T,{label:"Filled quantity",value:`${e.filled_qty} / ${e.payload.plan?.quantity||e.payload.quantity||'\u2014'}`}),(0,v.jsx)(T,{label:"Average fill",value:e.average_paise?(0,h.money)(e.average_paise/100):'Awaiting fill'}),'simulation'===e.mode&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(T,{label:"Scenario you chose",value:e.payload.scenario}),(0,v.jsx)(T,{label:`Outcome of the scenario you chose (${e.payload.scenario}) \u2014 synthetic, after assumed costs`,value:['queued','partial','open'].includes(e.status)?'Recorded at close':(0,h.money)(e.realized_paise/100)}),(0,v.jsx)(T,{label:"Favorable / adverse move",value:`${Number(e.payload.mfe_pct||0).toFixed(2)}% / ${Number(e.payload.mae_pct||0).toFixed(2)}%`})]}),e.payload.reason&&(0,v.jsx)(b.T,{style:{fontSize:14,color:b.C.muted},children:e.payload.reason}),(0,v.jsx)(b.T,{style:{fontSize:12,color:b.C.muted},children:S(e.updated)}),(0,v.jsxs)(s.default,{style:[b.s.row,{flexWrap:'wrap'}],children:['simulation'===e.mode&&['queued','partial','open'].includes(e.status)&&(0,v.jsx)(b.Button,{label:"Advance scenario",kind:"outline",loading:q,onPress:()=>ee(()=>(0,h.api)('/api/trading/advance',{id:e.id}))})," ",'queued'===e.status&&(0,v.jsx)(b.Button,{label:"Cancel unfilled order",kind:"ghost",onPress:()=>U({kind:'cancel',id:e.id,symbol:e.symbol})})," ",['partial','open'].includes(e.status)&&(0,v.jsx)(b.Button,{label:"Exit simulation",kind:"ghost",onPress:()=>U({kind:'exit',id:e.id,symbol:e.symbol})})]})]},e.id)),(0,v.jsxs)(s.default,{style:b.s.card,children:[(0,v.jsx)(b.T,{style:{fontSize:19,fontFamily:'InterSemi'},children:"Your live trading connection"}),(0,v.jsx)(b.T,{style:{fontSize:15,lineHeight:25,color:b.C.muted},children:"Kite authorization and live execution are separate. Live execution stays locked for this release while broker approval, fresh data, operating limits and the execution review are completed."}),(0,v.jsx)(b.Button,{label:"Manage Kite connection",kind:"outline",onPress:()=>o.router.push('/account')})]}),(0,v.jsxs)(b.Sheet,{visible:!!H,onClose:()=>D(null),title:`Review ${H?.symbol||''}`,subtitle:"Synthetic workflow simulation",children:[(0,v.jsx)(C,{error:O}),(0,v.jsx)(b.T,{style:{fontSize:15,lineHeight:25,color:b.C.muted},children:"The saved chart price sets the scale only. Artificial price steps run in seconds to test order handling; they do not reproduce the chart\u2019s holding period or predict the market."}),(0,v.jsx)(T,{label:"Quantity",value:H?.quantity}),(0,v.jsx)(T,{label:"Virtual capital reserved",value:(0,h.money)((H?.notional||0)+(H?.reserved_cost||0))}),(0,v.jsx)(T,{label:"Planned risk including assumed costs",value:(0,h.money)(H?.planned_risk)}),(0,v.jsx)(b.T,{style:{fontSize:15,fontFamily:'InterSemi'},children:"Choose the behavior to test"}),(0,v.jsx)(s.default,{style:{gap:10},children:[['target','Move toward target'],['stop','Stop reached'],['gap','Gap beyond stop'],['partial','Partial fill, then continuation'],['rejected','Broker rejection']].map(([e,t])=>(0,v.jsx)(b.Chip,{label:t,active:$===e,onPress:()=>{W(e),G.current=c.randomUUID()}},e))}),(0,v.jsx)(f.Consent,{value:M,onChange:Y,children:"I understand this uses synthetic prices and virtual money. No broker order will be sent."}),!!H&&!w(H)&&(0,v.jsx)(b.T,{accessibilityRole:"alert",style:{fontSize:13,color:b.C.amber},children:"This plan has no tested evidence for its exact exit rule, so it can\u2019t be simulated."}),F&&(0,v.jsxs)(b.T,{accessibilityRole:"alert",style:{fontSize:13,lineHeight:21,color:b.C.amber},children:[(0,y.dataAgeText)(A)," (stored data ends ",(0,h.dateText)(P?.source_latest),"). Fresh prices are needed, so the server will refuse this simulation if the data is older than
985its allowed age."]}),(0,v.jsx)(b.Button,{label:"Start this simulation",loading:q,disabled:!M||!w(H),onPress:()=>ee(async()=>{await(0,h.api)('/api/trading/simulate',{plan_id:H.id,request_id:G.current,scenario:$,acknowledge_synthetic:!0}),D(null)})})]}),(0,v.jsxs)(b.Sheet,{visible:!!K,onClose:()=>U(null),title:'pause'===K?.kind?'Pause new simulated entries?':`${'archive'===K?.kind?'Archive plan':'exit'===K?.kind?'Exit simulation':'Cancel order'} \xb7 ${K?.symbol||''}`,children:[(0,v.jsx)(b.T,{style:{fontSize:16,lineHeight:26},children:'pause'===K?.kind?'No new simulations can start until you resume. Filled simulations can still advance to their exits or be exited by you. Queued orders wait unfilled and can still be cancelled.':'archive'===K?.kind?'The draft will leave your review list. Existing orders are managed separately.':'exit'===K?.kind?'Close the filled virtual quantity at the current synthetic mark and release its reserved capital.':'Cancel the unfilled simulated order and release its reserved capital.'}),(0,v.jsx)(b.Button,{label:'pause'===K?.kind?'Pause new entries':'Confirm',loading:q,onPress:()=>ee(()=>'pause'===K.kind?(0,h.api)('/api/trading/pause',{paused:!0}):(0,h.api)('archive'===K.kind?'/api/product/plan-action':'/api/trading/'+K.kind,'archive'===K.kind?{id:K.id,action:'archive'}:{id:K.id}))})]})]})},_e.Recovery=function(){const e=(0,o.useLocalSearchParams)(),[s,n]=(0,t.useState)(''),[l,c]=(0,t.useState)(''),[d,u]=(0,t.useState)(!1),[p,y]=(0,t.useState)(!1);return(0,v.jsxs)(f.FormPage,{title:d?'Your password is updated.':'Recover your account.',detail:d?'All prior sessions have been revoked. Sign in with your new password.':'Use the private recovery link supplied by the pilot owner.',children:[(0,v.jsx)(C,{error:l}),d?(0,v.jsx)(b.Button,{label:"Sign in",onPress:()=>o.router.replace('/signin')}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(f.Field,{label:"New password \xb7 at least 12 characters",value:s,onChangeText:n,secure:!0,autoComplete:"new-password"}),(0,v.jsx)(b.Button,{label:"Set my new password",disabled:s.length<12||!e.code,loading:p,onPress:async()=>{y(!0);try{await(0,h.api)('/api/auth/recover',{code:String(e.code),password:s}),u(!0)}catch(e){c(e.message)}finally{y(!1)}}})]})]})};var t=r(_d[0]),s=e(r(_d[1]));r(_d[2]);var n=e(r(_d[3])),l=e(r(_d[4])),o=r(_d[5]),c=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}),t.default=e,t})(r(_d[6])),d=r(_d[7]),u=r(_d[8]),h=r(_d[9]),p=r(_d[10]),y=r(_d[11]),x=r(_d[12]),f=r(_d[13]),b=r(_d[14]),j=r(_d[15]),v=r(_d[16]);const S=e=>e?(0,h.dateTimeText)(e):'\u2014',w=e=>'draft'===e?.status&&!0!==e?.illustrative&&!0===e?.tradable_evidence;function k({title:e,detail:t}){return(0,v.jsxs)(s.default,{style:{gap:9},children:[(0,v.jsx)(b.T,{accessibilityRole:"header",style:b.s.title,children:e}),(0,v.jsx)(b.T,{style:{fontSize:16,lineHeight:25,color:b.C.muted},children:t})]})}function C({error:e,notice:t}){return(0,v.jsxs)(v.Fragment,{children:[!!e&&(0,v.jsx)(b.T,{accessibilityRole:"alert",style:{fontSize:14,lineHeight:23,color:b.C.red},children:e}),!!t&&(0,v.jsx)(b.T,{style:{fontSize:14,lineHeight:23,color:b.C.green},children:t})]})}function T({label:e,value:t}){return(0,v.jsxs)(s.default,{style:[b.s.between,{flexWrap:'wrap'}],children:[(0,v.jsx)(b.T,{style:{fontSize:14,color:b.C.muted},children:e}),(0,v.jsx)(b.T,{style:{fontSize:15},children:t})]})}},892,[11,13,136,400,360,252,203,198,196,197,838,248,893,894,821,871,6]); 986__d(function(g,r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DeskEmbedded",{enumerable:!0,get:function(){return T}}),_e.DeskPage=z,_e.TraderDesk=function(){const{state:e,matches:s,filters:c,setFilters:h,query:u,setQuery:j,setFilterOpen:S,setDetail:v,loading:T,error:B,refresh:P,setStock:I,product:L,defaultFilters:M}=(0,f.useProduct)(),{width:R}=(0,d.default)(),A=R>=m.BREAKPOINTS.desktop,F='phone'===(0,m.layoutMode)(R),H=M||(0,y.discoverDefaults)(),[W,E]=(0,t.useState)('all'),[$,_]=(0,t.useState)(''),[D,O]=(0,t.useState)(6),[N,Y]=(0,t.useState)(''),[U,K]=(0,t.useState)(''),[V,q]=(0,t.useState)(!1),[G,Q]=(0,t.useState)([]),[J,X]=(0,t.useState)(!1),[Z,ee]=(0,t.useState)(0),te=(0,t.useMemo)(()=>(0,p.filterMatches)(s,c,u),[s,c,u]),se={review:0,history:0,watch:0,pass:0};
986te.forEach(e=>se[(0,y.decision)(e,c).verdict]++);const le=te.filter(e=>'all'===W||(0,y.decision)(e,c).verdict===W),re=le.find(e=>e.id===$)||le[0];function ne(t){const l=t.toLowerCase().trim();if(!l)return;let n={...H};const i=l.match(/\b(1h|4h|1d|1w)\b/);i&&(n.timeframe=i[1].toUpperCase()),l.includes('bull')&&(n.direction='bullish'),l.includes('bear')&&(n.direction='bearish'),/2\s*[-\u2013]\s*5/.test(l)&&(n.band='2_5'),/1\s*[-\u2013]\s*2/.test(l)&&(n.band='1_2'),/5\s*[-\u2013]\s*10/.test(l)&&(n.band='5_10'),/over 10|>\s*10/.test(l)&&(n.band='over_10');const o=s.find(e=>e.symbol.toLowerCase()===l),d=e?.patterns?.find(e=>l.includes(e.name.toLowerCase()));o||d?(j(o?.symbol||d.name),h(n),E('all')):i||n.band||'all'!==n.direction?(h(n),j(''),E('all')):(j(t.trim()),E('all')),K(`Your focus: ${t}. Each result still uses that stock\u2019s own history.`),Y('')}return(0,t.useEffect)(()=>O(6),[c,u,W]),(0,t.useEffect)(()=>{let e=!0;if(Q([]),u.length<2)return;const t=setTimeout(()=>(0,p.api)('/api/stocks?q='+encodeURIComponent(u)).then(t=>{e&&Q(t.slice(0,4))}).catch(()=>{}),250);return()=>{e=!1,clearTimeout(t)}},[u]),T?(0,w.jsx)(m.Loading,{}):B&&!e?(0,w.jsx)(z,{children:(0,w.jsx)(m.Empty,{title:"Let\u2019s reconnect your agent",detail:B,action:(0,w.jsx)(m.Button,{label:"Reconnect",onPress:P})})}):(0,w.jsxs)(z,{children:[(0,w.jsxs)(l.default,{style:[m.s.between,{alignItems:'flex-start'}],children:[(0,w.jsxs)(l.default,{style:{gap:6},children:[(0,w.jsxs)(l.default,{style:m.s.row,children:[(0,w.jsx)(m.T,{style:{fontFamily:'ManropeBold',fontSize:F?25:32,lineHeight:40,letterSpacing:-.8},children:"Trader Agent"}),(0,w.jsx)(l.default,{style:{width:6,height:6,borderRadius:3,backgroundColor:m.C.green}})]}),!F&&(0,w.jsx)(m.T,{style:{fontSize:12,color:m.C.muted},children:"The market, reviewed. Your next move, explained."})]}),(0,w.jsxs)(l.default,{style:{alignItems:'flex-end',gap:6},children:[(0,w.jsx)(m.Badge,{label:e?.source_stale?'HISTORICAL REPLAY':'COMPLETED CANDLES',tone:"amber"}),(0,w.jsx)(m.T,{style:{fontSize:10,color:m.C.muted},children:(0,p.dateText)(e?.source_latest)})]})]}),F?(0,w.jsxs)(l.default,{style:{borderWidth:1,borderColor:m.C.greenLine,backgroundColor:m.C.tealBg,borderRadius:11,padding:13,gap:13},children:[(0,w.jsxs)(l.default,{style:m.s.row,children:[(0,w.jsx)(C.AgentMark,{size:23}),(0,w.jsxs)(m.T,{style:{fontFamily:'InterMedium',fontSize:12,flex:1},children:[se.review," setups for review. ",e?.source_stale?'Fresh prices come next.':'Open one to see the reasoning.']})]}),(0,w.jsx)(l.default,{style:[m.s.row,{justifyContent:'space-around'}],children:[[e?.universe,'stocks covered'],[s.length,'patterns stored'],[te.length,'with your history filter']].map(([e,t],s)=>(0,w.jsxs)(l.default,{style:{flex:1,gap:3,alignItems:'center'},children:[(0,w.jsx)(m.T,{style:{fontFamily:'ManropeBold',fontSize:20,color:m.C.green},children:Number(e||0).toLocaleString()}),(0,w.jsx)(m.T,{style:{fontSize:8,color:m.C.muted,textAlign:'center'},children:t})]},s))})]}):(0,w.jsx)(w.Fragment,{children:(0,w.jsxs)(l.default,{style:{flexDirection:A?'row':'column',gap:18},children:[(0,w.jsxs)(l.default,{style:{flex:1,backgroundColor:m.C.tealBg,borderWidth:1,borderColor:m.C.greenLine,borderRadius:13,padding:18,gap:12},children:[(0,w.jsxs)(l.default,{style:[m.s.row,{alignItems:'flex-start',gap:12}],children:[(0,w.jsx)(C.AgentMark,{size:28}),(0,w.jsxs)(l.default,{style:{flex:1,gap:6},children:[(0,w.jsx)(m.T,{style:{fontSize:A?17:15,lineHeight:24,fontFamily:'InterMedium'},children:se.review?`${se.review} setups are worth a closer look.`:'Nothing clears your current review screen.'}),(0,w.jsxs)(m.T,{style:{fontSize:12,color:m.C.muted,lineHeight:20},children:["I\u2019ve separated positive past averages from uncertain or weak histories. ",e?.source_stale?'Fresh candles are needed before any trade can move forward.':'Open a setup to inspect its structure and next conditions.']})]})]}),(0,w.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"How the agent decided",onPress:()=>q(!V),style:{minHeight:35,justifyContent:'center',paddingLeft:40},children:(0,w.jsxs)(m.T,{style:{fontSize:11,color:m.C.green},children:[V?'Hide decision rules':'See how I made the cut'," ",V?'\u2212':'+']})}),V&&(0,w.jsxs)(m.T,{style:{fontSize:12,color:m.C.muted,lineHeight:22},children:["For review: a directional pattern whose tested exit rule stayed positive after costs on later (out-of-sample) data, with at least ",c.minimum," later-test trades. History only: a positive hold-period average with at least ",c.minimum," historical trades, but no tested exit rule \u2014 context, not a rule to trade. Watch: unresolved direction or insufficient evidence. Pass: a non-positive average after assumed costs, or a 95% range entirely below zero. These are transparent screening rules, not a probability forecast."]})]}),(0,w.jsx)(l.default,{style:{flexDirection:'row',alignItems:'center',borderWidth:1,borderColor:m.C.line,borderRadius:13,padding:18,gap:20,justifyContent:'space-around',minWidth:A?330:void 0},children:[[e?.universe,'stocks covered'],[s.length,'patterns stored'],[te.length,`${c.minimum}+ trade history`]].map(([e,t],s)=>(0,w.jsxs)(l.default,{style:{alignItems:'center',gap:6,flex:1},children:[(0,w.jsx)(m.T,{style:{fontFamily:'ManropeBold',fontSize:23,color:1===s?m.C.green:m.C.ink}
986,children:Number(e||0).toLocaleString()}),(0,w.jsx)(m.T,{style:{fontSize:9,color:m.C.muted,textAlign:'center'},children:t})]},s))})]})}),(!F||J)&&(0,w.jsxs)(l.default,{style:{gap:10},children:[(0,w.jsxs)(l.default,{style:[m.s.row,{borderWidth:1,borderColor:m.C.line,backgroundColor:m.C.paper,borderRadius:12,paddingLeft:14,paddingRight:5}],children:[(0,w.jsx)(C.AgentMark,{size:23}),(0,w.jsx)(o.default,{accessibilityLabel:"Tell your agent what to find",value:N,onChangeText:Y,onSubmitEditing:()=>ne(N),placeholder:"Try \u201cbullish 4H\u201d, a stock or a pattern\u2026",placeholderTextColor:m.C.muted,returnKeyType:"search",style:{flex:1,fontFamily:'Inter',fontSize:12,color:m.C.ink,minHeight:50}}),(0,w.jsx)(m.Button,{label:"Find",icon:"arrow-right",kind:"ghost",onPress:()=>ne(N)})]}),(0,w.jsxs)(i.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:7},children:[['Bullish 4H','2\u20135% past return','Cup & Handle'].map(e=>(0,w.jsx)(m.Chip,{label:e,onPress:()=>ne(e)},e)),(0,w.jsx)(m.Chip,{label:"Reset focus",icon:"rotate-ccw",onPress:()=>{h(H),j(''),K(''),E('all')}})]}),!!U&&(0,w.jsx)(m.T,{style:{fontSize:11,color:m.C.green},children:U})]}),(0,w.jsxs)(l.default,{style:{flexDirection:A?'row':'column',gap:24,alignItems:'flex-start'},children:[(0,w.jsxs)(l.default,{style:{width:A?440:'100%',gap:14},children:[(0,w.jsxs)(l.default,{style:m.s.between,children:[(0,w.jsx)(m.T,{style:{fontFamily:'InterSemi',fontSize:15},children:F?'Setups':'Your decision feed'}),(0,w.jsxs)(l.default,{style:m.s.row,children:[F&&(0,w.jsx)(m.Button,{label:"Ask / search",icon:"search",kind:"ghost",onPress:()=>X(!J)}),(0,w.jsx)(m.Button,{label:"Filters",icon:"sliders",kind:"outline",onPress:()=>S(!0),style:{minHeight:39,paddingVertical:8}})]})]}),(0,w.jsx)(i.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:6},children:[['all',`All ${te.length}`],['review',`For review ${se.review}`],['history',`History only ${se.history}`],['watch',`Watch ${se.watch}`],['pass',`Pass ${se.pass}`]].map(([e,t])=>(0,w.jsx)(m.Chip,{label:t,active:W===e,onPress:()=>E(e)},e))}),(0,w.jsx)(l.default,{style:m.s.between,children:(0,w.jsx)(i.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:15},children:['All',...x.TIMEFRAMES].map(e=>(0,w.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:'All'===e?'All timeframes':e,accessibilityState:{selected:c.timeframe===e},"aria-selected":c.timeframe===e,onPress:()=>h({...c,timeframe:e}),style:{minHeight:44,paddingHorizontal:9,justifyContent:'center',borderBottomWidth:2,borderBottomColor:c.timeframe===e?m.C.green:'transparent'},children:(0,w.jsx)(m.T,{style:{fontSize:11,color:c.timeframe===e?m.C.green:m.C.muted},children:'All'===e?'All timeframes':e})},e))})}),!!u&&(0,w.jsxs)(l.default,{style:m.s.between,children:[(0,w.jsxs)(m.T,{style:{fontSize:12,color:m.C.muted,flex:1},children:["Search: ",u]}),(0,w.jsx)(m.Button,{label:"Clear search",kind:"ghost",onPress:()=>j('')})]}),!!G.length&&(0,w.jsxs)(l.default,{style:{gap:7},children:[(0,w.jsx)(m.T,{style:m.s.label,children:"Stock overview"}),G.map(e=>(0,w.jsx)(m.Button,{label:`Open ${e.symbol} stock overview`,kind:"outline",onPress:()=>I(e)},e.symbol))]}),le.length?(0,w.jsx)(l.default,{style:{borderWidth:1,borderColor:m.C.line,borderRadius:13,overflow:'hidden'},children:le.slice(0,D).map(e=>(0,w.jsx)(k,{match:e,selected:A&&e.id===re?.id,onPress:()=>{A?(_(e.id),ee(e=>e+1)):v(e)}},e.id))}):(0,w.jsx)(m.Empty,{title:"No setups in this view",detail:"Change your focus or let the agent show all available histories.",action:(0,w.jsx)(m.Button,{label:"Show all decisions",kind:"outline",onPress:()=>E('all')})}),le.length>D&&(0,w.jsx)(m.Button,{label:`Show more \xb7 ${le.length-D} remaining`,kind:"outline",onPress:()=>O(D+12)}),(0,w.jsx)(m.T,{style:{fontSize:10,color:m.C.muted},children:"Ordered by pattern fit within each decision. Sparklines show stored closes, not future paths."})]}),A&&(0,w.jsx)(l.default,{style:{flex:1,minWidth:0,borderWidth:1,borderColor:m.C.line,borderRadius:14,padding:25,backgroundColor:m.C.bg},children:re?(0,w.jsx)(b.AgentCase,{match:re},re.id+':'+Z):(0,w.jsx)(m.Empty,{title:"Your next setup will appear here",detail:"Select a stock from the agent\u2019s feed to open its chart and reasoning."})})]})]})},_e.WatchDesk=function(){const{product:e,setDetail:s,state:n}=(0,f.useProduct)(),i=e.watchlist||[],[o,d]=(0,t.useState)('all'),h=(0,j.useWatchRemoval)(),u=i.filter(e=>'all'===o||e.direction===o);return(0,w.jsxs)(z,{children:[(0,w.jsxs)(l.default,{style:m.s.between,children:[(0,w.jsxs)(l.default,{style:{gap:8},children:[(0,w.jsx)(m.T,{style:{fontFamily:'ManropeBold',fontSize:30,lineHeight:38}
986,children:"My watch"}),(0,w.jsx)(m.T,{style:{fontSize:12,color:m.C.muted},children:"One place for the setups you want followed through."})]}),(0,w.jsx)(C.AgentMark,{size:38})]}),(0,w.jsxs)(l.default,{style:[m.s.card,{backgroundColor:m.C.tealBg,borderColor:m.C.greenLine}],children:[(0,w.jsx)(m.T,{style:{fontFamily:'InterMedium'},children:"I\u2019ll keep the conditions in view."}),(0,w.jsxs)(m.T,{style:{fontSize:12,color:m.C.muted},children:["Saved setups are compared with each refreshed scan while KANIDA is open. ",n?.source_stale?'Fresh candles are still needed for a new market decision.':'Open a setup to review the latest completed candle.']})]}),(0,w.jsx)(l.default,{style:m.s.row,children:[['all','All'],['bullish','Bullish patterns'],['bearish','Bearish patterns']].map(([e,t])=>(0,w.jsx)(m.Chip,{label:t,active:o===e,onPress:()=>d(e)},e))}),u.length?u.map(e=>(0,w.jsx)(j.WatchRow,{item:e,variant:"card",onReview:e=>s(e),onRemove:()=>h.setRemoving(e)},e.id)):(0,w.jsx)(m.Empty,{icon:"eye",title:"Give your agent something to watch",detail:"Open a setup and choose Add to watch. Its pattern, timeframe and next conditions stay together here.",action:(0,w.jsx)(m.Button,{label:"Discover setups",icon:"arrow-right",onPress:()=>c.router.push('/chart')})}),(0,w.jsx)(m.T,{style:{fontSize:11,color:m.C.muted},children:"Basket returns, win rate and drawdown need a shared-capital simulation. Stock-level histories remain separate."}),h.sheet]})};var t=r(_d[0]),s=e(t),l=e(r(_d[1])),n=e(r(_d[2])),i=e(r(_d[3])),o=e(r(_d[4])),d=e(r(_d[5])),c=r(_d[6]),h=r(_d[7]),u=e(h),f=r(_d[8]),m=r(_d[9]),p=r(_d[10]),y=r(_d[11]),x=r(_d[12]),b=r(_d[13]),j=r(_d[14]),C=r(_d[15]),w=r(_d[16]);const S=new Map;function v({match:e}){const s=e.id+':'+e.candle_end,[n,i]=(0,t.useState)(S.get(s)||[]);if((0,t.useEffect)(()=>{let t=!0;if(!S.has(s))return(0,p.api)(`/api/chart?symbol=${encodeURIComponent(e.symbol)}&timeframe=${e.timeframe}`).then(e=>{const l=e.bars.slice(-28).map(e=>e.close);S.set(s,l),t&&i(l)}).catch(()=>{}),()=>{t=!1};i(S.get(s))},[s]),n.length<2)return(0,w.jsx)(l.default,{style:{width:64,height:24}});const o=Math.min(...n),d=Math.max(...n)-o||1,c=n.map((e,t)=>`${t?'L':'M'}${t/(n.length-1)*62+1},${23-(e-o)/d*21}`).join(' ');return(0,w.jsx)(u.default,{width:64,height:26,viewBox:"0 0 64 26",accessibilityLabel:"Last 28 stored closes",children:(0,w.jsx)(h.Path,{d:c,fill:"none",stroke:n[n.length-1]>=n[0]?m.C.green:m.C.red,strokeWidth:1.3})})}function k({match:e,selected:t,onPress:s}){const{filters:i}=(0,f.useProduct)(),o=(0,y.decision)(e,i);return(0,w.jsxs)(n.default,{accessibilityRole:"button",accessibilityLabel:`Inspect ${e.symbol} ${e.timeframe} ${e.pattern_name}`,onPress:s,style:({pressed:e})=>[{flexDirection:'row',gap:11,padding:14,paddingVertical:16,borderBottomWidth:1,borderColor:m.C.line,backgroundColor:t?m.C.tealBg:e?m.C.paper:'transparent',borderLeftWidth:2,borderLeftColor:t?m.C.green:'transparent'}],children:[(0,w.jsx)(l.default,{style:{width:36,height:36,borderRadius:18,borderWidth:1,borderColor:m.C.muted,backgroundColor:m.C.ink,alignItems:'center',justifyContent:'center'},children:(0,w.jsx)(m.T,{style:{fontFamily:'ManropeBold',fontSize:11,color:m.C.bg},children:e.symbol.slice(0,2)})}),(0,w.jsxs)(l.default,{style:{flex:1,gap:4},children:[(0,w.jsxs)(l.default,{style:m.s.between,children:[(0,w.jsx)(m.T,{style:{fontFamily:'InterSemi',fontSize:13},children:e.symbol}),(0,w.jsx)(m.Badge,{label:o.title.toUpperCase(),tone:'review'===o.verdict?'green':'watch'===o.verdict?'amber':'neutral'}),!!o.ruleNote&&(0,w.jsx)(m.Badge,{label:o.ruleNote,tone:"neutral"})]}),(0,w.jsxs)(m.T,{style:{fontSize:11,color:m.C.muted},children:[e.pattern_name," \xb7 ",e.timeframe]}),(0,w.jsxs)(l.default,{style:m.s.between,children:[(0,w.jsxs)(l.default,{style:{gap:2},children:[(0,w.jsxs)(m.T,{style:{fontSize:12,color:(o.headline.value||0)>0?m.C.green:m.C.red},children:[(0,p.pct)(o.headline.value),(0,w.jsxs)(m.T,{style:{fontSize:10,color:m.C.muted},children:[" ",o.headline.label]})]}),(0,w.jsxs)(m.T,{style:{fontSize:10,color:m.C.muted},children:[o.headline.n," trades",'Small sample'===o.headline.sample.label?(0,w.jsx)(m.T,{style:{fontSize:10,
986color:m.C.amber},children:" \xb7 Small sample"}):null," \xb7 ",o.stats?.holding?.duration||'No holding study']})]}),(0,w.jsx)(v,{match:e})]})]})]})}const T=s.default.createContext(!1);function z({children:e}){const t='phone'===(0,m.useLayoutMode)(),n=s.default.useContext(T);return(0,w.jsx)(l.default,{style:{width:'100%',maxWidth:1440,alignSelf:'center',paddingHorizontal:t||n?16:30,paddingVertical:t||n?16:30,gap:t?16:22,paddingBottom:35},children:e})}},893,[11,13,375,278,385,400,252,840,196,821,197,248,249,890,888,839,6]); 987__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.FormPage=y,_e.Field=f,_e.Consent=v,_e.SignIn=function({signup:e=!1}){const s=(0,l.useAuth)(),u=(0,o.useLocalSearchParams)(),[h,b]=(0,t.useState)(''),[j,S]=(0,t.useState)(''),[T,w]=(0,t.useState)(''),[C,k]=(0,t.useState)(String(u.invite||'')),[P,z]=(0,t.useState)(!1),[A,I]=(0,t.useState)(!1),[B,R]=(0,t.useState)(u.error?'Sign-in was not completed. Please try again.':''),_=!1!==s.config?.invitation_required;async function q(){I(!0),R('');try{const l={email:h,password:T,name:j,invite:C,policy_version:P?s.config?.policy_version:void 0};e?await s.signUp(l):await s.signIn(l),o.router.replace((t=u.returnTo,n=e?'/onboarding':'/','string'!=typeof t||!t.startsWith('/')||t.startsWith('//')||t.includes('\\')?n:t))}catch(e){R(e.message)}finally{I(!1)}var t,n}return(0,p.jsxs)(y,{title:e?'Your agent starts here.':'Welcome back.',detail:e?`Create your ${_?'invited ':''}KANIDA account. Your research, watchlist and plans stay together.`:'Sign in to continue your research and plans.',children:[!!B&&(0,p.jsx)(c.T,{accessibilityRole:"alert",style:{color:c.C.red,fontSize:14},children:B}),e&&(0,p.jsx)(f,{label:"Your name",value:j,onChangeText:S,autoCapitalize:"words",autoComplete:"name"}),(0,p.jsx)(f,{label:"Email",value:h,onChangeText:b,keyboardType:"email-address",autoComplete:"email",textContentType:"emailAddress"}),(0,p.jsx)(f,{label:e?'Password \xb7 at least 12 characters':'Password',value:T,onChangeText:w,secure:!0,autoComplete:e?'new-password':'current-password',textContentType:e?'newPassword':'password',onSubmitEditing:q}),e&&(0,p.jsxs)(p.Fragment,{children:[(_||!!C)&&(0,p.jsx)(f,{label:"Private invitation code",value:C,onChangeText:k}),(0,p.jsx)(v,{value:P,onChange:z,children:"I agree to the private pilot terms and understand that research and synthetic simulations do not promise returns."}),(0,p.jsxs)(n.default,{style:c.s.row,children:[(0,p.jsx)(c.Button,{label:"Read pilot terms",kind:"ghost",onPress:()=>o.router.push('/terms')}),(0,p.jsx)(c.Button,{label:"Privacy",kind:"ghost",onPress:()=>o.router.push('/privacy')})]})]}),(0,p.jsx)(c.Button,{label:e?'Create my account':'Sign in',loading:A,disabled:!h||!T||e&&(!j||_&&!C||!P||!s.config),onPress:q,style:{minHeight:54}}),(0,p.jsx)(c.Button,{label:"Continue with Google",kind:"outline",disabled:!s.config?.google||A,onPress:()=>s.google(C)}),!s.config?.google&&(0,p.jsx)(c.T,{style:{fontSize:13,color:c.C.muted},children:"Google sign-in will be available after the owner completes its setup."}),s.device&&(0,p.jsx)(c.Button,{label:"I\u2019ve approved this device",kind:"soft",loading:A,onPress:async function(){I(!0),R('');try{await s.finishDevice(),o.router.replace('/')}catch(e){R(e.message)}finally{I(!1)}}}),(0,p.jsx)(c.Button,{label:e?'Already have an account? Sign in':_?'Have an invitation? Create an account':'New to KANIDA? Create an account',kind:"ghost",onPress:()=>o.router.replace({pathname:e?'/signin':'/signup',params:{...u.returnTo?{returnTo:String(u.returnTo)}:{}}})}),!e&&(0,p.jsx)(c.T,{style:{fontSize:13,color:c.C.muted},children:"Forgot your password? Ask the pilot owner for an account recovery link. Broker passwords never belong here."}),_&&(0,p.jsx)(x,{})]})},_e.Onboarding=function(){const e=(0,l.useAuth)(),[s,x]=(0,t.useState)(e.user?.name||''),[b,j]=(0,t.useState)([...h.TIMEFRAMES]),[S,T]=(0,t.useState)(!1),[w,C]=(0,t.useState)(!1),[k,P]=(0,t.useState)('');return(0,p.jsxs)(y,{title:"Make it your workspace.",detail:"Choose your chart horizons. Discover starts with these timeframes, and you can explore research before connecting a broker.",children:[(0,p.jsx)(f,{label:"What should we call you?",value:s,onChangeText:x}),(0,p.jsx)(c.T,{style:{fontSize:14,color:c.C.muted},children:"Timeframes to follow"}),(0,p.jsx)(n.default,{style:[c.s.row,{flexWrap:'wrap'}],children:h.TIMEFRAMES.map(e=>(0,p.jsx)(c.Button,{label:e,kind:b.includes(e)?'soft':'outline',onPress:()=>j(b.includes(e)?b.filter(t=>t!==e):[...b,e])},e))}),(0,p.jsxs)(n.default,{style:c.s.card,children:[(0,p.jsx)(c.T,{style:{fontFamily:'InterSemi',fontSize:16},children:"You stay in control."}),(0,p.jsx)(c.T,{style:{fontSize:14,lineHeight:24,color:c.C.muted},children:"Your account begins with research and a \u20b91,00,000 virtual account. Simulations use artificial price scenarios. Connecting Kite does not enable live orders."})]}),(0,p.jsx)(v,{value:S,onChange:T,children:"I understand the private pilot limits and accept the current pilot terms."}),(0,p.jsx)(c.Button,{label:"Read pilot terms",kind:"ghost",onPress:()=>o.router.push('/terms')}),!!k&&(0,p.jsx)(c.T,{style:{color:c.C.red}
987,children:k}),(0,p.jsx)(c.Button,{label:"Open my workspace",loading:w,disabled:!S||!s||!b.length,onPress:async function(){C(!0);try{await(0,u.api)('/api/account/onboarding',{name:s,timeframes:b,acknowledge_pilot:S,policy_version:e.config?.policy_version}),await e.refresh(),o.router.replace('/account?welcome=1')}catch(e){P(e.message)}finally{C(!1)}}})]})},_e.DeviceConnect=function(){const e=(0,l.useAuth)(),n=(0,o.useLocalSearchParams)(),[s,h]=(0,t.useState)(!1),[f,v]=(0,t.useState)(''),[x,b]=(0,t.useState)(!1),j=String(n.code||'');return(0,p.jsxs)(y,{title:s?'Your app is ready to connect.':'Connect your KANIDA app.',detail:s?'Return to the app and tap \u201cI\u2019ve approved this device\u201d.':'Only approve this if you just started sign-in from your own KANIDA mobile app.',children:[!!f&&(0,p.jsx)(c.T,{style:{color:c.C.red},children:f}),!s&&(e.user?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(c.T,{children:["Connect as ",e.user.email]}),(0,p.jsx)(c.Button,{label:"Connect my mobile app",loading:x,disabled:!j,onPress:async function(){b(!0);try{await(0,u.api)('/api/auth/device/approve',{code:j,confirm_device:!0}),h(!0)}catch(e){v(e.message)}finally{b(!1)}}})]}):(0,p.jsx)(c.Button,{label:"Sign in to connect",onPress:()=>o.router.push({pathname:'/signin',params:{returnTo:'/device?code='+j}})})),(0,p.jsx)(c.T,{style:{fontSize:13,color:c.C.muted},children:"The request expires after 10 minutes. Your app proves it initiated the request before receiving a session."})]})},_e.PilotLegal=function({privacy:e=!1}){return(0,p.jsxs)(y,{title:e?'Your privacy in the pilot.':'Private pilot terms.',detail:"Version private-pilot-v1 \xb7 pilot testing",children:[(e?[['What is stored','Your account identity, encrypted broker authorization, subscription references, saved setups, plans and activity records. Passwords are stored as one-way hashes.'],['Who processes information','Google verifies your identity if you choose Google sign-in. Razorpay handles test checkout. Kite handles broker authorization and any separately activated brokerage functions. KANIDA never asks for your broker password or TOTP seed.'],['Your controls','Disconnect Kite, sign out of all devices or request account closure through the pilot owner. Financial and audit records may need retention before deletion. This local pilot has no advertising trackers.']]:[['Research is evidence, not a promise','Historical averages describe the supplied research dataset. Small samples, assumed costs, unadjusted prices and instrument-policy limitations can affect results. A pattern score is not a win probability.'],['Simulation is artificial','The virtual account uses named synthetic scenarios to test order handling. Its profit, loss and success rates are not investment results or forecasts. No broker prices feed the simulator.'],['Broker authorization is separate','Connecting Kite permits the configured account connection. Live order submission is disabled in this pilot release and requires a separately reviewed activation. Do not rely on this pilot to manage existing broker positions.'],['Payments and access','Razorpay is restricted to test mode. Registration follows the current access setting; the owner has included pilot access. The test checkout does not purchase a public production subscription.'],['Pilot use','Use your own account. Keep invitations private, review each action, and report unexpected behavior to the owner. Public availability and store release require further review.']]).map(([e,t])=>(0,p.jsxs)(n.default,{style:{gap:8},children:[(0,p.jsx)(c.T,{style:{fontFamily:'InterSemi',fontSize:17},children:e}),(0,p.jsx)(c.T,{style:{fontSize:15,lineHeight:25,color:c.C.muted},children:t})]},e)),(0,p.jsx)(c.Button,{label:"Go back",kind:"outline",onPress:()=>o.router.canGoBack()?o.router.back():o.router.replace('/welcome')})]})};var t=r(d[0]),n=e(r(d[1])),s=e(r(d[2]));r(d[3]);var o=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]),h=r(d[8]),p=r(d[9]);function y({title:e,detail:t,children:s}){const o=(0,l.useAuth)();return(0,p.jsxs)(n.default,{style:{width:'100%',maxWidth:560,alignSelf:'center',padding:24,paddingTop:40,paddingBottom:50,gap:22},children:[(0,p.jsxs)(n.default,{style:{gap:10},children:[(0,p.jsx)(c.Badge,{label:!1===o.config?.invitation_required?"PILOT":"PRIVATE PILOT"}),(0,p.jsx)(c.T,{accessibilityRole:"header",style:{fontFamily:'ManropeBold',fontSize:32,lineHeight:40,letterSpacing:-.8},children:e}),t&&(0,p.jsx)(c.T,{style:{fontSize:16,lineHeight:26,color:c.C.muted},children:t})]}),s]})}function f({label:e,value:t,onChangeText:o,secure:l=!1,...u}){return(0,p.jsxs)(n.default,{style:{gap:8},children:[(0,p.jsx)(c.T,{style:{fontSize:14,color:c.C.muted},children:e}),(0,p.jsx)(s.default,{accessibilityLabel:e,value:t,onChangeText:o,secureTextEntry:l,autoCapitalize:"none",autoCorrect:!1,style:[c.s.input,{minHeight:52,fontSize:16}],...u})]})}
987function v({value:e,onChange:t,children:n,label:s}){return(0,p.jsx)(c.Checkbox,{checked:!!e,onChange:t,label:s||('string'==typeof n?n:'I agree'),style:{minHeight:48,paddingVertical:10},children:(0,p.jsx)(c.T,{style:{flex:1,fontSize:14,lineHeight:23},children:n})})}function x(){const[e,s]=(0,t.useState)(!1),[o,l]=(0,t.useState)(''),[h,y]=(0,t.useState)(''),[v,x]=(0,t.useState)(''),[b,j]=(0,t.useState)(!1),[S,T]=(0,t.useState)(!1),[w,C]=(0,t.useState)('');return S?(0,p.jsx)(c.T,{accessibilityRole:"alert",style:{fontSize:14,color:c.C.green},children:"Thanks - your request is in. You'll receive an invitation link if it's approved."}):e?(0,p.jsxs)(n.default,{style:{gap:10,borderTopWidth:1,borderColor:c.C.line,paddingTop:12},children:[(0,p.jsx)(c.T,{style:{fontFamily:'InterSemi',fontSize:15},children:"Request access"}),(0,p.jsx)(f,{label:"Your name",value:h,onChangeText:y,autoCapitalize:"words"}),(0,p.jsx)(f,{label:"Email",value:o,onChangeText:l,keyboardType:"email-address",autoComplete:"email"}),(0,p.jsx)(f,{label:"How do you trade options? (optional)",value:v,onChangeText:x}),!!w&&(0,p.jsx)(c.T,{accessibilityRole:"alert",style:{color:c.C.red,fontSize:13},children:w}),(0,p.jsx)(c.Button,{label:"Send request",loading:b,disabled:!o,onPress:async()=>{j(!0),C('');try{await(0,u.api)('/api/access/request',{email:o,name:h,note:v}),T(!0)}catch(e){C(e.message)}finally{j(!1)}}})]}):(0,p.jsx)(c.Button,{label:"No invitation? Request access",kind:"ghost",onPress:()=>s(!0)})}},894,[11,13,385,136,252,198,821,197,249,6]); 988__d(function(g,_r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.SymbolSearch=function({compact:e=!1,onPicked:C}){const x=(0,i.useProduct)(),{active:T,setActive:j}=(0,h.useActiveSymbol)(),k=(0,r.usePathname)(),[v,z]=(0,t.useState)(!1),[A,$]=(0,t.useState)(''),[E,H]=(0,t.useState)([]),[R,w]=(0,t.useState)(!1),[P,D]=(0,t.useState)(''),L=(0,m.pageNotDeployed)(x.research),[M,F]=(0,t.useState)(null),_=(0,t.useRef)(null),I=(0,m.useRoving)(E.length,'vertical');(0,t.useEffect)(()=>{const e=A.trim();if(H([]),D(''),w(!1),!v||e.length<2||L)return;let t=!0;w(!0);const o=setTimeout(()=>(0,c.api)('/api/stocks?q='+encodeURIComponent(e)).then(e=>{t&&(F((0,m.isNotDeployed)(e)?(0,m.notDeployedMessage)(e):null),H((0,m.asList)(e).slice(0,8)),w(!1))}).catch(e=>{if(t){const t=(0,m.refusedNotDeployed)(e);t?F(t):D(e?.message||'Search is unavailable'),w(!1)}}),240);return()=>{t=!1,clearTimeout(o)}},[A,v,L]);const N=(0,t.useCallback)(()=>z(!1),[]),O=x.matches||[],W=e=>{const t=String(e||'').toUpperCase(),o=O.filter(e=>e.symbol===t);return[...u.TIMEFRAMES.filter(e=>o.some(t=>t.timeframe===e)),...Array.from(new Set(o.map(e=>e.timeframe))).filter(e=>!u.TIMEFRAMES.includes(e))]};function K(e){if(!e)return;const t=String(e.symbol||'').toUpperCase(),o=T?.timeframe||W(t)[0]||h.DEFAULT_TIMEFRAME;j({symbol:t,timeframe:o,source:'search'})?(z(!1),$(''),C?.(),(0,y.isWorkspacePath)(k)||r.router.push(y.CHART_PATH)):x.setToast(`${t} can\u2019t be opened on the chart.`)}const U=A.trim().length<2?'Type at least 2 characters of a symbol or company.':!L&&!M||E.length?R?'Searching\u2026':P?`Search failed: ${P}`:E.length?`${E.length} ${1===E.length?'stock':'stocks'} \xb7 Enter opens the first \xb7 \u2193 moves into the list`:'No stocks found.':`Stock search is not available here. ${L||M}`;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(s.default,{ref:_,accessibilityRole:"button",accessibilityLabel:T?`Search stocks. Active stock ${T.symbol}, ${T.timeframe}`:'Search stocks',...(0,p.webOnly)({'aria-haspopup':'dialog','aria-expanded':v}),onPress:()=>z(!0),hitSlop:S,style:t=>[l.s.row,{flex:1,minWidth:40,maxWidth:e?void 0:440,minHeight:38,gap:8,paddingHorizontal:12,borderRadius:10,borderWidth:1,borderColor:v||t.focused?l.C.green:l.C.line,backgroundColor:t.hovered?l.C.soft:l.C.paper}],children:[(0,b.jsx)(f.HitArea,{slop:S}),(0,b.jsx)(l.Icon,{name:"search",size:15,color:l.C.muted}),(0,b.jsx)(l.T,{numberOfLines:1,style:{flex:1,fontSize:13,color:T?l.C.ink:l.C.muted},children:T?(0,b.jsxs)(b.Fragment,{children:[T.symbol,(0,b.jsxs)(l.T,{style:{fontSize:12,color:l.C.muted},children:[" \xb7 ",T.timeframe," \xb7 Search stocks"]})]}):'Search stocks'})]}),(0,b.jsxs)(m.Popover,{open:v,onClose:N,anchor:_,placement:"bottom-start",label:"Search stocks",width:e?340:420,routeKey:k,children:[(0,b.jsxs)(o.default,{style:{paddingHorizontal:10,paddingTop:4,paddingBottom:6,gap:6},children:[(0,b.jsx)(n.default,{autoFocus:!0,accessibilityLabel:"Stock symbol or company",value:A,onChangeText:$,onSubmitEditing:()=>K(E[0]),onKeyPress:e=>
988{'ArrowDown'===e?.nativeEvent?.key&&E.length&&(e.preventDefault?.(),I.refs.current[0]?.focus?.())},placeholder:"Symbol or company",placeholderTextColor:l.C.muted,autoCapitalize:"characters",autoCorrect:!1,returnKeyType:"search",style:[l.s.input,{minHeight:42,fontSize:14}]}),(0,b.jsx)(l.T,{accessibilityLiveRegion:"polite",style:{fontSize:11,lineHeight:16,color:P?l.C.amber:l.C.muted},children:U})]}),E.length>0&&(0,b.jsx)(o.default,{accessibilityLabel:"Stock results",style:{borderTopWidth:1,borderColor:l.C.line},children:E.map((e,t)=>{const n=W(e.symbol);return(0,b.jsxs)(s.default,{ref:e=>{I.refs.current[t]=e},accessibilityRole:"button",accessibilityLabel:`Open ${e.symbol}${e.company?`, ${e.company}`:''} on the chart. ${n.length?`Stored setups on ${n.join(', ')}`:'No stored setup'}`,...(0,p.webOnly)({onKeyDown:e=>I.onKeyDown(t,e)}),onPress:()=>K(e),style:e=>[l.s.between,{minHeight:44,paddingHorizontal:14,paddingVertical:6,gap:8,backgroundColor:e.hovered||e.focused||e.pressed?l.C.soft:'transparent'}],children:[(0,b.jsxs)(o.default,{style:{flex:1,minWidth:0},children:[(0,b.jsx)(l.T,{style:{fontFamily:'InterSemi',fontSize:13},children:e.symbol}),!!e.company&&(0,b.jsx)(l.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16,color:l.C.muted},children:e.company})]}),(0,b.jsx)(l.T,{style:{fontSize:11,color:n.length?l.C.green:l.C.muted},children:n.length?n.join(' \xb7 '):'No stored setup'})]},e.symbol+t)})})]})]})};var t=_r(d[0]),o=e(_r(d[1])),s=e(_r(d[2])),n=e(_r(d[3])),r=_r(d[4]),i=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),m=_r(d[10]),p=_r(d[11]),y=_r(d[12]),f=_r(d[13]),b=_r(d[14]);const S=(0,f.touchSlop)(38,40)},895,[11,13,375,385,252,196,821,197,249,251,871,869,896,832,6]); 989__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CHART_PATH",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"WORKSPACE_PATHS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"ROUTE_TAB",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"TAB_ROUTE",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"isWorkspacePath",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"FULL_HEIGHT_PATHS",{enumerable:!0,get:function(){return s}}),e.WorkspaceRoute=function(){return null},Object.defineProperty(e,"NAV_MORE_BELOW",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"NAV_MORE_BELOW_WORKSPACE",{enumerable:!0,get:function(){return v}}),e.navSplit=function(t,n){return n?{primary:t.filter(t=>!t.more),more:t.filter(t=>t.more)}:{primary:t,more:[]}},Object.defineProperty(e,"NAV_ITEMS",{enumerable:!0,get:function(){return b}}),e.navActive=function(t){return'/'===t||'/discover'===t||'/derivative'===t||'/screener'===t||'/strategies'===t||'/watch'===t||'/autotrade'===t?t:'/simulate'===t||'/activity'===t?'/autotrade':null};const t='/chart',n=[t,'/simulate','/watch','/autotrade','/activity'],o={'/simulate':'simulate','/watch':'watch','/autotrade':'autotrade','/activity':'activity'},u={discover:t,evidence:t,simulate:'/simulate',autotrade:'/autotrade',activity:'/activity',watch:'/watch'},c=t=>n.includes(t),s=['/','/discover','/derivative','/derivative-studio'];const l=1024,v=1100;const b=[{route:'/',label:'Falcon',short:'Falcon',icon:'cpu'},{route:'/discover',label:'Market scans',short:'Scans',icon:'grid'},{route:'/derivative',label:'Derivative',short:'Derivative',icon:'layers'},{route:'/strategies',label:'Options desk',short:'Options desk',icon:'sliders'},{route:'/watch',label:'Watchlist',short:'Watchlist',icon:'eye'},{route:'/autotrade',label:'AutoTrade',short:'AutoTrade',icon:'zap',more:!0}]},896,[]); 990__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ShellMark=function({compact:e=!1,markOnly:t=!1}){const n=e?26:30,c=t?(0,y.touchSlop)(n+2,n+2):(0,y.touchSlop)(n+2);return(0,P.jsxs)(o.default,{accessibilityRole:"link",accessibilityLabel:"KANIDA home, Falcon",onPress:()=>s.router.push('/'),hitSlop:c,style:e=>
990[u.s.row,{gap:8,borderRadius:8,borderWidth:1,borderColor:e.focused?u.C.green:'transparent',paddingRight:t?0:4}],children:[(0,P.jsx)(y.HitArea,{slop:c}),(0,P.jsx)(f.CompassLogo,{size:n}),!t&&(0,P.jsxs)(u.T,{style:{fontFamily:'InterMedium',fontSize:e?16:18,letterSpacing:2},children:["KANIDA",!e&&(0,P.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:".AI"})]})]})},_e.AccountButton=function({connect:e=!1}){const n=(0,l.useAuth)(),o=(0,s.usePathname)(),[c,p]=(0,t.useState)(!1),f=(0,t.useRef)(null),y=(0,t.useCallback)(()=>p(!1),[]),x=[{label:'Account and billing',icon:'user',onPress:()=>s.router.push('/account')}];'owner'===n.user?.role&&x.push({label:'Manage strategies',icon:'sliders',onPress:()=>s.router.push('/admin/strategies')});e&&x.push({label:'Open on iPhone',icon:'smartphone',onPress:()=>s.router.push('/connect')});(0,h.uxPreview)(n.config)&&x.push({label:'day'===u.THEME?'Night theme':'Day theme',icon:'day'===u.THEME?'moon':'sun',onPress:()=>(0,u.setTheme)('day'===u.THEME?'night':'day')});const j='/account'===o||o.startsWith('/admin');return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(b.IconButton,{ref:f,icon:"user",label:"Account menu",tooltip:"Account",haspopup:"menu",expanded:c,pressed:j,onPress:()=>p(e=>!e),size:18}),(0,P.jsx)(b.Popover,{open:c,onClose:y,anchor:f,placement:"bottom-end",label:"Account menu",width:220,routeKey:o,role:"none",children:(0,P.jsx)(b.MenuList,{items:x,onClose:y,label:"Account menu"})})]})},_e.ConnectButton=function(){return(0,P.jsx)(b.IconButton,{icon:"smartphone",label:"Open on iPhone",tooltip:"Open on iPhone",onPress:()=>s.router.push('/connect'),size:17})},_e.WatchToggle=function({match:e}){const n=(0,c.useProduct)(),[o,s]=(0,t.useState)(!1),l=!!e&&!!n.product?.watchlist?.some(t=>t.id===e.id);const h=e?`${e.symbol} ${e.pattern_name} ${e.timeframe}`:'';return(0,P.jsx)(u.Button,{label:l?'Watching':'Watch',icon:"eye",kind:"outline",loading:o,disabled:!e,accessibilityLabel:e?l?`Watching ${h}. Remove from watch`:`Watch ${h}`:'Watch unavailable: no stored setup selected',accessibilityState:{selected:l,disabled:!e},onPress:async function(){if(e){s(!0);try{await(0,p.api)('/api/product/watch',{action:l?'remove':'add',match_id:e.id}),await n.refreshProduct()}catch(e){n.setToast(e.message)}finally{s(!1)}}},style:{minHeight:36,paddingVertical:6,paddingHorizontal:12}})},_e.ResearchBanner=function(){const{error:e,state:t,refresh:o,research:l}=(0,c.useProduct)(),h=(0,s.usePathname)()||'';if(!(0,b.showsOutage)(l?.status))return null;const p=(0,b.connectionView)(t,{error:t?'':e}),f=p?p.text:e?'Could not refresh just now \u2014 showing what loaded a moment ago.':'';if(!f||h.startsWith('/strategies')||h.startsWith('/derivative-studio'))return null;const y='very-stale'===p?.tone,x=p?p.a11y:f;return(0,P.jsxs)(n.default,{role:"status",accessibilityLiveRegion:"polite",accessibilityLabel:x,style:[u.s.between,{padding:12,backgroundColor:y?u.C.redBg:u.C.amberBg}],children:[(0,P.jsx)(u.T,{style:{fontSize:13,color:y?u.C.red:u.C.amber,flex:1},children:f}),(0,P.jsx)(u.Button,{label:"Retry",kind:"ghost",onPress:o})]})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2]));r(d[3]);var s=r(d[4]),c=r(d[5]),l=r(d[6]),u=r(d[7]),h=r(d[8]),p=r(d[9]),b=r(d[10]),f=r(d[11]),y=r(d[12]),P=r(d[13])},897,[11,13,375,136,252,196,198,821,881,197,871,898,832,6]); 991__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CompassLogo=function({size:e=24}){const h=(0,t.useRef)(new n.default.Value(0)).current,[y,j]=(0,t.useState)(!1);(0,t.useEffect)(()=>{let e=!0;return s.default.isReduceMotionEnabled?.().then(t=>{e&&j(!!t)}).catch(()=>{}),()=>{e=!1}},[]),(0,t.useEffect)(()=>{if(y)return;const e=n.default.loop(n.default.sequence([n.default.timing(h,{toValue:1,duration:4e3,easing:l.default.inOut(l.default.ease),useNativeDriver:!0}),n.default.timing(h,{toValue:0,duration:4e3,easing:l.default.inOut(l.default.ease),useNativeDriver:!0})]));return e.start(),()=>e.stop()},[y,h]);const p=h.interpolate({inputRange:[0,1],outputRange:['0deg','24deg']});return(0,x.jsxs)(o.default,{style:{width:e,height:e},accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:[(0,x.jsxs)(c.default,{viewBox:"0 0 32 32",width:e,height:e,style:{position:'absolute'},children:[(0,x.jsx)(u.Circle,{cx:"16",cy:"16",r:"14",fill:"none",stroke:f.C.green+"D9",strokeWidth:"1.5"}),(0,x.jsxs)(u.G,{stroke:f.C.green+"8C",strokeWidth:"1",children:[(0,x.jsx)(u.Line,{x1:"16",y1:"2",x2:"16",y2:"4.5"}),(0,x.jsx)(u.Line,{x1:"16",y1:"27.5",x2:"16",y2:"30"}),(0,x.jsx)(u.Line,{x1:"2",y1:"16",x2:"4.5",y2:"16"}),(0,x.jsx)(u.Line,{x1:"27.5",y1:"16",x2:"30",y2:"16"})]})]}),(0,x.jsx)(n.default.View,{style:{position:'absolute',width:e,height:e,transform:[{rotate:p}]},children:(0,x.jsxs)(c.default,{viewBox:"0 0 32 32",width:e,height:e,children:[(0,x.jsx)(u.Polygon,{points:"16,4 13.5,16 18.5,16",fill:f.C.green}),(0,x.jsx)(u.Polygon,{points:"16,28 13.5,16 18.5,16",fill:f.C.green+"59"}),(0,x.jsx)(u.Circle,{cx:"16",cy:"16",r:"1.5",fill:f.C.bg,stroke:f.C.green,strokeWidth:"0.8"})]})})]})};var t=r(d[0]),s=e(r(d[1])),n=e(r(d[2])),l=e(r(d[3])),o=e(r(d[4])),u=r(d[5]),c=e(u),f=r(d[6]),x=r(d[7])},898,[11,265,267,345,13,840,821,6]); 992__d(function(g,r,_i,a,m,_e,d){"use strict";
992function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"NAV_FULL_WIDTH",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"NAV_FULL_WIDTH_WORKSPACE",{enumerable:!0,get:function(){return j}}),_e.MainNav=function({variant:e="bar",fullFrom:t=x,moreBelow:n=p.NAV_MORE_BELOW}){const c=(0,l.usePathname)(),{width:b}=(0,i.default)(),C=(0,s.useSafeAreaInsets)(),j=(0,p.navActive)(c),v='tabs'===e,S=(0,h.useProduct)()?.research?.status??null,H=p.NAV_ITEMS.map(e=>'/derivative'===e.route?{...e,label:'Derivative studio',short:v?'Studio':'Derivative studio'}:e),z=b<t,{primary:I,more:O}=(0,p.navSplit)(H,v||b<n),T=I.map(e=>(0,y.jsx)(M,{item:e,on:j===e.route,tabs:v,compact:z,tag:(0,f.navTag)(e.route,S)},e.route));O.length&&T.push((0,y.jsx)(L,{items:O,current:j,tabs:v,compact:z,status:S},"more"));return v?(0,y.jsx)(o.default,{role:"navigation","aria-label":"Main navigation",style:{flexDirection:'row',gap:4,backgroundColor:u.C.bg,borderTopWidth:1,borderColor:u.C.line,paddingHorizontal:6,paddingTop:6,paddingBottom:Math.max(C.bottom,8)},children:T}):(0,y.jsx)(o.default,{role:"navigation","aria-label":"Main navigation",style:{flexDirection:'row',alignItems:'center',gap:2},children:T})};var t=e(r(d[0])),o=e(r(d[1])),n=e(r(d[2])),i=e(r(d[3])),l=r(d[4]),s=r(d[5]),u=r(d[6]),c=r(d[7]),b=r(d[8]),p=r(d[9]),h=r(d[10]),f=r(d[11]),C=r(d[12]),y=r(d[13]);const x=1600,j=1600,v=(0,C.touchSlop)(38),S=(0,C.touchSlop)(52);function H(e,t){try{t?l.router.replace(e):l.router.push(e)}catch{}}const z=e=>[{flex:1,minHeight:52,alignItems:'center',justifyContent:'center',gap:4,paddingHorizontal:0,borderRadius:10,borderWidth:2,borderColor:e.focused?u.C.green:'transparent',opacity:e.pressed?.65:1}],I=(e,t)=>o=>[{flexDirection:'row',alignItems:'center',gap:7,minHeight:38,paddingHorizontal:t?9:12,borderRadius:9,borderWidth:1,borderColor:o.focused?u.C.green:e?u.C.line:'transparent',backgroundColor:e?u.C.paper:o.hovered?u.C.soft:'transparent',opacity:o.pressed?.7:1}];function M({item:e,on:t,tabs:i,compact:l,tag:s}){const b=i||l?e.short:e.label,p=s?`${e.label}, ${s.a11y}`:e.label;return(0,y.jsxs)(n.default,{accessibilityRole:"link",accessibilityLabel:t?`${p}, current page`:p,accessibilityState:{selected:t},...(0,c.webOnly)({'aria-current':t?'page':void 0}),onPress:()=>H(e.route,t),hitSlop:i?S:v,style:i?z:I(t,l),children:[(0,y.jsx)(C.HitArea,{slop:i?S:v}),(i||!l)&&(0,y.jsx)(u.Icon,{name:e.icon,size:i?20:15,color:t?u.C.green:u.C.muted}),s&&!i?(0,y.jsxs)(o.default,{style:{flexDirection:'row',alignItems:'center',gap:5},children:[(0,y.jsx)(u.T,{numberOfLines:1,style:{fontSize:13,lineHeight:18,fontFamily:'InterSemi',color:t?u.C.green:u.C.ink},children:b}),(0,y.jsx)(u.T,{"aria-hidden":!0,numberOfLines:1,style:{fontSize:10,lineHeight:14,fontFamily:'InterMedium',color:u.C.muted,paddingHorizontal:5,borderRadius:5,borderWidth:1,borderColor:u.C.line},children:s.text})]}):(0,y.jsx)(u.T,{numberOfLines:1,style:{fontSize:i?11:13,lineHeight:i?15:18,fontFamily:'InterSemi',color:t?u.C.green:i?u.C.muted:u.C.ink},children:b}),s&&i&&(0,y.jsx)(u.T,{"aria-hidden":!0,numberOfLines:1,style:{position:'absolute',top:3,right:4,fontSize:9,lineHeight:12,fontFamily:'InterMedium',color:u.C.muted,paddingHorizontal:4,borderRadius:4,borderWidth:1,borderColor:u.C.line,backgroundColor:u.C.bg},children:s.text}),!i&&t&&(0,y.jsx)(o.default,{style:{position:'absolute',left:10,right:10,bottom:-7,height:2,borderRadius:1,backgroundColor:u.C.green}})]})}function L({items:e,current:i,tabs:s,compact:p,status:h}){const[x,j]=t.default.useState(!1),M=t.default.useRef(null),L=(0,l.usePathname)(),O=e.find(e=>e.route===i)||null,T=!!O,_=T?`More, current page: ${O.label}`:'More';return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(n.default,{ref:M,accessibilityRole:"button",accessibilityLabel:_,accessibilityState:{expanded:x,selected:T},...(0,c.webOnly)({'aria-haspopup':'menu','aria-expanded':x}),onPress:()=>j(e=>!e),hitSlop:s?S:v,style:s?z:I(T,p),children:[(0,y.jsx)(C.HitArea,{slop:s?S:v}),(0,y.jsx)(u.Icon,{name:s?'more-horizontal':'chevron-down',size:s?20:15,color:T?u.C.green:u.C.muted}),(0,y.jsx)(u.T,{numberOfLines:1,style:{fontSize:s?11:13,lineHeight:s?15:18,fontFamily:'InterSemi',color:T?u.C.green:s?u.C.muted:u.C.ink},children:T&&!s?O.short:'More'}),!s&&T&&(0,y.jsx)(o.default,{style:{position:'absolute',left:10,right:10,bottom:-7,height:2,borderRadius:1,backgroundColor:u.C.green}})]}),(0,y.jsx)(b.Popover,{open:x,onClose:()=>j(!1),anchor:M,placement:s?'top-end':'bottom-end',label:"More pages",width:220,routeKey:L,children:(0,y.jsx)(o.default,{role:"menu","aria-label":"More pages",children:e.map(e=>{const t=e.route===i,o=(0,f.navTag)(e.route,h);return(0,y.jsxs)(n.default,{role:"menuitem",accessibilityLabel:t?`${e.label}, current page`:o?`${e.label}, ${o.a11y}`:e.label,...(0,c.webOnly)({'aria-current':t?'page':void 0}),onPress:()=>{j(!1),H(e.route,t)},style:e=>[{flexDirection:'row',alignItems:'center',gap:10,minHeight:44,paddingHorizontal:14,backgroundColor:e.hovered||e.focused||e.pressed?u.C.soft:'transparent',borderLeftWidth:2,borderColor:t?u.C.green:'transparent'}],children:[(0,y.jsx)(u.Icon,{name:e.icon,size:16,color:t?u.C.green:u.C.muted}),(0,y.jsx)(u.T,{style:{fontSize:14,fontFamily:'InterSemi',color:t?u.C.green:u.C.ink},children:e.label}
992),o&&(0,y.jsx)(u.T,{"aria-hidden":!0,style:{fontSize:10,color:u.C.muted,paddingHorizontal:5,borderRadius:5,borderWidth:1,borderColor:u.C.line},children:o.text})]},e.route)})})})]})}},899,[11,13,375,400,252,105,821,869,875,896,196,820,832,6]); 993__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ERROR_HEADLINE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"ERROR_DETAIL",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"ScreenErrorBoundary",{enumerable:!0,get:function(){return u}});var t=e(r(d[0])),n=e(r(d[1]));r(d[2]);var o=r(d[3]),l=r(d[4]);const s='Something went wrong on this screen',c='Nothing you saved is affected. Try again, or reload the page.';class u extends t.default.Component{state={error:null,key:this.props.resetKey};static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return e.resetKey!==t.key?{error:null,key:e.resetKey}:null}componentDidCatch(e,t){console.error('Screen error',e,t?.componentStack)}retry=()=>this.setState({error:null});reload=()=>{'undefined'!=typeof window?window.location.reload():this.retry()};render(){return this.state.error?(0,l.jsx)(n.default,{role:"alert",accessibilityLabel:`${s}. ${c}`,style:{flex:1,alignItems:'center',justifyContent:'center',padding:24,backgroundColor:o.C.bg},children:(0,l.jsxs)(n.default,{style:{maxWidth:520,gap:12,padding:24,borderRadius:14,borderWidth:1,borderColor:o.C.line,backgroundColor:o.C.paper,alignItems:'flex-start'},children:[(0,l.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:10},children:[(0,l.jsx)(o.Icon,{name:"info",size:18,color:o.C.muted}),(0,l.jsx)(o.T,{role:"heading","aria-level":2,style:{fontFamily:'ManropeBold',fontSize:18,lineHeight:26,flexShrink:1},children:s})]}),(0,l.jsx)(o.T,{style:{fontSize:14,lineHeight:21,color:o.C.muted},children:c}),(0,l.jsxs)(n.default,{style:{flexDirection:'row',gap:8,flexWrap:'wrap'},children:[(0,l.jsx)(o.Button,{label:"Try again",kind:"outline",onPress:this.retry}),(0,l.jsx)(o.Button,{label:"Reload",kind:"ghost",icon:"refresh-cw",onPress:this.reload})]})]})}):this.props.children}}},900,[11,13,136,821,6]); 994__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.DisclaimerBar=function({compact:e=!1}){return(0,o.jsx)(l.default,{accessibilityRole:"text",accessibilityLabel:n.DISCLAIMER,testID:"disclaimer-bar",style:{borderTopWidth:1,borderColor:c.C.line,backgroundColor:c.C.bg,paddingHorizontal:e?12:20,paddingVertical:e?4:5,alignItems:'center'},children:(0,o.jsx)(c.T,{style:{fontSize:e?10:11,lineHeight:e?14:16,color:c.C.muted,textAlign:'center'},children:(0,n.disclaimerText)(e)})})},_e.DisclaimerNote=function({compact:e=!1,style:t}){return(0,o.jsxs)(l.default,{accessibilityRole:"text",accessibilityLabel:n.DISCLAIMER,testID:"disclaimer-note",style:[{flexDirection:'row',alignItems:'center',gap:6},t],children:[(0,o.jsx)(c.Icon,{name:"info",size:12,color:c.C.muted}),(0,o.jsx)(c.T,{style:{flexShrink:1,fontSize:e?11:12,lineHeight:e?16:18,color:c.C.muted},children:n.DISCLAIMER})]})},r(d[0]);var e,t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e}
994,c=r(d[2]),n=r(d[3]),o=r(d[4])},901,[11,13,821,902,6]); 995__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DISCLAIMER",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"DISCLAIMER_COMPACT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"disclaimerText",{enumerable:!0,get:function(){return o}});const t='Analysis only \u2014 not investment advice. KANIDA does not place trades for you.',n='Analysis only \xb7 Not investment advice \xb7 KANIDA places no trades for you',o=o=>o?n:t},902,[]); 996__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Account}});var t=r(d[0])},903,[892]); 997__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.WorkspaceRoute}});var t=r(d[0])},904,[896]); 998__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.AdminPanel}});var t=r(d[0])},905,[906]); 999__d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdminPanel=function(){const e=(0,c.useAuth)(),s=(0,r.default)().width<700,d=String((0,o.useLocalSearchParams)().kite||''),[p,m]=(0,t.useState)(d?'secrets':'access');return'owner'!==e.user?.role?(0,h.jsx)(i.default,{style:{padding:24},children:(0,h.jsx)(l.T,{style:{color:l.C.muted},children:"The admin panel is available to the owner only."})}):(0,h.jsxs)(n.default,{contentContainerStyle:{padding:s?14:24,gap:16,maxWidth:1100,width:'100%',alignSelf:'center'},children:[(0,h.jsxs)(i.default,{style:{gap:4},children:[(0,h.jsx)(l.T,{style:{fontFamily:'ManropeBold',fontSize:24},children:"Admin"}),(0,h.jsx)(l.T,{style:{fontSize:13,color:l.C.muted},children:"Who can get in, who is in, and whether the background jobs are healthy."})]}),(0,h.jsx)(i.default,{style:[l.s.row,{gap:8,flexWrap:'wrap'}],children:[['access','Access'],['users','Users'],['jobs','Jobs & health'],['secrets','Secrets & integrations'],['batch','Paper batch']].map(([e,t])=>(0,h.jsx)(l.Chip,{label:t,active:p===e,onPress:()=>m(e)},e))}),'access'===p&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x,{}),(0,h.jsx)(j,{})]}),'users'===p&&(0,h.jsx)(b,{}
999),'jobs'===p&&(0,h.jsx)(w,{}),'batch'===p&&(0,h.jsx)(u.PaperBatch,{}),'secrets'===p&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_,{}),(0,h.jsx)($,{})]})]})};var t=_r(_d[0]);_r(_d[1]);var n=e(_r(_d[2])),s=e(_r(_d[3])),i=e(_r(_d[4])),r=e(_r(_d[5])),o=_r(_d[6]),l=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]);const p=e=>{if(null==e)return'\u2014';return('number'==typeof e?new Date(1e3*e):new Date(String(e).replace(' ','T')+'+05:30')).toLocaleString('en-IN',{timeZone:'Asia/Kolkata',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit'})+' IST'},m={ok:'green',active:'green',approved:'green',waiting:'neutral',pending:'amber',late:'amber','used up':'neutral',expired:'neutral',failing:'red',stopped:'red',revoked:'red',declined:'neutral','not configured':'neutral','switched off':'neutral'};function f({title:e,children:t}){return(0,h.jsxs)(i.default,{style:{backgroundColor:l.C.paper,borderWidth:1,borderColor:l.C.line,borderRadius:14,padding:14,gap:10},children:[(0,h.jsx)(l.T,{style:{fontFamily:'InterSemi',fontSize:15},children:e}),t]})}const y={minHeight:44,borderWidth:1,borderColor:l.C.line,borderRadius:10,paddingHorizontal:10,color:l.C.ink,fontFamily:'Inter',fontSize:13,backgroundColor:l.C.bg};function x(){const[e,n]=(0,t.useState)(null),[r,o]=(0,t.useState)([]),[c,u]=(0,t.useState)(''),[x,j]=(0,t.useState)(!1),[b,w]=(0,t.useState)('1'),[C,T]=(0,t.useState)('1'),[S,k]=(0,t.useState)('7'),[_,$]=(0,t.useState)(''),v=(0,t.useCallback)(()=>(0,d.api)('/api/admin/codes').then(e=>n(e.codes)).catch(e=>u(e.message)),[]);return(0,t.useEffect)(()=>{v()},[v]),(0,h.jsxs)(f,{title:"Invite codes",children:[(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:"Share a code with a tester; they enter it on the sign-up page (or with Google). Codes are shown in full only once."}),(0,h.jsxs)(i.default,{style:[l.s.row,{gap:10,flexWrap:'wrap',alignItems:'flex-end'}],children:[[['How many',b,w,70],['Sign-ups per code',C,T,70],['Expires in days (blank = never)',S,k,90]].map(([e,t,n,r])=>(0,h.jsxs)(i.default,{style:{gap:3},children:[(0,h.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:e}),(0,h.jsx)(s.default,{value:t,onChangeText:n,keyboardType:"number-pad",accessibilityLabel:e,style:[y,{width:r}]})]},e)),(0,h.jsxs)(i.default,{style:{gap:3,flex:1,minWidth:160},children:[(0,h.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:"Note (who it is for)"}),(0,h.jsx)(s.default,{value:_,onChangeText:$,accessibilityLabel:"Note",style:y})]}),(0,h.jsx)(l.Button,{label:"Create codes",icon:"plus",loading:x,onPress:async function(){j(!0),u('');try{const e=await(0,d.api)('/api/admin/codes',{count:Number(b),uses:Number(C),days:S.trim()?Number(S):null,note:_});o(e.codes),v()}catch(e){u(e.message)}finally{j(!1)}}})]}),!!r.length&&(0,h.jsxs)(i.default,{accessibilityRole:"alert",style:{backgroundColor:l.C.soft,borderRadius:10,padding:10,gap:4},children:[(0,h.jsx)(l.T,{style:{fontFamily:'InterSemi'},children:"Copy these now - they will not be shown again"}),r.map(e=>(0,h.jsx)(l.T,{selectable:!0,style:{fontFamily:'InterSemi',fontSize:15,letterSpacing:1},children:e},e)),(0,h.jsx)(l.Button,{label:"Done",kind:"outline",onPress:()=>o([])})]}),!!c&&(0,h.jsx)(l.T,{accessibilityRole:"alert",style:{color:l.C.red,fontSize:12},children:c}),null===e?(0,h.jsx)(l.T,{style:{color:l.C.muted},children:"Loading\u2026"}):e.length?e.map(e=>(0,h.jsxs)(i.default,{style:[l.s.row,{gap:10,flexWrap:'wrap',alignItems:'center',borderTopWidth:1,borderColor:l.C.line,paddingTop:8}],children:[(0,h.jsx)(l.Badge,{label:e.state.toUpperCase(),tone:m[e.state]||'neutral'}),(0,h.jsx)(l.T,{style:{fontFamily:'InterSemi'},children:e.code_hint}),(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.muted,flex:1},children:`${e.uses}/${e.uses_max} used \xb7 ${e.expires?`expires ${p(e.expires)}`:'no expiry'}${e.note?` \xb7 ${e.note}`:''} \xb7 created ${p(e.created)}`}),'active'===e.state&&(0,h.jsx)(l.Button,{label:"Revoke",kind:"outline",onPress:async()=>{try{await(0,d.api)(`/api/admin/codes/${e.id}/revoke`,{}),v()}catch(e){u(e.message)}}})]},e.id)):(0,h.jsx)(l.T,{style:{color:l.C.muted,fontSize:12},children:"No codes yet."})]})}function j(){const[e,n]=(0,t.useState)(null),[s,r]=(0,t.useState)('pending'),[o,c]=(0,t.useState)(null),[u,y]=(0,t.useState)(''),x=(0,t.useCallback)(()=>(0,d.api)(`/api/admin/requests?status=${s}`).then(e=>n(e.requests)).catch(e=>y(e.message)),[s]);async function j(e,t){y('');try{const n=await(0,d.api)(`/api/admin/requests/${e.id}/${t}`,{});n.invite_url&&c({email:e.email,url:n.invite_url}),x()}catch(e){y(e.message)}}return(0,t.useEffect)(()=>{x()},[x]),(0,h.jsxs)(f,{title:"Access requests (waitlist)",children:[(0,h.jsx)(i.default,{style:[l.s.row,{gap:8}],children:['pending','approved','declined'].map(e=>(0,h.jsx)(l.Chip,{label:e[0].toUpperCase()+e.slice(1),active:s===e,onPress:()=>r(e)},e))}),!!o&&(0,h.jsxs)(i.default,{accessibilityRole:"alert",style:{backgroundColor:l.C.soft,borderRadius:10,padding:10,gap:4},children:[(0,h.jsx)(l.T,{style:{fontFamily:'InterSemi'},children:`Invitation for ${o.email} - send them this link (works once, 7 days; no email was sent)`}),(0,h.jsx)(l.T,{selectable:!0,style:{fontSize:12},children:o.url}),(0,h.jsx)(l.Button,{label:"Done",kind:"outline",onPress:()=>c(null)})]}),!!u&&(0,h.jsx)(l.T,{accessibilityRole:"alert",style:{color:l.C.red,fontSize:12},children:u}),null===e?(0,h.jsx)(l.T,{style:{color:l.C.muted},children:"Loading\u2026"}):e.length?e.map(e=>(0,h.jsxs)(i.default,{style:[l.s.row,{gap:10,flexWrap:'wrap',alignItems:'center',borderTopWidth:1,borderColor:l.C.line,paddingTop:8}],children:[(0,h.jsxs)(i.default,{style:{flex:1,minWidth:200,gap:2},children:[(0,h.jsx)(l.T,{style:{fontFamily:'InterSemi'},children:`${e.name||'\u2014'} \xb7 ${e.email}`}),(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:`${e.note||'No note'} \xb7 ${p(e.created)}`})]}),'pending'===e.status?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(l.Button,{label:"Approve",icon:"check",onPress:()=>j(e,'approve')}),(0,h.jsx)(l.Button,{label:"Decline",kind:"outline",onPress:()=>j(e,'decline')})]}):(0,h.jsx)(l.Badge,{label:e.status.toUpperCase(),tone:m[e.status]})]},e.id)):(0,h.jsx)(l.T,{style:{color:l.C.muted,fontSize:12},children:`No ${s} requests.`})]})}function b(){const[e,n]=(0,t.useState)(null),[s,r]=(0,t.useState)(''),o=(0,t.useCallback)(()=>(0,d.api)('/api/admin/users').then(e=>n(e.users)).catch(e=>r(e.message)),[]);return(0,t.useEffect)(()=>{o()},[o]),(0,h.jsxs)(f,{title:"Users"+(e?` (${e.length})`:''),children:[!!s&&(0,h.jsx)(l.T,{accessibilityRole:"alert",style:{color:l.C.red,fontSize:12},children:s}),null===e?(0,h.jsx)(l.T,{style:{color:l.C.muted},children:"Loading\u2026"}):e.map(e=>(0,h.jsxs)(i.default,{style:[l.s.row,{gap:10,flexWrap:'wrap',alignItems:'center',borderTopWidth:1,borderColor:l.C.line,paddingTop:8}],children:[(0,h.jsx)(l.Badge,{label:e.active?'ACTIVE':'DEACTIVATED',tone:e.active?'green':'red'}),(0,h.jsxs)(i.default,{style:{flex:1,minWidth:200,gap:2},children:[(0,h.jsx)(l.T,{style:{fontFamily:'InterSemi'},children:`${e.name} \xb7 ${e.email}${'owner'===e.role?' \xb7 owner':''}`}),(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:`Joined ${p(e.created)} \xb7 last sign-in ${p(e.last_sign_in)}`})]}),'owner'!==e.role&&(0,h.jsx)(l.Button,{label:e.active?'Deactivate':'Reactivate',kind:"outline",onPress:async()=>
999{if(!e.active||'undefined'==typeof window||!window.confirm||window.confirm(`Deactivate ${e.email}? They are signed out everywhere immediately.`))try{await(0,d.api)(`/api/admin/users/${e.id}/${e.active?'deactivate':'reactivate'}`,{}),o()}catch(e){r(e.message)}}})]},e.id))]})}function w(){const[e,n]=(0,t.useState)(null),[s,r]=(0,t.useState)(''),o=(0,t.useCallback)(()=>(0,d.api)('/api/admin/jobs').then(n).catch(e=>r(e.message)),[]);return(0,t.useEffect)(()=>{o();const e=setInterval(o,15e3);return()=>clearInterval(e)},[o]),(0,h.jsxs)(f,{title:"Jobs & health",children:[(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:"Refreshes every 15 s. Read-only: nothing is started or stopped from here."}),!!s&&(0,h.jsx)(l.T,{accessibilityRole:"alert",style:{color:l.C.red,fontSize:12},children:s}),e&&(0,h.jsxs)(i.default,{style:[l.s.row,{gap:8,alignItems:'center',flexWrap:'wrap'}],children:[(0,h.jsx)(l.Badge,{label:e.feed.live?'LIVE PRICES':'STORED PRICES',tone:e.feed.live?'green':'amber'}),(0,h.jsxs)(l.T,{style:{fontSize:12,color:l.C.muted,flex:1},children:[e.feed.live?'Live option prices are connected.':e.feed.message||'Live option prices are not connected.',e.feed.detail?` (${e.feed.detail})`:'']})]}),e?.jobs.map(e=>(0,h.jsxs)(i.default,{style:[l.s.row,{gap:10,flexWrap:'wrap',alignItems:'center',borderTopWidth:1,borderColor:l.C.line,paddingTop:8}],children:[(0,h.jsx)(l.Badge,{label:e.health.toUpperCase(),tone:m[e.health]||'neutral'}),(0,h.jsxs)(i.default,{style:{flex:1,minWidth:220,gap:2},children:[(0,h.jsx)(l.T,{style:{fontFamily:'InterSemi'},children:e.name}),(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:`${e.cadence} \xb7 last good run ${p(e.last_run)}${e.detail?` \xb7 ${Object.entries(e.detail).map(([e,t])=>`${t} ${e}`).join(', ')}`:''}${e.missed_latest_session?` \xb7 ${e.missed_latest_session} missed in the latest session`:''}`}),!!e.last_error_text&&(0,h.jsx)(l.T,{style:{fontSize:11,color:l.C.amber},children:e.last_error_text})]})]},e.key))]})}const C=e=>e?e.slice(11,16):'\u2014';function T(e,t){const n=new Date(Date.now()+6e4*(330+(new Date).getTimezoneOffset())),s=60*n.getHours()+n.getMinutes(),i=e.marks_missed?` \xb7 ${e.marks_missed} missed`:'';return'market_closed'===e.state?{text:`Market closed today. Nothing to do. Last capture ${p(e.last_capture_any_day)}.`,warn:!1}:'running'===e.state?{text:`Capturing \xb7 last ${C(e.last_mark)} \xb7 ${e.marks_ok} of ${e.marks_total} marks${i}`,warn:!1}:'done'===e.state?{text:`Done for today \xb7 ${e.marks_ok} of ${e.marks_total} marks captured${i}`,warn:0===e.marks_ok}:'waiting'!==e.state||t?'waiting'===e.state&&s<590?{text:'All set. The first capture is at 09:30.',warn:!1}:'waiting'===e.state?{text:'Connected, but nothing captured yet today. Tell the CTO session.',warn:!0}:{text:e.note||'Capture status is not available right now.',warn:!0}:{text:'Waiting for you: press the button below. The capture starts by itself within a minute.',warn:!0}}const S={connected:'Done. Kite is connected for today and the capture runs by itself.',signin:'You are signed in. Tap \u201cStart today\u2019s market data\u201d to finish.',KITE_CANCELLED:'The Kite login was cancelled. Nothing changed.',LOGIN_EXPIRED:'That connection request expired or was already used. Start again.',OWNER_REQUIRED:'Only the owner can connect Kite. Sign in as the owner and start again.',KITE_EXCHANGE_FAILED:'Kite did not issue a token. Please connect again.',KITE_SETUP:'The Kite API key, secret or market-data key is not set yet (infra/scripts/put-secret.sh kite_api_key / kite_api_secret / kite_md_encryption_key --generate).',KITE_WRONG_ACCOUNT:'That Zerodha account is not the one set for market data. Nothing was stored; log in to Kite with the expected account.',STORE_FAILED:'The token could not be saved on the server. Try again; if it repeats, tell the CTO.'},k='https://kite.zerodha.com/connect/login?';function _(){const e=(0,o.useLocalSearchParams)(),n=String(e.kite||''),s=String(e.code||''),[r,c]=(0,t.useState)(null),[u,m]=(0,t.useState)(''),[y,x]=(0,t.useState)(!1),j=(0,t.useCallback)(()=>(0,d.api)('/api/admin/kite/status').then(c).catch(e=>m(e.message)),[]);(0,t.useEffect)(()=>{j()},[j]);const b='connected'===n?S.connected:'signin'===n?S.signin:'failed'===n?S[s]||'Kite was not connected. Please try again.':'',w=!r?.connected&&'market_closed'===r?.capture?.state,C=r?.connected?'green':'live_only'===r?.state||w?'neutral':'amber',_=r?.connected?'CONNECTED TODAY':w?'NOT NEEDED TODAY':'live_only'===r?.state?'LIVE APP ONLY':'rejected'===r?.state?'REJECTED BY KITE':'expired'===r?.state?'EXPIRED':'NOT CONNECTED TODAY';return(0,h.jsxs)(f,{title:"Kite market data",children:[(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:"Option prices come from Zerodha Kite. Kite asks for a fresh login every trading morning: press the button (the 08:50 reminder email brings you to this page), log in on Kite\u2019s own page, and you are back here. No Kite password is stored."}),!!b&&(0,h.jsx)(i.default,{accessibilityRole:"alert",style:{backgroundColor:'failed'===n?l.C.amberBg:l.C.soft,borderRadius:10,padding:10},children:(0,h.jsx)(l.T,{style:{fontSize:13,color:'failed'===n?l.C.red:l.C.ink},children:b})}),!!u&&(0,h.jsx)(l.T,{accessibilityRole:"alert",style:{color:l.C.red,fontSize:12},children:u}),r?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(i.default,{style:[l.s.row,{gap:10,flexWrap:'wrap',alignItems:'center'}],children:[(0,h.jsx)(l.Badge,{label:_,tone:C}),(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.muted,flex:1,minWidth:200},children:'live_only'===r.state?r.note||'Connected on kanida.ai only.':r.connected?`Connected since ${p(r.since)} \xb7 expires ${p(r.expires)}${r.user_id_masked?` \xb7 account ${r.user_id_masked}`:''}${r.last_check?` \xb7 checked with Kite ${p(r.last_check.at)}`:''}`:'rejected'===r.state?`Kite rejected today\u2019s token${r.last_check?` (checked ${p(r.last_check.at)})`:''}. Connect again.`:w?'The market is closed today, so Kite is not needed.':'Not connected today. The capture is
999waiting for you.'})]}),!!r.capture&&(()=>{const e=T(r.capture,r.connected);return(0,h.jsxs)(i.default,{style:{backgroundColor:e.warn?l.C.amberBg:l.C.soft,borderRadius:10,padding:10},children:[(0,h.jsx)(l.T,{style:{fontSize:13,fontWeight:'600',color:l.C.ink},children:"Today\u2019s market data"}),(0,h.jsx)(l.T,{style:{fontSize:13,color:e.warn?l.C.amber:l.C.ink},children:e.text})]})})(),r.allowed&&(0,h.jsxs)(i.default,{style:[l.s.row,{gap:10,flexWrap:'wrap'}],children:[(0,h.jsx)(l.Button,{label:r.connected?'Reconnect Kite':'Start today\u2019s market data',icon:"link",disabled:!r.configured||y,loading:y,onPress:async function(){if('undefined'!=typeof window){x(!0),m('');try{const e=await(0,d.api)('/api/admin/kite/connect',{});if('string'!=typeof e?.url||!e.url.startsWith(k))throw new Error('Kite did not return its login page. Please try again.');window.location.assign(e.url)}catch(e){m(S[e?.code]||e.message),x(!1)}}}}),(r.connected||'rejected'===r.state)&&(0,h.jsx)(l.Button,{label:"Disconnect",kind:"outline",loading:y,onPress:async function(){if('undefined'==typeof window||!window.confirm||window.confirm('Disconnect Kite market data? The capture stops using today\u2019s token until you connect again.')){x(!0),m('');try{await(0,d.api)('/api/admin/kite/disconnect',{}),await j()}catch(e){m(e.message)}finally{x(!1)}}}})]}),r.allowed&&!r.configured&&(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.amber},children:S.KITE_SETUP}),r.allowed&&(r.warnings||[]).map(e=>(0,h.jsx)(l.T,{accessibilityRole:"alert",style:{fontSize:12,color:l.C.amber},children:e},e)),r.allowed&&(0,h.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:"Only enter Zerodha details when the address bar shows kite.zerodha.com."}),r.allowed&&(0,h.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:`Kite developer console redirect URL: ${r.redirect_url}`})]}):(0,h.jsx)(l.T,{style:{color:l.C.muted},children:"Loading\u2026"})]})}function $(){const[e,n]=(0,t.useState)(null),[s,r]=(0,t.useState)('');(0,t.useEffect)(()=>{(0,d.api)('/api/admin/integrations').then(n).catch(e=>r(e.message))},[]);const o=e=>e?new Date(e).toLocaleString('en-IN',{timeZone:'Asia/Kolkata',day:'numeric',month:'short',year:'numeric'}):'\u2014';return(0,h.jsxs)(f,{title:"Secrets & integrations",children:[!!s&&(0,h.jsx)(l.T,{accessibilityRole:"alert",style:{color:l.C.red,fontSize:12},children:s}),e&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:`Stored in: ${e.where}${e.checked_at?` \xb7 vault checked ${o(e.checked_at)}`:''}`}),e.items.map(e=>(0,h.jsxs)(i.default,{style:[l.s.row,{gap:10,flexWrap:'wrap',alignItems:'center',borderTopWidth:1,borderColor:l.C.line,paddingTop:8}],children:[(0,h.jsx)(l.Badge,{label:'live_trading'===e.key?'OFF':e.configured?'CONFIGURED':'MISSING',tone:'live_trading'===e.key?'neutral':e.configured?'green':'amber'}),(0,h.jsxs)(i.default,{style:{flex:1,minWidth:220,gap:2},children:[(0,h.jsx)(l.T,{style:{fontFamily:'InterSemi'},children:e.label}),(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:e.detail}),!!e.secret&&(0,h.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:`Vault: ${null==e.in_vault?'status not reported yet':e.in_vault?'present':'missing'} \xb7 last changed ${o(e.last_changed)} \xb7 last used ${o(e.last_used)}${e.rotation?' \xb7 auto-rotation on':''}`})]})]},e.key)),(0,h.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:e.how_to_change})]})]})}},906,[11,136,278,385,13,400,252,821,197,198,907,6]); 1000__d(function(_g,_r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PaperBatch=function(){const[e,u]=(0,t.useState)(null),[_,h]=(0,t.useState)(''),[$,f]=(0,t.useState)(!1),[y,g]=(0,t.useState)('1000'),b=(0,t.useCallback)(()=>(0,i.api)('/api/admin/paper-batch/status').then(e=>{u(e),h('')}).catch(e=>h(e.message)),[]);async function x(e,t={}){f(!0),h('');try{await(0,i.api)(`/api/admin/paper-batch/${e}`,t),await b()}catch(e){h(e.message)}finally{f(!1)}}(0,t.useEffect)(()=>{b();const e=setInterval(b,1e4);return()=>clearInterval(e)},[b]);const j=Number(y),S=Number.isInteger(j)&&j>=0&&j<=5e4,C='running'===e?.state||'paused'===e?.state,v=e?.positions,k=e?.readings;return(0,r.jsxs)(n.default,{style:{backgroundColor:l.C.paper,borderWidth:1,borderColor:l.C.line,borderRadius:14,padding:14,gap:10},children:[(0,r.jsx)(l.T,{style:{fontFamily:'InterSemi',fontSize:15},children:"Paper batch (sandbox)"}),(0,r.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:e?.disclaimer||'Synthetic paper trades on live data - not live trading, not an instruction. Shake-down, not evidence.'}),!!_&&(0,r.jsx)(l.T,{accessibilityRole:"alert",style:{color:l.C.red,fontSize:12},children:_}),e&&(0,r.jsxs)(n.default,{style:[l.s.row,{gap:8,alignItems:'center',flexWrap:'wrap'}],children:[(0,r.jsx)(l.Badge,{label:(e.state||'unknown').replace('_',' ').toUpperCase(),tone:p[e.state]||'neutral'}),e.entries_paused&&(0,r.jsx)(l.Badge,{label:"NEW ENTRIES PAUSED",tone:"amber"}),!!e.evidence&&(0,r.jsx)(l.Badge,{label:e.evidence.toUpperCase(),tone:"neutral"}),(0,r.jsx)(l.T,{style:{fontSize:12,color:l.C.muted,flex:1},children:[e.batch_id,e.label,e.heartbeat_at?`heartbeat ${e.heartbeat_at.slice(11)}
1000 IST`:null].filter(Boolean).join(' \xb7 ')})]}),(0,r.jsxs)(n.default,{style:[l.s.row,{gap:10,flexWrap:'wrap',alignItems:'flex-end'}],children:[(0,r.jsxs)(n.default,{style:{gap:3},children:[(0,r.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:"Open positions wanted"}),(0,r.jsx)(s.default,{value:y,onChangeText:g,keyboardType:"number-pad",accessibilityLabel:"Open positions wanted",style:{minHeight:44,width:110,borderWidth:1,borderColor:l.C.line,borderRadius:10,paddingHorizontal:10,color:l.C.ink,backgroundColor:l.C.bg}})]}),!C&&(0,r.jsx)(l.Button,{label:"Start",icon:"play",loading:$,disabled:!S,onPress:()=>x('start',{target:j})}),!C&&e?.batch_id&&(0,r.jsx)(l.Button,{label:"Resume this batch",kind:"outline",disabled:$||!S,onPress:()=>x('start',{target:j,batch_id:e.batch_id})}),C&&(0,r.jsx)(l.Button,{label:"Set size",disabled:$||!S,onPress:()=>x('target',{target:j})}),C&&'paused'!==e?.control?.state&&(0,r.jsx)(l.Button,{label:"Pause entries",kind:"outline",disabled:$,onPress:()=>x('pause')}),C&&'paused'===e?.control?.state&&(0,r.jsx)(l.Button,{label:"Resume entries",kind:"outline",disabled:$,onPress:()=>x('resume')}),C&&(0,r.jsx)(l.Button,{label:"Stop",kind:"outline",disabled:$,onPress:()=>{'undefined'!=typeof window&&window.confirm&&!window.confirm('Stop the batch? The summary is written and open positions stop being managed until it is resumed.')||x('stop')}})]}),e&&'idle'!==e.state&&(0,r.jsxs)(n.default,{style:{gap:4},children:[(0,r.jsx)(c,{k:"Wanted / open (incl. queued)",v:`${e.target_open_positions??'\u2014'} / ${v?.live??'\u2014'}`}),(0,r.jsx)(c,{k:"Open \xb7 queued entries \xb7 queued exits",v:`${v?.open??0} \xb7 ${v?.pending_entry??0} \xb7 ${v?.pending_exit??0}`}),(0,r.jsx)(c,{k:"Today: orders \xb7 entries filled \xb7 exits",v:`${e.today?.orders_placed??0} \xb7 ${e.today?.entries_filled??0} \xb7 ${e.today?.exits??0}`}),(0,r.jsx)(c,{k:"Closed \xb7 skipped (all days)",v:`${v?.closed??0} \xb7 ${v?.skipped??0}`}),(0,r.jsx)(c,{k:"Readings processed \xb7 last",v:`${k?.processed??0} \xb7 ${k?.last?k.last.slice(11,16):'\u2014'}`}),(0,r.jsx)(c,{k:"Per reading time p50 / p95",v:`${d(k?.cycle_s_p50)} / ${d(k?.cycle_s_p95)} (CPU ${d(k?.cpu_s_p50)} / ${d(k?.cpu_s_p95)})`}),(0,r.jsx)(c,{k:"Errors \xb7 rate",v:`${e.errors?.count??0} \xb7 ${(100*(e.errors?.rate??0)).toFixed(2)}%`}),(0,r.jsx)(c,{k:"Host load (1 min, 2 CPUs)",v:null==e.host_load_1m?'\u2014':String(e.host_load_1m)}),(0,r.jsx)(c,{k:"Universe",v:`${(e.universe?.indices_covered||[]).join(', ')} + ${e.universe?.stocks_covered??'\u2014'} of ${e.universe?.stocks_wanted??100} stocks (prior session ${e.universe?.prior_session??'\u2014'})`}),!!e.pause_reasons?.length&&(0,r.jsx)(l.T,{style:{fontSize:12,color:l.C.amber},children:'Paused because: '+e.pause_reasons.map(e=>`${e.reason}${e.why?` (${e.why})`:''}`).join('; ')})]}),e?.pnl&&(0,r.jsxs)(n.default,{style:{gap:4,borderTopWidth:1,borderColor:l.C.line,paddingTop:8},children:[(0,r.jsx)(l.T,{style:{fontFamily:'InterSemi'},children:`P&L - ${e.pnl.label}`}),(0,r.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:`${e.pnl.basis}. ${e.pnl.fill_basis}.`}),e.pnl.etv.length?e.pnl.etv.map(e=>(0,r.jsx)(l.T,{style:{fontSize:12},children:`${e.arm} \xb7 ${e.group}: ${e.closed} closed over ${e.entry_sessions} entry session(s) \xb7 ETV ${o(e.etv_per_trade)} per trade${null==e.etv_per_100_at_risk?'':` \xb7 ${e.etv_per_100_at_risk.toFixed(2)} per Rs 100 at risk`} \xb7 net ${o(e.net_pnl)} after ${o(e.charges)} charges${e.sample?` \xb7 ${e.sample}`:''}`},e.arm+e.group)):(0,r.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:"No complete entry cohort yet - no ETV."}),(0,r.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:`${e.pnl.incomplete_cohorts.label}: research ${e.pnl.incomplete_cohorts.research_closed} closed \xb7 ${e.pnl.incomplete_cohorts.research_open} open`}),(0,r.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:`${e.pnl.capacity_test.label}: ${e.pnl.capacity_test.queued} queued \xb7 ${e.pnl.capacity_test.open} open \xb7 ${e.pnl.capacity_test.closed} closed`}),(0,r.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:`Open, unrealised: ${e.pnl.open_unrealised.positions} positions \xb7 ${o(e.pnl.open_unrealised.net_after_entry_charges)} (${e.pnl.open_unrealised.note})`}),(e.pnl.open_unrealised_by_arm||[]).map(e=>(0,r.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:` ${e.label}: ${e.positions} open \xb7 ${o(e.net_after_entry_charges)} = market move ${o(e.market_move_since_entry)} + entry slippage ${o(e.entry_slippage)} + entry charges ${o(e.entry_charges)}`},e.arm))]}),e?.stale_fill&&(0,r.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:`Stale-fill skips (${e.stale_fill.label}, ${e.stale_fill.max_age_s} s): `+Object.entries(e.stale_fill.by_group).map(([e,t])=>`${e} ${t.skipped_stale_only}/${t.entries_decided}${null==t.rate?'':` (${(100*t.rate).toFixed(1)}%)`}`).join(' \xb7 ')}),!!e?.denominators&&(0,r.jsxs)(n.default,{style:{gap:2},children:[(0,r.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:"Where candidate entries went: no opportunity \xb7 missing data \xb7 not placed (size cap / pause) \xb7 other \xb7 unfilled \xb7 queued \xb7 open \xb7 closed"}),Object.entries(e.denominators).map(([e,t])=>(0,r.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:`${t.label}: ${t.no_opportunity} \xb7 ${t.missing_data} \xb7 ${t.not_placed} \xb7 ${t.other} \xb7 ${t.unfilled} \xb7 ${t.queued} \xb7 ${t.open} \xb7 ${t.closed}`},e))]}),!!e?.stale_fill?.by_reading?.length&&(0,r.jsxs)(n.default,{style:{gap:2},children:[(0,r.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:"Queued entries per reading (latest first): filled \xb7 attempts not filled (of which stale) \xb7 given up (of which stale)"}),e.stale_fill.by_reading.slice(0,8).map(e=>(0,r.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:`${e.reading.slice(11,16)} ${e.entries_filled} \xb7 ${e.attempts_failed} (${e.attempts_failed_stale}) \xb7 ${e.entries_skipped} (${e.skipped_stale})`},e.reading))]}),!!e?.pauses?.length&&(0,r.jsxs)(n.default,{style:{gap:2,borderTopWidth:1,borderColor:l.C.line,paddingTop:8},children:[(0,r.jsx)(l.T,{style:{fontFamily:'InterSemi'},children:"Pauses and controls (latest first)"}),e.pauses.slice(0,10).map((e,t)=>(0,r.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:`${e.at.slice(11,19)} ${e.kind}${e.reason?` ${e.reason}`:''}${e.state?` ${e.state}`:''}${e.why?` - ${e.why}`:''}`},t))]}),!!e?.files?.length&&(0,r.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:`Files in the batch folder: ${e.files.join(', ')}`})]})};var t=_r(_d[0]),s=e(_r(_d[1])),n=e(_r(_d[2])),l=_r(_d[3]),i=_r(_d[4]),r=_r(_d[5]);const o=e=>
1000null==e?'\u2014':`Rs ${Math.round(e).toLocaleString('en-IN')}`,d=e=>null==e?'\u2014':`${e.toFixed(2)} s`,p={running:'green',paused:'amber',stopped:'neutral',idle:'neutral',not_running:'red',refused:'red',starting:'amber'};function c({k:e,v:t}){return(0,r.jsxs)(n.default,{style:[l.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,r.jsx)(l.T,{style:{fontSize:12,color:l.C.muted,width:210},children:e}),(0,r.jsx)(l.T,{style:{fontSize:13,fontFamily:'InterSemi'},children:t})]})}},907,[11,385,13,821,197,6]); 1001__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.StrategyAdmin}});var t=r(d[0])},908,[909]); 1002__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"sourceOf",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"patternOf",{enumerable:!0,get:function(){return _}}),_e.sidesFor=T,_e.validateDraft=M,_e.draftWarnings=W,_e.StrategyAdmin=function(){const e=(0,i.useAuth)(),r='phone'===(0,o.useLayoutMode)(),l='owner'===e.user?.role,[d,p]=(0,t.useState)(null),[j,w]=(0,t.useState)(''),[F,K]=(0,t.useState)(null),[V,q]=(0,t.useState)(''),[U,G]=(0,t.useState)(!0),[Q,Y]=(0,t.useState)({}),[J,X]=(0,t.useState)(''),[Z,ee]=(0,t.useState)(null),[te,ae]=(0,t.useState)(null),[re,se]=(0,t.useState)(null),[le,ne]=(0,t.useState)(null),ie=(0,t.useCallback)(async()=>{G(!0);try{const e=await u.adminApi.registry();K({registry_version:e?.registry_version??0,blocks:$((e?.blocks||[]).map(e=>({...e,strategies:$(e.strategies||[])})))}),q('')}catch(e){q(A(e))}finally{G(!1)}},[]),oe=(0,t.useCallback)(async()=>{try{p(await u.adminApi.sources()),w('')}catch(e){p(null),w(A(e))}},[]);(0,t.useEffect)(()=>{l&&(ie(),oe())},[l,ie,oe]);const[de,ce]=(0,t.useState)(''),ue=(0,t.useRef)({});(0,t.useEffect)(()=>{if(!de||!F)return;const e=setTimeout(()=>ue.current[de]?.scrollIntoView?.({block:'center',behavior:'smooth'}),60);return()=>clearTimeout(e)},[de,F]);const he=(e,t)=>Y(a=>({...a,[e]:t}));async function ye(e,t){X(e),he(e,'');try{return await t(),await ie(),!0}catch(t){return he(e,A(t)),!1}finally{X('')}}if(!e.user)return(0,h.jsx)(o.Loading,{});if(!l)return(0,h.jsx)(c.DeskPage,{children:(0,h.jsx)(o.Empty,{icon:"lock",title:"Only the owner can manage strategies",detail:"The strategy registry decides which strategies every member sees in Market scans. Ask the pilot owner if a strategy should be added or changed.",action:(0,h.jsx)(o.Button,{label:"Go to Market scans",kind:"outline",onPress:()=>n.router.push('/discover')})})});const fe=F?.blocks||[],be=e=>[...d?.stored.patterns||[],...d?.research.patterns||[]].find(t=>t.id===e)?.name||e.replaceAll('_',' ');function pe(e,t,a){const r=e[t],s=e[a];let l=r.order??t,n=s.order??a;return l===n&&(l=t,n=a),[[r.key,n],[s.key,l]]}const me=(e,t)=>{const a=e+t;if(a<0||a>=fe.length)return;ye('block:'+fe[e].key,async()=>{for(const[t,r]of pe(fe,e,a))await u.adminApi.updateBlock(t,{order:r})})},ge=(e,t,a)=>{const r=e.strategies,s=t+a;s<0||s>=r.length||ye('block:'+e.key,async()=>{for(const[e,a]of pe(r,t,s))await u.adminApi.updateStrategy(e,{order:a})})},xe=e=>se({scope:'block:'+e.key,title:e.enabled?`Disable \u201c${e.title}\u201d?`:`Enable \u201c${e.title}\u201d?`,label:e.enabled?'Disable block':'Enable block',detail:e.enabled?'The block and all its strategy cards disappear from Market scans for every member. Strategies inside it keep their own settings.':`The block appears on Market scans for every member, showing its enabled strategies (${e.strategies.filter(e=>e.enabled).length} of ${e.strategies.length}).`,run:()=>u.adminApi.updateBlock(e.key,{enabled:!e.enabled})}),ke=(e,t)=>se({scope:'block:'+e.key,title:t.enabled?`Disable \u201c${t.name}\u201d?`:`Enable \u201c${t.name}\u201d?`,label:t.enabled?'Disable strategy':'Enable strategy',detail:t.enabled?'It disappears from the Market scans picker and from Falcon for every member. Cards that were using it fall back to the block defaults.':`It appears in the Market scans picker${e.enabled?'':' once the block is enabled'} for every member. Preview it first: rows without a tested exit rule are shown as \u201cnot tested\u201d, never as evidence.`,run:()=>u.adminApi.updateStrategy(t.key,{enabled:!t.enabled})});async function je(e){ne({strategy:e,loading:!0,error:'',data:null});try{const t=await u.adminApi.preview(e.key);ne(a=>a&&a.strategy.key===e.key?{...a,loading:!1,data:t}:a)}catch(t){ne(a=>a&&a.strategy.key===e.key?{...a,loading:!1,error:A(t)}:a)}}const we=Z?M(Z.draft,{blocks:fe,sources:d,editKey:Z.key}):[],Ce=Z?W(Z.draft,{blocks:fe,editKey:Z.key}):[],ve=!!Z?.tried,Se=e=>ee(t=>t&&{...t,draft:{...t.draft,...e},error:''}),Te=Z&&Z.draft.default_slot?fe.find(e=>e.key===Z.draft.block_key)?.strategies.find(e=>e.key!==Z.key&&e.default_slot===Z.draft.default_slot):void 0;function ze(e){ee(t=>
1002{if(!t)return t;const a=S(d,e),r=a?.timeframes?.length?a.timeframes:y,s=a?.block_key&&fe.some(e=>e.key===a.block_key)?a.block_key:t.draft.block_key;return{...t,error:'',draft:{...t.draft,source_type:e,pattern:'',variant:'',side:'long',block_key:s,timeframe:r.includes(t.draft.timeframe)?t.draft.timeframe:r[0]}}})}const Pe=te?[...'add'!==te.mode||/^[a-z][a-z0-9_]{1,39}$/.test(te.key)?[]:['Key: 2\u201340 lower-case letters, digits or _, starting with a letter.'],...'add'===te.mode&&fe.some(e=>e.key===te.key)?['A block with this key already exists.']:[],...te.title.trim().length<2||te.title.trim().length>60?['Title: 2\u201360 characters.']:[],...te.description.trim().length>200?['Description: 200 characters or fewer.']:[]]:[];const $e=(0,h.jsxs)(a.default,{style:[o.s.between,{flexWrap:'wrap',alignItems:'flex-end'}],children:[(0,h.jsxs)(a.default,{style:{gap:6,flexShrink:1},children:[(0,h.jsx)(o.T,{style:o.s.label,children:"Owner \xb7 Strategy registry"}),(0,h.jsx)(o.T,{role:"heading","aria-level":1,style:[o.s.title,r&&{fontSize:24,lineHeight:32}],children:"Manage strategies"}),(0,h.jsx)(o.T,{style:{color:o.C.muted,maxWidth:720},children:"Blocks and strategies shown on Market scans and used by Falcon. Changes apply to every member without a code release."})]}),(0,h.jsxs)(a.default,{style:[o.s.row,{flexWrap:'wrap'}],children:[F&&(0,h.jsx)(o.Badge,{label:`Registry version ${F.registry_version}`,tone:"neutral"}),(0,h.jsx)(o.Button,{label:"Refresh",kind:"ghost",icon:"refresh-cw",loading:U&&!!F,onPress:()=>{ie(),oe()}}),(0,h.jsx)(o.Button,{label:"Add block",kind:"outline",icon:"plus",disabled:!F,onPress:()=>ae({mode:'add',key:'',title:'',description:'',kind:'quant',error:'',busy:!1})}),(0,h.jsx)(o.Button,{label:"Add strategy",icon:"plus",disabled:!fe.length,onPress:()=>ee({mode:'add',draft:C(fe[0]?.key,B(fe[0])),error:'',busy:!1})})]})]});return(0,h.jsxs)(c.DeskPage,{children:[$e,!u.patchSupported&&(0,h.jsxs)(a.default,{style:[o.s.row,{padding:12,borderRadius:10,backgroundColor:o.C.amberBg}],children:[(0,h.jsx)(o.Icon,{name:"info",size:15,color:o.C.amber}),(0,h.jsx)(o.T,{style:{flex:1,fontSize:13,color:o.C.amber},children:"Enable, reorder and edit need the web app. You can view the registry, add and preview here."})]}),!!V&&(0,h.jsxs)(a.default,{style:{gap:10},children:[(0,h.jsx)(E,{text:`Strategy registry is unavailable: ${V}`}),(0,h.jsx)(o.Button,{label:"Retry",kind:"outline",onPress:ie,style:{alignSelf:'flex-start'}})]}),U&&!F&&!V&&(0,h.jsx)(o.Loading,{}),F&&!fe.length&&(0,h.jsx)(o.Empty,{icon:"layers",title:"No blocks yet",detail:"Add a block (for example Chart Strategies), then add strategies to it.",action:(0,h.jsx)(o.Button,{label:"Add block",onPress:()=>ae({mode:'add',key:'chart',title:'Chart Strategies',description:'',kind:'chart',error:'',busy:!1})})}),fe.map((e,t)=>{const l='block:'+e.key,n=J===l;return(0,h.jsxs)(a.default,{role:"region","aria-label":`Block ${e.title}`,style:[o.s.card,{padding:r?14:18,gap:12,opacity:n?.7:1}],children:[(0,h.jsxs)(a.default,{style:[o.s.between,{flexWrap:'wrap',alignItems:'flex-start'}],children:[(0,h.jsxs)(a.default,{style:{flex:1,minWidth:220,gap:4},children:[(0,h.jsxs)(a.default,{style:[o.s.row,{flexWrap:'wrap',gap:8}],children:[(0,h.jsx)(o.T,{role:"heading","aria-level":2,style:{fontFamily:'ManropeBold',fontSize:19,lineHeight:26},children:e.title}),(0,h.jsx)(o.Badge,{label:e.kind,tone:"neutral"}),(0,h.jsxs)(o.T,{style:{fontSize:11,color:o.C.muted},children:["key ",e.key," \xb7 order ",e.order]})]}),(0,h.jsx)(o.T,{style:{fontSize:13,color:o.C.muted},children:e.description||'No description.'}),(0,h.jsxs)(o.T,{style:{fontSize:12,color:o.C.muted},children:[e.strategies.length," strateg",1===e.strategies.length?'y':'ies'," \xb7 ",e.strategies.filter(e=>e.enabled).length," enabled"]})]}),(0,h.jsxs)(a.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,h.jsx)(I,{on:e.enabled,label:`Block ${e.title}: ${e.enabled?'enabled':'disabled'}`,disabled:n||!u.patchSupported,onPress:()=>xe(e)}),(0,h.jsx)(H,{icon:"arrow-up",label:`Move block ${e.title} up`,disabled:0===t||n||!u.patchSupported,onPress:()=>me(t,-1)}
1002),(0,h.jsx)(H,{icon:"arrow-down",label:`Move block ${e.title} down`,disabled:t===fe.length-1||n||!u.patchSupported,onPress:()=>me(t,1)}),(0,h.jsx)(H,{icon:"edit-2",text:"Edit",label:`Edit block ${e.title}`,disabled:!u.patchSupported,onPress:()=>ae({mode:'edit',key:e.key,title:e.title,description:e.description||'',kind:e.kind,error:'',busy:!1})}),(0,h.jsx)(H,{icon:"plus",text:"Strategy",label:`Add strategy to ${e.title}`,onPress:()=>ee({mode:'add',draft:C(e.key,B(e)),error:'',busy:!1})})]})]}),(0,h.jsx)(E,{text:Q[l]||''}),e.strategies.length?(0,h.jsx)(s.default,{horizontal:!0,showsHorizontalScrollIndicator:!0,contentContainerStyle:{minWidth:'100%'},children:(0,h.jsxs)(a.default,{role:"table","aria-label":`Strategies in ${e.title}`,style:{minWidth:980,flex:1},children:[(0,h.jsx)(a.default,{role:"row",style:[o.s.row,{gap:10,paddingVertical:8,borderBottomWidth:1,borderColor:o.C.line}],children:[['Name',2.4],['Pattern',1.3],['TF',.45],['Side',.7],['Audience',.8],['Slot',.5],['Enabled',1],['Order',.9],['',1.6]].map(([e,t])=>(0,h.jsx)(o.T,{role:"columnheader",style:[o.s.label,{flex:t,fontSize:10}],children:e},String(e)||'actions'))}),e.strategies.map((t,r)=>(0,h.jsxs)(a.default,{ref:e=>
1002{ue.current[t.key]=e},role:"row",style:[o.s.row,{gap:10,minHeight:52,paddingVertical:6,borderBottomWidth:r===e.strategies.length-1?0:1,borderColor:o.C.line},t.key===de&&{backgroundColor:o.C.soft,borderRadius:8,paddingHorizontal:6}],children:[(0,h.jsxs)(a.default,{role:"cell",style:{flex:2.4,minWidth:0},children:[(0,h.jsxs)(a.default,{style:[o.s.row,{gap:6}],children:[t.key===de&&(0,h.jsx)(o.Badge,{label:"New",tone:"green"}),(0,h.jsx)(o.T,{numberOfLines:1,style:{flexShrink:1,fontFamily:'InterSemi',fontSize:13,color:t.enabled?o.C.ink:o.C.muted},children:t.name})]}),(0,h.jsxs)(o.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16,color:o.C.muted},children:[t.key,t.tags?.length?` \xb7 ${t.tags.join(', ')}`:''," \xb7 min ",t.min_trades," trades"]})]}),(0,h.jsx)(o.T,{role:"cell",numberOfLines:1,style:{flex:1.3,fontSize:13},children:t.pattern_name||be(t.pattern)}),(0,h.jsx)(o.T,{role:"cell",style:{flex:.45,fontSize:13},children:t.timeframe}),(0,h.jsx)(o.T,{role:"cell",style:{flex:.7,fontSize:13,color:'long'===t.side?o.C.green:o.C.red},children:t.side}),(0,h.jsx)(o.T,{role:"cell",style:{flex:.8,fontSize:13},children:k[t.audience]||t.audience}),(0,h.jsx)(o.T,{role:"cell",style:{flex:.5,fontSize:13,color:t.default_slot?o.C.ink:o.C.muted},children:t.default_slot||'\u2014'}),(0,h.jsx)(a.default,{role:"cell",style:{flex:1},children:(0,h.jsx)(I,{on:t.enabled,label:`${t.name}: ${t.enabled?'enabled':'disabled'}`,disabled:n||!u.patchSupported,onPress:()=>ke(e,t)})}),(0,h.jsxs)(a.default,{role:"cell",style:[o.s.row,{flex:.9,gap:4}],children:[(0,h.jsx)(H,{icon:"arrow-up",label:`Move ${t.name} up`,disabled:0===r||n||!u.patchSupported,onPress:()=>ge(e,r,-1)}),(0,h.jsx)(H,{icon:"arrow-down",label:`Move ${t.name} down`,disabled:r===e.strategies.length-1||n||!u.patchSupported,onPress:()=>ge(e,r,1)})]}),(0,h.jsxs)(a.default,{role:"cell",style:[o.s.row,{flex:1.6,gap:6,justifyContent:'flex-end'}],children:[(0,h.jsx)(H,{text:"Edit",label:`Edit ${t.name}`,onPress:()=>ee({mode:'edit',key:t.key,draft:v(t),error:'',busy:!1})}),(0,h.jsx)(H,{icon:"eye",text:"Preview",label:`Preview ${t.name}`,onPress:()=>je(t)})]})]},t.key))]})}):(0,h.jsx)(o.T,{style:{fontSize:13,color:o.C.muted,paddingVertical:8},children:"No strategies in this block yet."})]},e.key)}),(0,h.jsx)(o.Sheet,{visible:!!Z,onClose:()=>!Z?.busy&&ee(null),title:'edit'===Z?.mode?'Edit strategy':'Add strategy',subtitle:'edit'===Z?.mode?`Key ${Z.key}`:'Saved strategies can be previewed before they are enabled.',footer:Z&&(0,h.jsxs)(a.default,{style:[o.s.row,{justifyContent:'flex-end',flexWrap:'wrap'}],children:[(0,h.jsx)(o.Button,{label:"Cancel",kind:"ghost",disabled:Z.busy,onPress:()=>ee(null)}),(0,h.jsx)(o.Button,{label:'edit'===Z.mode?'Save changes':Z.draft.enable?'Save and enable':'Save as disabled',loading:Z.busy,onPress:function(){if(!Z)return;if(we.length)return void ee(e=>e&&{...e,tried:!0});const e=Z.draft,t=P(e.tags),a=Number(e.min_trades);if('add'===Z.mode){const r={...e.key.trim()?{key:e.key.trim()}:{},block_key:e.block_key,name:e.name.trim(),description:e.description.trim(),tags:t,timeframe:e.timeframe,side:e.side,audience:e.audience,min_trades:a,default_slot:e.default_slot,enabled:e.enable},s='research_pattern'===e.source_type?{...r,source_type:'research_pattern',pattern_id:e.pattern,variant:e.variant}:{...r,source_type:'stored_pattern',pattern:e.pattern,pattern_name:be(e.pattern)};se({scope:'form',title:`Save \u201c${s.name}\u201d?`,label:e.enable?'Save and enable':'Save as disabled',detail:e.enable?'It is added to the registry and appears in Market scans for every member right away. Strategies without tested evidence are shown as \u201cnot tested\u201d.':'It is added to the registry as disabled. Use Preview to check what it finds, then enable it.',run:async()=>{ee(e=>e&&{...e,busy:!0,error:''});try{const e=await u.adminApi.createStrategy(s);ee(null),e?.key&&(ce(e.key),je(e))}catch(e){throw ee(t=>t&&{...t,busy:!1,error:A(e)}),e}}})}else if(Z.key){const r=fe.flatMap(e=>e.strategies).find(e=>e.key===Z.key),s={};if(!r)return ee(e=>e&&{...e,error:'This strategy is no longer in the registry. Close the form and refresh.'});if(e.name.trim()!==r.name&&(s.name=e.name.trim()),e.description.trim()!==(r.description||'')&&(s.description=e.description.trim()),t.join('|')!==(r.tags||[]).join('|')&&(s.tags=t),e.audience!==r.audie
1002nce&&(s.audience=e.audience),a!==r.min_trades&&(s.min_trades=a),e.default_slot!==(r.default_slot??null)&&(s.default_slot=e.default_slot),e.block_key!==r.block_key&&(s.block_key=e.block_key),e.enable!==r.enabled&&(s.enabled=e.enable),!Object.keys(s).length)return ee(e=>e&&{...e,error:'Nothing has changed.'});se({scope:'form',title:`Save changes to \u201c${r.name}\u201d?`,label:'Save changes',detail:`Changes: ${Object.keys(s).join(', ').replace('min_trades','minimum trades').replace('default_slot','default slot').replace('block_key','block')}. ${r.enabled||s.enabled?'Members see the change in Market scans right away.':'The strategy stays disabled.'}`,run:async()=>{ee(e=>e&&{...e,busy:!0,error:''});try{await u.adminApi.updateStrategy(r.key,s),ee(null)}catch(e){throw ee(t=>t&&{...t,busy:!1,error:A(e)}),e}}})}}})]}),children:Z&&(0,h.jsxs)(s.default,{keyboardShouldPersistTaps:"handled",contentContainerStyle:{padding:24,gap:16},children:[(0,h.jsx)(R,{label:"Block",value:Z.draft.block_key,options:fe.map(e=>[e.key,e.title+(e.enabled?'':' (disabled)')]),onChange:e=>Se({block_key:e})}),(0,h.jsx)(N,{label:"Name",value:Z.draft.name,onChangeText:e=>Se({name:e}),placeholder:"Falling Wedge strict \xb7 1D"}),'add'===Z.mode&&(0,h.jsxs)(a.default,{style:{gap:4},children:[(0,h.jsx)(N,{label:"Key (advanced)",value:Z.draft.key,onChangeText:e=>Se({key:e.trim().toLowerCase()}),placeholder:"auto from name"}),(0,h.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Optional. Leave empty and the server creates a unique key from the name (e.g. falling-wedge-strict-1d). A key can\u2019t change later."})]}),(0,h.jsx)(N,{label:"Description",value:Z.draft.description,onChangeText:e=>Se({description:e}),multiline:!0,placeholder:"What the strategy looks for, in one or two sentences."}),(0,h.jsxs)(a.default,{style:{gap:6},children:[(0,h.jsx)(L,{children:"Source"}),'edit'===Z.mode?(0,h.jsx)(o.T,{style:{fontSize:14},children:b[Z.draft.source_type]}):(0,h.jsx)(a.default,{role:"radiogroup","aria-label":"Source",style:[o.s.row,{flexWrap:'wrap',gap:6}],children:['stored_pattern','research_pattern'].map(e=>(0,h.jsx)(o.Chip,{label:b[e]+(d&&!S(d,e)?.available?' (unavailable)':''),active:Z.draft.source_type===e,onPress:()=>ze(e)},e))}),(0,h.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:'research_pattern'===Z.draft.source_type?'One combination of the researched catalogue: pattern, variant, side and timeframe. Its evidence is that combination\u2019s own research cell, and it still passes the publication gate before a single number is shown.':'Matches come from the stored market scan (point-in-time, data end stated).'}),!!j&&(0,h.jsxs)(o.T,{accessibilityRole:"alert",style:{fontSize:12,color:o.C.amber},children:["The list of patterns this server can add did not load: ",j]})]}),'edit'===Z.mode&&(0,h.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Pattern, timeframe and side can\u2019t change after saving (they define what the strategy is). Add a new strategy instead."}),(0,h.jsx)(D,{source:S(d,Z.draft.source_type),value:Z.draft.pattern,disabled:'edit'===Z.mode,fallbackName:be(Z.draft.pattern),onChange:function(e){ee(t=>{if(!t)return t;const a=t.draft,r=S(d,a.source_type)?.patterns.find(t=>t.id===e)||null,s='research_pattern'===a.source_type&&r?.variants[0]?.id||'',l=T(d,{source_type:a.source_type,pattern:e,variant:s}),n=r?.block_key&&fe.some(e=>e.key===r.block_key)?r.block_key:a.block_key;return{...t,error:'',draft:{...a,pattern:e,variant:s,block_key:n,side:l.length&&!l.includes(a.side)?l[0]:a.side}}})}}),'add'===Z.mode&&'research_pattern'===Z.draft.source_type&&!!_(d,Z.draft)&&(0,h.jsx)(R,{label:"Variant",value:Z.draft.variant,options:_(d,Z.draft).variants.map(e=>[e.id,e.label]),onChange:function(e){ee(t=>{if(!t)return t;const a=t.draft,r=T(d,{...a,variant:e});return{...t,error:'',draft:{...a,variant:e,side:r.length&&!r.includes(a.side)?r[0]:a.side}}})}}),(0,h.jsx)(R,{label:"Timeframe",value:Z.draft.timeframe,disabled:'edit'===Z.mode,options:z(d,Z.draft.source_type).map(e=>[e,e]),onChange:e=>Se({timeframe:e,audience:'add'===Z.mode?'1W'===e?'investor':'trader':Z.draft.audience})}),(0,h.jsx)(R,{label:"Side",value:Z.draft.side,disabled:'edit'===Z.mode,options:(T(d,Z.draft).length?T(d,Z.draft):['long','short']).map(e=>[e,x[e]]),onChange:e=>Se({side:e})}),(0,h.jsx)(R,{label:"Audience",value:Z.draft.audience,options:[['trader','Trader'],['investor','Investor'],['both','Both']],onChange:e=>Se({audience:e})}),(0,h.jsx)(N,{label:"Tags (comma separated)",value:Z.draft.tags,onChangeText:e=>Se({tags:e}),placeholder:"Chart patterns, Bullish, 1D"}),(0,h.jsx)(N,{label:"Minimum trades",value:Z.draft.min_trades,onChangeText:e=>Se({min_trades:e.replace(/[^0-9]/g,'')}),keyboardType:"number-pad"}),(0,h.jsx)(o.T,{style:{fontSize:11,color:o.C.muted,marginTop:-10},children:"Sample needed before a 95% low is shown as evidence (default 10)."}),(0,h.jsx)(R,{label:"Default slot",value:Z.draft.default_slot,options:[[null,'None'],['A','Scanner A'],['B','Scanner B']],onChange:e=>Se({default_slot:e})}),!!Te&&(0,h.jsxs)(o.T,{style:{fontSize:12,color:o.C.amber},children:["\u201c",Te.name,"\u201d is also the default for slot ",Z.draft.default_slot," in this block."]}),(0,h.jsxs)(a.default,{style:{gap:6},children:[(0,h.jsx)(L,{children:"Status"}),(0,h.jsx)(I,{on:Z.draft.enable,label:'edit'===Z.mode?'Enabled':'Enable after saving',disabled:'edit'===Z.mode&&!u.patchSupported,onPress:()=>Se({enable:!Z.draft.enable})}),(0,h.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:'add'===Z.mode?'Leave disabled to preview what it finds before members see it.':'Disabled strategies are hidden from members.'})]}),Ce.map(e=>(0,h.jsxs)(a.default,{accessibilityRole:"alert",style:[o.s.row,{gap:8,padding:10,borderRadius:10,backgroundColor:o.C.amberBg,alignItems:'flex-start'}],children:[(0,h.jsx)(o.Icon,{name:"info",size:15,color:o.C.amber}),(0,h.jsx)(o.T,{style:{flex:1,fontSize:13,lineHeight:19,color:o.C.amber},children:e})]},e)),ve&&we.length>0&&(0,h.jsxs)(a.default,{accessibilityRole:"alert",style:{gap:4,padding:12,borderRadius:10,backgroundColor:o.C.amberBg},children:[(0,h.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:13,color:o.C.amber},children:"Fix before saving:"}),we.map(e=>(0,h.jsxs)(o.T,{style:{fontSize:13,color:o.C.amber},children:["\u2022 ",e]},e))]}),(0,h.jsx)(E,{text:Z.error})]})}),(0,h.jsx)(o.Sheet,{visible:!!te,onClose:()=>!te?.busy&&ae(null),title:'edit'===te?.mode?'Edit block':'Add block',subtitle:'edit'===te?.mode?`Key ${te.key}`:'New blocks start disabled.',footer:te&&(0,h.jsxs)(a.default,{style:[o.s.row,{justifyContent:'flex-end'}],children:[(0,h.jsx)(o.Button,{label:"Cancel",kind:"ghost",disabled:te.busy,onPress:()=>ae(null)}),(0,h.jsx)(o.Button,{label:'edit'===te.mode?'Save block':'Add block',loading:te.busy,onPress:function(){if(!te)return;if(Pe.length)return ae(e=>e&&{...e,error:Pe.join(' ')});const e=te,t=e.title.trim(),a=e.description.trim();if('add'===e.mode){const r={key:e.key,title:t,description:a,kind:e.kind,order:fe.length?Math.max(...fe.map(e=>e.order??0))+1:0,enabled:!1};se({scope:'blockform',title:`Add block \u201c${t}
1002\u201d?`,label:'Add block (disabled)',detail:'The block is created disabled, so members see nothing until you add strategies and enable it.',run:async()=>{ae(e=>e&&{...e,busy:!0});try{await u.adminApi.createBlock(r),ae(null)}catch(e){throw ae(t=>t&&{...t,busy:!1,error:A(e)}),e}}})}else{const r=fe.find(t=>t.key===e.key);if(!r)return;const s={};if(t!==r.title&&(s.title=t),a!==(r.description||'')&&(s.description=a),e.kind!==r.kind&&(s.kind=e.kind),!Object.keys(s).length)return ae(e=>e&&{...e,error:'Nothing has changed.'});se({scope:'blockform',title:`Save \u201c${t}\u201d?`,label:'Save block',detail:r.enabled?'Members see the new title and description on Market scans right away.':'The block stays disabled.',run:async()=>{ae(e=>e&&{...e,busy:!0});try{await u.adminApi.updateBlock(r.key,s),ae(null)}catch(e){throw ae(t=>t&&{...t,busy:!1,error:A(e)}),e}}})}}})]}),children:te&&(0,h.jsxs)(s.default,{keyboardShouldPersistTaps:"handled",contentContainerStyle:{padding:24,gap:16},children:['add'===te.mode&&(0,h.jsx)(N,{label:"Key",value:te.key,onChangeText:e=>ae(t=>t&&{...t,key:e.toLowerCase().replace(/[^a-z0-9_]/g,''),error:''}),placeholder:"quant"}),(0,h.jsx)(N,{label:"Title",value:te.title,onChangeText:e=>ae(t=>t&&{...t,title:e,error:''}),placeholder:"Quant Strategies"}),(0,h.jsx)(N,{label:"Description",value:te.description,onChangeText:e=>ae(t=>t&&{...t,description:e,error:''}),multiline:!0}),(0,h.jsx)(R,{label:"Kind",value:te.kind,options:f.map(e=>[e,e]),onChange:e=>ae(t=>t&&{...t,kind:e,error:''})}),(0,h.jsx)(E,{text:te.error})]})}),(0,h.jsx)(o.Sheet,{wide:!0,visible:!!le,onClose:()=>ne(null),title:le?`Preview \xb7 ${le.strategy.name}`:'Preview',subtitle:le?`${le.strategy.pattern_name||be(le.strategy.pattern)} \xb7 ${le.strategy.timeframe} \xb7 ${le.strategy.side} \xb7 ${le.strategy.enabled?'enabled':'disabled (not visible to members)'}`:void 0,children:le&&(0,h.jsxs)(s.default,{contentContainerStyle:{padding:24,gap:16},children:[le.loading&&(0,h.jsx)(o.Loading,{}),!!le.error&&(0,h.jsxs)(a.default,{style:{gap:10},children:[(0,h.jsx)(E,{text:`Preview failed: ${le.error}`}),(0,h.jsx)(o.Button,{label:"Retry",kind:"outline",onPress:()=>je(le.strategy),style:{alignSelf:'flex-start'}})]}),le.data&&(0,h.jsx)(O,{data:le.data,minTrades:le.strategy.min_trades}),(0,h.jsxs)(a.default,{style:[o.s.row,{gap:8,padding:12,borderRadius:10,backgroundColor:o.C.soft,alignItems:'flex-start'}],children:[(0,h.jsx)(o.Icon,{name:"shield",size:15,color:o.C.green}),(0,h.jsx)(o.T,{style:{flex:1,fontSize:12,lineHeight:18,color:o.C.mint},children:"Strategies without tested evidence are shown as \u2018not tested\u2019 \u2014 never as evidence."})]})]})}),(0,h.jsx)(o.Sheet,{visible:!!re,onClose:()=>se(null),title:re?.title||'Confirm',footer:re&&(0,h.jsxs)(a.default,{style:[o.s.row,{justifyContent:'flex-end'}],children:[(0,h.jsx)(o.Button,{label:"Cancel",kind:"ghost",onPress:()=>se(null)}),(0,h.jsx)(o.Button,{label:re.label,onPress:async function(){const e=re;if(e)if(se(null),'form'!==e.scope&&'blockform'!==e.scope)await ye(e.scope,e.run);else try{await e.run(),await ie()}catch{}}})]}),children:re&&(0,h.jsx)(a.default,{style:{padding:24},children:(0,h.jsx)(o.T,{style:{color:o.C.muted,lineHeight:22},children:re.detail})})})]})};var t=_r(_d[0]),a=e(_r(_d[1])),r=e(_r(_d[2])),s=e(_r(_d[3])),l=e(_r(_d[4])),n=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]);const y=['1H','4H','1D','1W'],f=['chart','quant','results','options','candlestick','events'],b={stored_pattern:'Stored scan',research_pattern:'Researched catalogue'},p=60,x={long:'Long (bullish)',short:'Short (bearish)'},k={trader:'Trader',investor:'Investor',both:'Both'},j={tested_rule:'Tested exit rule (later-test)',hold_period_history:'Pattern hold-period history \xb7 not a tested exit rule',none:'Not tested'},w=/^[a-z0-9][a-z0-9_-]{2,63}$/,C=(e="",t="stored_pattern")=>({source_type:t,block_key:e,key:'',name:'',description:'',pattern:'',variant:'',timeframe:'1D',side:'long',audience:'trader',tags:'',min_trades:'10',default_slot:null,enable:!1}),v=e=>({source_type:e.source_type,block_key:e.block_key,key:e.key,name:e.name,description:e.description||'',pattern:e.pattern,variant:e.variant||'',timeframe:e.timeframe,side:e.side,audience:e.audience,tags:(e.tags||[]).join(', '),min_trades:String(e.min_trades??10),default_slot:e.default_slot??null,enable:e.enabled}),S=(e,t)=>('research_pattern'===t?e?.research:e?.stored)||null,_=(e,t)=>
1002S(e,t.source_type)?.patterns.find(e=>e.id===t.pattern)||null;function T(e,t){const a=_(e,t);return a?'research_pattern'!==t.source_type?a.sides||[]:(a.variants.find(e=>e.id===t.variant)||a.variants[0])?.sides||[]:[]}const z=(e,t)=>S(e,t)?.timeframes?.length?S(e,t).timeframes:y,P=e=>Array.from(new Set(e.split(',').map(e=>e.trim()).filter(Boolean))),$=e=>[...e].sort((e,t)=>(e.order??0)-(t.order??0)),B=e=>e?.strategies?.[0]?.source_type||'stored_pattern',A=e=>403===e?.status?'Only the owner can change the strategy registry.':404===e?.status?`Not found on the server${e?.message?`: ${e.message}`:''}.`:e?.message||'The server could not complete this change.';function M(e,t){const a=[],r=e.name.trim(),s=Number(e.min_trades),l=P(e.tags);if(t.blocks.some(t=>t.key===e.block_key)||a.push('Choose a block.'),r.length<3?a.push('Name needs at least 3 characters.'):r.length>80&&a.push('Name must be 80 characters or fewer.'),e.description.trim().length>300&&a.push('Description must be 300 characters or fewer.'),!t.editKey){const r=S(t.sources,e.source_type),s=_(t.sources,e);t.sources?r&&r.available||a.push(r?.reason||'That source is not available on this server.'):a.push('The list of patterns you can add has not loaded yet.'),e.pattern?t.sources&&r?.available&&!s&&a.push(`${e.pattern} is not a pattern this server can add.`):a.push('Choose a pattern.'),'research_pattern'===e.source_type&&s&&(e.variant?s.variants.some(t=>t.id===e.variant)||a.push('That variant was not researched for this pattern.'):a.push('Choose a variant.'));if(z(t.sources,e.source_type).includes(e.timeframe)||a.push('Choose a timeframe.'),'long'!==e.side&&'short'!==e.side)a.push('Choose a side.');
1002else if(s){const r=T(t.sources,e);r.length&&!r.includes(e.side)&&a.push(`${s.name} was researched ${r.join(' and ')} only.`)}}['trader','investor','both'].includes(e.audience)||a.push('Choose an audience.'),(!/^\d+$/.test(e.min_trades.trim())||!Number.isInteger(s)||s<1||s>1e3)&&a.push('Minimum trades must be a whole number from 1 to 1000.'),l.length>8&&a.push('Use at most 8 tags.'),l.some(e=>e.length>30)&&a.push('Each tag must be 30 characters or fewer.');const n=t.blocks.flatMap(e=>e.strategies),i=e.key.trim();return n.some(e=>e.key!==t.editKey&&e.name.trim().toLowerCase()===r.toLowerCase())&&a.push('Another strategy already uses this name.'),!t.editKey&&i&&(w.test(i)?n.some(e=>e.key===i)&&a.push('A strategy with this key already exists. Choose another key or leave it empty.'):a.push('Key: 3\u201364 lower-case letters, digits, - or _, starting with a letter or digit (or leave it empty to create it from the name).')),a}function W(e,t){if(t.editKey||!e.pattern)return[];const a=t.blocks.find(t=>t.key===e.block_key)?.strategies.find(t=>t.source_type===e.source_type&&t.pattern===e.pattern&&t.timeframe===e.timeframe&&t.side===e.side&&('research_pattern'!==e.source_type||t.variant===e.variant));return a?[`Same pattern, timeframe and side as \u201c${a.name}\u201d \u2014 results will be identical unless its settings differ.`]:[]}function I({on:e,label:t,onPress:s,disabled:l=!1}){return(0,h.jsxs)(r.default,{role:"switch","aria-checked":e,accessibilityState:{checked:e,disabled:l},accessibilityLabel:t,disabled:l,onPress:s,style:e=>[o.s.row,{gap:8,minHeight:36,paddingHorizontal:4,borderRadius:8,borderWidth:1,borderColor:e.focused?o.C.green:'transparent',opacity:l?.45:e.pressed?.7:1}],children:[(0,h.jsx)(a.default,{style:{width:34,height:20,borderRadius:10,backgroundColor:e?o.C.green:o.C.line,padding:2,alignItems:e?'flex-end':'flex-start'},children:(0,h.jsx)(a.default,{style:{width:16,height:16,borderRadius:8,backgroundColor:e?o.C.onGreen:o.C.muted}})}),(0,h.jsx)(o.T,{style:{fontSize:12,color:e?o.C.green:o.C.muted},children:e?'Enabled':'Disabled'})]})}function H({icon:e,label:t,onPress:a,disabled:s=!1,text:l}){return(0,h.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:t,disabled:s,onPress:a,style:e=>[o.s.row,{gap:5,minHeight:32,minWidth:32,justifyContent:'center',paddingHorizontal:l?10:6,borderRadius:8,borderWidth:1,borderColor:e.focused?o.C.green:o.C.line,backgroundColor:e.hovered?o.C.soft:o.C.paper,opacity:s?.35:e.pressed?.7:1}],children:[!!e&&(0,h.jsx)(o.Icon,{name:e,size:14,color:o.C.muted}),!!l&&(0,h.jsx)(o.T,{style:{fontSize:12,fontFamily:'InterMedium'},children:l})]})}function L({children:e}){return(0,h.jsx)(o.T,{style:[o.s.label,{fontSize:10}],children:e})}function N({label:e,value:t,onChangeText:r,multiline:s=!1,placeholder:n,keyboardType:i}){return(0,h.jsxs)(a.default,{style:{gap:6},children:[(0,h.jsx)(L,{children:e}),(0,h.jsx)(l.default,{accessibilityLabel:e,value:t,onChangeText:r,multiline:s,placeholder:n,placeholderTextColor:o.C.muted,keyboardType:i,autoCorrect:!1,style:[o.s.input,{minHeight:s?76:44,fontSize:14,paddingVertical:s?10:0,textAlignVertical:s?'top':'center'}]})]})}function R({label:e,value:t,options:r,onChange:s,disabled:l=!1}){return(0,h.jsxs)(a.default,{style:{gap:6},children:[(0,h.jsx)(L,{children:e}),(0,h.jsx)(a.default,{role:"radiogroup","aria-label":e,style:[o.s.row,{flexWrap:'wrap',gap:6,opacity:l?.5:1}],children:r.map(([e,a])=>(0,h.jsx)(o.Chip,{label:a,active:t===e,onPress:l?void 0:()=>s(e)},String(e)))})]})}function E({text:e}){return e?(0,h.jsxs)(a.default,{accessibilityRole:"alert",style:[o.s.row,{gap:8,padding:10,borderRadius:10,backgroundColor:o.C.redBg,alignItems:'flex-start'}],children:[(0,h.jsx)(o.Icon,{name:"alert-triangle",size:15,color:o.C.red}),(0,h.jsx)(o.T,{style:{flex:1,fontSize:13,lineHeight:19,color:o.C.red},children:e})]}):null}function D({source:e,value:r,disabled:s,fallbackName:n,onChange:i}){const[d,c]=(0,t.useState)('');if(s)return(0,h.jsxs)(a.default,{style:{gap:6},children:[(0,h.jsx)(L,{children:"Pattern"}),(0,h.jsx)(o.T,{style:{fontSize:14},children:n||r})]});if(!e)return(0,h.jsxs)(a.default,{style:{gap:6},children:[(0,h.jsx)(L,{children:"Pattern"}),(0,h.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Loading what this server can add\u2026"})]});if(!e.available)return(0,h.jsxs)(a.default,{style:{gap:6},children:[(0,h.jsx)(L,{children:"Pattern"}),(0,h.jsx)(o.T,{accessibilityRole:"alert",style:{fontSize:13,color:o.C.amber},children:e.reason||'This source is not available on this server.'})]});const u=d.trim().toLowerCase(),y=e.patterns,f=u?y.filter(e=>e.id.toLowerCase().includes(u)||e.name.toLowerCase().includes(u)):y,b=f.slice(0,p);return(0,h.jsxs)(a.default,{style:{gap:6},children:[(0,h.jsx)(L,{children:"Pattern"}),y.length>p&&(0,h.jsx)(l.default,{accessibilityLabel:"Search patterns",value:d,onChangeText:c,placeholder:`Search ${y.length} patterns`,placeholderTextColor:o.C.muted,autoCorrect:!1,style:[o.s.input,{minHeight:40,fontSize:13}]}),(0,h.jsx)(a.default,{role:"radiogroup","aria-label":"Pattern",style:[o.s.row,{flexWrap:'wrap',gap:6}],children:b.map(e=>(0,h.jsx)(o.Chip,{label:e.name,active:r===e.id,onPress:()=>i(e.id)},e.id))}),!f.length&&(0,h.jsxs)(o.T,{style:{fontSize:12,color:o.C.muted},children:["No pattern matches \u201c",d.trim(),"\u201d."]}),f.length>b.length&&(0,h.jsxs)(o.T,{style:{fontSize:11,color:o.C.muted},children:["Showing ",b.length," of ",f.length," \u2014 keep typing to narrow it down."]})]})}function O({data:e,minTrades:t}){const r=(e.rows||[]).slice(0,5),l=e.strategy;return(0,h.jsxs)(a.default,{style:{gap:14},children:[(0,h.jsxs)(a.default,{style:[o.s.row,{flexWrap:'wrap',gap:18}],children:[(0,h.jsxs)(a.default,{children:[(0,h.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Found"}),(0,h.jsx)(o.T,{style:{fontFamily:'ManropeBold',fontSize:26,lineHeight:33},children:e.total??r.length}),(0,h.jsxs)(o.T,{style:{fontSize:11,color:o.C.muted},children:[e.universe?.label||'Universe',e.universe?.count?` \xb7 ${e.universe.count}
1002 stocks`:'']})]}),l&&(0,h.jsxs)(a.default,{children:[(0,h.jsxs)(o.T,{style:{fontSize:11,color:o.C.muted},children:["Positive 95% low (n \u2265 ",t,")"]}),(0,h.jsx)(o.T,{style:{fontFamily:'ManropeBold',fontSize:26,lineHeight:33},children:l.positive_low_count??'\u2014'})]}),l&&(0,h.jsxs)(a.default,{children:[(0,h.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Tested exit rule"}),(0,h.jsx)(o.T,{style:{fontFamily:'ManropeBold',fontSize:26,lineHeight:33,color:l.tested_count?o.C.ink:o.C.muted},children:l.tested_count??'\u2014'}),(0,h.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:l.tested_count?'rows with a later-test':'not tested'})]})]}),(0,h.jsxs)(a.default,{style:[o.s.row,{flexWrap:'wrap',gap:8}],children:[(0,h.jsx)(o.Badge,{label:'stored_scan'===e.source?'Stored scan':String(e.source||''),tone:"neutral"}),(0,h.jsx)(o.Badge,{label:`Data to ${e.data_end?(0,d.dateText)(e.data_end):'unknown'}${null!=e.age_days?` \xb7 ${e.age_days}d old`:''}`,tone:e.stale?'amber':'green'}),e.stale&&(0,h.jsx)(o.Badge,{label:"Stale \u2014 research only",tone:"amber"})]}),r.length?(0,h.jsx)(s.default,{horizontal:!0,contentContainerStyle:{minWidth:'100%'},children:(0,h.jsxs)(a.default,{role:"table","aria-label":"Top 5 by 95% low",style:{minWidth:640,flex:1},children:[(0,h.jsx)(a.default,{role:"row",style:[o.s.row,{gap:10,paddingVertical:8,borderBottomWidth:1,borderColor:o.C.line}],children:[['Symbol',1.3],['95% low',.8],['Avg',.8],['n',.9],['Evidence basis',2.4]].map(([e,t])=>(0,h.jsx)(o.T,{role:"columnheader",style:[o.s.label,{flex:t,fontSize:10}],children:e},String(e)))}),r.map(e=>{const r=e.n<t;return(0,h.jsxs)(a.default,{role:"row",style:[o.s.row,{gap:10,minHeight:46,paddingVertical:6,borderBottomWidth:1,borderColor:o.C.line}],children:[(0,h.jsxs)(a.default,{role:"cell",style:{flex:1.3,minWidth:0},children:[(0,h.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:13},children:e.symbol}),(0,h.jsx)(o.T,{numberOfLines:1,style:{fontSize:11,lineHeight:16,color:o.C.muted},children:e.company})]}),(0,h.jsx)(o.T,{role:"cell",style:{flex:.8,fontSize:13,color:null==e.low_pct?o.C.muted:e.low_pct>0?o.C.green:o.C.red},children:(0,d.pct)(e.low_pct)}),(0,h.jsx)(o.T,{role:"cell",style:{flex:.8,fontSize:13},children:(0,d.pct)(e.avg_pct)}),(0,h.jsxs)(a.default,{role:"cell",style:{flex:.9},children:[(0,h.jsx)(o.T,{style:{fontSize:13},children:e.n}),(0,h.jsx)(o.T,{style:{fontSize:10,lineHeight:14,color:r?o.C.amber:o.C.muted},children:r?`below min ${t}`:e.sample_label})]}),(0,h.jsx)(o.T,{role:"cell",style:{flex:2.4,fontSize:12,color:'tested_rule'===e.evidence_basis?o.C.green:o.C.muted},children:j[e.evidence_basis]||'Not tested'})]},e.match_id||e.symbol)})]})}):(0,h.jsxs)(o.T,{style:{color:o.C.muted},children:["No stock in ",e.universe?.label||'the universe'," matches this strategy on data to ",e.data_end?(0,d.dateText)(e.data_end):'the latest scan',"."]})]})}},909,[11,13,375,278,385,252,198,821,197,893,910,6]); 1003__d(function(g,_r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"patchSupported",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"adminApi",{enumerable:!0,get:function(){return s}}),_r(_d[0]);var e=_r(_d[1]);const t=!0;function r(e,t){return'string'==typeof e?.error?e.error:Array.isArray(e?.detail)?e.detail.map(e=>[Array.isArray(e?.loc)?e.loc.filter(e=>'body'!==e).join('.'):'',e?.msg].filter(Boolean).join(': ')).join(' \xb7 ')||`Request failed (${t})`:'string'==typeof e?.detail?e.detail:`Request failed (${t})`}async function o(t,o){const n=await(0,e.api)('/api/auth/me'),s=new AbortController,c=setTimeout(()=>s.abort(),3e4);try{const c=await fetch(e.apiBase+t,{method:'PATCH',signal:s.signal,credentials:'include',headers:{'Content-Type':'application/json',...n?.csrf?{'X-Kanida-CSRF':n.csrf}:{}},body:JSON.stringify(o)});let p={};try{p=await c.json()}catch{}if(!c.ok)throw new e.ApiError(r(p,c.status),c.status,p?.code||'REQUEST_FAILED');return p}catch(t){if('AbortError'===t?.name)throw new e.ApiError('The server took too long to answer. Refresh to check whether the change was saved.',504,'TIMEOUT');throw t}finally{clearTimeout(c)}}const n=e=>encodeURIComponent(e),s={registry:()=>(0,e.api)('/api/admin/strategies'),sources:()=>(0,e.api)('/api/admin/strategy-sources'),createStrategy:t=>(0,e.api)('/api/admin/strategies',t),updateStrategy:(e,t)=>o(`/api/admin/strategies/${n(e)}`,t),preview:t=>(0,e.api)(`/api/admin/strategies/${n(t)}/preview`,{}),createBlock:t=>(0,e.api)('/api/admin/blocks',t),updateBlock:(e,t)=>o(`/api/admin/blocks/${n(e)}`,t)}},910,[136,197]); 1004__d(function(g,r,i,a,m,e,d){"use strict";
1004Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var t=r(d[1]),n=r(d[2]);function u(){return(0,n.jsx)(t.Redirect,{href:"/"})}},911,[11,252,6]); 1005__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.WorkspaceRoute}});var t=r(d[0])},912,[896]); 1006__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.BillingScreen}});var t=r(d[0])},913,[892]); 1007__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.WorkspaceRoute}});var t=r(d[0])},914,[896]); 1008__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Connect}});var t=r(d[0])},915,[916]); 1009__d(function(g,_r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Page=u,_e.Connect=function(){const e=(0,t.useMemo)(()=>{const e=(0,r.default)(0,'M');return e.addData(""),e.make(),e},[""]),p=e.getModuleCount();let f='';for(let t=0;t<p;t++)for(let n=0;n<p;
1009n++)e.isDark(t,n)&&(f+=`M${n+4} ${t+4}h1v1h-1z`);return(0,h.jsxs)(u,{children:[(0,h.jsx)(x,{eyebrow:"KANIDA, WITH YOU",title:"Meet your iPhone app.",detail:"Open the same KANIDA experience in Expo Go, with native navigation and touch controls."}),(0,h.jsxs)(n.default,{style:[d.s.card,{alignItems:'center',padding:30}],children:[(0,h.jsx)(d.Badge,{label:"Expo SDK 57 \xb7 local preview"}),(0,h.jsx)(n.default,{style:{padding:12,backgroundColor:'white',borderRadius:15},children:(0,h.jsxs)(s.default,{accessibilityLabel:"Expo Go connection QR code",width:250,height:250,viewBox:`0 0 ${p+8} ${p+8}`,children:[(0,h.jsx)(l.Rect,{x:"0",y:"0",width:p+8,height:p+8,fill:"white"}),(0,h.jsx)(l.Path,{d:f,fill:d.C.dark})]})}),(0,h.jsx)(d.T,{style:{fontFamily:'ManropeBold',fontSize:22,textAlign:'center'},children:"Scan. Open. Explore."}),(0,h.jsxs)(n.default,{style:{maxWidth:470,gap:18},children:[(0,h.jsx)(c.Rule,{n:"1",title:"Connect to the same Wi-Fi",text:"Keep this computer and your iPhone on the same local network."}),(0,h.jsx)(c.Rule,{n:"2",title:"Install or update Expo Go",text:"Use the current Expo Go app from the iPhone App Store."}),(0,h.jsx)(c.Rule,{n:"3",title:"Scan with your iPhone camera",text:"Point the camera at this QR code, then choose Open in Expo Go. Keep the local servers running."})]}),(0,h.jsx)(d.Button,{label:"Open in Expo Go",icon:"smartphone",onPress:()=>o.default.openURL("")}),(0,h.jsx)(d.T,{selectable:!0,style:{fontSize:12,color:d.C.muted},children:""}),(0,h.jsxs)(d.T,{style:{fontSize:12,color:d.C.muted,textAlign:'center',maxWidth:520},children:["Safari preview: ","https://kanida.ai",". On a different Wi-Fi network, restart the preview script to refresh the local address."]})]})]})};var t=_r(_d[0]),n=e(_r(_d[1])),o=e(_r(_d[2])),l=_r(_d[3]),s=e(l),r=e(_r(_d[4])),d=_r(_d[5]),c=_r(_d[6]),h=_r(_d[7]);function u({children:e}){const t=(0,d.useLayoutMode)(),o='phone'===t;return(0,h.jsx)(n.default,{style:{width:'100%',maxWidth:1390,alignSelf:'center',padding:o?20:'desktop'===t?40:28,gap:o?18:26,paddingBottom:44},children:e})}function x({eyebrow:e,title:t,detail:o,action:l}){const s='phone'===(0,d.useLayoutMode)();return(0,h.jsxs)(n.default,{style:[d.s.between,{alignItems:'flex-start'}],children:[(0,h.jsxs)(n.default,{style:{gap:9,flex:1},children:[!s&&(0,h.jsx)(d.T,{style:d.s.label,children:e}),(0,h.jsx)(d.T,{accessibilityRole:"header",style:[d.s.title,{fontSize:s?30:38,lineHeight:s?39:48}],children:t}),o&&(0,h.jsx)(d.T,{style:{color:d.C.muted,fontSize:13,maxWidth:620},children:o})]}),l]})}},916,[11,13,199,840,917,821,836,6]); 1010__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"qrcode",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"stringToBytes",{enumerable:!0,get:function(){return P}});const t=function(t,e){let n=t;const r=i[e];let o=null,u=0,c=null;const l=[],f={},s=function(t,e){u=4*n+17,o=(function(t){const e=new Array(t);for(let n=0;n<t;n+=1){e[n]=new Array(t);for(let r=0;r<t;r+=1)e[n][r]=null}return e})(u),a(0,0),a(u-7,0),a(0,u-7),y(),d(),L(t,e),n>=7&&x(t),null==c&&(c=I(n,r,l)),D(c,e)},a=function(t,e){for(let n=-1;n<=7;n+=1)if(!(t+n<=-1||u<=t+n))for(let r=-1;r<=7;r+=1)e+r<=-1||u<=e+r||(o[t+n][e+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},h=function(){let t=0,e=0;for(let n=0;n<8;n+=1){s(!0,n);const r=w.getLostPoint(f);(0==n||t>r)&&(t=r,e=n)}return e},d=function(){for(let t=8;t<u-8;t+=1)null==o[t][6]&&(o[t][6]=t%2==0);for(let t=8;t<u-8;t+=1)null==o[6][t]&&(o[6][t]=t%2==0)},y=function(){const t=w.getPatternPosition(n);for(let e=0;e<t.length;e+=1)for(let n=0;n<t.length;n+=1){const r=t[e],i=t[n];if(null==o[r][i])for(let t=-2;t<=2;t+=1)for(let e=-2;e<=2;e+=1)o[r+t][i+e]=-2==t||2==t||-2==e||2==e||0==t&&0==e}},x=function(t){const e=w.getBCHTypeNumber(n);for(let n=0;n<18;n+=1){const r=!t&&1==(e>>n&1);o[Math.floor(n/3)][n%3+u-8-3]=r}for(let n=0;n<18;n+=1){const r=!t&&1==(e>>n&1);o[n%3+u-8-3][Math.floor(n/3)]=r}},L=function(t,e){const n=r<<3|e,i=w.getBCHTypeInfo(n);for(let e=0;e<15;e+=1){const n=!t&&1==(i>>e&1);e<6?o[e][8]=n:e<8?o[e+1][8]=n:o[u-15+e][8]=n}for(let e=0;e<15;e+=1){const n=!t&&1==(i>>e&1);e<8?o[8][u-e-1]=n:e<9?o[8][15-e-1+1]=n:o[8][15-e-1]=n}o[u-8][8]=!t},D=function(t,e){let n=-1,r=u-1,i=7,c=0;const l=w.getMaskFunction(e);for(let e=u-1;e>0;e-=2)for(6==e&&(e-=1);;){for(let n=0;n<2;n+=1)if(null==o[r][e-n]){let u=!1;c<t.length&&(u=1==(t[c]>>>i&1));l(r,e-n)&&(u=!u),o[r][e-n]=u,i-=1,-1==i&&(c+=1,i=7)}if(r+=n,r<0||u<=r){r-=n,n=-n;break}}},S=function(t,e){let n=0,r=0,o=0;const i=new Array(e.length),u=new Array(e.length);for(let c=0;c<e.length;c+=1){const l=e[c].dataCount,f=e[c].totalCount-l;r=Math.max(r,l),o=Math.max(o,f),i[c]=new Array(l);for(let e=0;e<i[c].length;e+=1)i[c][e]=255&t.getBuffer()[e+n];n+=l;const s=w.getErrorCorrectPolynomial(f),a=p(i[c],s.getLength()-1).mod(s);u[c]=new Array(s.getLength()-1);for(let t=0;t<u[c].length;t+=1){const e=t+a.getLength()-u[c].length;u[c][t]=e>=0?a.getAt(e):0}}let c=0;for(let t=0;t<e.length;t+=1)c+=e[t].totalCount;const l=new Array(c);let f=0;for(let t=0;t<r;t+=1)for(let n=0;n<e.length;n+=1)t<i[n].length&&(l[f]=i[n][t],f+=1);for(let t=0;t<o;t+=1)for(let n=0;n<e.length;n+=1)t<u[n].length&&(l[f]=u[n][t],f+=1);return l},I=function(t,e,n){const r=B.getRSBlocks(t,e),o=k();for(let e=0;e<n.length;e+=1){const r=n[e];o.put(r.getMode(),4),o.put(r.getLength(),w.getLengthInBits(r.getMode(),t)),r.write(o)}let i=0;for(let t=0;t<r.length;t+=1)i+=r[t].dataCount;if(o.getLengthInBits()>
10108*i)throw'code length overflow. ('+o.getLengthInBits()+'>'+8*i+')';for(o.getLengthInBits()+4<=8*i&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*i||(o.put(236,8),o.getLengthInBits()>=8*i));)o.put(17,8);return S(o,r)};f.addData=function(t,e){let n=null;switch(e=e||'Byte'){case'Numeric':n=C(t);break;case'Alphanumeric':n=b(t);break;case'Byte':n=A(t);break;case'Kanji':n=M(t);break;default:throw'mode:'+e}l.push(n),c=null},f.isDark=function(t,e){if(t<0||u<=t||e<0||u<=e)throw t+','+e;return o[t][e]},f.getModuleCount=function(){return u},f.make=function(){if(n<1){let t=1;for(;t<40;t++){const e=B.getRSBlocks(t,r),n=k();for(let e=0;e<l.length;e++){const r=l[e];n.put(r.getMode(),4),n.put(r.getLength(),w.getLengthInBits(r.getMode(),t)),r.write(n)}let o=0;for(let t=0;t<e.length;t++)o+=e[t].dataCount;if(n.getLengthInBits()<=8*o)break}n=t}s(!1,h())},f.createTableTag=function(t,e){t=t||2;let n='';n+='<table style="',n+=' border-width: 0px; border-style: none;',n+=' border-collapse: collapse;',n+=' padding: 0px; margin: '+(e=void 0===e?4*t:e)+'px;',n+='">',n+='<tbody>';for(let e=0;e<f.getModuleCount();e+=1){n+='<tr>';for(let r=0;r<f.getModuleCount();r+=1)n+='<td style="',n+=' border-width: 0px; border-style: none;',n+=' border-collapse: collapse;',n+=' padding: 0px; margin: 0px;',n+=' width: '+t+'px;',n+=' height: '+t+'px;',n+=' background-color: ',n+=f.isDark(e,r)?'#000000':'#ffffff',n+=';',n+='"/>';n+='</tr>'}return n+='</tbody>',n+='</table>',n},f.createSvgTag=function(t,e,n,r){let o={};'object'==typeof arguments[0]&&(o=arguments[0],t=o.cellSize,e=o.margin,n=o.alt,r=o.title),t=t||2,e=void 0===e?4*t:e,(n='string'==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||'qrcode-description':null,(r='string'==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||'qrcode-title':null;const i=f.getModuleCount()*t+2*e;let u,c,l,s,a,h='';for(a='l'+t+',0 0,'+t+' -'+t+',0 0,-'+t+'z ',h+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',h+=o.scalable?'':' width="'+i+'px" height="'+i+'px"',h+=' viewBox="0 0 '+i+' '+i+'" ',h+=' preserveAspectRatio="xMinYMin meet"',h+=r.text||n.text?' role="img" aria-labelledby="'+P([r.id,n.id].join(' ').trim())+'"':'',h+='>',h+=r.text?'<title id="'+P(r.id)+'">'+P(r.text)+'</title>':'',h+=n.text?'<description id="'+P(n.id)+'">'+P(n.text)+'</description>':'',h+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',h+='<path d="',l=0;l<f.getModuleCount();l+=1)for(s=l*t+e,u=0;u<f.getModuleCount();u+=1)f.isDark(l,u)&&(c=u*t+e,h+='M'+c+','+s+a);return h+='" stroke="transparent" fill="black"/>',h+='</svg>',h},f.createDataURL=function(t,e){t=t||2,e=void 0===e?4*t:e;const n=f.getModuleCount()*t+2*e,r=e,o=n-e;return v(n,n,function(e,n){if(r<=e&&e<o&&r<=n&&n<o){const o=Math.floor((e-r)/t),i=Math.floor((n-r)/t);return f.isDark(i,o)?0:1}return 1})},f.createImgTag=function(t,e,n){t=t||2,e=void 0===e?4*t:e;const r=f.getModuleCount()*t+2*e;let o='';return o+='<img',o+=' src="',o+=f.createDataURL(t,e),o+='"',o+=' width="',o+=r,o+='"',o+=' height="',o+=r,o+='"',n&&(o+=' alt="',o+=P(n),o+='"'),o+='/>',o};const P=function(t){let e='';for(let n=0;n<t.length;n+=1){const r=t.charAt(n);switch(r){case'<':e+='<';break;case'>':e+='>';break;case'&':e+='&';break;case'"':e+='"';break;default:e+=r}}return e},T=function(t){t=void 0===t?2:t;const e=1*f.getModuleCount()+2*t,n=t,r=e-t;let o,i,u,c,l;const s={'\u2588\u2588':'\u2588','\u2588 ':'\u2580',' \u2588':'\u2584',' ':' '},a={'\u2588\u2588':'\u2580','\u2588 ':'\u2580',' \u2588':' ',' ':' '};let h='';for(o=0;o<e;o+=2){for(u=Math.floor((o-n)/1),c=Math.floor((o+1-n)/1),i=0;i<e;i+=1)l='\u2588',n<=i&&i<r&&n<=o&&o<r&&f.isDark(u,Math.floor((i-n)/1))&&(l=' '),n<=i&&i<r&&n<=o+1&&o+1<r&&f.isDark(c,Math.floor((i-n)/1))?l+=' ':l+='\u2588',h+=t<1&&o+1>=r?a[l]:s[l];h+='\n'}return e%2&&t>0?h.substring(0,h.length-e-1)+Array(e+1).join('\u2580'):h.substring(0,h.length-1)};return f.createASCII=function(t,e){if((t=t||1)<2)return T(e);t-=1,e=void 0===e?2*t:e;const n=f.getModuleCount()*t+2*e,r=e,o=n-e;let i,u,c,l;const s=Array(t+1).join('\u2588\u2588'),a=Array(t+1).join(' ');let h='',d='';for(i=0;i<n;i+=1){for(c=Math.floor((i-r)/t),d='',u=0;u<n;u+=1)l=1,r<=u&&u<o&&r<=i&&i<o&&f.isDark(c,Math.floor((u-r)/t))&&(l=0),d+=l?s:a;for(c=0;c<t;c+=1)h+=d+'\n'}return h.substring(0,h.length-1)},f.renderTo2dContext=function(t,e){e=e||2;const n=f.getModuleCount();for(let r=0;r<n;r++)for(let o=0;o<n;o++)t.fillStyle=f.isDark(r,o)?'black':'white',t.fillRect(o*e,r*e,e,e)},f};t.stringToBytes=function(t){const e=[];for(let n=0;n<t.length;n+=1){const r=t.charCodeAt(n);e.push(255&r)}return e},t.createStringToBytes=function(t,e){const n=(function(){const n=D(t),r=function(){const t=n.read();if(-1==t)throw'eof';return t};let o=0;const i={};for(;;){const t=n.read();if(-1==t)break;const e=r(),u=r()<<8|r();i[String.fromCharCode(t<<8|e)]=u,o+=1}if(o!=e)throw o+' != '+e;return i})(),r='?'.charCodeAt(0);return function(t){const e=[];for(let o=0;o<t.length;o+=1){const i=t.charCodeAt(o);if(i<128)e.push(i);else{const i=n[t.charAt(o)];'number'==typeof i?(255&i)==i?e.push(i):(e.push(i>>>8),e.push(255&i)):e.push(r)}}return e}};const e=1,n=2,r=4,o=8,i={L:1,M:0,Q:3,H:2},u=0,c=1,l=2,f=3,s=4,a=5,h=6,d=7,w=(function(){const t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],i=1335,w=7973,B={},k=function(t){let e=0;for(;0!=t;)e+=1,t>>>=1;return e};return B.getBCHTypeInfo=function(t){let e=t<<10;for(;k(e)-k(i)>=0;)e^=i<<k(e)-k(i);return 21522^(t<<10|e)},B.getBCHTypeNumber=function(t){let e=t<<12;
1010for(;k(e)-k(w)>=0;)e^=w<<k(e)-k(w);return t<<12|e},B.getPatternPosition=function(e){return t[e-1]},B.getMaskFunction=function(t){switch(t){case u:return function(t,e){return(t+e)%2==0};case c:return function(t,e){return t%2==0};case l:return function(t,e){return e%3==0};case f:return function(t,e){return(t+e)%3==0};case s:return function(t,e){return(Math.floor(t/2)+Math.floor(e/3))%2==0};case a:return function(t,e){return t*e%2+t*e%3==0};case h:return function(t,e){return(t*e%2+t*e%3)%2==0};case d:return function(t,e){return(t*e%3+(t+e)%2)%2==0};default:throw'bad maskPattern:'+t}},B.getErrorCorrectPolynomial=function(t){let e=p([1],0);for(let n=0;n<t;n+=1)e=e.multiply(p([1,y.gexp(n)],0));return e},B.getLengthInBits=function(t,i){if(1<=i&&i<10)switch(t){case e:return 10;case n:return 9;case r:case o:return 8;default:throw'mode:'+t}else if(i<27)switch(t){case e:return 12;case n:return 11;case r:return 16;case o:return 10;default:throw'mode:'+t}else{if(!(i<41))throw'type:'+i;switch(t){case e:return 14;case n:return 13;case r:return 16;case o:return 12;default:throw'mode:'+t}}},B.getLostPoint=function(t){const e=t.getModuleCount();let n=0;for(let r=0;r<e;r+=1)for(let o=0;o<e;o+=1){let i=0;const u=t.isDark(r,o);for(let n=-1;n<=1;n+=1)if(!(r+n<0||e<=r+n))for(let c=-1;c<=1;c+=1)o+c<0||e<=o+c||0==n&&0==c||u==t.isDark(r+n,o+c)&&(i+=1);i>5&&(n+=3+i-5)}for(let r=0;r<e-1;r+=1)for(let o=0;o<e-1;o+=1){let e=0;t.isDark(r,o)&&(e+=1),t.isDark(r+1,o)&&(e+=1),t.isDark(r,o+1)&&(e+=1),t.isDark(r+1,o+1)&&(e+=1),0!=e&&4!=e||(n+=3)}for(let r=0;r<e;r+=1)for(let o=0;o<e-6;o+=1)t.isDark(r,o)&&!t.isDark(r,o+1)&&t.isDark(r,o+2)&&t.isDark(r,o+3)&&t.isDark(r,o+4)&&!t.isDark(r,o+5)&&t.isDark(r,o+6)&&(n+=40);for(let r=0;r<e;r+=1)for(let o=0;o<e-6;o+=1)t.isDark(o,r)&&!t.isDark(o+1,r)&&t.isDark(o+2,r)&&t.isDark(o+3,r)&&t.isDark(o+4,r)&&!t.isDark(o+5,r)&&t.isDark(o+6,r)&&(n+=40);let r=0;for(let n=0;n<e;n+=1)for(let o=0;o<e;o+=1)t.isDark(o,n)&&(r+=1);return n+=10*(Math.abs(100*r/e/e-50)/5),n},B})(),y=(function(){const t=new Array(256),e=new Array(256);for(let e=0;e<8;e+=1)t[e]=1<<e;for(let e=8;e<256;e+=1)t[e]=t[e-4]^t[e-5]^t[e-6]^t[e-8];for(let n=0;n<255;n+=1)e[t[n]]=n;const n={glog:function(t){if(t<1)throw'glog('+t+')';return e[t]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return t[e]}};return n})(),p=function(t,e){if(void 0===t.length)throw t.length+'/'+e;const n=(function(){let n=0;for(;n<t.length&&0==t[n];)n+=1;const r=new Array(t.length-n+e);for(let e=0;e<t.length-n;e+=1)r[e]=t[e+n];return r})(),r={getAt:function(t){return n[t]},getLength:function(){return n.length},multiply:function(t){const e=new Array(r.getLength()+t.getLength()-1);for(let n=0;n<r.getLength();n+=1)for(let o=0;o<t.getLength();o+=1)e[n+o]^=y.gexp(y.glog(r.getAt(n))+y.glog(t.getAt(o)));return p(e,0)},mod:function(t){if(r.getLength()-t.getLength()<0)return r;const e=y.glog(r.getAt(0))-y.glog(t.getAt(0)),n=new Array(r.getLength());for(let t=0;t<r.getLength();t+=1)n[t]=r.getAt(t);for(let r=0;r<t.getLength();r+=1)n[r]^=y.gexp(y.glog(t.getAt(r))+e);return p(n,0).mod(t)}};return r},B=(function(){const t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e=function(t,e){const n={};return n.totalCount=t,n.dataCount=e,n},n={},r=function(e,n){switch(n){case i.L:return t[4*(e-1)+0];case i.M:return t[4*(e-1)+1];case i.Q:return t[4*(e-1)+2];case i.H:return t[4*(e-1)+3];default:return}};return n.getRSBlocks=function(t,n){const o=r(t,n);if(void 0===o)throw'bad rs block @ typeNumber:'+t+'/errorCorrectionLevel:'+n;const i=o.length/3,u=[];for(let t=0;t<i;t+=1){const n=o[3*t+0],r=o[3*t+1],i=o[3*t+2];for(let t=0;t<n;t+=1)u.push(e(r,i))}return u},n})(),k=function(){const t=[];let e=0;const n={getBuffer:function(){return t},getAt:function(e){const n=Math.floor(e/8);return 1==(t[n]>>>7-e%8&1)},put:function(t,e){for(let r=0;r<e;r+=1)n.putBit(1==(t>>>e-r-1&1))},getLengthInBits:function(){return e},putBit:function(n){const r=Math.floor(e/8);t.length<=r&&t.push(0),n&&(t[r]|=128>>>e%8),e+=1}};return n},C=function(t){const n=e,r=t,o={getMode:function(){return n},getLength:function(t){return r.length},write:function(t){const e=r;let n=0;for(;n+2<e.length;)t.put(i(e.substring(n,n+3)),10),n+=3;n<e.length&&(e.length-n==1?t.put(i(e.substring(n,n+1)),4):e.length-n==2&&t.put(i(e.substring(n,n+2)),7))}},i=function(t){let e=0;for(let n=0;n<t.length;n+=1)e=10*e+u(t.charAt(n));return e},u=function(t){if('0'<=t&&t<='9')return t.charCodeAt(0)-'0'.charCodeAt(0);throw'illegal char :'+t};return o},b=function(t){const e=n,r=t,o={getMode:function(){return e},getLength:function(t){return r.length},write:function(t){const e=r;let n=0;for(;n+1<e.length;)t.put(45*i(e.charAt(n))+i(e.charAt(n+1)),11),n+=2;n<e.length&&t.put(i(e.charAt(n)),6)}},i=function(t){if('0'<=t&&t<='9')return t.charCodeAt(0)-'0'.charCodeAt(0);if('A'<=t&&t<='Z')return t.charCodeAt(0)-'A'.charCodeAt(0)+10;switch(t){case' ':return 36;case'$':return 37;case'%':return 38;case'*':return 39;case'+':return 40;case'-':return 41;case'.':return 42;case'/':return 43;case':':return 44;default:throw'illegal char :'+t}};return o},A=function(e){const n=r,o=t.stringToBytes(e),i={getMode:function(){return n},getLength:function(t){return o.length},write:function(t){for(let e=0;e<o.length;e+=1)t.put(o[e],8)}};return i},M=function(e){const n=o,r=t.stringToBytes;!(function(){const t=r('\u53cb');if(2!=t.length||38726!=(t[0]<<8|t[1]))throw'sjis not supported.'})();const i=r(e),u={getMode:function(){return n},getLength:function(t){return~~(i.length/2)},write:function(t){const e=i;let n=0;for(;n+1<e.length;){let r=(255&e[n])<<8|255&e[n+1];if(33088<=r&&r<=40956)r-=33088;else{if(!(57408<=r&&r<=60351))throw'illegal char at '+(n+1)+'/'+r;r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13),n+=2}if(n<e.length)throw'illegal char at '+(n+1)}};return u},x=function(){const t=[],e={writeByte:function(e){t.push(255&e)}
1010,writeShort:function(t){e.writeByte(t),e.writeByte(t>>>8)},writeBytes:function(t,n,r){n=n||0,r=r||t.length;for(let o=0;o<r;o+=1)e.writeByte(t[o+n])},writeString:function(t){for(let n=0;n<t.length;n+=1)e.writeByte(t.charCodeAt(n))},toByteArray:function(){return t},toString:function(){let e='';e+='[';for(let n=0;n<t.length;n+=1)n>0&&(e+=','),e+=t[n];return e+=']',e}};return e},L=function(){let t=0,e=0,n=0,r='';const o={},i=function(t){r+=String.fromCharCode(u(63&t))},u=function(t){if(t<0)throw'n:'+t;if(t<26)return 65+t;if(t<52)return t-26+97;if(t<62)return t-52+48;if(62==t)return 43;if(63==t)return 47;throw'n:'+t};return o.writeByte=function(r){for(t=t<<8|255&r,e+=8,n+=1;e>=6;)i(t>>>e-6),e-=6},o.flush=function(){if(e>0&&(i(t<<6-e),t=0,e=0),n%3!=0){const t=3-n%3;for(let e=0;e<t;e+=1)r+='='}},o.toString=function(){return r},o},D=function(t){const e=t;let n=0,r=0,o=0;const i={read:function(){for(;o<8;){if(n>=e.length){if(0==o)return-1;throw'unexpected end of file./'+o}const t=e.charAt(n);if(n+=1,'='==t)return o=0,-1;t.match(/^\s$/)||(r=r<<6|u(t.charCodeAt(0)),o+=6)}const t=r>>>o-8&255;return o-=8,t}},u=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw'c:'+t};return i},S=function(t,e){const n=t,r=e,o=new Array(t*e),i={setPixel:function(t,e,r){o[e*n+t]=r},write:function(t){t.writeString('GIF87a'),t.writeShort(n),t.writeShort(r),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(','),t.writeShort(0),t.writeShort(0),t.writeShort(n),t.writeShort(r),t.writeByte(0);const e=c(2);t.writeByte(2);let o=0;for(;e.length-o>255;)t.writeByte(255),t.writeBytes(e,o,255),o+=255;t.writeByte(e.length-o),t.writeBytes(e,o,e.length-o),t.writeByte(0),t.writeString(';')}},u=function(t){const e=t;let n=0,r=0;const o={write:function(t,o){if(t>>>o!=0)throw'length over';for(;n+o>=8;)e.writeByte(255&(t<<n|r)),o-=8-n,t>>>=8-n,r=0,n=0;r|=t<<n,n+=o},flush:function(){n>0&&e.writeByte(r)}};return o},c=function(t){const e=1<<t,n=1+(1<<t);let r=t+1;const i=l();for(let t=0;t<e;t+=1)i.add(String.fromCharCode(t));i.add(String.fromCharCode(e)),i.add(String.fromCharCode(n));const c=x(),f=u(c);f.write(e,r);let s=0,a=String.fromCharCode(o[s]);for(s+=1;s<o.length;){const t=String.fromCharCode(o[s]);s+=1,i.contains(a+t)?a+=t:(f.write(i.indexOf(a),r),i.size()<4095&&(i.size()==1<<r&&(r+=1),i.add(a+t)),a=t)}return f.write(i.indexOf(a),r),f.write(n,r),f.flush(),c.toByteArray()},l=function(){const t={};let e=0;const n={add:function(r){if(n.contains(r))throw'dup key:'+r;t[r]=e,e+=1},size:function(){return e},indexOf:function(e){return t[e]},contains:function(e){return void 0!==t[e]}};return n};return i},v=function(t,e,n){const r=S(t,e);for(let o=0;o<e;o+=1)for(let e=0;e<t;e+=1)r.setPixel(e,o,n(e,o));const o=x();r.write(o);const i=L(),u=o.toByteArray();for(let t=0;t<u.length;t+=1)i.writeByte(u[t]);return i.flush(),'data:image/gif;base64,'+i};var I=t;const P=t.stringToBytes},917,[]); 1011__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}}),r(d[0]);
1011var t=r(d[1]),u=r(d[2]),n=r(d[3]),c=r(d[4]),o=r(d[5]);function f(){const f=(0,u.useAuth)();return f?.ready?(0,n.uxPreview)(f.config)?(0,o.jsx)(c.StudioPage,{}):(0,o.jsx)(t.Redirect,{href:"/derivative"}):null}},918,[11,252,198,881,919,6]); 1012__d(function(_g,r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TOOLS",{enumerable:!0,get:function(){return P}}),_e.dockScale=function(e,n){if(null==n)return 1;const t=Math.abs(e-n);return 0===t?1.14:1===t?1.05:1},Object.defineProperty(_e,"glass",{enumerable:!0,get:function(){return z}}),_e.DockBar=R,_e.StudioPage=function(){const{width:e}=(0,l.default)(),t=e<1180,a=e<760,[g,y]=(0,n.useState)(()=>{const e=(0,d.readStore)(I,'tool').id;return P.some(n=>n.id===e)?e:'oi'}),b=(0,n.useCallback)(e=>{y(e),(0,d.writeStore)(I,'tool',{id:e})},[]),f=(0,i.useLocalSearchParams)();(0,n.useEffect)(()=>{const e=String(f.tool||'');e&&P.some(n=>n.id===e)&&b(e)},[f.tool]);const x=(0,p.useInstrument)(),j=x.u,k=x.exp,v=x.setExp,S=(0,n.useCallback)(e=>x.setU(e),[]),C=(0,c.usePinnedReading)(!0),H=C.at,M=C.seq,T='done'===C.phase||'error'===C.phase,[z,L]=(0,n.useState)(null),_=(0,n.useCallback)(e=>L(n=>n===e?n:e),[]),[W,F]=(0,n.useState)({mode:'oi',window:'prev_close'}),D=(0,n.useCallback)(e=>F(n=>n.mode===e.mode&&n.window===e.window?n:e),[]),B=(0,u.useSharedRead)('/api/derivatives/filters',0),V=B.data?.underlyings;(0,n.useEffect)(()=>{if(V&&V.length&&!V.some(e=>e.underlying===j)){const e=V.find(e=>e.underlying===h.WIP_UNDERLYING)||V.find(e=>e.is_index)||V[0];e&&e.underlying!==j&&S(e.underlying)}},[V,j,S]);const G={underlying:j,expiry:k,at:H,seq:M,onPick:S,highlight:z,onHighlight:_,link:W,onView:D},U=P.find(e=>e.id===g)||P[0],N=(0,n.useCallback)(e=>b('chain'===e?'chain':'gallery'===e?'gallery':'scratch'===e?'scratch':e),[b]),[Y,A]=(0,n.useState)(!1),q=a?10:16,[J,K]=(0,n.useState)(0),Q={style:{height:J||420},sh:G,expanded:Y,onExpand:()=>A(e=>!e),onClose:()=>b('oi')},X=!1!==V?.find(e=>e.underlying===j)?.is_index,Z=U.render?U.render({...Q,isIndex:X}):E[U.widget]?.render(Q);return(0,w.jsx)(p.StudioOpen.Provider,{value:N,children:(0,w.jsxs)(o.default,{style:{flex:1,minHeight:0,backgroundColor:s.C.bg,padding:q,paddingTop:8,gap:8},children:[(0,w.jsx)(R,{active:U.id,onPick:e=>{b(e),A(!1)},underlying:j,onUnderlying:S,expiry:k,onExpiry:v,compact:t,filters:B.data}),O.has(U.id)&&(0,w.jsxs)(o.default,{style:[s.s.row,{gap:10,alignItems:'center',paddingHorizontal:4,zIndex:50}],children:[(0,w.jsx)(h.SymbolSearch,{value:j,onPick:S,data:B.data}),(0,w.jsx)(h.ExpiryPicker,{underlying:j,value:k,onPick:v,data:B.data})]}),(0,w.jsx)(o.default,{style:{flex:1,minHeight:0,overflow:'hidden'},onLayout:e=>{const n=Math.round(e.nativeEvent.layout.height);K(e=>Math.abs(e-n)<2?e:n)},children:J>0&&(T?(0,w.jsx)(o.default,{style:{height:J},children:Z},U.id):(0,w.jsx)(o.default,{style:{height:J,alignItems:'center',justifyContent:'center'},children:(0,w.jsx)(s.T,{style:{fontSize:12,lineHeight:16,color:s.C.muted},children:"Finding the latest reading\u2026"})}))})]})})};var n=r(_d[0]),t=e(n),i=r(_d[1]),a=e(r(_d[2])),o=e(r(_d[3])),l=e(r(_d[4]));r(_d[5]);var s=r(_d[6]),d=r(_d[7]),c=r(_d[8]),u=r(_d[9]),h=r(_d[10]),g=r(_d[11]),y=r(_d[12]),b=r(_d[13]),f=r(_d[14]),p=r(_d[15]),x=r(_d[16]),j=r(_d[17]),k=r(_d[18]),v=r(_d[19]),S=r(_d[20]),w=r(_d[21]);const C=e=>(0,w.jsx)(o.default,{style:{flex:1,minHeight:0},children:e}),I='derivative-studio',O=new Set(['oi','multi','chain','maxpain']),P=[{id:'oi',name:'Open interest',icon:'bar-chart-2',tint:'green',blurb:'Open interest and its change by strike, implied volatility now and before, and what the readings show',render:e=>(0,w.jsx)(g.OiStudioTool,{...e})},{id:'multi',name:'Multi-strike',icon:'grid',tint:'blue',blurb:'The strikes around the money through the day: OI, \u0394OI, IV and price, with what they show',render:e=>(0,w.jsx)(y.MultiStrikeTool,{...e})},{id:'chain',name:'Option chain',icon:'list',tint:'ink',blurb:'The chain as a terminal or a simple table, with a heatmap of OI, volume or the Greeks beside it',render:e=>(0,w.jsx)(b.ChainTool,{...e})},{id:'maxpain',name:'Max pain',icon:'target',tint:'amber',blurb:'Spot against Max Pain through the day, with futures and ATM IV - and which one is moving toward the other',render:e=>(0,w.jsx)(f.MaxPainTool,{...e})},{id:'mine',name:'My strategies',icon:'folder',tint:'ink',blurb:'Your saved strategies',render:()=>C((0,w.jsx)(x.Home,{}))},{id:'scratch',name:'Build from scratch',icon:'edit-2',tint:'green',blurb
1012:'Build a strategy leg by leg from the chain',render:()=>C((0,w.jsx)(j.ScratchDesk,{}))},{id:'gallery',name:'Strategy gallery',icon:'grid',tint:'mint',blurb:'Ready-made strategies ranked by risk and reward',render:()=>C((0,w.jsx)(k.StrategyGallery,{}))},{id:'movers',name:'Market movers',icon:'trending-up',tint:'blue',blurb:'Top gainers, losers, sectors and volume shockers',render:()=>C((0,w.jsx)(v.MarketMovers,{}))},{id:'oscreener',name:'Options screener',icon:'sliders',tint:'purple',blurb:'Screen every F&O underlying by OI, IV and Greeks',render:()=>C((0,w.jsx)(S.OptionsScreener,{}))}],H=['movers','oscreener','oi','chain','multi','maxpain','gallery','scratch','mine'],M=['FIND','ANALYSE','BUILD'],T={movers:0,oscreener:0,oi:1,chain:1,multi:1,maxpain:1,gallery:2,scratch:2,mine:2};P.sort((e,n)=>H.indexOf(e.id)-H.indexOf(n.id));const E=Object.fromEntries(h.WIDGETS.map(e=>[e.id,e]));const z=()=>({backgroundColor:s.C.glass,borderWidth:1,borderColor:s.C.glassLine,backdropFilter:'blur(18px) saturate(140%)',WebkitBackdropFilter:'blur(18px) saturate(140%)'});function L({tool:e,index:n,hovered:t,active:i,onHover:o,onPress:l}){const d=s.C[e.tint],c=t===n;return(0,w.jsxs)(a.default,{accessibilityRole:"tab",accessibilityLabel:e.name,accessibilityHint:e.blurb,accessibilityState:{selected:i},title:e.blurb,onHoverIn:()=>o(n),onHoverOut:()=>o(null),onPress:l,style:{flexDirection:'column',alignItems:'center',justifyContent:'center',gap:3,height:50,minWidth:76,paddingHorizontal:8,borderRadius:10,marginHorizontal:2,backgroundColor:i?s.C.soft:c?s.C.dark:'transparent',borderWidth:1,borderColor:i?s.C.green:'transparent',transform:[{translateY:c&&!i?-1:0}]},children:[(0,w.jsx)(s.Icon,{name:e.icon,size:18,color:i?s.C.green:d}),(0,w.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:14,fontFamily:i?'InterSemi':'InterMedium',color:i?s.C.green:s.C.ink},children:e.name})]})}function R({active:e,onPick:i,underlying:a,onUnderlying:l,expiry:d,onExpiry:c,compact:u,filters:h}){const[g,y]=(0,n.useState)(null);return(0,w.jsx)(o.default,{style:{alignItems:'center',zIndex:60},children:(0,w.jsx)(o.default,{onPointerLeave:()=>y(null),style:[s.s.row,z(),{gap:0,borderRadius:14,paddingHorizontal:6,paddingVertical:5,flexWrap:u?'wrap':'nowrap',justifyContent:'center',maxWidth:'100%'}],children:(0,w.jsx)(o.default,{accessibilityRole:"tablist",style:[s.s.row,{gap:0,flexWrap:u?'wrap':'nowrap',justifyContent:'center'}],children:[0,1,2].map(n=>(0,w.jsxs)(t.default.Fragment,{children:[n>0&&(0,w.jsx)(o.default,{style:{width:2,alignSelf:'stretch',marginVertical:4,marginHorizontal:10,borderRadius:1,backgroundColor:s.C.blue,shadowColor:s.C.blue,shadowOpacity:.9,shadowRadius:6}}),(0,w.jsxs)(o.default,{style:{alignItems:'center'},children:[(0,w.jsx)(s.T,{style:{fontSize:11,lineHeight:11,letterSpacing:2.2,fontFamily:'InterSemi',color:s.C.blue,marginBottom:1},children:M[n]}),(0,w.jsx)(o.default,{style:[s.s.row,{gap:0}],children:P.map((t,a)=>T[t.id]!==n?null:(0,w.jsx)(L,{tool:t,index:a,hovered:g,active:t.id===e,onHover:y,onPress:()=>i(t.id)},t.id))})]})]},n))})})})}},919,[11,252,375,13,400,136,821,871,920,921,922,957,964,968,971,974,975,987,997,998,999,6]); 1013__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useDerivativeRead=function(n,u=0){const[s,o]=(0,e.useState)({path:'',data:null,error:'',phase:'idle'}),l=(0,e.useRef)(0),c=(0,e.useRef)(null),d=(0,e.useCallback)(()=>{const e=++l.current;if(c.current?.abort(),!n)return c.current=null,void o({path:'',data:null,error:'',phase:'idle'});const u=new AbortController;c.current=u,o({path:n,data:null,error:'',phase:'loading'}),(0,t.api)(n,void 0,void 0,u.signal).then(t=>{e===l.current&&o({path:n,data:t,error:'',phase:'done'})},t=>{e!==l.current||u.signal.aborted||o({path:n,data:null,error:t?.message||'Unable to load',phase:'error'})})},[n]);(0,e.useEffect)(()=>(d(),()=>{l.current++,c.current?.abort(),c.current=null}),[d,u]);const f=s.path===(n||'');return{data:f?s.data:null,error:f?s.error:'',phase:f?s.phase:n?'loading':'idle',reload:d}},Object.defineProperty(_e,"LIVE_POLL_MS",{enumerable:!0,get:function(){return n}}),_e.visiblePoll=s,_e.readingAdvanced=o,_e.useFollowLatest=function(u,l){const c=(0,e.useRef)(''),d=(0,e.useRef)(l);d.current=l,(0,e.useEffect)(()=>
1013{if(!u)return;let e=!0;const l=s(()=>{(0,t.api)('/api/derivatives/status').then(t=>{if(!e)return;const n=String(t?.as_of||'');o(c.current,n)&&d.current(),n&&(c.current=n)},()=>{})},n);return()=>{e=!1,l()}},[u])},_e.usePinnedReading=function(u=!0){const[l,c]=(0,e.useState)({at:'',phase:'loading',seq:0}),d=(0,e.useRef)(''),f=(0,e.useCallback)(()=>{(0,t.api)('/api/derivatives/status').then(e=>{const t=String(e?.as_of||''),n=o(d.current,t);t&&(d.current=t),c(e=>({at:t||e.at,phase:'done',seq:n?e.seq+1:e.seq}))},e=>c(e=>'done'===e.phase?e:{...e,phase:'error'}))},[]);(0,e.useEffect)(()=>{if(!u)return;let e=!0;const t=s(()=>{e&&f()},n);return()=>{e=!1,t()}},[u,f]);const p=(0,e.useCallback)(()=>{c(e=>({...e,seq:e.seq+1}))},[]);return{...l,reload:p}};var e=r(_d[0]),t=r(_d[1]);const n=3e4,u=()=>'undefined'==typeof document||'visible'===document.visibilityState;function s(e,t){let n=null;const s=()=>{n&&(clearInterval(n),n=null)},o=()=>{s(),n=setInterval(e,t)},l=()=>{u()?(e(),o()):s()};return e(),u()&&o(),'undefined'!=typeof document&&document.addEventListener('visibilitychange',l),()=>{s(),'undefined'!=typeof document&&document.removeEventListener('visibilitychange',l)}}function o(e,t){return!!e&&!!t&&t!==e}},920,[11,197]); 1014__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useSharedRead=function(t,s=0){const[,u]=(0,e.useState)(0),d=t?l(t,s):'',c=(0,e.useRef)(d);c.current=d,(0,e.useEffect)(()=>{if(!d||!t)return;let e=n.get(d);e||(e={data:null,error:'',phase:'idle',controller:null,subs:new Set,gen:0},n.set(d,e));const l=()=>u(e=>e+1);return e.subs.add(l),'idle'===e.phase?o(d,t,e):l(),()=>{const e=n.get(d);e&&(e.subs.delete(l),e.subs.size||(e.controller?.abort(),n.delete(d)))}},[d,t]);const h=(0,e.useCallback)(()=>{const e=c.current,l=e?n.get(e):null;l&&t&&o(e,t,l)},[t]),p=d?n.get(d):null;
1014return t?p?{data:p.data??null,error:p.error,phase:'idle'===p.phase?'loading':p.phase,reload:h}:{data:null,error:'',phase:'loading',reload:h}:{data:null,error:'',phase:'idle',reload:h}},_e.sharedReadCount=function(){return n.size};var e=r(_d[0]),t=r(_d[1]);const n=new Map,l=(e,t)=>`${t}|${e}`;function o(e,n,l){l.controller?.abort();const o=new AbortController,u=++l.gen;l.controller=o,l.data=null,l.error='',l.phase='loading',s(l),(0,t.api)(n,void 0,void 0,o.signal).then(e=>{l.gen===u&&(l.data=e,l.error='',l.phase='done',l.controller=null,s(l))},e=>{l.gen!==u||o.signal.aborted||(l.data=null,l.error=e?.message||'Unable to load',l.phase='error',l.controller=null,s(l))})}const s=e=>{for(const t of e.subs)try{t()}catch{}}},921,[11,197]); 1015__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WIP_UNDERLYING",{enumerable:!0,get:function(){return k}}),_e.ResizableBox=function({id:e,initial:n,min:r,maxW:i,children:o}){const[s,u]=(0,t.useState)(()=>{const t=(0,d.readStore)(z,e);return{w:T(t.w,n.w),h:T(t.h,n.h)}}),c=(0,t.useRef)(s);c.current=s,(0,t.useEffect)(()=>{const t=setTimeout(()=>(0,d.writeStore)(z,e,s),300);return()=>clearTimeout(t)},[s.w,s.h]);const h=(0,t.useRef)(null),p=E(s.w,r.w,Math.max(r.w,i)),y=t=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{$(!0),h.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,w:p,h:c.current.h}},onResponderMove:e=>{const n=h.current;n&&u({w:'y'===t?n.w:E(n.w+e.nativeEvent.pageX-n.x,r.w,Math.max(r.w,i)),h:'x'===t?n.h:Math.max(r.h,n.h+e.nativeEvent.pageY-n.y)})},onResponderRelease:()=>{$(!1),h.current=null,(0,d.writeStore)(z,e,c.current)},onResponderTerminate:()=>{$(!1),h.current=null,(0,d.writeStore)(z,e,c.current)}});return(0,R.jsxs)(a.default,{style:{width:p,height:s.h},children:[o({w:p,h:s.h}),(0,R.jsx)(a.default,{...y('x'),accessibilityLabel:"Drag to change the width",style:{position:'absolute',top:0,bottom:16,right:-6,width:12,cursor:'ew-resize'}}),(0,R.jsx)(a.default,{...y('y'),accessibilityLabel:"Drag to change the height",style:{position:'absolute',left:0,right:16,bottom:-6,height:12,cursor:'ns-resize'}}),(0,R.jsx)(a.default,{...y('xy'),accessibilityLabel:"Drag to change the width and height",style:{position:'absolute',right:-6,bottom:-6,width:22,height:22,cursor:'nwse-resize',alignItems:'center',justifyContent:'center'},children:(0,R.jsx)(a.default,{style:{width:10,height:10,borderRightWidth:2,borderBottomWidth:2,borderColor:l.C.muted,borderBottomRightRadius:3}})})]})},_e.matchUnderlyings=function(e,t,n=8){const r=t.trim().toUpperCase();return e.filter(e=>r?e.underlying.toUpperCase().includes(r):e.is_index).sort((e,t)=>+t.is_index-+e.is_index||+t.underlying.toUpperCase().startsWith(r)-+e.underlying.toUpperCase().startsWith(r)||e.underlying.localeCompare(t.underlying)).slice(0,n)},_e.SymbolSearch=M,_e.ExpiryPicker=P,_e.OiByStrikeWidget=A,_e.SplitBlock=function({id:e,maxW:n,left:r,right:i,initialH:o=560,minH:s=380}){const u=(0,d.readStore)(z,e),[c,h]=(0,t.useState)(()=>E(T(u.f,.55),.25,.75)),[p,y]=(0,t.useState)(()=>Math.max(s,T(u.h,o))),f=(0,t.useRef)({f:c,h:p});f.current={f:c,h:p},(0,t.useEffect)(()=>{const t=setTimeout(()=>(0,d.writeStore)(z,e,{f:c,h:p}),300);return()=>clearTimeout(t)},[c,p]);const x=(0,t.useRef)(null),b=Math.max(0,n),C=Math.round((b-10)*c),v=b-10-C,S=t=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{$(!0),x.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,f:f.current.f,h:f.current.h}},onResponderMove:e=>{const n=x.current;n&&('x'===t?h(E(n.f+(e.nativeEvent.pageX-n.x)/Math.max(1,b-10),.25,.75)):y(Math.max(s,n.h+e.nativeEvent.pageY-n.y)))},onResponderRelease:()=>{$(!1),x.current=null,(0,d.writeStore)(z,e,f.current)},onResponderTerminate:()=>{$(!1),x.current=null,(0,d.writeStore)(z,e,f.current)}});return(0,R.jsxs)(a.default,{style:{width:b,height:p},children:[(0,R.jsxs)(a.default,{style:{flexDirection:'row',height:p},children:[(0,R.jsx)(a.default,{style:{width:C,height:p},children:r({w:C,h:p})}),(0,R.jsx)(a.default,{...S('x'),accessibilityLabel:"Drag to share the width between the two widgets",style:{width:10,alignItems:'center',justifyContent:'center',cursor:'col-resize'},children:(0,R.jsx)(a.default,{style:{width:3,height:36,borderRadius:2,backgroundColor:l.C.line}})}),(0,R.jsx)(a.default,{style:{width:v,height:p},children:i({w:v,h:p})})]}),(0,R.jsx)(a.default,{...S('y'),accessibilityLabel:"Drag to change the height",style:{position:'absolute',left:0,right:0,bottom:-6,height:12,cursor:'ns-resize',alignItems:'center',justifyContent:'center'},children:(0,R.jsx)(a.default,{style:{width:36,height:3,borderRadius:2,backgroundColor:l.C.line}})})]})},_e.SplitRow=U,Object.defineProperty(_e,"WIDGETS",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(_e,"DEFAULT_LAYOUT",{enumerable:!0,get:function(){return G}}),_e.cleanLayout=V,_e.dropWidget=K,_e.moveWidget=Z,_e.WipPage=function(){const{width:e,height:o}=(0,s.default)(),p=e<760,[y,f]=(0,t.useState)(0),[x,b]=(0,t.useState)(''),[C,v]=(0,t.useState)(!1),[S,j]=(0,t.useState)(()=>{const e=(0,d.readStore)(z,'layouts');if(e&&e.names&&'object'==typeof e.names&&Object.keys(e.names).length){const t={};for(const n of Object.keys(e.names))t[n]=V(e.names[n]);return{names:t,active:t[e.active]?e.active:Object.keys(t)[0]}}const t=(0,d.readStore)(z,'layout');let n=V(t.blocks);if(t.blocks){const e=new Set(Array.isArray(t.known)?t.known:['oi_chart','oi_grid','chain','signal','summary']),r=Y.map(e=>e.id).filter(t=>!e.has(t)&&!n.flat().includes(t));r.length&&(n=[...n,r])}return{names:{Standard:n},active:'Standard'}}),w=(0,t.useRef)(null),[T,E]=(0,t.useState)(''),$=(0,t.useRef)(null),W=e=>{null!=w.current&&(clearTimeout($.current),$.current=setTimeout(async()=>
1015{const t=await(0,u.apiSend)('/api/me/layouts/derivative-studio','PUT',{expected_version:w.current,names:e.names,active:e.active});return t.ok&&t.data?(w.current=Number(t.data.version)||w.current,void E('')):409===t.status&&t.data?.current?(_(t.data.current),void E('updated')):void E('device')},600))},_=e=>{const t={};for(const n of Object.keys(e?.names||{}))t[n]=V(e.names[n]);if(w.current=Number(e?.version)||0,!Object.keys(t).length)return!1;const n={names:t,active:t[e.active]?e.active:Object.keys(t)[0]};return j(n),(0,d.writeStore)(z,'layouts',n),!0};(0,t.useEffect)(()=>{let e=!0;return(0,u.apiSend)('/api/me/layouts/derivative-studio','GET').then(t=>{e&&(t.ok&&t.data?_(t.data)||(w.current=Number(t.data.version)||0,W(S)):E('device'))}),()=>{e=!1}},[]);const A=(0,t.useCallback)(e=>{j(e),(0,d.writeStore)(z,'layouts',e),W(e)},[]),F=S.names[S.active]||G,L=(0,t.useCallback)(e=>A({...S,names:{...S.names,[S.active]:e}}),[S,A]),[N,D]=(0,t.useState)(()=>'screener'===(0,d.readStore)(z,'tab').t?'screener':'analyzer'),O=e=>{D(e),(0,d.writeStore)(z,'tab',{t:e})},[q,B]=(0,t.useState)(()=>{const e=(0,d.readStore)(z,'oi_symbol').u;return'string'==typeof e&&e?e:k}),[Q,ne]=(0,t.useState)(''),re=(0,c.usePinnedReading)(!0),ie=re.at,oe=re.seq,ae='done'===re.phase||'error'===re.phase,se=(0,t.useCallback)(e=>
1015{B(e),ne(''),(0,d.writeStore)(z,'oi_symbol',{u:e})},[]),[le,de]=(0,t.useState)(null),ue=(0,t.useCallback)(e=>de(t=>t===e?t:e),[]),[ce,he]=(0,t.useState)({mode:'oi',window:'prev_close'}),ge=(0,t.useCallback)(e=>he(t=>t.mode===e.mode&&t.window===e.window?t:e),[]),pe=(0,h.useSharedRead)('/api/derivatives/filters',0),ye=pe.data?.underlyings;(0,t.useEffect)(()=>{if(ye&&ye.length&&!ye.some(e=>e.underlying===q)){const e=ye.find(e=>e.underlying===k)||ye.find(e=>e.is_index)||ye[0];e&&e.underlying!==q&&se(e.underlying)}},[ye,q,se]);const fe={underlying:q,expiry:Q,at:ie,seq:oe,onPick:se,highlight:le,onHighlight:ue,link:ce,onView:ge},xe=Math.max(0,(y||e)-2*(p?12:H)),me=new Set(F.flat()),be=Y.filter(e=>!me.has(e.id)),{drag:Ce,grip:ve}=ee((e,t)=>L(K(F,e,t))),Se=(e,t)=>({style:t,sh:fe,expanded:x===e,onExpand:()=>b(t=>t===e?'':e),onClose:()=>{b(''),L(Z(F,e,null))}}),je=(0,R.jsx)(a.default,{style:{gap:10,zIndex:60},children:(0,R.jsxs)(a.default,{style:[l.s.row,{gap:12,flexWrap:'wrap',zIndex:61}],children:[(0,R.jsx)(a.default,{style:{flexDirection:'row',borderRadius:8,borderWidth:1,borderColor:l.C.line,overflow:'hidden'},children:[['analyzer','Analyzer'],['screener','Option screener']].map(([e,t],n)=>{const i=N===e;return(0,R.jsx)(r.default,{accessibilityRole:"tab",accessibilityState:{selected:i},onPress:()=>O(e),style:e=>[{height:32,paddingHorizontal:14,justifyContent:'center',borderLeftWidth:n?1:0,borderColor:l.C.line,backgroundColor:i?l.C.soft:e.hovered?l.C.dark:'transparent'}],children:(0,R.jsx)(l.T,{style:{fontSize:13,lineHeight:18,fontFamily:i?'InterSemi':'InterMedium',color:i?l.C.green:l.C.ink},children:t})},e)})}),'analyzer'===N&&(0,R.jsx)(M,{value:q,onPick:se,data:pe.data}),'analyzer'===N&&(0,R.jsx)(P,{underlying:q,value:Q,onPick:ne,data:pe.data}),(0,R.jsx)(a.default,{style:{flex:1}}),'analyzer'===N&&!p&&!x&&!!T&&(0,R.jsx)(l.T,{style:{fontSize:11,lineHeight:15,color:'device'===T?l.C.amber:l.C.muted},children:'device'===T?'Layouts saved on this device only':'Layouts updated from your other device'}),'analyzer'===N&&!p&&!x&&(0,R.jsx)(te,{store:S,edit:C,onPick:e=>A({...S,active:e}),onSaveAs:e=>A({names:{...S.names,[e]:F.map(e=>[...e])},active:e}),onDelete:e=>{const t={...S.names};delete t[e];const n=Object.keys(t);A(n.length?{names:t,active:n[0]}:{names:{Standard:G.map(e=>[...e])},active:'Standard'})}}),'analyzer'===N&&!p&&!x&&(C?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(r.default,{onPress:()=>L(G.map(e=>[...e])),style:{height:30,justifyContent:'center',paddingHorizontal:6},children:(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,color:l.C.muted},children:"Reset to default"})}),(0,R.jsxs)(r.default,{accessibilityRole:"button",onPress:()=>v(!1),style:e=>[l.s.row,{gap:6,height:30,paddingHorizontal:12,borderRadius:8,backgroundColor:e.hovered?l.C.mint:l.C.green}],children:[(0,R.jsx)(l.Icon,{name:"check",size:14,color:l.C.bg}),(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:l.C.bg},children:"Done"})]})]}):(0,R.jsxs)(r.default,{accessibilityRole:"button",onPress:()=>v(!0),style:e=>[l.s.row,{gap:6,height:30,paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:l.C.line,backgroundColor:e.hovered?l.C.dark:'transparent'}],children:[(0,R.jsx)(l.Icon,{name:"layout",size:14,color:l.C.ink}),(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterMedium',color:l.C.ink},children:"Edit layout"})]}))]})});if(x&&X[x])return(0,R.jsxs)(i.default,{style:{flex:1,backgroundColor:l.C.bg},contentContainerStyle:{padding:p?12:H,gap:I},children:[je,X[x].render(Se(x,{height:Math.max(520,o-200)}))]});const we=e=>C&&(0,R.jsx)(a.default,{dataSet:{wipZone:String(e)},style:{height:Ce?28:14,borderRadius:8,borderWidth:1,borderStyle:'dashed',borderColor:Ce&&Ce.drop&&'newBlockAt'in Ce.drop&&Ce.drop.newBlockAt===e?l.C.green:l.C.line,alignItems:'center',justifyContent:'center'},children:!!Ce&&(0,R.jsx)(l.T,{style:{fontSize:11,lineHeight:14,color:l.C.muted},children:"Drop here for a new block"})},'z'+e);return'screener'===N?(0,R.jsxs)(i.default,{style:{flex:1,backgroundColor:l.C.bg},contentContainerStyle:{padding:p?12:H,gap:I},children:[je,(0,R.jsxs)(a.default,{style:{borderRadius:12,borderWidth:1,borderStyle:'dashed',borderColor:l.C.line,padding:28,gap:10,alignItems:'flex-start'},children:[(0,R.jsx)(l.T,{style:{fontSize:18,lineHeight:24,fontFamily:'InterSemi',color:l.C.ink},children:"Option screener"}),(0,R.jsx)(l.T,{style:{fontSize:13,lineHeight:20,color:l.C.muted,maxWidth:640},children:"Screen every index and stock with options using indicators you write yourself, for example a trap indicator built from open interest, premium and IV changes. Each result opens in the Analyzer."}),(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:18,color:l.C.muted},children:"Being built next. Until then, pick any instrument in the Analyzer."}),(0,R.jsx)(r.default,{onPress:()=>O('analyzer'),style:e=>[l.s.row,{gap:6,height:32,paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:l.C.green,backgroundColor:e.hovered?l.C.soft:'transparent'}],children:(0,R.jsx)(l.T,{style:{fontSize:13,lineHeight:18,fontFamily:'InterSemi',color:l.C.green},children:"Open the Analyzer"})})]})]}):(0,R.jsxs)(a.default,{style:{flex:1},children:[(0,R.jsxs)(i.default,{style:{flex:1,backgroundColor:l.C.bg},contentContainerStyle:{padding:p?12:H,gap:I},onLayout:e=>f(Math.round(e.nativeEvent.layout.width)),children:[je,C&&(0,R.jsxs)(a.default,{style:[l.s.row,{gap:8,flexWrap:'wrap',padding:10,borderRadius:10,borderWidth:1,borderColor:l.C.line,backgroundColor:l.C.paper}],children:[(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,color:l.C.muted},children:be.length?'Not on the page - drag one in:':'Drag a widget by its bar to move it. Drop it beside another widget, or on a dashed gap for a new block.'}),be.map(e=>(0,R.jsxs)(a.default,{...ve(e.id),style:[l.s.row,{gap:6,height:30,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:l.C.green,backgroundColor:l.C.soft,cursor:'grab'}],children:[(0,R.jsx)(l.Icon,{name:"move",size:13,color:l.C.green}),(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,color:l.C.ink},children:e.name})]},e.id))]}),we(0),!ae&&(0,R.jsx)(a.default,{style:{height:360,alignItems:'center',justifyContent:'center'},children:(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,color:l.C.muted},children:"Finding the latest reading\u2026"})}),ae&&F.map((e,t)=>(0,R.jsxs)(n.default.Fragment,{children:[p?e.map(e=>(0,R.jsx)(a.default,{children:X[e].render(Se(e,{height:X[e].phoneH}))}
1015,e)):(0,R.jsx)(U,{id:'block_'+e.join('+'),maxW:xe,initial:J[e.join('+')]||e.map(()=>1),panes:e.map((e,n)=>i=>(0,R.jsxs)(a.default,{dataSet:{wipPane:t+':'+n},style:{height:i.h},children:[X[e].render(Se(e,{height:i.h})),C&&(0,R.jsx)(a.default,{style:{position:'absolute',left:0,right:0,top:0,bottom:0,borderRadius:12,borderWidth:2,borderColor:Ce?.id===e?l.C.green:l.C.line,backgroundColor:Ce?.id===e?l.C.soft:'transparent',opacity:Ce?.id===e?.5:1},children:(0,R.jsxs)(a.default,{...ve(e),style:[l.s.row,{gap:8,height:44,paddingHorizontal:12,borderTopLeftRadius:10,borderTopRightRadius:10,backgroundColor:l.C.paper,borderBottomWidth:1,borderColor:l.C.line,cursor:'grab'}],children:[(0,R.jsx)(l.Icon,{name:"move",size:15,color:l.C.green}),(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:l.C.ink,flex:1},children:X[e].name}),(0,R.jsx)(l.T,{style:{fontSize:11,lineHeight:14,color:l.C.muted},children:"Drag to move"}),(0,R.jsx)(r.default,{accessibilityRole:"button",accessibilityLabel:`Remove ${X[e].name}`,onPress:()=>L(Z(F,e,null)),style:e=>[{width:28,height:28,borderRadius:6,alignItems:'center',justifyContent:'center',backgroundColor:e.hovered?l.C.dark:'transparent'}],children:(0,R.jsx)(l.Icon,{name:"x",size:14,color:l.C.muted})})]})})]}))}),we(t+1)]},t+':'+e.join('+')))]}),!!Ce&&(0,R.jsx)(a.default,{pointerEvents:"none",style:{position:'fixed',left:Ce.x+12,top:Ce.y+12,zIndex:100,paddingHorizontal:10,height:28,borderRadius:8,backgroundColor:l.C.green,justifyContent:'center'},children:(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:l.C.bg},children:X[Ce.id]?.name})}),!!Ce?.line&&(0,R.jsx)(a.default,{pointerEvents:"none",style:{position:'fixed',left:Ce.line.x,top:Ce.line.y,width:Ce.line.w,height:Ce.line.h,borderRadius:2,backgroundColor:l.C.green,zIndex:99}})]})};var t=_r(_d[0]),n=e(t),r=e(_r(_d[1])),i=e(_r(_d[2])),o=e(_r(_d[3])),a=e(_r(_d[4])),s=e(_r(_d[5])),l=_r(_d[6]),d=_r(_d[7]),u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),y=_r(_d[12]),f=_r(_d[13]),x=_r(_d[14]),b=_r(_d[15]),C=_r(_d[16]),v=_r(_d[17]),S=_r(_d[18]),j=_r(_d[19]),w=_r(_d[20]),R=_r(_d[21]);const k='NIFTY',z='derivative-wip',H=20,I=12,T=(e,t)=>'number'==typeof e&&Number.isFinite(e)?e:t,E=(e,t,n)=>Math.max(t,Math.min(n,e)),$=e=>{try{const t=globalThis.document?.body;t&&(t.style.userSelect=e?'none':'')}catch{}};const W=new Set(['NIFTY','BANKNIFTY','FINNIFTY','MIDCPNIFTY','NIFTYNXT50','SENSEX','BANKEX']);function _(e,t){const r=n.default.useRef(null);return n.default.useEffect(()=>{if(!e||'undefined'==typeof document)return;const n=e=>{const n=r.current;n&&'function'==typeof n.contains&&!n.contains(e.target)&&t()};return document.addEventListener('pointerdown',n,!0),()=>document.removeEventListener('pointerdown',n,!0)},[e,t]),r}function M({value:e,onPick:s,data:d}){const u=(0,h.useSharedRead)(void 0===d?'/api/derivatives/filters':null,0),c=(void 0===d?u.data:d)?.underlyings||[],[p,y]=(0,t.useState)(!1),[f,x]=(0,t.useState)(''),b=f.trim().toUpperCase(),C=e=>!b||e.underlying.toUpperCase().includes(b),v=(e,t)=>+t.underlying.toUpperCase().startsWith(b)-+e.underlying.toUpperCase().startsWith(b)||e.underlying.localeCompare(t.underlying),S=e=>e.is_index||W.has(e.underlying.toUpperCase()),j=c.filter(e=>S(e)&&C(e)).sort(v),w=c.filter(e=>!S(e)&&C(e)).sort(v),k=c.find(t=>t.underlying===e),z=k?S(k):void 0,H=_(p,n.default.useCallback(()=>y(!1),[])),I=e=>{s(e),x(''),y(!1)},T=t=>(0,R.jsxs)(r.default,{onPress:()=>I(t.underlying),style:n=>[l.s.row,{gap:8,height:30,paddingHorizontal:10,borderRadius:6,backgroundColor:t.underlying===e?l.C.soft:n.hovered?l.C.dark:'transparent'}],children:[(0,R.jsx)(l.T,{style:{fontSize:13,lineHeight:18,flex:1,fontFamily:t.underlying===e?'InterSemi':'Inter',color:t.underlying===e?l.C.green:l.C.ink},children:t.underlying}),t.underlying===e&&(0,R.jsx)(l.Icon,{name:"check",size:13,color:l.C.green})]},t.underlying),E=(e,t)=>!!t.length&&(0,R.jsxs)(a.default,{style:{gap:1},children:[(0,R.jsx)(l.T,{style:{fontSize:11,lineHeight:16,color:l.C.muted,fontFamily:'InterSemi',letterSpacing:1,paddingHorizontal:10,paddingTop:6},children:`${e.toUpperCase()} \xb7 ${t.length}`}),t.map(T)]});return(0,R.jsxs)(a.default,{ref:H,style:{position:'relative',zIndex:p?400:70},children:[(0,R.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`Instrument: ${e}. Change instrument`,onPress:()=>y(e=>!e),style:e=>[l.s.row,{gap:8,height:32,paddingHorizontal:12,minWidth:180,borderRadius:8,borderWidth:1,borderColor:p?l.C.green:l.C.line,backgroundColor:e.hovered?l.C.dark:l.C.paper}],children:[(0,R.jsx)(l.Icon,{name:"search",size:14,color:l.C.muted}),(0,R.jsx)(l.T,{style:{fontSize:14,lineHeight:18,fontFamily:'InterSemi',color:l.C.ink,flex:1},children:e}),null!=z&&(0,R.jsx)(l.T,{style:{fontSize:11,lineHeight:14,color:l.C.muted},children:z?'Index':'Stock'}),(0,R.jsx)(l.Icon,{name:p?'chevron-up':'chevron-down',size:14,color:l.C.muted})]}),p&&(0,R.jsxs)(a.default,{style:{position:'absolute',top:36,left:0,width:300,maxHeight:440,borderRadius:10,borderWidth:1,borderColor:l.C.line,backgroundColor:l.C.paper,padding:8,gap:6},children:[(0,R.jsx)(o.default,{autoFocus:!0,value:f,onChangeText:x,placeholder:"Search an index or stock",placeholderTextColor:l.C.muted,autoCapitalize:"characters",accessibilityLabel:"Search an index or stock",onSubmitEditing:()=>{const e=j[0]||w[0];e&&I(e.underlying)},style:{height:34,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:l.C.line,backgroundColor:l.C.dark,color:l.C.ink,fontSize:13}}),(0,R.jsx)(i.default,{style:{maxHeight:370},children:c.length?j.length||w.length?(0,R.jsxs)(R.Fragment,{children:[E('Indexes',j),E('Stocks',w)]}):(0,R.jsxs)(l.T,{style:{fontSize:12,lineHeight:16,color:l.C.muted,padding:10},children:["No index or stock with options matches \u201c",f,"\u201d."]}):(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,color:l.C.muted,padding:10},children:"Loading the list\u2026"})})]})]})}function P({underlying:e,value:o,onPick:s,data:d}){const u=(0,h.useSharedRead)(void 0===d?'/api/derivatives/filters':null,0),c=((void 0===d?u.data:d)?.expiries||[]).filter(t=>t.underlying===e).sort((e,t)=>
1015e.expiry.localeCompare(t.expiry)),[p,y]=(0,t.useState)(!1),f=e=>{const t=new Date(e+'T00:00:00');return Number.isFinite(t.getTime())?t.toLocaleDateString('en-IN',{day:'2-digit',month:'short',year:'numeric'}):e},x=c.find(e=>e.expiry===o),b=o?`${f(o)}${null!=x?.days_to_expiry?` \xb7 ${x.days_to_expiry}d`:''}`:"Nearest"+(c[0]?` \xb7 ${f(c[0].expiry)}`:''),C=_(p,n.default.useCallback(()=>y(!1),[]));return(0,R.jsxs)(a.default,{ref:C,style:{position:'relative',zIndex:p?400:69},children:[(0,R.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`Expiry: ${b}. Change expiry`,onPress:()=>y(e=>!e),style:e=>[l.s.row,{gap:8,height:32,paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:p?l.C.green:l.C.line,backgroundColor:e.hovered?l.C.dark:l.C.paper}],children:[(0,R.jsx)(l.Icon,{name:"calendar",size:14,color:l.C.muted}),(0,R.jsx)(l.T,{style:{fontSize:11,lineHeight:14,color:l.C.muted},children:"Expiry"}),(0,R.jsx)(l.T,{style:{fontSize:13,lineHeight:18,fontFamily:'InterSemi',color:l.C.ink},children:b}),(0,R.jsx)(l.Icon,{name:p?'chevron-up':'chevron-down',size:14,color:l.C.muted})]}),p&&(0,R.jsx)(a.default,{style:{position:'absolute',top:36,left:0,width:250,maxHeight:360,padding:6,gap:2,borderRadius:10,borderWidth:1,borderColor:l.C.line,backgroundColor:l.C.paper},children:(0,R.jsxs)(i.default,{style:{maxHeight:340},children:[[{expiry:'',days_to_expiry:null},...c].map((e,t)=>{const n=e.expiry===o;return(0,R.jsxs)(r.default,{onPress:()=>{s(e.expiry),y(!1)},style:e=>[l.s.row,{gap:8,height:32,paddingHorizontal:10,borderRadius:6,backgroundColor:n?l.C.soft:e.hovered?l.C.dark:'transparent'}],children:[(0,R.jsx)(l.T,{style:{fontSize:13,lineHeight:18,flex:1,fontFamily:n?'InterSemi':'Inter',color:n?l.C.green:l.C.ink},children:0===t?'Nearest expiry':f(e.expiry)}),null!=e.days_to_expiry&&(0,R.jsx)(l.T,{style:{fontSize:11,lineHeight:14,color:l.C.muted},children:0===e.days_to_expiry?'today':`${e.days_to_expiry}d`}),n&&(0,R.jsx)(l.Icon,{name:"check",size:13,color:l.C.green})]},e.expiry||'nearest')}),!c.length&&(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,color:l.C.muted,padding:10},children:"Loading the expiries\u2026"})]})})]})}function A({style:e,expanded:n,onExpand:r,onClose:i,sh:o,initialMode:a}){const{underlying:s}=o,l=(0,h.useSharedRead)(`/api/derivatives/oi-by-strike?underlying=${encodeURIComponent(s)}${o.expiry?`&expiry=${encodeURIComponent(o.expiry)}`:''}${o.at?`&at=${encodeURIComponent(o.at)}`:''}`,o.seq),d=l.data,u=(0,y.stateOf)(l,'No open interest has been captured for this expiry yet.'),c=!!d&&null==d.spot&&null==d.spot_last,p=(0,h.useSharedRead)(c?`/api/derivatives/maxpain-series?underlying=${encodeURIComponent(s)}${d?.expiry?`&expiry=${encodeURIComponent(d.expiry)}`:''}`:null,o.seq),C=(0,t.useMemo)(()=>(0,b.resolveSpot)(d,p.data?.points),[d,p.data]),v=s+(d?.expiry?' \xb7 '+d.expiry:'')+(null!=d?.days_to_expiry?' \xb7 '+(0,f.dteText)(d.days_to_expiry):'');return(0,R.jsx)(x.OiStrikeChart,{initialMode:a,onView:o.onView,body:d,spot:C,state:u,underlying:s,subtitle:v,onRefresh:l.reload,onExpand:r,expanded:n,onClose:i,highlight:o.highlight,onHighlight:o.onHighlight,style:e})}function F({style:e,expanded:n,onExpand:r,onClose:i,sh:o}){const a=(0,h.useSharedRead)(`/api/derivatives/oi-grid?underlying=${encodeURIComponent(o.underlying)}${o.expiry?`&expiry=${encodeURIComponent(o.expiry)}`:''}${o.at?`&at=${encodeURIComponent(o.at)}`:''}`,o.seq),[s,l]=(0,t.useState)(null);return(0,R.jsx)(C.DeltaOiGrid,{link:o.link,underlying:o.underlying,read:a,target:s,onTarget:l,highlight:o.highlight,onHighlight:o.onHighlight,onExpand:r,expanded:n,onClose:i,style:e})}function L({style:e,expanded:n,onExpand:r,onClose:i,sh:o}){const[a,s]=(0,t.useState)(null),l=(0,h.useSharedRead)(`/api/derivatives/oi-grid?underlying=${encodeURIComponent(o.underlying)}${o.expiry?`&expiry=${encodeURIComponent(o.expiry)}`:''}${o.at?`&at=${encodeURIComponent(o.at)}`:''}`,o.seq);return(0,R.jsx)(v.ChainWidget,{spotHint:l.data?.spot??null,underlying:o.underlying,expiry:o.expiry,at:o.at||void 0,seq:o.seq,target:a,onTarget:s,highlight:o.highlight,onHighlight:o.onHighlight,onExpand:r,expanded:n,onClose:i,style:e})}function U({id:e,maxW:r,panes:i,initial:o,initialH:s=560,minH:u=380}){const c=i.length,h=(0,d.readStore)(z,e),p=e=>{const t=e.reduce((e,t)=>
1015e+t,0)||1;return e.map(e=>e/t)},[y,f]=(0,t.useState)(()=>Array.isArray(h.f)&&h.f.length===c&&h.f.every(e=>'number'==typeof e)?p(h.f):p(o)),[x,b]=(0,t.useState)(()=>Math.max(u,T(h.h,s))),C=(0,t.useRef)({f:y,h:x});C.current={f:y,h:x},(0,t.useEffect)(()=>{const t=setTimeout(()=>(0,d.writeStore)(z,e,{f:y,h:x}),300);return()=>clearTimeout(t)},[y,x]);const v=(0,t.useRef)(null),S=Math.max(0,r),j=Math.max(1,S-10*(c-1)),w=y.map(e=>Math.round(e*j)),k=e=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{$(!0),v.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,f:C.current.f,h:C.current.h}},onResponderMove:t=>{const n=v.current;if(!n)return;if('y'===e)return void b(Math.max(u,n.h+t.nativeEvent.pageY-n.y));const r=(t.nativeEvent.pageX-n.x)/j,i=n.f[e],o=n.f[e+1],a=E(i+r,.15,i+o-.15),s=[...n.f];s[e]=a,s[e+1]=i+o-a,f(s)},onResponderRelease:()=>{$(!1),v.current=null},onResponderTerminate:()=>{$(!1),v.current=null}});return(0,R.jsxs)(a.default,{style:{width:S,height:x},children:[(0,R.jsx)(a.default,{style:{flexDirection:'row',height:x},children:i.map((e,t)=>(0,R.jsxs)(n.default.Fragment,{children:[t>0&&(0,R.jsx)(a.default,{...k(t-1),accessibilityLabel:"Drag to share the width",style:{width:10,alignItems:'center',justifyContent:'center',cursor:'col-resize'},children:(0,R.jsx)(a.default,{style:{width:3,height:36,borderRadius:2,backgroundColor:l.C.line}})}),(0,R.jsx)(a.default,{style:{width:w[t],height:x},children:e({w:w[t],h:x})})]},t))}),(0,R.jsx)(a.default,{...k('y'),accessibilityLabel:"Drag to change the height",style:{position:'absolute',left:0,right:0,bottom:-6,height:12,cursor:'ns-resize',alignItems:'center',justifyContent:'center'},children:(0,R.jsx)(a.default,{style:{width:36,height:3,borderRadius:2,backgroundColor:l.C.line}})})]})}function N(e){const t=encodeURIComponent(e.underlying),n=e.expiry?`&expiry=${encodeURIComponent(e.expiry)}`:'',r=e.at?`&at=${encodeURIComponent(e.at)}`:'';return{grid:(0,h.useSharedRead)(`/api/derivatives/oi-grid?underlying=${t}${n}${r}`,e.seq),pcr:D((0,h.useSharedRead)(`/api/derivatives/pcr-series?underlying=${t}${n}`,e.seq),e.at),fut:D((0,h.useSharedRead)(`/api/derivatives/futures-buildup?underlying=${t}`,e.seq),e.at),mp:D((0,h.useSharedRead)(`/api/derivatives/maxpain-series?underlying=${t}${n}`,e.seq),e.at),iv:D((0,h.useSharedRead)(`/api/derivatives/iv-series?underlying=${t}${n}`,e.seq),e.at),stand:(0,h.useSharedRead)(`/api/derivatives/oi-by-strike?underlying=${t}${n}${r}`,e.seq)}}function D(e,t){return e.data&&Array.isArray(e.data.points)?{...e,data:{...e.data,points:(0,p.clipPoints)(e.data.points,t)}}:e}function O({reads:e}){const t=e.filter(([,e])=>'error'===e.phase);return t.length?(0,R.jsx)(a.default,{style:{paddingHorizontal:10,paddingVertical:5,borderRadius:8,backgroundColor:l.C.amberBg,marginBottom:4},children:t.map(([e,t])=>(0,R.jsx)(l.T,{style:{fontSize:11,lineHeight:15,color:l.C.amber},children:`\u2014 ${e} unavailable: ${t.error||'no answer'}`},e))}):null}function q({style:e,expanded:t,onExpand:n,sh:r}){const i=N(r),o=e?.height??0;return(0,R.jsxs)(a.default,{style:{height:o},children:[(0,R.jsx)(O,{reads:[['PCR series',i.pcr],['Max pain series',i.mp],['ATM IV series',i.iv],['Where positions stand',i.stand]]}),(0,R.jsx)(S.SignalPanel,{symbol:r.underlying,read:i.grid,pcr:i.pcr.data,maxPain:i.mp.data,iv:i.iv.data,standing:i.stand.data,onExpand:n,expanded:t,style:{flex:1,minHeight:0}})]})}function B({style:e,expanded:n,onExpand:r,sh:i}){const o=N(i),[,s]=(0,t.useState)(null),l=e?.height??0;return(0,R.jsxs)(a.default,{style:{height:l},children:[(0,R.jsx)(O,{reads:[['PCR series',o.pcr],['Futures series',o.fut],['Where positions stand',o.stand]]}),(0,R.jsx)(j.SummaryPanel,{symbol:i.underlying,read:o.grid,pcr:o.pcr.data,futures:o.fut.data,standing:o.stand.data,highlight:i.highlight,onHighlight:i.onHighlight,onTarget:s,onExpand:r,expanded:n,style:{flex:1,minHeight:0}})]})}const Y=[{id:'oi_chart',name:'Open interest by strike',phoneH:560,render:e=>(0,R.jsx)(A,{...e})},{id:'oi_grid',name:'Strikes at the money',phoneH:520,render:e=>(0,R.jsx)(F,{...e})},{id:'chain',name:'Option chain',phoneH:560,render:e=>(0,R.jsx)(L,{...e})}
1015,{id:'signal',name:'Signal by reading',phoneH:520,render:e=>(0,R.jsx)(q,{...e})},{id:'summary',name:'What is happening',phoneH:560,render:e=>(0,R.jsx)(B,{...e})},{id:'iv',name:'Implied volatility by strike',phoneH:560,render:e=>(0,R.jsx)(w.IvGridWidget,{underlying:e.sh.underlying,expiry:e.sh.expiry,at:e.sh.at,seq:e.sh.seq,highlight:e.sh.highlight,onHighlight:e.sh.onHighlight,style:e.style,onExpand:e.onExpand,expanded:e.expanded,onClose:e.onClose})},{id:'maxpain',name:'Max pain through the session',phoneH:420,render:e=>(0,R.jsx)(w.MaxPainWidget,{underlying:e.sh.underlying,expiry:e.sh.expiry,at:e.sh.at,seq:e.sh.seq,style:e.style,onExpand:e.onExpand,expanded:e.expanded,onClose:e.onClose})}],X=Object.fromEntries(Y.map(e=>[e.id,e])),G=[['oi_chart','oi_grid'],['chain','signal','summary'],['iv','maxpain']];function V(e){if(!Array.isArray(e))return G.map(e=>[...e]);const t=new Set,n=e.filter(Array.isArray).map(e=>e.filter(e=>'string'==typeof e&&X[e]&&!t.has(e)&&(t.add(e),!0)));return n.length?n:G.map(e=>[...e])}function K(e,t,n){if('newBlockAt'in n){const r=e.map(e=>e.map(e=>e===t?'\0':e));return r.splice(Math.max(0,Math.min(n.newBlockAt,r.length)),0,[t]),r.map(e=>e.filter(e=>'\0'!==e)).filter(e=>e.length>0)}const r=e.findIndex(e=>e.includes(t)),i=r<0?-1:e[r].indexOf(t),o=r===n.block&&i>=0&&i<n.index?n.index-1:n.index;return Z(e,t,{block:n.block,index:o})}function Z(e,t,n){const r=e.map(e=>e.filter(e=>e!==t));if(n){for(;r.length<=n.block;)r.push([]);const e=r[n.block];e.splice(null==n.index?e.length:Math.min(n.index,e.length),0,t)}return r.filter(e=>e.length>0)}const J={'iv+maxpain':[.62,.38],'oi_chart+oi_grid':[.55,.45],'chain+signal+summary':[.45,.25,.3]};function Q(e,t){const n=globalThis.document;if(!n)return null;for(const r of Array.from(n.querySelectorAll('[data-wip-zone]'))){const n=r.getBoundingClientRect();if(t>=n.top-8&&t<=n.bottom+8&&e>=n.left&&e<=n.right)return{drop:{newBlockAt:Number(r.getAttribute('data-wip-zone'))},line:{x:n.left,y:n.top+n.height/2-2,w:n.width,h:4}}}for(const r of Array.from(n.querySelectorAll('[data-wip-pane]'))){const n=r.getBoundingClientRect();if(e<n.left||e>n.right||t<n.top||t>n.bottom)continue;const[i,o]=String(r.getAttribute('data-wip-pane')).split(':').map(Number),a=e>n.left+n.width/2;return{drop:{block:i,index:a?o+1:o},line:{x:(a?n.right:n.left)-2,y:n.top,w:4,h:n.height}}}return null}function ee(e){const[n,r]=(0,t.useState)(null),i=(0,t.useRef)(null),o=e=>{i.current=e,r(e)};return{drag:n,grip:t=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{$(!0),o({id:t,x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,drop:null,line:null})},onResponderMove:e=>{const n=e.nativeEvent.pageX,r=e.nativeEvent.pageY,i=Q(n,r);o({id:t,x:n,y:r,drop:i?.drop??null,line:i?.line??null})},onResponderRelease:t=>{$(!1);const n=i.current,r=Q(t?.nativeEvent?.pageX??n?.x??0,t?.nativeEvent?.pageY??n?.y??0)||(n?.drop?{drop:n.drop,line:null}:null);o(null),n&&r&&e(n.id,r.drop)},onResponderTerminate:()=>{$(!1),o(null)}})}}function te({store:e,edit:n,onPick:i,onSaveAs:s,onDelete:d}){const[u,c]=(0,t.useState)(!1),[h,p]=(0,t.useState)(''),y=Object.keys(e.names),f=()=>{const e=h.trim().slice(0,40);e&&(s(e),p(''),c(!1))};return(0,R.jsxs)(a.default,{style:{position:'relative',zIndex:50},children:[(0,R.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`Layout: ${e.active}. Change layout`,onPress:()=>c(e=>!e),style:e=>[l.s.row,{gap:6,height:30,paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:u?l.C.green:l.C.line,backgroundColor:e.hovered?l.C.dark:'transparent'}],children:[(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,color:l.C.muted},children:"Layout"}),(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:l.C.ink},children:e.active}),(0,R.jsx)(l.Icon,{name:"chevron-down",size:13,color:l.C.muted})]}),u&&(0,R.jsxs)(a.default,{style:{position:'absolute',top:34,right:0,width:260,padding:8,gap:4,borderRadius:10,borderWidth:1,borderColor:l.C.line,backgroundColor:l.C.paper},children:[y.map(t=>(0,R.jsxs)(a.default,{style:[l.s.row,{gap:4}],children:[(0,R.jsxs)(r.default,{onPress:()=>{i(t),c(!1)},style:n=>[l.s.row,{flex:1,gap:6,paddingHorizontal:8,height:30,borderRadius:6,backgroundColor:t===e.active?l.C.soft:n.hovered?l.C.dark:'transparent'}],children:[t===e.active&&(0,R.jsx)(l.Icon,{name:"check",size:12,color:l.C.green}),(0,R.jsx)(l.T,{numberOfLines:1,style:{fontSize:12,lineHeight:16,color:t===e.active?l.C.green:l.C.ink},children:t})]}),y.length>1&&(0,R.jsx)(r.default,{accessibilityLabel:`Delete layout ${t}`,onPress:()=>d(t),style:e=>[{width:26,height:26,borderRadius:6,alignItems:'center',justifyContent:'center',backgroundColor:e.hovered?l.C.dark:'transparent'}],children:(0,R.jsx)(l.Icon,{name:"trash-2",size:12,color:l.C.muted})})]},t)),(0,R.jsx)(a.default,{style:{height:1,backgroundColor:l.C.line,marginVertical:4}}),(0,R.jsx)(l.T,{style:{fontSize:11,lineHeight:15,color:l.C.muted},children:"Save the arrangement on screen as a new layout"}),(0,R.jsxs)(a.default,{style:[l.s.row,{gap:6}],children:[(0,R.jsx)(o.default,{value:h,onChangeText:p,onSubmitEditing:f,placeholder:"Expiry day",placeholderTextColor:l.C.muted,accessibilityLabel:"New layout name",style:{flex:1,height:30,paddingHorizontal:8,borderRadius:6,borderWidth:1,borderColor:l.C.line,backgroundColor:l.C.dark,color:l.C.ink,fontSize:12}}),(0,R.jsx)(r.default,{onPress:f,style:e=>[{height:30,paddingHorizontal:10,borderRadius:6,justifyContent:'center',backgroundColor:h.trim()?e.hovered?l.C.mint:l.C.green:l.C.line}],children:(0,R.jsx)(l.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:l.C.bg},children:"Save"})})]})]})]})}},922,[11,375,278,385,13,400,821,871,197,920,921,923,924,926,927,929,943,946,947,953,955,6]); 1016__d(function(g,r,i,a,m,e,d){"use strict";
1016Object.defineProperty(e,'__esModule',{value:!0}),e.clipPoints=function(n,u){const l=t(u);return n&&null!=l?n.filter(n=>{const u=t(n?.at);return null==u||u<=l}):n||[]};const t=t=>{const n=Date.parse(String(t||'').replace(' ','T'));return Number.isFinite(n)?n:null}},923,[]); 1017__d(function(_g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"webOnly",{enumerable:!0,get:function(){return f.webOnly}}),Object.defineProperty(_e,"CenterNote",{enumerable:!0,get:function(){return f.CenterNote}}),Object.defineProperty(_e,"head",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"tab",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"tone",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"buildupColor",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"typeColor",{enumerable:!0,get:function(){return C}}),_e.Pill=j,Object.defineProperty(_e,"SCALE",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"IDLE_H",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"bodyText",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"metaText",{enumerable:!0,get:function(){return H}}),_e.infoGroups=L,_e.InfoDisclosure=function({label:e="How to read this",title:i,groups:h}){const[x,b]=t.default.useState(!1),y=t.default.useRef(null),C=L(h);return C.length?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(l.default,{ref:y,accessibilityRole:"button",accessibilityState:{expanded:x},accessibilityLabel:`${e}: ${i}. ${x?'Hide the definitions':'Read the definitions'}`,...(0,f.webOnly)({'aria-expanded':x,'aria-haspopup':'dialog'}),onPress:()=>b(e=>!e),hitSlop:w,style:e=>[s.s.row,{gap:5,minHeight:30,paddingHorizontal:9,borderRadius:8,borderWidth:1,borderColor:x?s.C.green:s.C.line,backgroundColor:x||e.hovered||e.focused?s.C.soft:'transparent'}],children:[(0,p.jsx)(u.HitArea,{slop:w}),(0,p.jsx)(s.Icon,{name:"info",size:13,color:x?s.C.green:s.C.muted}),(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:x?s.C.green:s.C.muted},children:e})]}),(0,p.jsx)(c.Popover,{open:x,onClose:()=>b(!1),anchor:y,placement:"bottom-end",label:i,width:400,children:(0,p.jsx)(o.default,{contentContainerStyle:{paddingHorizontal:14,paddingVertical:8,gap:12},children:C.map(e=>(0,p.jsxs)(n.default,{style:{gap:4},children:[(0,p.jsx)(s.T,{style:g,children:e.heading}),e.lines.map((e,t)=>(0,p.jsx)(s.T,{accessibilityRole:"text",style:{fontSize:12,lineHeight:18,color:'amber'===e.tone?s.C.amber:s.C.ink},children:e.text},t))]},e.heading))})})]}):null},_e.captureView=I,Object.defineProperty(_e,"CaptureContext",{enumerable:!0,get:function(){return W}}),_e.CaptureChip=$,_e.BlockCaptureChip=v,_e.DirectionChip=F,_e.Tag=B,_e.EmptyPanel=N,_e.LoadingPanel=V,_e.stateOf=function(e,t){return(0,h.cardState)(e.data,{loading:'loading'===e.phase,error:'error'===e.phase?e.error:'',emptyText:t})},_e.SourceLine=function({body:e}){const t=(0,h.sourceText)(e?.source);return t?(0,p.jsx)(s.T,{style:{fontSize:11,lineHeight:15,color:s.C.muted},children:t}):null},_e.Section=function({title:e,subtitle:t,stacked:l,asOf:i,badge:o,info:c,actions:u,children:f}){const h=!!(i||o||c||u);return(0,p.jsxs)(n.default,{style:{gap:8},children:[(0,p.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',flexWrap:'wrap',gap:10},children:[(0,p.jsxs)(n.default,{style:{gap:2,flexShrink:1,minWidth:0},children:[(0,p.jsx)(s.T,{role:"heading","aria-level":2,style:{fontFamily:'ManropeBold',fontSize:19,lineHeight:26,letterSpacing:-.3},children:e}),!!t&&(0,p.jsx)(s.T,{style:{fontSize:12,lineHeight:17,color:s.C.muted},children:t})]}),h&&(0,p.jsxs)(n.default,{style:{flex:1,minWidth:190,flexDirection:'row',flexWrap:'wrap',alignItems:'center',justifyContent:'flex-end',gap:10},children:[!!o&&(0,p.jsx)(n.default,{children:(0,p.jsx)(j,{label:o})}),!!i&&(0,p.jsxs)(n.default,{style:[s.s.row,{gap:5}],children:[(0,p.jsx)(s.Icon,{name:"clock",size:12,color:s.C.muted}),(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:s.C.muted},children:i})]}),c,u]})]}),(0,p.jsx)(n.default,{style:{flexDirection:l?'column':'row',alignItems:'stretch',gap:12},children:f})]})}
1017,_e.WidgetFrame=function({name:e,subtitle:i,body:g,state:x,showsSignals:b,filterCount:y,onCustomize:C,onRefresh:j,onExpand:S,expanded:T,onClose:z,toolbar:w,note:_,emptyDetail:k,footer:L,inBlock:P,inline:R,children:I,style:W}){const $=(0,h.missingText)(g?.missing,b||[]),[v,F]=t.default.useState(!1),B=x?.phase||'ready';let E=I;'loading'===B?E=(0,p.jsx)(V,{}):'error'===B?E=(0,p.jsx)(f.CenterNote,{icon:"alert-triangle",text:`No rows are shown while this widget is unavailable. This is not the same as nothing happening. ${x?.text||''}`,children:!!j&&(0,p.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`Retry ${e}`,onPress:j,hitSlop:O,style:e=>[{minHeight:32,paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:s.C.line,justifyContent:'center',backgroundColor:e.hovered||e.focused?s.C.soft:'transparent'}],children:[(0,p.jsx)(u.HitArea,{slop:O}),(0,p.jsx)(s.T,{style:{fontSize:12,fontFamily:'InterSemi',color:s.C.green},children:"Retry"})]})}):'empty'===B&&(E=(0,p.jsx)(N,{text:x?.text||'',detail:k}));const A=P?26:30,M=P?10:12,D=P?6:10,K=u.TOUCH_MIN,X=u.TOUCH_MIN-A,q=X/2,U=(0,u.touchSlop)(A,A),G=!!j||!!S||!!z;return(0,p.jsxs)(n.default,{role:"region","aria-label":e,style:[{backgroundColor:s.C.paper,borderWidth:1,borderColor:s.C.line,borderRadius:12,overflow:'hidden',minWidth:0},W],children:[(0,p.jsxs)(n.default,{style:[s.s.row,{paddingLeft:M,paddingRight:G?q:2,minHeight:K,borderBottomWidth:1,borderColor:s.C.line,gap:D}],children:[R?(0,p.jsxs)(s.T,{numberOfLines:1,style:{minWidth:0,flexShrink:1,fontSize:11,lineHeight:16},children:[(0,p.jsx)(s.T,{role:"heading","aria-level":3,style:{fontFamily:'InterSemi',fontSize:11,letterSpacing:1,textTransform:'uppercase'},children:e}),!!i&&(0,p.jsx)(s.T,{style:{fontSize:11,color:s.C.muted},children:` (${i})`})]}):(0,p.jsxs)(n.default,{style:{minWidth:0,flexShrink:1},children:[(0,p.jsx)(s.T,{role:"heading","aria-level":3,numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:11,lineHeight:16,letterSpacing:1,textTransform:'uppercase'},children:e}),!!i&&(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:s.C.muted},children:i})]}),!!C&&(0,p.jsx)(f.LinkText,{label:(0,h.customizeLabel)(y||0),a11y:`Customize ${e}: ${y||0} filters in force. Open the filter builder`,onPress:C}),(0,p.jsx)(n.default,{style:{flex:1,minWidth:4}}),G&&(0,p.jsxs)(n.default,{style:[s.s.row,{gap:X}],children:[R&&(0,p.jsxs)(n.default,{children:[(0,p.jsx)(c.IconButton,{icon:"info",size:13,label:`Notes for ${e}`,tooltip:"Notes and as-of",pressed:v,onPress:()=>F(e=>!e),style:{width:A,height:A},slop:U}),!!$&&(0,p.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:3,width:6,height:6,borderRadius:3,backgroundColor:s.C.amber}})]}),!!j&&(0,p.jsx)(c.IconButton,{icon:"refresh-cw",size:13,label:`Refresh ${e}`,tooltip:"Refresh",onPress:j,style:{width:A,height:A},slop:U}),!!S&&(0,p.jsx)(c.IconButton,{icon:T?'minimize-2':'maximize-2',size:13,pressed:T,label:`${T?'Restore':'Expand'} ${e}`,tooltip:T?'Restore':'Expand',onPress:S,style:{width:A,height:A},slop:U}),!!z&&(0,p.jsx)(c.IconButton,{icon:"x",size:14,label:`Close ${e}`,tooltip:"Close",onPress:z,style:{width:A,height:A},slop:U})]})]}),!!w&&(0,p.jsx)(n.default,{style:{paddingHorizontal:M,paddingVertical:P?6:8,borderBottomWidth:1,borderColor:s.C.line,gap:5,zIndex:1},children:w}),(0,p.jsxs)(n.default,{style:{flex:1,minHeight:0},children:[E,R&&v&&(0,p.jsx)(n.default,{style:{position:'absolute',top:0,left:0,right:0,maxHeight:'70%',zIndex:20,backgroundColor:s.C.paper,borderBottomWidth:1,borderColor:s.C.line,paddingHorizontal:M,paddingVertical:8},children:(0,p.jsxs)(o.default,{contentContainerStyle:{gap:4},children:[!!g?.as_of&&(0,p.jsxs)(s.T,{style:H,children:[(0,h.asOfText)(g?.as_of),g?.floors||g?.floors_text?` \xb7 ${(0,h.floorsText)(g?.floors,g?.floors_text)}`:'']}),!!_&&('string'==typeof _?(0,p.jsx)(s.T,{style:H,children:_}):_),!!$&&(0,p.jsx)(s.T,{style:{...H,color:s.C.amber},children:$}),!g?.as_of&&!_&&!$&&(0,p.jsx)(s.T,{style:H,children:"No notes for this widget."})]})})]}),R?null:P?(!!_||!!$)&&(0,p.jsxs)(n.default,{style:{borderTopWidth:1,borderColor:s.C.line,paddingHorizontal:M,paddingVertical:6,gap:3},children:[!!_&&('string'==typeof _?(0,p.jsx)(s.T,{style:H,children:_}):_),!!$&&(0,p.jsx)(s.T,{style:{...H,color:s.C.amber},children:$})]}):void 0!==L?null!==L&&(0,p.jsx)(n.default,{style:{borderTopWidth:1,borderColor:s.C.line,paddingHorizontal:12,paddingVertical:7,gap:3},children:L}):(0,p.jsxs)(n.default,{style:{borderTopWidth:1,borderColor:s.C.line,paddingHorizontal:12,paddingVertical:7,gap:3},children:[(0,p.jsxs)(n.default,{style:[s.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,p.jsx)(s.Icon,{name:"clock",size:11,color:s.C.muted}),(0,p.jsx)(s.T,{style:{fontSize:11,lineHeight:15,color:s.C.muted},children:(0,h.asOfText)(g?.as_of)})]}),(0,p.jsx)(s.T,{style:{fontSize:11,lineHeight:15,color:s.C.muted},children:(0,h.floorsText)(g?.floors,g?.floors_text)}),!!_&&('string'==typeof _?(0,p.jsx)(s.T,{style:{fontSize:11,lineHeight:15,color:s.C.muted},children:_}):_),!!$&&(0,p.jsx)(s.T,{style:{fontSize:11,lineHeight:15,color:s.C.amber},children:$})]})]})}
1017,Object.defineProperty(_e,"BLOCK_H",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"BLOCK_CHART_FLEX",{enumerable:!0,get:function(){return A}}),Object.defineProperty(_e,"BLOCK_CONTENT_FLEX",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"BLOCK_BESIDE",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"BLOCK_PIN_COLUMN",{enumerable:!0,get:function(){return K}}),Object.defineProperty(_e,"BLOCK_GAP",{enumerable:!0,get:function(){return X}}),_e.paneStyles=q,_e.Headline=U,_e.SymbolPill=J,_e.Block=function({title:e,subtitle:l,asOf:i,badge:o,linked:c,headline:u,info:f,actions:h,stacked:g,height:x,idle:b,chart:y,content:C}){const j=q(!!g,x||(b?T:E)),S=y(j.chart),z=C(j.content);if(!S&&!z)return null;const H=t.default.useContext(W),w=!!H&&!1===H.healthy,O=!!i||!!o||!!f||!!h||w;return(0,p.jsxs)(n.default,{style:{gap:8},children:[(0,p.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'flex-start',flexWrap:'wrap',gap:10},children:[(0,p.jsxs)(n.default,{style:{gap:2,flexShrink:1,minWidth:0},children:[(0,p.jsx)(s.T,{role:"heading","aria-level":2,style:{fontFamily:'ManropeBold',fontSize:19,lineHeight:26,letterSpacing:-.3},children:e}),!!l&&(0,p.jsx)(s.T,{style:{fontSize:12,lineHeight:17,color:s.C.muted},children:l})]}),O&&(0,p.jsxs)(n.default,{style:{flex:1,minWidth:190,flexDirection:'row',flexWrap:'wrap',alignItems:'center',justifyContent:'flex-end',gap:10},children:[!!o&&(0,p.jsx)(n.default,{children:(0,p.jsx)(J,{label:o,linked:c})}),!!i&&(0,p.jsxs)(n.default,{style:[s.s.row,{gap:5}],children:[(0,p.jsx)(s.Icon,{name:"clock",size:12,color:s.C.muted}),(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:s.C.muted},children:i})]}),(0,p.jsx)(v,{}),f,h]})]}),!!u&&(0,p.jsx)(U,{...u}),(0,p.jsxs)(n.default,{style:[s.s.row,{alignItems:'stretch',gap:X}],children:[!!c&&(0,p.jsx)(n.default,{style:{width:2,borderRadius:2,backgroundColor:s.C.green,opacity:.55}}),(0,p.jsxs)(n.default,{style:{flex:1,minWidth:0,flexDirection:g?'column':'row',alignItems:'stretch',gap:X},children:[S,z]})]})]})},_e.useHoverIndex=function(e){const[n,l]=t.default.useState(null),i=t.default.useRef(e);i.current=e;const o=t.default.useRef(0),s=t.default.useRef(null);t.default.useEffect(()=>()=>{o.current&&cancelAnimationFrame(o.current)},[]);const c=t.default.useMemo(()=>({onPointerMove:e=>{const t=e?.nativeEvent||e;'touch'!==t?.pointerType&&(s.current={target:e.currentTarget,clientX:t.clientX},o.current||(o.current=requestAnimationFrame(()=>{o.current=0;const e=s.current,t=e?.target?.getBoundingClientRect?.();if(!e||!t||!Number.isFinite(e.clientX))return;const n=i.current(e.clientX-t.left,t.width);l(e=>null==n?null:n===e?e:n)})))},onPointerLeave:e=>{const t=e?.nativeEvent||e;'touch'!==t?.pointerType&&(o.current&&(cancelAnimationFrame(o.current),o.current=0),s.current=null,l(null))}}),[]);return{cursor:n,hover:c}},_e.CrosshairReadout=function({time:e,rows:t}){return(0,p.jsxs)(n.default,{style:[s.s.row,{gap:10,flexWrap:'wrap',paddingHorizontal:8,paddingVertical:4,borderRadius:8,borderWidth:1,borderColor:s.C.line,backgroundColor:s.C.dark}],children:[(0,p.jsxs)(n.default,{style:[s.s.row,{gap:4}],children:[(0,p.jsx)(s.Icon,{name:"clock",size:10,color:s.C.green}),(0,p.jsx)(s.T,{style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:s.C.green,fontVariant:['tabular-nums']},children:e})]}),t.map(e=>(0,p.jsxs)(n.default,{style:[s.s.row,{gap:5}],children:[(0,p.jsx)(n.default,{style:{width:8,height:2,backgroundColor:e.color}}),(0,p.jsxs)(s.T,{numberOfLines:1,style:[H,{color:s.C.ink,fontVariant:['tabular-nums']}],children:[e.label," ",e.value,e.tag?` ${e.tag}`:'']})]},e.label))]})};var t=e(r(d[0])),n=e(r(d[1])),l=e(r(d[2])),i=e(r(d[3])),o=e(r(d[4]));r(d[5]);var s=r(d[6]),c=r(d[7]),u=r(d[8]),f=r(d[9]),h=r(d[10]),p=r(d[11]);const g={fontSize:12,lineHeight:16,fontFamily:'InterMedium',letterSpacing:.6,textTransform:'uppercase',color:s.C.muted},x={fontVariant:['tabular-nums']},b=e=>null==e?s.C.muted:e>0?s.C.green:e<0?s.C.red:s.C.ink,y=e=>'up'===e?s.C.green:'down'===e?s.C.red:s.C.muted,C=e=>'call'===e?s.C.green:'put'===e?s.C.red:s.C.muted;function j({label:e,tone:t=s.C.muted}){return(0,p.jsx)(n.default,{style:{alignSelf:'flex-start',paddingHorizontal:6,paddingVertical:2,borderRadius:5,backgroundColor:t===s.C.muted?s.C.bg:s.C.soft},children:(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:t},children:e})})}const S={title:11,sub:11,body:11,meta:11,pad:10,gap:6},T=190,z={fontSize:S.body,lineHeight:15,color:s.C.muted},H={fontSize:S.meta,lineHeight:15,color:s.C.muted},w=(0,u.touchSlop)(30),O=(0,u.touchSlop)(32),_=(0,u.touchSlop)(26),k=(0,u.touchSlop)(22);function L(e){return(e||[]).map(e=>({heading:e.heading,lines:(e.lines||[]).map(e=>'string'==typeof e?{text:e}:e).filter(e=>!!e&&!!String(e.text||'').trim())})).filter(e=>e.lines.length>0)}const P={missing_capture:'Nothing captured',partial_capture:'Partial capture',complete:'Capture complete',no_eligible_rows:'Capture complete',filtered_out:'Capture complete',failed:'Store unavailable'},R={missing_capture:'amber',partial_capture:'amber',failed:'amber',complete:'green',no_eligible_rows:'green',filtered_out:'green'};function I(e){if(!e||!e.state)return null;
1017const t=e.state,n=[e.state_text].filter(Boolean),l=Number(e.rows)||0,i=(e.required_fields||[]).concat(['spot']).map(t=>({key:t,entry:(e.coverage||{})[t]})).filter(e=>e.entry&&e.entry.column).map(e=>`${e.entry.label}: ${Number(e.entry.present||0).toLocaleString()} of ${l.toLocaleString()}`);l&&i.length&&n.push(`At this reading \u2014 ${i.join(' \xb7 ')}.`),'candles_15m'===e.source&&n.push("This reading was rebuilt from 15-minute candles. A candle carries no traded-price average, so there is no premium traded here to measure anything against.");const o=(e.floors_applied||[]).map(t=>(e.floors_labels||{})[t]||t);e.floors_degraded&&o.length&&n.push(`The rows at this reading were gated on ${o.length} of the 3 liquidity floors: ${o.join(', ')}.`);for(const t of e.floors_unmeasured_text||[])n.push(t);return null!=e.cleared&&null!=e.matched&&e.cleared>0&&0===e.matched&&n.push(`${e.cleared.toLocaleString()} contracts cleared the floors here; the filters in force excluded every one of them.`),e.latest_complete_at&&!e.latest_complete_is_here?n.push(`The newest reading with every required field captured is ${(0,h.asOfText)(e.latest_complete_at)}. Choose it above to move the tab there \u2014 nothing is substituted for you.`):e.latest_complete_at||'complete'===t||n.push('No recent reading has every required field captured.'),e.capture_text&&n.push(e.capture_text),{state:t,label:P[t]||t,tone:R[t]||'muted',detail:e.state_text||'',lines:n}}const W=t.default.createContext(null);function $({capture:e,compact:n}){const i=I(e),[x,b]=t.default.useState(!1),y=t.default.useRef(null);if(!i)return null;const C='amber'===i.tone?s.C.amber:'green'===i.tone?s.C.green:s.C.muted;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(l.default,{ref:y,accessibilityRole:"button",accessibilityState:{expanded:x},accessibilityLabel:`F&O capture: ${i.label}. ${i.detail} ${x?'Hide the detail':'Read the detail'}`,...(0,f.webOnly)({'aria-expanded':x,'aria-haspopup':'dialog'}),onPress:()=>b(e=>!e),hitSlop:n?k:_,style:e=>[s.s.row,{gap:5,minHeight:n?22:26,paddingHorizontal:7,borderRadius:7,borderWidth:1,borderColor:C,backgroundColor:x||e.hovered||e.focused?s.C.soft:'transparent'}],children:[(0,p.jsx)(u.HitArea,{slop:n?k:_}),(0,p.jsx)(s.Icon,{name:'amber'===i.tone?'alert-triangle':'check-circle',size:n?11:12,color:C}),(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:C},children:i.label})]}),(0,p.jsx)(c.Popover,{open:x,onClose:()=>b(!1),anchor:y,placement:"bottom-end",label:"F&O capture health",width:420,children:(0,p.jsxs)(o.default,{contentContainerStyle:{paddingHorizontal:14,paddingVertical:10,gap:8},children:[(0,p.jsx)(s.T,{style:g,children:e?.at?`F&O capture at ${(0,h.asOfText)(e.at)}`:'F&O capture'}),i.lines.map((e,t)=>(0,p.jsx)(s.T,{accessibilityRole:"text",style:{fontSize:12,lineHeight:18,color:0===t&&'amber'===i.tone?s.C.amber:s.C.ink},children:e},t))]})})]})}function v(){const e=t.default.useContext(W);return e&&!1===e.healthy?(0,p.jsx)($,{capture:e,compact:!0}):null}function F({label:e,tone:t="flat",size:l=11}){const i=Math.max(11,l);if(!e)return(0,p.jsx)(s.T,{style:{fontSize:i,lineHeight:i+4,color:s.C.muted},children:"no baseline"});const o='flat'===t?s.C.muted:y(t);return(0,p.jsx)(n.default,{style:{alignSelf:'flex-start',paddingHorizontal:5,paddingVertical:1,borderRadius:4,borderWidth:1,borderColor:'flat'===t?s.C.line:o},children:(0,p.jsx)(s.T,{style:{fontSize:i,lineHeight:i+4,fontFamily:'InterSemi',color:o},children:e})})}function B({label:e,a11y:t}){return(0,p.jsx)(n.default,{accessibilityLabel:t||e,style:{alignSelf:'flex-start',paddingHorizontal:4,paddingVertical:1,borderRadius:3,borderWidth:1,borderColor:s.C.mint},children:(0,p.jsx)(s.T,{style:{fontSize:11,lineHeight:14,letterSpacing:.7,fontFamily:'InterSemi',color:s.C.mint},children:e})})}function N({text:e,detail:t}){return(0,p.jsx)(f.CenterNote,{icon:"clock",text:e,children:!!t&&(0,p.jsx)(s.T,{style:{fontSize:11,lineHeight:16,color:s.C.muted,textAlign:'center',maxWidth:340},children:t})})}function V(){return(0,p.jsxs)(n.default,{style:{flex:1,alignItems:'center',justifyContent:'center',gap:10,padding:20},children:[(0,p.jsx)(i.default,{color:s.C.green}),(0,p.jsx)(s.T,{style:{fontSize:12,color:s.C.muted},children:"Reading the F&O store\u2026"})]})}const E=530,A=1,M=1.5,D=1200,K=760,X=12;function q(e,t){return e?{chart:{height:t},content:{height:t}}:{chart:{flex:A,minWidth:0,height:t},content:{flex:M,minWidth:0,height:t}}}function U({label:e,value:t,against:l,chip:i,chipTone:o,tag:c,reason:u}){const f=!t||t===G,h=f?u||'not captured':`${t}${c?` ${c}`:''}${l?`. ${l}`:''}${i?`. ${i}`:''}`;return(0,p.jsxs)(n.default,{accessibilityRole:"text",accessibilityLabel:`${e}: ${h}`,style:[s.s.row,{gap:14,flexWrap:'wrap',paddingHorizontal:14,paddingVertical:10,borderRadius:12,borderWidth:1,borderColor:s.C.line,backgroundColor:s.C.dark}],children:[(0,p.jsxs)(n.default,{style:{gap:1,minWidth:0},children:[(0,p.jsx)(s.T,{numberOfLines:1,style:g,children:e}),(0,p.jsxs)(n.default,{style:[s.s.row,{gap:7}],children:[(0,p.jsx)(s.T,{numberOfLines:1,style:{fontFamily:'ManropeBold',fontSize:26,lineHeight:32,letterSpacing:-.6,color:f?s.C.muted:s.C.ink,fontVariant:['tabular-nums']},children:t}),!!c&&!f&&(0,p.jsx)(B,{label:c})]})]}),(0,p.jsx)(s.T,{numberOfLines:2,style:{flex:1,minWidth:150,fontSize:12,lineHeight:17,color:s.C.muted},children:f?u||'':l||''}),!f&&!!i&&(0,p.jsx)(F,{label:i,tone:o,size:10})]})}const G='\u2014';function J({label:e,linked:t,large:l}){return e?(0,p.jsxs)(n.default,{style:[s.s.row,{gap:5,alignSelf:'flex-start',paddingHorizontal:l?10:7,paddingVertical:l?4:2,borderRadius:7,borderWidth:1,borderColor:t?s.C.green:s.C.line,backgroundColor:t?s.C.soft:s.C.bg}],children:[!!t&&(0,p.jsx)(n.default,{style:{width:5,height:5,borderRadius:3,backgroundColor:s.C.green}}),(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:l?12:11,lineHeight:l?17:15,fontFamily:'InterSemi',color:t?s.C.green:s.C.muted},children:e})]}):null}},924,[11,13,375,360,278,136,821,871,832,925,926,6]); 1018__d(function(g,r,_i,a,m,_e,d){"use strict";
1018function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"web",{enumerable:!0,get:function(){return s.web}}),Object.defineProperty(_e,"webOnly",{enumerable:!0,get:function(){return s.webOnly}}),Object.defineProperty(_e,"BLOCK_COLORS",{enumerable:!0,get:function(){return p}}),_e.CardShell=x,Object.defineProperty(_e,"HeaderChip",{enumerable:!0,get:function(){return C}}),_e.RadioMenu=function({label:e,options:c,value:u,onPick:f,onClose:h,note:y}){const p=(0,o.useRoving)(c.length,'vertical');return t.default.useEffect(()=>{if(!s.web)return;const e=Math.max(0,c.findIndex(e=>e.value===u)),t=setTimeout(()=>p.refs.current[e]?.focus?.(),0);return()=>clearTimeout(t)},[]),(0,b.jsxs)(n.default,{role:"menu","aria-label":e,children:[c.map((e,t)=>{const o=e.value===u;return(0,b.jsxs)(l.default,{ref:e=>{p.refs.current[t]=e},role:"menuitemradio","aria-checked":o,"aria-disabled":!!e.disabled,accessibilityLabel:e.label,accessibilityState:{checked:o,disabled:!!e.disabled},disabled:e.disabled,...(0,s.webOnly)({tabIndex:o?0:-1,onKeyDown:e=>p.onKeyDown(t,e)}),onPress:()=>{h(),o||f(e.value)},style:t=>[i.s.row,{minHeight:44,paddingHorizontal:14,gap:10,backgroundColor:t.hovered||t.focused?i.C.soft:'transparent',opacity:e.disabled?.45:1}],children:[(0,b.jsx)(n.default,{style:{width:15},children:o&&(0,b.jsx)(i.Icon,{name:"check",size:15,color:i.C.green})}),(0,b.jsxs)(n.default,{style:{flex:1},children:[(0,b.jsx)(i.T,{style:{fontSize:13,color:o?i.C.green:i.C.ink},children:e.label}),!!e.detail&&(0,b.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:e.detail})]})]},e.value)}),!!y&&(0,b.jsx)(i.T,{style:{fontSize:11,color:i.C.muted,paddingHorizontal:14,paddingVertical:6},children:y})]})},_e.Skeleton=function({lines:e=4,chart:t=!1}){return(0,b.jsxs)(n.default,{"aria-hidden":!0,style:{flex:1,padding:12,gap:10},children:[t&&(0,b.jsx)(n.default,{style:{flex:1,minHeight:120,borderRadius:8,backgroundColor:i.C.soft,opacity:.5}}),Array.from({length:e}).map((e,t)=>(0,b.jsx)(n.default,{style:{height:12,width:90-14*t+"%",borderRadius:4,backgroundColor:i.C.line}},t))]})},_e.LinkText=function({label:e,a11y:t,onPress:n,disabled:o}){return(0,b.jsx)(l.default,{accessibilityRole:"link",accessibilityLabel:t||e,accessibilityState:{disabled:!!o},disabled:o,onPress:n,hitSlop:y,style:e=>({minHeight:28,justifyContent:'center',opacity:o?.4:e.pressed?.7:1}),children:t=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.HitArea,{slop:y}),(0,b.jsx)(i.T,{numberOfLines:1,style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:i.C.green,textDecorationLine:t.hovered||t.focused?'underline':'none'},children:e})]})})},_e.CenterNote=j,_e.StaleLine=function({stale:e,ageDays:t}){const l=(0,u.useProduct)()?.state?.data_status;if(!e)return null;const o=(0,c.cardWarning)(l,{stale:e,ageDays:t});return o?(0,b.jsxs)(n.default,{style:[i.s.row,{gap:6}],children:[(0,b.jsx)(i.Icon,{name:"alert-circle",size:12,color:i.C.amber}),(0,b.jsx)(i.T,{style:{fontSize:11,lineHeight:15,color:i.C.amber,flex:1},children:o})]}):null},_e.ComingSoonCard=function({title:e,detail:t,style:n}){return(0,b.jsx)(x,{label:e,style:n,header:(0,b.jsx)(i.T,{numberOfLines:1,style:{flex:1,fontFamily:'InterSemi',fontSize:11,letterSpacing:1,textTransform:'uppercase'},children:e}),children:(0,b.jsx)(j,{icon:"clock",text:t})})};var t=e(r(d[0])),n=e(r(d[1])),l=e(r(d[2])),i=r(d[3]),o=r(d[4]),s=r(d[5]),c=r(d[6]),u=r(d[7]),f=r(d[8]),b=r(d[9]);const h=(0,f.touchSlop)(32),y=(0,f.touchSlop)(28),p=[i.C.green,i.C.amber,i.C.blue,i.C.purple];function x({label:e,header:t,children:l,style:o,footer:s}){return(0,b.jsxs)(n.default,{role:"region","aria-label":e,style:[{backgroundColor:i.C.paper,borderWidth:1,borderColor:i.C.line,borderRadius:12,overflow:'hidden',minWidth:0},o],children:[(0,b.jsx)(n.default,{style:[i.s.row,{paddingLeft:12,paddingRight:2,minHeight:44,borderBottomWidth:1,borderColor:i.C.line,gap:4}],children:t}),(0,b.jsx)(n.default,{style:{flex:1,minHeight:0},children:l}),null!=s&&!1!==s&&(0,b.jsx)(n.default,{style:{borderTopWidth:1,borderColor:i.C.line,paddingHorizontal:12,paddingVertical:7,gap:3},children:s})]})}const C=t.default.forwardRef(function({label:e,a11y:t,onPress:n,expanded:o,icon:c="chevron-down",tone:u,style:y},p){return(0,b.jsxs)(l.default,{ref:p,accessibilityRole:"button",accessibilityLabel:t,...(0,s.webOnly)({'aria-haspopup':null==o?void 0:'menu','aria-expanded':o}),onPress:n,hitSlop:h,style:e=>[i.s.row,{gap:6,minHeight:32,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:o?i.C.green:i.C.line,backgroundColor:e.hovered||e.focused?i.C.soft:i.C.paper,opacity:e.pressed?.7:1},y],children:[(0,b.jsx)(f.HitArea,{slop:h}),(0,b.jsx)(i.T,{numberOfLines:1,style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:u||i.C.ink},children:e}),!!c&&(0,b.jsx)(i.Icon,{name:c,size:14,color:i.C.muted})]})});function j({icon:e="mouse-pointer",text:t,children:l}){return(0,b.jsxs)(n.default,{style:{flex:1,alignItems:'center',justifyContent:'center',padding:20,gap:10},children:[(0,b.jsx)(i.Icon,{name:e,size:20,color:i.C.muted}),(0,b.jsx)(i.T,{style:{fontSize:13,color:i.C.muted,textAlign:'center',maxWidth:300},children:t}),l]})}},925,[11,13,375,821,871,869,879,196,832,6]); 1019__d(function(e,t,n,r,i,o,a){"use strict";Object.defineProperty(o,'__esModule',{value:!0}),Object.defineProperty(o,"DASH",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"MINUS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"RUPEE",{enumerable:!0,get:function(){return l}}),Object.defineProperty(o,"TIMES",{enumerable:!0,get:function(){return c}}),Object.defineProperty(o,"EMPTY_TEXT",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"NO_BASELINE",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"MONTHS",{enumerable:!0,get:function(){return h}}),o.crore=p,o.units=g,o.compact=b,o.signed=_,o.signedUnits=y,o.price=$,o.strike=v,Object.defineProperty(o,"INDEX_UNDERLYINGS",{enumerable:!0,get:function(){return w}}),o.isIndexUnderlying=S,o.level=O,o.seriesPriceText=function(e,t){return'underlying'===t?.kind||'FUT'===String(t?.instrument_type||'').trim().toUpperCase()?T(e,t?.underlying):$(e)},o.spotLevel=T,o.ratio=N,o.stamp=P,o.asOfText=function(e){const t=P(e);return t?`As of ${t.date}${t.time?` \xb7 ${t.time} IST`:''}`:'Not captured yet'},o.clock=E,o.dteText=I,o.expiryText=function(e,t){const n=P(e);if(!n)return u;const r=I(t);return r===u?n.date:`${n.date} \xb7 ${r}`},Object.defineProperty(o,"BUILDUP_LABELS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"BUILDUP_STATE_LABELS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(o,"BUILDUP_IDS",{enumerable:!0,get:function(){return M}}),Object.defineProperty(o,"BUILDUP_WIRE",{enumerable:!0,get:function(){return L}}),Object.defineProperty(o,"BUILDUP_UNKNOWN",{enumerable:!0,get:function(){return C}}),o.buildupId=k,o.buildupLabel=U,o.buildupChoiceLabel=R,o.buildupTone=function(e){const t=k(e);return'long_buildup'===t||'short_covering'===t?'up':'short_buildup'===t||'long_unwinding'===t?'down':'flat'},Object.defineProperty(o,"BUILDUP_FROM_MOVES",{enumerable:!0,get:function(){return D}}),o.buildupFromMoves=function(e,t){return D[`${String(e||'')}|${String(t||'')}`]||'unknown'},o.buildupPair=function(e){return{fifteen:U(e?.buildup_15m),day:U(e?.buildup_day)}},o.volumeRatio=F,o.volumeRatioShort=function(e,t=3){const n=m(e?.volume_ratio),r=m(e?.volume_baseline_sessions);return'ok'!==e?.volume_baseline||null==n||null==r||r<t?f:`${n.toFixed(1)}${c}`},o.volumeToOi=function(e){const t=m(e?.volume_to_oi);if(null==t)return u;const n=m(e?.volume),r=m(e?.previous_oi),i=null!=n&&null!=r?` (${g(n)} traded vs ${g(r)} standing)`:'';return`${t.toFixed(2)}${c}${i}`},Object.defineProperty(o,"volumeToOiHot",{enumerable:!0,get:function(){return B}}),o.pcrText=G,o.maxPainText=function(e){const t=m(e?.max_pain_strike);if(null==t)return u;const n=m(e?.max_pain_distance);return null==n?v(t):0===Math.round(n)?`${v(t)}
1019 \xb7 spot at max pain`:`${v(t)} \xb7 spot ${g(Math.abs(n))} ${n>0?'above':'below'}`},o.maxPainBasis=function(e,t){const n=m(e),r=m(t);return null==n&&null==r?'Total OI behind it: not captured':`From ${g((n||0)+(r||0))} contracts of open interest (CE ${b(n)} \xb7 PE ${b(r)})`},o.oiShareText=function(e){const t=m(e);return null==t?f:`${t.toFixed(2)}${c} its 20-day average`},o.basisText=V,o.cardState=function(e,t={}){if(t.error)return{phase:'error',text:t.error};if(!e)return{phase:!1===t.loading?'empty':'loading',text:!1===t.loading?d:'Reading the F&O store\u2026'};if(!e.available||!e.captured)return{phase:'empty',text:e.empty_reason||e.empty_text||d};return(e.rows||e.points||e.candles||[]).length?{phase:'ready',text:''}:{phase:'empty',text:e.empty_note||t.emptyText||'Nothing clears the filters at this reading.'}},o.floorsText=function(e,t){return t||(e?`Liquidity floors in force: premium traded \u2265 ${l}${e.premium_cr} cr, OI \u2265 ${e.oi_lots} lot, last price \u2265 ${l}${e.last_price}.`:'')},o.floorsDegradedNote=function(e){if(!e||!e.floors_degraded)return'';const t=e.floors_labels||{},n=(e.floors_applied||[]).map(e=>t[e]||e),r=(e.floors_unmeasured||[]).concat(e.floors_absent||[]).map(e=>t[e]||e);if(!r.length)return'';return`${n.length?`These rows were gated on ${n.length} of the 3 liquidity floors \u2014 ${n.join(', ')}.`:'No liquidity floor could be applied at this reading.'} Not applied here: ${r.join(', ')} \u2014 the number it rests on was not captured at this reading, so no contract in the list failed it.`},Object.defineProperty(o,"MISSING_LABELS",{enumerable:!0,get:function(){return W}}),o.missingText=function(e,t=[]){const n=(e||[]).filter(e=>!t.length||t.includes(e));if(!n.length)return'';const r=n.map(e=>W[e]||e.replace(/_/g,' ')),i=r.slice(0,3).join(', '),o=r.length>3?` and ${r.length-3} more`:'';return`Not captured yet: ${i}${o}.`},o.sourceText=function(e){return'metrics_module'===e?'Signals read from the derivatives metrics.':'store'===e?'Signals read from the stored metrics.':''},o.groupSummary=function(e){const t=[];e.calls&&t.push(`${e.calls} call strike${1===e.calls?'':'s'}`);e.puts&&t.push(`${e.puts} put strike${1===e.puts?'':'s'}`);const n=t.length?`${t.join(' and ')} over the floors`:`${e.strike_count} strikes over the floors`,r=null==e.oi_change_day?'':` \xb7 OI ${y(e.oi_change_day)} today`;return null==e.premium_cr?`${n} \xb7 premium traded not captured at this reading${r}`:`${n} \xb7 ${p(e.premium_cr,e.premium_cr>=10?0:1)} traded${r}`},o.strikeSummary=function(e,t=3){const n='CE'===e.instrument_type?'call':'PE'===e.instrument_type?'put':e.instrument_type||'';return`${v(e.strike)} ${n} \xb7 ${p(e.premium_cr)} \xb7 ${U(e.buildup_day)} \xb7 volume ${F(e,t)}`},o.scaleSeries=function(e,t,n,r){const i=e.map(e=>{const n=e?.[t];return'number'==typeof n&&Number.isFinite(n)?n:null}),o=i.filter(e=>null!=e);if(o.length<2||n<=0||r<=0)return null;const a=Math.min(...o),u=Math.max(...o),s=u-a||Math.abs(u)||1,l=e.length>1?n/(e.length-1):0;return{lo:a,hi:u,points:i.map((e,t)=>null==e?null:{x:t*l,y:r-(e-a)/s*r,i:t})}},o.linePath=function(e){if(!e)return'';let t='',n=!1;for(const r of e.points)r?(t+=`${n?'L':'M'}${r.x.toFixed(2)},${r.y.toFixed(2)}`,n=!0):n=!1;return t},o.nearestStrikeIndex=H,o.oiPeak=function(e){let t=0;for(const n of e||[])for(const e of[n.ce_oi,n.pe_oi]){const n=m(e);null!=n&&n>t&&(t=n)}return t>0?t:null},Object.defineProperty(o,"DEFAULT_FILTERS",{enumerable:!0,get:function(){return X}}),o.sanitizeFilters=function(e,t){const n=e||{},r=(e,t=40)=>'string'==typeof e&&e.length<=t?e:'',i=(e,t)=>'number'==typeof e&&Number.isFinite(e)&&e>=0&&e<=t?e:null,o=r(n.optionType),a=/^[A-Z0-9&._-]{1,40}$/.test(r(n.underlying))?r(n.underlying):'',u=K.test(r(n.expiry))?r(n.expiry):'';return{watchlist:r(n.watchlist,20)||X.watchlist,underlying:a,expiry:t?Y(u,t,a):u,maxDte:i(n.maxDte,400),optionType:'CE'===o||'PE'===o?o:'',minPremiumCr:i(n.minPremiumCr,1e5)}},o.currentExpiry=Y,Object.defineProperty(o,"DTE_CHOICES",{enumerable:!0,get:function(){return q}}),Object.defineProperty(o,"PREMIUM_CHOICES",{enumerable:!0,get:function(){return z}}),o.unusualQuery=function(e){const t=[];e.underlying&&t.push(`underlying=${encodeURIComponent(e.underlying)}`);e.expiry&&t.push(`expiry=${encodeURIComponent(e.expiry)}`);
1019e.watchlist&&'all'!==e.watchlist&&t.push(`watchlist=${encodeURIComponent(e.watchlist)}`);e.optionType&&t.push(`option_type=${e.optionType}`);null!=e.maxDte&&t.push(`max_dte=${Math.max(0,Math.round(e.maxDte))}`);null!=e.minPremiumCr&&t.push(`min_premium_cr=${e.minPremiumCr}`);return t.length?`?${t.join('&')}`:''},o.filterText=function(e,t=""){const n=[];if(n.push(e.underlying||t||'All underlyings'),e.expiry){const t=P(e.expiry);t&&n.push(t.date)}null!=e.maxDte&&n.push(q.find(t=>t.value===e.maxDte)?.label||`Within ${e.maxDte} days`);e.optionType&&n.push('CE'===e.optionType?'Calls only':'Puts only');null!=e.minPremiumCr&&n.push(`\u2265 ${l}${e.minPremiumCr} cr`);return n.join(' \xb7 ')},o.expiriesFor=function(e,t){const n=(e||[]).filter(e=>!t||e.underlying===t),r=new Map;for(const e of n)r.has(e.expiry)||r.set(e.expiry,{expiry:e.expiry,days_to_expiry:e.days_to_expiry});return Array.from(r.values()).sort((e,t)=>e.expiry<t.expiry?-1:1)},Object.defineProperty(o,"OPERATOR_LABELS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(o,"FILTER_COLUMNS",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(o,"filterColumn",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"columnLabel",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(o,"DTE_VALUES",{enumerable:!0,get:function(){return te}}),Object.defineProperty(o,"PREMIUM_VALUES",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(o,"VOLUME_RATIO_VALUES",{enumerable:!0,get:function(){return re}}),Object.defineProperty(o,"VOLUME_TO_OI_VALUES",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(o,"OI_CHANGE_VALUES",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(o,"BUILDUP_VALUES",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(o,"BUILDUP_WINDOWS",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(o,"BUILDUP_WINDOW_DEFAULT",{enumerable:!0,get:function(){return se}}),Object.defineProperty(o,"MONEYNESS_VALUES",{enumerable:!0,get:function(){return le}}),Object.defineProperty(o,"MARKET_VALUES",{enumerable:!0,get:function(){return ce}}),o.sanitizeRules=me,o.currentRules=function(e,t){const n=e||[],r=n.find(e=>'expiry'===e.column);if(!r)return n;const i=n.find(e=>'underlying'===e.column)?.value||'';return Y(r.value,t,i)===r.value?n:n.filter(e=>e!==r)},o.freeColumns=pe,o.newRule=function(e){const t=pe(e||[])[0];return t?{column:t.key,operator:t.operators[0],value:''}:null},o.withColumn=function(e,t){const n=Q(t);return n&&n.key!==e.column?{column:n.key,operator:n.operators[0],value:''}:e},o.rulesToFilters=function(e){const t={...X};for(const n of me(e))'underlying'===n.column?t.underlying=n.value:'expiry'===n.column?t.expiry=n.value:'optionType'===n.column?t.optionType='is_not'===n.operator?'CE'===n.value?'PE':'CE':n.value:'dte'===n.column?t.maxDte=Math.max(0,Math.round(Number(n.value))-1):'premium'===n.column?t.minPremiumCr=Math.round(100*(Number(n.value)+.01))/100:'watchlist'===n.column&&(t.watchlist=n.value);return t},o.customizeLabel=function(e){return e>0?`Customize (${e} filter${1===e?'':'s'})\u2026`:'Customize\u2026'},o.ruleText=ge,o.rulesText=function(e,t){const n=me(e);return n.length?n.map(e=>ge(e,t?.(e))).join(' \xb7 '):'No filters \u2014 every contract over the liquidity floors'},o.nextSort=function(e,t){return e&&e.key===t?'desc'===e.dir?{key:t,dir:'asc'}:null:{key:t,dir:'desc'}},o.compareValues=be,o.sortRows=function(e,t,n){return(e||[]).map((e,t)=>({row:e,i:t})).sort((e,r)=>be(t(e.row),t(r.row),n)||e.i-r.i).map(e=>e.row)},o.shortDate=_e,o.contractSummary=function(e){const t=_e(e?.expiry),n=null==m(e?.strike)?'':`${S(e?.underlying,e?.underlying_kind)?'':l}${v(e?.strike)}`,r=String(e?.instrument_type||'').trim(),i=[t,n,r].filter(Boolean);return i.length?i.join(' '):u},o.optionTone=function(e){const t=String(e||'').toUpperCase();return'CE'===t?'call':'PE'===t?'put':'flat'},o.flattenUnusual=function(e){const t=[];for(const n of e||[])for(const e of n?.strikes||[])t.push(e);return t},o.rowKey=function(e,t=0){return String(e?.instrument_token??e?.tradingsymbol??`${e?.underlying}-${e?.strike}-${e?.instrument_type}-${t}`)},Object.defineProperty(o,"GRID_DIRECTION_LOOKBACK",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(o,"DIRECTION_GRID_MINUTES",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(o,"GRID_DIRECTION_LOOKBACK_MINUTES",{enumerable:!0,get:function(){return ve}}),o.stampSeconds=we,o.lookbackIndex=Se,o.onDecisionGrid=Oe,o.directionAnchor=Te,Object.defineProperty(o,"GRID_FLAT_FRACTION",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(o,"GRID_PRICE_FLAT_FRACTION",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(o,"GRID_BLOCK_BALANCE_RATIO",{enumerable:!0,get:function(){return Ee}}
1019),Object.defineProperty(o,"GRID_NOT_ENOUGH_MARKS",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(o,"GRID_NO_DELTA",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(o,"DIRECTION_CHIPS",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(o,"NO_DIRECTION",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(o,"FLOW_LABELS",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(o,"FLOW_OBSERVATIONS",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(o,"FLOW_ATTRIBUTIONS",{enumerable:!0,get:function(){return je}}),Object.defineProperty(o,"FLOW_FLAT_WHAT",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(o,"FLOW_FLAT_MEANING",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(o,"FLOW_NOT_ENOUGH",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(o,"GRID_BLOCK_BOTH_BUILDING",{enumerable:!0,get:function(){return De}}),Object.defineProperty(o,"GRID_LEGEND_TEXT",{enumerable:!0,get:function(){return Fe}}),o.deltaUnits=Be,o.gridDirection=We,o.gridPriceDirection=He,o.gridFlow=Xe,o.gridDeltaChange=Ke,o.gridBlockRead=function(e,t=Ee){let n=0,r=0,i=0,o=0;for(const t of e||[]){const e=Ke(t?.points);null!=e&&('puts'===t.row?(r+=e,o++):(n+=e,i++))}if(!i||!o||n<=0||r<=0)return'';const a=Math.max(n,r),u=Math.min(n,r);return u<=0||a>t*u?'':De},o.gridPriceSpoken=Ye,o.directionChip=function(e){return Ae[String(e||'')]||''},o.directionTone=function(e){const t=String(e||'');return'building'===t?'up':'unwinding'===t?'down':'flat'},o.gridSlotTitle=qe,o.gridSlotDetail=function(e){if(!e)return'';if(!e.present)return e.label;const t=e.marks_with_delta??0;return`${e.label} \xb7 ${t}
1019 reading${1===t?'':'s'}`},o.gridSlotNote=ze,o.gridSlotLabel=function(e,t){if(!e)return'';if(!e.present)return ze(e);const n=String(t||e.direction||''),r=Ae[n],i=r?r.replace(/^[^ ]+ /,'').toLowerCase():Me;return`${qe(e)}, ${e.label}. Open interest ${Be(e.latest_delta_oi)} against the previous close over ${e.marks_with_delta} captured reading${1===e.marks_with_delta?'':'s'}. ${i}. ${Ye(e)}`},o.scaleDelta=function(e,t,n){const r=(e||[]).map(e=>m(e?.delta_oi)),i=r.filter(e=>null!=e);if(!i.length||t<=0||n<=0)return null;const o=Math.min(0,...i),a=Math.max(0,...i),u=a-o||1,s=e=>n-(e-o)/u*n,l=r.length>1?t/(r.length-1):0;return{lo:o,hi:a,height:n,zero:s(0),real:i.length,points:r.map((e,t)=>null==e?null:{x:t*l,y:s(e),i:t})}},o.scaleGridPrice=function(e,t,n){const r=(e||[]).map(e=>m(e?.price)),i=r.filter(e=>null!=e);if(i.length<2||t<=0||n<=0)return null;const o=Math.min(...i),a=Math.max(...i),u=a-o||Math.abs(a)||1,s=r.length>1?t/(r.length-1):0;return{lo:o,hi:a,points:r.map((e,t)=>null==e?null:{x:t*s,y:n-(e-o)/u*n,i:t})}},o.deltaAxis=function(e){if(!e)return[];const t=e.hi-e.lo||1,n=[];for(const r of[e.hi,0,e.lo]){const i=e.height-(r-e.lo)/t*e.height;n.some(e=>Math.abs(e.y-i)<9)||n.push({v:r,y:i})}return n},o.axisTimes=function(e,t=4){const n=(e||[]).map((e,t)=>({i:t,label:E(e?.at)})).filter(e=>e.label!==u);if(!n.length)return[];const r=n.filter(e=>e.label.endsWith(':30')),i=r.length>=2?r:n;if(i.length<=t)return i;const o=(i.length-1)/(t-1),a=[];for(let e=0;e<t;e++){const t=i[Math.round(e*o)];t&&!a.some(e=>e.i===t.i)&&a.push(t)}return a},o.gridBasis=function(e){if(!e)return'';const t=null==e.atm_strike?u:v(e.atm_strike),n=null==e.spot?u:T(e.spot,e.underlying),r=(e.marks||[]).length,i=r?` ${r} reading${1===r?'':'s'} captured, ${E(e.marks[0])} to ${E(e.marks[r-1])}.`:'',o=e.expiry?P(e.expiry)?.date||e.expiry:'';return`At the money: ${t}, from a captured spot of ${n}${o?` in the ${o} expiry`:''}.${i}`},o.gridSourceText=function(e){return'snapshots'===e?'Readings taken from the live capture.':'candles_15m'===e?'Readings taken from the 15-min candle backfill; the live capture has not written this session yet.':'read_api'===e?'Readings taken from the derivatives reader.':''},Object.defineProperty(o,"FUTURES_INTERVALS",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(o,"FUTURES_DEFAULT_INTERVAL",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(o,"FUTURES_NO_SYMBOL",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(o,"FUTURES_NO_CANDLES",{enumerable:!0,get:function(){return et}}),Object.defineProperty(o,"FUTURES_SHORT_HISTORY",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(o,"FUTURES_GAP_TEXT",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(o,"FUTURES_DISPLAY_TEXT",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(o,"FUTURES_FEW_CANDLES",{enumerable:!0,get:function(){return it}}),Object.defineProperty(o,"FUTURES_INTERVAL_NOTE",{enumerable:!0,get:function(){return ot}}),o.futuresIntervalChoices=function(e){const t=Array.isArray(e?.intervals)?e.intervals:null,n=t?new Map:null;for(const e of t||[]){if('string'==typeof e){e&&n.set(e,{available:!0,note:''});continue}const t=e||{},r=String(t.interval||'');r&&n.set(r,{available:!1!==t.available,note:String(t.note||'').trim()})}return Je.map(e=>{const t=n?n.get(e.key):null;return!n||!!t?.available?{key:e.key,label:e.label,available:!0,reason:''}:{key:e.key,label:e.label,available:!1,reason:t?.note||`No ${e.label.toLowerCase()} stored for this contract yet.`}})},o.futuresIntervalNote=function(e){return(e||[]).filter(e=>!e.available).map(e=>e.reason).join(' ')},o.futuresChartName=at,o.futuresBars=function(e){const t=m(e?.bars);return null!=t?Math.max(0,Math.round(t)):(e?.candles||[]).filter(e=>!e?.gap&&null!=ut(e)).length},o.futuresChartTitle=function(e,t){const n=String(e?.tradingsymbol||'').trim();if(n)return n;const r=String(t||'').trim();return r?`${r} futures`:'Futures chart'},o.futuresChartSubtitle=function(e){const t=[],n=P(e?.contract?.expiry)?.date||'';n&&t.push(n);const r=I(e?.contract?.days_to_expiry);r!==u&&t.push(r);return t.join(' \xb7 ')},o.futuresNote=function(e,t=Ze){return String(e?.note||'').trim()||ot[String(t)]||''},o.futuresShortText=function(e){return e?.short_history?String(e?.short_history_text||'').trim()||tt:''},o.futuresFewText=function(e,t=it){const n=m(e);return null==n||n<=0||n>=t?'':`Only ${Math.round(n)} candle${1===Math.round(n)?'':'s'} stored for this contract \u2014 every one of them is drawn.`},o.storedCandle=ut,o.scaleCandles=st,Object.defineProperty(o,"CANDLE_MIN_STEP",{enumerable:!0,get:function(){return lt}}),o.candleWindow=function(e,t,n=lt){const r=e||[],i=m(t)||0,o=m(n)||lt;if(!r.length||i<=0||o<=0)return{candles:r,shown:r.length,total:r.length,windowed:!1};const a=Math.max(1,Math.floor(i/o));return r.length<=a?{candles:r,shown:r.length,total:r.length,windowed:!1}:{candles:r.slice(r.length-a),shown:a,total:r.length,windowed:!0}},o.candleWindowText=function(e){return e?.windowed?`Showing the latest ${e.shown} of ${e.total} candles in this series; the panel is too narrow for all of them.`:''},o.candleWindowShort=function(e){return e?.windowed?`Latest ${e.shown} of ${e.total} candles`:''},o.candleDrawnText=function(e,t){const n=m(e),r=m(t);if(null==n||n<=0)return'';const i=Math.round(n),o=null==r?null:Math.round(r);return null!=o&&o>i?`${i} of ${o} stored candles drawn`:`${i} stored candle${1===i?'':'s'} drawn`},o.candleAxis=function(e,t){const n=m(t)||0;if(!e||n<=0)return[];const r=e.hi-e.lo||1,i=[];for(const t of[e.hi,(e.hi+e.lo)/2,e.lo]){const o=n-(t-e.lo)/r*n;i.some(e=>Math.abs(e.y-o)<10)||i.push({v:t,y:o})}return i},o.priceTick=function(e){const t=m(e);if(null==t)return u;const n=Math.abs(t)>=1e3?0:Math.abs(t)>=100?1:2;
1019return t.toLocaleString('en-IN',{minimumFractionDigits:n,maximumFractionDigits:n})},o.candleAxisLabel=ct,o.candleSessions=dt,o.candleAxisTimes=function(e,t=Ze,n=4,r){const i=e||[],o=dt(i),a='1d'!==t&&o.length>1?o.map(e=>({i:e.i,label:_e(i[e.i]?.at)})).filter(e=>!!e.label&&e.label!==u):i.map((e,n)=>({i:n,label:ct(e?.at,t)})).filter(e=>e.label!==u&&''!==e.label);let s=a;if(a.length>n){const e=(a.length-1)/(n-1);s=[];for(let t=0;t<n;t++){const n=a[Math.round(t*e)];n&&!s.some(e=>e.i===n.i)&&s.push(n)}}return ht(s,i.length,r)},Object.defineProperty(o,"CANDLE_LABEL_PX",{enumerable:!0,get:function(){return ft}}),o.thinAxisLabels=ht,o.futuresChartSpoken=function(e,t=Ze,n){const r=e?.candles||[],i=st(r,100,100)?.drawn||0,o=Je.find(e=>e.key===t),a=`${at(e?.contract,n)}, ${(o?.label||'candles').toLowerCase()}.`;if(!i)return`${a} ${et}.`;const s='1d'!==t&&dt(r).length>1,l=e=>{const n=P(e?.at);return n?'1d'===t?_e(e?.at)||u:s?n.time?`${_e(e?.at)} ${n.time}`:_e(e?.at):n.time||u:u},c=l(r[0]),d=l(r[r.length-1]);return`${a} ${i} candle${1===i?'':'s'} stored${c!==u&&d!==u?` from ${c} to ${d}`:''}.`},Object.defineProperty(o,"BLOCK_DEFAULT_RANKED",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(o,"BLOCK_DEFAULT_INDEX",{enumerable:!0,get:function(){return pt}}),o.resolveBlockSymbol=gt,Object.defineProperty(o,"SCREENER_PATH",{enumerable:!0,get:function(){return bt}}),o.screenerParam=_t,o.screenerQuery=function(e,t){const n=[];let r=!1;for(const t of me(e)){const e=_t(t);e&&('buildup'===e.key&&(r=!0),n.push(`${e.key}=${encodeURIComponent(e.value)}`))}const i=String(t?.buildupWindow||'').trim();r&&ue.some(e=>e.value===i)&&n.push(`buildup_window=${i}`);const o=String(t?.at||'').trim();o&&n.push(`at=${encodeURIComponent(o)}`);const a=String(t?.group||'').trim();a&&Pn.some(e=>e.value===a)&&n.push(`group=${a}`);return n.length?`?${n.join('&')}`:''},Object.defineProperty(o,"FILTER_PENDING_REASON",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(o,"FILTER_NOT_APPLIED_REASON",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(o,"FILTER_UNSUPPORTED_REASON",{enumerable:!0,get:function(){return vt}}),o.joinWords=wt,o.filterKey=St,o.servedFilters=Ot,o.servedApplied=Tt,o.filterStatuses=function(e,t,n){const r=me(e),i=Tt(t),o=Array.isArray(i),a=new Map;for(const e of i||[]){const t=St(e);t&&a.set(t,e)}const u=Ot(t),s=Array.isArray(u),l=new Map;for(const e of u||[]){const t=St(e);t&&l.set(t,e)}return r.map(e=>{const t=_t(e),r=Q(e.column),i=t?t.key:r?.param||String(e.column),u=l.get(i),c=ee(e.column),d=ge(e,n?.(e));let f='pending';f=o?a.has(i)?'applied':r?.noScreener||s&&!l.has(i)||u&&!1===u.ready?'unsupported':'not_applied':'pending';const h=(u?.missing_columns||[]).filter(Boolean);return{rule:e,key:i,label:c,text:d,state:f,reason:'applied'===f?'':'pending'===f?yt:'unsupported'===f?r?.noScreener?'The screener has no parameter for this filter, so it was not sent. It still narrows the other lists on this tab.':h.length?`This store does not carry ${wt(h)}, so this filter could not be applied.`:vt:$t}})},o.alwaysApplied=function(e){return(Tt(e)||[]).filter(e=>e&&e.always).map(e=>String(e.text||'').trim()).filter(Boolean)},o.appliedCount=function(e){return(e||[]).filter(e=>'applied'===e.state).length},o.notAppliedText=function(e,t){const n=(e||[]).filter(e=>'applied'!==e.state);if(!n.length)return'';if(t&&String(t).trim())return String(t).trim();const r=e=>e.label.toLowerCase(),i=n.filter(e=>'not_applied'===e.state),o=n.filter(e=>'unsupported'===e.state),a=n.filter(e=>'pending'===e.state),u=[];i.length&&u.push(`The server did not apply ${wt(i.map(r))}.`);o.length&&u.push(`The server has no parameter for ${wt(o.map(r))}.`);a.length&&u.push(`The server has not said whether it applied ${wt(a.map(r))}.`);return`${u.join(' ')} The rows below are NOT narrowed by ${1===n.length?'it':'them'}.`},o.appliedText=function(e){const t=(e||[]).filter(e=>'applied'===e.state);return t.length?t.map(e=>e.text).join(' \xb7 '):(e||[]).length?'No filter applied by the server':'No filters \u2014 every contract over the liquidity floors'},o.resolveTabSymbol=function(e,t,n,r,i){return gt(String(e||'').trim()||String(t||'').trim(),n,r,i)},o.symbolBadge=function(e){return e?.symbol?e.defaulted&&e.label?`${e.label}: ${e.symbol}
1019`:e.symbol:''},Object.defineProperty(o,"NO_SYMBOL_TEXT",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(o,"PCR_CHIPS",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(o,"MAX_PAIN_CHIPS",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(o,"IV_CHIPS",{enumerable:!0,get:function(){return It}}),Object.defineProperty(o,"FUTURES_CHIPS",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(o,"NO_SESSION_DIRECTION",{enumerable:!0,get:function(){return At}}),o.sessionChip=function(e,t){return e[String(t||'')]||''},o.sessionTone=function(e,t){const n=Object.keys(e),r=String(t||'');return r===n[0]?'up':r===n[2]?'down':'flat'},Object.defineProperty(o,"SESSION_LOOKBACK",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(o,"SESSION_FLAT_FRACTION",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(o,"PCR_KEYS",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(o,"MAX_PAIN_KEYS",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(o,"IV_KEYS",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(o,"FUTURES_KEYS",{enumerable:!0,get:function(){return Ut}}),o.sessionDirection=Rt,o.servedDirection=function(e,t,n,r){const i=String(e||'').trim();return n.includes(i)?i:Rt(t,n,Mt,Lt,r)},Object.defineProperty(o,"PCR_OI_LABEL",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(o,"PCR_VOLUME_LABEL",{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(o,"PCR_DEFINITION",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(o,"PCR_READING_TEXT",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(o,"PCR_NO_POINTS",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(o,"PCR_THIN_CHAIN",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(o,"MAX_PAIN_DEFINITION",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(o,"MAX_PAIN_GAP_TEXT",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(o,"MAX_PAIN_READING_TEXT",{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(o,"MAX_PAIN_NO_POINTS",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(o,"MAX_PAIN_THIN_CHAIN",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(o,"IV_COMPUTED_TAG",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(o,"IV_COMPUTED_TEXT",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(o,"IV_ATM_LABEL",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(o,"IV_DEFINITION",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(o,"IV_READING_TEXT",{enumerable:!0,get:function(){return en}}),Object.defineProperty(o,"IV_NO_POINTS",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(o,"IV_THIN_CHAIN",{enumerable:!0,get:function(){return nn}}),Object.defineProperty(o,"IV_REASONS",{enumerable:!0,get:function(){return rn}}),o.ivReasonText=on,o.ivText=an,o.ivTagged=function(e){const t=an(e);return t===u?t:`${t} ${zt}`},o.ivModelText=function(e){const t=String(e?.model||'').trim(),n=m(e?.rate),r=String(e?.rate_label||'').trim()||(null==n?'':`${(Math.abs(n)<=1?100*n:n).toFixed(2)}% risk-free rate`);return t||r?`Model: ${t||'not named by the server'}${r?` \xb7 solved at ${r}`:''}.`:'The server did not name the model or the rate these were solved at.'},o.ivComputedText=function(e){return String(e?.computed_text||'').trim()||Jt},o.ivCoverage=un,o.ivCoverageText=function(e){const{total:t,solved:n,withReason:r}=un(e);return t?`${n} of ${t}
1019 reading${1===t?'':'s'} solved`+(r?`; ${r} carr${1===r?'ies':'y'} a reason instead of a number.`:'.'):''},o.ivStrikeSpoken=function(e){const t=`${v(e?.strike)} ${String(e?.option_type||'').toUpperCase()}`.trim(),n=String(e?.moneyness||'').trim(),r=null!=m(e?.iv)?`computed implied volatility ${an(e?.iv)}`:on(e?.reason,e?.reason_text)||'no computed implied volatility';return`${t}${n?`, ${n}`:''}. ${r}.`},Object.defineProperty(o,"FUTURES_BUILDUP_DEFINITION",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(o,"FUTURES_BUILDUP_READING_TEXT",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(o,"FUTURES_BUILDUP_NO_POINTS",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(o,"FUTURES_BUILDUP_THIN",{enumerable:!0,get:function(){return dn}}),o.basisPair=fn,o.oiVsAvgText=hn,o.scaleValues=function(e,t,n,r=!1){const i=(e||[]).map(e=>m(e)),o=i.filter(e=>null!=e);if(o.length<2||t<=0||n<=0)return null;const a=r?Math.min(0,...o):Math.min(...o),u=r?Math.max(0,...o):Math.max(...o),s=u-a||Math.abs(u)||1,l=i.length>1?t/(i.length-1):0;return{lo:a,hi:u,points:i.map((e,t)=>null==e?null:{x:t*l,y:n-(e-a)/s*n,i:t})}},o.scaleTogether=function(e,t,n,r){const i=(e||[]).map(e=>m(e)),o=(t||[]).map(e=>m(e)),a=[...i,...o].filter(e=>null!=e);if(a.length<2||n<=0||r<=0)return null;const u=Math.min(...a),s=Math.max(...a),l=s-u||Math.abs(s)||1,c=e=>{if(!e.some(e=>null!=e))return null;const t=e.length>1?n/(e.length-1):0;return{lo:u,hi:s,points:e.map((e,n)=>null==e?null:{x:n*t,y:r-(e-u)/l*r,i:n})}};return{lo:u,hi:s,a:c(i),b:c(o)}},Object.defineProperty(o,"VALUE_LABEL_PX",{enumerable:!0,get:function(){return mn}}),o.valueAxis=pn,o.valueAxisLabels=function(e,t,n,r=3){const i=[];for(const o of pn(e,t,r)){const e=n(o.v);e&&e!==u&&(i.some(t=>t.label===e)||i.push({...o,label:e}))}return i},o.sessionAxisTimes=function(e,t=4,n,r=ft){const i=e||[],o=[];let a='';if(i.forEach((e,t)=>{const n=P(e);n&&n.time&&(a&&n.time<=a||(a=n.time,o.push({i:t,label:n.time})))}),!o.length)return[];let u=o;if(o.length>t){const e=(o.length-1)/(Math.max(2,t)-1);u=[];for(let n=0;n<t;n++){const t=o[Math.round(n*e)];t&&!u.some(e=>e.i===t.i)&&u.push(t)}}const s=new Set;return ht(u.filter(e=>!s.has(e.label)&&(s.add(e.label),!0)),i.length,n,r)},o.sessionSpoken=function(e,t,n){const r=(t||[]).filter(e=>null!=m(e)).length,i=n||[];if(!r)return`${e}. Nothing captured yet.`;const o=E(i[0]),a=E(i[i.length-1]);return`${e}. ${r} captured reading${1===r?'':'s'}${o!==u&&a!==u?` from ${o} to ${a}`:''}.`},o.directionWords=function(e,t){const n=e||{},r=t?n[t]:n;return r&&'object'==typeof r&&'string'==typeof r.up&&'string'==typeof r.down?r:null},o.directionMissing=function(e,t){const n=String(e||'').trim();return!(!n||n===At)&&(!t||n!==t.up&&n!==t.down&&n!==t.flat)},o.servedChip=function(e,t,n){const r=String(e||'').trim();if(!r||r===At)return'';const i=String(n?.[r]||'').trim()||r.replace(/_/g,' '),o=r===t?.up?'\u2191':r===t?.down?'\u2193':r===t?.flat?'\u2192':'';return`${o?`${o} `:''}${i.toUpperCase()}`},o.servedTone=function(e,t){const n=String(e||'').trim();return n&&n===t?.up?'up':n&&n===t?.down?'down':'flat'},o.directionRule=function(e){return String(e?.direction_text||'').trim()},o.seriesValues=function(e,t){return(e||[]).map(e=>!0===(e||{}).gap?null:m(t(e)))},o.seriesTimes=function(e){return(e||[]).map(e=>e?.at??null)},o.readingsText=gn,o.withheldLines=bn,o.withheldText=function(e){const t=bn(e);if(!t.length)return'';const n=gn(e);return`${n?`${n}. `:''}${t.join(' ')}`},o.maxPainDistanceText=_n,o.maxPainDistanceRule=function(e){return String(e?.distance_definition||'').trim()},o.maxPainLine=function(e){if(!e)return'';const t=m(e.latest_total_oi),n=m(e.latest_spot),r=null==n?'no spot was captured at this reading, so there is no distance to it':`spot ${T(n,e.underlying)} \xb7 ${_n(e.latest_distance)}`;return`Max pain ${v(e.latest_max_pain_strike)} \xb7 ${r}.`+(null==t?' Total OI behind it: not captured.':` From ${b(t)} contracts of open interest.`)},o.pcrLine=function(e){return e?`${Dt} ${G(e.latest_pcr_oi)} \xb7 ${Ft} ${G(e.latest_pcr_volume)}.`:''},o.ivRateText=yn,o.ivRateSourceShort=function(e){const t=yn(e),n=e?.risk_free_rate_source;if(!t&&!n)return'';const r=String(n?.kind||'').trim(),i=[r,!1===n?.live_feed?'no live feed behind it':!0===n?.live_feed?'from a live feed':''].filter(
1019Boolean).join(', ');return`Solved at a risk-free rate of ${t||'a rate the server did not name'}${i?` \u2014 ${i}`:''}.`},o.ivRateSourceText=function(e){const t=e?.risk_free_rate_source,n=String(t?.text||'').trim(),r=String(t?.where||'').trim();return n?r?`${n} It lives in ${r}.`:n:''},o.ivRateIsAssumed=function(e){return!1===e?.risk_free_rate_source?.live_feed},o.ivRateSensitivityText=function(e){const t=m(e);if(null==t)return'';const n=Math.abs(t);return n<.005?'A rate one percentage point higher would not move this reading at all.':`A rate one percentage point higher would move this reading by ${n.toFixed(2)} percentage point${1===n?'':'s'}${t<0?' down':' up'}.`},o.ivRateSensitivity=function(e){let t=null;for(const n of e||[])for(const e of n?.points||[]){const n=m(e?.rate_sensitivity_pct_points);null!=n&&((null==t||Math.abs(n)>Math.abs(t))&&(t=n))}return t},o.ivRejectionLines=function(e){const t=e?.rejections||{},n=e?.reason_text||{};return Object.entries(t).filter(([,e])=>null!=m(e)&&Number(e)>0).sort((e,t)=>Number(t[1])-Number(e[1])).map(([e,t])=>`${Math.round(Number(t))} reading${1===Math.round(Number(t))?'':'s'}: ${n[e]||e}`)},o.ivMethodText=function(e){const t=String(e?.model||'').trim();if(!t)return'The server did not name the model these were solved with.';const n=String(e?.method||'').trim(),r=String(e?.day_count||'').trim(),i=String(e?.expiry_time_ist||'').trim();return`Model: ${t}${n?` \xb7 ${n}`:''}${r?` \xb7 ${r}${i?` to ${i} IST on the expiry date`:''}`:''}.`},o.ivPointReason=$n,o.ivLatestRefusal=function(e,t){const n=[...e||[]].reverse().find(e=>null==m(e?.iv)&&(e?.reason||e?.reason_text));return n?$n(n,t):''},o.futuresLine=function(e,t){if(!e)return'';const n=Sn(e.latest_buildup_day),r=fn(e.latest_basis,e.latest_basis_pct,t??S(e.underlying));return`${hn(e.latest_oi_vs_avg)} \xb7 ${r===u?vn:`basis ${r}`}`+(n===u?'':` \xb7 ${n} on the day`)+"."},Object.defineProperty(o,"BASIS_NO_SPOT",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(o,"BASIS_NO_SPOT_ROW",{enumerable:!0,get:function(){return wn}}),o.servedBuildup=Sn,o.coverageText=On,Object.defineProperty(o,"SESSION_READINGS",{enumerable:!0,get:function(){return Tn}}),o.readingChoices=function(e,t=Tn){const n=e?.readings||[],r=P(n[0]?.at)?.iso||'',i=r?n.filter(e=>P(e?.at)?.iso===r):n;return(i.length?i:n).slice(0,t).map(e=>{const t=String(e?.at||''),n=P(t),r=m(e?.underlyings);return{value:t,label:n?`${n.date} \xb7 ${n.time}
1019`:t,short:n&&n.time?n.time:t,detail:null==r?'':`${Math.round(r)} underlying${1===Math.round(r)?'':'s'} covered`}}).filter(e=>!!e.value)},o.screenerEmptyDetail=function(e){const t=On(e),n=Array.isArray(e?.readings)&&(e?.readings).length>1?' Earlier readings of this session are listed above; choosing one moves this whole block to it.':'';return`${t}${n}`.trim()},o.readingLabel=Nn,o.readingIsFallback=function(e){return!!e&&!1===e.reading_is_newest&&!e.reading_chosen},o.readingNote=function(e){if(!e||!1!==e.reading_is_newest)return'';const t=Nn(e.reading_at),n=Nn(e.newest_at);if(!t)return'';if(e.reading_chosen)return`Showing the reading of ${t}, the one chosen above.${n?` The newest this store holds is ${n}.`:''}`;const r=m(e.reading_skipped)||0,i=r>0?` No contract cleared the liquidity floors at the ${Math.round(r)} reading${1===Math.round(r)?'':'s'} after it.`:'';return`Showing the reading of ${t} \u2014 NOT the newest this store holds${n?` (${n})`:''}.${i} Any reading can be chosen above.`},o.maxPainAgainstSpot=function(e,t,n,r,i,o){const a=m(t);if(null==a)return'No spot was captured for this underlying at any reading of this session, so there is no distance to it.';const u=String(r||'').trim(),s=String(i||'').trim(),l=[];s&&l.push(`strike ${s}`);l.push(`spot ${T(a,o)}${u?` ${u}`:''}`);const c=m(n);null!=c&&l.push(0===c?'the strike is at spot':`the strike is ${v(Math.abs(c))} ${c>0?'above':'below'} it`);return l.join(' \xb7 ')},o.headlineAgainst=function(...e){return e.map(e=>String(e||'').trim()).filter(e=>e&&!e.endsWith(u)&&e!==u).join(' \xb7 ')},o.pcrAgainst=function(e,t){return null==m(e)&&null==m(t)?'':`${b(e)} put open interest against ${b(t)} call`},Object.defineProperty(o,"SCREENER_VIEWS",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(o,"SCREENER_VIEW_DEFAULT",{enumerable:!0,get:function(){return En}}),o.groupContracts=In,o.groupSplit=xn,o.groupOptionsNote=function(e){const t=m(e?.options)??0,n=m(e?.contracts)??0;return t?t===n?`of ${Math.round(n)}`:`of ${Math.round(t)} options`:'no options listed'},o.groupVolumeRatioMax=An,o.groupVolumeRatioText=Mn,Object.defineProperty(o,"MIN_BASELINE_SESSIONS_TEXT",{enumerable:!0,get:function(){return Ln}}),o.groupHot=function(e){const t=m(e?.volume_to_oi_over_1);return null!=t&&m(e?.volume_to_oi_contracts)?`${Math.round(t)}`:u},o.groupHotText=Cn,o.groupBuildupText=jn,Object.defineProperty(o,"SIGNAL_AGGREGATE_TEXT",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(o,"SIGNAL_BASKET_TEXT",{enumerable:!0,get:function(){return Un}}),Object.defineProperty(o,"SIGNAL_CAVEAT_TEXT",{enumerable:!0,get:function(){return Rn}}),Object.defineProperty(o,"SIGNAL_RULE_TEXT",{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(o,"SIGNAL_NO_DATA",{enumerable:!0,get:function(){return Fn}}),Object.defineProperty(o,"SIGNAL_NO_BASELINE",{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(o,"SIGNAL_NO_WINDOW",{enumerable:!0,get:function(){return Gn}}),Object.defineProperty(o,"SIGNAL_NO_STRENGTH",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(o,"SIGNAL_STRENGTH_BANDS",{enumerable:!0,get:function(){return Wn}}),Object.defineProperty(o,"SIGNAL_STRENGTH_TEXT",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(o,"SIGNAL_STRENGTH_WORDS",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(o,"SIGNAL_STRENGTH_MIN",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(o,"SIGNAL_ARROWS",{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(o,"SIGNAL_ARROWS_DOWN",{enumerable:!0,get:function(){return qn}}),Object.defineProperty(o,"SIGNAL_STABLE",{enumerable:!0,get:function(){return zn}}),Object.defineProperty(o,"SIGNAL_LABELS",{enumerable:!0,get:function(){return Jn}}),Object.defineProperty(o,"SIGNAL_DOTS",{enumerable:!0,get:function(){return Zn}}),o.signalLabel=er,Object.defineProperty(o,"SIGNAL_INTERPRETATIONS",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(o,"SIGNAL_MORE_CALLS",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(o,"SIGNAL_MORE_PUTS",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(o,"SIGNAL_BALANCED",{enumerable:!0,get:function(){return ir}}),Object.defineProperty(o,"SIGNAL_WINDOW_MINUTES",{enumerable:!0,get:function(){return or}}),Object.defineProperty(o,"SIGNAL_WINDOW_MAX_MINUTES",{enumerable:!0,get:function(){return ar}}),Object.defineProperty(o,"SIGNAL_RULE_VERSION",{enumerable:!0,get:function(){return ur}}),o.readingMinutes=sr,o.signalBaselineIndex=lr,Object.defineProperty(o,"SIGNAL_INTERVAL_MINUTES",{enumerable:!0,get:function(){return cr}}),o.intervalIndex=function(e,t,n=cr){if(t<=0)return null;const r=sr(e?.[t]);if(null==r)return t-1;for(let i=t-1;i>=0;i--){const t=sr(e?.[i]);if(null!=t&&r-t>=n)return i}return 0},Object.defineProperty(o,"SIGNAL_LEANS",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(o,"signalLean",{enumerable:!0,get:function(){return fr}}),o.signalSide=mr,o.signalInterpretation=pr,o.marketSignal=gr,o.signalRows=function(e,t=or,n=ar){const r=(e||[]).filter(e=>e&&e.present),i=r.filter(e=>'puts'!==e.row),o=r.filter(e=>'puts'===e.row),a=Math.max(0,...r.map(e=>(e.points||[]).length));if(!a)return[];const s=Array.from({length:a},(e,t)=>r.map(e=>e.points?.[t]?.at).find(Boolean)||null),l={calls:{peak:0,pricePeak:0,ranked:0},puts:{peak:0,pricePeak:0,ranked:0}},c=[];for(let e=0;e<a;e++){const a=s[e],d=lr(s,e,t,n),f=null==d?null:s[d],h=null==d?null:(sr(a)??0)-(sr(f)??0),p=(t,n,r)=>{const i={...r};let o=null,a=null;null!=d&&(o=hr(t,e,d,'delta_oi').change,a=hr(t,e,d,'price').change);const u=null==o?i.peak:Math.max(i.peak,Math.abs(o)),s=null==a?i.pricePeak:Math.max(i.pricePeak,Math.abs(a)
1019),l=i.ranked+(null==o?0:1),c=mr(t,e,d,n,u,s,l);return r.peak=u,r.pricePeak=s,r.ranked=l,c},g=p(i,'CE',l.calls),b=p(o,'PE',l.puts),_={at:a,from:f,window_minutes:h,rule_version:ur};if(!g&&!b){const t=r.some(t=>null!=m(t?.points?.[e]?.delta_oi))?null==d?Gn:Bn:Fn;c.push({..._,calls:null,puts:null,interpretation:'',signal:'',label:u,dot:'',reason:t});continue}const y=gr(g,b);c.push({..._,calls:g,puts:b,interpretation:pr(g,b),signal:y,label:er(y,g,b),dot:y?Zn[y]:'',reason:y?'':Bn})}return c.reverse()},Object.defineProperty(o,"UNUSUAL_RULE_DEFS",{enumerable:!0,get:function(){return br}}),Object.defineProperty(o,"UNUSUAL_RULE_UNCLASSIFIED",{enumerable:!0,get:function(){return _r}}),Object.defineProperty(o,"UNUSUAL_RULE_UNCLASSIFIED_LABEL",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(o,"UNUSUAL_RULE_UNCLASSIFIED_SHORT",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(o,"UNUSUAL_RULE_MAX",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(o,"UNUSUAL_WHAT",{enumerable:!0,get:function(){return wr}}),Object.defineProperty(o,"UNUSUAL_COUNTS_TEXT",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(o,"UNUSUAL_RULE_TEXT",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(o,"UNUSUAL_SORT_TEXT",{enumerable:!0,get:function(){return Tr}}),Object.defineProperty(o,"UNUSUAL_COLOUR_TEXT",{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(o,"UNUSUAL_HONEST_TEXT",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(o,"UNUSUAL_EVIDENCE_LABEL",{enumerable:!0,get:function(){return Er}}),Object.defineProperty(o,"UNUSUAL_EVIDENCE_NONE",{enumerable:!0,get:function(){return Ir}}),Object.defineProperty(o,"UNUSUAL_NONE",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(o,"UNUSUAL_NOT_MEASURED",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(o,"UNUSUAL_NOT_MEASURED_TEXT",{enumerable:!0,get:function(){return Mr}}),o.unusualMeasured=Lr,o.unusualRuleWords=Cr,o.unusualRuleOf=jr,o.unusualRules=kr,o.unusualConditions=Ur,o.unusualContractCount=Rr,o.unusualObservations=Dr,o.unusualDegree=Fr,o.unusualText=Br,o.unusualShort=Gr,o.unusualRuleBadge=Vr,o.unusualBadgesText=Wr,o.unusualRuleDetail=function(e){if(!e)return'';const t=[],n=String(e.comparator||'').trim(),r=m(e.threshold);n&&null!=r&&t.push(`Flagged when ${e.measure||'the measurement'} is ${'>='===n?'at least':'more than'} ${N(r,1)} ${e.baseline_label||'its baseline'}`);const i=m(e.value_max);null!=i&&t.push(`Largest in this instrument ${N(i,1)}${e.value_max_symbol?` on ${e.value_max_symbol}`:''}`);const o=m(e.baseline_at_max);null!=o&&t.push(`measured against ${b(o)}`);const a=m(e.sample_count_at_max);null!=a&&t.push(`over ${Math.round(a)} ${e.sample_label||'observation'}${1===Math.round(a)?'':'s'}`);return t.join(' \xb7 ')},o.unusualTriggerText=function(e,t){if(!e)return'';const n=(t||[]).find(t=>t.rule_id===e.rule_id),r=n?.label||br.find(t=>t.rule_id===e.rule_id)?.label||String(e.text||'')||yr,i=m(e.value),o=[r,null!=i?N(i,1):'no value stored'],a=String(e.comparator||'').trim(),u=m(e.threshold);a&&null!=u&&o.push(`${a} ${N(u,1)}`);const s=m(e.baseline);null!=s&&o.push(`baseline ${b(s)}`);const l=m(e.sample_count);null!=l&&o.push(`${Math.round(l)} observation${1===Math.round(l)?'':'s'}`);return o.join(' \xb7 ')},o.unusualEvidence=function(e){const t=e?.unusual_contracts;return Array.isArray(t)?t.filter(e=>e&&e.tradingsymbol):[]},o.unusualEvidenceSummary=function(e){const t=Ur(e),n=Rr(e),r=Dr(e);return`${t} condition${1===t?'':'s'} \xb7 ${n} contract${1===n?'':'s'} flagged \xb7 ${r} observation${1===r?'':'s'}`},o.unusualRank=function(e){return[Ur(e),m(e?.unusual)||0,m(e?.premium_cr)||0,String(e?.underlying||'')]},o.rankingLabel=function(e){return String(e?.label||'').trim()},o.rankingText=function(e){return[String(e?.text||'').trim(),...(e?.keys||[]).map(e=>String(e?.text||'').trim())].filter(Boolean)},Object.defineProperty(o,"SEARCH_WHAT",{enumerable:!0,get:function(){return Hr}}),Object.defineProperty(o,"SEARCH_NOT_FOUND",{enumerable:!0,get:function(){return Xr}}),o.matchesSearch=Kr,o.searchRows=function(e,t){const n=e||[],r=String(t||'').trim();return r?n.filter(e=>Kr(e?.underlying,r)):n.slice()},o.searchNote=function(e,t,n){const r=String(e||'').trim();return r?t?`${t} of ${n} instrument${1===n?'':'s'} at this reading match \u201c${r}\u201d.`:Xr:''},o.groupTopText=Yr,o.groupRowLabel=function(e,t=3){return[`${e?.underlying||''}.`,Fr(e)?`${Gr(e)}: ${Wr(e)}.`:'',`${In(e)} over the liquidity floors, options and futures together.`,`${p(e?.premium_cr)}
1019 traded.`,null==e?.spot?'':`Spot ${T(e.spot,e?.underlying,e?.underlying_kind)}.`,`Open interest ${b(e?.oi)}, change today ${y(e?.oi_change_day)}.`,Mn(e),Cn(e),jn(e)?`Build-up across those contracts: ${jn(e)}.`:'',Yr(e)?`${Yr(e)}.`:'','Click to point the whole tab at it and open its contracts.'].filter(Boolean).join(' ')},o.groupsCountText=function(e){const t=m(e?.groups_total),n=m(e?.contracts_total),r=m(e?.returned);if(null==t)return'';const i=null!=r&&r<t?`, and this list carries ${Math.round(r)} of them`:'';return`${Math.round(t)} instrument${1===Math.round(t)?'':'s'} have a contract over the floors at this reading${null==n?'':`, ${Math.round(n)} contracts between them`}${i}.`},o.figureAt=qr,o.figureAtText=function(e,t){const n=qr(e,t);return n?`at ${n}`:''},Object.defineProperty(o,"CHAIN_LEAD_ROWS",{enumerable:!0,get:function(){return zr}}),o.chainStartRow=function(e,t,n=zr){const r=H(e||[],t);return null==r?0:Math.max(0,r-n)},Object.defineProperty(o,"CHAIN_AT_MONEY_TEXT",{enumerable:!0,get:function(){return Jr}}),Object.defineProperty(o,"CHAIN_NO_SPOT_TEXT",{enumerable:!0,get:function(){return Zr}}),o.deltaRatio=function(e,t=2,n=4){const r=m(e);if(null==r)return u;let i=t;for(;i<n&&0!==r&&0===Number(Math.abs(r).toFixed(i));)i++;const o=Math.abs(r).toFixed(i);return`${0===Number(o)?'':Qr(r)}${o}`},o.deltaStrikePoints=function(e){const t=m(e);return null==t?u:`${Qr(t)}${Math.round(Math.abs(t)).toLocaleString('en-IN')} pts`},o.deltaVolPoints=function(e,t=1){const n=m(e);return null==n?u:`${Qr(n)}${Math.abs(n).toFixed(t)} vol pts`},o.deltaReasonText=ei,o.deltaSince=function(e,t,n){const r=String(e||'').trim();return r&&r!==u?`${r} since the previous session's close`:ei(t,n)},o.previousCloseText=function(e,t){const n=String(e||'').trim();if(!n||n===u)return String(t?.previous_close_reason||'').trim();const r=Nn(t?.previous_close_at);return`Previous close ${n}${r?` \xb7 ${r}`:''}`},o.previousCloseAtText=function(e){const t=Nn(e);return t?`at ${t}`:''},o.deltaReadingsText=function(e){const t=m(e?.readings_with_delta),n=m(e?.total_readings);return null==t||null==n?'':`${Math.round(t)} of ${Math.round(n)} readings carry a change since the previous close`};const u='\u2014',s='\u2212',l='\u20b9',c='\xd7',d='No F&O data captured yet \u2014 capture starts at the next reading',f='no baseline',h=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],m=e=>'number'==typeof e&&Number.isFinite(e)?e:null;function p(e,t=1){const n=m(e);return null==n?u:`${l}${n.toFixed(t)} cr`}function g(e){const t=m(e);return null==t?u:Math.round(t).toLocaleString('en-IN')}function b(e){const t=m(e);if(null==t)return u;const n=Math.abs(t),r=t<0?s:'',i=e=>{const t=e>=100?e.toFixed(0):e.toFixed(1);return t.endsWith('.0')?t.slice(0,-2):t};return n>=1e7?`${r}${i(n/1e7)}Cr`:n>=1e5?`${r}${i(n/1e5)}L`:n>=1e3?`${r}${i(n/1e3)}k`:`${r}${Math.round(n)}`}function _(e,t=1){const n=m(e);return null==n?u:`${n>0?'+':n<0?s:''}${Math.abs(n).toFixed(t)}%`}function y(e){const t=m(e);return null==t?u:`${t>0?'+':t<0?s:''}${Math.abs(Math.round(t)).toLocaleString('en-IN')}`}function $(e,t=2){const n=m(e);return null==n?u:`${l}${n.toLocaleString('en-IN',{minimumFractionDigits:t,maximumFractionDigits:t})}`}function v(e){const t=m(e);return null==t?u:Math.round(t).toLocaleString('en-IN')}const w=new Set(['NIFTY','BANKNIFTY','FINNIFTY','MIDCPNIFTY','NIFTYNXT50','SENSEX','BANKEX','NIFTYFPI']);function S(e,t){const n=String(e||'').trim().toUpperCase();return'boolean'==typeof t?t:'index'===t||'stock'!==t&&(Array.isArray(t)&&t.length?t.some(e=>String(e||'').trim().toUpperCase()===n):w.has(n))}function O(e,t,n=2,r=n){const i=m(e);if(null==i)return u;const o=i.toLocaleString('en-IN',{minimumFractionDigits:r,maximumFractionDigits:n});return t?o:`${l}${o}`}function T(e,t,n,r=2,i=r){return O(e,S(t,n),r,i)}function N(e,t=2){const n=m(e);return null==n?u:`${n.toFixed(t)}${c}`}function P(e){const t=String(e||'').trim(),n=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?/.exec(t);if(!n)return null;const[,r,i,o,a,u]=n,s=h[Number(i)-1];return s?{date:`${Number(o)} ${s} ${r}`,time:null!=a?`${a}:${u}`:'',iso:`${r}-${i}-${o}`}:null}function E(e){const t=P(e);return t&&t.time?t.time:u}function I(e){const t=m(e);return null==t?u:t<0?'expired':0===t?'expires today':`${Math.round(t)} day${1===Math.round(t)?'':'s'} to expiry`}const x={long_buildup:'Long build-up',short_buildup:'Short build-up',short_covering:'Short covering',long_unwinding:'Long unwinding'},A={flat:'Flat',no_data:'no data'},M=['long_buildup','short_buildup','short_covering','long_unwinding','flat','no_data'],L={...x,...A},C='unrecognised build-up',j=(()=>{const e={};for(const t of M)e[L[t].toLowerCase()]=t;return e})();function k(e){if(null==e)return'missing';const t=String(e).trim();if(!t)return'missing';const n=t.toLowerCase().replace(/[\s-]+/g,'_');return M.includes(n)?n:j[t.toLowerCase()]||'unknown'}function U(e){const t=k(e);return'missing'===t||'no_data'===t?u:'unknown'===t?C:L[t]}function R(e){return'no_data'===k(e)?L.no_data:U(e)}const D={'up|building':'long_buildup','down|building':'short_buildup','up|unwinding':'short_covering','down|unwinding':'long_unwinding','up|flat':'flat','down|flat':'flat','flat|building':'flat','flat|unwinding':'flat','flat|flat':'flat'};function F(e,t=3){const n=m(e?.volume_ratio),r=m(e?.volume_baseline_sessions);return'ok'!==e?.volume_baseline||null==n||null==r||r<t?f:`${n.toFixed(1)}${c} its ${Math.round(r)}-session median`}const B=e=>(m(e?.volume_to_oi)??0)>1;function G(e){const t=m(e);return null==t?u:t.toFixed(2)}function V(e,t=!1){const n=m(e);return null==n?u:`${n>0?'+':n<0?s:''}${O(Math.abs(n),t)}`}const W={premium_cr:'premium (\u20b9 cr)',premium_inr:'premium',oi_change_15m:'OI change (15 min)',oi_change_15m_pct:'OI change % (15 min)',buildup_15m:'build-up (15 min)',oi_change_day:'OI change (day)',oi_change_day_pct:'OI change % (day)',buildup_day:'build-up (day)',volume_ratio:'volume vs its average',volume_baseline_sessions:'baseline sessions',volume_to_oi:'volume-to-OI',previous_oi:'previous close OI',basis:'basis',oi_vs_20d_avg:'OI vs 20-day average',days_to_expiry:'days to expiry',spot:'the underlying price',price_change_15m_pct:'price change (15 min)',price_change_day_pct:'price change (day)'};function H(e,t){const n=m(t);if(null==n||!e?.length)return null;let r=0,i=1/0;return e.forEach((e,t)=>{const o=Math.abs((e.strike??NaN)-n);Number.isFinite(o)&&o<i&&(r=t,i=o)}),Number.isFinite(i)?r:null}const X={watchlist:'all',underlying:'',expiry:'',maxDte:null,optionType:'',minPremiumCr:null};const K=/^\d{4}-\d{2}-\d{2}$/;function Y(e,t,n=""){const r='string'==typeof e&&K.test(e)?e:'';if(!r||!t||!Array.isArray(t.expiries))return'';if(!t.expiries.filter(e=>e&&(!n||e.underlying===n)&&!('number'==typeof e.days_to_expiry&&e.days_to_expiry<0)).some(e=>e.expiry===r))return'';const i=t.served,o=!i?.expiry||!K.test(i.expiry)||n&&i.underlying!==n?'':i.expiry;return o&&r<o?'':r}const q=[{value:null,label:'Any expiry'},{value:0,label:'Expiry day only'},{value:7,label:'Within 7 days'},{value:30,label:'Within 30 days'}],z=[{value:null,label:'Floor (\u20b92 cr)'},{value:5,label:'\u20b95 cr and up'},{value:10,label:'\u20b910 cr and up'},{value:25,label:'\u20b925 cr and up'},{value:50,label:'\u20b950 cr and up'}];const J={is:'is',is_not:'is not',gt:'greater than',lt:'less than',in_watchlist:'is in watch list'},Z=[{key:'underlying',label:'Symbol',operators:['is'],param:'underlying'},{key:'expiry',label:'Exp. date',operators:['is'],param:'expiry'},{key:'optionType',label:'Type',operators:['is','is_not'],param:'option_type'},{key:'dte',label:'DTE',operators:['lt'],param:'max_dte',unit:'days'},{key:'premium',label:'Premium',operators:['gt'],param:'min_premium_cr',unit:'\u20b9 cr'},{key:'watchlist',label:'Watch list',operators:['in_watchlist'],param:'watchlist',noScreener:!0},{key:'volumeRatio',label:'Volume vs median',operators:['gt'],param:'min_volume_ratio',unit:'\xd7 median',route:'screener'},{key:'volumeToOi',label:'Volume to OI',operators:['gt'],param:'min_volume_to_oi',unit:'\xd7',route:'screener'},{key:'oiChange15m',label:'OI change (15 min)',operators:['gt','lt'],param:'min_oi_change_15m_pct',twin:'max_oi_change_15m_pct',unit:'%',route:'screener'},{key:'oiChangeDay',label:'OI change (day)',operators:['gt','lt'],param:'min_oi_change_day_pct',twin:'max_oi_change_day_pct',unit:'%',route:'screener'},{key:'buildup',label:'Build-up',operators:['is'],param:'buildup',route:'screener'},{key:'moneyness',label:'Moneyness',operators:['is'],param:'moneyness',route:'screener'},{key:'market',label:'Index or stock',operators:['is'],param:'underlying_kind',route:'screener'}],Q=e=>Z.find(t=>t.key===e)||null,ee=e=>Q(e)?.label||String(e||''),te=[1,3,7,15,31],ne=[2,5,10,25,50],re=[1.5,2,3,5,10],ie=[.5,1,2,5],oe=[1,2,5,10,25],ae=M.map(e=>L[e]),ue=[{value:'15m',label:'Over the last 15 minutes'},{value:'day',label:'Since the previous close'}],se='15m',le=[{value:'itm',label:'In the money'},{value:'atm',label:'At the money'},{value:'otm',label:'Out of the money'}],ce=[{value:'index',label:'Index'},{value:'stock',label:'Stock'}],de=e=>/^\d{1,3}(\.\d{1,2})?$/.test(e)&&Number(e)>=0&&Number(e)<=999,fe={underlying:e=>/^[A-Z0-9&._-]{1,40}$/.test(e),expiry:e=>/^\d{4}-\d{2}-\d{2}$/.test(e),optionType:e=>'CE'===e||'PE'===e,dte:e=>/^\d{1,3}$/.test(e)&&Number(e)>=1&&Number(e)<=400,premium:e=>/^\d{1,6}(\.\d{1,2})?$/.test(e)&&Number(e)>=0&&Number(e)<=1e5,watchlist:e=>/^[a-z][a-z0-9_-]{0,19}$/.test(e),volumeRatio:e=>/^\d{1,3}(\.\d{1,2})?$/.test(e)&&Number(e)>0&&Number(e)<=999,volumeToOi:e=>/^\d{1,3}(\.\d{1,2})?$/.test(e)&&Number(e)>
10190&&Number(e)<=999,oiChange15m:de,oiChangeDay:de,buildup:e=>M.includes(k(e)),moneyness:e=>le.some(t=>t.value===e),market:e=>ce.some(t=>t.value===e)},he={buildup:e=>k(e)};function me(e){const t=Array.isArray(e)?e:[],n=[],r=new Set;for(const e of t){const t=e||{},i=Q(t.column);if(!i||r.has(i.key))continue;const o=t.operator;if(!i.operators.includes(o))continue;const a='string'==typeof t.value?t.value.trim():'';if(a&&fe[i.key](a)&&(r.add(i.key),n.push({column:i.key,operator:o,value:he[i.key]?.(a)??a}),n.length>=Z.length))break}return n}function pe(e,t){const n=new Set((e||[]).map(e=>e.column));return Z.filter(e=>e.key===t||!n.has(e.key))}function ge(e,t){const n=Q(e?.column),r=!t&&n?.unit?` ${n.unit}`:'';return`${ee(e?.column)} ${J[e?.operator]||e?.operator} ${t||e?.value||''}${r}`.trim()}function be(e,t,n){const r=e=>null==e||''===e||'number'==typeof e&&!Number.isFinite(e)?1:0,i=r(e),o=r(t);if(i||o)return i-o;const a='asc'===n?1:-1;if('number'==typeof e&&'number'==typeof t)return(e-t)*a;const u=String(e),s=String(t);return(u<s?-1:u>s?1:0)*a}function _e(e){const t=P(e);if(!t)return'';const[n,r]=t.date.split(' ');return`${n} ${r}`}const ye=4,$e=15,ve=60;function we(e){const t=String(e??'').replace(/T/g,' ').slice(0,19),n=/^(\d{4})-(\d{2})-(\d{2})(?: (\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(t);if(!n)return null;const[r,i,o,a,u,s]=[n[1],n[2],n[3],n[4]??'0',n[5]??'0',n[6]??'0'].map(Number);if(i<1||i>12||o<1||a>23||u>59||s>59)return null;const l=Date.UTC(r,i-1,o);return new Date(l).getUTCDate()!==o?null:l/1e3+3600*a+60*u+s}function Se(e,t=ye,n=t*$e,r=0){const i=e||[],o=i.length;if(!o)return 0;const a=i.map(we);if(a.some(e=>null==e))return Math.max(0,o-1-t);const u=a[o-1]-60*n;let s=null;for(let e=0;e<o&&a[e]<=u;e++)s=e;return null==s?r:s}function Oe(e){const t=we(String(e??'').trim());if(null==t)return!1;const n=(t%86400+86400)%86400,r=Math.floor(n/3600),i=Math.floor(n/60)%60;return n%60==0&&i%15==0&&60*r+i>=570&&60*r+i<=945}function Te(e){const t=e||[],n=t.map((e,t)=>Oe(e)?t:-1).filter(e=>e>=0);if(!n.length)return{anchor:t.map((e,t)=>t),start:0};const r=t.length-1;return{anchor:n[n.length-1]===r?n:[...n,r],start:n[0]}}const Ne=.05,Pe=.05,Ee=1.33,Ie='Not enough readings captured yet \u2014 the first line appears after two readings',xe='No \u0394OI captured for this strike yet',Ae={building:'\u2191 BUILDING',flat:'\u2192 FLAT',unwinding:'\u2193 UNWINDING'},Me='no baseline',Le={'CE|down|building':['Call writing increasing','Call OI rising as premium falls'],'CE|up|unwinding':['Call short covering','Call sellers are exiting'],'CE|up|building':['Call long build-up','Call OI and premium rising together'],'CE|down|unwinding':['Call buyers exiting','Call buyers are closing out'],'CE|flat|building':['New positions added','Premium barely moved'],'CE|flat|unwinding':['Positions closing out','Premium barely moved'],'CE|up|flat':['Premium rose','Open interest barely moved'],'CE|down|flat':['Premium fell','Open interest barely moved'],'CE|flat|flat':['Very little change','Positioning is unchanged'],'PE|down|building':['Put writing increasing','Put OI rising as premium falls'],'PE|up|unwinding':['Put short covering','Put sellers are exiting'],'PE|up|building':['Put long build-up','Put OI and premium rising together'],'PE|down|unwinding':['Put buyers exiting','Put buyers are closing out'],'PE|flat|building':['New positions added','Premium barely moved'],'PE|flat|unwinding':['Positions closing out','Premium barely moved'],'PE|up|flat':['Premium rose','Open interest barely moved'],'PE|down|flat':['Premium fell','Open interest barely moved'],'PE|flat|flat':['Very little change','Positioning is unchanged']},Ce={'up|building':'Premium up, open interest up','down|building':'Premium down, open interest up','up|unwinding':'Premium up, open interest down','down|unwinding':'Premium down, open interest down','flat|building':'Premium flat, open interest up','flat|unwinding':'Premium flat, open interest down','up|flat':'Premium up, open interest flat','down|flat':'Premium down, open interest flat','flat|flat':'Premium flat, open interest flat'},je={'down|building':'Consistent with option writing; who traded is not known','up|building':'Consistent with long build-up; who traded is not known','up|unwinding':'Consistent with short covering; who traded is not known','down|unwinding':'Consistent with holders closing out; who traded is not known'},ke='Very little change',Ue='Positioning is unchanged',Re='Not enough readings yet',De='Both sides building similarly \u2014 no clear directional edge',Fe='Solid line: \u0394OI, on the left scale. Dashed line: the contract\'s own last traded price, on its own scale.';function Be(e){const t=m(e);if(null==t)return u;const n=Math.abs(t),r=t>0?'+':t<0?s:'',i=e=>{const t=e>=100?e.toFixed(0):e.toFixed(1);return t.endsWith('.0')?t.slice(0,-2):t};return n>=1e7?`${r}${i(n/1e7)}Cr`:n>=1e5?`${r}${i(n/1e5)}L`:n>=1e3?`${r}${i(n/1e3)}K`:`${r}${Math.round(n)}`}function Ge(e,t){const n=[];for(const r of e||[]){const e=m(r?.[t]);null!=e&&n.push({v:e,at:r?.at??null})}return n}function Ve(e,t){const n=e.map(e=>
1019e.at),{anchor:r,start:i}=Te(n),o=Se(n,t,t*$e,i);return o===e.length-1?null:{index:o,anchor:r.map(t=>e[t].v)}}function We(e,t=ye,n=Ne){const r=Ge(e,'delta_oi');if(r.length<2)return Me;const i=Ve(r,t);if(!i)return Me;const o=r.map(e=>e.v),a=i.index,u=o[o.length-1]-o[a],s=Math.max(...i.anchor.map(e=>Math.abs(e)));return 0===s||Math.abs(u)<n*s?'flat':u>0?'building':'unwinding'}function He(e,t=ye,n=Pe){const r=Ge(e,'price');if(r.length<2)return Me;const i=Ve(r,t);if(!i)return Me;const o=r.map(e=>e.v),a=i.index,u=o[o.length-1]-o[a],s=i.anchor[0],l=Math.max(...i.anchor.map(e=>Math.abs(e-s)));return 0===l||Math.abs(u)<n*l?'flat':u>0?'up':'down'}function Xe(e,t){const n=We(t),r=He(t),i=String(e||'').toUpperCase();if(r===Me||n===Me)return{price_direction:r,oi_direction:n,what_label:Re,meaning:'',observation:'',attribution:''};const o=Le[`${i}|${r}|${n}`],a=`${r}|${n}`;return{price_direction:r,oi_direction:n,what_label:o?o[0]:Re,meaning:o?o[1]:'',observation:o&&Ce[a]||'',attribution:o&&je[a]||''}}function Ke(e,t=ye){const n=Ge(e,'delta_oi');if(n.length<2)return null;const r=Ve(n,t);return r?n[n.length-1].v-n[r.index].v:null}function Ye(e){if(!e)return'';const t=Xe(e.option_type,e.points),n=[...e.points||[]].reverse().find(e=>null!=m(e?.price));return`${n?`Price ${$(n.price)}.`:'No price captured for this strike yet.'} ${t.what_label}${t.meaning?`. ${t.meaning}`:''}.${t.observation?` ${t.observation}.`:''}${t.attribution?` ${t.attribution}.`:''}`}function qe(e){if(!e)return u;const t=v(e.strike);return t===u?e.label||u:`${t} ${e.option_type}`}function ze(e){return e?e.present?e.marks_with_delta?'':xe:e.missing_text||'This strike is not listed in this expiry.':xe}const Je=[{key:'15m',label:'15-min candles'},{key:'1d',label:'Daily candles'}],Ze='15m',Qe='Choose a symbol in Customize, or click a row in the screener, to see its front futures contract.',et='No candles stored for this futures contract yet',tt='Too few candles stored to read this as a series.',nt='Every candle drawn was stored. A reading with no candle is left blank \u2014 nothing is interpolated and no candle is carried forward.',rt='This panel draws what was stored for the contract named above. Nothing on it says what comes next.',it=3,ot={'15m':'Each candle is one 15-min bar of the front futures contract, oldest on the left.','1d':'Each candle is one session of the front futures contract, oldest on the left.'};function at(e,t){const n=String(e?.tradingsymbol||'').trim()||(String(t||'').trim()?`${String(t).trim()} futures`:'');if(!n)return'Futures chart';const r=P(e?.expiry)?.date||'';return r?`${n} \xb7 ${r}`:n}function ut(e){const t=m(e?.open),n=m(e?.high),r=m(e?.low),i=m(e?.close);return null==t||null==n||null==r||null==i||n<r||n<Math.max(t,i)||r>Math.min(t,i)?null:{o:t,hi:n,lo:r,c:i}}function st(e,t,n){const r=m(t)||0,i=m(n)||0,o=(e||[]).map(e=>ut(e)),a=o.filter(e=>null!=e);if(!a.length||r<=0||i<=0)return null;const u=Math.min(...a.map(e=>e.lo)),s=Math.max(...a.map(e=>e.hi)),l=s-u||Math.abs(s)||1,c=e=>i-(e-u)/l*i,d=o.length?r/o.length:0,f=Math.max(1,Math.min(11,.62*d));return{lo:u,hi:s,step:d,body:f,drawn:a.length,candles:o.map((e,t)=>null==e?null:{i:t,x:d*(t+.5),open:c(e.o),close:c(e.c),high:c(e.hi),low:c(e.lo),direction:e.c>e.o?'up':e.c<e.o?'down':'flat'})}}const lt=3;function ct(e,t=Ze){return'1d'===t?_e(e)||u:E(e)}function dt(e){const t=[];let n='';return(e||[]).forEach((e,r)=>{const i=P(e?.at)?.iso;i&&i!==n&&(n=i,t.push({i:r,iso:i}))}),t}const ft=46;function ht(e,t,n,r=ft){const i=m(n);if(null==i||i<=0||!t)return e;const o=i/t,a=[];for(const t of e){const e=a[a.length-1];(!e||(t.i-e.i)*o>=r)&&a.push(t)}return a}const mt='First in the screener order',pt='Default';function gt(e,t,n,r){const i=String(e||'').trim();if(i)return{symbol:i,defaulted:!1,label:''};const o=String(t||'').trim();if(o)return{symbol:o,defaulted:!0,label:String(r||'').trim()||mt};const a=String(n||'').trim();return a?{symbol:a,defaulted:!0,label:pt}:{symbol:'',defaulted:!1,label:''}}const bt='/api/derivatives/screener';function _t(e){const t=Q(e?.column);if(!t)return null;if(t.noScreener)return null;const n=String(e?.value||'').trim();if(!n)return null;switch(e.column){case'underlying':return{key:'underlying',value:n};case'expiry':return{key:'expiry',value:n};case'optionType':return{key:'option_type',value:'is_not'===e.operator?'CE'===n?'PE':'CE':n};case'dte':return{key:'max_dte',value:String(Math.max(0,Math.round(Number(n))-1))};case'premium':return{key:'min_premium_cr',value:String(Math.round(100*(Number(n)+.01))/100)};case'watchlist':return'all'===n?null:{key:'watchlist',value:n};case'market':return{key:'underlying_kind',value:n};case'volumeRatio':return{key:'min_volume_ratio',value:n};case'volumeToOi':return{key:'min_volume_to_oi',value:n};case'oiChange15m':return{key:'lt'===e.operator?'max_oi_change_15m_pct':'min_oi_change_15m_pct',value:n};case'oiChangeDay':return{key:'lt'===e.operator?'max_oi_change_day_pct':'min_oi_change_day_pct',value:n};case'buildup':{const e=L[k(n)];return e?{key:'buildup',value:e}:null}case'moneyness':return{key:'moneyness',value:n};default:return null}}const yt='The server has not said whether it applied this filter, so it is not shown as active.',$t='The server did not apply this filter, so the rows below are not narrowed by it.',vt='This server has no parameter for this filter, so it was not applied.';
1019function wt(e){const t=(e||[]).filter(Boolean);return t.length?1===t.length?t[0]:`${t.slice(0,-1).join(', ')} and ${t[t.length-1]}`:''}function St(e){if('string'==typeof e)return e;const t=e||{};return'string'==typeof t.key?t.key:''}function Ot(e){return(Array.isArray(e?.available_filters)?e?.available_filters:Array.isArray(e?.filters?.available)?e?.filters?.available:null)||null}function Tt(e){return(Array.isArray(e?.applied)?e?.applied:Array.isArray(e?.filters?.applied)?e?.filters?.applied:null)||null}const Nt='Choose a symbol in Customize, or click any row on this tab, to point every block at it.',Pt={rising:'\u2191 RISING',flat:'\u2192 STABLE',falling:'\u2193 FALLING'},Et={shifting_up:'\u2191 SHIFTING UP',stable:'\u2192 STABLE',shifting_down:'\u2193 SHIFTING DOWN'},It={expanding:'\u2191 EXPANDING',stable:'\u2192 STABLE',cooling:'\u2193 COOLING'},xt={building:'\u2191 BUILDING',flat:'\u2192 FLAT',unwinding:'\u2193 UNWINDING'},At='no baseline';const Mt=4,Lt=.05,Ct=['rising','flat','falling'],jt=['shifting_up','stable','shifting_down'],kt=['expanding','stable','cooling'],Ut=['building','flat','unwinding'];function Rt(e,t,n=Mt,r=Lt,i){const o=(e||[]).map(e=>m(e)).map((e,t)=>({v:e,i:t})).filter(e=>null!=e.v);if(o.length<2)return At;const a=o[o.length-1],u=o.map(e=>i?.[e.i]??null),{anchor:s,start:l}=Te(u),c=Se(u,n,n*$e,l);if(c===o.length-1)return At;const d=o[c],f=a.v-d.v,h=Math.max(...s.map(e=>Math.abs(o[e].v-d.v)),Math.abs(f))||Math.abs(a.v)||1;return Math.abs(f)<=h*r?t[1]:f>0?t[0]:t[2]}const Dt='PCR by open interest',Ft='PCR by volume',Bt='PCR by open interest is put open interest divided by call open interest across every strike of this expiry, at each reading. PCR by volume is the same division over the day\'s volume (\xa73.5).',Gt='Both lines are the ratios as captured. The chip says what the open-interest ratio did over the last hour of readings, and nothing about what it does after that.',Vt='No put-call ratio has been captured for this symbol yet',Wt='Withheld: the chain was too thin at this reading to divide honestly.',Ht='Max pain is the strike where the total payout to option buyers at expiry would be smallest, worked out from the open interest standing at that reading (\xa73.6).',Xt='The second line is the captured spot at the same readings, on the same scale, so the gap between the two is the gap you can see.',Kt='The chip says which way the max-pain strike moved over the last hour of readings. It describes the standing book, and says nothing about where either number goes.',Yt='No max-pain strike has been computed for this symbol yet',qt='Withheld: too few strikes cleared the liquidity floors to compute max pain at this reading.',zt='COMPUTED',Jt='Implied volatility is COMPUTED here, not reported by the exchange: it is what a pricing model returns when it is asked which volatility reproduces the traded price. Every other number on this tab is something the exchange said.',Zt='ATM implied volatility',Qt='The line is the at-the-money implied volatility of this underlying at each reading; the list beside it is the latest solved volatility per strike.',en='The chip says what the at-the-money volatility did over the last hour of readings. It describes what the model solved from captured prices, and nothing after them.',tn='No implied volatility has been computed for this symbol yet',nn='Withheld: the chain was too thin at this reading for an at-the-money volatility.',rn={stale_trade:'No volatility: the last trade in this contract is older than the reading it would be solved at.',no_time_value:'No volatility: at this price the contract has no time value left to solve.',below_intrinsic:'No volatility: the traded price is under the contract\'s intrinsic value, so no volatility reproduces it.',no_convergence:'No volatility: the solver did not settle on an answer for this price.',expiry_today:'No volatility: no time is left before this contract settles.',non_finite_input:'No volatility: an input to the solver was not a finite number.',future_last_trade:'No volatility: the last trade is stamped after this reading, so its price was not known then.'};function on(e,t){const n=String(t||'').trim();if(n)return n;const r=String(e||'').trim();return r?rn[r]||`No volatility: the server gave the reason "${r}".`:''}function an(e){const t=m(e);if(null==t)return u;return`${(Math.abs(t)<=3?100*t:t).toFixed(1)}%`}function un(e){const t=e||[];let n=0,r=0;for(const e of t)null!=m(e?.iv)?n++:String(e?.reason||'').trim()&&r++;return{total:t.length,solved:n,withReason:r}}const sn='Open interest on the front futures contract at each reading, against its own 20-day average, with the basis - the futures price less spot - beside it (\xa73.7).',ln='The chip s
1019ays what open interest on this contract did over the last hour of readings. It describes the standing position and stops there.',cn='No futures readings have been captured for this contract yet',dn='Withheld: this contract did not clear the liquidity floors at this reading.';function fn(e,t,n=!1){const r=m(e),i=m(t);return null==r&&null==i?u:null==r?_(i,2):null==i?V(r,n):`${V(r,n)} (${_(i,2)})`}function hn(e,t){const n=m(e);if(null==n)return f;const r=m(t),i=null==r?null:Math.round(r);return`${n.toFixed(2)}${c} its 20-day average`+(null==i?'':`, from ${i} session${1===i?'':'s'}`)}const mn=11;function pn(e,t,n=3,r=mn){if(!(e&&t>0))return[];const i=e.hi-e.lo||1,o=Math.max(2,Math.round(n)),a=[];for(let n=o-1;n>=0;n--){const u=e.lo+i*(n/(o-1)),s=t-(u-e.lo)/i*t;a.some(e=>Math.abs(e.y-s)<r)||(a.some(e=>e.v===u)||a.push({v:u,y:s}))}return a}function gn(e){const t=m(e?.total_readings),n=m(e?.readings_with_value);return null==t||null==n?'':`${Math.round(n)} of ${Math.round(t)} reading${1===Math.round(t)?'':'s'} carried a value`}function bn(e){const t=e?.withheld_reasons||{},n=e?.reason_text||{};return Object.entries(t).filter(([,e])=>null!=m(e)&&Number(e)>0).sort((e,t)=>Number(t[1])-Number(e[1])).map(([e,t])=>`${Math.round(Number(t))} reading${1===Math.round(Number(t))?'':'s'}: ${n[e]||e}`)}function _n(e){const t=m(e);return null==t?u:0===t?'strike at spot':`strike ${v(Math.abs(t))} ${t>0?'above':'below'} spot`}function yn(e){const t=m(e?.risk_free_rate);return null==t?'':`${(Math.abs(t)<=1?100*t:t).toFixed(2)}% a year`}function $n(e,t){const n=String(e?.reason_text||'').trim();if(n)return n;const r=String(e?.reason||'').trim();return r?String(t?.[r]||'').trim()||rn[r]||`No volatility: the server gave the reason "${r}".`:''}const vn='no spot was captured at this reading, so there is no basis',wn='A basis needs a futures price and a spot at the same reading.';function Sn(e){return U(e)}function On(e){if(!e)return'';const t=m(e.scanned),n=m(e.total),r=m(e.returned);if(null==t&&null==n)return'';const i=m(e.coverage?.underlyings),o=null==i?'':` across ${Math.round(i)} underlying${1===Math.round(i)?'':'s'}`,a=null==n?'':`${Math.round(n)} cleared the floors and the applied filters`,u=null!=r&&null!=n&&r<n?`, and this list carries ${Math.round(r)} of them`:'';return(null==t?'':`${Math.round(t).toLocaleString('en-IN')} row${1===Math.round(t)?'':'s'} at this reading${o}`)+`${null!=t&&a?'; ':''}${a}${u}.`}const Tn=84;function Nn(e){const t=P(e);return t?t.time?`${t.date} \xb7 ${t.time}`:t.date:''}const Pn=[{value:'underlying',label:'Instruments'},{value:'contract',label:'Contracts'}],En='underlying';function In(e){const t=m(e?.contracts);if(null==t)return u;const n=xn(e);return`${Math.round(t)} contract${1===Math.round(t)?'':'s'}`+(n?` \xb7 ${n}`:'')}function xn(e){const t=m(e?.calls)??0,n=m(e?.puts)??0,r=m(e?.options)??t+n,i=m(e?.futures)??0,o=i?`${Math.round(i)}F`:'';return r?[`${Math.round(t)}C / ${Math.round(n)}P`,o].filter(Boolean).join(' \xb7 '):o?`futures only \xb7 ${o}`:''}function An(e){const t=m(e?.volume_ratio_max);return null==t?f:`${t.toFixed(t>=100?0:1)}${c}`}function Mn(e){const t=m(e?.volume_ratio_max),n=m(e?.volume_baseline_contracts)??0,r=m(e?.contracts)??0,i=`${Math.round(n)} of ${Math.round(r)} carried a baseline`;if(null==t)return`No contract of this instrument has ${Ln}, so there is no ratio to show \u2014 ${i}. It is not computed for futures at all.`;const o=String(e?.volume_ratio_max_symbol||'').trim();return`Highest on one contract: ${An(e)}${o?` on ${o}`:''}. This is that contract's own reading, not an average \u2014 ${i}.`}const Ln='the three sessions of history \xa73.2 requires';function Cn(e){const t=m(e?.volume_to_oi_contracts)??0;if(!t)return'Volume against open interest (\xa73.3) is not computed for a futures contract, and no option of this instrument cleared the floors, so there is nothing to count.';const n=m(e?.volume_to_oi_over_1)??0;return`${Math.round(n)} of the ${Math.round(t)} contracts that carry the ratio traded more today than was standing at the previous close (\xa73.3). It is not computed for futures.`}function jn(e){const t=e?.buildup_counts||{},n={};for(const[e,r]of Object.entries(t)){const t=m(r);if(null==t||t<=0)continue;const i=k(e);n[i]=(n[i]||0)+t}const r=[...M,'unknown'].filter(e=>(n[e]||0)>0).map(e=>`${'unknown'===e?C:R(e)} ${n[e]}`);return r.length?r.join(' \xb7 '):''}const kn='Each row aggregates the SAME ten at-the-money contracts the \u
10190394OI tiles draw \u2014 the five calls at and above the money and the five puts at and below it \u2014 and no others. It is not the whole chain, and the ten are the ten at the LATEST reading: the same basket is carried back over the earlier rows, so an earlier row is not a record of which strikes were at the money at that time.',Un='A side is compared with itself an hour earlier \u2014 the latest reading at least 60 minutes before this one, found by the reading times themselves and never by counting four rows back, because four rows is not an hour when a reading is missing. Only the contracts that carried a value at BOTH readings are in the comparison, and the row says how many did. A reading with less than an hour of session behind it, or with no contract in common with the reading an hour back, has no direction at all and says which.',Rn='This is the conventional reading of option positioning at each reading, not a prediction: every opened contract has a buyer and a seller, the tape does not say which side was the aggressor, and this describes where open interest sits rather than what the price does next.',Dn='Each side is read on its price AND its open interest together, and only where both moved: a side whose premium barely moved, or whose open interest barely moved, carries no reading of its own. Open interest alone never decides a row. The Premiums column then says what the premiums of the sides that read did \u2014 both sides named when both read (for example "Call premium up, put premium down", or "Call and put premiums both up" when the two sides read OPPOSITE ways, which stays on screen as it is), one side named when only one reads, and "No paired premium + OI move" when neither does. It describes this reading and nothing about what the price does next. Rule signal/2: signal/1 chose the word from open interest alone and measured every row against the whole session, including readings taken after it.',Fn='No contract carried a value at this reading',Bn='no baseline',Gn='Less than an hour of readings stands behind this one',Vn='not yet ranked',Wn=[.3333333333333333,.6666666666666666],Hn='Strength is a size, not a confidence and not a chance of anything: it says how big this side\'s change is beside the changes that same side had already made, and nothing else. It is measured against that instrument\'s own session AS IT STOOD AT THIS READING \u2014 never a fixed number of contracts and never a reading taken later, so a row cannot be rewritten by what arrives after it. Under 5% of that largest change is stable \u2014 the same 5% band the \u0394OI tiles use \u2014 and the rest is split into equal thirds, which is Mild, Strong and Very strong. Until three measured changes stand behind the ladder the row says the strength is not yet ranked.',Xn=['Mild','Strong','Very strong'],Kn=Xn.length,Yn=['\u2191','\u2191\u2191','\u2191\u2191\u2191'],qn=['\u2193','\u2193\u2193','\u2193\u2193\u2193'],zn='Stable',Jn={strong_bullish:'Call premium up, put premium down',bullish:'One side read: call premium up or put premium down',neutral:'Call and put premiums moved the same way',flat:'No paired premium + OI move',bearish:'One side read: call premium down or put premium up',strong_bearish:'Call premium down, put premium up'},Zn={strong_bullish:'',bullish:'',neutral:'',flat:'',bearish:'',strong_bearish:''},Qn=(e,t)=>t?`${e} premium ${'Call'===e?'up'===t?'up':'down':'up'===t?'down':'up'}`:'';function er(e,t,n){if(!e)return u;const r=t?.lean||'',i=n?.lean||'';if(r&&i&&r!==i)return"Call and put premiums both "+('up'===r?'up':'down');const o=Qn('Call',r),a=Qn('Put',i);return o&&a?`${o}, ${a.charAt(0).toLowerCase()}${a.slice(1)}`:o||a||Jn[e]||u}const tr={'building|building':'Both sides adding positions','building|unwinding':'Call OI rising + put OI falling','unwinding|building':'Call OI falling + put OI rising','unwinding|unwinding':'Both sides reducing positions','building|flat':'Call OI rising; put OI little changed','flat|building':'Put OI rising; call OI little changed','unwinding|flat':'Call OI falling; put OI little changed','flat|unwinding':'Put OI falling; call OI little changed','flat|flat':'No meaningful new positioning'},nr='Both adding; more call OI than put OI',rr='Both adding; more put OI than call OI',ir=De,or=60,ar=120,ur='signal/2';function sr(e){const t=/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})/.exec(String(e||'').trim());if(!t)return null;const n=Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isFinite(n)?n/6e4+60*Number(t[4])+Number(t[5]):null}
1019function lr(e,t,n=or,r=ar){const i=sr(e?.[t]);if(null==i)return null;for(let o=t-1;o>=0;o--){const t=sr(e[o]);if(null==t)continue;const a=i-t;if(!(a<n))return a<=r?o:null}return null}const cr=15;const dr={'CE|up|building':'up','CE|up|unwinding':'up','CE|down|building':'down','CE|down|unwinding':'down','CE|flat|building':'','CE|flat|unwinding':'','CE|up|flat':'','CE|down|flat':'','CE|flat|flat':'','PE|up|building':'down','PE|up|unwinding':'down','PE|down|building':'up','PE|down|unwinding':'up','PE|flat|building':'','PE|flat|unwinding':'','PE|up|flat':'','PE|down|flat':'','PE|flat|flat':''},fr=(e,t,n)=>dr[`${String(e||'').toUpperCase()}|${String(t||'')}|${String(n||'')}`]||'';function hr(e,t,n,r){let i=0,o=0,a=0;for(const u of e){const e=m(u?.points?.[t]?.[r]),s=m(u?.points?.[n]?.[r]);null!=e&&null!=s&&(i+=e,o+=s,a++)}return a?{change:i-o,contracts:a}:{change:null,contracts:0}}function mr(e,t,n,r,i,o,a=0,u=Ne){if(null==n)return null;const s=hr(e,t,n,'delta_oi');if(null==s.change)return null;const l=hr(e,t,n,'price'),c=i>0&&Math.abs(s.change)<u*i,d=i<=0||c?'flat':s.change>0?'building':'unwinding',f=null==l.change?Me:o<=0||Math.abs(l.change)<Pe*o?'flat':l.change>0?'up':'down',h=Le[`${r}|${f}|${d}`],m=i>0?Math.min(1,Math.abs(s.change)/i):0,p=a>=Kn,g=p&&!c&&i?m<Wn[0]?1:m<Wn[1]?2:3:0,b=g?('building'===d?Yn:qn)[g-1]:'',_=g?Xn[g-1]:p?zn:Vn;return{contracts:s.contracts,change:s.change,price_change:l.change,oi_direction:d,price_direction:f,strength:g,lean:fr(r,f,d),ranked:a,what_label:h?h[0]:Re,meaning:h?h[1]:'',text:`${_}${b?' '+b:''}`}}function pr(e,t,n=Ee){if(!e||!t)return'';const r=`${e.oi_direction}|${t.oi_direction}`;if('building|building'===r){const i=Math.abs(e.change||0),o=Math.abs(t.change||0);return i&&o?i>n*o?nr:o>n*i?rr:ir:tr[r]||''}return tr[r]||''}function gr(e,t){if(!e||!t)return'';const n=e.lean,r=t.lean;if(n&&r&&n!==r)return'neutral';const i=n||r;if(!i)return'flat';const o=!(!n||!r);return'up'===i?o?'strong_bullish':'bullish':o?'strong_bearish':'bearish'}const br=[{rule_id:'vol_tod_median',label:'Volume vs its own median',short_label:'Vol vs median',measure:'cumulative volume so far today',baseline_label:"the median of this contract's own cumulative volume at the same clock time",sample_label:'session',comparator:'>=',threshold:2,pattern:/^volume\s+([0-9.]+)x its own time-of-day median$/i},{rule_id:'day_vol_vs_prev_oi',label:'Day volume vs previous-close OI',short_label:'Day vol vs prev OI',measure:"the day's volume",baseline_label:'the open interest standing at the previous close',sample_label:'prior session',comparator:'>',threshold:1,pattern:/^day volume\s+([0-9.]+)x yesterday's OI$/i}],_r='unclassified',yr='Condition this build does not name',$r='Unnamed condition',vr=br.length,wr='A row is flagged when the store flagged one of its contracts under \xa73. The flag is the store\'s own, not a score this tab invents, and the word beside the colour says which conditions were tripped and by how many contracts.',Sr='Three numbers, and they are not the same number. CONDITIONS is how many DISTINCT rules the name\'s contracts tripped between them \u2014 two rules exist, \xa73.2 and \xa73.3, so it is 1 or 2. CONTRACTS is how many of its contracts were flagged. OBSERVATIONS is how many times a rule fired across them. The same rule at twenty different multiples is ONE condition and twenty observations.',Or='Each condition is a rule with a version, a comparator, a threshold and a baseline \u2014 not a sentence. The badge names the rule and how many contracts tripped it; the evidence drawer lists those contracts with the value, the threshold it was compared against, the baseline it was measured against and how many observations that baseline stands on.',Tr='The list opens with the unusual first \u2014 most distinct conditions, then most contracts flagged, then largest premium traded, then instrument name A to Z so a tie comes out in the same order every time. Every column still sorts on its own header, and a sort re-orders these rows without re-querying them.',Nr='Colour never carries the flag on its own: the word and the counts are printed on the row beside it, the conditions are named as badges under them, and the contracts behind them are in the evidence drawer.',Pr='The \xa73.2 figure a flag can rest on is the LARGEST reading among this name\'s contracts, with that contract named - never an average of its contracts.',Er='Evidence',Ir='This reading\'s response carried the rule totals for this instrument but not the contracts behind them.',xr='Nothing flagged',Ar='Not measured',Mr='\xa73.2 and \xa73.3 are not computed for a futures contract. An instrument whose whole book over the floors is futures therefore reads "Not measured", never "Nothing flagged" \u2014 a name nothing was measured on is not a name nothing was found on.';function Lr(e){return(m(e?.volume_to_oi_contracts)||0)>0||(m(e?.volume_baseline_contracts)||0)>0||(m(e?.options)||0)>0}function Cr(e){const t=br.find(t=>t.rule_id===String(e||''));return t?{label:t.label,short_label:t.short_label,measure:t.measure,baseline_label:t.baseline_label,sample_label:t.sample_label,comparator:t.comparator,threshold:t.threshold,unit:'x'}:{label:yr,short_label:$r,measure:null,baseline_label:null,sample_label:null,comparator:null,threshold:null,unit:null}}function jr(e){const t=String(e||'').trim();for(const e of br)if(e.pattern.test(t))return e.rule_id;return t?_r:''}function kr(e){const t=e?.unusual_rules;if(Array.isArray(t))return t.filter(e=>e&&e.rule_id).map(e=>({...Cr(e.rule_id),...Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&''!==e))}));const n=e?.unusual_reasons;
1019if(!n||'object'!=typeof n)return[];const r=br.map(e=>e.rule_id),i=new Map;for(const e of Object.keys(n)){const t=jr(e);if(!t)continue;let r=i.get(t);r||(r={rule_id:t,...Cr(t),contracts:null,observations:0},i.set(t,r)),r.observations+=m(n[e])||0}return[...i.values()].sort((e,t)=>{const n=r.indexOf(e.rule_id),i=r.indexOf(t.rule_id);return(n<0?r.length:n)-(i<0?r.length:i)||e.rule_id.localeCompare(t.rule_id)})}function Ur(e){if(!e)return 0;if((m(e.unusual)||0)<=0)return 0;const t=m(e.unusual_rule_count),n=null!=t?t:kr(e).length;return Math.max(0,Math.round(n))}function Rr(e){return m(e?.unusual)||0}function Dr(e){const t=m(e?.unusual_observations);return null!=t?Math.max(0,Math.round(t)):kr(e).reduce((e,t)=>e+(m(t.observations)||0),0)}function Fr(e){return e?(m(e.unusual)||0)<=0?0:Math.max(1,Math.min(vr,Ur(e))):0}function Br(e){if(!Fr(e))return'';const t=Ur(e),n=Rr(e);return`Unusual \xb7 ${[t>0?`${t} condition${1===t?'':'s'}`:'',`${n} contract${1===n?'':'s'}`].filter(Boolean).join(' \xb7 ')}`}function Gr(e){return Fr(e)?Br(e):Lr(e)?xr:Ar}function Vr(e,t=!1){if(!e)return'';const n=(t?e.short_label:'')||e.label||(t?$r:yr),r=m(e.contracts);if(null!=r)return`${n} \xb7 ${Math.round(r)}`;const i=m(e.observations);return null!=i?`${n} \xb7 ${Math.round(i)} seen`:n}function Wr(e){if(!Fr(e))return'';const t=kr(e).map(e=>Vr(e,!0)).filter(Boolean);return t.length?t.join(' \xb7 '):'the store named no condition'}const Hr='Typing a name narrows the instruments this reading returned. It does not re-query: the as-of, the floors and the applied filters above still describe exactly these rows.',Xr='No instrument in this reading matches that name. A name whose contracts did not clear the liquidity floors is not in this list to be found.';function Kr(e,t){const n=String(t||'').trim().toUpperCase().replace(/\s+/g,'');return!n||String(e||'').toUpperCase().replace(/\s+/g,'').includes(n)}function Yr(e){const t=e?.top;if(!t)return'';const n=String(t.instrument_type||'').toUpperCase();return`Busiest contract ${String(t.tradingsymbol||'').trim()||`${v(t.strike)} ${n}`} at ${p(t.premium_cr)}`}function qr(e,t){const n=String(e||'').trim();if(!n||n===String(t||'').trim())return'';const r=E(n);return r===u?'':r}const zr=3;const Jr='The chain opens at the money: the tinted row is the strike nearest the captured spot at this reading. Every strike of the expiry is still listed above and below it.',Zr='No spot was captured for this underlying at this reading, so the chain cannot say which strike is at the money. It opens at the lowest strike listed.';function Qr(e){return e>0?'+':e<0?s:''}function ei(e,t){const n=String(e?.previous_close_reason||'').trim(),r=String(t||'').trim();return(r?String(e?.delta_reason_text?.[r]||'').trim():'')||n||''}},926,[]); 1020__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"NARROW_BELOW",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"NARROW_CHART_H",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"TIGHT_BELOW",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"SPOT_MARK",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"HINT_FROM",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"STRIKE_BAND_OPACITY",{enumerable:!0,get:function(){return W}}),Object.defineProperty(_e,"ATM_BAND_OPACITY",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"FALL_OPACITY",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"BOTH_NOTE",{enumerable:!0,get:function(){return N}}),_e.Seg=G,_e.OiStrikeChart=function({lead:e,onView:n,initialMode:r,body:d,spot:w,state:j,underlying:M,subtitle:W,onRefresh:$,onExpand:z,expanded:ee,onClose:ne,highlight:ie,onHighlight:le,style:oe}){const ae=(0,u.useAuth)(),se=(0,f.orientationKey)(ae?.user?.id),re='phone'===(0,c.useLayoutMode)(),de=(0,a.default)().width<I,[ce,ue]=(0,t.useState)(()=>D(se));(0,t.useEffect)(()=>{ue(D(se))},[se]);const[he,xe]=(0,t.useState)(r??'oi'),[fe,ye]=(0,t.useState)(S.DEFAULT_CHANGE_WINDOW),[pe,ge]=(0,t.useState)(f.WINDOW_DEFAULT),[be,me]=(0,t.useState)(!0),[we,Ce]=(0,t.useState)({w:0,h:0}),[je,Oe]=(0,t.useState)({x:0,y:0}),[Te,ke]=(0,t.useState)(!1),Se=(Te||'oi'!==he)&&M&&d?`${(0,b.oiSessionPath)({underlying:M,expiry:d.expiry,session:d.session})}${d.as_of?`&at=${encodeURIComponent(d.as_of)}`:''}`:null,Le=(0,p.useOiSession)(Se),ve=Le&&'ready'===Le.state?Le.session:null,Ae=(0,p.useReplay)(ve),Me=Te&&ve?Ae.frame:null,Ie=Te&&M?`/api/derivatives/maxpain-series?underlying=${encodeURIComponent(M)}${d?.expiry?`&expiry=${encodeURIComponent(d.expiry)}`:''}`:null,Re=(0,x.useDerivativeRead)(Ie,0),Pe=Me?(0,f.frameSpot)(Me,M):w,Ee=(0,t.useMemo)(()=>(0,f.toStrikeRows)(d?.rows),[d]),He=Me?Me.rows:Ee,We='oi'!==he&&'prev_close'!==fe,$e=ve?Me?Me.index:(0,f.currentIndex)(ve.readings,d?.as_of)??ve.readings.length-1:null,ze=(0,t.useMemo)(()=>ve&&null!=$e?Object.fromEntries(S.CHANGE_WINDOWS.map(e=>{const t=(0,S.baselineIndex)(ve,$e,e.value);return[e.value,t.ok?'':t.reason]}).filter(([,e])=>e)):void 0,[ve,$e]);(0,t.useEffect)(()=>{ze?.[fe]&&ye(S.DEFAULT_CHANGE_WINDOW)},[ze,fe]);const Ne=(0,t.useMemo)(()=>We&&ve&&null!=$e?(0,S.changeView)(ve,$e,fe):null,[We,ve,$e,fe]),De=Ne?Ne.rows:He,Fe='oi'===he?null:We?Ne?Ne.footer:S.CHANGE_WINDOW_NOT_LOADED:'Change since previous close',Ge=Ne&&Ne.ok&&Ne.baseline.ok?Ne.baseline.time:null,Be=We?Ge?`since ${Ge}`:void 0:'since prev close',Ve=(0,t.useMemo)(()=>
1020{if(!Te||!ve)return null;if(!We)return(0,f.replayExtent)(ve,he,(0,b.replayScaleMax)(ve),(0,b.replayChangeScaleMax)(ve));if('change'===he){const e=(0,S.changeWindowScaleMax)(ve,fe);return e&&e>0?{lo:-e,hi:e}:null}const e=(0,b.replayScaleMax)(ve);return e&&e>0?{lo:0,hi:1.04*e}:null},[Te,ve,he,fe,We]),Ye=Me?(0,f.frameTotals)(He):{ce:d?.total_ce_oi??null,pe:d?.total_pe_oi??null},Xe=Me?(0,f.maxPainAt)(Re.data?.points,Me.at):(0,O.maxPainStrike)(d),Ue=(0,t.useMemo)(()=>(0,f.windowCentre)(De,Pe?.value,Xe),[De,Pe,Xe]),Ke=(0,t.useMemo)(()=>(0,f.windowRows)(De,Ue.index,pe),[De,Ue,pe]),qe=(0,t.useMemo)(()=>(0,f.atmIndex)(Ke.rows,Pe?.value),[Ke,Pe]),Je=(0,t.useMemo)(()=>(0,f.highestInView)(Ke.rows,De,'call'),[Ke,De]),Qe=(0,t.useMemo)(()=>(0,f.highestInView)(Ke.rows,De,'put'),[Ke,De]),Ze=(0,f.chooseOrientation)(ce,we.w,we.h,re),et=(0,t.useMemo)(()=>we.w>0&&we.h>0&&Ke.rows.length?(0,f.layoutChart)({rows:Ke.rows,mode:he,orientation:Ze,width:we.w,height:we.h,spot:Pe?.value??null,atm:qe,maxPainBand:be&&null!=Xe&&'across'===Ze?O.MAX_PAIN_BAND:0,extent:Ve,labelSample:(0,f.replayLabelSample)(he,Ve),peaks:'change'===he?{call:(0,f.topChange)(Ke.rows,'call')?.strike??null,put:(0,f.topChange)(Ke.rows,'put')?.strike??null}:{call:Je.top?.strike??null,put:Qe.top?.strike??null}}):null,[Ke,he,Ze,we,Pe,qe,be,Xe,Ve,Je,Qe]);(0,t.useEffect)(()=>{Oe({x:0,y:0})},[Ze,pe,he]);const tt=(0,k.useStrikeCursor)(Ke.rows,Ze,{indexAt:(e,t)=>et?et.scale.indexAt('across'===Ze?e:t):null,onActive:le,startIndex:qe,valueText:(e,t)=>
1020`Strike ${e.strike}${null!=qe?", ATM"+(t-qe===0?'':(t-qe>0?'+':'\u2212')+Math.abs(t-qe)):''}`}),nt=null!=tt.activeIndex?Ke.rows[tt.activeIndex]??null:null,it=(0,k.atmOffsetOf)(tt.activeIndex,qe),lt=et&&null!=tt.activeIndex?Y(et,tt.activeIndex,je):null,ot=be?(0,O.maxPainReason)(Xe,et?.scale??null):null,at=!de&&we.w>0&&we.w<P,st=de||at,rt=(0,_.jsxs)(i.default,{style:[c.s.row,{gap:s.CTRL.gap,flexWrap:'wrap',rowGap:s.CTRL.gap}],children:[e,(0,_.jsx)(G,{label:"Show",value:he,onChange:e=>xe(e),options:['oi','change','both'].map(e=>({value:e,text:f.MODE_LABELS[e]}))}),('oi'!==he||!de)&&(0,_.jsx)(L.ChangeWindowPicker,{value:fe,onChange:ye,disabled:'oi'===he||!ve,compact:st,dense:!de,unavailable:ze,reason:'oi'===he?J:ve?void 0:Le&&'loading'!==Le.state&&'ready'!==Le.state?Le.message:S.CHANGE_WINDOW_NOT_LOADED}),(0,_.jsx)(G,{label:"Strikes around ATM",value:pe,onChange:ge,options:f.WINDOW_CHOICES.map(e=>({value:e,text:(0,f.windowLabel)(e)}))}),!re&&(0,_.jsx)(G,{label:"Layout",value:ce,onChange:e=>{ue(e),F(se,e)},options:['auto','across','down'].map(e=>({value:e,text:f.ORIENTATION_LABELS[e]}))}),!de&&(0,_.jsx)(B,{label:f.MAX_PAIN_TOGGLE,on:be,onChange:me,hint:ot||void 0}),!de&&(0,_.jsx)(B,{label:f.PLAY_TOGGLE,on:Te,onChange:ke,hint:f.PLAY_HINT})]}),dt=!!(Pe&&et&&(0,f.placeSpotPill)(et,E)),ct=Pe?`${E}${et?.spotOutside?` ${f.OUTSIDE_TEXT[et.spotOutside]}`:''}`:f.NO_SPOT_TEXT,ut=(0,_.jsxs)(i.default,{style:[c.s.row,{gap:de?8:10,flexWrap:'wrap',minHeight:24}],children:['both'===he?(0,_.jsx)(i.default,{style:{flexShrink:1,minWidth:0,maxWidth:'100%'},children:(0,_.jsx)(C.OiBothLegend,{baseline:"prev_close",compact:!0,since:!1})}):'change'===he?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(V,{color:v,label:st?'Call':'Call OI change'}),(0,_.jsx)(V,{color:A,label:st?'Put':'Put OI change'}),(0,_.jsx)(V,{color:c.C.muted,light:!0,label:st?'Fall':'Fall (lighter, below 0)'})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(V,{color:v,label:"Calls"}),(0,_.jsx)(V,{color:A,label:"Puts"})]}),!de&&(0,_.jsx)(q,{}),!!ot&&(0,_.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:ot}),(0,_.jsx)(i.default,{style:{flex:1}}),dt?null:Pe?(0,_.jsx)(i.default,{style:{borderWidth:1,borderColor:m.SPOT_COLOR,borderRadius:10,paddingHorizontal:7,paddingVertical:1},children:(0,_.jsx)(c.T,{style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:m.SPOT_COLOR,fontVariant:['tabular-nums']},children:ct})}):(0,_.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:ct}),(0,_.jsx)(B,{label:f.MAX_PAIN_TOGGLE,on:be,onChange:me}),!de&&we.w>=H&&!Te&&(0,_.jsx)(c.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:c.C.muted,flexShrink:1},children:f.PLAY_HINT}),!de&&(0,_.jsx)(B,{label:f.MAX_PAIN_TOGGLE,on:be,onChange:me,hint:ot||void 0}),!de&&(0,_.jsx)(B,{label:f.PLAY_TOGGLE,on:Te,onChange:ke,hint:f.PLAY_HINT})]}),ht=null!=ie&&Ke.rows.length?(()=>{const e=Ke.rows.findIndex(e=>Math.abs(e.strike-ie)<.5);return e<0?null:e})():null,xt=M?`Open interest by strike for ${M}, ${'down'===et?.orientation?'calls left and puts right':'calls and puts side by side'}, ${Ke.rows.length} strikes${Pe?`, ${Pe.label}`:''}. Use the arrow keys to move across strikes.`:'Open interest by strike',ft=(0,t.useMemo)(()=>Z(et),[et]);(0,t.useEffect)(()=>{n?.({mode:he,window:fe})},[he,fe]);const yt=Q(`${he}|${fe}|${pe}|${ce}|${M}`,450),pt=et?(0,_.jsx)(i.default,{...tt.handlers,focusable:!0,accessible:!0,accessibilityRole:"adjustable",accessibilityLabel:xt,style:{width:et.scale.width,height:et.scale.height},children:(0,_.jsx)(te,{layout:et,lit:ht,active:tt.activeIndex,spot:Pe,painStrike:Xe,showPain:be,grow:yt,atm:qe,moves:ft})}):null,gt=(0,t.useRef)(null),bt=!!et&&(et.scrolls||et.scale.height>we.h+2||et.scale.width>we.w+2),mt=bt&&null!=qe&&et?et.scale.at(qe):null;(0,t.useEffect)(()=>{if(null==mt||!et)return;const e='across'===et.orientation&&et.scale.width>we.w+2,t=Math.max(0,mt-(e?we.w:we.h)/2),n=setTimeout(()=>gt.current?.scrollTo?.(e?{x:t,y:0,animated:!1}:{x:0,y:t,animated:!1}),0);return()=>clearTimeout(n)},[mt,et?.orientation,pe,we.w,we.h]);const wt=(0,f.statTiles)({rows:De,totals:Ye,spot:Pe,changeLabel:Be}),Ct=at?wt.map(e=>'call'===e.key||'put'===e.key?{...e,sub:e.sub?.replace(/\s+since .*$/,'')}:'pcr'===e.key?{...e,sub:void 0}:e):wt,jt=`${(0,f.highestText)('call',Je)} \xb7 ${(0,f.highestText)('put',Qe)}`,Ot=['change'===he?f.CHANGE_NOTE:'both'===he?N:f.OI_NOTE,Fe,...(0,f.statCoverage)(De),'max_pain'===Ue.basis||'middle'===Ue.basis?f.CENTRE_TEXT[Ue.basis]:null].filter(
1020Boolean),Tt=de?{...oe,height:void 0}:oe;return(0,_.jsx)(h.WidgetFrame,{name:"Open interest by strike",subtitle:W,body:d,state:j,onRefresh:$,onExpand:z,expanded:ee,onClose:ne,showsSignals:['oi_change_day'],inBlock:!0,style:Tt,toolbar:rt,inline:!0,note:de?(0,_.jsx)(i.default,{style:{gap:3},children:Ot.map(e=>(0,_.jsx)(c.T,{style:h.metaText,children:e},e))}):(0,_.jsx)(c.T,{numberOfLines:2,style:h.metaText,children:Ot.join(' \xb7 ')}),children:(0,_.jsxs)(i.default,{style:{flex:1,minHeight:0,paddingHorizontal:10,paddingTop:6,paddingBottom:2,gap:4},children:[de?(0,_.jsxs)(_.Fragment,{children:[!!d&&(0,_.jsx)(K,{tiles:Ct,narrow:de,tight:at}),!!d&&(0,_.jsx)(c.T,{numberOfLines:2,style:{fontSize:11,lineHeight:15,color:c.C.ink,fontVariant:['tabular-nums']},children:jt}),ut]}):(0,_.jsx)(U,{showTop:'oi'===he,tiles:wt,peaks:{call:X(Je),put:X(Qe)},extra:(0,_.jsxs)(_.Fragment,{children:['both'===he?(0,_.jsx)(C.OiBothLegend,{baseline:"prev_close",compact:!0,since:!1}):'change'===he?(0,_.jsx)(V,{color:c.C.muted,light:!0,label:"Fall (lighter, below 0)"}):null,ft.map(e=>(0,_.jsxs)(i.default,{style:[c.s.row,{gap:4}],title:('added'===e.part?'Largest addition':'Largest unwind')+" on screen - outlined on the chart",children:[(0,_.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:'change'===he?'added'===e.part?'Biggest rise':'Biggest fall':'added'===e.part?'Most added':'Most unwound'}),(0,_.jsx)(c.T,{style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:'call'===e.side?v:A,fontVariant:['tabular-nums']},children:`${e.strike.toLocaleString('en-IN')} ${'call'===e.side?'calls':'puts'} ${e.text}`})]},e.part)),!dt&&(0,_.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:Pe?m.SPOT_COLOR:c.C.muted},children:ct})]})}),(0,_.jsxs)(i.default,{testID:"oi-chart-area",style:de?{height:R,position:'relative'}:{flex:1,minHeight:120,position:'relative',overflow:'hidden'},onLayout:e=>{const{width:t,height:n}=e.nativeEvent.layout,i=Math.round(t),l=Math.round(n);Ce(e=>Math.abs(e.w-i)<3&&Math.abs(e.h-l)<3?e:{w:i,h:l})},children:[pt&&(bt?(0,_.jsx)(l.default,{ref:gt,horizontal:'across'===et.orientation,style:{flex:1},scrollEventThrottle:32,onScroll:e=>{const t=e.nativeEvent.contentOffset;Oe({x:t.x,y:t.y})},contentOffset:'down'===et.orientation&&null!=qe?{x:0,y:Math.max(0,et.scale.at(qe)-we.h/2)}:void 0,children:pt}):pt),!de&&nt&<&&(0,_.jsx)(T.OiDetailCard,{row:nt,atmOffset:it??0,pinned:tt.pinned,onClose:tt.clear,anchor:lt,orientation:Ze,bounds:{width:we.w,height:we.h}}),(0,_.jsx)(T.StrikeAnnouncer,{row:nt,atmOffset:it})]}),de&&!!d&&(0,_.jsxs)(i.default,{style:{gap:4},children:[(0,_.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:Te?f.REPLAY_CLOSE:f.PLAY_TOGGLE,accessibilityHint:f.PLAY_HINT,accessibilityState:{selected:Te},'aria-pressed':Te,onPress:()=>ke(e=>!e),style:e=>[c.s.row,{minHeight:44,paddingHorizontal:14,borderRadius:11,borderWidth:1,alignSelf:'flex-start',borderColor:Te?c.C.line:c.C.green,backgroundColor:e.pressed?c.C.dark:c.C.paper,gap:8}],children:(0,_.jsx)(c.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterMedium',color:Te?c.C.muted:c.C.green},children:Te?f.REPLAY_CLOSE:f.PLAY_TOGGLE})}),!Te&&(0,_.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:f.PLAY_HINT})]}),Te&&(0,_.jsx)(y.OiReplay,{session:ve,load:Le,value:Ae.value,onChange:Ae.setValue,playing:Ae.playing,onPlay:Ae.setPlaying,speed:Ae.speed,onSpeed:Ae.setSpeed,wide:!de}),de&&nt&&(0,_.jsx)(T.OiDetailCard,{inline:!0,row:nt,atmOffset:it??0,pinned:tt.pinned,onClose:tt.clear,anchor:{x:0,y:0},orientation:Ze})]})})},_e.cardAnchor=Y,Object.defineProperty(_e,"OI_NO_WINDOW",{enumerable:!0,get:function(){return J}}),_e.useGrow=Q,_e.sweepClock=function(e,t,n){const i=.22;if(e<i)return e/i*.28;const l=i+.45*(n?t/n:0);return.28+.72*Math.max(0,Math.min(1,(e-l)/.33))},_e.keyMovesOf=Z,_e.placeLabels=ee;var t=_r(_d[0]),n=e(t),i=e(_r(_d[1])),l=e(_r(_d[2])),o=e(_r(_d[3])),a=e(_r(_d[4])),s=_r(_d[5]),r=_r(_d[6]),d=e(r),c=_r(_d[7]),u=_r(_d[8]),h=_r(_d[9]),x=_r(_d[10]),f=_r(_d[11]),y=_r(_d[12]),p=_r(_d[13]),b=_r(_d[14]),m=_r(_d[15]),w=_r(_d[16]),C=_r(_d[17]),j=_r(_d[18]),O=_r(_d[19]),T=_r(_d[20]),k=_r(_d[21]),S=_r(_d[22]),L=_r(_d[23]),_=_r(_d[24]);const v=m.OI_SIDE_COLOR.call,A=m.OI_SIDE_COLOR.put,M='Inter',I=600,R=420,P=900,E='Spot',H=1200,W=.035,$=.09,z=.45,N='Both: each bar is one side at one strike - dim = held since the baseline, bright = added, hatched = unwound.';function D(e){try{return(0,f.parseOrientationChoice)('undefined'!=typeof window?window.localStorage?.getItem(e):null)}catch{return'auto'}}function F(e,t){try{'undefined'!=typeof window&&window.localStorage?.setItem(e,t)}catch{}}function G({label:e,options:t,value:n,onChange:l}){return(0,_.jsx)(i.default,{accessibilityLabel:e,style:[c.s.row,{gap:0,borderWidth:1,borderColor:c.C.line,borderRadius:s.CTRL.radius,overflow:'hidden'}],children:t.map((t,i)=>{const a=t.value===n;return(0,_.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:`${e}: ${t.text}`,accessibilityState:{selected:a},'aria-pressed':a,onPress:()=>l(t.value),style:e=>[{minHeight:s.CTRL.h,minWidth:28,paddingHorizontal:s.CTRL.padX,justifyContent:'center',alignItems:'center',borderLeftWidth:i?1:0,borderColor:c.C.line,backgroundColor:a?c.C.soft:e.hovered||e.focused?c.C.dark:'transparent'}],children:(0,_.jsx)(c.T,{style:{fontSize:s.CTRL.font,lineHeight:s.CTRL.lineHeight,fontFamily:a?'InterSemi':'InterMedium',color:a?c.C.green:c.C.ink},children:t.text})},String(t.value))})})}function B({label:e,on:t,onChange:n,hint:l}){return(0,_.jsxs)(o.default,{accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{selected:t},accessibilityHint:l,'aria-pressed':t,title:l,onPress:()=>n(!t),style:e=>[c.s.row,{gap:5,minHeight:s.CTRL.h,paddingHorizontal:s.CTRL.padX,borderRadius:s.CTRL.radius,borderWidth:1,borderColor:t?c.C.amber:c.C.line,backgroundColor:e.hovered||e.focused?c.C.dark:'transparent'}],children:[(0,_.jsx)(i.default,{style:{width:8,height:8,borderRadius:2,backgroundColor:t?c.C.amber:'transparent',borderWidth:1,borderColor:t?c.C.amber:c.C.muted}}),(0,_.jsx)(c.T,{style:{fontSize:s.CTRL.font,lineHeight:s.CTRL.lineHeight,fontFamily:'InterMedium',color:t?c.C.amber:c.C.ink},children:e})]})}function V({color:e,light:t,label:n}){return(0,_.jsxs)(i.default,{style:[c.s.row,{gap:5}],children:[(0,_.jsx)(i.default,{style:{width:10,height:10,borderRadius:2,backgroundColor:e,opacity:t?z:1}}),(0,_.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:n})]})}function Y(e,t,n){if('across'===e.orientation){const i=e.bars.filter(e=>e.index===t).map(e=>e.box.y);return{x:e.scale.at(t)-n.x,y:(i.length?Math.min(...i):e.zero)-n.y}}return{x:e.zero-n.x,y:e.scale.at(t)-n.y}}function X(e){return(0,f.highestText)('call',e).replace(/^Highest call OI\s*/,'')}function U({tiles:e,peaks:t,extra:l,showTop:o=!0}){const a=()=>(0,_.jsx)(i.default,{style:{width:1,alignSelf:'stretch',backgroundColor:c.C.line,marginVertical:2}}),s={fontFamily:'InterSemi',fontSize:15,lineHeight:20,fontVariant:['tabular-nums']},r={fontSize:11,lineHeight:15,color:c.C.muted,fontVariant:['tabular-nums']},d=e=>{const n='call'===e.key||'put'===e.key,l=n?(0,_.jsx)(i.default,{style:{width:10,height:10,borderRadius:2,backgroundColor:'call'===e.key?v:A}}):'spot'===e.key?(0,_.jsx)(i.default,{style:{width:14,height:0,borderTopWidth:2,borderStyle:'dashed',borderColor:m.SPOT_COLOR}}):null,a=n?'call'===e.key?'Calls':'Puts':e.label,d=n?e.sub?.replace(/\s+since .*$/,''):null;return(0,_.jsxs)(i.default,{title:[e.label,e.value,e.sub].filter(
1020Boolean).join(' \xb7 '),accessibilityLabel:`${e.label} ${e.value}${e.sub?`, ${e.sub}`:''}${n?`, highest at ${t[e.key]}`:''}`,style:[c.s.row,{gap:6,alignItems:'baseline'}],children:[l&&(0,_.jsx)(i.default,{style:{alignSelf:'center'},children:l}),(0,_.jsx)(c.T,{style:r,children:a}),(0,_.jsx)(c.T,{style:[s,{color:'spot'===e.key?m.SPOT_COLOR:c.C.ink}],children:e.value}),!!d&&(0,_.jsx)(c.T,{style:r,children:d}),n&&o&&(0,_.jsxs)(c.T,{style:r,children:["\xb7 top ",t[e.key]]}),'spot'===e.key&&!!e.sub&&(0,_.jsx)(c.T,{style:r,children:e.sub})]},e.key)};return(0,_.jsxs)(i.default,{style:[c.s.row,{gap:14,flexWrap:'wrap',rowGap:4,minHeight:26}],children:[e.map((e,t)=>(0,_.jsxs)(n.default.Fragment,{children:[t>0&&(0,_.jsx)(a,{}),d(e)]},e.key)),l]})}function K({tiles:e,narrow:t,tight:n=!1}){return(0,_.jsx)(i.default,{accessibilityRole:"summary",accessibilityLabel:e.map(e=>`${e.label} ${e.value}${e.sub?`, ${e.sub}`:''}`).join('. '),style:{flexDirection:'row',flexWrap:'wrap',gap:6},children:e.map(e=>{return(0,_.jsxs)(i.default,{style:{flexGrow:1,flexBasis:t?'45%':0,minWidth:t?130:96,paddingHorizontal:8,paddingVertical:3,borderRadius:8,borderWidth:1,borderColor:c.C.line,backgroundColor:c.C.dark,gap:1},children:[(0,_.jsxs)(i.default,{style:[c.s.row,{gap:6}],children:[('call'===e.key||'put'===e.key)&&(0,_.jsx)(i.default,{style:{width:8,height:8,borderRadius:2,backgroundColor:(n=e.key,'call'===n?v:'put'===n?A:'spot'===n?m.SPOT_COLOR:c.C.ink)}}),(0,_.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:e.label})]}),(0,_.jsx)(c.T,{style:{fontFamily:'InterSemi',fontSize:14,lineHeight:18,color:'spot'===e.key?m.SPOT_COLOR:c.C.ink,fontVariant:['tabular-nums']},children:e.value}),!!e.sub&&(0,_.jsx)(c.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:c.C.muted,fontVariant:['tabular-nums']},children:e.sub})]},e.key);var n})})}function q(){return(0,_.jsxs)(i.default,{style:[c.s.row,{gap:5}],children:[(0,_.jsx)(i.default,{style:{width:14,height:0,borderTopWidth:2,borderStyle:'dashed',borderColor:m.SPOT_COLOR}}),(0,_.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:"Spot"})]})}const J='OI is the total standing now, so it has no "since"; pick Change or Both to measure from a time';function Q(e,n=450){const[i,l]=(0,t.useState)(1);return(0,t.useEffect)(()=>{let e=!1;try{e=!!globalThis.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches}catch{}const t=globalThis.requestAnimationFrame;if(e||!t)return void l(1);let i=0;const o=Date.now(),a=()=>{const e=Math.min(1,(Date.now()-o)/n);l(e),e<1&&(i=t(a))};l(0),i=t(a);const s=setTimeout(()=>l(1),n+150);return()=>{globalThis.cancelAnimationFrame?.(i),clearTimeout(s)}},[e]),i}function Z(e){if(!e||'oi'===e.mode)return[];const t=[];if('change'===e.mode){let n=null,i=null;for(const t of e.bars)t.value>0&&(!n||t.value>n.value)&&(n=t),t.value<0&&(!i||t.value<i.value)&&(i=t);return n&&t.push({key:n.side+n.index,part:'added',side:n.side,strike:n.strike,text:(0,f.signedLcr)(n.value)}),i&&t.push({key:i.side+i.index,part:'unwound',side:i.side,strike:i.strike,text:(0,f.signedLcr)(i.value)}),t}for(const n of['added','unwound']){let i=null,l=0;for(const t of e.bars)(t.seg?.[n]??0)>l&&(l=t.seg[n],i=t);i&&t.push({key:i.side+i.index,part:n,side:i.side,strike:i.strike,text:('added'===n?(0,w.addedLabel)(i.seg):(0,w.unwoundLabel)(i.seg))||''})}return t}function ee(e,t,n,i){const l=(e,t)=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h,o=[],a=[];for(const s of[...e].sort((e,t)=>+!!t.peak-+!!e.peak)){const e=(0,f.textWidth)(s.text,i)+4,r=i+2,d=1===s.dir?1:-1;let c=s.y;for(let u=0;u<4;u++){const u={x:s.x-e/2,y:c-i,w:e,h:r};if(u.x<n.x-2||u.x+u.w>n.x+n.w+2||u.y<n.y-i-4||u.y+u.h>n.y+n.h+i+6)break;const h=[...o.filter(e=>l(e,u)),...t.filter(e=>!s.own.includes(e)&&l(e,u))];if(!h.length){o.push(u),a.push({...s,y:c});break}c=d<0?Math.min(...h.map(e=>e.y))-3:Math.max(...h.map(e=>e.y+e.h))+i+3}}return a}function te({layout:e,lit:n,active:i,spot:l,painStrike:o,showPain:a,grow:s=1,atm:u=null,moves:h}){const{scale:x,bars:y,orientation:p}=e,{plot:b}=x,w='both'===e.mode,O=1-Math.pow(1-s,3),T=O,k=O,S=((0,t.useMemo)(()=>null==u?0:y.reduce((e,t)=>
1020Math.max(e,Math.abs(t.index-u)),0),[y,u]),(0,t.useMemo)(()=>{if(!w)return new Map;let e='',t=0,n='',i=0;for(const l of y){const o=l.side+l.index;(l.seg?.added??0)>t&&(t=l.seg.added,e=o),(l.seg?.unwound??0)>i&&(i=l.seg.unwound,n=o)}const l=new Map;return e&&l.set(e,'added'),n&&n!==e&&l.set(n,'unwound'),l},[y,w]),'across'===p),L=(0,t.useMemo)(()=>{if(!S)return[];const t=[...e.peakLabels.filter(e=>e.peak).map(e=>({...e,dir:-1}))];for(const n of h||[]){const i=y.find(e=>e.side+e.index===n.key);if(!i)continue;const l='change'===e.mode&&i.value<0;t.push({side:i.side,text:n.text,x:i.box.x+i.box.w/2,y:l?i.box.y+i.box.h+f.SMALL+2:i.box.y-4,anchor:'middle',peak:!0,dir:l?1:-1})}const n=new Map;for(const e of t)n.set(e.side+Math.round(e.x)+e.dir,e);const i=[...n.values()];return ee(i.map(e=>{return{...e,own:(t=e.x,y.filter(e=>t>=e.box.x-1&&t<=e.box.x+e.box.w+1).map(e=>e.box))};var t}),y.map(e=>e.box),b,f.SMALL)},[e,S,y,b,h]),I=l?(0,f.placeSpotPill)(e,E):null,R=(e,t,n,i)=>S?(0,_.jsx)(r.Rect,{x:x.at(e)-x.band/2,y:b.y,width:x.band,height:b.h,fill:t,opacity:n},i):(0,_.jsx)(r.Rect,{x:b.x,y:x.at(e)-x.band/2,width:b.w,height:x.band,fill:t,opacity:n},i);return(0,_.jsxs)(d.default,{width:x.width,height:x.height,'aria-hidden':!0,children:[(0,_.jsx)(C.OiHatchDefs,{}),null!=n&&R(n,c.C.mint,.12,'lit'),null!=i&&i!==n&&R(i,c.C.mint,.1,'act'),S&&e.ticks.map(e=>(0,_.jsxs)(r.G,{children:[(0,_.jsx)(r.Line,{x1:b.x,x2:b.x+b.w,y1:e.pos,y2:e.pos,stroke:c.C.line,strokeWidth:1,strokeDasharray:0===e.value?void 0:'2 4'}),(0,_.jsx)(r.Text,{x:b.x-6,y:e.pos+4,fill:c.C.muted,fontSize:f.SMALL,fontFamily:M,textAnchor:"end",children:e.text})]},'t'+e.value)),!S&&e.headers&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(r.Text,{x:e.headers.call.x+e.headers.call.w-4,y:e.headers.call.y+12,fill:v,fontSize:f.SMALL,fontFamily:M,fontWeight:"600",textAnchor:"end",children:f.SIDE_HEADERS.call}),(0,_.jsx)(r.Text,{x:e.headers.put.x+4,y:e.headers.put.y+12,fill:A,fontSize:f.SMALL,fontFamily:M,fontWeight:"600",textAnchor:"start",children:f.SIDE_HEADERS.put}),(0,_.jsx)(r.Text,{x:e.zero,y:e.headers.call.y+12,fill:c.C.muted,fontSize:f.SMALL,fontFamily:M,textAnchor:"middle",children:"Strike"})]}),null!=e.spotPos&&(S?(0,_.jsx)(r.Line,{x1:e.spotPos,x2:e.spotPos,y1:b.y-2,y2:b.y+b.h,stroke:m.SPOT_COLOR,strokeWidth:1.5,strokeDasharray:"4 3"}):(0,_.jsx)(r.Line,{x1:b.x,x2:b.x+b.w,y1:e.spotPos,y2:e.spotPos,stroke:m.SPOT_COLOR,strokeWidth:1.5,strokeDasharray:"4 3"})),(0,_.jsx)(r.G,{transform:T>=1?void 0:S?`translate(0 ${e.zero}) scale(1 ${Math.max(.001,T)}) translate(0 ${-e.zero})`:`translate(${e.zero} 0) scale(${Math.max(.001,T)} 1) translate(${-e.zero} 0)`,children:y.map(t=>{const n='call'===t.side?v:A,i=t.side+t.index;return'both'===e.mode&&t.seg&&t.origin?(0,_.jsx)(C.OiBothBar,{side:t.side,seg:t.seg,scale:e.len,orientation:p,thickness:e.barThickness,origin:t.origin,label:"none",mark:h?.find(e=>e.key===i)?.part??null},i):(0,_.jsx)(r.Rect,{x:t.box.x,y:t.box.y,width:t.box.w,height:t.box.h,fill:n,opacity:t.fall?z:.9,rx:1.5},i)})}),(0,_.jsxs)(r.G,{opacity:k,children:[!S&&e.valueLabels.map((e,t)=>(0,_.jsx)(r.Text,{x:e.x,y:e.y,fill:e.peak?c.C.ink:c.C.muted,fontSize:f.SMALL,fontFamily:M,fontWeight:e.peak?'700':'400',textAnchor:e.anchor,children:e.text},'v'+t)),S&&L.map((e,t)=>(0,_.jsxs)(r.G,{children:[(0,_.jsx)(r.Text,{x:e.x,y:e.y,fill:c.C.bg,stroke:c.C.bg,strokeWidth:3,strokeLinejoin:"round",fontSize:f.SMALL,fontFamily:M,fontWeight:e.peak?'700':'500',textAnchor:"middle",children:e.text}),(0,_.jsx)(r.Text,{x:e.x,y:e.y,fill:'call'===e.side?v:A,fontSize:f.SMALL,fontFamily:M,fontWeight:e.peak?'700':'500',textAnchor:"middle",children:e.text})]},'p'+t))]}),S&&(0,_.jsx)(r.Line,{x1:b.x,x2:b.x+b.w,y1:e.zero,y2:e.zero,stroke:c.C.muted,strokeWidth:1}),x.labels.map(e=>(0,_.jsx)(r.Text,{x:e.box.x+e.box.w/2,y:e.box.y+f.FONT-1,fill:e.atm?c.C.ink:c.C.muted,fontSize:f.FONT,fontFamily:M,fontWeight:e.atm?'700':'400',textAnchor:"middle",children:e.text},'s'+e.strike)),(0,_.jsx)(j.MaxPainMarker,{strike:o,scale:x,orientation:p,visible:a}),I&&(0,_.jsxs)(r.G,{children:[(0,_.jsx)(r.Rect,{x:I.x,y:I.y,width:I.w,height:I.h,rx:10,fill:c.C.dark,stroke:m.SPOT_COLOR,strokeWidth:1}),(0,_.jsx)(r.Text,{x:I.x+I.w/2,y:I.y+14,fill:m.SPOT_COLOR,fontSize:f.SMALL,fontFamily:M,fontWeight:"600",textAnchor:"middle",children:E})]})]})}},927,[11,13,278,375,400,928,840,821,198,924,920,929,931,933,932,934,930,935,937,938,939,940,941,942,6]); 1021__d(function(g,r,i,a,m,e,d){"use strict";
1021Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CTRL",{enumerable:!0,get:function(){return t}});const t={h:26,padX:8,radius:6,font:11,lineHeight:14,icon:14,gap:6}},928,[]); 1022__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"uxPreview",{enumerable:!0,get:function(){return n.uxPreview}}),Object.defineProperty(_e,"MINUS",{enumerable:!0,get:function(){return r}}),_e.lcr=l,_e.signedLcr=i,_e.strikeText=a,_e.spotText=function(t){const e=o(t);return null==e?'\u2014':e.toLocaleString('en-IN',{minimumFractionDigits:0,maximumFractionDigits:2})},_e.toStrikeRows=function(t){const e=new Map;for(const n of t||[]){const t=o(n?.strike);if(null==t||e.has(t))continue;const r=o(n.ce_oi),l=o(n.pe_oi),i=o(n.ce_oi_change_day),a=o(n.pe_oi_change_day);e.set(t,{strike:t,ce_oi:r,pe_oi:l,ce_chg:i,pe_chg:a,ce_base:null!=r&&null!=i?r-i:null,pe_base:null!=l&&null!=a?l-a:null,ce_buildup:n.ce_buildup_day??null,pe_buildup:n.pe_buildup_day??null})}return[...e.values()].sort((t,e)=>t.strike-e.strike)},_e.stampParts=u,_e.spotLabel=c,_e.resolveSpot=function(t,n){if(!t)return null;const r=t.as_of??null,l=(0,e.isIndexUnderlying)(t.underlying),i=o(t.spot);if(null!=i){const e=t.spot_at??r;return{value:i,at:e,fallback:!(!e||!r||e===r),label:c(i,e,r,l),isIndex:l}}const a=h(r),s=o(t.spot_last);if(null!=s&&t.spot_last_at&&(null==a||h(t.spot_last_at)<=a))return{value:s,at:t.spot_last_at,fallback:!0,label:c(s,t.spot_last_at,r,l),isIndex:l};if(!n?.length||null==a)return null;const f=u(r)?.day;let p=null,d='';for(const t of n){const e=o(t?.spot),n=h(t?.at);null==e||null==n||n>a||u(t.at)?.day!==f||(!p||n>d)&&(p=t,d=n)}return p?{value:p.spot,at:p.at,fallback:!0,label:c(p.spot,p.at,r,l),isIndex:l}:null},Object.defineProperty(_e,"ACROSS_RATIO",{enumerable:!0,get:function(){return f}}),_e.autoOrientation=p,_e.chooseOrientation=function(t,e,n,o){return o?'down':'across'===t||'down'===t?t:p(e,n)},Object.defineProperty(_e,"ORIENTATION_KEY",{enumerable:!0,get:function(){return d}}),_e.orientationKey=function(t){return`${d}.${null==t||''===t?'anon':t}`},_e.parseOrientationChoice=function(t){return'across'===t||'down'===t?t:'auto'},Object.defineProperty(_e,"WINDOW_DEFAULT",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"WINDOW_CHOICES",{enumerable:!0,get:function(){return m}}),_e.windowLabel=function(t){return'all'===t?'All':`\xb1${t}`},_e.atmIndex=x,_e.windowCentre=function(t,e,n){if(!t.length)return{index:null,basis:'none'};const o=x(t,e);if(null!=o)return{index:o,basis:'atm'};const r=x(t,n);return null!=r?{index:r,basis:'max_pain'}:{index:Math.floor((t.length-1)/2),basis:'middle'}},_e.windowRows=function(t,e,n){if('all'===n||null==e)return{rows:t,start:0};const o=Math.max(0,e-n),r=Math.min(t.length-1,e+n);return{rows:t.slice(o,r+1),start:o}},_e.valueExtent=g,_e.niceStep=_,_e.valueTicks=y,Object.defineProperty(_e,"MIN_FALL_PX",{enumerable:!0,get:function(){return M}}),_e.axisTicks=k,_e.textWidth=O,Object.defineProperty(_e,"FONT",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"SMALL",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"LABEL_GAP",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"MIN_BAR",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"MAX_BAR",{enumerable:!0,get:function(){return A}}),Object.defineProperty(_e,"MAX_BAR_ACROSS",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"MIN_ROW",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"MIN_BAND_ACROSS",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"SPOT_GAP",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"LABEL_EVERY_PX",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"DOWN_LABEL_H",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"DOWN_LABEL_GAP",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"ACROSS_PAD",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"DOWN_PAD",{enumerable:!0,get:function(){return C}}),_e.thinStep=D,_e.layoutChart=function(e){const{rows:n,mode:o,orientation:u}=e,s=n.length,c=Math.max(0,Math.floor(e.width)),h=Math.max(0,Math.floor(e.height)),f=e.extent&&e.extent.hi>e.extent.lo?e.extent:g(n,o),p='across'===u?{lo:f.lo<0?1.18*f.lo:f.lo,hi:f.hi*('both'===o?1.14:1.1)}:'both'===o?{lo:f.lo,hi:1.04*f.hi}:f,d=e.peaks?.call??null,b=e.peaks?.put??null,m=n.map(t=>a(t.strike)),x=Math.max(0,...m.map(t=>O(t,P))),_=(t,e)=>'change'===o?'call'===e?t.ce_chg:t.pe_chg:'call'===e?t.ce_oi:t.pe_oi,y=(e,n)=>'both'===o?(0,t.segments)(e,'prev_close')[n]:null,M=(t,e,n)=>{const o=y(t,e);return o?o.held+Math.max(o.added,o.unwound):n},W=(t,e,n)=>{if('change'===o)return i(n);const a=y(t,e);return a&&a.unwound>0?`${l(n)} (${r}
1022${l(a.unwound)})`:l(n)},G=[],X=[],Y=[];if('across'===u){const t=s?Math.max(L,(c-R.left-R.right)/s):0,r=s*t,a=Math.max(c,Math.ceil(r+R.left+R.right)),f={x:R.left,y:R.top,w:r,h:Math.max(40,h-R.top-R.bottom-(e.maxPainBand||0))},g=k(p,f.h),A=t=>f.y+f.h-(t-g.lo)/(g.hi-g.lo)*f.h,$=A(0),j=Math.max(E,Math.min(I,Math.floor((t-8)/2))),T=e=>f.x+(e+.5)*t,N=[];n.forEach((e,n)=>{['call','put'].forEach((r,a)=>{const u=_(e,r);if(null==u)return;const s=T(n)+(0===a?-j-1:1),c=M(e,r,u),h=Math.min(A(c),$),f=Math.abs(A(c)-$),p=y(e,r),m={x:s,y:h,w:j,h:Math.max(0!==c?1:0,f)},x='change'===o&&u<0;G.push({side:r,index:n,strike:e.strike,value:u,outline:!1,fall:x,box:m,...'both'===o?{seg:p,origin:{x:s+j/2,y:$}}:{}});const g=s+j/2;if(u>0&&('call'===r&&e.strike===d||'put'===r&&e.strike===b)&&N.push({side:r,text:'change'===o?i(u):l(u),x:g,y:m.y-4,anchor:'middle',peak:!0}),x){const e=i(u),o=O(e,w),l=T(n)-t/2+1,a=T(n)+t/2-1,s=Math.max(l,Math.min(a-o,g-o/2));o<=t-2&&!N.some(t=>t.y>$&&Math.abs(t.x-(s+o/2))<(o+O(t.text,w))/2+2)&&N.push({side:r,text:e,x:s+o/2,y:m.y+m.h+w+1,anchor:'middle'})}})});const C=t>=S?1:Math.max(2,D(s,t,x)),W=e.atm??0,U=t=>{const o=O(m[t],P);return{strike:n[t].strike,index:t,text:m[t],atm:t===e.atm,box:{x:T(t)-o/2,y:f.y+f.h+6,w:o,h:14}}},z=[];for(const t of[e.atm,n.findIndex(t=>t.strike===d),n.findIndex(t=>t.strike===b)])if(null!=t&&t>=0&&!z.includes(t)){const e=U(t);z.some(t=>H(U(t).box,e.box))||z.push(t)}n.forEach((t,e)=>{if(z.includes(e))return void Y.push(U(e));if(((e-W)%C+C)%C!==0)return;const n=U(e);z.some(t=>H(U(t).box,{...n.box,x:n.box.x-4,w:n.box.w+v}))||Y.push(n)}),Y.sort((t,e)=>t.index-e.index);const J=B('across',n,t,T,f,f.y+f.h+6+P,Y,a,h),K=F(J,e.spot);return{orientation:u,mode:o,scale:J,bars:G,zero:$,valueLabels:X,atm:e.atm,barThickness:j,len:t=>$-A(t),peakLabels:N,ticks:g.ticks.map(t=>({value:t,text:0===t?'0':l(t),pos:A(t)})),spotPos:K.pos,spotOutside:K.outside,headers:null,scrolls:a>c+1}}const U=e.spot;let z=-1;if(null!=U&&s>1)for(let t=0;t<s-1;t++)if(U>=n[t].strike&&U<=n[t+1].strike){z=t;break}const J=z>=0?j:0,K=Math.max(0,h-C.top-C.bottom-J),V=s?Math.max($,K/s):0,q=s*V+J,Q=Math.max(h,Math.ceil(q+C.top+C.bottom)),Z=Math.max(C.centre,Math.ceil(x+20)),tt=c/2,et=Math.max(0,tt-Z/2-C.side);let nt=0;n.forEach(t=>['call','put'].forEach(e=>{const n=_(t,e);null!=n&&(nt=Math.max(nt,O(W(t,e,n),w)))})),e.labelSample&&(nt=O(e.labelSample,w));const ot=Math.max(20,et-Math.max(C.valueRoom,Math.ceil(nt)+8)),rt={x:C.side,y:C.top,w:Math.max(0,c-2*C.side),h:q},lt=Math.max(Math.abs(p.lo),Math.abs(p.hi))||1,it=t=>Math.abs(t)/lt*ot,at=Math.max(E,Math.min(A,Math.floor(.55*V))),ut=t=>rt.y+(t+.5)*V+(z>=0&&t>z?J:0),st=z>=0?rt.y+(z+1)*V:0,ct=tt-Z/2,ht=tt+Z/2;n.forEach((t,e)=>{['call','put'].forEach(n=>{const r=_(t,n);if(null==r)return;const l=M(t,n,r),i=Math.max(0!==l?1:0,it(l)),a=ut(e)-at/2,u='call'===n?{x:ct-2-i,y:a,w:i,h:at}:{x:ht+2,y:a,w:i,h:at},s=y(t,n);G.push({side:n,index:e,strike:t.strike,value:r,outline:!1,fall:'change'===o&&r<0,box:u,...'both'===o?{seg:s,origin:{x:'call'===n?ct-2:ht+2,y:ut(e)}}:{}});const c=W(t,n,r);X.push('call'===n?{side:n,text:c,x:u.x-4,y:ut(e)+3.96,anchor:'end',peak:r>0&&t.strike===d}:{side:n,text:c,x:u.x+u.w+4,y:ut(e)+3.96,anchor:'start',peak:r>0&&t.strike===b})})});const ft=D(s,V,T,N),pt=e.atm??0;n.forEach((t,n)=>{if(((n-pt)%ft+ft)%ft!==0)return;const o=O(m[n],P);Y.push({strike:t.strike,index:n,text:m[n],atm:n===e.atm,box:{x:tt-o/2,y:ut(n)-6.5,w:o,h:T}})});const dt=B('down',n,V,ut,rt,tt,Y,c,Q,z>=0?{index:z,top:st,h:J}:null),bt=F(dt,e.spot),mt=z>=0&&null!=bt.pos?st+Math.max(0,Math.min(1,(e.spot-n[z].strike)/(n[z+1].strike-n[z].strike||1)))*J:bt.pos;return{orientation:u,mode:o,scale:dt,bars:G,zero:tt,ticks:[],valueLabels:X,atm:e.atm,barThickness:at,len:it,peakLabels:[],spotPos:mt,spotOutside:bt.outside,spotRow:z>=0?{y:st,h:J}:null,headers:{call:{x:rt.x,y:4,w:ct-rt.x,h:16},put:{x:ht,y:4,w:rt.x+rt.w-ht,h:16}},scrolls:Q>h+1}},Object.defineProperty(_e,"PILL_H",{enumerable:!0,get:function(){return W}}),_e.pillWidth=G,_e.placeSpotPill=function(t,e){if(null==t.spotPos)return null;const n=G(e),o=W,r=t.scale.width;if('across'===t.orientation)return n>r-4||t.scale.plot.y<26?null:{x:Math.max(2,Math.min(r-n-2,t.spotPos-n/2)),y:4,w:n,h:o};return t.spotRow?{x:Math.max(2,Math.min(r-n-2,t.zero-n/2)),y:t.spotRow.y+(t.spotRow.h-o)/2,w:n,h:o}:null},_e.overlaps=H,_e.labelsClear=function(t){for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++)if(H(t[e].box,t[n].box))return!1;return!0},Object.defineProperty(_e,"MODE_LABELS",{enumerable:!0,get:function(){return X}}),Object.defineProperty(_e,"MAX_PAIN_TOGGLE",{enumerable:!0,get:function(){return Y}}),_e.pcrFromTotals=U,Object.defineProperty(_e,"ORIENTATION_LABELS",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"SIDE_HEADERS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(_e,"NO_SPOT_TEXT",{enumerable:!0,get:function(){return K}}),Object.defineProperty(_e,"OUTSIDE_TEXT",{enumerable:!0,get:function(){return V}}),Object.defineProperty(_e,"CENTRE_TEXT",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"CHANGE_NOTE",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(_e,"OI_NOTE",{enumerable:!0,get:function(){return Z}}),_e.replayExtent=function(t,e,n,r){if(!t)return null;if('oi'===e)return null!=n&&n>0?{lo:0,hi:n}:null;if('both'===e){let e=n??0;for(const n of[...t.prev_close_call,...t.prev_close_put]){const t=o(n);null!=t&&t>e&&(e=t)}return e>0?{lo:0,hi:1.04*e}:null}if(null==r||!(r>0))return null;let l=0,i=0;const a=[[t.call_oi,t.prev_close_call],[t.put_oi,t.prev_close_put]];for(const[t,e]of a)for(const n of t)n.forEach((t,n)=>{const r=o(t),a=o(e[n]);if(null==r||null==a)return;const u=r-a;u<l&&(l=u),u>i&&(i=u)});return{lo:l,hi:i}},_e.replayLabelSample=function(t,e){if(!e)return null;const n=Math.max(Math.abs(e.lo),Math.abs(e.hi));return'change'===t?i(-n):'both'===t?`${l(n)} (${r}${l(n)})`:l(n)},_e.frameSpot=function(t,n){if(!t)return null;const r=(0,e.isIndexUnderlying)(n),l=o(t.spot);if(null!=l)return{value:l,at:t.at,fallback:!1,label:c(l,t.at,t.at,r),isIndex:r};const i=t.spotEarlier;return i&&null!=o(i.value)?{value:i.value,at:i.at,fallback:!0,label:c(i.value,i.at,t.at,r),isIndex:r}:null},_e.sameReading=tt,_e.maxPainAt=function(t,e){if(!t||!e)return null;const n=t.find(t=>tt(t.at,e));return n?o(n.max_pain_strike):null},_e.frameTotals=function(t){let e=0,n=0,o=!1,r=!1;for(const l of t)null!=l.ce_oi&&(e+=l.ce_oi,o=!0),null!=l.pe_oi&&(n+=l.pe_oi,r=!0);return{ce:o?e:null,pe:r?n:null}},Object.defineProperty(_e,"REPLAY_TOGGLE",{enumerable:!0,get:function(){return et}}),Object.defineProperty(_e,"REPLAY_OPEN",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(_e,"REPLAY_CLOSE",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(_e,"REPLAY_PAIN_NOTE",{enumerable:!0,get:function(){return rt}}
1022),_e.topStrike=lt,_e.topChange=function(t,e){let n=null;for(const o of t){const t='call'===e?o.ce_chg:o.pe_chg;null!=t&&t>0&&((!n||t>n.value)&&(n={strike:o.strike,value:t}))}return n},_e.highestInView=function(t,e,n){const o=lt(t,n),r=lt(e,n),l=new Set(t.map(t=>t.strike));return{top:o,outside:r&&!l.has(r.strike)?r:null}},_e.highestText=function(t,e){const n='call'===t?'Highest call OI':'Highest put OI',o=e.top?`${n} ${a(e.top.strike)} (${l(e.top.value)})`:`${n} \u2014`;return e.outside?`${o} (outside view: ${a(e.outside.strike)})`:o},_e.statTiles=function(t){const n=e=>{let n=0,o=0;for(const r of t.rows){const t=r[e];null!=t&&(n+=t,o++)}return o?n:null},o=e=>{const o='call'===e?t.totals.ce:t.totals.pe,r=n('call'===e?'ce_chg':'pe_chg');return{key:e,label:'call'===e?'Call OI':'Put OI',value:l(o),sub:null==r?'change \u2014':`${i(r)} ${t.changeLabel||'since prev close'}`}},r=U(t.totals.ce,t.totals.pe),a=t.spot&&u(t.spot.at)?.time||'';return[o('call'),o('put'),{key:'pcr',label:'PCR',value:null==r?'\u2014':r.toFixed(2),sub:'put OI \xf7 call OI'},{key:'spot',label:'Spot',value:t.spot?(0,e.level)(t.spot.value,!0===t.spot.isIndex,2,0):'\u2014',sub:t.spot?`${t.spot.fallback?'last spot \xb7 ':''}${a}`:'no spot this session'}]},_e.statCoverage=function(t){const e=[];for(const[n,o,r]of[['Call',"ce_oi","ce_chg"],['Put',"pe_oi","pe_chg"]]){let l=0,i=0;for(const e of t)null!=e[o]&&l++,null!=e[r]&&i++;i<l&&e.push(`${n} OI change over ${i} of ${l} strikes`)}return e},_e.currentIndex=function(t,e){if(!t||!e)return null;const n=t.findIndex(t=>tt(t.at,e));return n<0?null:n},Object.defineProperty(_e,"PLAY_TOGGLE",{enumerable:!0,get:function(){return it}}),Object.defineProperty(_e,"PLAY_HINT",{enumerable:!0,get:function(){return at}});var t=_r(_d[0]),e=_r(_d[1]),n=_r(_d[2]);const o=t=>'number'==typeof t&&Number.isFinite(t)?t:null,r='\u2212';function l(t){const e=o(t);if(null==e)return'\u2014';const n=Math.abs(e),l=e<0?r:'',i=t=>{const e=t>=100?t.toFixed(0):t.toFixed(1);return e.endsWith('.0')?e.slice(0,-2):e};return n>=1e7?`${l}${i(n/1e7)}Cr`:n>=1e5?`${l}${i(n/1e5)}L`:n>=1e3?`${l}${i(n/1e3)}k`:`${l}${Math.round(n)}`}function i(t){const e=o(t);return null==e?'\u2014':(e>0?'+':'')+l(e)}function a(t){const e=o(t);return null==e?'\u2014':Math.round(e).toLocaleString('en-IN')}function u(t){const e=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}):(\d{2}))?/.exec(String(t||'').trim());return e?{day:e[1],time:e[2]?`${e[2]}:${e[3]}`:''}:null}const s=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];function c(t,n,o,r=!0){const l=u(n),i=u(o);let a='';if(l){const[t,e,n]=l.day.split('-').map(Number),o=`${n} ${s[e-1]||''}`.trim();a=i&&i.day!==l.day?`${o}${l.time?' '+l.time:''}`:l.time||o}return`Spot ${(0,e.level)(t,r,2,0)}${a?' \xb7 '+a:''}`}function h(t){const e=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?/.exec(String(t||'').trim());return e?`${e[1]} ${e[2]||'00'}:${e[3]||'00'}:${e[4]||'00'}`:null}const f=1.2;function p(t,e){return t>0&&e>0?t/e>=f?'across':'down':'across'}const d='kanida.oiChart.orientation';const b=10,m=[5,10,15,'all'];function x(t,e){const n=o(e);if(null==n||!t.length)return null;let r=0,l=1/0;return t.forEach((t,e)=>{const o=Math.abs(t.strike-n);o<l-1e-9&&(r=e,l=o)}),r}function g(t,e){let n=0,o=0;for(const r of t){const t='change'===e?[r.ce_chg,r.pe_chg]:'both'===e?[r.ce_oi,r.pe_oi,r.ce_base,r.pe_base]:[r.ce_oi,r.pe_oi];for(const e of t)null!=e&&(e>o&&(o=e),e<n&&(n=e))}return{lo:n,hi:o}}function _(t,e){if(!(t>0))return 1;const n=t/Math.max(1,e),o=Math.pow(10,Math.floor(Math.log10(n)));for(const t of[1,2,2.5,5,10])if(t*o>=n-1e-9)return t*o;return 10*o}function y(t,e=4){const n=t.hi-t.lo;if(!(n>0))return{ticks:[0],lo:0,hi:1};let o=_(n,e-1);for(let n=0;n<12;n++){const n=Math.floor(t.lo/o+1e-9)*o,r=Math.ceil(t.hi/o-1e-9)*o,l=Math.round((r-n)/o)+1;if(l<=e){const t=[];for(let e=0;e<l;e++){const r=n+e*o;t.push(Math.abs(r)<o/1e6?0:r)}return{ticks:t,lo:n,hi:r}}o=_(1.0001*o,1)}return{ticks:[0],lo:Math.min(0,t.lo),hi:Math.max(t.hi,1)}}const M=20;function k(t,e,n=4){const o=Math.max(0,t.hi),r=Math.min(0,t.lo);if(!(o>0||r<0))return{ticks:[0],lo:0,hi:1};const l=o>0?y({lo:0,hi:o},n):{ticks:[0],lo:0,hi:0};let i=l.hi,a=r;if(!(i>0)){i=0;const t=y({lo:r,hi:0},n);return{ticks:t.ticks,lo:t.lo,hi:1e-4*Math.abs(t.lo)}}if(a<0&&e>40){const t=-M/(e-M)*i;a>t&&(a=t)}const u=l.ticks.length>1?l.ticks[1]-l.ticks[0]:i,s=[...l.ticks];for(let t=-u;t>=a-1e-9;t-=u)s.unshift(t);let c=s,h=1;for(;c.length>n&&h<64;)h*=2,c=s.filter(t=>
1022Math.abs(Math.round(t/u))%h===0);return{ticks:c,lo:a,hi:i}}function O(t,e){let n=0;for(const e of t)n+=/[.,:\xb7' ]/.test(e)?.34:/[\u2212+\u2014]/.test(e)?.66:.62;return n*e}const P=12,w=11,v=8,E=6,A=16,I=22,$=14,L=16,j=24,S=44,T=13,N=1,R={left:48,right:12,top:30,bottom:26},C={top:26,bottom:8,side:6,centre:66,valueRoom:44};function D(t,e,n,o=v){return t<=1||!(e>0)?1:Math.max(1,Math.ceil((n+o)/e))}function B(t,e,n,o,r,l,i,a,u,s=null){const c=e.map(t=>t.strike),h='across'===t?r.x:r.y;return{orientation:t,strikes:c,band:n,at:o,pos:t=>{if(!c.length||!Number.isFinite(t))return null;if(1===c.length)return Math.abs(t-c[0])<1e-9?o(0):null;if(t<c[0]||t>c[c.length-1])return null;for(let e=0;e<c.length-1;e++){const n=c[e],r=c[e+1];if(t>=n&&t<=r)return o(e)+(r===n?0:(t-n)/(r-n))*(o(e+1)-o(e))}return null},indexAt:t=>{if(!(c.length&&n>0))return null;let e=t;if(s)if(e>=s.top+s.h)e-=s.h;else if(e>=s.top)return e<s.top+s.h/2?s.index:s.index+1;return Math.max(0,Math.min(c.length-1,Math.floor((e-h)/n)))},plot:r,axis:l,labels:i,width:a,height:u}}function F(t,e){if(null==e||!t.strikes.length)return{pos:null,outside:null};const n=t.pos(e);return null!=n?{pos:n,outside:null}:{pos:null,outside:e<t.strikes[0]?'below':'above'}}const W=20;function G(t){return Math.ceil(O(t,w))+14}function H(t,e){return t.x<e.x+e.w&&e.x<t.x+t.w&&t.y<e.y+e.h&&e.y<t.y+t.h}const X={oi:'OI',change:'Change',both:'Both'},Y='Max pain';function U(t,e){const n=o(t),r=o(e);return null!=n&&null!=r&&n>0?r/n:null}const z={auto:'Auto',across:'Across',down:'Down'},J={call:'Calls',put:'Puts'},K='No spot at this reading or earlier in this session',V={below:'below the strikes shown',above:'above the strikes shown'},q={max_pain:'No spot: strikes centred on max pain',middle:'No spot: strikes centred on the middle strike'},Q='A fall in open interest is a lighter bar below zero, with a minus value.',Z='Each bar is the open interest standing at this reading; nothing is smoothed or projected.';function tt(t,e){const n=h(t),o=h(e);return null!=n&&n===o}const et='Replay',nt='Replay the session',ot='Back to this reading',rt='Max pain shown for the reading on screen';function lt(t,e){let n=null;for(const o of t){const t='call'===e?o.ce_oi:o.pe_oi;null!=t&&t>0&&((!n||t>n.value)&&(n={strike:o.strike,value:t}))}return n}const it='Play the day',at='Watch the open interest build, reading by reading, up to this reading.'},929,[930,926,881]); 1023__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MIN_SEGMENT_PX",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_UNWOUND_PX",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"UNWOUND_STROKE",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"BASELINES",{enumerable:!0,get:function(){return o}}),e.sideSegments=s,e.baselineOi=p,e.segments=function(n,t="prev_close"){return{call:s(n.ce_oi,p(n,'call',t)),put:s(n.pe_oi,p(n,'put',t))}},e.segmentLayout=function(n,l,o=t,c=Math.max(u,o)){if(!n)return null;const s=n=>{const t=l(n);return'number'==typeof t&&Number.isFinite(t)?Math.max(t,0):0},p=(n,t,u,l=o)=>n>0?Math.max(u-t,l):0,h=s(0),b=p(n.held,h,s(n.held)),f=p(n.added,s(n.held),s(n.held+n.added)),_=p(n.unwound,s(n.held),s(n.held+n.unwound),c);return{held:{start:0,length:b},added:{start:b,length:f},unwound:{start:b,length:_},end:b+Math.max(f,_)}},e.unwoundLabel=function(t){return t&&t.unwound>0?n.MINUS+(0,n.compact)(t.unwound):null},e.addedLabel=function(t){return t&&t.added>0?'+'+(0,n.compact)(t.added):null},e.baselineWords=h,e.bothBarLabel=function(t,u,l="prev_close"){const o='call'===t?'Call OI':'Put OI';if(!u)return`${o}: ${n.DASH} not available`;const c=`since ${h(l)}`,s=[`${o} ${(0,n.compact)(u.held+u.added)}`,`held ${(0,n.compact)(u.held)}`];u.added>0?s.push(`added ${(0,n.compact)(u.added)} ${c}`):u.unwound>0?s.push(`unwound ${(0,n.compact)(u.unwound)} ${c}`):s.push(`unchanged ${c}`);return s.join(', ')};var n=r(d[0]);const t=2,u=4,l=1,o=['prev_close'],c=n=>'number'==typeof n&&Number.isFinite(n)&&n>=0?n:null;function s(n,t){const u=c(n),l=c(t);return null==u||null==l?null:{held:Math.min(u,l),added:Math.max(u-l,0),unwound:Math.max(l-u,0)}}function p(n,t,u){if('prev_close'!==u)return null;const l='call'===t?n.ce_base:n.pe_base;if(null!=c(l))return l;const o='call'===t?n.ce_oi:n.pe_oi,s='call'===t?n.ce_chg:n.pe_chg,p=c(o),h='number'==typeof s&&Number.isFinite(s)?s:null;return null==p||null==h?null:c(p-h)}function h(n){return'prev_close'===n?'previous close':'baseline'}},930,[926]); 1024__d(function(g,r,_i,a,m,_e,d){"use strict";
1024function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return j}}),_e.nextSpeed=R,_e.OiReplay=L;var i=r(d[0]),t=e(i);r(d[1]);var n=e(r(d[2])),s=e(r(d[3])),l=r(d[4]),o=r(d[5]),c=r(d[6]),u=r(d[7]),y=r(d[8]);const p=44,b='Inter',h=11,f='Reading shown';function C({icon:e,label:i,onPress:t,disabled:s,hint:c,dense:u}){return(0,y.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:i,accessibilityHint:c,accessibilityState:{disabled:!!s},disabled:s,onPress:t,style:({pressed:e})=>({width:u?l.CTRL.h+4:p,height:u?l.CTRL.h:p,borderRadius:u?l.CTRL.radius:12,borderWidth:1,borderColor:o.C.line,backgroundColor:o.C.paper,alignItems:'center',justifyContent:'center',opacity:s?.42:e?.72:1}),children:(0,y.jsx)(o.Icon,{name:e,size:u?l.CTRL.icon:18,color:s?o.C.muted:o.C.green})})}function x({session:e,value:n,onChange:u,dense:b}){const h=e.readings.length,C=Math.max(0,h-1),[x,R]=(0,i.useState)(0),L=(0,c.replayValueText)(e,n);return(0,y.jsx)(s.default,{style:{minHeight:b?l.CTRL.h:p,justifyContent:'center'},children:t.default.createElement('input',{type:'range',min:0,max:C,step:1,value:n,'aria-label':f,'aria-valuetext':L,onChange:e=>u((0,c.clampIndex)(Number(e.target.value),h)),style:{width:'100%',height:p,margin:0,accentColor:o.C.green,cursor:'pointer',background:'transparent'}})})}function R(e){const i=c.REPLAY_SPEEDS.indexOf(e);return c.REPLAY_SPEEDS[(i+1)%c.REPLAY_SPEEDS.length]}function L({session:e,value:i,onChange:t,playing:f,onPlay:L,speed:j,onSpeed:E,load:P,wide:T=!1}){const S=(0,u.useReducedMotion)(),_=e=>(0,y.jsx)(o.T,{accessibilityLiveRegion:"polite",style:{fontFamily:b,fontSize:12,lineHeight:18,color:o.C.muted},children:e});if(!e)return'loading'===P?.state?_(c.REPLAY_LOADING):P&&'ready'!==P.state?_(P.message):_(c.REPLAY_NOT_AVAILABLE);const A=e.readings.length;if(!A)return _(c.REPLAY_NO_READINGS);const v=(0,c.clampIndex)(i,A),w=A-1,O=v>=w,I=(0,c.replayFrame)(e,v),D=(0,c.replayTicks)(e,5),H=A>1&&!S,k=e=>t((0,c.clampIndex)(e,A)),z=(0,y.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Show the latest reading",accessibilityState:{disabled:O},disabled:O,onPress:()=>{L(!1),k(w)},style:({pressed:e})=>({minHeight:T?l.CTRL.h:p,paddingHorizontal:T?l.CTRL.padX:14,borderRadius:T?l.CTRL.radius:11,borderWidth:1,borderColor:O?o.C.line:o.C.green,backgroundColor:o.C.paper,justifyContent:'center',opacity:O?.42:e?.72:1}),children:(0,y.jsx)(o.T,{style:{fontFamily:'InterMedium',fontSize:T?l.CTRL.font:12,color:O?o.C.muted:o.C.green},children:"Latest"})}),F=(0,y.jsx)(s.default,{style:{flexDirection:'row',justifyContent:'space-between'},accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:D.map(e=>(0,y.jsx)(o.T,{style:{fontFamily:b,fontSize:h,lineHeight:15,color:o.C.muted},children:e.time},e.index))});return T?(0,y.jsxs)(s.default,{style:{gap:4,maxWidth:'100%'},children:[(0,y.jsxs)(s.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,y.jsx)(C,{icon:"skip-back",label:"Previous reading",disabled:v<=0,onPress:()=>k(v-1),dense:!0}),(0,y.jsx)(C,{dense:!0,icon:f?'pause':'play',label:f?'Pause replay':'Play replay',disabled:!f&&!H,hint:S?c.REPLAY_REDUCED_MOTION:void 0,onPress:()=>L(!f)}),(0,y.jsx)(C,{dense:!0,icon:"skip-forward",label:"Next reading",disabled:O,onPress:()=>k(v+1)}),(0,y.jsxs)(s.default,{style:{flex:1,minWidth:160},children:[(0,y.jsx)(x,{dense:!0,session:e,value:v,onChange:k}),F]}),(0,y.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Replay speed ${j}\xd7. Change speed`,onPress:()=>E(R(j)),style:({pressed:e})=>({minWidth:l.CTRL.h+8,height:l.CTRL.h,paddingHorizontal:l.CTRL.padX,borderRadius:l.CTRL.radius,borderWidth:1,borderColor:o.C.green,backgroundColor:o.C.soft,alignItems:'center',justifyContent:'center',opacity:e?.72:1}),children:(0,y.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:l.CTRL.font,color:o.C.green},children:`${j}\xd7`})}),z]}),(0,y.jsxs)(o.T,{accessibilityLiveRegion:f?'none':'polite',numberOfLines:1,style:{fontFamily:b,fontSize:12,lineHeight:17,color:o.C.ink},children:[(0,c.replayReadout)(I,A),(0,y.jsxs)(o.T,{style:{fontFamily:b,fontSize:h,color:o.C.muted},children:[` \xb7 ${c.REPLAY_SCALE_NOTE}`,S?` \xb7 ${c.REPLAY_REDUCED_MOTION}`:'']})]})]}):(0,y.jsxs)(s.default,{style:{gap:8,maxWidth:'100%'},children:[(0,y.jsxs)(s.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,y.jsx)(C,{icon:"skip-back",label:"Previous reading",disabled:v<=0,onPress:()=>k(v-1)}),(0,y.jsx)(C,{icon:f?'pause':'play',label:f?'Pause replay':'Play replay',disabled:!f&&!H,hint:S?c.REPLAY_REDUCED_MOTION:void 0,onPress:()=>L(!f)}),(0,y.jsx)(C,{icon:"skip-forward",label:"Next reading",disabled:O,onPress:()=>k(v+1)}),(0,y.jsx)(o.T,{accessibilityLiveRegion:f?'none':'polite',numberOfLines:2,style:{flex:1,minWidth:150,fontFamily:b,fontSize:12,lineHeight:17,color:o.C.ink},children:(0,c.replayReadout)(I,A)})]}
1024),(0,y.jsx)(x,{session:e,value:v,onChange:k}),(0,y.jsx)(s.default,{style:{flexDirection:'row',justifyContent:'space-between'},accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:D.map(e=>(0,y.jsx)(o.T,{style:{fontFamily:b,fontSize:h,lineHeight:15,color:o.C.muted},children:e.time},e.index))}),(0,y.jsxs)(s.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,y.jsx)(s.default,{accessibilityLabel:"Replay speed",style:[o.s.row,{gap:6}],children:c.REPLAY_SPEEDS.map(e=>(0,y.jsx)(o.Chip,{label:`${e}\xd7`,active:j===e,onPress:()=>E(e)},e))}),(0,y.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Show the latest reading",accessibilityState:{disabled:O},disabled:O,onPress:()=>{L(!1),k(w)},style:({pressed:e})=>({minHeight:p,paddingHorizontal:14,borderRadius:11,borderWidth:1,borderColor:O?o.C.line:o.C.green,backgroundColor:o.C.paper,justifyContent:'center',opacity:O?.42:e?.72:1}),children:(0,y.jsx)(o.T,{style:{fontFamily:'InterMedium',fontSize:12,color:O?o.C.muted:o.C.green},children:"Latest"})})]}),(0,y.jsxs)(o.T,{style:{fontFamily:b,fontSize:h,lineHeight:15,color:o.C.muted},children:[c.REPLAY_SCALE_NOTE,S?` \xb7 ${c.REPLAY_REDUCED_MOTION}`:'']})]})}var j=L},931,[11,136,375,13,928,821,932,933,6]); 1025__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"OI_SESSION_PATH",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"REPLAY_SPEEDS",{enumerable:!0,get:function(){return r}}),Object.defineProperty(_e,"REPLAY_STEP_MS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"REPLAY_NOT_AVAILABLE",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"REPLAY_UNREADABLE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"REPLAY_NO_READINGS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"REPLAY_LOADING",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"REPLAY_SCALE_NOTE",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"REPLAY_REDUCED_MOTION",{enumerable:!0,get:function(){return c}}),_e.oiSessionPath=function(e){const n=[`underlying=${encodeURIComponent(e.underlying)}`];e.expiry&&n.push(`expiry=${encodeURIComponent(e.expiry)}`);e.session&&n.push(`session=${encodeURIComponent(e.session)}`);return`${t}?${n.join('&')}`},_e.parseOiSession=d,_e.sessionErrorResult=y,_e.sessionBodyResult=_,_e.fetchOiSession=async function(e,t){try{return _(await(0,n.api)(e,void 0,void 0,t))}catch(e){return y(e)}},_e.replayFrame=function(n,t){if(!n||!n.readings.length)return null;const r=b(t,n.readings.length),o=n.readings[r],i=n.call_oi[r]||[],s=n.put_oi[r]||[];let l=null;if(null==o.spot)for(let e=r-1;e>=0;e--){const t=n.readings[e].spot;if(null!=t){l={value:t,at:n.readings[e].at};break}}const u=n.strikes.map((e,t)=>{const r=f(i[t]),o=f(s[t]),l=f(n.prev_close_call[t]),u=f(n.prev_close_put[t]);return{strike:e,ce_oi:r,pe_oi:o,ce_chg:h(r,l),pe_chg:h(o,u),ce_base:l,pe_base:u}});return{index:r,at:o.at,time:(0,e.clock)(o.at),on_grid:o.on_grid,spot:o.spot,spotEarlier:l,rows:u}},_e.replayScaleMax=function(e){if(!e)return null;let n=null;for(const t of[e.call_oi,e.put_oi])for(const e of t)for(const t of e){const e=f(t);null!=e&&(null==n||e>n)&&(n=e)}return n},_e.replayChangeScaleMax=function(e){if(!e)return null;let n=null;const t=[[e.call_oi,e.prev_close_call],[e.put_oi,e.prev_close_put]];for(const[e,r]of t)for(const t of e)t.forEach((e,t)=>{const o=h(f(e),f(r[t]));null!=o&&(null==n||Math.abs(o)>n)&&(n=Math.abs(o))});return n},_e.clampIndex=b,_e.replayTicks=function(n,t=5){const r=n?.readings.length||0;if(!n||!r)return[];if(1===r)return[{index:0,time:(0,e.clock)(n.readings[0].at)}];const o=Math.max(2,Math.min(t,r)),i=[];for(let t=0;t<o;t++){const s=Math.round(t*(r-1)/(o-1));i.length&&i[i.length-1].index===s||i.push({index:s,time:(0,e.clock)(n.readings[s].at)})}return i},_e.replayReadout=function(e,n){return e?`Open interest as captured at ${e.time} \xb7 reading ${e.index+1} of ${n}`:l},_e.replayValueText=function(n,t){const r=n?.readings.length||0;if(!n||!r)return l;const o=b(t,r);return`${(0,e.clock)(n.readings[o].at)}, reading ${o+1} of ${r}`},_e.indexAtPosition=function(e,n,t){return t<=1||!(n>0)?0:b(Math.max(0,Math.min(n,e))/n*(t-1),t)};var e=_r(_d[0]),n=_r(_d[1]);const t='/api/derivatives/oi-by-strike/session',r=[1,2,4],o=1e3,i='Replay not available on this server',s='The session readings could not be read',l='No readings captured for this session yet',u='Loading the session readings',a='Scale fixed for replay',c='Auto-play is off because reduced motion is on. Use the slider or the step buttons.',f=e=>'number'==typeof e&&Number.isFinite(e)?e:null;const p=e=>f(e);function d(e){if(!e||'object'!=typeof e)return null;const n=e,{readings:t,strikes:r,call_oi:o,put_oi:i,prev_close_call:s,prev_close_put:l}=n;if(!(Array.isArray(t)&&Array.isArray(r)&&Array.isArray(o)&&Array.isArray(i)&&Array.isArray(s)&&Array.isArray(l)))return null;if(!r.every(e=>null!=f(e)))return null;for(let e=1;e<r.length;e++)if(r[e]<=r[e-1])return null;const u=r.length,a=t.length;if(o.length!==a||i.length!==a||s.length!==u||l.length!==u)return null;const c=[];for(const e of t){if(!e||'object'!=typeof e)return null;const{at:n,spot:t,on_grid:r}=e;if('string'!=typeof n||!n||'boolean'!=typeof r)return null;if(null!==t&&'number'!=typeof t)return null;c.push({at:n,spot:f(t),on_grid:r})}const d=e=>{const n=[];for(const t of e){if(!Array.isArray(t)||t.length!==u)return null;n.push(t.map(p))}return n},y=d(o),_=d(i);if(!y||!_)return null;const h={readings:c,strikes:r,call_oi:y,put_oi:_,prev_close_call:s.map(p),prev_close_put:l.map(p)};return'string'==typeof n.underlying&&(h.underlying=n.underlying),'string'==typeof n.expiry&&(h.expiry=n.expiry),'string'!=typeof n.session&&null!==n.session||(h.session=n.session),h}function y(e){const n=e?.status;return 404===n?{state:'unavailable',message:i}:{state:'error',message:s}}function _(e){const n=d(e);return n?{state:'ready',session:n}:{state:'error',message:s}}const h=(e,n)=>null==e||null==n?null:e-n;function b(e,n){return n<=0?0:Number.isFinite(e)?Math.max(0,Math.min(n-1,Math.round(e))):n-1}},932,[926,197]); 1026__d(function(g,_r,_i,_a,m,_e,d){"use strict";
1026Object.defineProperty(_e,'__esModule',{value:!0}),_e.initReplay=i,_e.replayReducer=u,_e.nextDelay=a,_e.useReducedMotion=r,_e.useReplay=function(e){const t=e?.readings.length||0,c=r(),[o,l]=(0,n.useReducer)(u,t,i);(0,n.useEffect)(()=>{l({type:'session',count:t})},[t]),(0,n.useEffect)(()=>{c&&l({type:'reduce',on:!0})},[c]);const p=a(o,c);(0,n.useEffect)(()=>{if(null==p)return;const e=setTimeout(()=>l({type:'tick'}),p);return()=>clearTimeout(e)},[p,o.index]);const y=(0,n.useMemo)(()=>(0,s.replayFrame)(e,o.index),[e,o.index]),x=(0,n.useMemo)(()=>{const e=e=>l({type:'set',index:e});return{setIndex:e,setValue:e,setSpeed:e=>l({type:'speed',speed:e}),goLatest:()=>l({type:'latest'})}},[]),f=(0,n.useMemo)(()=>e=>l({type:'play',on:e,reduce:c}),[c]);return{value:o.index,index:o.index,playing:o.playing,speed:o.speed,frame:y,atLatest:0===t||o.index>=t-1,reduceMotion:c,setPlaying:f,...x}},_e.useOiSession=function(e){const[t,i]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(!e)return void i(null);const n=new AbortController;let t=!0;return i({state:'loading',message:s.REPLAY_LOADING}),(0,s.fetchOiSession)(e,n.signal).then(e=>{t&&i(e)}),()=>{t=!1,n.abort()}},[e]),t};var e,n=_r(d[0]),t=_r(d[1]);(e=t)&&e.__esModule;_r(d[2]);var s=_r(d[3]);function i(e){return{index:Math.max(0,e-1),count:Math.max(0,e),playing:!1,speed:1}}function u(e,n){const t=e.count-1;switch(n.type){case'session':{const t=Math.max(0,0|n.count);if(t===e.count)return e;const i=0===e.count||e.index>=e.count-1?Math.max(0,t-1):(0,s.clampIndex)(e.index,t);return{...e,count:t,index:i,playing:e.playing&&t>1&&i<t-1}}case'set':{const t=(0,s.clampIndex)(n.index,e.count);return t!==e.index||e.playing?{...e,index:t,playing:!1}:e}case'play':return!n.on||n.reduce||e.count<2?e.playing?{...e,playing:!1}:e:{...e,playing:!0,index:e.index>=t?0:e.index};case'tick':{if(!e.playing)return e;const n=Math.min(t,e.index+1);return{...e,index:n,playing:n<t}}case'speed':return s.REPLAY_SPEEDS.includes(n.speed)&&n.speed!==e.speed?{...e,speed:n.speed}:e;case'latest':return{...e,index:Math.max(0,t),playing:!1};case'reduce':return n.on&&e.playing?{...e,playing:!1}:e}return e}function a(e,n){return!e.playing||n||e.count<2||e.index>=e.count-1?null:s.REPLAY_STEP_MS/e.speed}function r(){const[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{{const e=globalThis.matchMedia?.('(prefers-reduced-motion: reduce)');if(!e)return;t(!!e.matches);const n=e=>t(!!e.matches);return e.addEventListener?.('change',n),()=>e.removeEventListener?.('change',n)}},[]),e}},933,[11,265,136,932]); 1027__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"OI_SIDE_COLOR",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"MAX_PAIN_COLOR",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"SPOT_COLOR",{enumerable:!0,get:function(){return O}});var t=r(d[0]);const n={call:t.C.red,put:t.C.green},u=t.C.amber,O=t.C.mint},934,[821]); 1028__d(function(g,_r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTH_COLOR",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"HELD_OPACITY",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"HATCH_ID",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"UNWOUND_STROKE_V4",{enumerable:!0,get:function(){return y}}),_e.OiHatchDefs=f,Object.defineProperty(_e,"ADDED_OPACITY",{enumerable:!0,get:function(){return O}}),_e.bothBeats=j,_e.partRect=m,_e.OiBothBar=function({side:e,seg:t,scale:i,orientation:h,thickness:f,origin:p={x:0,y:0},label:w="none",t:_,pulse:k,mark:I}){const b=(0,o.segmentLayout)(t,i);if(!(b&&f>0))return null;const T=s[e],R=t=>m(h,e,p,f,t),N=y,M='none'===w?null:(0,o.unwoundLabel)(t)??('change'===w?(0,o.addedLabel)(t):null),D=R(b.unwound),F=b.end+3,L='across'===h?{x:p.x,y:p.y-F,anchor:'middle'}:'call'===e?{x:p.x-F,y:p.y+r.OI_MIN_FONT/2-1,anchor:'end'}:{x:p.x+F,y:p.y+r.OI_MIN_FONT/2-1,anchor:'start'};if(null!=_&&_<1){const t=j(_),i=(e,n)=>({start:e.start*t.held,length:e.length*n}),l=k&&t.ring>0&&t.ring<1?R('added'===k?b.added:b.unwound):null,r=8*t.ring;return(0,c.jsxs)(n.G,{children:[b.held.length>0&&(0,c.jsx)(n.Rect,{...R(i(b.held,t.held)),fill:T,fillOpacity:u}),b.unwound.length>0&&0===t.out&&(0,c.jsx)(n.Rect,{...R(i(b.unwound,t.held)),fill:T,fillOpacity:u}),b.unwound.length>0&&t.out>0&&(0,c.jsxs)(n.G,{children:[(0,c.jsx)(n.Rect,{x:D.x+.75,y:D.y+.75,width:Math.max(D.width-N,0),height:Math.max(D.height-N,0),fill:`url(#${x[e]})`,stroke:T,strokeWidth:N,opacity:t.drain}),(0,c.jsx)(n.Rect,{...D,fill:T,fillOpacity:.85*(1-t.drain)})]}),b.added.length>0&&t.out>0&&(0,c.jsx)(n.Rect,{...R(i(b.added,t.out)),fill:T,fillOpacity:O}),l&&(0,c.jsx)(n.Rect,{x:l.x-r,y:l.y-r,width:l.width+2*r,height:l.height+2*r,rx:3,fill:"none",stroke:T,strokeWidth:1.5,opacity:1-t.ring})]})}return(0,c.jsxs)(n.G,{children:[b.held.length>0&&(0,c.jsx)(n.Rect,{...R(b.held),fill:T,fillOpacity:u}),b.added.length>0&&(0,c.jsx)(n.Rect,{...R(b.added),fill:T,fillOpacity:O}),b.unwound.length>0&&(0,c.jsx)(n.Rect,{x:D.x+.75,y:D.y+.75,width:Math.max(D.width-N,0),height:Math.max(D.height-N,0),fill:`url(#${x[e]})`,stroke:T,strokeWidth:N}),I&&b[I].length>0&&(()=>{const e=R(b[I]);return(0,c.jsx)(n.Rect,{x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,rx:2,fill:"none",stroke:l.C.ink,strokeWidth:1.25})}
1028)(),!!M&&(0,c.jsx)(n.Text,{x:L.x,y:L.y,textAnchor:L.anchor,fontFamily:r.OI_FONT,fontSize:r.OI_MIN_FONT,fill:T,children:M})]})},_e.OiBothLegend=function({baseline:e="prev_close",sides:h=['call','put'],compact:p=!1,since:w=!0}){const j=`since ${(0,o.baselineWords)(e)}`,m=p?[{key:'held',text:'Held'},{key:'added',text:'Added'},{key:'unwound',text:w?'Unwound (hatched)':'Unwound'}]:[{key:'held',text:`Held ${j}`},{key:'added',text:`Added ${j}`},{key:'unwound',text:`Unwound ${j} (hatched)`}],_=p?10:12;return(0,c.jsxs)(t.default,{accessibilityLabel:`Legend: ${m.map(e=>e.text).join('; ')}${p?`, ${j}`:''}`,style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',columnGap:p?8:14,rowGap:6},children:[m.map(e=>(0,c.jsxs)(t.default,{style:{flexDirection:'row',alignItems:'center',gap:p?4:6},children:[(0,c.jsxs)(i.default,{width:h.length*(_+3),height:10,"aria-hidden":!0,children:[(0,c.jsx)(f,{}),h.map((t,i)=>{const l=i*(_+3),r=s[t];return'unwound'===e.key?(0,c.jsx)(n.Rect,{x:l+.75,y:.75,width:_-y,height:8.5,fill:`url(#${x[t]})`,stroke:r,strokeWidth:y},t):(0,c.jsx)(n.Rect,{x:l,y:0,width:_,height:10,fill:r,fillOpacity:'held'===e.key?u:O},t)})]}),(0,c.jsx)(l.T,{style:{fontFamily:r.OI_FONT,fontSize:r.OI_MIN_FONT,lineHeight:16,color:l.C.muted},children:e.text})]},e.key)),p&&w&&(0,c.jsx)(l.T,{style:{fontFamily:r.OI_FONT,fontSize:r.OI_MIN_FONT,lineHeight:16,color:l.C.muted},children:j})]})},_r(d[0]);var t=e(_r(d[1])),n=_r(d[2]),i=e(n),l=_r(d[3]),r=_r(d[4]),h=_r(d[5]),o=_r(d[6]),c=_r(d[7]);const s=h.OI_SIDE_COLOR,u=.28,x={call:'oi-hatch-call',put:'oi-hatch-put'},y=1.5;function f(){return(0,c.jsx)(n.Defs,{children:['call','put'].map(e=>(0,c.jsx)(n.Pattern,{id:x[e],patternUnits:"userSpaceOnUse",width:5,height:5,patternTransform:"rotate(45)",children:(0,c.jsx)(n.Line,{x1:0,y1:0,x2:0,y2:5,stroke:s[e],strokeWidth:2})},e))})}const O=1,p=e=>Math.max(0,Math.min(1,e)),w=e=>1-Math.pow(1-p(e),3);function j(e){return{held:w(e/.28),out:w((e-.28)/.37),drain:p((e-.32)/.33),ring:p((e-.62)/.38)}}function m(e,t,n,i,l){const{start:r,length:h}=l,o=i/2;return'across'===e?{x:n.x-o,y:n.y-r-h,width:i,height:h}:'call'===t?{x:n.x-r-h,y:n.y-o,width:h,height:i}:{x:n.x+r,y:n.y-o,width:h,height:i}}},935,[11,13,840,821,936,934,930,6]); 1029__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"OI_FONT",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"OI_MIN_FONT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"OI_LABEL_FONT",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"OI_MIN_BAR",{enumerable:!0,get:function(){return c}});const t='Inter',n=11,u=12,c=6},936,[]); 1030__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.MaxPainMarker=function({strike:x,scale:o,orientation:_,visible:y}){if(!y)return null;const k=(0,l.maxPainPlacement)(x,o,_);if(!k)return null;const u=(0,l.maxPainA11y)((0,n.strike)(x));return(0,c.jsxs)(t.G,{accessibilityLabel:u,'aria-label':u,children:[k.tick&&(0,c.jsx)(t.Line,{x1:k.tick.x1,y1:k.tick.y1,x2:k.tick.x2,y2:k.tick.y2,stroke:i.MAX_PAIN_COLOR,strokeWidth:1,strokeDasharray:"2,2"}),k.triangles.map((n,s)=>(0,c.jsx)(t.Polygon,{points:n,fill:i.MAX_PAIN_COLOR},s)),Number.isFinite(k.text.y)&&(0,c.jsx)(t.Text,{x:k.text.x,y:k.text.y,textAnchor:k.text.anchor,fill:i.MAX_PAIN_COLOR,fontFamily:s.OI_FONT,fontSize:s.OI_MIN_FONT,children:l.MAX_PAIN_LABEL})]})},r(d[0]);
1030var t=r(d[1]),i=r(d[2]),n=r(d[3]),s=r(d[4]),l=r(d[5]),c=r(d[6])},937,[11,840,934,926,936,938,6]); 1031__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PAIN_LABEL",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MAX_PAIN_MISSING",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"MAX_PAIN_OFF_AXIS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"MAX_PAIN_BAND",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"MAX_PAIN_TEXT_WIDTH",{enumerable:!0,get:function(){return x}}),e.maxPainStrike=function(n){return c(n?.max_pain_strike)},e.maxPainReason=function(n,t){return null==c(n)?a:t&&null!=t.pos(n)?null:o},e.maxPainPlacement=function(t,a,o){const u=c(t);if(null==u||!a)return null;const _=a.pos(u);if(null==_||!Number.isFinite(_))return null;const{plot:y,labels:f}=a;if('across'===o){const t=y.y+y.h,o=f.length?Math.max(...f.map(n=>n.box.y+n.box.h)):Math.max(t,a.axis),u=Math.max(o,t)+s,x=_,c=`${x},${u} ${x-l},${u+l} ${x+l},${u+l}`,b=24,M=h(x,b,a.width-b),$=f.length?Math.min(...f.map(n=>n.box.y)):u;return{triangles:[c],tick:!f.some(n=>x>=n.box.x-1&&x<=n.box.x+n.box.w+1)&&$-1>t+1?{x1:x,y1:t+1,x2:x,y2:$-1}:null,text:{x:M,y:u+l+n.OI_MIN_FONT,anchor:'middle'},at:_}}const M=f.length?Math.min(...f.map(n=>n.box.x)):a.axis-24,$=f.length?Math.max(...f.map(n=>n.box.x+n.box.w)):a.axis+24,p=_,N=M-s,P=$+s,I=[`${N-l},${p-l} ${N},${p} ${N-l},${p+l}`,`${P+l},${p-l} ${P},${p} ${P+l},${p+l}`],A=n.OI_MIN_FONT+2,O=y.y+A/2,w=y.y+y.h-A/2,F=[p,p+A+1,p-A-1].find(n=>n>=O&&n<=w&&!f.some(t=>b({x:a.axis-24,y:n-A/2,w:x,h:A},t.box))),X=null==F?{x:a.axis,y:NaN,anchor:'middle'}:{x:a.axis,y:F+n.OI_MIN_FONT/2-1,anchor:'middle'};return{triangles:I,tick:null,text:X,at:_}},e.maxPainA11y=function(n){return`${t} ${n}`};var n=r(d[0]);const t='Max pain',a='Max pain not sent for this reading',o='Max pain lies outside the strikes shown',u=20,x=48,l=5,s=2,c=n=>'number'==typeof n&&Number.isFinite(n)?n:null;const b=(n,t)=>n.x<t.x+t.w&&t.x<n.x+n.w&&n.y<t.y+t.h&&t.y<n.y+n.h,h=(n,t,a)=>a<t?(t+a)/2:Math.min(a,Math.max(t,n))},938,[936]); 1032__d(function(g,r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CARD_WORDS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"PINNED_HINT",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"MISSING_NOTE",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"ZERO_BASE_NOTE",{enumerable:!0,get:function(){return y}}),_e.atmText=O,_e.changePct=C,_e.signedCompact=I,_e.putMinusCall=x,_e.cardModel=w,_e.cardSummary=T,Object.defineProperty(_e,"CARD_WIDTH",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"CARD_HEIGHT",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"CARD_GAP",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"CARD_MARGIN",{enumerable:!0,get:function(){return S}}),_e.placeCard=k,_e.OiDetailCard=function({row:e,atmOffset:c,pinned:h,onClose:b,anchor:y,orientation:_,bounds:O,inline:C=!1}){const[I,x]=(0,t.useState)(null),[N,S]=(0,t.useState)({width:M,height:j}),F=O??I,H=w(e,c),P=C?{left:0,top:0,width:0,side:'below'}:F?k(y,N,F,_):null,R=T(e,c),A=h||C,D=n.default;return(0,f.jsxs)(D,{pointerEvents:"box-none",style:C?{width:'100%'}:l.default.absoluteFill,onLayout:e=>{const{width:t,height:n}=e.nativeEvent.layout;x(e=>e&&Math.abs(e.width-t)<1&&Math.abs(e.height-n)<1?e:{width:t,height:n})},children:[(0,f.jsx)(s.T,{style:$,"aria-live":"polite","aria-atomic":!0,accessibilityLiveRegion:"polite",children:R}),P&&(0,f.jsxs)(n.default,{role:"group","aria-label":`${p.group}, ${p.strike.toLowerCase()} ${H.strike}`,pointerEvents:h||C?'auto':'none',onLayout:e=>{const{height:t}=e.nativeEvent.layout;S(e=>Math.abs(e.height-t)<1?e:{width:M,height:t})},style:{...C?{position:'relative',width:'100%',borderTopWidth:2,borderTopColor:s.C.mint}:{position:'absolute',left:P.left,top:P.top,width:P.width},backgroundColor:s.C.dark,borderWidth:1,borderColor:h?s.C.muted:s.C.line,borderRadius:10,paddingHorizontal:10,paddingVertical:C?10:7,gap:5,shadowColor:s.C.bg,shadowOpacity:.6,shadowRadius:12,shadowOffset:{width:0,height:4},elevation:6},children:[(0,f.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:8,minHeight:A?44:void 0},children:[(0,f.jsxs)(n.default,{"aria-hidden":!0,importantForAccessibility:"no-hide-descendants",style:{flex:1,flexDirection:'row',alignItems:'baseline',flexWrap:'wrap',gap:8},children:[(0,f.jsxs)(s.T,{style:[v,{fontFamily:'InterSemi',fontSize:13,lineHeight:18,color:s.C.ink}],children:[p.strike," ",H.strike]}),H.atm&&(0,f.jsx)(s.T,{style:[v,{fontFamily:'InterMedium',fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.amber}],children:H.atm})]}),A&&(0,f.jsx)(o.default,{role:"button",accessibilityRole:"button",accessibilityLabel:p.close,onPress:b,hitSlop:4,style:({pressed:e})=>({minWidth:44,minHeight:44,marginRight:-10,alignItems:'center',justifyContent:'center',borderRadius:10,opacity:e?.6:1}),children:(0,f.jsx)(s.Icon,{name:"x",size:18,color:s.C.muted})})]}),(0,f.jsxs)(n.default,{"aria-hidden":!0,importantForAccessibility:"no-hide-descendants",style:{gap:4},children:[H.sides.map(e=>(0,f.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,f.jsx)(n.default,{style:{width:8,height:8,borderRadius:2,backgroundColor:e.color}}),(0,f.jsxs)(s.T,{style:{fontFamily:'InterSemi',fontSize:u.OI_MIN_FONT,lineHeight:16,color:e.color,minWidth:44},children:[e.label," ",p.oi]}),(0,f.jsx)(s.T,{style:[v,{fontFamily:'InterSemi',fontSize:u.OI_LABEL_FONT,lineHeight:16,color:s.C.ink}],children:e.oi}),(0,f.jsx)(n.default,{style:{flex:1}}),(0,f.jsx)(s.T,{style:[v,{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.ink}],children:e.chg}),(0,f.jsx)(s.T,{style:[v,{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.muted}],children:e.pct})]},e.key)),(0,f.jsx)(n.default,{style:{height:1,backgroundColor:s.C.line}}),(0,f.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap'},children:[(0,f.jsx)(s.T,{style:{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.muted},children:p.putMinusCall}),(0,f.jsx)(s.T,{style:[v,{fontFamily:'InterSemi',fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.ink}],children:H.diffOi}),(0,f.jsx)(n.default,{style:{flex:1}}),(0,f.jsxs)(s.T,{style:[v,{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.muted}],children:[p.putMinusCallChange," ",H.diffChg]})]}),H.notes.map(e=>(0,f.jsx)(s.T,{style:{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:15,color:s.C.muted},children:e},e)),h&&(0,f.jsx)(s.T,{style:{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:15,color:s.C.muted},children:m})]})]})]})},_e.StrikeAnnouncer=function({row:e,atmOffset:t}){return(0,f.jsx)(s.T,{style:$,"aria-live":"polite","aria-atomic":!0,accessibilityLiveRegion:"polite",children:e?T(e,t):''})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]),f=r(d[8]);const p={strike:'Strike',atm:'ATM',call:'Call',put:'Put',oi:'OI',change:'Change',changePct:'Change %',putMinusCall:'Puts minus calls',putMinusCallChange:'change',putMinusCallSpoken:'Put OI minus call OI',putMinusCallChangeSpoken:'Put change minus call change',close:'Close strike details',group:'Strike details'}
1032,m='Tap this strike again, or press Esc, to close. Press and hold to move across strikes.',b='A dash means that number was not captured at this reading.',y='Change % is a dash where the baseline open interest was zero.',_=e=>'number'==typeof e&&Number.isFinite(e);function O(e){if(!_(e))return null;const t=Math.round(e);return 0===t?p.atm:`${p.atm}${t>0?'+':c.MINUS}${Math.abs(t)}`}function C(e,t){return _(e)&&_(t)&&0!==t?e/t*100:null}function I(e){return _(e)?(e>0?'+':'')+(0,c.compact)(e):c.DASH}function x(e,t){return _(e)&&_(t)?e-t:null}function w(e,t){const n=t=>{const n='call'===t?e.ce_oi:e.pe_oi,o='call'===t?e.ce_chg:e.pe_chg,l='call'===t?e.ce_base:e.pe_base;return{key:t,label:'call'===t?p.call:p.put,oi:(0,c.compact)(n),chg:I(o),pct:(0,c.signed)(C(o,l)),color:h.OI_SIDE_COLOR[t]}},o=[n('call'),n('put')],l=I(x(e.pe_oi,e.ce_oi)),s=I(x(e.pe_chg,e.ce_chg)),u=[[e.ce_chg,e.ce_base],[e.pe_chg,e.pe_base]].some(([e,t])=>_(e)&&0===t),f=[...[e.ce_oi,e.pe_oi,e.ce_chg,e.pe_chg].some(e=>!_(e))||[[e.ce_chg,e.ce_base],[e.pe_chg,e.pe_base]].some(([e,t])=>_(e)&&!_(t))?[b]:[],...u?[y]:[]];return{strike:(0,c.strike)(e.strike),atm:O(t),sides:o,diffOi:l,diffChg:s,notes:f}}function T(e,t){const n=w(e,t),o=e=>`${e.label} ${p.oi} ${e.oi}, ${p.change.toLowerCase()} ${e.chg} (${e.pct}).`;return`${p.strike} ${n.strike}${n.atm?`, ${n.atm}`:''}. ${o(n.sides[0])} ${o(n.sides[1])} ${p.putMinusCallSpoken} ${n.diffOi}. ${p.putMinusCallChangeSpoken} ${n.diffChg}.`}const M=208,j=128,N=10,S=8,F=(e,t,n)=>n<t?t:Math.max(t,Math.min(n,e));function k(e,t,n,o,l=N,s=S){const c=_(n.width)?Math.max(0,n.width):0,h=_(n.height)?Math.max(0,n.height):0,u=Math.max(0,Math.min(_(t.width)?t.width:M,c-2*s)),f=_(t.height)?t.height:j,p=_(e.x)?F(e.x,0,c):c/2,m=_(e.y)?F(e.y,0,h):h/2,b=e=>F(e,s,c-u-s),y=e=>F(e,s,h-f-s),O=()=>{const e=p+l,t=p-l-u,n=e+u<=c-s,o=t>=s;return!(p<=c/2)&&o||!n?o?{left:t,top:y(m-f/2),width:u,side:'left'}:null:{left:e,top:y(m-f/2),width:u,side:'right'}},C=()=>{const e=m+l,t=m-l-f,n=e+f<=h-s,o=t>=s;return!(m<=h/2)&&o||!n?o?{left:b(p-u/2),top:t,width:u,side:'above'}:null:{left:b(p-u/2),top:e,width:u,side:'below'}},I='across'===o?O()??C():C()??O();return I||{left:b(p<=c/2?p+l:p-l-u),top:y(m<=h/2?m+l:m-l-f),width:u,side:'across'===o?p<=c/2?'right':'left':m<=h/2?'below':'above'}}const $={position:'absolute',width:1,height:1,overflow:'hidden',opacity:0},v={fontVariant:['tabular-nums']}},939,[11,13,375,26,821,926,934,936,6]); 1033__d(function(_g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CURSOR_IDLE",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"TAP_SLOP",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"LONG_PRESS_MS",{enumerable:!0,get:function(){return r}}),_e.pressDecision=i,_e.blocksScroll=u,_e.clampIndex=o,_e.startIndex=a,_e.keyAction=s,_e.cursorReducer=d,_e.atmOffsetOf=function(e,n){return c(e)&&c(n)?Math.round(e)-Math.round(n):null},_e.useStrikeCursor=function(t,l,p){const[f,v]=(0,e.useState)(n),y=t.length,x=(0,e.useRef)({count:y,start:null});x.current={count:y,start:a(y,p.startIndex)};const g=(0,e.useRef)(p);g.current=p;const h=(0,e.useCallback)(e=>v(n=>d(n,e,x.current)),[]),b=(0,e.useCallback)(()=>h({type:'close'}),[h]),I=o(f.activeIndex,y),R=null!=I?t[I]?.strike??null:null,w=(0,e.useRef)(null);(0,e.useEffect)(()=>{const e=w.current;if(null==e)return;const n=t.findIndex(n=>n.strike===e);h({type:'sync',index:n>=0?n:null})},[t,h]),(0,e.useEffect)(()=>{w.current!==R&&(w.current=R,g.current.onActive?.(R))},[R]);const E=(0,e.useRef)(null),M=(0,e.useRef)(f);M.current={...f,activeIndex:I};const A=(0,e.useRef)(l);A.current=l;const S=(e,n)=>({touch:e.touch,orientation:A.current,dx:n.x-e.px0,dy:n.y-e.py0,heldMs:Date.now()-e.t0,onPinned:e.onPinned}),P=(0,e.useRef)(null),T=(0,e.useCallback)(e=>{const n=E.current;if(n&&P.current&&'function'==typeof n.removeEventListener&&n.removeEventListener('touchmove',P.current),E.current=e,P.current=null,!e||'function'!=typeof e.addEventListener)return;e.style&&(e.style.touchAction='pan-y',e.style.userSelect='none',e.style.webkitUserSelect='none',e.style.webkitTouchCallout='none');const t=e=>{const n=O.current,t=e?.touches?.[0];n&&t&&e.cancelable&&u(S(n,{x:t.pageX,y:t.pageY}),n.decided)&&e.preventDefault()};P.current=t,e.addEventListener('touchmove',t,{passive:!1})},[]),k=(0,e.useRef)({w:0,h:0}),O=(0,e.useRef)(null),L=(0,e.useRef)('mouse'),D=(0,e.useRef)(0),C=(0,e.useRef)(null);(0,e.useEffect)(()=>()=>{D.current&&'undefined'!=typeof cancelAnimationFrame&&cancelAnimationFrame(D.current),O.current?.timer&&clearTimeout(O.current.timer)},[]);const _=(0,e.useMemo)(()=>{const e=(e,n)=>{const t=e?.nativeEvent||e;if(!t)return null;const r=t.touches?.[0]||t.changedTouches?.[0]||t;{const e=E.current;if(!e||'function'!=typeof e.getBoundingClientRect||!c(r.clientX)||!c(r.clientY))return null;const n=e.getBoundingClientRect(),t=n.width>0&&k.current.w>0?k.current.w/n.width:1,i=n.height>0&&k.current.h>0?k.current.h/n.height:1;return{x:(r.clientX-n.left)*t,y:(r.clientY-n.top)*i}}},n=e=>e?o(g.current.indexAt(e.x,e.y),x.current.count):null,t=e=>{const n=e?.nativeEvent||e||{},t=n.touches?.[0]||n.changedTouches?.[0]||n;return{x:c(t.pageX)?t.pageX:0,y:c(t.pageY)?t.pageY:0}},u=e=>{e?.timer&&clearTimeout(e.timer)},a={ref:T,onLayout:e=>{const n=e?.nativeEvent?.layout;n&&(k.current={w:n.width,h:n.height})},onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>'scrub'===O.current?.decided,onResponderGrant:c=>{u(O.current);const i='touch'===L.current,o=t(c),a={x0:0,y0:0,originX:0,originY:0,touch:i,px0:o.x,py0:o.y,t0:Date.now(),onPinned:!1,decided:'wait',timer:null},s=e(c);if(!s)return void(O.current=null);const d=n(s),l={...a,x0:s.x,y0:s.y,onPinned:M.current.pinned&&null!=d&&M.current.activeIndex===d};O.current=l,i&&(l.timer=setTimeout(()=>{O.current===l&&'wait'===l.decided&&(l.decided='scrub',h({type:'dragStart',index:n({x:l.x0,y:l.y0})}))},r))},onResponderMove:r=>{const c=O.current;if(!c||'release'===c.decided)return;const o=e(r);if(o){if('wait'===c.decided){const e=i(S(c,t(r)));if('wait'===e)return;return u(c),c.decided=e,void('scrub'===e&&h({type:'dragStart',index:n(o)}))}h({type:'dragMove',index:n(o)})}},onResponderRelease:()=>{const e=O.current;O.current=null,e&&(u(e),'scrub'===e.decided?h({type:'dragEnd'}):'wait'===e.decided&&h({type:'tap',index:n({x:e.x0,y:e.y0}),touch:e.touch}))},onResponderTerminationRequest:()=>'scrub'!==O.current?.decided,onResponderTerminate:()=>{const e=O.current;O.current=null,u(e),'scrub'===e?.decided&&h({type:'dragEnd'})},accessible:!0,accessibilityRole:'adjustable',accessibilityActions:[{name:'increment'},{name:'decrement'},{name:'escape'}],onAccessibilityAction:e=>{const n=e?.nativeEvent?.actionName;'increment'===n?h({type:'step',by:'next'}):'decrement'===n?h({type:'step',by:'prev'}):'escape'===n&&h({type:'close'})},onAccessibilityEscape:()=>h({type:'close'})};return Object.assign(a,{focusable:!0,'aria-orientation':'across'===l?'horizontal':'vertical',onKeyDown:e=>{const n=s(e?.nativeEvent?.key??e?.key,l);
1033n&&(e?.preventDefault?.(),h('close'===n?{type:'close'}:{type:'step',by:n}))},onPointerDown:e=>{L.current=(e?.nativeEvent||e)?.pointerType||'mouse'},onPointerMove:t=>{const r=t?.nativeEvent||t;L.current=r?.pointerType||'mouse','touch'===L.current||O.current||(C.current=e(t),D.current||'undefined'==typeof requestAnimationFrame||(D.current=requestAnimationFrame(()=>{D.current=0,h({type:'hover',index:n(C.current)})})))},onPointerLeave:e=>{'touch'!==((e?.nativeEvent||e)?.pointerType||'mouse')&&(D.current&&'undefined'!=typeof cancelAnimationFrame&&(cancelAnimationFrame(D.current),D.current=0),h({type:'leave'}))}}),a},[h,l,T]),j=null!=I&&t[I]?p.valueText?p.valueText(t[I],I):String(t[I].strike):void 0,F=(0,e.useMemo)(()=>({..._,accessibilityValue:y>0?{min:0,max:y-1,...null!=I?{now:I}:{},...j?{text:j}:{}}:void 0}),[_,y,I,j]);return{activeIndex:I,pinned:f.pinned&&null!=I,handlers:F,clear:b}};var e=_r(_d[0]);_r(_d[1]);const n=Object.freeze({activeIndex:null,pinned:!1,dragging:!1}),t=8,r=300,c=e=>'number'==typeof e&&Number.isFinite(e);function i(e){const n=c(e.dx)?e.dx:0,i=c(e.dy)?e.dy:0,u=c(e.heldMs)?e.heldMs:0,o=Math.hypot(n,i)>=t;return e.touch?o?u>=r||e.onPinned||'across'===e.orientation&&Math.abs(n)>Math.abs(i)?'scrub':'release':u>=r?'scrub':'wait':o?'scrub':'wait'}function u(e,n){return!(!e.touch||'release'===n)&&('scrub'===n||'scrub'===i(e))}function o(e,n){return!c(e)||!c(n)||n<1?null:Math.max(0,Math.min(Math.floor(n)-1,Math.round(e)))}function a(e,n){return o(c(n)?n:(e-1)/2,e)}function s(e,n){if('Escape'===e||'Esc'===e)return'close';if('Home'===e)return'first';if('End'===e)return'last';if('across'===n){if('ArrowLeft'===e)return'prev';if('ArrowRight'===e)return'next'}else{if('ArrowUp'===e)return'prev';if('ArrowDown'===e)return'next'}return null}function d(e,t,r){const{count:c}=r;if(c<1)return n;switch(t.type){case'hover':{if(e.pinned||e.dragging)return e;const n=o(t.index,c);return n===e.activeIndex?e:{activeIndex:n,pinned:!1,dragging:!1}}case'leave':return e.pinned||e.dragging||null==e.activeIndex?e:n;case'tap':{const r=o(t.index,c);return null==r?e:e.pinned&&e.activeIndex===r?t.touch?n:{activeIndex:r,pinned:!1,dragging:!1}:{activeIndex:r,pinned:!0,dragging:!1}}case'dragStart':return{activeIndex:o(t.index,c)??e.activeIndex,pinned:e.pinned,dragging:!0};case'dragMove':{if(!e.dragging)return e;const n=o(t.index,c);return null==n||n===e.activeIndex?e:{...e,activeIndex:n}}case'dragEnd':return e.dragging?null==e.activeIndex?n:{activeIndex:e.activeIndex,pinned:!0,dragging:!1}:e;case'step':{const n=o(e.activeIndex,c);let i;return i='first'===t.by?0:'last'===t.by?c-1:null==n?a(c,r.start):o(n+('next'===t.by?1:-1),c),{activeIndex:i,pinned:!0,dragging:!1}}case'close':return null!=e.activeIndex||e.pinned||e.dragging?n:e;case'sync':{if(null==e.activeIndex)return e;const n=null!=t.index?o(t.index,c):o(e.activeIndex,c);return n===e.activeIndex?e:{...e,activeIndex:n}}}return e}},940,[11,136]); 1034__d(function(g,_r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CHANGE_WINDOWS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"DEFAULT_CHANGE_WINDOW",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"CHANGE_WINDOW_NOT_LOADED",{enumerable:!0,get:function(){return r}}),e.stampMs=u,e.baselineIndex=p,e.changeRows=_,e.elapsedText=v,e.changeWindowFooter=k,e.changeView=function(n,t,r){const l=p(n,t,r),o=_(n,t,l),i=k(n,t,r);return l.ok?{ok:!0,rows:o,baseline:l,footer:i}:{ok:!1,rows:o,reason:l.reason,footer:i}},e.changeWindowScaleMax=function(n,t){if(!n)return null;let r=null;for(let l=0;l<n.readings.length;l++)for(const o of _(n,l,p(n,l,t)))for(const n of[o.ce_chg,o.pe_chg])null!=n&&(null==r||Math.abs(n)>r)&&(r=Math.abs(n));return r};const n=[{value:'prev_close',label:'Since prev close',a11y:'Change since the previous close',minutes:null},{value:'open',label:'Since open',a11y:'Change since the first reading of the session',minutes:null},{value:'5m',label:'Last 5m',a11y:'Change over the last 5 minutes',minutes:5},{value:'15m',label:'Last 15m',a11y:'Change over the last 15 minutes',minutes:15}
1034,{value:'30m',label:'30m',a11y:'Change over the last 30 minutes',minutes:30},{value:'1h',label:'1h',a11y:'Change over the last hour',minutes:60}],t='prev_close',r='The session readings are not loaded, so only the change since the previous close can be shown',l='session not loaded',o='the reading time could not be read',i=n=>'number'==typeof n&&Number.isFinite(n)?n:null,a=n=>String(n).padStart(2,'0'),s=/(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})(?::(\d{2}))?/;function u(n){if('string'!=typeof n)return null;const t=s.exec(n);if(!t)return null;const[r,l,o,i,a,u]=t.slice(1).map(n=>null==n?0:Number(n));return l<1||l>12||o<1||o>31||i>23||a>59||u>59?null:Date.UTC(r,l-1,o,i,a,u)}const c=n=>{const t=new Date(n);return`${a(t.getUTCHours())}:${a(t.getUTCMinutes())}`},d=n=>{const t=u(n);return null==t?null:c(t)},h=(n,t)=>t<=0?0:Number.isFinite(n)?Math.max(0,Math.min(t-1,Math.round(n))):t-1,f=2,m=t=>n.find(n=>n.value===t)||n[0];function p(n,t,r){const i=m(r);if('prev_close'===i.value)return{ok:!0,index:null,at:null,time:null};if(!n||!n.readings.length)return{ok:!1,reason:l};const a=h(t,n.readings.length);if('open'===i.value){const t=n.readings[0];return{ok:!0,index:0,at:t.at,time:d(t.at)}}const s=u(n.readings[a].at);if(null==s)return{ok:!1,reason:o};const p=s-6e4*i.minutes;for(let t=a;t>=0;t--){const r=u(n.readings[t].at);if(null!=r&&r<=p){if(s-r>f*i.minutes*6e4)return{ok:!1,reason:`readings here are ${Math.round((s-r)/6e4)} min apart, so there is no reading ${i.minutes} min back`};return{ok:!0,index:t,at:n.readings[t].at,time:c(r)}}}return{ok:!1,reason:`no reading at ${c(p)}`}}const b=(n,t)=>null==n||null==t?null:n-t;function _(n,t,r){if(!n||!n.readings.length)return[];const l=h(t,n.readings.length);let o;o=null==r?null:'number'==typeof r?Number.isInteger(r)&&r>=0&&r<=l?r:void 0:r.ok?null==r.index?null:Number.isInteger(r.index)&&r.index>=0&&r.index<=l?r.index:void 0:void 0;const a=n.call_oi[l]||[],s=n.put_oi[l]||[],u=void 0===o?null:null===o?n.prev_close_call:n.call_oi[o]||[],c=void 0===o?null:null===o?n.prev_close_put:n.put_oi[o]||[];return n.strikes.map((n,t)=>{const r=i(a[t]),l=i(s[t]),o=u?i(u[t]):null,d=c?i(c[t]):null;return{strike:n,ce_oi:r,pe_oi:l,ce_chg:b(r,o),pe_chg:b(l,d),ce_base:o,pe_base:d}})}function v(n){const t=Math.max(0,Math.round(n));if(t<60)return`${t} min`;const r=Math.floor(t/60),l=t%60;return l?`${r} h ${l} min`:`${r} h`}function k(n,t,r){const l=p(n,t,r);if(!l.ok)return`No change shown: ${l.reason}`;if(null==l.index||!n)return'Change since previous close';const o=h(t,n.readings.length),i=u(n.readings[o].at),a=u(l.at),s=null!=i&&null!=a?` (${v((i-a)/6e4)})`:'';return`Change since ${l.time}${s}`}},941,[]); 1035__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"COMPACT_LABELS",{enumerable:!0,get:function(){return h}}),_e.ChangeWindowPicker=function({value:e,onChange:f,disabled:y=!1,reason:C,compact:p=!1,dense:v=!1,unavailable:x}){return v?(0,s.jsx)(t.default,{accessibilityRole:"radiogroup",accessibilityLabel:"Change measured from",'aria-disabled':y,title:y?C:'Change measured from',style:{flexDirection:'row',borderWidth:1,borderColor:l.C.line,borderRadius:n.CTRL.radius,overflow:'hidden',opacity:y?.42:1},children:o.CHANGE_WINDOWS.map((t,o)=>{const c=x?.[t.value],u=y||!!c,b=t.value===e&&!u;return(0,s.jsx)(i.default,{role:"radio","aria-checked":b,"aria-disabled":u,title:c||void 0,accessibilityState:{checked:b,disabled:u},accessibilityLabel:t.a11y,accessibilityHint:y?C:c,disabled:u,onPress:()=>{b||f(t.value)},style:e=>({minHeight:n.CTRL.h,paddingHorizontal:n.CTRL.padX,alignItems:'center',justifyContent:'center',borderLeftWidth:o?1:0,borderColor:l.C.line,backgroundColor:b?l.C.soft:e.hovered?l.C.dark:'transparent'}),children:(0,s.jsx)(l.T,{numberOfLines:1,style:{fontFamily:b?'InterSemi':'InterMedium',fontSize:n.CTRL.font,lineHeight:n.CTRL.lineHeight,color:b?l.C.green:u&&!y?l.C.muted:l.C.ink,opacity:u&&!y?.5:1},children:h[t.value]})},t.value)})}):p?(0,s.jsxs)(t.default,{style:{gap:4,width:'100%'},children:[(0,s.jsx)(t.default,{accessibilityRole:"radiogroup",accessibilityLabel:"Change measured from",'aria-disabled':y,style:{flexDirection:'row',flexWrap:'nowrap',borderWidth:1,borderColor:l.C.line,borderRadius:11,opacity:y?.42:1},children:o.CHANGE_WINDOWS.map((t,n)=>
1035{const p=t.value===e,v=n===o.CHANGE_WINDOWS.length-1;return(0,s.jsx)(i.default,{role:"radio","aria-checked":p,"aria-disabled":y,accessibilityState:{checked:p,disabled:y},accessibilityLabel:t.a11y,accessibilityHint:y?C:void 0,disabled:y,onPress:()=>{p||f(t.value)},style:({pressed:e})=>({flexGrow:'prev_close'===t.value?1.6:1,flexBasis:0,minHeight:c,minWidth:c,paddingHorizontal:4,alignItems:'center',justifyContent:'center',borderLeftWidth:n?1:0,borderColor:l.C.line,borderTopLeftRadius:n?0:10,borderBottomLeftRadius:n?0:10,borderTopRightRadius:v?10:0,borderBottomRightRadius:v?10:0,backgroundColor:p?l.C.soft:'transparent',opacity:e?.72:1}),children:(0,s.jsx)(l.T,{numberOfLines:1,style:{fontFamily:p?'InterMedium':u,fontSize:b,lineHeight:17,color:p?l.C.green:l.C.muted},children:h[t.value]})},t.value)})}),y&&!!C&&(0,s.jsx)(l.T,{accessibilityLiveRegion:"polite",style:{fontFamily:u,fontSize:b,lineHeight:17,color:l.C.muted},children:C})]}):(0,s.jsxs)(t.default,{style:{gap:4,maxWidth:'100%'},children:[(0,s.jsx)(t.default,{accessibilityRole:"radiogroup",accessibilityLabel:"Change measured from",'aria-disabled':y,style:{flexDirection:'row',flexWrap:'wrap',gap:6,opacity:y?.42:1},children:o.CHANGE_WINDOWS.map(t=>{const o=t.value===e;return(0,s.jsx)(i.default,{role:"radio","aria-checked":o,"aria-disabled":y,accessibilityState:{checked:o,disabled:y},accessibilityLabel:t.a11y,accessibilityHint:y?C:void 0,disabled:y,onPress:()=>{o||f(t.value)},style:({pressed:e})=>({minHeight:c,minWidth:c,paddingHorizontal:12,borderRadius:11,borderWidth:1,borderColor:o?l.C.green:l.C.line,backgroundColor:o?l.C.soft:l.C.paper,alignItems:'center',justifyContent:'center',opacity:e?.72:1}),children:(0,s.jsx)(l.T,{style:{fontFamily:o?'InterMedium':u,fontSize:b,lineHeight:17,color:o?l.C.green:l.C.muted},children:t.label})},t.value)})}),y&&!!C&&(0,s.jsx)(l.T,{accessibilityLiveRegion:"polite",style:{fontFamily:u,fontSize:b,lineHeight:17,color:l.C.muted},children:C})]})},r(d[0]);var i=e(r(d[1])),t=e(r(d[2])),l=r(d[3]),o=r(d[4]),n=r(d[5]),s=r(d[6]);const c=44,u='Inter',b=12,h={prev_close:'Prev close',open:'Open','5m':'5m','15m':'15m','30m':'30m','1h':'1h'}},942,[11,375,13,821,941,928,6]); 1036__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"READ_TILE_H",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"TILE_H",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"TILE_READING_TEXT",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"SCREENER_FLOOR_TEXT",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"SCREENER_IDLE_SUB",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"SCREENER_CLICK_TEXT",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"GRID_HIGHLIGHT_TEXT",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"GRID_GAP_TEXT",{enumerable:!0,get:function(){return E}}),_e.gridColumns=function(e){return e<420?2:e<660?3:5},_e.tileSeries=D,_e.premiumMove=z,_e.sharpFall=F,Object.defineProperty(_e,"GRID_VIEWS",{enumerable:!0,get:function(){return K}}),_e.gridSelection=V,_e.StrikePicker=q,_e.DeltaOiGrid=J,_e.OiGridSection=function({symbol:e,badge:t,linked:i,expiry:n,seq:l,read:r,rules:s,target:a,onTarget:d,onCustomize:u,stacked:c,height:b,hidden:k,onHide:w,expanded:_,onExpand:C,highlight:S,onHighlight:T}){const j=e=>!(k?.[e]||_&&_!==e),[v,I]=(0,o.useState)([]),L=(0,o.useCallback)(e=>I(t=>t.length===e.length&&t.every((t,i)=>t.text===e[i].text)?t:e),[]),R=r,H=R.data,E=[{heading:'delta-OI by strike',lines:j('oi_grid')?[H?.delta_oi_text||'\u0394OI is open interest added or removed since the previous close. Every line starts at 0 at the first reading of the day.',H?.atm_text||'ATM is the listed strike nearest spot in the front expiry. ATM+n is n strikes above spot, ATM\u2212n is n strikes below.',H?.direction_text||'',y.GRID_LEGEND_TEXT,H?.price_text||'The dashed line on each tile is that contract\'s own last traded price at the same readings, on its own scale.',O,H?.flow_text||'Every opened contract has a buyer and a seller. The
1036se two lines read which side was paying up at each reading \u2014 they do not say what happens next.',H?.block_text||'',(0,y.gridBasis)(H),("A reading with no snapshot is drawn as a gap on both lines; nothing here is interpolated. "+(0,y.gridSourceText)(H?.points_source)).trim(),M]:[]},{heading:'Futures chart',lines:j('oi_grid_futures')?v:[]}],$=e?{label:'At-the-money strike',value:(0,y.strike)(H?.atm_strike),against:(0,y.headlineAgainst)(null!=H?.spot?'nearest the captured spot '+(0,y.spotLevel)(H.spot,H?.underlying||e):'',H?.expiry?(0,y.expiryText)(H.expiry,H?.days_to_expiry??null):''),reason:H?.not_enough_marks||y.GRID_NOT_ENOUGH_MARKS}:{label:'At-the-money strike',value:y.DASH,reason:'Click any row on the screener above, or choose a symbol in Customize, to point this block at one.'};return(0,x.jsx)(p.Block,{title:"\u0394OI by strike, through the session",subtitle:"One symbol across the block: its front futures contract, and the ten strikes at the money.",asOf:(0,y.asOfText)(H?.as_of),badge:t,linked:i,headline:$,info:(0,x.jsx)(p.InfoDisclosure,{title:"\u0394OI by strike, through the session",groups:E}),actions:(0,x.jsx)(h.LinkText,{label:(0,y.customizeLabel)((s||[]).length),a11y:'Customize this block: '+(s||[]).length+' filters in force. Open the filter builder',onPress:u}),stacked:c,height:b,chart:t=>j('oi_grid_futures')?(0,x.jsx)(f.FuturesChartPanel,{underlying:e,seq:l,onInfo:L,onExpand:C?()=>C('oi_grid_futures'):void 0,expanded:'oi_grid_futures'===_,onClose:w?()=>w('oi_grid_futures'):void 0,style:t},"oi_grid_futures"):null,content:t=>j('oi_grid')?(0,x.jsx)(J,{underlying:e,read:R,target:a,onTarget:d,highlight:S,onHighlight:T,onExpand:C?()=>C('oi_grid'):void 0,expanded:'oi_grid'===_,onClose:w?()=>w('oi_grid'):void 0,style:t},"oi_grid"):null})};var t=_r(_d[0]),i=_r(_d[1]),n=_r(_d[2]),l=_r(_d[3]),o=_r(_d[4]),r=e(_r(_d[5])),s=e(_r(_d[6])),a=e(_r(_d[7])),d=_r(_d[8]),u=e(d),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),f=_r(_d[12]),y=_r(_d[13]),x=_r(_d[14]);const b=8,k=16,w=18,_=14,C=18,S=8,T=4,j=72,v=212,I=198,O='The two lines under each tile read that contract\'s premium and its \u0394OI together over that same hour: what is happening, and what that is a reading of. Both are worked out in the browser from the very points the tile drew, so a tile can never disagree with its own chart.',L='A contract is listed only when it clears all three floors above.',R='Over the floors',H='Clicking a row points the futures chart and the ten tiles at that contract.',M='Pointing at a tile lights the same strike wherever else it is on this tab \u2014 on the option chain and in the volatility-by-strike list. It highlights; it changes nothing.',E='A reading with no snapshot is drawn as a gap on both lines; nothing here is interpolated.';const $={'5m':5,'15m':15,'30m':30,'1h':60},P={prev_close:'since close',open:'since open','5m':'in 5 min','15m':'in 15 min','30m':'in 30 min','1h':'in 1 hr'},A=e=>{const t=e?Date.parse(e):NaN;return Number.isFinite(t)?t:null};function D(e,t){if('oi'===t.mode)return e.map(e=>e.oi??null);const i=t.window;if('prev_close'===i||!i)return e.map(e=>e.delta_oi??null);if('open'===i){const t=e.find(e=>null!=e.oi)?.oi??null;return e.map(e=>null==e.oi||null==t?null:e.oi-t)}const n=$[i];return n?e.map((t,i)=>{const l=A(t.at);if(null==t.oi||null==l)return null;for(let o=i-1;o>=0;o--){const i=A(e[o].at);if(null!=i&&i<=l-6e4*n)return null==e[o].oi?null:t.oi-e[o].oi}return null}):e.map(e=>e.delta_oi??null)}function z(e,t){const i=[...e.keys()].reverse().find(t=>null!=e[t].price);if(null==i)return null;const n=e[i].price,l=A(e[i].at);let o=null,r='since open';const s='oi'===t.mode?0:$[t.window];if(s&&null!=l){for(let t=i-1;t>=0;t--){const i=A(e[t].at);if(null!=i&&i<=l-6e4*s&&null!=e[t].price){o=e[t].price;break}}r=P[t.window]}else o=e.find(e=>null!=e.price)?.price??null;return null!=o&&o?{pct:(n-o)/o*100,words:r}:null}function F(e){const t=e.filter(e=>null!=e.price);if(t.length<i.SHARP_FALL_READINGS_BACK+1)return!1;const n=t[t.length-1-i.SHARP_FALL_READINGS_BACK].price,l=t[t.length-1].price;return n>0&&(l-n)/n<=-i.SHARP_FALL_PCT}function N(e,t,i,n){const l=e.filter(e=>null!=e);if(!l.length||t<=0||i<=0)return null;let o=Math.min(...l),r=Math.max(...l);n&&(o=Math.min(0,o),r=Math.max(0,r));const s=r-o||Math.abs(r)||1,a=.08*i,d=i-2*a,u=e=>a+d-(e-o)/s*d,c=e.length>1?t/(e.length-1):0;return{lo:o,hi:r,zero:u(0),points:e.map((e,t)=>null==e?null:{x:t*c,y:u(e),i:t})}}const G=e=>{let t='',i=!1;for(const n of e)n?(t+=(i?'L':'M')+n.x.toFixed(1)+' '+n.y.toFixed(1),i=!0):i=!1;return t},W={prev_close:'since close',open:'since open','5m':'in 5 min','15m':'in 15 min','30m':'in 30 min','1h':'in 1 hr'},B=e=>(0,y.deltaUnits)(e).replace('K','k');function X({slot:e,width:n,selected:l,lit:s,onPress:h,onHighlight:f,tileH:b=v,link:I,draw:O=1}){const L='oi'!==I.mode,R=j+Math.max(0,b-v)+(L?0:22),H=(0,y.gridDirection)(e.points),M=(0,y.directionChip)(H),E=(0,y.directionTone)(H),$=(0,y.gridFlow)(e.option_type,e.points),A=(0,y.gridSlotNote)(e),W=String(e.option_type).toUpperCase().startsWith('C')?'call':'put',X=t.OI_SIDE_COLOR[W],K=e.points||[],U=Math.max(0,n-16-2),V=(0,o.useMemo)(()=>D(K,I),[K,I.mode,I.window]),q=N(V,U,R,'oi'!==I.mode),J=N(K.map(e=>e.price??null),U,R,!1),Q=[...V].reverse().find(e=>null!=e)??null,Y=[...K].reverse().find(e=>null!=e.oi)?.oi??null,Z=[...K].reverse().find(e=>null!=e.delta_oi)?.delta_oi??null,ee=[...K].reverse().find(e=>'number'==typeof e?.price)?.price,te=z(K,I),ie=F(K),ne=(0,y.axisTimes)(K,2),le=(0,y.gridSlotDetail)(e).split('\xb7')[0].trim(),oe=q?[...q.points].reverse().find(Boolean):null,re=J?[...J.points].reverse().find(Boolean):null,[se,ae]=(0,o.useState)(!1);(0,o.useEffect)(()=>
1036{if(!ie)return;let e=0;const t=setInterval(()=>{e++,ae(e=>!e),e>=12&&(clearInterval(t),ae(!1))},450);return()=>clearInterval(t)},[ie,I.mode,I.window]);P['oi'===I.mode?'prev_close':I.window];const de='oi'===I.mode?Z:Q,ue=e=>B(Math.abs(e)).replace(/^[+\u2212-]/,''),ce=null==de?'Change in OI \u2014':`Change in OI ${de>=0?'+':'\u2212'}${ue(de)}`,he='oi'===I.mode?null==Y?'OI \u2014':`OI ${ue(Y)} standing`:'both'===I.mode?`OI ${null==Y?'\u2014':ue(Y)} \xb7 change ${null==de?'\u2014':(de>=0?'+':'\u2212')+ue(de)}`:ce,pe=!!te&&Math.abs(te.pct)<i.FLAT_PREMIUM_PCT,fe=te?pe?`\u20b9 flat ${te.words}`:`\u20b9 ${te.pct>=0?'up':'down'} ${Math.abs(te.pct).toFixed(1)}% ${te.words}`:'',ge=[(0,y.gridSlotTitle)(e),(0,y.gridSlotDetail)(e),q?`OI scale ${B(q.lo)} to ${B(q.hi)}`:'',J?`premium ${(0,y.price)(J.lo)} to ${(0,y.price)(J.hi)}${te?` (${fe} ${te.words})`:''}`:'',$.what_label,$.meaning].filter(Boolean).join(' \xb7 '),me={fontSize:11,lineHeight:14,color:c.C.muted,fontVariant:['tabular-nums']},ye=`clip-${e.slot}`;return(0,x.jsxs)(a.default,{accessibilityRole:"button",accessibilityLabel:(0,y.gridSlotLabel)(e,H)+'. '+he+(fe?', '+fe:''),accessibilityState:{selected:l},disabled:!e.present,onPress:h,title:ge,onHoverIn:()=>f?.(null==e.strike?null:Number(e.strike)),onHoverOut:()=>f?.(null),onFocus:()=>f?.(null==e.strike?null:Number(e.strike)),onBlur:()=>f?.(null),style:e=>[{width:n,height:b,padding:S,borderRadius:10,gap:T,borderWidth:l||e.focused?2:1,borderColor:l||e.focused?c.C.green:s?c.C.mint:c.C.line,backgroundColor:l?c.C.soft:s||e.hovered||e.focused?c.C.dark:'transparent'}],children:[(0,x.jsxs)(r.default,{style:[c.s.row,{height:k,gap:6}],children:[(0,x.jsx)(c.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:13,lineHeight:k,color:X,flexShrink:1},children:(0,y.gridSlotTitle)(e)}),(0,x.jsx)(r.default,{style:{flex:1}}),(0,x.jsx)(c.T,{numberOfLines:1,style:me,children:le})]}),(0,x.jsxs)(r.default,{style:[c.s.row,{height:w,gap:4}],children:[(0,x.jsxs)(c.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:12,lineHeight:w,color:X,fontVariant:['tabular-nums'],flexShrink:1},children:['oi'===I.mode?null==Y?y.DASH:B(Y).replace(/^[+]/,''):null==Q?y.DASH:B(Q),(0,x.jsx)(c.T,{style:{fontFamily:'Inter',fontSize:11,color:c.C.muted},children:" OI"})]}),(0,x.jsx)(r.default,{style:{flex:1}}),(0,x.jsx)(c.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:12,lineHeight:w,color:ie?(0,p.buildupColor)('down'):c.C.ink,fontVariant:['tabular-nums']},children:(0,y.price)(ee)})]}),(0,x.jsxs)(r.default,{style:{height:R+_},children:[A?(0,x.jsx)(r.default,{style:{flex:1,justifyContent:'center'},children:(0,x.jsx)(c.T,{style:me,children:A})}):U>0&&(0,x.jsxs)(u.default,{width:U,height:R,children:[(0,x.jsx)(d.Defs,{children:(0,x.jsx)(d.ClipPath,{id:ye,children:(0,x.jsx)(d.Rect,{x:0,y:0,width:Math.max(.1,U*O),height:R})})}),'oi'!==I.mode&&!!q&&(0,x.jsx)(d.Line,{x1:0,x2:U,y1:q.zero,y2:q.zero,stroke:c.C.line,strokeWidth:1,strokeDasharray:"2 3"}),(0,x.jsxs)(d.G,{clipPath:`url(#${ye})`,children:[!!J&&(0,x.jsx)(d.Path,{d:G(J.points),stroke:c.C.muted,strokeOpacity:.9,strokeWidth:1.1,strokeDasharray:"3 3",fill:"none"}),!!q&&(0,x.jsx)(d.Path,{d:G(q.points),stroke:X,strokeWidth:2,fill:"none"})]}),O>=1&&!!oe&&(0,x.jsx)(d.Circle,{cx:oe.x,cy:oe.y,r:3,fill:X}),O>=1&&!!re&&(0,x.jsx)(d.Circle,{cx:re.x,cy:re.y,r:se?5:2.6,fill:ie?(0,p.buildupColor)('down'):c.C.muted,opacity:se?.35:1})]}),!A&&(0,x.jsx)(r.default,{style:[c.s.row,{height:_,justifyContent:'space-between'}],children:ne.map(e=>(0,x.jsx)(c.T,{style:me,children:e.label},e.i))})]}),L&&(0,x.jsxs)(c.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,height:C,color:c.C.ink,fontVariant:['tabular-nums']},children:['oi'!==I.mode&&(0,x.jsx)(c.T,{style:{color:null==de?c.C.muted:(0,p.buildupColor)(de>=0?'up':'down'),fontFamily:'InterSemi'},children:null==de?'\u2013 ':de>=0?'\u2191 ':'\u2193 '}),he]}),(0,x.jsxs)(c.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,height:C,color:ie?(0,p.buildupColor)('down'):c.C.ink,fontVariant:['tabular-nums']},children:[(0,x.jsx)(c.T,{style:{color:!te||pe?c.C.muted:(0,p.buildupColor)(te.pct>=0?'up':'down'),fontFamily:'InterSemi'},children:te?pe?'\u2192 ':te.pct>=0?'\u2191 ':'\u2193 ':'\u2013 '}),fe||'\u20b9 change \u2014',ie?' \xb7 sharp fall':'']}),(0,x.jsxs)(r.default,{style:[c.s.row,{height:C,gap:6}],children:[(0,x.jsx)(c.T,{accessibilityLabel:M||'no baseline',style:{fontSize:12,lineHeight:15,fontFamily:'InterSemi',color:M&&'flat'!==E?(0,p.buildupColor)(E):c.C.muted},children:M?'up'===E?'\u2191':'down'===E?'\u2193':'\u2192':'\u2013'}),(0,x.jsx)(c.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,fontFamily:'InterMedium',color:c.C.muted,flexShrink:1},children:'Day: '+($.what_label||(M?M.replace(/^\W+\s*/,''):'no baseline'))})]})]})}const K=[{value:'2x5',text:'2\xd75'},{value:'2x3',text:'2\xd73'},{value:'1x1',text:'1\xd71'}];function U(){try{const e=JSON.parse(globalThis.localStorage?.getItem("kanida/derivative-wip/grid_view")||'null');
1036if(e&&'object'==typeof e)return{view:['2x5','2x3','1x1','pick'].includes(e.view)?e.view:'2x5',picked:Array.isArray(e.picked)?e.picked.filter(e=>'string'==typeof e):[],one:'string'==typeof e.one?e.one:''}}catch{}return{view:'2x5',picked:[],one:''}}function V(e,t,i,n){if('2x3'===t){return{slots:e.filter(e=>Math.abs(e.atm_offset)<=2),columns:3}}if('1x1'===t){const t=e.find(e=>e.slot===n)||e.find(e=>'calls'===e.row&&0===e.atm_offset)||e[0];return{slots:t?[t]:[],columns:1}}if('pick'===t){const t=e.filter(e=>i.includes(e.slot));return{slots:t,columns:Math.min(5,Math.max(1,Math.ceil(t.length/2)))}}return{slots:e,columns:5}}function q({rows:e,view:i,picked:l,one:s,onPick:d}){const[u,h]=(0,o.useState)(!1),p='pick'===i?`${l.length} strike${1===l.length?'':'s'}`:'1x1'===i?(0,y.gridSlotTitle)(e.find(e=>e.slot===s)||e.find(e=>'calls'===e.row&&0===e.atm_offset)||e[0]||{})||'Strike':'Strikes',f=t=>{if('1x1'===i)return d({view:i,picked:l,one:t}),void h(!1);const n='pick'===i?l:V(e,i,l,s).slots.map(e=>e.slot),o=n.includes(t)?n.filter(e=>e!==t):[...n,t];d({view:'pick',picked:o.length?o:n,one:s})};return(0,x.jsxs)(r.default,{style:{position:'relative',zIndex:30},children:[(0,x.jsx)(a.default,{accessibilityRole:"button",accessibilityLabel:'Choose strikes: '+p,onPress:()=>h(e=>!e),style:e=>[c.s.row,{gap:5,minHeight:n.CTRL.h,paddingHorizontal:n.CTRL.padX,borderRadius:n.CTRL.radius,borderWidth:1,borderColor:'pick'===i||u?c.C.green:c.C.line,backgroundColor:e.hovered?c.C.dark:'transparent'}],children:(0,x.jsxs)(c.T,{style:{fontSize:n.CTRL.font,lineHeight:n.CTRL.lineHeight,fontFamily:'InterMedium',color:'pick'===i?c.C.green:c.C.ink},children:[p," \u25be"]})}),u&&(0,x.jsxs)(r.default,{style:{position:'absolute',top:n.CTRL.h+4,right:0,width:250,padding:8,gap:6,borderRadius:8,borderWidth:1,borderColor:c.C.line,backgroundColor:c.C.paper},children:[(0,x.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:'1x1'===i?'Show this strike':'Tick the strikes to show'}),['calls','puts'].map(o=>(0,x.jsx)(r.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:4},children:e.filter(e=>e.row===o).map(r=>{const d=(u=r.slot,'1x1'===i?V(e,i,l,s).slots[0]?.slot===u:V(e,i,l,s).slots.some(e=>e.slot===u));var u;return(0,x.jsx)(a.default,{accessibilityRole:"checkbox",accessibilityState:{checked:d},onPress:()=>f(r.slot),style:e=>[{minHeight:n.CTRL.h,paddingHorizontal:6,borderRadius:n.CTRL.radius,borderWidth:1,justifyContent:'center',borderColor:d?t.OI_SIDE_COLOR['calls'===o?'call':'put']:c.C.line,backgroundColor:e.hovered?c.C.dark:'transparent'}],children:(0,x.jsx)(c.T,{style:{fontSize:11,lineHeight:14,fontFamily:d?'InterSemi':'Inter',color:d?t.OI_SIDE_COLOR['calls'===o?'call':'put']:c.C.muted},children:(0,y.gridSlotTitle)(r)})},r.slot)})},o)),(0,x.jsx)(a.default,{onPress:()=>{d({view:'2x5',picked:[],one:s}),h(!1)},style:{minHeight:n.CTRL.h,justifyContent:'center'},children:(0,x.jsx)(c.T,{style:{fontSize:11,lineHeight:14,fontFamily:'InterSemi',color:c.C.green},children:"Show all ten"})})]})]})}function J({link:e={mode:'change',window:'prev_close'},underlying:t,read:i,target:a,onTarget:d,highlight:u,onHighlight:h,onExpand:f,expanded:k,onClose:w,style:_}){const[C,S]=(0,o.useState)(0),[T,j]=(0,o.useState)(0),[I,O]=(0,o.useState)(U),L=e=>{O(e);try{globalThis.localStorage?.setItem("kanida/derivative-wip/grid_view",JSON.stringify(e))}catch{}},R=i.data,H=t?(0,p.stateOf)(i,R?.not_enough_marks||y.GRID_NOT_ENOUGH_MARKS):{phase:'empty',text:'Choose a symbol in Customize, or click a row in the screener, to see the strikes at the money.'},M=R?.rows||[],{slots:E,columns:$}=V(M,I.view,I.picked,I.one),P=Math.max(1,Math.min($,Math.floor(((C||660)+b)/128))),A=Math.max(120,Math.floor(((C||660)-b*(P-1))/P)),D=Math.max(1,Math.ceil(E.length/P)),z=(0,l.useGrow)(`${e.mode}|${e.window}|${t}|${I.view}|${I.picked.join(',')}|${I.one}|${M.length}`,700),F=Math.max(v,Math.floor((T-20-b*(D-1))/D)),N=e=>{e.present&&d({underlying:R?.underlying||t,instrumentToken:e.instrument_token,label:e.tradingsymbol||(0,y.gridSlotTitle)(e),detail:`${(0,y.gridSlotTitle)(e)} \xb7 ${e.label}${null!=R?.days_to_expiry?` \xb7 ${(0,y.dteText)(R.days_to_expiry)}`:''}`})},G=R?.expiry?(0,y.expiryText)(R.expiry,null):'',B=t?`${t}${G&&G!==y.DASH?` \xb7 ${G}`:''}${null!=R?.atm_strike?` \xb7 ATM ${(0,y.strike)(R.atm_strike)}`:''}${null!=R?.spot?` \xb7 spot ${(0,y.spotLevel)(R.spot,t)}`:''}`:'',J=(0,y.gridBlockRead)(M),Q=(0,x.jsxs)(r.default,{style:[c.s.row,{gap:n.CTRL.gap,flexWrap:'wrap'}],children:[(0,x.jsx)(l.Seg,{label:"Tiles",value:'pick'===I.view?'':I.view,onChange:e=>L({...I,view:e}),options:K}),(0,x.jsx)(r.default,{style:{flex:1}}),(0,x.jsxs)(r.default,{style:[c.s.row,{gap:5}],children:[(0,x.jsx)(r.default,{style:{width:14,height:2,borderRadius:1,backgroundColor:c.C.ink}}),(0,x.jsx)(c.T,{style:{fontSize:11,lineHeight:14,color:c.C.muted},children:'oi'===e.mode?'OI standing':`Change in OI ${W[e.window]||'since close'}`})]}),(0,x.jsxs)(r.default,{style:[c.s.row,{gap:5}],children:[(0,x.jsx)(r.default,{style:{width:14,height:0,borderTopWidth:1.5,borderStyle:'dashed',borderColor:c.C.muted}}),(0,x.jsx)(c.T,{style:{fontSize:11,lineHeight:14,color:c.C.muted},children:"Option price"})]}),!!M.length&&(0,x.jsx)(q,{rows:M,view:I.view,picked:I.picked,one:I.one,onPick:L})]});return(0,x.jsx)(p.WidgetFrame,{name:"Strikes at the money",subtitle:B,body:R,state:H,onRefresh:i.reload,onExpand:f,expanded:k,toolbar:Q,inline:!0,onClose:w,note:J||void 0,inBlock:!0,style:_,emptyDetail:R?.empty_detail||'Each line needs two readings before it is a line rather than a dot.',children:(0,x.jsx)(s.default,{style:{flex:1},contentContainerStyle:{padding:10},onLayout:e=>{const t=Math.round(e.nativeEvent.layout.height);j(e=>Math.abs(e-t)<3?e:t)},children:(0,x.jsx)(r.default,{onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width);
1036S(e=>Math.abs(e-t)<3?e:t)},style:[c.s.row,{flexWrap:'wrap',alignItems:'flex-start',gap:b}],children:E.map(t=>(0,x.jsx)(X,{slot:t,width:A,tileH:F,onPress:()=>N(t),link:e,draw:z,onHighlight:h,lit:null!=u&&null!=t.strike&&Math.abs(Number(t.strike)-u)<.5,selected:null!=t.instrument_token&&a?.instrumentToken===t.instrument_token},t.slot))})})})}},943,[934,944,928,927,11,13,278,375,840,821,925,924,945,926,6]); 1037__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ATM_TOLERANCE_PCT",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ATM_TOLERANCE_MIN_POINTS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"isAtTheMoney",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"SHARP_FALL_PCT",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"SHARP_FALL_READINGS_BACK",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"FLAT_PREMIUM_PCT",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"FLAT_IV_POINTS",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"WINDOW_SLACK_FACTOR",{enumerable:!0,get:function(){return f}});const t=.002,n=1,u=(u,o)=>null!=o&&Math.abs(u-o)<=Math.max(n,o*t),o=.1,c=2,_=.05,b=.05,f=2},944,[]); 1038__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.FuturesChartPanel=function({underlying:e,seq:F,onExpand:R,expanded:U,onClose:$,onInfo:A,style:H}){const[D,I]=(0,t.useState)({w:0,h:0}),[O,W]=(0,t.useState)(x.FUTURES_DEFAULT_INTERVAL),N=e?`/api/derivatives/futures-chart?underlying=${encodeURIComponent(e)}&interval=${O}`:null,B=(0,c.useDerivativeRead)(N,F),P=B.data,z=e?(0,h.stateOf)(B,x.FUTURES_NO_CANDLES):{phase:'empty',text:x.FUTURES_NO_SYMBOL},V=P?.candles||[],G=Math.max(0,D.w-p),X=Math.max(0,D.h-j),Y=(0,x.candleWindow)(V,G),q=Y.candles,J=(0,x.candleWindowText)(Y),K=(0,x.scaleCandles)(q,G,X),Q=(0,x.candleWindowShort)(Y)||(0,x.candleDrawnText)(K?.drawn,(0,x.futuresBars)(P)),Z=(0,x.candleAxis)(K,X),ee=(0,x.candleAxisTimes)(q,O,5,G),te=[...q].reverse().find(e=>'number'==typeof e?.close),ae=(0,x.futuresShortText)(P),le=(0,x.futuresFewText)(K?.drawn),ne=(0,x.futuresIntervalChoices)(P),se=(0,x.futuresIntervalNote)(ne),ie=(0,x.futuresChartSubtitle)(P),re=[(0,x.futuresNote)(P,O),J,x.FUTURES_GAP_TEXT,x.FUTURES_DISPLAY_TEXT].filter(Boolean).join(L);(0,t.useEffect)(()=>{A?.(re?re.split(L).map(e=>({text:e})):[])},[re,A]);const oe=(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(n.default,{style:[u.s.row,{gap:6,rowGap:16,flexWrap:'wrap'}],children:ne.map(e=>{const t=e.key===O;return(0,y.jsxs)(s.default,{accessibilityRole:"button",accessibilityState:{selected:t,disabled:!e.available},disabled:!e.available,accessibilityLabel:e.available?`Show ${e.label}`:`${e.label}, unavailable. ${e.reason}`,onPress:()=>W(e.key),hitSlop:b,style:l=>[{minHeight:28,paddingHorizontal:10,justifyContent:'center',borderRadius:8,borderWidth:1,borderColor:t?u.C.green:u.C.line,opacity:e.available?1:.5,backgroundColor:t?u.C.soft:l.hovered||l.focused?u.C.dark:'transparent'}],children:[(0,y.jsx)(f.HitArea,{slop:b}),(0,y.jsx)(u.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:t?u.C.green:e.available?u.C.ink:u.C.muted},children:e.label})]},e.key)})})}),de=[ae,le].filter(Boolean).join(' '),ue=(0,y.jsxs)(n.default,{style:{gap:3},children:[(0,y.jsxs)(n.default,{style:[u.s.row,{gap:10}],children:[(0,y.jsxs)(u.T,{numberOfLines:1,style:[h.bodyText,{fontVariant:['tabular-nums']}],children:["Last close ",(0,x.spotLevel)(te?.close,e)]}),(0,y.jsx)(n.default,{style:{flex:1}}),!!Q&&(0,y.jsx)(u.T,{numberOfLines:1,style:[h.metaText,{fontVariant:['tabular-nums']}],children:Q})]}),!!se&&(0,y.jsxs)(n.default,{style:[u.s.row,{gap:5,alignItems:'flex-start'}],children:[(0,y.jsx)(n.default,{style:{paddingTop:2},children:(0,y.jsx)(u.Icon,{name:"info",size:10,color:u.C.muted})}),(0,y.jsx)(u.T,{style:[h.metaText,{flex:1}],children:se})]}),!!de&&(0,y.jsx)(u.T,{style:[h.metaText,{color:u.C.amber}],children:de})]});return(0,y.jsx)(h.WidgetFrame,{name:(0,x.futuresChartTitle)(P?.contract,e),subtitle:ie,body:P,state:z,onRefresh:B.reload,onExpand:R,expanded:U,onClose:$,toolbar:oe,note:ue,inBlock:!0,style:H,emptyDetail:"The panel draws only candles that were stored for this contract; it never fills a gap in the series.",children:(0,y.jsx)(n.default,{style:{flex:1,minHeight:0,padding:w,gap:6},children:(0,y.jsx)(n.default,{style:{flex:1,minHeight:T},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout,n=Math.round(t),s=Math.round(l);I(e=>Math.abs(e.w-n)<3&&Math.abs(e.h-s)<3?e:{w:n,h:s})},children:G>0&&X>0&&(0,y.jsxs)(o.default,{width:D.w,height:D.h,accessibilityLabel:`${(0,x.futuresChartSpoken)({contract:P?.contract,candles:q},O,e)}${J?` ${J}`:''}`,children:[Z.map(e=>(0,y.jsx)(k,{y:e.y,label:(0,x.priceTick)(e.v),width:D.w,plotH:X},`y${e.v}`)),(K?.candles||[]).map((e,t)=>{if(!e)return null;const n='up'===e.direction?C:'down'===e.direction?v:S,s=Math.min(e.open,e.close),o=Math.max(_,Math.abs(e.close-e.open)),u=p+e.x;return(0,y.jsxs)(l.default.Fragment,{children:[(0,y.jsx)(i.Line,{x1:u,x2:u,y1:e.high,y2:e.low,stroke:n,strokeWidth:M}),(0,y.jsx)(i.Rect,{x:u-K.body/2,y:s,width:K.body,height:o,fill:n})]},`c${t}`)}),ee.map(e=>(0,y.jsx)(E,{label:e.label,x:p+(K?.step||0)*(e.i+.5),width:D.w,y:D.h-3},`x${e.i}`))]})})})})};var t=r(d[0]),l=e(t),n=e(r(d[1])),s=e(r(d[2])),i=r(d[3]),o=e(i),u=r(d[4]),c=r(d[5]),h=r(d[6]),x=r(d[7]),f=r(d[8]),y=r(d[9]);const b=(0,f.touchSlop)(28),p=46,j=14,w=10,T=120,C=u.C.green,v=u.C.red,S=u.C.muted,M=1,_=1,L='\0';function k({y:e,label:t,width:l,plotH:n}){return t===x.DASH?null:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i.Line,{x1:p,x2:l,y1:Math.min(n,Math.max(0,e)),y2:Math.min(n,Math.max(0,e)),stroke:u.C.line,strokeWidth:1,strokeDasharray:"2 4"}),(0,y.jsx)(F,{x:0,y:Math.min(n-1,Math.max(8,e+3)),label:t})]})}function E({label:e,x:t,width:l,y:n}){return e===x.DASH?null:(0,y.jsx)(F,{x:Math.min(l-32,Math.max(p,t-16)),y:n,label:e})}function F({x:e,y:t,label:l}){return(0,y.jsx)(i.Text,{x:e,y:t,fill:u.C.muted,fontSize:9,children:l})}},945,[11,13,375,840,821,920,924,926,832,6]); 1039__d(function(g,r,i,a,m,_e,d){"use strict";
1039function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ChainWidget=function({underlying:e,expiry:C,at:S,seq:$,target:w,onTarget:H,filterCount:v,onCustomize:O,onExpand:z,expanded:I,onClose:P,highlight:R,onHighlight:A,style:L,spotHint:E}){const F=e?`/api/derivatives/chain?underlying=${encodeURIComponent(e)}${C?`&expiry=${encodeURIComponent(C)}`:''}${S?`&at=${encodeURIComponent(S)}`:''}`:null,W=(0,y.useDerivativeRead)(F,$),M=W.data,N=(0,x.stateOf)(W,'No strike of this expiry has been captured yet.'),q=M?.baseline_sessions_required??null,U=e=>H({underlying:e.underlying,instrumentToken:e.instrument_token,label:e.tradingsymbol||e.underlying,detail:`${(0,l.strike)(e.strike)} ${e.instrument_type} \xb7 ${(0,l.dteText)(e.days_to_expiry)}`}),D=M?.rows||[],B=M?.spot??E??null,X=(0,s.useMemo)(()=>(0,l.nearestStrikeIndex)(D,B),[D,B]),V=(0,s.useRef)(null),Y=o.default.useCallback(e=>{null!=X&&V.current?.scrollTo?.({y:(0,l.chainStartRow)(D,B)*T,animated:e})},[X,D,B]);(0,s.useEffect)(()=>{Y(!1)},[e,M?.expiry,X,Y]);const G=e?`${e}${M?.expiry?` \xb7 ${M.expiry}`:''}${null!=M?.days_to_expiry?` \xb7 ${(0,l.dteText)(M.days_to_expiry)}`:''}${null!=M?.spot?` \xb7 spot ${(0,l.spotLevel)(M.spot,e)}`:''}`:'';return e?(0,b.jsxs)(x.WidgetFrame,{inline:!0,name:"Option chain",subtitle:G,body:M,state:N,onRefresh:W.reload,filterCount:v,onCustomize:O,onExpand:z,expanded:I,onClose:P,showsSignals:['oi_change_day','buildup_day','premium_cr','volume_ratio'],style:L,toolbar:null==X?void 0:(0,b.jsxs)(u.default,{style:[p.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,b.jsxs)(h.default,{accessibilityRole:"button",accessibilityLabel:`Scroll the chain back to ${(0,l.strike)(D[X]?.strike)}, the strike nearest the captured spot`,onPress:()=>Y(!0),hitSlop:j,style:e=>[p.s.row,{gap:5,minHeight:24,paddingHorizontal:8,borderRadius:6,borderWidth:1,borderColor:e.hovered||e.focused?p.C.green:p.C.line,backgroundColor:e.hovered||e.focused?p.C.soft:'transparent'}],children:[(0,b.jsx)(f.HitArea,{slop:j}),(0,b.jsx)(p.Icon,{name:"crosshair",size:11,color:p.C.mint}),(0,b.jsxs)(p.T,{numberOfLines:1,style:{fontSize:10,lineHeight:14,color:p.C.mint},children:["At the money ",(0,l.strike)(D[X]?.strike)]})]}),(0,b.jsx)(p.T,{style:x.metaText,children:null!=M?.spot?`Spot ${(0,l.spotLevel)(M.spot,e)} at this reading`:`Last spot ${(0,l.spotLevel)(B,e)} (none at this reading)`})]}),inBlock:!0,note:(0,b.jsxs)(u.default,{style:{gap:2},children:[(0,b.jsxs)(p.T,{style:x.metaText,children:[(0,l.asOfText)(M?.as_of)," \xb7 ",(0,l.floorsText)(M?.floors,M?.floors_text)]}),(0,b.jsx)(p.T,{style:x.metaText,children:null==X?l.CHAIN_NO_SPOT_TEXT:l.CHAIN_AT_MONEY_TEXT}),(0,b.jsx)(p.T,{style:x.metaText,children:"Build-up here is the day-on-day reading; the 15-minute reading is a separate label and is never mixed into it (\xa73.1). Pointing at a strike lights the same strike wherever else it is on this tab."})]}),children:[(0,b.jsxs)(u.default,{style:[p.s.row,{paddingHorizontal:9,minHeight:22,gap:5}],children:[(0,b.jsx)(p.T,{style:[x.head,{flex:1}],children:"Calls"}),(0,b.jsx)(p.T,{style:[x.head,{width:_.oi,textAlign:'right'}],children:"OI"}),(0,b.jsx)(p.T,{style:[x.head,{width:_.prem,textAlign:'right'}],children:"Premium"}),(0,b.jsx)(p.T,{style:[x.head,{width:58,textAlign:'center'}],children:"Strike"}),(0,b.jsx)(p.T,{style:[x.head,{width:46,textAlign:'center'}],children:"PCR"}),(0,b.jsx)(p.T,{style:[x.head,{flex:1}],children:"Puts"}),(0,b.jsx)(p.T,{style:[x.head,{width:_.oi,textAlign:'right'}],children:"OI"}),(0,b.jsx)(p.T,{style:[x.head,{width:_.prem,textAlign:'right'}],children:"Premium"})]}),(0,b.jsx)(c.default,{ref:V,style:{flex:1},contentContainerStyle:{paddingBottom:8},children:(0,b.jsx)(u.default,{...(0,x.webOnly)({role:'listbox'}),"aria-label":`Option chain for ${e}`,children:D.map(e=>{const s=(0,n.isAtTheMoney)(e.strike,M?.spot),o=null!=R&&Math.abs(e.strike-R)<.5;return(0,b.jsxs)(u.default,{onPointerEnter:A?()=>A(e.strike):void 0,onPointerLeave:A?()=>A(null):void 0,style:[p.s.row,{gap:4,height:T,paddingHorizontal:3,borderRadius:8,borderWidth:1,borderColor:o||s?p.C.mint:'transparent',backgroundColor:o?p.C.dark:s?'#0C1E1A':'transparent'}],children:[(0,b.jsx)(k,{row:e.ce,side:"CE",selected:!!e.ce&&w?.instrumentToken===e.ce.instrument_token,required:q,onPress:U}),(0,b.jsx)(u.default,{style:{width:58,alignItems:'center',justifyContent:'center',paddingVertical:2},children:(0,b.jsx)(p.T,{style:[x.tab,{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:o||s?p.C.mint:p.
1039C.ink}],children:(0,l.strike)(e.strike)})}),(0,b.jsx)(u.default,{style:{width:46,alignItems:'center',justifyContent:'center'},children:(()=>{const n=Number(e.ce?.oi),s=Number(e.pe?.oi),o=null!=e.ce?.oi&&null!=e.pe?.oi&&n>0?s/n:null;return(0,b.jsx)(p.T,{accessibilityLabel:`Strike ${(0,l.strike)(e.strike)} put-call ratio ${null==o?'not available':o.toFixed(2)}`,style:[x.tab,{fontSize:12,lineHeight:16,fontFamily:'InterMedium',color:null==o?p.C.muted:o>=1?t.OI_SIDE_COLOR.put:t.OI_SIDE_COLOR.call}],children:null==o?'\u2014':o>=10?o.toFixed(0):o.toFixed(2)})})()}),(0,b.jsx)(k,{row:e.pe,side:"PE",selected:!!e.pe&&w?.instrumentToken===e.pe.instrument_token,required:q,onPress:U})]},e.strike)})})})]}):(0,b.jsx)(x.WidgetFrame,{name:"Option chain",body:null,filterCount:v,onCustomize:O,onClose:P,state:{phase:'empty',text:'Click any row on the screener above, or choose a symbol in Customize, to see a chain.'},footer:null,style:L})};var t=r(d[0]),n=r(d[1]),l=r(d[2]),s=r(d[3]),o=e(s),u=e(r(d[4])),c=e(r(d[5])),h=e(r(d[6])),p=r(d[7]),y=r(d[8]),x=r(d[9]),f=r(d[10]),b=r(d[11]);const C=(0,f.touchSlop)(38),j=(0,f.touchSlop)(24),_={oi:56,prem:68},T=44;function k({row:e,side:t,selected:n,required:s,onPress:o}){if(!e)return(0,b.jsx)(u.default,{style:{flex:1,minHeight:38,justifyContent:'center',paddingHorizontal:6},children:(0,b.jsx)(p.T,{style:{fontSize:11,color:p.C.muted},children:"\u2014"})});const c=`${'CE'===t?'Call':'Put'} ${(0,l.strike)(e.strike)}. Open interest ${(0,l.compact)(e.oi)}, change ${(0,l.signedUnits)(e.oi_change_day)}, premium ${(0,l.crore)(e.premium_cr)}, ${(0,l.buildupLabel)(e.buildup_day)} on the day, volume ${null==s?'not baselined':(0,l.volumeRatioShort)(e,s)} of its own median`;return(0,b.jsxs)(h.default,{role:"option","aria-selected":n,accessibilityLabel:c,...(0,x.webOnly)({tabIndex:0}),onPress:()=>o(e),hitSlop:C,style:e=>[p.s.row,{flex:1,gap:5,minHeight:38,paddingHorizontal:6,borderRadius:7,borderWidth:n||e.focused?2:1,borderColor:n||e.focused?p.C.green:'transparent',backgroundColor:n?p.C.soft:e.hovered||e.focused?'#0F1F28':'transparent'}],children:[(0,b.jsx)(f.HitArea,{slop:C}),(0,b.jsxs)(u.default,{style:{flex:1,minWidth:0},children:[(0,b.jsx)(p.T,{numberOfLines:1,style:[x.tab,{fontSize:12,lineHeight:16}],children:(0,l.price)(e.last_price)}),(0,b.jsx)(p.T,{numberOfLines:1,style:{fontSize:9,lineHeight:12,color:(0,x.buildupColor)((0,l.buildupTone)(e.buildup_day))},children:(0,l.buildupLabel)(e.buildup_day)})]}),(0,b.jsxs)(u.default,{style:{width:_.oi,alignItems:'flex-end'},children:[(0,b.jsx)(p.T,{style:[x.tab,{fontSize:11,lineHeight:15}],children:(0,l.compact)(e.oi)}),(0,b.jsx)(p.T,{style:[x.tab,{fontSize:9,lineHeight:12,color:(0,x.tone)(e.oi_change_day)}],children:(0,l.signedUnits)(e.oi_change_day)})]}),(0,b.jsxs)(u.default,{style:{width:_.prem,alignItems:'flex-end'},children:[(0,b.jsx)(p.T,{style:[x.tab,{fontSize:11,lineHeight:15}],children:(0,l.crore)(e.premium_cr)}),(0,b.jsx)(p.T,{style:[x.tab,{fontSize:9,lineHeight:12,color:p.C.muted}],children:null==s?l.DASH:(0,l.volumeRatioShort)(e,s)})]})]})}},946,[934,944,926,11,13,278,375,821,920,924,832,6]); 1040__d(function(g,_r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SIGNAL_EMPTY",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"SIGNAL_NO_SYMBOL",{enumerable:!0,get:function(){return b}}),_e.SignalPanel=function({symbol:e,read:m,pcr:y,maxPain:_,iv:C,standing:j,onExpand:S,expanded:k,style:T}){const w=m.data,v=e?(0,u.stateOf)(m,x):{phase:'empty',text:b},$=(0,s.useReducedMotion)(),[z,I]=(0,t.useState)(''),[W,V]=(0,t.useState)(!1),L=(0,t.useCallback)(e=>I(t=>t===e?'':e),[]),M=(0,t.useMemo)(()=>(w?.marks||[]).map(e=>String(e)),[w]),E=M.length?M[M.length-1]:'',P=String(w?.expiry||''),D=(0,c.useDerivativeRead)(e&&E?`/api/derivatives/snapshots?underlying=${encodeURIComponent(e)}&upto=${encodeURIComponent(E)}`:null),F=(0,t.useMemo)(()=>{const e=(D.data?.snapshots||[]).filter(e=>'ok'===e.status&&e.state);return!e.filter(e=>!P||!e.expiry||e.expiry===P).length&&e.length?String(e[0].expiry||''):''},[D.data,P]),R=(0,t.useMemo)(()=>(D.data?.snapshots||[]).filter(e=>'ok'===e.status&&e.state&&(!P||!e.expiry||e.expiry===P)).map(e=>e.state),[D.data,P]),B=(0,t.useMemo)(()=>(0,h.states)({grid:w,pcr:y,maxPain:_,iv:C},{intervalOnly:!0}),[w,y,_,C]),N=(0,t.useMemo)(()=>R.filter(e=>String(e.timestamp)<E),[R,E]),G=(0,t.useMemo)(()=>R.find(e=>
1040String(e.timestamp)===E)||(B[0]?(0,h.chainStep)(N.length?N[N.length-1]:null,B[0]):void 0),[R,E,B,N]),U=(0,t.useMemo)(()=>(0,h.periods)(N.slice().reverse()),[N]),Y=(0,t.useMemo)(()=>B.length?null:(0,h.standing)(j),[B.length,j]),K=Y&&'empty'===v.phase?{phase:'ready',text:''}:v,q=W?U:U.slice(0,6),J=U.slice(q.length).reduce((e,t)=>e+t.count,0);return(0,f.jsx)(u.WidgetFrame,{inline:!0,name:"Signal by reading",subtitle:"The market's current state, and how it got there",body:w,state:K,onRefresh:m.reload,onExpand:S,expanded:k,inBlock:!0,emptyDetail:"A state needs two readings of these contracts before anything can be compared.",toolbar:(0,f.jsxs)(n.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[!!G&&(0,f.jsxs)(n.default,{style:[o.s.row,{gap:5}],children:[(0,f.jsx)(n.default,{style:{width:5,height:5,borderRadius:3,backgroundColor:o.C.green}}),(0,f.jsxs)(o.T,{style:{fontSize:10,lineHeight:14,color:o.C.muted,fontVariant:['tabular-nums']},children:[(0,p.clock)(G.timestamp)," IST"]})]}),(0,f.jsx)(n.default,{style:{flex:1,minWidth:4}}),(0,f.jsx)(u.InfoDisclosure,{label:"How to read this",title:"How to read this",groups:h.SIGNAL_GUIDE})]}),note:void 0,footer:null,style:T,children:(0,f.jsxs)(l.default,{style:{flex:1},contentContainerStyle:{paddingBottom:8},children:[!!Y&&(0,f.jsx)(A,{s:Y}),!!G&&(0,f.jsx)(H,{row:G}),!!U.length&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(n.default,{style:[o.s.row,{gap:7,paddingHorizontal:10,paddingTop:8,paddingBottom:4}],children:[(0,f.jsx)(o.T,{style:u.head,children:"Earlier today"}),(0,f.jsx)(o.T,{style:{fontSize:9.5,lineHeight:13,color:o.C.muted},children:`${U.length} state${1===U.length?'':'s'} before this reading`})]}),q.map(e=>(0,f.jsx)(O,{period:e,open:z,onToggle:L,reduce:$},String(e.to))),J>0&&(0,f.jsx)(r.default,{accessibilityRole:"button",accessibilityLabel:`Show all readings, ${J} more earlier in the session`,onPress:()=>V(!0),style:e=>[{minHeight:44,justifyContent:'center',paddingHorizontal:10,paddingVertical:7,alignItems:'flex-start'},e.hovered?{backgroundColor:'#08161D'}:null],children:(0,f.jsx)(o.T,{style:{fontSize:10.5,lineHeight:14,color:o.C.green},children:`Show all readings (${J} earlier)`})})]}),!!G&&!U.length&&(0,f.jsx)(o.T,{style:{fontSize:11,lineHeight:15,color:'error'===D.phase||F?o.C.amber:o.C.muted,paddingHorizontal:10,paddingTop:8},children:'error'===D.phase?`\u2014 Earlier readings could not be loaded: ${D.error||'the snapshot store did not answer'}.`:F?`\u2014 Earlier readings of this session are stored for another expiry (${F}), so they are not shown against ${P}.`:M.length>1?'\u2014 Earlier readings of this session have not been stored yet.':'This is the first reading of the session, so there is nothing yet to compare it against.'})]})})};var t=_r(d[0]),n=e(_r(d[1])),r=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var o=_r(d[5]),s=_r(d[6]),c=_r(d[7]),u=_r(d[8]),p=_r(d[9]),h=_r(d[10]),f=_r(d[11]);const m=o.s,x='No reading of these ten contracts has been captured yet.',b='Pick an instrument on the left to read how its last fifteen minutes went.',y={up:o.C.green,down:o.C.red,warn:o.C.amber,flat:o.C.muted},_=e=>null==e?o.C.muted:e>0?o.C.green:e<0?o.C.red:o.C.muted,C=e=>null==e?'':e>0?'\u2191 ':e<0?'\u2193 ':'\u2192 ',j=(e,t)=>null==e?p.DASH:`${C(e)}${t(Math.abs(e))}`;function S(e){const t='puts'===e.row||!e.row&&Math.abs(e.put_oi_change||0)>Math.abs(e.call_oi_change||0),n=t?e.put_oi_change:e.call_oi_change,r=null==e.max_pain_current?p.DASH:e.max_pain_change?`${(0,h.strikeOf)(e.max_pain_previous)} \u2192 ${(0,h.strikeOf)(e.max_pain_current)}`:`\u2192 ${(0,h.strikeOf)(e.max_pain_current)}`;return[{label:'Price',value:j(e.price_change,e=>`\u20b9${e.toFixed(2)}`),colour:_(e.price_change),sub:e.price_contract||''},{label:'\u0394 Open interest',value:j(n,e=>(0,p.compact)(e)),colour:_(n),sub:t?'Puts':'Calls'},{label:'\u0394 IV',value:j(e.iv_change,e=>e.toFixed(1)),colour:_(e.iv_change),sub:''},{label:'\u0394 PCR',value:j(e.pcr_change,e=>e.toFixed(2)),colour:_(e.pcr_change),sub:''},{label:'Max pain',value:r,colour:e.max_pain_change?o.C.amber:o.C.muted,sub:''}]}function k({box:e}){return(0,f.jsxs)(n.default,{accessibilityRole:"text",accessibilityLabel:`${e.label} ${e.value}. ${e.sub}`,style:{width:96,flexGrow:1,gap:1,paddingHorizontal:7,paddingVertical:5,borderRadius:7,borderWidth:1,borderColor:o.C.line,backgroundColor:o.C.dark},children:[(0,f.jsx)(o.T,{numberOfLines:1,style:{fontSize:8,lineHeight:11,letterSpacing:.5,textTransform:'uppercase',color:o.C.muted},children:e.label}),(0,f.jsx)(o.T,{numberOfLines:1,style:{fontSize:12.5,lineHeight:16,fontFamily:'InterSemi',color:e.colour,fontVariant:['tabular-nums']},children:e.value}),(0,f.jsx)(o.T,{numberOfLines:2,style:{fontSize:8.5,lineHeight:11,color:o.C.muted},children:e.sub})]})}function T({state:e,big:t}){const r=y[h.STATE_TONE[e]]||o.C.muted;return(0,f.jsx)(n.default,{style:{paddingHorizontal:t?9:6,paddingVertical:t?3:1.5,borderRadius:6,borderWidth:1,borderColor:r,backgroundColor:'flat'===h.STATE_TONE[e]?'transparent':
1040o.C.dark},children:(0,f.jsx)(o.T,{style:{fontSize:t?10.5:9,lineHeight:t?14:12,letterSpacing:.8,textTransform:'uppercase',fontFamily:'InterSemi',color:r},children:h.STATE_LABEL[e]})})}function w({label:e}){const t=/not confirming|unavailable|weak|narrowing/i.test(e);return(0,f.jsx)(n.default,{style:{paddingHorizontal:6,paddingVertical:1.5,borderRadius:5,borderWidth:1,borderColor:t?o.C.amber:o.C.line,backgroundColor:o.C.dark},children:(0,f.jsx)(o.T,{style:{fontSize:9,lineHeight:12,color:t?o.C.amber:o.C.muted},children:e})})}function v({row:e}){return e.key_strikes.length?(0,f.jsxs)(n.default,{style:{gap:3},children:[(0,f.jsx)(o.T,{style:u.head,children:"Key strikes"}),(0,f.jsx)(n.default,{style:[o.s.row,{gap:5,flexWrap:'wrap'}],children:e.key_strikes.map(e=>(0,f.jsxs)(n.default,{accessibilityRole:"text",accessibilityLabel:`${(0,h.strikeOf)(e.strike)} ${e.side}, ${e.note}`,style:[o.s.row,{gap:5,paddingHorizontal:7,paddingVertical:2.5,borderRadius:6,borderWidth:1,borderColor:e.lead?o.C.green:o.C.line,backgroundColor:o.C.dark}],children:[(0,f.jsxs)(o.T,{style:{fontSize:10.5,lineHeight:14,fontFamily:'InterSemi',color:e.lead?o.C.green:o.C.ink,fontVariant:['tabular-nums']},children:[(0,h.strikeOf)(e.strike)," ",e.side]}),(0,f.jsx)(o.T,{style:{fontSize:9,lineHeight:12,color:o.C.muted},children:e.note})]},`${e.strike}-${e.side}`))})]}):null}function H({row:e}){const[l,s]=(0,t.useState)(!1),c=e.previous_timestamp?`${(0,p.clock)(e.previous_timestamp)} \u2192 ${(0,p.clock)(e.timestamp)}`:(0,p.clock)(e.timestamp),u=(0,h.persistenceText)(e),m='balanced'===e.state;return(0,f.jsxs)(n.default,{style:{gap:8,paddingHorizontal:10,paddingVertical:9,borderBottomWidth:1,borderColor:o.C.line,backgroundColor:o.C.dark},children:[(0,f.jsxs)(n.default,{style:[o.s.row,{gap:7,flexWrap:'wrap'}],children:[(0,f.jsx)(T,{state:e.state,big:!0}),(0,f.jsx)(o.T,{style:{fontSize:10.5,lineHeight:14,color:o.C.muted,fontVariant:['tabular-nums']},children:c}),(0,f.jsx)(n.default,{style:{flex:1,minWidth:2}}),!!u&&(0,f.jsx)(o.T,{style:{fontSize:10,lineHeight:14,color:o.C.muted},children:u})]}),(0,f.jsxs)(n.default,{style:{gap:4},children:[(0,f.jsx)(o.T,{style:{fontSize:16,lineHeight:21,fontFamily:'InterSemi',color:o.C.ink,letterSpacing:-.2},children:e.plain_language_read}),!!e.plain_language_evidence&&(0,f.jsx)(o.T,{style:{fontSize:11,lineHeight:16,color:o.C.muted},children:e.plain_language_evidence})]}),!!e.tags.length&&(0,f.jsx)(n.default,{style:[o.s.row,{gap:5,flexWrap:'wrap'}],children:e.tags.map(e=>(0,f.jsx)(w,{label:e},e))}),(0,f.jsx)(v,{row:e}),m&&null==e.price_change&&null==e.call_oi_change?null:(0,f.jsx)(r.default,{accessibilityRole:"button",accessibilityState:{expanded:l},accessibilityLabel:`${S(e).map(e=>`${e.label} ${e.value}`).join(', ')}. ${l?'Hide':'Show'} the levels behind these changes`,onPress:()=>s(e=>!e),style:[o.s.row,{gap:5,flexWrap:'wrap',alignItems:'stretch'}],children:S(e).map(e=>(0,f.jsx)(k,{box:e},e.label))}),l&&(0,f.jsx)($,{row:e})]})}function $({row:e}){const t=[['Premium',null==e.price_level?p.DASH:`\u20b9${e.price_level.toFixed(2)}${e.price_contract?` (${e.price_contract})`:''}`],['Call open interest',null==e.call_oi_level?p.DASH:(0,p.compact)(e.call_oi_level)],['Put open interest',null==e.put_oi_level?p.DASH:(0,p.compact)(e.put_oi_level)],['ATM IV',null==e.iv_level?p.DASH:`${e.iv_level.toFixed(1)}%`],['Call / put IV change',`${null==e.call_iv_change?p.DASH:(0,h.signedNum)(e.call_iv_change)} / ${null==e.put_iv_change?p.DASH:(0,h.signedNum)(e.put_iv_change)} pts`],['PCR',null==e.pcr_current?p.DASH:`${null==e.pcr_previous?'':`${e.pcr_previous.toFixed(2)} \u2192 `}${e.pcr_current.toFixed(2)}`],['Max pain',null==e.max_pain_current?p.DASH:(0,h.strikeOf)(e.max_pain_current)]];return(0,f.jsx)(n.default,{style:{gap:2},children:t.map(([e,t])=>(0,f.jsxs)(n.default,{style:[o.s.row,{gap:8}],children:[(0,f.jsx)(o.T,{style:{width:118,fontSize:10,lineHeight:14,color:o.C.muted},children:e}),(0,f.jsx)(o.T,{style:{flex:1,fontSize:10,lineHeight:14,color:o.C.ink,fontVariant:['tabular-nums']},children:t})]},e))})}function z({row:e}){return(0,f.jsxs)(n.default,{style:{gap:8,paddingHorizontal:10,paddingBottom:9,paddingTop:4,backgroundColor:o.C.dark},children:[!!e.plain_language_evidence&&(0,f.jsx)(o.T,{style:{fontSize:10.5,lineHeight:15,color:o.C.muted},children:e.plain_language_evidence}),'opening'!==e.state&&(0,f.jsx)(n.default,{style:[o.s.row,{gap:5,flexWrap:'wrap',alignItems:'stretch'}],children:S(e).map(e=>(0,f.jsx)(k,{box:e},e.label))}),(0,f.jsx)($,{row:e})]})}function O({period:e,open:t,onToggle:l,reduce:s}){const c=String(e.to||''),u=t===c,m=e.count>1?`${(0,p.clock)(e.from)} \u2192 ${(0,p.clock)(e.to)}`:(0,p.clock)(e.to),x=y[h.STATE_TONE[e.state]]||o.C.muted,b=`${m}. ${h.STATE_LABEL[e.state]}${e.count>1?`, ${e.count} readings${null!=e.minutes?` over ${e.minutes} minutes`:''}`:''}. ${e.read}.`;return(0,f.jsxs)(n.default,{style:{borderBottomWidth:1,borderColor:'#0F1B22'},children:[(0,f.jsxs)(r.default,{accessibilityRole:"button",accessibilityState:{expanded:u},accessibilityLabel:`${b} ${u?'Close':'Open'} the readings behind this period`,onPress:()=>l(c),style:e=>[{minHeight:44,justifyContent:'center',paddingHorizontal:10,paddingVertical:6,gap:2,borderLeftWidth:2,borderLeftColor:u?x:'transparent',backgroundColor:u?o.C.dark:'transparent',...s?{}:{transitionProperty:'background-color',transitionDuration:'160ms'}},e.hovered&&!u?{backgroundColor:'#08161D'}:null],children:[(0,f.jsxs)(n.default,{style:[o.s.row,{gap:7,flexWrap:'wrap'}],children:[(0,f.jsx)(o.T,{style:{width:92,fontSize:10,lineHeight:14,color:o.C.muted,fontVariant:['tabular-nums']},children:m}),(0,f.jsx)(T,{state:e.state}),e.count>1&&(0,f.jsx)(o.T,{style:{fontSize:9,lineHeight:12,color:o.C.muted},children:`${e.count} readings${null!=e.minutes?` \xb7 ${e.minutes} min`:''}`}),(0,f.jsx)(n.default,{style:{flex:1,minWidth:2}}),(0,f.jsx)(o.Icon,{name:u?'chevron-down':'chevron-right',size:11,color:o.C.muted})]}),(0,f.jsx)(o.T,{numberOfLines:u?3:2,style:{fontSize:10.5,lineHeight:14,color:o.C.ink,paddingLeft:99},children:e.read})]}),u&&(0,f.jsxs)(n.default,{children:[e.count>1&&(0,f.jsx)(o.T,{style:{fontSize:9.5,lineHeight:13,color:o.C.muted,paddingHorizontal:10,paddingTop:5},children:"Every reading this period covers, newest first."}),e.readings.slice().reverse().map(e=>(0,f.jsxs)(n.default,{style:{borderTopWidth:1,borderColor:'#0F1B22'},children:[(0,f.jsxs)(n.default,{style:[o.s.row,{gap:7,paddingHorizontal:10,paddingTop:6}],children:[(0,f.jsx)(o.T,{style:{width:92,fontSize:10,lineHeight:14,color:o.C.muted,fontVariant:['tabular-nums']},children:(0,p.clock)(e.timestamp)}),(0,f.jsx)(o.T,{style:{flex:1,fontSize:10.5,lineHeight:14,color:o.C.ink},children:e.plain_language_read})]}),(0,f.jsx)(z,{row:e})]},String(e.timestamp)))]})]})}function A({s:e}){const t=[['Spot',(0,p.level)(e.spot,e.is_index,2,0)],['At the money',(0,h.strikeOf)(e.atm)],['Put/call OI',null==e.pcr?p.DASH:e.pcr.toFixed(2)],['Max pain',(0,h.strikeOf)(e.max_pain)]];return(0,f.jsxs)(n.default,{style:{gap:9,paddingHorizontal:10,paddingVertical:10,backgroundColor:o.C.dark},children:[(0,f.jsxs)(n.default,{style:[m.row,{gap:7,flexWrap:'wrap'}],children:[(0,f.jsx)(T,{state:"opening",big:!0}),(0,f.jsx)(o.T,{style:{fontSize:10.5,lineHeight:14,color:o.C.muted,fontVariant:['tabular-nums']},children:(0,p.clock)(e.at)})]}),!!e.opening&&(0,f.jsx)(o.T,{style:{fontSize:16,lineHeight:21,fontFamily:'InterSemi',color:o.C.ink,letterSpacing:-.2},children:e.opening}),(0,f.jsx)(n.default,{style:[m.row,{gap:5,flexWrap:'wrap',alignItems:'stretch'}],children:t.map(([e,t])=>(0,f.jsxs)(n.default,{style:{width:96,flexGrow:1,gap:1,paddingHorizontal:7,paddingVertical:5,borderRadius:7,borderWidth:1,borderColor:o.C.line,backgroundColor:o.C.bg},children:[(0,f.jsx)(o.T,{style:{fontSize:8,lineHeight:11,letterSpacing:.5,textTransform:'uppercase',color:o.C.muted},children:e}),(0,f.jsx)(o.T,{style:{fontSize:12.5,lineHeight:16,fontFamily:'InterSemi',color:o.C.ink,fontVariant:['tabular-nums']},children:t})]},e))})]})}},947,[11,13,375,278,136,821,948,920,924,926,951,6]); 1041__d(function(g,r,i,a,m,_e,d){"use strict";
1041Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"toMs",{enumerable:!0,get:function(){return v}}),_e.useReducedMotion=function(){const[e,n]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{{const e=globalThis.matchMedia?.('(prefers-reduced-motion: reduce)');if(!e)return;n(!!e.matches);const t=e=>n(!!e.matches);return e.addEventListener?.('change',t),()=>e.removeEventListener?.('change',t)}},[]),e},_e.useFalconScan=function(){const[e,n]=(0,t.useState)('idle'),[w,S]=(0,t.useState)(null),[b,I]=(0,t.useState)(null),[k,y]=(0,t.useState)(!1),[C,D]=(0,t.useState)(''),[M,T]=(0,t.useState)(()=>(0,u.initPace)(Date.now())),[P,R]=(0,t.useState)(Date.now()),[_,A]=(0,t.useState)(()=>!!(0,s.readStore)(o,l).completedOnce),[E,L]=(0,t.useState)(!1),O=(0,t.useRef)(0),F=(0,t.useRef)(null),j=(0,t.useRef)(M),N=(0,t.useRef)(!1),$=(0,t.useRef)(0);F.current=w,j.current=M,N.current=E;const q=(0,t.useCallback)(e=>{const t={...(0,s.readStore)(o,l),...e};!e.runningId&&'runningId'in e&&delete t.runningId,(0,s.writeStore)(o,l,t)},[]),x=(0,t.useCallback)((e,t)=>{let s=0;const u=async()=>{if(t===O.current)try{const o=await c.falconApi.get(e);if(t!==O.current)return;if(s=0,S(o),'running'===o.status)return void setTimeout(u,f);if(q({runningId:void 0}),'cancelled'===o.status)return O.current++,S(null),void n('idle');if('failed'===o.status){const e=o.stages.find(e=>'failed'===e.status);D(o.error||(e?`${e.title} failed on the server.`:'The scan failed on the server.'))}}catch(e){if(t!==O.current)return;if(404===e?.status)return q({runningId:void 0}),O.current++,D('This scan is no longer on the server.'),void n('error');if(++s>=p)return D(e?.message?`Lost contact with the scan: ${e.message}`:'Lost contact with the scan.'),void n('error');setTimeout(u,800)}};u()},[q]),z=(0,t.useCallback)((e,t,s)=>{const c=++O.current;$.current=s,S(e),D(''),L(!1);const o=Date.now();T((0,u.initPace)(o,s)),R(o),n('scanning'),x(t,c)},[x]),B=(0,t.useCallback)(async()=>{const e=++O.current;D(''),L(!1),S(null);const t=Date.now();$.current=t,T((0,u.initPace)(t)),R(t),n('scanning');try{const{id:n}=await c.falconApi.start();if(e!==O.current)return void c.falconApi.cancel(n).catch(()=>{});if(!n)throw new Error('The server did not return a scan id.');q({runningId:n}),O.current--,z(null,n,t)}catch(t){if(e!==O.current)return;D(t?.message?`Falcon could not start a scan: ${t.message}`:'Falcon could not start a scan.'),n('error')}},[z,q]),G=(0,t.useCallback)(()=>{const e=F.current?.id||(0,s.readStore)(o,l).runningId;O.current++,q({runningId:void 0}),S(null),L(!1),n('idle'),e&&c.falconApi.cancel(e).catch(()=>{})},[q]),H=(0,t.useCallback)(()=>{b?.result&&(O.current++,S(b),n('results'))},[b]),J=(0,t.useCallback)(()=>{O.current++,D(''),n('idle')},[]);(0,t.useEffect)(()=>{let e=!0;c.falconApi.latest().then(t=>{e&&I(t?.result?t:null)}).catch(()=>{}).finally(()=>{e&&y(!0)});const t=(0,s.readStore)(o,l).runningId;return t&&c.falconApi.get(t).then(n=>{if(e)if('running'===n.status){const e=v(n.started_at);z(n,t,Number.isFinite(e)?Math.min(e,Date.now()):Date.now())}else q({runningId:void 0})}).catch(()=>{e&&q({runningId:void 0})}),()=>{e=!1,O.current++}},[]),(0,t.useEffect)(()=>{if('scanning'!==e)return;const t=setInterval(()=>{const e=Date.now(),t=F.current;if(R(e),!t)return;const s=N.current?(0,u.skipPace)(j.current,t.stages,e):(0,u.stepPace)(j.current,t.stages,e);s!==j.current&&(j.current=s,T(s)),'failed'!==t.status?'done'===t.status&&((0,u.paceComplete)(s,t.stages)||N.current&&t.result)&&(O.current++,n(t.result?'results':'error'),t.result||D('The scan finished without results.'),t.result&&(I(t),A(!0),q({completedOnce:!0,runningId:void 0}))):n('error')},h);return()=>clearInterval(t)},[e,q]);const K='scanning'===e?Math.max(0,P-$.current):0;return{phase:e,job:w,latest:b,latestLoaded:k,error:C,pace:M,now:P,elapsedMs:K,completedOnce:_,skip:E,start:B,cancel:G,retry:B,rescan:B,viewResults:H,backToIdle:J,requestSkip:()=>L(!0)}};var e,t=r(d[0]),n=r(d[1]);(e=n)&&e.__esModule;r(d[2]);var s=r(d[3]),c=r(d[4]),u=r(d[5]);const o='falcon',l='home',f=400,h=100,p=8,v=e=>{if(null==e||''===e)return NaN;const t='number'==typeof e?e:Date.parse(e);return'number'==typeof e&&t<1e12?1e3*t:t}},948,[11,265,136,869,949,950]); 1042__d(function(g,_r,i,a,m,e,_d){"use strict";
1042Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"falconApi",{enumerable:!0,get:function(){return c}}),_r(_d[0]),_r(_d[1]);var t=_r(_d[2]);async function n(n,c){const o={};{const n=await(0,t.api)('/api/auth/me').catch(()=>null);n?.csrf&&(o['X-Kanida-CSRF']=n.csrf)}const r=new AbortController,s=setTimeout(()=>r.abort(),15e3);try{const s=await fetch(t.apiBase+n,{method:c,signal:r.signal,credentials:'include',headers:o}),l=await s.json().catch(()=>({}));if(!s.ok)throw new t.ApiError(l.error||'Unable to reach KANIDA',s.status,l.code||'REQUEST_FAILED');return l}finally{clearTimeout(s)}}const c={start:async()=>(0,t.api)('/api/falcon/scan',{}),get:async n=>(0,t.api)(`/api/falcon/scan/${encodeURIComponent(n)}`),cancel:async t=>n(`/api/falcon/scan/${encodeURIComponent(t)}`,'DELETE'),latest:async()=>{const n=await(0,t.api)('/api/falcon/latest');return n&&'object'==typeof n&&Array.isArray(n.stages)?n:n?.job&&Array.isArray(n.job.stages)?n.job:null}}},949,[136,201,197]); 1043__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TARGET_MS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"DWELL_MS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_DWELL_MS",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"isTerminal",{enumerable:!0,get:function(){return o}}),e.initPace=function(n,t=n){return{shown:0,since:n,start:Math.min(t,n)}},e.dwellFor=s,e.stepPace=u,e.skipPace=function(n,t,i){let o=n;for(let n=0;n<t.length;n++){const n=u(o,t,i,!0);if(n===o)break;o=n}return o},e.shownStatus=function(n,t,i){const o=t[i]?.status??'waiting';return i<n.shown?o:i===n.shown?'failed'===o?'failed':'waiting'===o?'waiting':'running':'waiting'},Object.defineProperty(e,"paceComplete",{enumerable:!0,get:function(){return c}}),e.paceProgress=function(n,t,i){const o=t.length;if(!o)return 0;if(n.shown>=o)return 1;const u='waiting'!==t[n.shown]?.status?Math.min(.85,(i-n.since)/Math.max(1,s(n,o,i))):0;return Math.min(1,(n.shown+u)/o)};const n=3e4,t=2500,i=450,o=n=>'done'===n||'unavailable'===n||'failed'===n;function s(o,s,u){const c=Math.max(1,s-o.shown),f=n-(u-o.start);return Math.max(i,Math.min(t,f/c))}function u(n,t,i,u=!1){const c=t.length;if(n.shown>=c)return n;const f=t[n.shown];return f&&o(f.status)?'failed'===f.status?n:u?{...n,shown:n.shown+1,since:i}:i-n.since<s(n,c,i)?n:{...n,shown:n.shown+1,since:i}:n}const c=(n,t)=>t.length>0&&n.shown>=t.length},950,[]); 1044__d(function(g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STATE_LABEL",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"STATE_TONE",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"signedPct",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"signedLots",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"signedMoney",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"signedNum",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"strikeOf",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"priceText",{enumerable:!0,get:function(){return e.price}}),_e.persistenceText=function(t){return t.persistence_evidence_available&&t.persistence_since?`Since ${(0,e.clock)(t.persistence_since)}`:''},Object.defineProperty(_e,"ENGINE_VERSION",{enumerable:!0,get:function(){return $}}),_e.states=function(i,o={}){const c=i.grid,u=(0,t.observe)(c);if(!u.length)return[];const h=r(i.pcr?.points),p=r(i.maxPain?.points),b=r(i.iv?.points),y=Array.from(new Set((c?.rows||[]).map(e=>a(e.strike)).filter(e=>null!=e))).sort((e,t)=>e-t),E=a(c?.atm_strike),M=e=>{if(null==E||!e.length)return'';const t=Math.min(...e),n=Math.max(...e);return t===n&&t===E?'at ATM':t>=E&&n>E?'above ATM':n<=E&&t<E?'below ATM':'around ATM'},N=(t,n)=>{const i=t.slice().sort((e,t)=>e-t);return i.length?1===i.length?`${(0,e.strike)(i[0])} ${n}`:`${(0,e.strike)(i[0])}\u2013${(0,e.strike)(i[i.length-1])} ${n}`:''};return u.map((t,i)=>{const r=s(t.at),c=s(t.previous_at),E=i>0?u[i-1]:null,O=t.calls_interval,I=t.puts_interval,P=t.ladder||[],S=_(P,'calls'),A=_(P,'puts'),C=!t.previous_at,T=t.calls.weight,D=t.puts.weight,R=0===T&&0===D?null:D>T?'puts':'calls',L='puts'===R?t.puts:'calls'===R?t.calls:null,j=('puts'===R?t.calls:t.puts,e=>f.indexOf(e)>=0),B=T>0&&D>0&&Math.max(T,D)<=1.25*Math.min(T,D)&&j(t.calls.behaviour)!==j(t.puts.behaviour),U=k(L||('quiet'!==t.calls.state?t.calls:t.puts),B&&!!L&&'not_observed'!==L.state&&'no_baseline'!==L.state),G=C?null:v(O,I,P,y),H=(o.intervalOnly||'no_baseline'===U)&&!C,F=!!(O&&O.total||I&&I.total),V=C?'opening':H?G?G.state:F?'balanced':'not_observed':U,q=!H&&!C&&!!L&&L.scans>=2&&!!L.first_at,W=H?G?G.row:null:R,X=H?G?G.side:null:L?L.side:null,Y=H?G?G.behaviour:'none':L?L.behaviour:'none',z=H?G?G.strikes.slice():[]:L?L.str
1044ikes.slice():[],Q=H?G?G.lead:null:L?L.lead:null,J=z.length>1&&y.indexOf(z[z.length-1])-y.indexOf(z[0])===z.length-1,K=E&&E.previous_at?v(E.calls_interval,E.puts_interval,E.ladder||[],y):null,Z=E?'puts'===W?E.puts:E.calls:null,ee=!!Z&&'no_baseline'!==Z.state&&'not_observed'!==Z.state,te=H?K&&K.row===W?K.strikes.length:null:ee?Z.strikes.length:null,ne=z.length,ie=null==te||!ne&&!te?'none':ne>te?'wider':ne<te?'narrower':'same',ae='puts'===W?A||S:S||A,se=ae?a(ae.price_change):null,re=ae?a(ae.price_level):null,le=null!=re&&null!=se?re-se:null,oe=le&&0!==le&&null!=se?l(se/Math.abs(le)*100,0):null,ce=O&&O.total?a(O.total.change):null,ue=I&&I.total?a(I.total.change):null,de=e=>P.filter(t=>t.row===e).reduce((e,t)=>{const n=a(t.oi_level);return null==n?e:(e||0)+n},null),he=b.get(r),ge=b.get(c),pe=he?a(he.iv_pct):null,be=ge?a(ge.iv_pct):null,me=null!=pe&&null!=be?l(pe-be,1):null,ve=he?a(he.ce_iv_pct):null,fe=he?a(he.pe_iv_pct):null,ke=ge?a(ge.ce_iv_pct):null,we=ge?a(ge.pe_iv_pct):null,$e=h.get(r),ye=h.get(c),xe=$e?a($e.pcr_oi):null,Ee=ye?a(ye.pcr_oi):null,Me=p.get(r),Ne=p.get(c),Oe=Me?a(Me.max_pain_strike):null,Ie=Ne?a(Ne.max_pain_strike):null,Pe=e=>P.filter(t=>t.row===e&&('added'===t.status||'reduced'===t.status)&&Math.abs(a(t.oi_added)||0)>0),Se=(e,t,n)=>null==t?'not_measured':Pe(e).length?n&&j(n)?'reducing':t>0?'building':t<0?'reducing':'quiet':'quiet',Ae=C?'opening':Se('calls',ce,O?.behaviour),Ce=C?'opening':Se('puts',ue,I?.behaviour),Te=e=>{const t=Pe(e),n=t.reduce((e,t)=>e+(a(t.price_change)||0),0),i=t.reduce((e,t)=>e+Math.abs(a(t.price_level)||0),0);return t.length?i>0&&Math.abs(n)<.01*i?'with prices little changed':n<0?'while prices declined':n>0?'while prices rose':'with prices unchanged':''},De=(t,n,i)=>{const s=Pe(t);if(null==n||!s.length||0===n)return'';const r='puts'===t?'PE':'CE',l='puts'===t?'Put':'Call',o=s.slice().sort((e,t)=>Math.abs(a(t.oi_added)||0)-Math.abs(a(e.oi_added)||0))[0];return`${l} OI ${n>0?'rose':'fell'} ${(0,e.compact)(Math.abs(n))} across ${N(s.map(e=>e.strike),r)} `+`${Te(t)}`.trim()+(i&&o?`; ${(0,e.strike)(o.strike)} ${r} leads`:'')},Re=[],Le=[],je='puts'===W?ue:ce,Be='puts'===W?ce:ue,Ue='puts'===W?'calls':'puts',Ge=['appeared','building','held','strengthened','broadened','concentrated','shifted','slowed','reversing','mixed'].indexOf(V)>=0;if(W&&Ge){const e=De(W,je,!0);e&&Re.push({text:e+'.'});if(null!=Be&&null!=je&&Math.abs(Be)>=.25*Math.abs(je)){const e=De(Ue,Be,!1);e&&Re.push({text:e+'.'})}else null!=je&&Re.push({text:('puts'===Ue?'Put':'Call')+" activity changed only marginally."});null!=me&&Math.abs(me)<.2&&Le.push({text:'IV was unchanged.'}),'narrower'===ie&&Le.push({text:`Activity narrowed to ${ne} strike${1===ne?'':'s'} from ${te}.`})}const He=null!=je&&(null==Be||Math.abs(je)>1.25*Math.abs(Be)),Fe=!!W&&/declined|rose/.test(Te(W)),Ve='mixed'!==V&&W&&He&&Fe?m(W,Y):null,qe='puts'===Ue?Ce:Ae,We=[];Ge&&('wider'===ie?We.push('Broader activity'):'narrower'===ie&&We.push('Narrowing'),null!=je&&null!=Be&&Math.abs(je)>1.5*Math.abs(Be)?We.push(('puts'===W?'Puts':'Calls')+" stronger"):null!=je&&null!=Be&&Math.abs(Be)>Math.abs(je)&&We.push(('puts'===Ue?'Puts':'Calls')+" larger"),null!=me&&Math.abs(me)<.2&&We.push('IV not confirming'));const Xe=W&&Ge?Pe(W).sort((e,t)=>Math.abs(a(t.oi_added)||0)-Math.abs(a(e.oi_added)||0)).slice(0,4).map((e,t)=>({strike:e.strike,side:e.side,lead:0===t,note:0===t?'Highest activity':e.joined?'New activity':'reduced'===e.status?'Reducing':'Building'})):[],Ye=e=>P.filter(t=>t.row===e&&null!=a(t.oi_level)&&a(t.oi_level)>0).sort((e,t)=>a(t.oi_level)-a(e.oi_level)).slice(0,3).map(e=>e.strike),ze=C?Ye('calls'):[],Qe=C?Ye('puts'):[],Je='puts'===W?'Put':'Call',Ke=Ve||`${Je} activity`,Ze=M(z),et=Z&&ee?Z.lead:null,tt=L&&L.joined||[],nt=Z&&ee?Z.strikes:[],it=tt.length&&nt.length?Math.min(...tt)>Math.max(...nt)?'higher':Math.max(...tt)<Math.min(...nt)?'lower':'more':'more';let at='';switch(V){case'opening':{const e=[];ze.length&&e.push(`Calls concentrated around ${N(ze,'CE')}`),Qe.length&&e.push(`${ze.length?'puts':'Puts'} around ${N(Qe,'PE')}`),at=e.join('; ')||'Opening read';break}case'building':at=`${Ke} building ${Ze}`;break;case'appeared':at=`${Ke} appears ${Ze}`;break;case'held':at=`${Ke} holding ${Ze}`;break;case'strengthened':at=`${Ke} strengthens ${Ze}`;break;case'broadened':at=`${Ke} broadens into ${it} strikes`;break;case'concentrated':at=`${Ke} narrows to ${N(z,X||'')}`;break;case'shifted':at=null!=et&&null!=Q?`Leading ${Je.toLowerCase()} activity shifts from ${(0,e.strike)(et)} to ${(0,e.strike)(Q)} ${X||''}`:`Leading ${Je.toLowerCase()} activity shifts strike`;break;case'slowed':at=`${Ke} losing momentum ${Ze}`;break;
1044case'fading':at=`Earlier ${(Ve||`${Je} activity`).toLowerCase()} is fading`;break;case'reversing':at=`${Je} positions being reduced ${Ze}`;break;case'mixed':at=`Call positions ${'reducing'===Ae?'reducing':'building'} while put positions `+('reducing'===Ce?'reduce':'build');break;case'balanced':at='No material change in market structure';break;case'not_observed':at='No comparable values captured at this reading';break;default:at=''}at=at.replace(/\s+/g,' ').trim();const st=Re.map(e=>e.text.replace(/\.$/,'')).join('. ')+(Re.length?'.':''),rt=n[V],lt=q&&!!L;return{timestamp:t.at,previous_timestamp:t.previous_at,current_timestamp:t.at,interval_minutes:x(t.previous_at,t.at),state:V,state_change:rt,market_state:V,call_state:Ae,put_state:Ce,side:X,row:W,location:Ze,strike_range:C?ze:z,strike_cluster:C?ze:z,leading_strike:Q,persistence_since:lt?L.first_at:null,persistence_minutes:lt?L.elapsed_minutes:null,consecutive_readings:lt?L.scans:0,persistence_known:lt,persistence_evidence_available:lt,persistence_status:lt?'established':'none',breadth_previous:te,breadth_current:ne,breadth_direction:ie,breadth:w(ne,J),price_change:l(se),price_change_pct:oe,price_level:l(re),price_contract:ae?`${(0,e.strike)(ae.strike)} ${ae.side}`:'',call_oi_change:ce,put_oi_change:ue,call_oi_level:de('calls'),put_oi_level:de('puts'),call_iv_change:null!=ve&&null!=ke?l(ve-ke,1):null,put_iv_change:null!=fe&&null!=we?l(fe-we,1):null,iv_change:me,iv_level:pe,iv_reason:String(he?.reason_text||''),pcr_previous:l(Ee),pcr_current:l(xe),pcr_change:null!=xe&&null!=Ee?l(xe-Ee):null,max_pain_previous:Ie,max_pain_current:Oe,max_pain_change:null!=Oe&&null!=Ie?Oe-Ie:null,supporting_evidence:Re,conflicting_evidence:Le,opposing_side_state:qe,regime:Ve,tags:We.slice(0,3),key_strikes:Xe,plain_language_read:at,plain_language_detail:st,plain_language_headline:at,plain_language_evidence:st,behaviour:Y,weight:Math.abs(je||0),engine_version:$,rules_version:e.SIGNAL_RULE_VERSION,covered:t.covered}}).reverse()},_e.chainStep=E,_e.chainSession=function(e){const t=[];for(const n of e)t.push(E(t.length?t[t.length-1]:null,n));return t},_e.periods=function(e){const t=e.slice().reverse(),i=[];for(const e of t){const t=i[i.length-1];t&&t.state===e.state&&t.readings[0].row===e.row?(t.readings.push(e),t.to=e.timestamp,t.count+=1,t.read=e.plain_language_read,t.detail=e.plain_language_detail):i.push({from:e.previous_timestamp||e.timestamp,to:e.timestamp,minutes:null,readings:[e],state:e.state,label:n[e.state],read:e.plain_language_read,detail:e.plain_language_detail,count:1,latest:!1})}for(const e of i)e.minutes=x(e.from,e.to);const a=i.reverse();a.length&&(a[0].latest=!0);return a},Object.defineProperty(_e,"SIGNAL_GUIDE",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"STANDING_CAVEAT",{enumerable:!0,get:function(){return N}}),_e.standing=O,_e.openingSnapshot=function(t,i){const a=O(t);if(!a||!a.opening)return null;const s=null;return{timestamp:i,previous_timestamp:s,current_timestamp:i,interval_minutes:s,state:'opening',state_change:n.opening,market_state:'opening',call_state:'opening',put_state:'opening',side:a.open_calls.length?'CE':'PE',row:a.open_calls.length?'calls':'puts',location:'',strike_range:a.open_calls.slice(),strike_cluster:a.open_calls.slice(),leading_strike:s,persistence_since:s,persistence_minutes:s,consecutive_readings:0,persistence_known:!1,persistence_evidence_available:!1,persistence_status:'none',breadth_previous:s,breadth_current:0,breadth_direction:'none',breadth:'none',price_change:s,price_change_pct:s,price_level:s,price_contract:'',call_oi_change:s,put_oi_change:s,call_oi_level:a.total_ce_oi,put_oi_level:a.total_pe_oi,call_iv_change:s,put_iv_change:s,iv_change:s,iv_level:s,iv_reason:'',pcr_previous:s,pcr_current:a.pcr,pcr_change:s,max_pain_previous:s,max_pain_current:a.max_pain,max_pain_change:s,supporting_evidence:[],conflicting_evidence:[],opposing_side_state:'opening',regime:s,tags:[],key_strikes:[],plain_language_read:a.opening,plain_language_detail:'',plain_language_headline:a.opening,plain_language_evidence:'',behaviour:'none',weight:0,engine_version:$,rules_version:e.SIGNAL_RULE_VERSION,covered:!0}};var e=_r(d[0]),t=_r(d[1]);const n={opening:'Opening read',appeared:'Appeared',building:'Building',held:'Held',strengthened:'Strengthened',broadened:'Broadened',concentrated:'Concentrated',shifted:'Shifted',slowed:'Slowed',fading:'Fading',reversing:'Reversing',balanced:'Balanced',mixed:'Mixed',not_observed:'Not observed',no_baseline:'No baseline yet'},i={opening:'flat',appeared:'up',building:'up',held:'up',strengthened:'up',broadened:'up',concentrated:'warn',shifted:'warn',slowed:'warn',fading:'warn',reversing:'down',balanced:'flat',mixed:'flat',not_observed:'warn',no_baseline:'flat'},a=e=>
1044{if(null==e||''===e)return null;const t='number'==typeof e?e:Number(e);return Number.isFinite(t)?t:null},s=e=>String(e||'').slice(0,16),r=e=>{const t=new Map;for(const n of e||[])n&&n.at&&t.set(s(n.at),n);return t},l=(e,t=2)=>null==e?null:Math.round(e*10**t)/10**t,o=t=>null==t?e.DASH:`${t>0?'+':t<0?e.MINUS:''}${Math.abs(t).toFixed(0)}%`,c=t=>null==t?e.DASH:`${t>0?'+':t<0?e.MINUS:''}${(0,e.compact)(Math.abs(t))}`,u=t=>null==t?e.DASH:`${t>0?'+':t<0?e.MINUS:''}${e.RUPEE}${Math.abs(t).toLocaleString('en-IN',{minimumFractionDigits:2,maximumFractionDigits:2})}`,h=(t,n=1)=>null==t?e.DASH:`${t>0?'+':t<0?e.MINUS:''}${Math.abs(t).toFixed(n)}`,p=t=>null==t?e.DASH:(0,e.strike)(t);function _(e,t){let n=null;for(const i of e)i.row===t&&'not_captured'!==i.status&&(!n||Math.abs(a(i.oi_added)||0)>Math.abs(a(n.oi_added)||0))&&(n=i);return n&&Math.abs(a(n.oi_added)||0)>0?n:null}const b={buying:'Long build-up',writing:'Writing',short_covering:'Short covering',buyers_exiting:'Buyers exiting'},m=(e,t)=>{const n=b[t];return n&&e?`${'puts'===e?'Put':'Call'} ${n.toLowerCase()}`:null};function v(e,n,i,s){const r=((e,n)=>{const i=e&&t.DIRECTIONAL.indexOf(e.behaviour)>=0?e.weight:0,a=n&&t.DIRECTIONAL.indexOf(n.behaviour)>=0?n.weight:0;return i<=0&&a<=0?null:a>i?n:e})(e,n);if(!r)return null;const l=e&&t.DIRECTIONAL.indexOf(e.behaviour)>=0?e.weight:0,o=n&&t.DIRECTIONAL.indexOf(n.behaviour)>=0?n.weight:0,c=l>0&&o>0&&Math.max(l,o)<=1.25*Math.min(l,o)&&f.indexOf(e.behaviour)>=0!=f.indexOf(n.behaviour)>=0,u=r.row,h=r.side,p=i.filter(e=>e.row===u&&('added'===e.status||'reduced'===e.status)&&Math.abs(a(e.oi_added)||0)>0);if(!p.length)return null;const _=p.map(e=>e.strike).sort((e,t)=>e-t),b=p.reduce((e,t)=>Math.abs(a(t.oi_added)||0)>Math.abs(a(e.oi_added)||0)?t:e,p[0]).strike,m=c?'mixed':f.indexOf(r.behaviour)>=0?'reversing':'building';return{row:u,side:h,behaviour:r.behaviour,state:m,strikes:_,lead:b,both:c}}const f=['short_covering','buyers_exiting'];function k(e,t){if(!e)return'no_baseline';if('no_baseline'===e.state)return'no_baseline';if('not_observed'===e.state)return'not_observed';if(t)return'mixed';switch(e.state){case'appeared':return'appeared';case'continued':return e.scans<=2?'building':'held';case'strengthened':return'strengthened';case'broadened':return'broadened';case'narrowed':return'concentrated';case'shifted':return'shifted';case'slowed':return'slowed';case'faded':return'fading';case'unwound':return'reversing';default:return'balanced'}}const w=(e,t)=>e<=0?'none':1===e?'isolated':t?'clustered':'dispersed';const $='pane/3.3 2026-09-21';const y=['building','appeared','held','strengthened','broadened','concentrated','shifted','slowed','reversing'],x=(e,t)=>{const n=e=>{const t=String(e||'').match(/(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})/);return t?Date.UTC(+t[1],+t[2]-1,+t[3],+t[4],+t[5])/6e4:null},i=n(e),a=n(t);return null==i||null==a?null:a-i};function E(i,a){const s={...a,persistence_since:null,persistence_minutes:null,consecutive_readings:0,persistence_known:!1,persistence_evidence_available:!1,persistence_status:'none'};if(!i||'opening'===a.state||'not_observed'===a.state||'mixed'===a.state)return s;const r=e=>y.indexOf(e.state)>=0,l=e=>'reversing'===e.state||f.indexOf(e.behaviour)>=0,o=e=>'puts'===e.row?'Put':'Call',c=e=>e.regime||`${o(e)} activity`,u=(e,t)=>{s.state=e,s.state_change=n[e],s.market_state=e,s.plain_language_read=t.replace(/\s+/g,' ').trim(),s.plain_language_headline=s.plain_language_read};if('balanced'===a.state)return r(i)&&!l(i)&&u('fading',`Earlier ${c(i).toLowerCase()} is fading`),s;if(!r(a))return s;const h=!i.regime||!a.regime||i.regime===a.regime,p=r(i)&&i.row===a.row&&l(i)===l(a)&&h;if(i.row===a.row&&r(i)){const e=i.strike_range||[];s.key_strikes=(a.key_strikes||[]).map(t=>({...t,note:t.lead?'Highest activity':e.indexOf(t.strike)<0?'New activity':'New activity'===t.note?l(a)?'Reducing':'Building':t.note}))}const _=a.side||'';if(!p)return l(a)?u('reversing',`${o(a)} positions being reduced ${a.location}`):'opening'!==i.state&&u('appeared',`${c(a)} appears ${a.location}`),s;const b=i.persistence_since||i.timestamp;if(s.persistence_since=b,s.persistence_minutes=x(b,a.timestamp),s.consecutive_readings=(i.consecutive_readings||1)+1,s.persistence_known=!0,s.persistence_evidence_available=!0,s.persistence_status='established',l(a))return u('reversing',`${o(a)} positions still being reduced ${a.location}`),s.breadth_previous=(i.strike_range||[]).length,s.breadth_current=(a.strike_range||[]).length,s;const m=i.strike_range||[],v=a.strike_range||[],k=v.filter(e=>m.indexOf(e)<0),w=m.filter(e=>v.indexOf(e)<0);s.breadth_previous=m.length,s.breadth_current=v.length,s.breadth_direction=v.length>
1044m.length?'wider':v.length<m.length?'narrower':'same',s.tags=s.tags.filter(e=>'Broader activity'!==e&&'Narrowing'!==e),'wider'===s.breadth_direction&&(s.tags=['Broader activity',...s.tags].slice(0,3)),'narrower'===s.breadth_direction&&(s.tags=['Narrowing',...s.tags].slice(0,3));const $=c(a);if(k.length&&!w.length){u('broadened',`${$} broadens into ${Math.min(...k)>Math.max(...m)?'higher':Math.max(...k)<Math.min(...m)?'lower':'more'} strikes`)}else w.length&&!k.length?u('concentrated',`${$} narrows to ${(t=>{const n=t.slice().sort((e,t)=>e-t);return n.length?1===n.length?`${(0,e.strike)(n[0])} ${_}`:`${(0,e.strike)(n[0])}\u2013${(0,e.strike)(n[n.length-1])} ${_}`:''})(v)}`):null!=i.leading_strike&&null!=a.leading_strike&&i.leading_strike!==a.leading_strike?u('shifted',`Leading ${o(a).toLowerCase()} activity shifts from ${(0,e.strike)(i.leading_strike)} to ${(0,e.strike)(a.leading_strike)} ${_}`):i.weight>0&&a.weight>i.weight*t.PACE_UP?u('strengthened',`${$} strengthens ${a.location}`):i.weight>0&&a.weight<i.weight*t.PACE_DOWN?u('slowed',`${$} losing momentum ${a.location}`):u('held',`${$} holding ${a.location}`);return s}const M=[{heading:'What this pane is',lines:["The latest reading, and the states the session moved through before it. Every change is measured against the reading fifteen minutes before it (the session's first reading, until fifteen minutes have passed), and both ends of that interval are named.",'It describes what the option book DID. It is not a recommendation and it names no buyer or seller.']},{heading:'The state words',lines:["OPENING READ \u2014 the first reading of the session: where call and put open interest are concentrated near the money. There is no earlier reading, so nothing is said about change.","BUILDING \u2014 positions are being added on the side the reading is about. APPEARED \u2014 the behaviour was not there at the reading before. HELD \u2014 the same behaviour, continuing (the headline says holding).","STRENGTHENED \xb7 SLOWED \u2014 the same behaviour, moving faster or slower than the interval before (the headline says losing momentum).",'BROADENED \xb7 CONCENTRATED \u2014 more strikes joined, or the set narrowed.','SHIFTED \u2014 the strike carrying the largest change moved.','FADING \u2014 it stopped registering. REVERSING \u2014 positions are being closed rather than opened.',"BALANCED \u2014 no material change in market structure. MIXED \u2014 one side opening positions while the other closes them, at a comparable scale. Both sides adding positions is not MIXED: the headline names the larger side and the evidence names both.","NOT OBSERVED \u2014 the reading was taken but carried no comparable value. That is an absence of measurement, not a quiet market."]},{heading:'Persistence',lines:["\"Since 10:30\" appears once the same behaviour has held across more than one comparable reading. Until then there is no persistence to report, and none is shown.",'It is time between two stamps, never a score: readings at 09:30, 09:45 and 10:00 are THIRTY minutes.',"Early in the session each state is read from the latest fifteen minutes; persistence joins it once the behaviour has repeated."]},{heading:'The colours',lines:['GREEN \u2014 increasing, building, expanding.','RED \u2014 decreasing, weakening, contracting.','GREY \u2014 unchanged or stable.','AMBER \u2014 slowing, or evidence that conflicts or is missing.',{text:"No colour here is a view on direction. Rising call open interest is shown as an increase because it IS one \u2014 it is not painted as good news.",tone:'amber'}]},{heading:'The five metrics',lines:["PRICE is the premium of the single contract that moved most this interval \u2014 a real, tradeable instrument. Five strikes added together are not one, so their sum is never shown as a price.",'\u0394 OPEN INTEREST is the change across the five at-the-money contracts of the side carrying the reading.',"\u0394 IV is at-the-money volatility in POINTS. It is solved from premium and spot rather than reported by the exchange; where it could not be solved the box says so instead of showing a zero.",'\u0394 PCR is put open interest against call open interest, across the whole book.',"MAX PAIN is the listed strike at which the total intrinsic payout owed to option holders at expiry would be smallest, from the open interest at this reading. A flat bottom is a range of strikes, not a point. Context, not a target (nor a pin or a forecast), and the weakest of the five."]},{heading:'Evidence and conflict',lines:["A behaviour \u2014 writing, long build-up, covering \u2014 is an INTERPRETATION of open interest and premium read together. It is never shown without what contradicts it or fails to confirm it.",{text:"Open interest and premium cannot identify who initiated a trade: every contract opened has a buyer and a seller. The underlying\u2019s own move affects every premium, so a falling premium is not by itself evidence of anything.",tone
1044:'amber'}]},{heading:'Quiet periods',lines:["Consecutive readings in the same state are shown as ONE period with the number of readings it covers. Nothing is deleted \u2014 open the period, or use \"Show all readings\", to see each one.",'A quiet session is allowed to look quiet. The pane will not invent activity to fill itself.']}],N="These are levels at one reading. Open interest says where positions sit, not who opened them or why.";function O(t,n=3){const i=Array.isArray(t?.rows)?t.rows:[];if(!i.length)return null;const s=a(t?.spot),r=i.map(e=>a(e.strike)).filter(e=>null!=e),o=null!=s&&r.length?r.reduce((e,t)=>Math.abs(t-s)<Math.abs(e-s)?t:e,r[0]):null,c=a(t?.total_ce_oi),u=a(t?.total_pe_oi),h=(e,t)=>i.map(t=>({strike:a(t.strike),oi:a(t[e])})).filter(e=>null!=e.strike&&null!=e.oi&&e.oi>0).sort((e,t)=>t.oi-e.oi).slice(0,n).map(e=>({...e,share:t?l(e.oi/t*100,0):null,distance:null==s?null:l(e.strike-s,2)})),p=h('ce_oi',c),_=h('pe_oi',u);if(!p.length&&!_.length)return null;const b=e=>i.map(t=>({strike:a(t.strike),change:a(t[e])})).filter(e=>null!=e.strike&&null!=e.change&&e.change>0).sort((e,t)=>t.change-e.change).slice(0,1),m=b('ce_oi_change_day'),v=b('pe_oi_change_day'),f=c&&null!=u?l(u/c,2):null,k=a(t?.max_pain_strike),w=null!=k&&null!=s?l(k-s,2):null,$=e=>`${Math.abs(e).toLocaleString('en-IN',{maximumFractionDigits:2})} points`,y=(0,e.isIndexUnderlying)(t?.underlying),x=p[0],E=_[0],M=x&&E?`Call open interest is heaviest at ${(0,e.strike)(x.strike)} CE, put open interest at ${(0,e.strike)(E.strike)} PE`:x?`Call open interest is heaviest at ${(0,e.strike)(x.strike)} CE`:`Put open interest is heaviest at ${(0,e.strike)(E.strike)} PE`,O=[];if(null!=s&&x&&E){const t=x.strike>=s&&E.strike<=s;O.push(t?`Spot ${(0,e.level)(s,y,2,0)} sits between them: ${$(x.strike-s)} below the heaviest call strike and ${$(s-E.strike)} above the heaviest put strike.`:`Spot is ${(0,e.level)(s,y,2,0)}; the heaviest call strike is `+(x.strike>=s?`${$(x.strike-s)} above`:`${$(s-x.strike)} below`)+" it and the heaviest put strike "+(E.strike<=s?`${$(s-E.strike)} below`:`${$(E.strike-s)} above`)+" it.")}const I=[];if(null!=f&&I.push(`the put/call open-interest ratio is ${f.toFixed(2)} for this expiry`),null!=k&&I.push(`max pain is ${(0,e.strike)(k)}${null==w?'':0===w?', at spot':`, ${$(w)} ${w>0?'above':'below'} spot`}`),I.length&&O.push(I.join('; ').replace(/^./,e=>e.toUpperCase())+'.'),m.length||v.length){const t=[];m.length&&t.push(`call open interest was added most at ${(0,e.strike)(m[0].strike)} CE (+${(0,e.compact)(m[0].change)})`),v.length&&t.push(`put open interest at ${(0,e.strike)(v[0].strike)} PE (+${(0,e.compact)(v[0].change)})`),O.push(`Since the previous session's close, ${t.join(' and ')}.`)}const P=r.slice().sort((e,t)=>e-t),S=null==o?-1:P.indexOf(o),A=e=>{if(S<0)return[];const t='ce_oi'===e?P.slice(S,S+5):P.slice(Math.max(0,S-4),S+1);return i.filter(n=>t.indexOf(a(n.strike))>=0&&null!=a(n[e])&&a(n[e])>0).sort((t,n)=>a(n[e])-a(t[e])).slice(0,3).map(e=>a(e.strike)).sort((e,t)=>e-t)},C=A('ce_oi'),T=A('pe_oi'),D=(t,n)=>t.length?1===t.length?`${(0,e.strike)(t[0])} ${n}`:`${(0,e.strike)(t[0])}\u2013${(0,e.strike)(t[t.length-1])} ${n}`:'';return{opening:[C.length?`Calls concentrated around ${D(C,'CE')}`:'',T.length?`${C.length?'puts':'Puts'} around ${D(T,'PE')}`:''].filter(Boolean).join('; '),open_calls:C,open_puts:T,at:t?.as_of||null,expiry:t?.expiry||null,days_to_expiry:a(t?.days_to_expiry),spot:s,atm:o,is_index:y,calls:p,puts:_,total_ce_oi:c,total_pe_oi:u,pcr:f,max_pain:k,max_pain_distance:w,day_calls:m,day_puts:v,headline:M,lines:O,caveat:N}}},951,[926,952]); 1045__d(function(g,_r,_i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DIRECTIONAL",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PACE_UP",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"PACE_DOWN",{enumerable:!0,get:function(){return s}}),e.behaviourOf=l,e.observe=function(o,c,h=t.SIGNAL_WINDOW_MINUTES,p=t.SIGNAL_WINDOW_MAX_MINUTES){const f=(o?.rows||[]).filter(t=>t&&t.present);if(!f.length)return[];const b=f.filter(t=>'puts'!==t.row),k=f.filter(t=>'puts'===t.row),v=Math.max(0,...f.map(t=>(t.points||[]).length));if(!v)return[];const _=Array.from({length:v},(t,n)=>f.map(t=>t.points?.[n]?.at).find(Boolean)||null),m=(0,t.readingMinutes)(c),$=null==m?v-1:_.reduce((n,i,r)=>{const s=(0,t.readingMinutes)(i);return null!=s&&s<=m?r:n},-1);if($<0)return[];const w={calls:{peak:0,pricePeak:0,ranked:0},puts:{peak:0,pricePeak:0,ranked:0}},S={calls:{peak:0,pricePeak:0,ranked:0},puts:{peak:0,pricePeak:0,ranked:0}},I={calls:null,puts:null},M={calls:null,puts:null},x=[];for(let y=0;y<=$;y++){const O=_[y],N=(0,t.signalBaselineIndex)(_,y,h,p),T=null==N?null:_[N],P=null==N?null:((0,t.readingMinutes)(O)??0)-((0,t.readingMinutes)(T)??0),E=[],C=(o,c,h,p)=>{const f={...p};let b=null,k=null;if(null!=N){const n=(0,t.signalSide)(o,y,N,c,f.peak,f.pricePeak,f.ranked);b=n?n.change:null,k=n?n.price_change:null}const v=null==b?f.peak:Math.max(f.peak,Math.abs(b)),_=null==k?f.pricePeak:Math.max(f.pricePeak,Math.abs(k)),m=f.ranked+(null==b?0:1),$=(0,t.signalSide)(o,y,N,c,v,_,m);p.peak=v,p.pricePeak=_,p.ranked=m;let w=0;const S=o.map(i=>{const r=null==N?null:(0,t.signalSide)([i],y,N,c,v,_,m);r&&(w+=1);const s=r?l(c,r.price_direction,r.oi_direction):'none';return{strike:a(i.strike),label:i.label||'',side:c,row:h,oi_change:r?r.change:null,price_change:r?r.price_change:null,oi_direction:r?r.oi_direction:t.NO_DIRECTION,price_direction:r?r.price_direction:t.NO_DIRECTION,what_label:r?r.what_label:'',meaning:r?r.meaning:'',behaviour:s,directional:n.indexOf(s)>=0}});E.push(...S);const x=u(S),T=S.filter(t=>t.directional&&t.behaviour===x.behaviour&&null!=t.strike),P=T.reduce((t,n)=>!t||Math.abs(a(n.oi_change)||0)>Math.abs(a(t.oi_change)||0)?n:t,null),C=T.reduce((t,n)=>t+Math.abs(a(n.oi_change)||0),0),j=M[h],A=j?x.strikes.filter(t=>
1045j.strikes.indexOf(t)<0):[],D=j?j.strikes.filter(t=>x.strikes.indexOf(t)<0):[],L=w>0;let R,F=I[h];if(null==N)R='no_baseline';else if(L)if('none'===x.behaviour)R=F?'faded':'quiet',F=null;else if(F&&F.behaviour===x.behaviour){const t=A.length>0&&0===D.length,n=D.length>0&&0===A.length,i=P&&null!=F.lead&&null!=P.strike&&P.strike!==F.lead;R=t?'broadened':n?'narrowed':i?'shifted':F.weight>0&&C>F.weight*r?'strengthened':F.weight>0&&C<F.weight*s?'slowed':'continued',F={behaviour:F.behaviour,first:F.first,last:O,scans:F.scans+1,strikes:x.strikes,lead:P?P.strike:F.lead,weight:C,leadStable:F.leadStable&&(!P||null==P.strike||P.strike===F.lead)}}else R=F&&i.indexOf(x.behaviour)>=0&&n.indexOf(F.behaviour)>=0&&i.indexOf(F.behaviour)<0?'unwound':'appeared',F={behaviour:x.behaviour,first:O,last:O,scans:1,strikes:x.strikes,lead:P?P.strike:null,weight:C,leadStable:!0};else R='not_observed';I[h]=F;const U=F?F.first:null,q=(0,t.readingMinutes)(U),W=(0,t.readingMinutes)(F?F.last:O),B=F&&null!=q&&null!=W?W-q:null,G={side:c,row:h,behaviour:x.behaviour,strikes:x.strikes,lead:P?P.strike:null,lead_oi_change:P?P.oi_change:null,lead_price_change:P?P.price_change:null,joined:A,left:D,weight:C,total:$,state:R,lead_stable:!!F&&F.leadStable,first_at:U,last_confirmed_at:F?F.last:null,elapsed_minutes:B,scans:F?F.scans:0,measured:w,slots:o.length};return M[h]=G,G},j=C(b,'CE','calls',w.calls),A=C(k,'PE','puts',w.puts),D=(0,t.intervalIndex)(_,y),L=(n,i,r)=>{if(null==D)return null;const s=(0,t.signalSide)(n,y,D,i,r.peak,r.pricePeak,r.ranked),a=s?s.change:null,l=s?s.price_change:null;return r.peak=null==a?r.peak:Math.max(r.peak,Math.abs(a)),r.pricePeak=null==l?r.pricePeak:Math.max(r.pricePeak,Math.abs(l)),r.ranked+=null==a?0:1,(0,t.signalSide)(n,y,D,i,r.peak,r.pricePeak,r.ranked)},R=L(b,'CE',S.calls),F=L(k,'PE',S.puts),U=(t,n,i)=>t?{side:n,row:i,behaviour:l(n,t.price_direction,t.oi_direction),strikes:[],lead:null,lead_oi_change:t.change,lead_price_change:t.price_change,joined:[],left:[],weight:Math.abs(a(t.change)||0),lead_stable:!1,total:t,state:'continued',first_at:null,last_confirmed_at:null,elapsed_minutes:null,scans:0,measured:t.contracts,slots:q(i)}:null;function q(t){return'puts'===t?k.length:b.length}const W=(n,i,r,s,l)=>{const o=a(n.strike),u=null==D?null:(0,t.signalSide)([n],y,D,i,s.peak,s.pricePeak,s.ranked),c=n.points?.[y],h=null==(c&&null!=c.delta_oi?a(c.delta_oi):null)?'not_captured':null==u?'no_change':'building'===u.oi_direction?'added':'unwinding'===u.oi_direction?'reduced':'no_change';return{strike:null==o?0:o,side:i,row:r,oi_added:u?u.change:null,price_change:u?u.price_change:null,oi_level:c&&null!=c.oi?a(c.oi):null,price_level:c&&null!=c.price?a(c.price):null,status:h,joined:null!=o&&l.joined.indexOf(o)>=0,since:null!=o&&l.strikes.indexOf(o)>=0?l.first_at:null}},B=[...b.map(t=>W(t,'CE','calls',S.calls,j)),...k.map(t=>W(t,'PE','puts',S.puts,A))].filter(t=>t.strike>0);x.push({at:O,from:T,window_minutes:P,previous_at:null==D?null:_[D],covered:j.measured>0||A.measured>0,calls:j,puts:A,calls_interval:U(R,'CE','calls'),puts_interval:U(F,'PE','puts'),strikes:E,ladder:B,rule_version:t.SIGNAL_RULE_VERSION})}return x},e.whereText=c,e.minutesText=f,Object.defineProperty(e,"CAVEAT",{enumerable:!0,get:function(){return m}}),e.narrate=function(n,r={}){if(!n)return null;const s={headline:'',window:'',observed:'',qualified:'',session:'',otherSide:'',context:'',cross:[],evidence:[],caveat:m,cited:[],ladder:n.ladder||[],limited:!0},a=n.calls.weight>=n.puts.weight?n.calls:n.puts,l=a===n.calls?n.puts:n.calls,u=h[a.row],p=r.ladder&&r.ladder.length?r.ladder:o(n.strikes.filter(t=>t.row===a.row).map(t=>t.strike)),M=$(n);if('no_baseline'===a.state)return{...s,window:M,headline:_.no_baseline('',0,!1),observed:`This session does not yet hold a reading ${t.SIGNAL_WINDOW_MINUTES} minutes before ${(0,t.clock)(n.at)} IST, so no change can be measured at ${r.underlying||'this instrument'}.`,evidence:[w(n)],context:`Reading ${(0,t.clock)(n.at)} IST \xb7 no comparison available`};if('not_observed'===a.state)return{...s,window:M,headline:_.not_observed('',0,!1),observed:`The ${(0,t.clock)(n.at)} IST reading was taken, but none of the ten contracts carried a value that could be compared, so nothing is claimed for this interval.`,session:a.first_at?`Last confirmed ${(0,t.clock)(a.first_at)}\u2013${(0,t.clock)(a.last_confirmed_at||a.first_at)} IST. An interval nobody observed is not counted as time the earlier activity continued.`:'',evidence:[S(n),w(n)],context:`Reading ${(0,t.clock)(n.at)} IST \xb7 not observed`};
1045if('none'===a.behaviour&&'none'===l.behaviour){const i='faded'===a.state;return{...s,limited:!1,window:M,headline:i?_.faded(u,0,!1):_.quiet('',0,!1),observed:i?`No strike moved open interest and premium together between ${(0,t.clock)(n.previous_at)} and ${(0,t.clock)(n.at)} IST. The outstanding open interest from earlier is still standing; that is a total, not evidence that the same positions are still held.`:`No strike changed materially between ${(0,t.clock)(n.previous_at)} and ${(0,t.clock)(n.at)} IST. The outstanding open interest is unchanged, which is a total rather than a statement about whose positions remain.`,cross:r.cross||[],evidence:[S(n),w(n)],context:`${M} \xb7 little fresh change`}}const x='broadened'===a.state?a.joined.length:'narrowed'===a.state?a.strikes.length:0,y=i.indexOf(a.behaviour)>=0,O=(_[a.state]||_.continued)(u,x,y),N=c(a.strikes,a.side,p),T='buying'===a.behaviour||'short_covering'===a.behaviour,P=i.indexOf(a.behaviour)>=0?'fell':'rose',E=[`Open interest ${P} and premium ${T?'rose':'fell'} ${N}, measured against the ${(0,t.clock)(n.previous_at||n.from)} IST reading.`];'broadened'===a.state&&a.joined.length?E.push(`${a.joined.map(n=>(0,t.strike)(n)).join(' and ')} ${a.side} `+(1===a.joined.length?'is new':'are new')+" this interval."):'narrowed'===a.state&&a.left.length?E.push(`${a.left.map(n=>(0,t.strike)(n)).join(' and ')} ${a.side} stopped changing this interval.`):'shifted'===a.state&&E.push(`${(0,t.strike)(a.lead)} ${a.side} now carries the largest change.`);const C=E.join(' '),j=I(a.behaviour,a.row,r.spot||null),A=f(a.elapsed_minutes),D=`${u} positions began changing at ${(0,t.clock)(a.first_at)} IST`,L=null==a.lead?'':a.lead_stable?` ${(0,t.strike)(a.lead)} ${a.side} has carried the largest change at every reading since.`:` ${(0,t.strike)(a.lead)} ${a.side} carries the largest change at this reading; the leading strike has changed during the episode.`,R=`${D}${A?`, ${A} ago`:''}.${L}`,F='none'===l.behaviour?`${h[l.row]} strikes did not change materially this interval.`:`${h[l.row]} strikes separately show open interest `+(i.indexOf(l.behaviour)>=0?'falling':'rising')+" "+`${c(l.strikes,l.side,o(n.strikes.filter(t=>t.row===l.row).map(t=>t.strike)))}.`,U=[`First seen ${(0,t.clock)(a.first_at)} IST`];A?U.push(`${A} so far`):U.push('first reading of this episode');null!=a.lead&&U.push(`${(0,t.strike)(a.lead)} ${a.side} largest`);const q=[w(n),...a.strikes.map(i=>{const r=n.strikes.find(t=>t.strike===i&&t.row===a.row);return r?`${(0,t.strike)(i)} ${a.side}: open interest ${k(r.oi_change)}, premium ${b(r.price_change)} over the episode window. The \u0394OI tile labels this \u201c${r.what_label}\u201d.`:''}).filter(Boolean),r.spot&&null!=r.spot.change?`Spot moved ${r.spot.change>0?'+':t.MINUS}${v(r.spot.change)} over the same interval.`:'The underlying\u2019s own move over this interval was not captured.',S(n),`Strike behaviour is read from the ten at-the-money contracts the \u0394OI tiles draw, under rule ${n.rule_version}.`];return{headline:O,window:M,observed:C,qualified:j,session:R,otherSide:F,context:U.join(' \xb7 '),cross:r.cross||[],evidence:q,caveat:m,cited:a.strikes.slice(),ladder:n.ladder||[],limited:!1}},e.phrases=function(t){return t?[t.observed,t.qualified,t.otherSide,t.session].filter(Boolean).flatMap(t=>String(t).split(/(?<=\.)\s+/).map(t=>t.trim()).filter(Boolean)):[]},e.spotMove=function(t,n){const{now:i,prev:r}=M(t,n),s=i?a(i.spot):null,l=r?a(r.spot):null;return null==i?null:{at:String(i.at||''),from:r?String(r.at||''):null,spot:s,change:null==s||null==l?null:Math.round(100*(s-l))/100}},e.crossMarket=function(t){const n=[];if(t.puts){const r=t.puts;n.push({label:'Puts',text:'none'===r.behaviour?'Little change at the put strikes this interval.':`Open interest ${i.indexOf(r.behaviour)>=0?'fell':'rose'} at ${r.strikes.length} put strike${1===r.strikes.length?'':'s'} this interval.`})}const r=M(t.pcr,t.upto);if(r.now&&r.prev){const t=a(r.now.pcr_oi),i=a(r.prev.pcr_oi),s=a(r.now.total_ce_oi),l=a(r.prev.total_ce_oi),o=a(r.
1045now.total_pe_oi),u=a(r.prev.total_pe_oi);if(null!=t&&null!=i){const r=t>i?'rose':t<i?'fell':'was unchanged';let a='';if(null!=s&&null!=l&&null!=o&&null!=u){const t=s-l,n=o-u;a=Math.abs(t)>Math.abs(n)?` \u2014 driven by call open interest ${t>=0?'rising':'falling'}, not the put side.`:` \u2014 driven by put open interest ${n>=0?'rising':'falling'}.`}n.push({label:'PCR',text:`${t.toFixed(2)}, ${r} from ${i.toFixed(2)}${a}`})}}const s=M(t.futures,t.upto);if(s.now){const t=a(s.now.oi),i=s.prev?a(s.prev.oi):null,r=a(s.now.basis),l=s.prev?a(s.prev.basis):null,o=[];null!=t&&null!=i&&o.push("open interest "+(t>i?'rose':t<i?'fell':'was flat')),null!=r&&null!=l&&o.push("basis "+(Math.abs(r)>Math.abs(l)?'widened':Math.abs(r)<Math.abs(l)?'narrowed':'held')),o.length&&n.push({label:'Futures',text:`Front contract ${o.join(' and ')} this interval.`})}return n};var t=_r(d[0]);const n=['buying','writing','short_covering','buyers_exiting'],i=['short_covering','buyers_exiting'],r=1.25,s=.75,a=t=>{if(null==t||''===t)return null;const n='number'==typeof t?t:Number(t);return Number.isFinite(n)?n:null};function l(n,i,r){const s=String(i||''),a=String(r||'');return s!==t.NO_DIRECTION&&a!==t.NO_DIRECTION&&s&&a?'building'===a?'up'===s?'buying':'down'===s?'writing':'positions_added':'unwinding'===a?'up'===s?'short_covering':'down'===s?'buyers_exiting':'positions_closing':'flat'===s?'quiet':'price_only':'none'}const o=t=>Array.from(new Set(t.filter(t=>null!=t))).sort((t,n)=>t-n);function u(t){const n=new Map;for(const i of t){if(!i.directional)continue;const t=n.get(i.behaviour)||{n:0,weight:0,strikes:[]};t.n+=1,t.weight+=Math.abs(a(i.oi_change)||0),t.strikes.push(i.strike),n.set(i.behaviour,t)}if(!n.size)return{behaviour:'none',strikes:[]};const i=[...n.entries()].sort((t,n)=>n[1].n-t[1].n||n[1].weight-t[1].weight);return i.length>1&&i[0][1].n===i[1][1].n&&i[0][1].weight===i[1][1].weight?{behaviour:'none',strikes:[]}:{behaviour:i[0][0],strikes:o(i[0][1].strikes)}}function c(n,i,r=[]){const s=o(n);if(!s.length)return'';if(1===s.length)return`at ${(0,t.strike)(s[0])} ${i}`;const a=o(r.length?r:s),l=a.indexOf(s[0]),u=a.indexOf(s[s.length-1]);if(l>=0&&u>=0&&u-l===s.length-1)return`across ${(0,t.strike)(s[0])}\u2013${(0,t.strike)(s[s.length-1])} ${i}`;return`at ${s.slice(0,-1).map(n=>(0,t.strike)(n)).join(', ')} and ${(0,t.strike)(s[s.length-1])} ${i}`}const h={calls:'Call',puts:'Put'},p={buying:'long build-up',writing:'writing',short_covering:'short covering',buyers_exiting:'buyers closing out',positions_added:'positions added',positions_closing:'positions closed',price_only:'a premium move',quiet:'little change',none:'no clear behaviour'};function f(t){if(null==t||t<=0)return'';if(t<60)return`${t} minutes`;const n=Math.floor(t/60),i=t%60;return`${n} hour${1===n?'':'s'}${i?` ${i} minutes`:''}`}const b=n=>{const i=a(n);return null==i?t.DASH:`${i>0?'+':i<0?t.MINUS:''}${t.RUPEE}${Math.abs(i).toLocaleString('en-IN',{minimumFractionDigits:2,maximumFractionDigits:2})}`},k=n=>{const i=a(n);return null==i?t.DASH:`${i>0?'+':i<0?t.MINUS:''}${(0,t.compact)(Math.abs(i))}`},v=n=>{const i=a(n);return null==i?t.DASH:`${Math.abs(i).toLocaleString('en-IN',{maximumFractionDigits:0})} points`},_={appeared:(t,n,i)=>`${t} positions begin ${i?'reducing':'building'}`,continued:(t,n,i)=>`${t} positions keep ${i?'reducing':'building'} at the same strikes`,strengthened:(t,n,i)=>`${t} position ${i?'reduction':'building'} picks up`,slowed:(t,n,i)=>`${t} position ${i?'reduction':'building'} slows`,broadened:(t,n,i)=>`${t} positions ${i?'reduce':'build'} at ${1===n?'another strike':`${n} more strikes`}`,narrowed:(t,n,i)=>`${t} position ${i?'reduction':'building'} narrows to ${1===n?'one strike':`${n} strikes`}`,shifted:t=>`The largest ${t.toLowerCase()} change moves to another strike`,unwound:t=>`Earlier ${t.toLowerCase()} positions are being reduced`,faded:t=>`No further ${t.toLowerCase()} position change this interval`,quiet:()=>'No material change at this reading',not_observed:()=>'This reading carried no comparable value',no_baseline:()=>'Not enough readings yet to compare'},m="Position and premium changes are observations. Naming a behaviour such as writing or long build-up is an interpretation of them, not a measurement: every contract opened has a buyer and a seller, the underlying\u2019s own move affects every premium, and nothing here is a forecast or a trade instruction.";function $(n){return n.previous_at?`${(0,t.clock)(n.previous_at)} \u2192 ${(0,t.clock)(n.at)} IST`:`${(0,t.clock)(n.at)} IST`}function w(n){return(n.previous_at?`Interval ${(0,t.clock)(n.previous_at)} \u2192 ${(0,t.clock)(n.at)} IST.`:`Reading ${(0,t.clock)(n.at)} IST has no reading before it.`)+(n.from?` Episode measured against ${(0,t.clock)(n.from)} IST, ${n.window_minutes} minutes back (rule ${n.rule_version}).`:'')}function S(t){return`Measured at this reading \u2014 calls ${t.calls.measured} of ${t.calls.slots} contracts, puts ${t.puts.measured} of ${t.puts.slots}.`}function I(t,i,r){if(n.indexOf(t)<0)return'';const s=p[t];if(!r||null==r.change)return`Consistent with ${'puts'===i?'put':'call'} ${s}, though the underlying\u2019s own move over this interval was not captured, so the premium change cannot be separated from it.`;const a=r.change>0?'rose':r.change<0?'fell':'was unchanged';return 0===r.change?`Consistent with ${'puts'===i?'put':'call'} ${s}; spot was unchanged over the interval, so the premium move is not explained by the underlying.`:`Consistent with ${'puts'===i?'put':'call'} ${s}, though spot also ${a} ${v(r.change)} over the same interval, which may explain some of the premium change.`}const M=(n,i)=>{const r=(n||[]).filter(t=>t&&t.at),s=(0,t.readingMinutes)(i),a=null==s?r:r.filter(n=>{const i=(0,t.readingMinutes)(String(n.at));return null!=i&&i<=s});return{now:a[a.length-1]||null,prev:a[a.length-2]||null}}},952,[926]); 1046__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";
1046function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SIGNAL_W",{enumerable:!0,get:function(){return y.SIGNAL_W}}),Object.defineProperty(_e,"SUMMARY_EMPTY",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"SUMMARY_NO_SYMBOL",{enumerable:!0,get:function(){return C}}),_e.SummaryPanel=function({symbol:e,expiry:n,read:o,pcr:a,futures:y,highlight:S,onHighlight:v,onTarget:_,standing:$,style:z,onExpand:W,expanded:A}){const R=o.data,F=e?(0,c.stateOf)(o,R?.not_enough_marks||j):{phase:'empty',text:C},I=(0,h.useReducedMotion)(),[O,N]=(0,t.useState)(!1),[L,P]=(0,t.useState)(!1),E=I||O,D=(0,t.useMemo)(()=>(0,p.observe)(R),[R]),B=D.length?D[D.length-1]:null,V=(0,t.useMemo)(()=>!B||'no_baseline'===B.calls.state&&'no_baseline'===B.puts.state?(0,f.standing)($):null,[B,$]),G=V&&'empty'===F.phase?{phase:'ready',text:''}:F,Y=(0,t.useMemo)(()=>{if(!B||D.length<2)return'A second reading is needed before anything can be said about change.';const e=String(D[0]?.at||'').match(/([0-9]{2}):([0-9]{2})/);if(!e)return'The fifteen-minute change is in the middle pane; this pane compares across the hour.';const t=60*Number(e[1])+Number(e[2])+u.SIGNAL_WINDOW_MINUTES;return`The fifteen-minute change is in the middle pane; this pane compares across the hour, from ${`${String(Math.floor(t/60)).padStart(2,'0')}:${String(t%60).padStart(2,'0')}`} IST.`},[B,D]),q=(0,t.useMemo)(()=>Array.from(new Set((R?.rows||[]).map(e=>e.strike).filter(e=>null!=e))).sort((e,t)=>e-t),[R]),Q=(0,t.useMemo)(()=>(0,p.spotMove)(y?.points||null,B?.at),[y,B]),U=(0,t.useMemo)(()=>(0,p.crossMarket)({puts:B?B.puts:null,pcr:a?.points||null,futures:y?.points||null,upto:B?.at}),[B,a,y]),K=(0,t.useMemo)(()=>(0,p.narrate)(B,{underlying:R?.underlying||e,expiry:R?.expiry||n,ladder:q,spot:Q,cross:U}),[B,R,e,n,q,Q,U]),J=(0,t.useMemo)(()=>(0,p.phrases)(K),[K]),X=(0,t.useMemo)(()=>K?[K.headline,K.observed,K.qualified,K.otherSide,K.session,K.context].filter(Boolean).join(' '):'',[K]),Z=`${R?.underlying||e}|${R?.expiry||n||''}|${B?.at||''}`,[ee,te]=(0,t.useState)(0),[ne,ie]=(0,t.useState)(0),re=(0,t.useRef)([]),se=(0,t.useRef)(0),oe=(0,t.useRef)(''),ae=(0,t.useCallback)(()=>{re.current.forEach(clearTimeout),re.current=[],se.current&&(cancelAnimationFrame(se.current),se.current=0)},[]),le=(0,t.useCallback)(()=>{ae(),te(J.length),ie(1)},[ae,J.length]),de=(0,t.useCallback)(()=>{ae(),!E&&J.length?(te(0),ie(0),J.forEach((e,t)=>re.current.push(setTimeout(()=>te(t+1),t*w))),re.current.push(setTimeout(()=>{const e=Date.now(),t=()=>{const n=Math.min(1,(Date.now()-e)/k);ie(n),se.current=n<1?requestAnimationFrame(t):0};se.current=requestAnimationFrame(t),re.current.push(setTimeout(()=>{se.current&&(cancelAnimationFrame(se.current),se.current=0),ie(1)},700))},J.length*w))):le()},[J,E,le,ae]);(0,t.useEffect)(()=>{if(ae(),!K||!J.length)return te(0),ie(0),void(oe.current=Z);oe.current!==Z?(oe.current=Z,E?le():de()):le()},[Z,J.length,E]),(0,t.useEffect)(()=>()=>ae(),[ae]),(0,t.useEffect)(()=>{E&&le()},[E,le]);const he=!!J.length&&ee<J.length,ce=B&&B.puts.weight>B.calls.weight?'puts':'calls',ue=K?[{heading:'Why KANIDA says this',lines:K.evidence},{heading:'What this is and is not',lines:[{text:K.caveat,tone:'amber'}]},{heading:'Where the numbers come from',lines:[R?.flow_text||'',R?.delta_oi_text||'']}]:[{heading:'What this is and is not',lines:[{text:p.CAVEAT,tone:'amber'}]}];return(0,x.jsx)(c.WidgetFrame,{inline:!0,name:"What is happening",subtitle:e?`${e}${R?.expiry?` \xb7 ${R.expiry}`:''} \xb7 read from the ten at-the-money contracts`:'',body:R,state:G,onRefresh:o.reload,onExpand:W,expanded:A,inBlock:!0,emptyDetail:"Each sentence needs two readings of these contracts before anything can be compared.",toolbar:(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)(i.default,{style:[l.s.row,{gap:6,rowGap:20,flexWrap:'wrap'}],children:[!!K&&!K.limited&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:"Replay the explanation",onPress:de,disabled:he,hitSlop:b,style:e=>[l.s.row,{gap:5,minHeight:24,paddingHorizontal:8,borderRadius:6,borderWidth:1,borderColor:l.C.line,opacity:he?.5:1,backgroundColor:e.hovered||e.focused?l.C.soft:'transparent'}],children:[(0,x.jsx)(m.HitArea,{slop:b}),(0,x.jsx)(l.Icon,{name:"refresh-cw",size:11,color:l.C.green}),(0,x.jsx)(l.T,{style:{fontSize:10,lineHeight:14,color:l.C.green},children:"Replay"})]}),(0,x.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:"Skip the reveal and show the whole explanation",onPress:le,disabled:!he,hitSlop:b,style:e=>[l.s.row,{gap:5,minHeight:24,paddingHorizontal:8,borderRadius:6,borderWidth:1,borderColor:l.C.line,opacity:he?1:.5,backgroundColor:e.hovered||e.focused?l.C.soft:'transparent'}],children:[(0,x.jsx)(m.HitArea,{slop:b}),(0,x.jsx)(l.T,{style:{fontSize:10,lineHeight:14,color:l.C.ink},children:"Skip"})]}),(0,x.jsxs)(r.default,{accessibilityRole:"button",accessibilityState:{checked:O},accessibilityLabel:"Quiet motion. Show the whole explanation without a reveal",onPress:()=>N(e=>!e),hitSlop:b,style:e=>[l.s.row,{gap:5,minHeight:24,paddingHorizontal:8,borderRadius:6,borderWidth:1,borderColor:O?l.C.green:l.C.line,backgroundColor:O||e.hovered?l.C.soft:'transparent'}],children:[(0,x.jsx)(m.HitArea,{slop:b}),(0,x.jsx)(l.T,{style:{fontSize:10,lineHeight:14,color:O?l.C.green:l.C.muted}
1046,children:"Quiet"})]})]}),(0,x.jsx)(i.default,{style:{flex:1,minWidth:4}}),(0,x.jsx)(c.InfoDisclosure,{label:"Why this?",title:"Why KANIDA says this",groups:ue})]})}),note:K&&!K.limited?`Rule ${B?.rule_version||''} \xb7 ${(0,u.asOfText)(R?.as_of)}`:void 0,style:z,children:(0,x.jsx)(s.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:9},children:V?(0,x.jsx)(M,{s:V,after:Y}):K?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(i.default,{style:{gap:2},children:[(0,x.jsxs)(l.T,{style:c.head,children:["Latest change \xb7 ",K.window]}),(0,x.jsx)(l.T,{role:"heading","aria-level":3,style:{fontFamily:'ManropeBold',fontSize:16,lineHeight:22,letterSpacing:-.2,color:K.limited?l.C.muted:l.C.ink},children:K.headline}),!K.limited&&(0,x.jsx)(T,{width:Math.min(190,Math.max(60,3.4*K.headline.length)),progress:ne})]}),(0,x.jsx)(i.default,{accessibilityRole:"text",accessibilityLabel:X,...(0,d.webOnly)({'aria-label':X}),style:{gap:6},children:J.map((e,t)=>(0,x.jsx)(l.T,{...(0,d.webOnly)({'aria-hidden':!0}),style:{fontSize:12,lineHeight:18,color:0===t?l.C.ink:l.C.muted,opacity:t<ee?1:.12,transitionProperty:'opacity',transitionDuration:'240ms'},children:e},t))}),!K.limited&&(0,x.jsx)(i.default,{style:{paddingTop:7,borderTopWidth:1,borderColor:l.C.line},children:(0,x.jsx)(H,{rungs:K.ladder.filter(e=>e.row===ce),spot:Q?Q.spot:null,window:K.window,highlight:S,onHighlight:v,onTarget:_,slotOf:e=>(R?.rows||[]).find(t=>t.strike===e&&t.row===ce)||null})}),!!K.context&&(0,x.jsxs)(i.default,{style:[l.s.row,{gap:6,flexWrap:'wrap',paddingTop:7,borderTopWidth:1,borderColor:l.C.line}],children:[(0,x.jsx)(l.Icon,{name:"clock",size:11,color:l.C.green}),(0,x.jsx)(l.T,{style:{flex:1,minWidth:120,fontSize:11,lineHeight:16,color:l.C.green,fontVariant:['tabular-nums']},children:K.context})]}),!!K.cross.length&&(0,x.jsxs)(i.default,{style:{gap:3,paddingTop:7,borderTopWidth:1,borderColor:l.C.line},children:[(0,x.jsxs)(l.T,{style:c.head,children:["Cross-market context \xb7 ",K.window]}),K.cross.map(e=>(0,x.jsxs)(i.default,{style:[l.s.row,{gap:7,alignItems:'flex-start'}],children:[(0,x.jsx)(l.T,{style:{width:52,fontSize:10,lineHeight:15,color:l.C.muted},children:e.label}),(0,x.jsx)(l.T,{style:{flex:1,minWidth:0,fontSize:11,lineHeight:15,color:l.C.ink},children:e.text})]},e.label))]}),!K.limited&&(0,x.jsxs)(i.default,{style:{paddingTop:7,borderTopWidth:1,borderColor:l.C.line},children:[(0,x.jsxs)(r.default,{accessibilityRole:"button",accessibilityState:{expanded:L},accessibilityLabel:(L?'Hide':'Show')+" how this episode developed through the session",onPress:()=>P(e=>!e),style:e=>[l.s.row,{gap:6,minHeight:44,borderRadius:6,paddingHorizontal:4,backgroundColor:e.hovered||e.focused?l.C.soft:'transparent'}],children:[(0,x.jsx)(l.Icon,{name:L?'chevron-down':'chevron-right',size:12,color:l.C.muted}),(0,x.jsx)(l.T,{style:{flex:1,fontSize:11,lineHeight:15,color:l.C.ink},children:"How this developed through the session"})]}),L&&(0,x.jsx)(i.default,{style:{gap:3,paddingTop:4},children:D.slice().reverse().map((t,n)=>{const r=(0,p.narrate)(t,{underlying:R?.underlying||e,ladder:q});return(0,x.jsxs)(i.default,{style:[l.s.row,{gap:7,alignItems:'flex-start'}],children:[(0,x.jsx)(l.T,{style:{width:38,fontSize:10,lineHeight:15,color:l.C.muted,fontVariant:['tabular-nums']},children:(0,u.clock)(t.at)}),(0,x.jsx)(l.T,{style:{flex:1,minWidth:0,fontSize:11,lineHeight:15,color:t.covered?l.C.ink:l.C.amber},children:r?r.headline:''})]},`${n}-${t.at}`)})})]})]}):null})})};var t=_r(_d[0]),n=e(t),i=e(_r(_d[1])),r=e(_r(_d[2])),s=e(_r(_d[3]));_r(_d[4]);var o=_r(_d[5]),a=e(o),l=_r(_d[6]),d=_r(_d[7]),h=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]),f=_r(_d[12]),m=_r(_d[13]),x=_r(_d[14]),y=_r(_d[15]);(0,m.touchSlop)(22);const b={...(0,m.touchSlop)(24),left:3,right:3},j='No reading of these ten contracts has been captured yet.',C='Click a row on the screener to read what that instrument is doing.',w=560,k=620;function S(e,t=11){let n=t;const i=()=>(n=16807*n%2147483647,n/2147483647-.5),r=Math.max(3,Math.round(e/16)),s=[];for(let t=0;t<=r;t++){const n=t/r;s.push([1+n*(e-2),5+1.7*i()*Math.sin(Math.PI*n)])}let o=`M${s[0][0].toFixed(1)} ${s[0][1].toFixed(1)}`;for(let e=1;e<s.length-1;e++){const t=(s[e][0]+s[e+1][0])/2,n=(s[e][1]+s[e+1][1])/2;o+=` Q${s[e][0].toFixed(1)} ${s[e][1].toFixed(1)} ${t.toFixed(1)} ${n.toFixed(1)}`}const a=s[s.length-1];return o+` L${a[0].toFixed(1)} ${a[1].toFixed(1)}`}function T({width:e,progress:n}){const i=(0,t.useMemo)(()=>S(e),[e]);return e<=0||n<=0?null:(0,x.jsx)(a.default,{width:e,height:11,style:{marginTop:1},children:(0,x.jsx)(o.Path,{d:i,stroke:l.C.green,strokeWidth:1.8,fill:"none",strokeLinecap:"round",strokeDasharray:""+1.15*e,strokeDashoffset:1.15*e*(1-n)})})}function H({rungs:e,spot:s,window:o,highlight:a,onHighlight:d,onTarget:h,slotOf:p}){const f=(0,t.useMemo)(()=>e.slice().sort((e,t)=>
1046t.strike-e.strike),[e]),m=(0,t.useMemo)(()=>Math.max(1,...f.map(e=>Math.abs(Number(e.oi_added)||0))),[f]);return f.length?(0,x.jsxs)(i.default,{style:{gap:3},children:[(0,x.jsxs)(l.T,{style:c.head,children:["Open interest added \xb7 ",o]}),f.map((e,t)=>{const o=f[t+1],c=null!=s&&e.strike>s&&(!o||o.strike<=s),y=Math.abs(Number(e.oi_added)||0)/m,b=a===e.strike,j='added'===e.status?l.C.green:'reduced'===e.status?l.C.red:l.C.line;return(0,x.jsxs)(n.default.Fragment,{children:[(0,x.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`${(0,u.strike)(e.strike)} ${e.side}. `+('not_captured'===e.status?'Not captured at this reading.':'no_change'===e.status?'Measured, no material change this interval.':`Open interest ${'added'===e.status?'added':'reduced'} ${(0,u.compact)(Math.abs(Number(e.oi_added)||0))}`+(e.joined?', new this interval':e.since?`, in this episode since ${(0,u.clock)(e.since)} IST`:'')+'.')+' Highlight this strike and draw it on the chart',onPress:()=>{d?.(e.strike);const t=p(e.strike);h&&null!=t?.instrument_token&&h({underlying:'',instrumentToken:t.instrument_token,label:t.tradingsymbol||`${(0,u.strike)(e.strike)} ${e.side}`,detail:t.label||''})},onHoverIn:()=>d?.(e.strike),onHoverOut:()=>d?.(null),style:e=>[l.s.row,{gap:6,minHeight:18,paddingHorizontal:3,borderRadius:4,backgroundColor:b||e.hovered||e.focused?l.C.soft:'transparent'}],children:[(0,x.jsx)(l.T,{style:{width:54,fontSize:10,lineHeight:14,textAlign:'right',color:b?l.C.green:l.C.muted,fontVariant:['tabular-nums']},children:(0,u.strike)(e.strike)}),(0,x.jsx)(i.default,{style:{flex:1,minWidth:0,height:8,justifyContent:'center'},children:'not_captured'===e.status?(0,x.jsx)(l.T,{style:{fontSize:9,lineHeight:12,color:l.C.amber},children:"not captured"}):'no_change'===e.status?(0,x.jsx)(i.default,{style:{width:5,height:2,borderRadius:1,backgroundColor:l.C.line}}):(0,x.jsx)(i.default,{style:{width:`${Math.max(6,100*y)}%`,height:8,borderRadius:2,backgroundColor:j,opacity:b?1:.85}})}),(0,x.jsx)(l.T,{numberOfLines:1,style:{width:104,fontSize:9,lineHeight:12,color:l.C.muted},children:'not_captured'===e.status?'':'no_change'===e.status?'no change':e.joined?'new this interval':e.since?`since ${(0,u.clock)(e.since)}`:''})]}),c&&(0,x.jsxs)(i.default,{style:[l.s.row,{gap:6,paddingHorizontal:3}],children:[(0,x.jsx)(l.T,{style:{width:54,fontSize:9,lineHeight:12,textAlign:'right',color:l.C.amber,fontVariant:['tabular-nums']},children:"spot"}),(0,x.jsx)(i.default,{style:{flex:1,height:1,backgroundColor:l.C.amber,opacity:.55}}),(0,x.jsx)(l.T,{style:{width:104,fontSize:9,lineHeight:12,color:l.C.amber,fontVariant:['tabular-nums']},children:(0,u.strike)(s)})]})]},e.strike)}),(0,x.jsxs)(l.T,{style:c.metaText,children:["Bar length is the position change over this interval. A short mark is a strike that was",' ',"measured and did not move; amber is a strike the capture did not reach."]})]}):null}function M({s:e,after:t}){return(0,x.jsxs)(i.default,{style:{gap:8},children:[(0,x.jsxs)(i.default,{style:{gap:2},children:[(0,x.jsxs)(l.T,{style:c.head,children:["Where positions stand \xb7 ",(0,u.clock)(e.at)," IST"]}),(0,x.jsx)(l.T,{role:"heading","aria-level":3,style:{fontFamily:'ManropeBold',fontSize:16,lineHeight:22,letterSpacing:-.2,color:l.C.ink},children:e.headline})]}),e.lines.map((e,t)=>(0,x.jsx)(l.T,{style:{fontSize:12,lineHeight:18,color:0===t?l.C.ink:l.C.muted},children:e},t)),(0,x.jsx)(l.T,{style:{fontSize:11,lineHeight:16,color:l.C.amber},children:`${e.caveat} ${t}`})]})}},953,[11,13,375,278,136,840,821,925,948,924,926,952,951,832,6,954]); 1047__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SIGNAL_W",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"SIGNAL_EMPTY",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"SIGNAL_NO_SYMBOL",{enumerable:!0,get:function(){return f}}),_e.SignalTable=function({symbol:e,read:h,style:_,onExpand:T,expanded:p}){const S=h.data,j=e?(0,s.stateOf)(h,S?.not_enough_marks||u):{phase:'empty',text:f},w=(0,t.useMemo)(()=>(0,o.signalRows)(S?.rows),[S]),C=[{heading:'What this table is',lines:[{text:o.SIGNAL_CAVEAT_TEXT,tone:'amber'},o.SIGNAL_RULE_TEXT]},{heading:'Which contracts',lines:[o.SIGNAL_AGGREGATE_TEXT,o.SIGNAL_BASKET_TEXT]},{heading:'How strong is strong',lines:[o.SIGNAL_STRENGTH_TEXT]},{heading:'The vocabulary',lines:[S?.flow_text||'',o.GRID_LEGEND_TEXT]}];
1047return(0,c.jsx)(s.WidgetFrame,{name:"Signal by reading",subtitle:e?`${e} \xb7 the same ten at-the-money contracts the \u0394OI tiles draw`:'',body:S,state:j,onRefresh:h.reload,onExpand:T,expanded:p,inBlock:!0,toolbar:(0,c.jsx)(i.default,{style:[l.s.row,{justifyContent:'flex-end'}],children:(0,c.jsx)(s.InfoDisclosure,{title:"Signal by reading",groups:C})}),emptyDetail:"Each row needs two readings of these contracts before either side has anything to compare against.",style:_,children:(0,c.jsxs)(i.default,{style:{flex:1,minHeight:0},children:[(0,c.jsxs)(i.default,{style:[l.s.row,{gap:6,paddingHorizontal:10,paddingVertical:4,borderBottomWidth:1,borderColor:l.C.line}],children:[(0,c.jsx)(l.T,{style:[s.head,{width:y.time}],children:"Time"}),(0,c.jsx)(l.T,{style:[s.head,{width:y.side}],children:"Call activity"}),(0,c.jsx)(l.T,{style:[s.head,{width:y.side}],children:"Put activity"}),(0,c.jsx)(l.T,{style:[s.head,{width:y.read,flex:1}],children:"Open interest"}),(0,c.jsx)(l.T,{style:[s.head,{width:y.premium}],children:"Premiums"})]}),(0,c.jsx)(n.default,{style:{flex:1},contentContainerStyle:{paddingBottom:6},children:w.map((e,t)=>(0,c.jsxs)(i.default,{accessibilityRole:"text",accessibilityLabel:`${(0,o.clock)(e.at)}. ${e.reason?e.reason:`Compared with the ${(0,o.clock)(e.from)} reading, ${e.window_minutes} minutes back. Calls ${e.calls?.text||o.SIGNAL_NO_BASELINE}, ${e.calls?.what_label||''}. Puts ${e.puts?.text||o.SIGNAL_NO_BASELINE}, ${e.puts?.what_label||''}. ${e.interpretation}. ${e.label}.`}`,style:[l.s.row,{gap:6,paddingHorizontal:10,paddingVertical:5,borderBottomWidth:1,borderColor:'#0F1B22',alignItems:'flex-start'}],children:[(0,c.jsx)(l.T,{style:{width:y.time,fontSize:10,lineHeight:14,color:l.C.muted,fontVariant:['tabular-nums']},children:(0,o.clock)(e.at)}),!e.reason||e.calls||e.puts?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(b,{side:e.calls}),(0,c.jsx)(b,{side:e.puts}),(0,c.jsx)(l.T,{numberOfLines:2,style:{width:y.read,flex:1,fontSize:9,lineHeight:13,color:l.C.muted},children:e.interpretation||o.DASH}),(0,c.jsx)(i.default,{style:{width:y.premium},children:(0,c.jsx)(l.T,{numberOfLines:2,style:{fontSize:10,lineHeight:14,fontFamily:'InterMedium',color:x[e.signal]||l.C.muted},children:e.label})})]}):(0,c.jsx)(l.T,{style:{flex:1,fontSize:9,lineHeight:13,color:l.C.muted},children:e.reason})]},`${t}-${e.at||''}`))}),(0,c.jsx)(i.default,{style:{paddingHorizontal:10,paddingVertical:4,borderTopWidth:1,borderColor:l.C.line},children:(0,c.jsxs)(l.T,{style:s.metaText,children:[w.length," reading",1===w.length?'':'s'," of these ten contracts, each read",' ',"against the reading ",o.SIGNAL_WINDOW_MINUTES," minutes before it. Rule ",o.SIGNAL_RULE_VERSION,".",' ',(0,o.asOfText)(S?.as_of),"."]})})]})})};var t=r(d[0]),i=e(r(d[1])),n=e(r(d[2])),l=r(d[3]),s=r(d[4]),o=r(d[5]),c=r(d[6]);const h=556,u='No reading of these ten contracts has been captured yet.',f='Click a row on the screener to read the ten at-the-money contracts of that instrument.',x={strong_bullish:l.C.ink,bullish:l.C.ink,neutral:l.C.ink,flat:l.C.muted,bearish:l.C.ink,strong_bearish:l.C.ink},y={time:48,side:100,read:140,premium:110};function b({side:e}){if(!e)return(0,c.jsx)(i.default,{style:{width:y.side},children:(0,c.jsx)(l.T,{style:{fontSize:9,lineHeight:13,color:l.C.muted},children:o.SIGNAL_NO_BASELINE})});const t='building'===e.oi_direction?l.C.green:'unwinding'===e.oi_direction?l.C.red:l.C.muted;return(0,c.jsxs)(i.default,{style:{width:y.side,gap:1},children:[(0,c.jsx)(l.T,{numberOfLines:1,style:{fontSize:10,lineHeight:14,fontFamily:'InterSemi',color:t},children:e.text}),(0,c.jsx)(l.T,{numberOfLines:2,style:{fontSize:9,lineHeight:12,color:l.C.muted},children:e.what_label})]})}},954,[11,13,278,821,924,926,6]); 1048__d(function(g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.IvGridWidget=function({underlying:e,expiry:n="",at:s="",seq:o=0,highlight:u,onHighlight:c,style:f,onExpand:v,expanded:S,onClose:M}){const T=n?`&expiry=${encodeURIComponent(n)}`:'',I=(0,h.useSharedRead)(`/api/derivatives/oi-grid?underlying=${encodeURIComponent(e)}${T}${s?`&at=${encodeURIComponent(s)}`:''}`,o),$=I.data?.rows||[],[_,L]=(0,t.useState)({view:'2x5',picked:[],one:''}),[H,W]=(0,t.useState)(0),[O,R]=(0,t.useState)(0),{slots:z,columns:E}=(0,b.gridSelection)($,_.view,_.picked,_.one),D=Math.max(1,Math.min(E,Math.floor(((H||660)+C)/128))),G=Math.max(120,Math.floor(((H||660)-C*(D-1))/D)),N=Math.max(1,Math.ceil(z.length/D)),A=Math.max(F,Math.floor((O-20-C*(N-1))/N)),U=(0,j.useGrow)(`${e}|${_.view}|${_.picked.join(',')}|${_.one}|${$.length}`,700),B=(0,h.useSharedRead)((0,k.ivGridPath)({underlying:e,expiry:n,at:s,legs:(0,k.ivGridLegsParam)($)}),o),q=I.data,J=(0,w.jsxs)(i.default,{style:[d.s.row,{gap:y.CTRL.gap,flexWrap:'wrap'}],children:[(0,w.jsx)(j.Seg,{label:"Tiles",value:'pick'===_.view?'':_.view,onChange:e=>L({..._,view:e}),options:b.GRID_VIEWS}),(0,w.jsx)(i.default,{style:{flex:1}}),(0,w.jsxs)(i.default,{style:[d.s.row,{gap:5}],children:[(0,w.jsx)(i.default,{style:{width:14,height:2,borderRadius:1,backgroundColor:d.C.ink}}),(0,w.jsx)(d.T,{style:V,children:"IV (computed)"})]}),(0,w.jsxs)(i.default,{style:[d.s.row,{gap:5}],children:[(0,w.jsx)(i.default,{style:{width:14,height:0,borderTopWidth:1.5,borderStyle:'dashed',borderColor:d.C.muted}}),(0,w.jsx)(d.T,{style:V,children:"Option price"})]}),!!$.length&&(0,w.jsx)(b.StrikePicker,{rows:$,view:_.view,picked:_.picked,one:_.one,onPick:L})]}),K=`${e}${null!=q?.atm_strike?` \xb7 ATM ${(0,p.strike)(q.atm_strike)}`:''}`;return(0,w.jsx)(x.WidgetFrame,{inline:!0,name:"Implied volatility by strike",subtitle:K,body:q,state:(0,x.stateOf)(I,'No strikes at the money yet.'),onRefresh:I.reload,onExpand:v,expanded:S,onClose:M,toolbar:J,inBlock:!0,note:"IV is computed: the volatility a pricing model needs to reproduce each traded price. The exchange does not report it. A reading the model could not solve
1048keeps its reason and is a gap in the line.",style:f,children:(0,w.jsxs)(l.default,{style:{flex:1},contentContainerStyle:{padding:10},onLayout:e=>{const t=Math.round(e.nativeEvent.layout.height);R(e=>Math.abs(e-t)<3?e:t)},children:['error'===B.phase&&(0,w.jsx)(d.T,{style:{...V,color:d.C.amber,paddingBottom:8},children:`\u2014 IV for this grid is unavailable: ${B.error||'the server did not answer'}`}),(0,w.jsx)(i.default,{onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width);W(e=>Math.abs(e-t)<3?e:t)},style:[d.s.row,{flexWrap:'wrap',alignItems:'flex-start',gap:C}],children:z.map(e=>(0,w.jsx)(P,{slot:e,leg:B.data?(0,k.ivGridLegFor)(B.data,e):null,readings:B.data?.readings||[],reasonText:B.data?.reason_text,phase:B.phase,at:s,width:G,tileH:A,draw:U,lit:null!=u&&null!=e.strike&&Math.abs(Number(e.strike)-u)<.5,onHighlight:c},e.slot))})]})})},_e.MaxPainWidget=function({underlying:e,expiry:l="",at:c="",seq:f=0,style:y,onExpand:b,expanded:k,onClose:C}){const v=(0,h.useSharedRead)(`/api/derivatives/maxpain-series?underlying=${encodeURIComponent(e)}${l?`&expiry=${encodeURIComponent(l)}`:''}`,f),S=v.data,M=(0,u.clipPoints)(S?.points||[],c),[T,I]=(0,t.useState)({w:0,h:0}),$=(0,j.useGrow)(`${e}|${M.length}`,700),_=48,F=Math.max(0,T.w-_-8),L=Math.max(0,T.h-16-8),H=M.map(e=>e?.max_pain_strike??null),P=M.map(e=>e?.spot??null),O=[...H,...P].filter(e=>null!=e),R=O.length?Math.min(...O):0,z=O.length?Math.max(...O):1,E=z-R||1,D=.1*E,G=e=>8+L-(e-(R-D))/(E+2*D)*L,N=M.length>1?F/(M.length-1):0,A=e=>_+e*N;let U='',B=null;H.forEach((e,t)=>{null==e||A(t)>_+F*$?B=null:(U+=null==B?`M${A(t)} ${G(e)}`:`H${A(t)}V${G(e)}`,B=e)});let q='',J=!1;P.forEach((e,t)=>{null==e||A(t)>_+F*$?J=!1:(q+=(J?'L':'M')+A(t)+' '+G(e),J=!0)});const K=S?.latest_max_pain_strike??null,Q=S?.latest_spot??null,X=H.find(e=>null!=e)??null,Y=null!=K&&null!=Q?K-Q:null,Z=H.reduce((e,t,n)=>e+(n>0&&null!=t&&null!=H[n-1]&&t!==H[n-1]?1:0),0),ee=null==K?'Max pain not computed yet':null!=X&&X!==K?`Max pain moved ${(0,p.strike)(X)} \u2192 ${(0,p.strike)(K)} today (${Z} change${1===Z?'':'s'})`:`Max pain held at ${(0,p.strike)(K)} all session`,te=null==Y?S?.no_distance_reason||'No spot at this reading, so no distance to it.':`${(0,p.strike)(Math.abs(Y))} ${Y>0?'above':Y<0?'below':'at'} spot`,ne=[R,(R+z)/2,z].map(e=>Math.round(e)),le=(0,p.axisTimes)(M,3),ie=(0,w.jsxs)(i.default,{style:[d.s.row,{gap:10,flexWrap:'wrap'}],children:[(0,w.jsx)(d.T,{style:{fontFamily:'InterSemi',fontSize:20,lineHeight:24,color:W(),fontVariant:['tabular-nums']},children:null==K?p.DASH:(0,p.strike)(K)}),(0,w.jsx)(d.T,{style:V,children:"max pain"}),(0,w.jsx)(i.default,{style:{width:1,alignSelf:'stretch',backgroundColor:d.C.line}}),(0,w.jsx)(d.T,{style:{fontFamily:'InterSemi',fontSize:15,lineHeight:20,color:d.C.ink,fontVariant:['tabular-nums']},children:null==Q?p.DASH:(0,p.spotLevel)(Q,e)}),(0,w.jsx)(d.T,{style:V,children:"spot"}),(0,w.jsx)(i.default,{style:{flex:1}}),(0,w.jsxs)(i.default,{style:[d.s.row,{gap:5}],children:[(0,w.jsx)(i.default,{style:{width:14,height:2,backgroundColor:W()}}),(0,w.jsx)(d.T,{style:V,children:"Max pain"})]}),(0,w.jsxs)(i.default,{style:[d.s.row,{gap:5}],children:[(0,w.jsx)(i.default,{style:{width:14,height:0,borderTopWidth:1.5,borderStyle:'dashed',borderColor:d.C.ink}}),(0,w.jsx)(d.T,{style:V,children:"Spot"})]})]});return(0,w.jsx)(x.WidgetFrame,{inline:!0,name:"Max pain through the session",subtitle:e,body:S,state:(0,x.stateOf)(v,'No max pain has been computed for this expiry yet.'),onRefresh:v.reload,onExpand:b,expanded:k,onClose:C,toolbar:ie,inBlock:!0,note:"Max pain is the strike at which the open interest standing at each reading would pay out least. It is arithmetic on the positions standing, and says nothing about what comes next.",style:y,children:(0,w.jsxs)(i.default,{style:{flex:1,padding:10,gap:6},children:[(0,w.jsx)(i.default,{style:{flex:1,minHeight:120},onLayout:e=>{const{width:t,height:n}=e.nativeEvent.layout;I({w:Math.round(t),h:Math.round(n)})},children:T.w>0&&(0,w.jsxs)(o.default,{width:T.w,height:T.h,children:[ne.map(e=>(0,w.jsxs)(n.default.Fragment,{children:[(0,w.jsx)(s.Line,{x1:_,x2:_+F,y1:G(e),y2:G(e),stroke:d.C.line,strokeDasharray:"2 4"}),(0,w.jsx)(s.Text,{x:42,y:G(e)+4,fill:d.C.muted,fontSize:11,fontFamily:"Inter",textAnchor:"end",children:(0,p.strike)(e)})]},e)),!!q&&(0,w.jsx)(s.Path,{d:q,stroke:d.C.ink,strokeOpacity:.8,strokeWidth:1.3,strokeDasharray:"4 3",fill:"none"}),!!U&&(0,w.jsx)(s.Path,{d:U,stroke:W(),strokeWidth:2.2,fill:"none"}),$>=1&&null!=K&&H.length>0&&(0,w.jsx)(s.Circle,{cx:A(H.length-1),cy:G(K),r:3.5,fill:W()}),le.map(e=>(0,w.jsx)(s.Text,{x:Math.min(_+F-24,A(e.i)),y:T.h-2,fill:d.C.muted,fontSize:11,fontFamily:"Inter",children:e.label},e.i))]})}),(0,w.jsx)(d.T,{style:{fontSize:12,lineHeight:16,color:d.C.ink},children:ee}),(0,w.jsx)(d.T,{style:{fontSize:12,lineHeight:16,color:d.C.muted},children:te})]})})};var t=r(_d[0]),n=e(t),l=e(r(_d[1])),i=e(r(_d[2])),s=r(_d[3]),o=e(s),d=r(_d[4]),h=r(_d[5]),u=r(_d[6]),c=r(_d[7]),x=r(_d[8]),p=r(_d[9]),f=r(_d[10]),y=r(_d[11]),j=r(_d[12]),b=r(_d[13]),k=r(_d[14]),w=r(_d[15]);const C=8,v=8,S=16,M=18,T=14,I=18,$=4,_=72,F=190,L=e=>{let t='',n=!1;for(const l of e)l?(t+=(n?'L':'M')+l.x.toFixed(1)+' '+l.y.toFixed(1),n=!0):n=!1;return t};function H(e,t,n){const l=e.filter(e=>null!=e);if(!l.length||t<=0||n<=0)return null;const i=Math.min(...l),s=Math.max(...l),o=s-i||Math.abs(s)||1,d=.08*n,h=n-2*d,u=e.length>1?t/(e.length-1):0;return{lo:i,hi:s,points:e.map((e,t)=>null==e?null:{x:t*u,y:d+h-(e-i)/o*h})}}const V={fontSize:11,lineHeight:14,color:d.C.muted,fontVariant:['tabular-nums']};function P({slot:e,leg:t,readings:n,reasonText:l,phase:h,at:y="",width:j,tileH:b,draw:C,lit:P,onHighlight:W}){const O=(0,u.clipPoints)(t?(0,k.ivGridLegPoints)({readings:n,reason_text:l||{},legs:[]},t):[],y),R=String(e.option_type).toUpperCase().startsWith('C')?'call':'put',z=f.OI_SIDE_COLOR[R],E=_+Math.max(0,b-F),D=Math.max(0,j-16-2),G=O.map(e=>{const t=e?.iv_pct??e?.iv;return'number'==typeof t&&Number.isFinite(t)?t:null}),N=H(G,D,E),A=H(O.map(e=>e?.last_price??null),D,E),U=[...G.keys()].reverse().find(e=>null!=G[e]),B=G.findIndex(e=>null!=e),q=null==U?null:G[U],J=B<0?null:G[B],K=[...O].reverse().find(e=>null!=e?.last_price)?.last_price,Q=[...O].reverse().find(e=>e?.reason_text)?.reason_text||t?.missing_text||e.missing_text||'',X=null!=q&&null!=J&&U!==B?q-J:null,Y=null!=X&&Math.abs(X)<c.FLAT_IV_POINTS,Z=null==X?null==q?'IV not solved':'IV change \u2014':Y?'IV flat since open':`IV ${X>0?'up':'down'} ${Math.abs(X).toFixed(1)} pts since open`,ee=N?[...N.points].reverse().find(Boolean):null,te=(0,p.axisTimes)(O,2),ne=(0,p.gridSlotDetail)(e).split('\xb7')[0].trim(),le=t?.direction_label||'';return(0,w.jsxs)(i.default,{title:[(0,p.gridSlotTitle)(e),ne,N?`IV ${N.lo.toFixed(1)}% to ${N.hi.toFixed(1)}
1048% today`:'',Q||''].filter(Boolean).join(' \xb7 '),onPointerEnter:()=>W?.(null==e.strike?null:Number(e.strike)),onPointerLeave:()=>W?.(null),style:{width:j,height:b,padding:v,borderRadius:10,gap:$,borderWidth:1,borderColor:P?d.C.mint:d.C.line,backgroundColor:P?d.C.dark:'transparent'},children:[(0,w.jsxs)(i.default,{style:[d.s.row,{height:S,gap:6}],children:[(0,w.jsx)(d.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:13,lineHeight:S,color:z,flexShrink:1},children:(0,p.gridSlotTitle)(e)}),(0,w.jsx)(i.default,{style:{flex:1}}),(0,w.jsx)(d.T,{numberOfLines:1,style:V,children:ne})]}),(0,w.jsxs)(i.default,{style:[d.s.row,{height:M,gap:4}],children:[(0,w.jsxs)(d.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:12,lineHeight:M,color:z,fontVariant:['tabular-nums']},children:[null==q?p.DASH:`${q.toFixed(1)}%`,(0,w.jsx)(d.T,{style:{fontFamily:'Inter',fontSize:11,color:d.C.muted},children:" IV"})]}),(0,w.jsx)(i.default,{style:{flex:1}}),(0,w.jsx)(d.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:12,lineHeight:M,color:d.C.ink,fontVariant:['tabular-nums']},children:(0,p.price)(K)})]}),(0,w.jsxs)(i.default,{style:{height:E+T},children:[N?(0,w.jsxs)(o.default,{width:D,height:E,children:[!!A&&(0,w.jsx)(s.Path,{d:L(A.points.map(e=>e&&e.x<=D*C?e:null)),stroke:d.C.muted,strokeWidth:1.1,strokeDasharray:"3 3",fill:"none"}),(0,w.jsx)(s.Path,{d:L(N.points.map(e=>e&&e.x<=D*C?e:null)),stroke:z,strokeWidth:2,fill:"none"}),C>=1&&!!ee&&(0,w.jsx)(s.Circle,{cx:ee.x,cy:ee.y,r:3,fill:z})]}):(0,w.jsx)(i.default,{style:{flex:1,justifyContent:'center'},children:(0,w.jsx)(d.T,{style:V,children:'loading'===h?'Loading\u2026':'error'===h?'IV unavailable (see above)':Q||'No IV could be solved for this contract yet.'})}),!!N&&(0,w.jsx)(i.default,{style:[d.s.row,{height:T,justifyContent:'space-between'}],children:te.map(e=>(0,w.jsx)(d.T,{style:V,children:e.label},e.i))})]}),(0,w.jsxs)(d.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,height:I,color:d.C.ink},children:[null!=X&&!Y&&(0,w.jsx)(d.T,{style:{fontFamily:'InterSemi',color:(0,x.buildupColor)(X>0?'up':'down')},children:X>0?'\u2191 ':'\u2193 '}),Z]}),(0,w.jsx)(d.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,height:I,color:d.C.muted},children:le?`Day: ${le}`:' '})]})}const W=()=>d.C.amber},955,[11,278,13,840,821,921,923,944,924,926,934,928,927,943,956,6]); 1049__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"IV_GRID_ORDER",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"IV_GRID_SLOTS",{enumerable:!0,get:function(){return _}}),Object.defineProperty(_e,"IV_GRID_CALLS_LABEL",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"IV_GRID_PUTS_LABEL",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"IV_GRID_TEXT",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"IV_GRID_GAP_TEXT",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"IV_GRID_HIGHLIGHT_TEXT",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"IV_GRID_COMPUTED_TEXT",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"IV_GRID_NO_VALUE",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"IV_GRID_NO_LADDER",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"IV_CHART_H",{enumerable:!0,get:function(){return G}}),_e.scaleIv=N,_e.ivAxis=z,_e.ivSlotDetail=U,_e.ivSlotSpoken=F,_e.ivGridLegsParam=W,_e.ivGridPath=B,_e.ivGridLegFor=X,_e.
1049ivGridLegPoints=q,_e.ivGridLegAsIvLeg=K,_e.IvStrikeGrid=function({underlying:e,expiry:l,seq:s,ladder:o,onPick:f,selected:k,highlight:C,onHighlight:I,at:j}){const[T,S]=n.default.useState(0),$=o.data?.rows||[],O=(0,t.useMemo)(()=>{const t=new Map;for(const e of $)e?.slot&&t.set(e.slot,e);return b.map(n=>{const i=t.get(n);if(i)return i;const l=n.slice(0,2),s=Number(n.slice(2))||0;return{slot:n,option_type:l,atm_offset:s,label:`ATM${0===s?'':s>0?`+${s}`:`\u2212${Math.abs(s)}`} ${l}`,row:'CE'===l?'calls':'puts',present:!1,tradingsymbol:null,instrument_token:null,strike:null,previous_close_oi:null,points:[],direction:'no baseline',direction_detail:{},marks:0,marks_with_delta:0,latest_delta_oi:null,peak_abs_delta_oi:null,marks_with_price:0,latest_price:null,flow:{price_direction:'no baseline',oi_direction:'no baseline',what_label:'',meaning:null,detail:{}},missing_text:e?P:''}})},[$,e]),L=(0,c.useDerivativeRead)(B({underlying:e,expiry:l,at:j,legs:W(O)}),s),M=e=>{const t=L.data?X(L.data,e):null;return t&&L.data?K(L.data,t):null},w=[{key:'calls',label:x,slots:O.slice(0,_/2)},{key:'puts',label:v,slots:O.slice(_/2)}],H=(0,p.gridColumns)(T||660),D=Math.max(120,Math.floor(((T||660)-E*(H-1))/H));return(0,y.jsx)(i.default,{onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width);S(e=>Math.abs(e-t)<3?e:t)},style:{gap:10},children:w.map(e=>(0,y.jsxs)(i.default,{style:{gap:6},children:[(0,y.jsx)(u.T,{style:h.head,children:e.label}),(0,y.jsx)(i.default,{style:[u.s.row,{flexWrap:'wrap',alignItems:'flex-start',gap:E}],children:e.slots.map(e=>(0,y.jsx)(Y,{slot:e,leg:M(e),reasonText:L.data?.reason_text,phase:L.phase,width:D,onPick:f,onHighlight:I,selected:k,lit:null!=C&&null!=e.strike&&Math.abs(Number(e.strike)-C)<.5},e.slot))})]},e.key))})};var t=r(d[0]),n=e(t),i=e(r(d[1])),l=e(r(d[2])),s=r(d[3]),o=e(s),u=r(d[4]),c=r(d[5]),h=r(d[6]),p=r(d[7]),f=r(d[8]),y=r(d[9]);const b=['CE+0','CE+1','CE+2','CE+3','CE+4','PE+0','PE-1','PE-2','PE-3','PE-4'],_=b.length,x='Calls \u2014 at the money and above',v='Puts \u2014 at the money and below',k='Each tile is one contract\'s implied volatility through the session, on the same ten strikes the \u0394OI grid draws and in the same order, so the two blocks can be read tile for tile.',C='A reading the model could not solve is a gap in that tile\'s line, with the server\'s reason under it; nothing here is interpolated, carried forward or drawn at zero.',I='Pointing at a tile lights the same strike wherever else it is on this tab \u2014 on the option chain, on the OI-by-strike bars and on the \u0394OI grid. It highlights; it changes nothing.',j='Every tile carries COMPUTED because every number on it is a model\'s output, not a figure the exchange reported.',T='No implied volatility has been solved for this contract at any reading of this session.',P='The at-the-money ladder has not been resolved for this symbol yet.',S=34,$=12,E=8,O=16,L=13,M=15,w=14,H=26,D=8,R=4,G=p.TILE_H-122,V=G-$,A=1.4;function N(e,t,n){const i=(e||[]).map(e=>{const t=e?.iv_pct??e?.iv;return'number'==typeof t&&Number.isFinite(t)?Math.abs(t)<=3?100*t:t:null}),l=i.filter(e=>null!=e);if(l.length<2||t<=0||n<=0)return null;const s=Math.min(...l),o=Math.max(...l),u=o-s||Math.abs(o)||1,c=i.length>1?t/(i.length-1):0;return{lo:s,hi:o,points:i.map((e,t)=>null==e?null:{x:t*c,y:n-(e-s)/u*n,i:t})}}function z(e,t){if(!e)return[];const n=e.hi-e.lo||1,i=[];for(const l of[e.hi,e.lo]){const s=t-(l-e.lo)/n*t;i.some(e=>Math.abs(e.y-s)<9)||i.push({v:l,y:s})}return i}function U(e,t){if(!e.present)return e.label;const n=t?.points||[];if(!n.length)return e.label;const i=n.filter(e=>e&&null!=(e.iv??e.iv_pct)).length;return`${e.label} \xb7 ${i} of ${n.length} reading${1===n.length?'':'s'} solved`}function F(e,t,n,i,l){const s=`${(0,f.strike)(e.strike)===f.DASH?e.label:`${(0,f.strike)(e.strike)} ${e.option_type}`}, ${e.label}`;if(!e.present)return`${s}. ${e.missing_text||'This strike is not listed in this expiry.'}`;if(null==n)return`${s}. No computed implied volatility. ${l}`;const o=i?i.replace(/^[^ ]+ /,'').toLowerCase():'no baseline';return`${s}. Computed implied volatility ${(0,f.ivText)(n)}, ${o}. `+`${U(e,t).split(' \xb7 ').slice(1).join(' \xb7 ')||''}`.trim()}function W(e){return e.filter(e=>e.present&&null!=e.strike).map(e=>`${e.option_type}:${e.strike}`).join(',')}function B(e){return e.underlying&&e.legs?`/api/derivatives/iv-grid-series?underlying=${encodeURIComponent(e.underlying)}${e.expiry?`&expiry=${encodeURIComponent(e.expiry)}`:''}${e.at?`&at=${encodeURIComponent(e.at)}`:''}&legs=${encodeURIComponent(e.legs)}`:null}function X(e,t){return e&&Array.isArray(e.legs)&&null!=t.strike&&e.legs.find(e=>String(e.option_type).toUpperCase()===String(t.option_type).toUpperCase()&&Number(e.strike)===Number(t.strike))||null}function q(e,t){return(e.readings||[]).map((n,i)=>{const l=t.iv_pct?.[i]??null,s=t.reason?.[i]??null;return{at:n,iv:null==l?null:l/100,iv_pct:l,computed:null!=l,reason:s,reason_text:s?e.reason_text?.[s]??s:null,last_price:t.last_price?.[i]??null,spot:null,strike:t.strike}})}function K(e,t){return{present:t.present,strike:t.strike,option_type:t.option_type,tradingsymbol:t.tradingsymbol,instrument_token:t.instrument_token,points:q(e,t),direction:t.direction,direction_label:t.direction_label,rejections:t.rejections??null,readings_with_value:t.readings_with_value,missing_text:t.missing_text??null}}function Y({slot:e,leg:n,reasonText:c,phase:b,width:_,selected:x,lit:v,onPick:k,onHighlight:C}){const I=c,j=b,P=n?.points||[],E=(0,t.useMemo)(()=>P.map(e=>{const t=e?.iv_pct??e?.iv;return'number'==typeof t&&Number.isFinite(t)?t:null}),[P]),W=[...P].reverse().find(e=>e&&null!=(e.iv??e.iv_pct))||null,B=W?W.iv_pct??W.iv:null,X=(0,t.useMemo)(()=>P.map(e=>e?.at??null),[P]),q=(0,f.servedDirection)(n?.direction,E,f.IV_KEYS,X),K=(0,f.sessionChip)(f.IV_CHIPS,q),Y=(0,f.sessionTone)(f.IV_CHIPS,q),J=null!=B?'':(0,f.ivLatestRefusal)(P,I)||String(n?.missing_text||'')||String(e.missing_text||'')||('loading'===j?'':T),Q=e.present?P.length?E.filter(e=>null!=e).length<2?J||'One solved reading is a dot, not a line.':'':'loading'===j?'':T:e.missing_text||'This strike is not listed in this expiry.',Z=(0,h.typeColor)((0,f.optionTone)(e.option_type)),ee=Math.max(0,_-S-22),te=N(P,ee,V),ne=z(te,V),ie=(0,f.axisTimes)(P,3),le=te?[...te.points].reverse().find(Boolean):null,re=(0,f.strike)(e.strike)===f.DASH?e.label:`${(0,f.strike)(e.strike)}
1049 ${e.option_type}`,se=!!x?.(n);return(0,y.jsxs)(l.default,{accessibilityRole:"button",accessibilityState:{selected:se},accessibilityLabel:F(e,n,B,K,J),disabled:!e.present||!n||!k,onPress:()=>{n&&k&&k(n,W)},onHoverIn:()=>C?.(null==e.strike?null:Number(e.strike)),onHoverOut:()=>C?.(null),onFocus:()=>C?.(null==e.strike?null:Number(e.strike)),onBlur:()=>C?.(null),style:e=>[{width:_,height:p.TILE_H,padding:D,borderRadius:10,gap:R,borderWidth:se||e.focused?2:1,borderColor:se||e.focused?u.C.green:v?u.C.mint:u.C.line,backgroundColor:se?u.C.soft:v||e.hovered||e.focused?u.C.dark:'transparent'}],children:[(0,y.jsxs)(i.default,{style:[u.s.row,{gap:5,height:O}],children:[(0,y.jsx)(u.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:12,lineHeight:O,color:Z,flexShrink:1,minWidth:0},children:re}),(0,y.jsx)(h.Tag,{label:f.IV_COMPUTED_TAG,a11y:"Computed by a pricing model, not reported by the exchange"})]}),(0,y.jsx)(u.T,{numberOfLines:1,style:{fontSize:9,lineHeight:L,height:L,color:u.C.muted},children:U(e,n)}),(0,y.jsx)(i.default,{style:{height:G},children:Q?(0,y.jsx)(i.default,{style:{flex:1,justifyContent:'center'},children:(0,y.jsx)(u.T,{style:{fontSize:9,lineHeight:13,color:u.C.muted},children:Q})}):ee>0&&(0,y.jsxs)(o.default,{width:_-18,height:G,children:[ne.map(e=>(0,y.jsx)(s.Text,{x:0,y:Math.min(G-$,Math.max(8,e.y+3)),fill:u.C.muted,fontSize:8,children:(0,f.ivText)(e.v)},`y${e.v}`)),!!te&&(0,y.jsx)(s.Line,{x1:S,x2:S+ee,y1:V,y2:V,stroke:u.C.line,strokeWidth:1,strokeDasharray:"2 3"}),(0,y.jsx)(s.Path,{d:(0,f.linePath)(te),stroke:Z,strokeWidth:A,fill:"none",transform:`translate(${S},0)`}),!!le&&(0,y.jsx)(s.Circle,{cx:S+le.x,cy:le.y,r:2.4,fill:Z}),ie.map(e=>{const t=P.length>1?ee/(P.length-1):0;return(0,y.jsx)(s.Text,{x:Math.min(_-40,S+e.i*t-10),y:G-2,fill:u.C.muted,fontSize:8,children:e.label},`x${e.i}`)})]})}),(0,y.jsxs)(i.default,{style:[u.s.row,{gap:6,height:M}],children:[K?(0,y.jsx)(i.default,{style:{paddingHorizontal:5,paddingVertical:1,borderRadius:4,borderWidth:1,borderColor:'flat'===Y?u.C.line:(0,h.buildupColor)(Y)},children:(0,y.jsx)(u.T,{style:{fontSize:9,lineHeight:13,fontFamily:'InterSemi',color:'flat'===Y?u.C.muted:(0,h.buildupColor)(Y)},children:K})}):(0,y.jsx)(u.T,{style:{fontSize:9,lineHeight:13,color:u.C.muted},children:"no baseline"}),(0,y.jsx)(i.default,{style:{flex:1}}),(0,y.jsx)(u.T,{numberOfLines:1,style:{fontSize:9,lineHeight:13,color:null==B?u.C.muted:u.C.ink,fontVariant:['tabular-nums']},children:(0,f.ivText)(B)}),(0,y.jsx)(h.Tag,{label:f.IV_COMPUTED_TAG})]}),(0,y.jsx)(u.T,{numberOfLines:1,style:{fontSize:9,lineHeight:13,height:w,fontFamily:'InterMedium',color:null==B?u.C.muted:u.C.ink},children:null==B?'No volatility at the latest reading':'Solved at the latest reading'}),(0,y.jsx)(i.default,{style:{height:H},children:(0,y.jsx)(u.T,{numberOfLines:2,style:{fontSize:9,lineHeight:13,color:u.C.muted},children:J})})]})}},956,[11,13,375,840,821,920,924,943,926,6]); 1050__d(function(g,_r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.OiStudioTool=function(e){const{underlying:p,expiry:H,at:z,seq:E}=e.sh,P=e.style?.height??480,[A,F]=(0,t.useState)(()=>{const e=(0,o.readStore)(v,'oi_view').v;return f.SIDE_VIEWS.some(t=>t.id===e)?e:'combined'}),[V,D]=(0,t.useState)(()=>{const e=(0,o.readStore)(v,'oi_window').v;return f.WINDOWS.some(t=>t.id===e)?e:'15m'}),[N,B]=(0,t.useState)(()=>'experienced'===(0,o.readStore)(v,'mode').m?'experienced':'beginner'),U=(e,t,n)=>r=>{t(r),(0,o.writeStore)(v,e,{[n]:r})},[X,K]=(0,t.useState)(!0),[q,G]=(0,t.useState)(()=>{const e=(0,o.readStore)(v,'oi_strikes').n;return f.STRIKE_CHOICES.some(t=>t.id===e)?e:10}),[Y,J]=(0,t.useState)(null),[Q,Z]=(0,t.useState)(!1),[ee,te]=(0,t.useState)(1),[ne,re]=(0,t.useState)(null),le=(0,d.useOiSession)(p?(0,c.oiSessionPath)({underlying:p,expiry:H||null}):null),ie='ready'===le?.state?le.session:null,oe=(0,t.useMemo)(()=>{if(!ie)return null;const e=(0,f.indexAtOrBefore)(ie.readings,z);return e>=0?(0,f.refSpot)(ie,e).value:null},[ie,z]),se=(0,t.useMemo)(()=>(0,f.drawnStrikes)(ie,oe,null,q),[ie,oe,q]),ae=W(p,H,z,se,E,'all'===q),de=(0,s.use
1050SharedRead)(p?`/api/derivatives/maxpain-series?underlying=${encodeURIComponent(p)}${H?`&expiry=${encodeURIComponent(H)}`:''}`:null,E),ce=Y||z,he=(0,t.useMemo)(()=>(0,f.buildFrame)(ie,ae.data||null,z,V,!1!==e.isIndex,q),[ie,ae.data,z,V,e.isIndex,q]),ue=(0,t.useMemo)(()=>Y?(0,f.buildFrame)(ie,ae.data||null,ce,V,!1!==e.isIndex,q,he?.strikes):he,[ie,ae.data,ce,V,e.isIndex,q,Y,he]),fe=he,pe=(0,t.useMemo)(()=>(0,x.maxPainAt)(de.data?.points,ue?.at),[de.data,ue?.at]),ge=(0,t.useMemo)(()=>(0,x.maxPainAt)(de.data?.points,fe?.at),[de.data,fe?.at]),xe=(0,t.useMemo)(()=>fe?.thenAt?(0,x.maxPainAt)(de.data?.points,fe.thenAt):null,[de.data,fe?.thenAt]),me=(0,t.useMemo)(()=>ie?ie.readings.filter(e=>Date.parse(e.at.replace(' ','T'))<=Date.parse(z.replace(' ','T'))).length-1:-1,[ie,z]);(0,t.useEffect)(()=>{if(!Q||!ie||me<0)return;let e=Y?ie.readings.findIndex(e=>e.at===Y):-1;const t=()=>{if(e+=1,e>=me)return J(null),void Z(!1);J(ie.readings[e].at)};t();const n=setInterval(t,900/ee);return()=>clearInterval(n)},[Q,ie,me,ee]);const ye=(0,t.useMemo)(()=>(0,y.sessionSummary)(fe,N),[fe,N]),Ce=(0,t.useMemo)(()=>(0,C.sessionStory)(ie,fe,z,N),[ie,fe,z,N]),be=(0,t.useMemo)(()=>{const e=e=>e?` \u2192 ${e}`:'';return(0,S.typeMs)(Ce.headline+e(Ce.headSo))+Ce.lines.reduce((t,n)=>t+(0,S.typeMs)(n.t+e(n.so)),0)},[Ce]),[je,Se]=(0,t.useState)(!1);(0,t.useEffect)(()=>{Se(!1);const e=setTimeout(()=>Se(!0),be);return()=>clearTimeout(e)},[be,Ce.headline,N]);const we=(0,t.useMemo)(()=>`${fe?.at}|${V}|${A}|${q}|${N}`,[fe?.at,V,A,q,N]),Ie=(0,t.useRef)(0),ve=(0,t.useRef)('');ve.current!==we&&(ve.current=we,Ie.current++);const Te=(0,t.useMemo)(()=>(0,y.readingRows)(ie,ae.data||null,fe),[ie,ae.data,fe]),[Oe,ke]=(0,t.useState)({w:0,h:0}),[Re,Me]=(0,t.useState)(()=>{const e=(0,o.readStore)(v,'oi_split').f;return'number'==typeof e&&e>=.3&&e<=.75?e:.5}),[Le,He]=(0,t.useState)(0),$e=(0,t.useRef)(null),We={onPointerDown:e=>{$e.current={x0:e.nativeEvent.clientX??e.nativeEvent.pageX,f0:Re},e.target?.setPointerCapture?.(e.nativeEvent.pointerId)},onPointerMove:e=>{const t=$e.current;if(!t||!Le)return;const n=e.nativeEvent.clientX??e.nativeEvent.pageX;Me(Math.min(.75,Math.max(.3,t.f0+(n-t.x0)/Le)))},onPointerUp:()=>{$e.current&&($e.current=null,Me(e=>((0,o.writeStore)(v,'oi_split',{f:e}),e)))}},ze=f.WINDOWS.find(e=>e.id===V),Ee=!le||'loading'===le.state,Pe=le&&'ready'!==le.state&&'loading'!==le.state?le.message:null;return(0,w.jsxs)(l.default,{style:{height:P,flexDirection:'row'},onLayout:e=>He(Math.round(e.nativeEvent.layout.width)),children:[(0,w.jsxs)(l.default,{style:{width:Le?Math.round((Le-14)*Re):void 0,flex:Le?void 0:1,minWidth:0,borderWidth:1,borderColor:i.C.line,borderRadius:12,backgroundColor:i.C.paper,overflow:'hidden'},children:[(0,w.jsxs)(l.default,{style:[i.s.row,{paddingHorizontal:12,height:44,borderBottomWidth:1,borderColor:i.C.line,gap:10,overflow:'hidden'}],children:[(0,w.jsx)(i.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:11,lineHeight:16,letterSpacing:1,textTransform:'uppercase',color:i.C.ink},children:"Open interest by strike"}),(0,w.jsx)(R,{value:A,items:f.SIDE_VIEWS,onChange:U('oi_view',F,'v'),label:"Which side to draw"}),(0,w.jsx)(R,{value:V,items:f.WINDOWS.map(e=>({id:e.id,label:e.label})),onChange:U('oi_window',D,'v'),label:"Change window"}),(0,w.jsx)(R,{value:q,items:f.STRIKE_CHOICES,onChange:U('oi_strikes',G,'n'),label:"Strikes each side of the money"}),(0,w.jsx)(R,{value:X?'on':'off',items:[{id:'on',label:'IV on'},{id:'off',label:'IV off'}],onChange:e=>K('on'===e),label:"Implied volatility lines"})]}),(0,w.jsxs)(l.default,{style:[i.s.row,{gap:10,rowGap:4,paddingHorizontal:12,paddingVertical:4,height:62,flexWrap:'wrap',alignContent:'flex-start',overflow:'hidden'}],children:[(0,w.jsxs)(i.T,{numberOfLines:1,style:{...T,minWidth:96,color:Y?i.C.green:i.C.ink},children:[Y?'replaying':'as of'," ",(0,w.jsxs)(i.T,{style:{fontFamily:'InterSemi'},children:[ue?ue.time:(0,f.clockOf)(z)," IST"]})]}),null!=ue?.spot&&(0,w.jsxs)(i.T,{numberOfLines:1,style:{...T,color:i.C.ink},children:["Spot ",(0,w.jsx)(i.T,{style:{fontFamily:'InterSemi',fontSize:13},children:f.fmt.spot(ue.spot,ue.isIndex)}),null!=ue.spotOpen&&(0,w.jsxs)(i.T,{style:{color:ue.spot>=ue.spotOpen?i.C.green:i.C.red}
1050,children:[" ",ue.spot-ue.spotOpen>=0?'+':'',(ue.spot-ue.spotOpen).toFixed(2)," (",f.fmt.pct(ue.spotOpen?(ue.spot-ue.spotOpen)/ue.spotOpen*100:null,2),")"]})]}),(0,w.jsxs)(n.default,{onPress:()=>{Q?(Z(!1),J(null)):(J(ie?.readings[0]?.at||null),Z(!0))},disabled:!ie||me<1,accessibilityRole:"button",accessibilityLabel:Q?'Stop and return to this reading':'Play the day',style:e=>[i.s.row,{gap:5,minHeight:u.CTRL.h,paddingHorizontal:u.CTRL.padX,borderWidth:1,borderColor:Q?i.C.green:i.C.line,borderRadius:u.CTRL.radius,backgroundColor:Q?i.C.soft:e.hovered?i.C.dark:'transparent',opacity:!ie||me<1?.5:1}],children:[(0,w.jsx)(i.Icon,{name:Q?'square':'play',size:12,color:Q?i.C.green:i.C.ink}),(0,w.jsx)(i.T,{style:{fontSize:u.CTRL.font,lineHeight:u.CTRL.lineHeight,fontFamily:'InterMedium',color:Q?i.C.green:i.C.ink},children:Q?'Stop':'Play the day'})]}),(0,w.jsx)(R,{value:ee,items:[{id:1,label:'1\xd7'},{id:2,label:'2\xd7'},{id:4,label:'4\xd7'}],onChange:te,label:"Replay speed"}),(0,w.jsxs)(l.default,{style:[i.s.row,{gap:12,width:'100%',overflow:'hidden'}],children:[(0,w.jsx)(M,{swatch:(0,w.jsx)(_,{color:h.OI_SIDE_COLOR.call}),label:"Call OI"}),(0,w.jsx)(M,{swatch:(0,w.jsx)(_,{color:h.OI_SIDE_COLOR.put}),label:"Put OI"}),(0,w.jsx)(M,{swatch:(0,w.jsxs)(l.default,{style:[i.s.row,{gap:2}],children:[(0,w.jsx)(_,{color:h.OI_SIDE_COLOR.put,hatch:!0}),(0,w.jsx)(i.T,{style:{fontSize:11,lineHeight:14,color:i.C.green,fontFamily:'InterSemi'},children:"\u25b2"})]}),label:`added \xb7 ${ze.label}`}),(0,w.jsx)(M,{swatch:(0,w.jsxs)(l.default,{style:[i.s.row,{gap:2}],children:[(0,w.jsx)(_,{color:i.C.muted,hatch:!0}),(0,w.jsx)(i.T,{style:{fontSize:11,lineHeight:14,color:i.C.muted,fontFamily:'InterSemi'},children:"\u25bc"})]}),label:`left \xb7 ${ze.label}`}),X&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(M,{swatch:(0,w.jsx)(L,{}),label:"IV now"}),(0,w.jsx)(M,{swatch:(0,w.jsx)(L,{dashed:!0}),label:'1d'===V&&fe?.ivThenLabel?`IV ${fe.ivThenLabel}`:`IV ${ze.label} ago`}),ae.failed>0&&(0,w.jsxs)(i.T,{style:{...T,color:i.C.amber},children:["\xb7 ",ae.failed," IV request",1===ae.failed?'':'s'," unanswered"]})]}),null!=pe&&(0,w.jsx)(M,{swatch:(0,w.jsx)(l.default,{style:{width:8,height:8,backgroundColor:h.MAX_PAIN_COLOR,transform:[{rotate:'45deg'}]}}),label:`Max pain ${f.fmt.strike(pe)}`})]})]}),(0,w.jsxs)(l.default,{style:{flex:1,minHeight:120},onLayout:e=>{const{width:t,height:n}=e.nativeEvent.layout;ke(e=>Math.abs(e.w-t)<2&&Math.abs(e.h-n)<2?e:{w:Math.round(t),h:Math.round(n)})},children:[fe&&Oe.w>0&&(0,w.jsx)(j.OiIvChart,{frame:ue,view:A,width:Oe.w,height:Oe.h,showIv:X,showChange:!0,maxPain:pe,active:ne,onActive:re}),!fe&&(0,w.jsx)(l.default,{style:{flex:1,alignItems:'center',justifyContent:'center',padding:16},children:(0,w.jsx)(i.T,{style:{...T,color:Pe?i.C.amber:i.C.muted,textAlign:'center'},children:Ee?'Reading the session\u2026':Pe||'No reading at or before the one on screen.'})}),fe&&!fe.ivKnown&&'loading'!==ae.phase&&X&&(0,w.jsx)(l.default,{style:{position:'absolute',right:10,top:8},children:(0,w.jsxs)(i.T,{style:{...T,color:i.C.amber},children:["IV unavailable at this reading",ae.error?` \xb7 ${ae.error}`:'']})}),fe&&fe.ivKnown&&fe.ivAt&&(0,f.clockOf)(fe.ivAt)!==fe.time&&X&&(0,w.jsx)(l.default,{style:{position:'absolute',right:10,top:8},children:(0,w.jsxs)(i.T,{style:{...T,color:i.C.amber},children:["IV as of ",(0,f.clockOf)(fe.ivAt)," \xb7 not solved at ",fe.time]})})]}),fe&&(0,w.jsxs)(l.default,{style:{padding:8,gap:4,borderTopWidth:1,borderColor:i.C.line,height:122},children:[(0,w.jsxs)(l.default,{style:[i.s.row,{gap:8,alignItems:'stretch'}],children:[(0,w.jsx)($,{card:fe.cards.put,tone:h.OI_SIDE_COLOR.put,text:(0,y.cardText)(fe.cards.put,fe),cue:Ie.current}),(0,w.jsx)($,{card:fe.cards.call,tone:h.OI_SIDE_COLOR.call,text:(0,y.cardText)(fe.cards.call,fe),cue:Ie.current})]}),(0,w.jsxs)(l.default,{style:[i.s.row,{gap:6,height:18}],children:[(0,w.jsx)(l.default,{style:{width:8,height:8,backgroundColor:h.MAX_PAIN_COLOR,transform:[{rotate:'45deg'}]}}),(0,w.jsx)(S.Typed,{text:(0,y.maxPainText)(ge,xe,fe)||'Max pain not reported for this reading.',cue:Ie.current,order:2,style:{...O,fontSize:11,lineHeight:15,color:i.C.muted}})]})]})]}),(0,w.jsx)(l.default,{...We,accessibilityRole:"adjustable",accessibilityLabel:"Drag to resize the chart and the interpretation",title:'Drag to resize',style:{width:14,alignItems:'center',justifyContent:'center',cursor:'col-resize'},children:(0,w.jsx)(l.default,{style:{width:4,height:44,borderRadius:2,backgroundColor:i.C.line}})}),(0,w.jsxs)(l.default,{style:{flex:1,minWidth:0,borderWidth:1,borderColor:i.C.line,borderRadius:12,backgroundColor:i.C.paper,overflow:'hidden'},children:[(0,w.jsxs)(l.default,{style:[i.s.row,{paddingHorizontal:12,minHeight:44,borderBottomWidth:1,borderColor:i.C.line,ga
1050p:8}],children:[(0,w.jsx)(i.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:11,lineHeight:16,letterSpacing:1,textTransform:'uppercase',color:i.C.ink,flexShrink:1},children:"Market interpretation"}),(0,w.jsx)(i.T,{numberOfLines:2,style:{fontSize:11,lineHeight:14,color:i.C.muted,flexShrink:1},children:b.INTERP_TAG}),(0,w.jsx)(l.default,{style:{flex:1}}),fe&&(0,w.jsxs)(i.T,{style:T,children:["as of ",fe.time," IST"]}),(0,w.jsx)(R,{value:N,items:[{id:'beginner',label:'Beginner'},{id:'experienced',label:'Experienced'}],onChange:U('mode',B,'m'),label:"How much to show"})]}),(0,w.jsxs)(r.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:12},children:[(0,w.jsx)(b.StoryBlock,{cue:Ie.current,d:{label:`The story since ${(0,f.clockOf)(ie?.readings[0]?.at)||'the open'} \xb7 as of ${Ce.asOf}`,headline:Ce.headline,headSo:Ce.headSo,lines:Ce.lines,watch:Ce.keyStrikes}}),Te.length>0&&(0,w.jsxs)(l.default,{style:{gap:4},children:[(0,w.jsxs)(i.T,{style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',letterSpacing:.8,textTransform:'uppercase',color:i.C.amber},children:["Reading by reading",fe?.spacing?` \xb7 every ${Math.round(fe.spacing)} min`:'']}),(0,w.jsxs)(l.default,{style:[i.s.row,{gap:8,paddingVertical:4,borderBottomWidth:1,borderColor:i.C.line}],children:[(0,w.jsx)(i.T,{style:{...T,width:38},children:"Time"}),(0,w.jsx)(i.T,{style:{...T,width:70},children:"Spot (\u0394)"}),(0,w.jsx)(i.T,{style:{...T,width:96},children:"Put OI below"}),(0,w.jsx)(i.T,{style:{...T,width:96},children:"Call OI above"}),(0,w.jsx)(i.T,{style:{...T,width:58},children:"ATM IV"}),(0,w.jsx)(i.T,{style:{...T,flex:1},children:"What changed vs the reading before"})]}),Te.map((e,t)=>(0,w.jsxs)(l.default,{style:[i.s.row,{gap:8,alignItems:'flex-start',paddingVertical:5,borderBottomWidth:1,borderColor:i.C.lineSoft}],children:[(0,w.jsx)(i.T,{style:{...k,width:38,color:i.C.ink},children:e.time}),(0,w.jsxs)(l.default,{style:{width:70},children:[(0,w.jsx)(i.T,{style:{...k,color:i.C.ink},children:e.spot}),null!=e.dSpot&&(0,w.jsxs)(i.T,{style:{...T,color:e.dSpot>=0?i.C.green:i.C.red},children:[e.dSpot>=0?'+':'',e.dSpot.toFixed(0)]})]}),(0,w.jsxs)(l.default,{style:{width:96},children:[(0,w.jsx)(i.T,{style:{...k,color:null==e.dPe?i.C.muted:e.dPe>=0?i.C.green:i.C.red},children:e.pe}),(0,w.jsx)(i.T,{style:T,children:e.peRange})]}),(0,w.jsxs)(l.default,{style:{width:96},children:[(0,w.jsx)(i.T,{style:{...k,color:null==e.dCe?i.C.muted:e.dCe>=0?i.C.green:i.C.red},children:e.ce}),(0,w.jsx)(i.T,{style:T,children:e.ceRange})]}),(0,w.jsxs)(l.default,{style:{width:58},children:[(0,w.jsx)(i.T,{style:{...k,color:i.C.ink},children:e.atmIv}),null!=e.dIv&&(0,w.jsx)(i.T,{style:{...T,color:e.dIv>0?i.C.amber:i.C.muted},children:f.fmt.pts(e.dIv)})]}),(0,w.jsx)(l.default,{style:{flex:1},children:(0,w.jsx)(S.Typed,{text:e.note,order:ye.length,cue:Ie.current,animate:0===t,marks:I,style:{...O,lineHeight:16,color:'Unavailable'===e.tag?i.C.muted:i.C.ink}})})]},e.at))]}),je&&(0,w.jsx)(i.T,{style:T,children:"\"Call OI wall\" and \"put OI base\" are the usual trader reading of open interest by side and place; open interest alone does not show who traded. Arithmetic on the readings captured so far - not a forecast."})]})]})]})};var t=_r(_d[0]),n=e(_r(_d[1])),r=e(_r(_d[2])),l=e(_r(_d[3])),i=_r(_d[4]),o=_r(_d[5]),s=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),f=_r(_d[11]),p=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]),C=_r(_d[15]),b=_r(_d[16]),j=_r(_d[17]),S=_r(_d[18]),w=_r(_d[19]);const I={fontFamily:S.KEY_FONT,color:i.C.blue,backgroundColor:i.C.blueBg,borderRadius:4,paddingHorizontal:4,fontSize:'0.88em'},v='derivative-studio',T={fontSize:11,lineHeight:15,color:i.C.muted},O={fontFamily:S.PROSE_FONT,fontSize:13,lineHeight:19,color:i.C.ink},k={fontSize:12,lineHeight:16,fontVariant:['tabular-nums']};function R({value:e,items:t,onChange:r,label:o}){return(0,w.jsx)(l.default,{accessibilityRole:"radiogroup",accessibilityLabel:o,style:[i.s.row,{gap:0,borderWidth:1,borderColor:i.C.line,borderRadius:u.CTRL.radius,overflow:'hidden'}],children:t.map((t,l)=>{const o=t.id===e;return(0,w.jsx)(n.default,{role:"radio","aria-checked":o,accessibilityState:{checked:o},onPress:()=>r(t.id),style:e=>[{minHeight:u.CTRL.h,paddingHorizontal:u.CTRL.padX,justifyContent:'center',borderLeftWidth:l?1:0,borderColor:i.C.line,backgroundColor:o?i.C.soft:e.hovered?i.C.dark:'transparent'}],children:(0,w.jsx)(i.T,{style:{fontSize:u.CTRL.font,lineHeight:u.CTRL.lineHeight,fontFamily:o?'InterSemi':'InterMedium',color:o?i.C.green:i.C.ink},children:t.label})},String(t.id))})})}function M({swatch:e,label:t}){return(0,w.jsxs)(l.default,{style:[i.s.row,{gap:5}],children:[e,(0,w.jsx)(i.T,{style:T,children:t})]})}const _=({color:e,hatch:t})=>(0,w.jsx)(l.default,{style:{width:12,height:12,borderRadius:2,backgroundColor:t?i.C.paper:e,opacity:t?1:.85,borderWidth:t?1.5:0,borderColor:e,borderStyle:t?'dashed':'solid'}}),L=({dashed:e})=>(0,w.jsx)(l.default,{style:{width:18,height:0,borderTopWidth:2,borderColor:e?i.C.curve:i.C.ink,borderStyle:e?'dotted':'solid'}}),H=(i.C.green,i.C.blue,i.C.amber,i.C.muted,84);
1050function $({card:e,tone:t,text:n,cue:r}){return(0,w.jsxs)(l.default,{style:{flex:1,minWidth:0,height:H,borderLeftWidth:3,borderLeftColor:t,borderRadius:6,backgroundColor:i.C.dark,paddingHorizontal:10,paddingVertical:6,gap:3,overflow:'hidden'},children:[(0,w.jsxs)(l.default,{style:[i.s.row,{gap:8}],children:[(0,w.jsxs)(i.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:t},children:[e.label," ",f.fmt.range(e.lo,e.hi)]}),(0,w.jsxs)(i.T,{style:T,children:[e.count," strike",1===e.count?'':'s'," ",'put'===e.side?'below':'above'," the money"]})]}),(0,w.jsx)(S.Typed,{text:n,cue:r,order:1,style:{...O,fontSize:11,lineHeight:15,color:i.C.ink}})]})}function W(e,n,r,l,i,o=!1){const[s,d]=(0,t.useState)({data:null,phase:'idle',error:'',failed:0}),c=`${i}|${e}|${n}|${r}|${o?'all':l.join(',')}`;return(0,t.useEffect)(()=>{if(!e||!r||!l.length)return void d({data:null,phase:'idle',error:'',failed:0});let t=!0;d(e=>({...e,phase:'loading'}));const i=`/api/derivatives/iv-grid-series?underlying=${encodeURIComponent(e)}${n?`&expiry=${encodeURIComponent(n)}`:''}&at=${encodeURIComponent(r)}`,s=o?['all']:(0,f.ivLegChunks)(l);return Promise.all(s.map(e=>(0,p.api)(`${i}&legs=${encodeURIComponent(e)}`).then(e=>e).catch(()=>null))).then(e=>{if(!t)return;const{series:n,failed:r}=(0,f.mergeIvChunks)(e);d({data:n,phase:n?'done':'error',error:n?'':'the IV route did not answer',failed:r})}),()=>{t=!1}},[c]),s}},957,[11,375,278,13,821,871,921,933,932,934,928,958,197,929,959,960,961,963,962,6]); 1051__d(function(g,_r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SIDE_VIEWS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"WINDOWS",{enumerable:!0,get:function(){return n}}),e.readingSpacing=t,e.readingsBack=r,Object.defineProperty(e,"IV_LEGS_PER_REQUEST",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"STRIKE_WINDOW",{enumerable:!0,get:function(){return i}}),e.drawnStrikes=function(l,n,t,r){if(!l||!l.strikes?.length)return[];const u=l.strikes,i=null!=n?b(u,n):null!=t?b(u,t):Math.floor(u.length/2),a='all'===r?u.length:r;return u.slice(Math.max(0,i-a),Math.min(u.length-1,i+a)+1)},e.ivLegChunks=function(l){const n=l.flatMap(l=>[`CE:${l}`,`PE:${l}`]),t=[];for(let l=0;l<n.length;l+=u)t.push(n.slice(l,l+u).join(','));return t},e.mergeIvChunks=function(l){const n=l.filter(l=>!!l&&Array.isArray(l.readings));return n.length?{series:{...n[0],legs:n.flatMap(l=>l.legs||[])},failed:l.length-n.length}:{series:null,failed:l.length}},Object.defineProperty(e,"STRIKE_CHOICES",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"CARD_STRIKES",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"stampMs",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clockOf",{enumerable:!0,get:function(){return p}}),e.indexAtOrBefore=m,e.refSpot=v,e.nearestIndex=b,e.buildFrame=function(l,u,i,a,O=!0,x=10,y){if(!l||!l.readings?.length||!l.strikes?.length)return null;const E=m(l.readings,i);if(E<0)return null;const S=n.find(l=>l.id===a)||n[0],P=t(l.readings),T=null==S.minutes?null:r(S.minutes,P),C=null==T?null:E-T>=0?E-T:null,F=null==C?null:l.readings[C].at,A=F?Math.round(((c(l.readings[E].at)??0)-(c(F)??0))/6e4):null,$=null==S.minutes?S.ago:null!=A&&A!==S.minutes?`${A} min ago (nearest reading to ${S.label})`:S.ago,j=v(l,E),D=v(l,0),L=l.strikes,N=null!=j.value?b(L,j.value):null!=u?.atm_strike?b(L,u.atm_strike):Math.floor(L.length/2),R='all'===x?L.length:x;let W=Math.max(0,N-R),w=Math.min(L.length-1,N+R);if(y&&y.length){const l=L.indexOf(y[0]),n=L.indexOf(y[y.length-1]);l>=0&&n>=l&&(W=l,w=n)}const B=u?k(u,m(u.readings,l.readings[E].at)):-1,K=null!=S.minutes&&u?r(S.minutes,t(u.readings)):null;let V=u&&B>=0&&null!=K?k(u,B-K):-1,G=$;const H=!!u&&u.legs.some(l=>l.present&&null!=o(l.previous_close_iv_pct));if(null==S.minutes&&u&&B>0&&!H){const l=_(u);l>=0&&l<B&&(V=l,G=`first reading ${p(u.readings[l])}`)}const Q=null==S.minutes&&H,U=l.call_oi[E]||[],q=l.put_oi[E]||[],z=null==C?l.prev_close_call:l.call_oi[C],J=null==C?l.prev_close_put:l.put_oi[C],X=[];for(let l=W;l<=w;l++){const n=L[l],t=I(u,'call',n),r=I(u,'put',n);X.push({strike:n,callOi:o(U[l]),putOi:o(q[l]),callBase:o(z?.[l]),putBase:o(J?.[l]),callIv:M(t,B),putIv:M(r,B),callIvThen:Q?o(t?.previous_close_iv_pct):M(t,V),putIvThen:Q?o(r?.previous_close_iv_pct):M(r,V),otm:l<N?'put':l>N?'call':'atm'})}const Y=L.map((l,n)=>n),Z={call:f(U,Y),put:f(q,Y),dCall:d(f(U,Y),f(z,Y)),dPut:d(f(q,Y),f(J,Y))},ee=l=>{const n=[];for(let t=1;t<=s;t++){const r='put'===l?N-t:N+t;r>=0&&r<L.length&&n.push(r)}const t='put'===l?q:U,r='put'===l?J:z,u=f(t,n),i=f(r,n),a=d(u,i),c=n.map(l=>({strike:L[l],delta:(o(t[l])??0)-(o(r?.[l])??0)})).filter(l=>l.delta>
10510).sort((l,n)=>n.delta-l.delta).slice(0,3).map(l=>l.strike),p=n.map(n=>{const t=X.find(l=>l.strike===L[n]);return'put'===l?t?.putIv??null:t?.callIv??null}),m=n.map(n=>{const t=X.find(l=>l.strike===L[n]);return'put'===l?t?.putIvThen??null:t?.callIvThen??null}),v=h(p),b=h(m),I='put'===l?Z.put:Z.call,_=n.filter(l=>(o(t[l])??0)>0&&!o(r?.[l])&&null!=r).map(l=>L[l]),k=n.filter(l=>!o(t[l])&&(o(r?.[l])??0)>0).map(l=>L[l]);return{side:l,label:'put'===l?'PE':'CE',lo:n.length?L[Math.min(...n)]:null,hi:n.length?L[Math.max(...n)]:null,count:n.length,newStrikes:_,closedStrikes:k,totalOi:u,dOi:a,dOiPct:null!=a&&i?a/i*100:null,share:null!=u&&I?u/I*100:null,avgIv:v,dIv:null!=v&&null!=b&&p.filter(l=>null!=l).length===m.filter(l=>null!=l).length?v-b:null,builtAt:c.length?[Math.min(...c),Math.max(...c)]:null}},le=X.find(l=>l.strike===L[N]),ne=le?h([le.callIv,le.putIv]):null,te=le?h([le.callIvThen,le.putIvThen]):null;return{at:l.readings[E].at,time:p(l.readings[E].at),index:E,thenIndex:C,thenAt:F,ago:$,spot:j.value,spotAt:j.at,spotFallback:j.fallback,spotOpen:D.value,atm:L[N],atmIndex:N,strikes:L.slice(W,w+1),rows:X,ivAt:B>=0&&u?u.readings[B]:null,ivThenAt:V>=0&&u?u.readings[V]:null,ivKnown:X.some(l=>null!=l.callIv||null!=l.putIv),ivThenLabel:G,cards:{put:ee('put'),call:ee('call')},totals:Z,atmIv:ne,atmIvThen:te,readingsCount:E+1,isIndex:O,spacing:P}},e.ivFor=function(l,n,t=!1){const r=t?l.callIvThen:l.callIv,u=t?l.putIvThen:l.putIv;return'calls'===n?r:'puts'===n?u:'call'===l.otm?r:'put'===l.otm?u:h([r,u])},Object.defineProperty(e,"fmt",{enumerable:!0,get:function(){return O}});const l=[{id:'combined',label:'Combined'},{id:'calls',label:'Calls only'},{id:'puts',label:'Puts only'}],n=[{id:'1d',label:'1D',minutes:null,ago:'previous close'},{id:'15m',label:'15m',minutes:15,ago:'15 min ago'},{id:'30m',label:'30m',minutes:30,ago:'30 min ago'},{id:'1h',label:'1h',minutes:60,ago:'1 h ago'}];function t(l){if(!l||l.length<2)return null;const n=[];for(let t=1;t<l.length;t++){const r=c('string'==typeof l[t-1]?l[t-1]:l[t-1].at),u=c('string'==typeof l[t]?l[t]:l[t].at);null!=r&&null!=u&&u>r&&n.push((u-r)/6e4)}return n.length?(n.sort((l,n)=>l-n),n[Math.floor(n.length/2)]):null}function r(l,n){return Math.max(1,Math.round(l/(n||15)))}const u=200,i=9;const a=[{id:5,label:'\xb15'},{id:10,label:'\xb110'},{id:15,label:'\xb115'},{id:'all',label:'All'}],s=5,o=l=>'number'==typeof l&&Number.isFinite(l)?l:null,c=l=>{if(!l)return null;const n=Date.parse(String(l).replace(' ','T'));return Number.isFinite(n)?n:null},p=l=>{const n=/(\d{2}):(\d{2})/.exec(l||'');return n?`${n[1]}:${n[2]}`:l||''},d=(l,n)=>null==l||null==n?null:l-n,f=(l,n)=>{if(!l)return null;let t=0,r=!1;return(n||l.map((l,n)=>n)).forEach(n=>{const u=o(l[n]);null!=u&&(t+=u,r=!0)}),r?t:null},h=l=>{const n=l.filter(l=>null!=l);return n.length?n.reduce((l,n)=>l+n,0)/n.length:null};function m(l,n){if(!l||!l.length)return-1;const t=c(n);let r=-1;return l.forEach((l,n)=>{const u='string'==typeof l?l:l.at,i=c(u);(null==t||null==i||i<=t)&&(r=n)}),r}function v(l,n){for(let t=n;t>=0;t--){const r=o(l.readings[t]?.spot);if(null!=r)return{value:r,at:l.readings[t].at,fallback:t!==n}}return{value:null,at:null,fallback:!1}}function b(l,n){let t=0;return l.forEach((r,u)=>{Math.abs(r-n)<Math.abs(l[t]-n)&&(t=u)}),t}function I(l,n,t){if(!l||!Array.isArray(l.legs))return null;const r='call'===n?'CE':'PE';return l.legs.find(l=>l.present&&l.option_type===r&&l.strike===t)||null}function _(l){for(let n=0;n<l.readings.length;n++)if(l.legs.some(l=>l.present&&null!=o(l.iv_pct?.[n])))return n;return-1}function k(l,n){for(let t=n;t>=0;t--)if(l.legs.some(l=>l.present&&null!=o(l.iv_pct?.[t])))return t;return-1}const M=(l,n)=>l&&null!=n&&n>=0?o(l.iv_pct?.[n]):null;const O={oi(l){if(null==l)return'\u2014';const n=Math.abs(l),t=l<0?'\u2212':'';return n>=1e7?t+(n/1e7).toFixed(n>=1e8?1:2).replace(/\.?0+$/,'')+' Cr':n>=1e5?t+(n/1e5).toFixed(n>=1e6?0:1).replace(/\.0$/,'')+' L':n>=1e3?t+(n/1e3).toFixed(n>=1e4?0:1).replace(/\.0$/,'')+'k':t+Math.round(n).toString()},signedOi:l=>null==l?'\u2014':(l>0?'+':'')+O.oi(l),pct:(l,n=1)=>null==l?'\u2014':(l>0?'+':'')+l.toFixed(n)+'%',iv:l=>null==l?'\u2014':l.toFixed(1)+'%',pts(l){if(null==l)return'\u2014';const n=Math.round(10*l)/10;return(n>0?'+':n<0?'\u2212':'')+Math.abs(n).toFixed(1)},strike:l=>
1051null==l?'\u2014':Math.round(l).toLocaleString('en-IN'),spot:(l,n=!0)=>null==l?'\u2014':(n?'':'\u20b9')+l.toLocaleString('en-IN',{minimumFractionDigits:2,maximumFractionDigits:2}),range:(l,n)=>null==l||null==n?'\u2014':l===n?O.strike(l):`${O.strike(l)}\u2013${O.strike(n)}`}},958,[]); 1052__d(function(g,_r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"arrow",{enumerable:!0,get:function(){return s}}),e.sessionSummary=function(l,n){if(!l)return[{label:'Session',tag:'Unavailable',text:'No reading captured at or before the one on screen.'}];const a=[],{put:u,call:d}=l.cards;if(null!=l.spot&&null!=l.spotOpen){const n=l.spot-l.spotOpen,s=l.spotOpen?n/l.spotOpen*100:null;a.push({label:'Spot',tag:'Observed',text:`${t.fmt.spot(l.spotOpen,l.isIndex)} \u2192 ${t.fmt.spot(l.spot,l.isIndex)} (${n>0?'+':''}${n.toFixed(2)}, ${t.fmt.pct(s,2)}) across ${l.readingsCount} reading${1===l.readingsCount?'':'s'}${l.spotFallback?` \xb7 spot last read ${(0,t.clockOf)(l.spotAt)}`:''}.`})}else a.push({label:'Spot',tag:'Unavailable',text:'No spot captured in this session yet.'});const r=(o,i,u)=>{if(null==o.totalOi)return a.push({label:i,tag:'Unavailable',text:`No open interest captured on the ${o.count||t.CARD_STRIKES} strikes ${u} the money.`});const d=o.builtAt?` Most of the ${null!=o.dOi&&o.dOi<0?'fall':'build'} sits at ${t.fmt.range(o.builtAt[0],o.builtAt[1])}.`:'';a.push({label:`${i} ${'below'===u?'\u2212':'+'}1\u2026${'below'===u?'\u2212':'+'}${o.count}`,tag:'Observed',text:null==o.dOi?`${t.fmt.oi(o.totalOi)} standing on ${t.fmt.range(o.lo,o.hi)}; the ${l.ago} baseline was not captured.`:`${s(o.dOi)} ${t.fmt.signedOi(o.dOi)} (${t.fmt.pct(o.dOiPct)}) since ${l.ago} on ${t.fmt.range(o.lo,o.hi)}; ${t.fmt.oi(o.totalOi)} standing, ${null==o.share?'\u2014':o.share.toFixed(0)+'%'} of all ${i} OI.${d}`,state:'experienced'===n?`\u0394OI ${t.fmt.signedOi(o.dOi)} \xb7 base ${t.fmt.oi(null!=o.totalOi&&null!=o.dOi?o.totalOi-o.dOi:null)} \xb7 strikes ${o.count}`:void 0})};if(r(u,'Put OI','below'),r(d,'Call OI','above'),l.ivKnown){const s=o(l,'put'),i=o(l,'call'),u=null!=l.atmIv&&null!=l.atmIvThen?`ATM IV ${t.fmt.iv(l.atmIvThen)} \u2192 ${t.fmt.iv(l.atmIv)} (${t.fmt.pts(l.atmIv-l.atmIvThen)} pts)`:null!=l.atmIv?`ATM IV ${t.fmt.iv(l.atmIv)}; no ${l.ago} value to compare`:'ATM IV not solved',d=null!=l.cards.call.avgIv&&null!=l.cards.put.avgIv?` Calls above the money carry ${l.cards.call.avgIv>l.cards.put.avgIv?'more':'less'} IV than puts below (${t.fmt.iv(l.cards.call.avgIv)} vs ${t.fmt.iv(l.cards.put.avgIv)}).`:'';a.push({label:'IV',tag:'Model estimate',text:`Put side ${s}; call side ${i} since ${l.ago}. ${u}.${d}`,state:'experienced'===n?`solved from last traded premiums at ${(0,t.clockOf)(l.ivAt)}${l.ivThenAt?` vs ${(0,t.clockOf)(l.ivThenAt)}`:''}; a leg without a premium has no IV`:void 0})}else a.push({label:'IV',tag:'Unavailable',text:'Implied volatility could not be solved at this reading (no usable premiums).'});return a.push(...i(l,n)),a},e.readingRows=function(a,s,o){if(!a||!o)return[];const i=a.strikes,r=[];for(let d=o.index;d>=1;d--){const p=(0,t.refSpot)(a,d),c=(0,t.refSpot)(a,d-1),h=null!=p.value?(0,t.nearestIndex)(i,p.value):o.atmIndex,f=[],m=[];for(let l=1;l<=t.CARD_STRIKES;l++)h-l>=0&&f.push(h-l),h+l<i.length&&m.push(h+l);const v=n(a.put_oi[d],f),b=n(a.put_oi[d-1],f),$=n(a.call_oi[d],m),I=n(a.call_oi[d-1],m),O=null!=v&&null!=b?v-b:null,w=null!=$&&null!=I?$-I:null,x=(n,a,s)=>{const o=n.map(t=>({k:t,d:(l(a[t])??0)-(l(s[t])??0)})).filter(t=>t.d>0).sort((t,l)=>l.d-t.d).slice(0,3).map(t=>i[t.k]);return o.length?t.fmt.range(Math.min(...o),Math.max(...o)):'\u2014'};let M=null,k=null;if(s){const n=(0,t.indexAtOrBefore)(s.readings,a.readings[d].at),o=(0,t.indexAtOrBefore)(s.readings,a.readings[d-1].at),u=s.legs.filter(t=>t.present&&t.strike===i[h]),r=t=>{const n=u.map(n=>t>=0?l(n.iv_pct?.[t]):null).filter(t=>null!=t);return n.length?n.reduce((t,l)=>t+l,0)/n.length:null};M=r(n),k=n!==o?r(o):null}const C=null!=M&&null!=k?M-k:null,P=null==p.value||null==c.value||p.fallback?null:p.value-c.value;r.push({at:a.readings[d].at,time:(0,t.clockOf)(a.readings[d].at),spot:t.fmt.spot(p.value,o.isIndex),dSpot:P,pe:t.fmt.signedOi(O),peRange:x(f,a.put_oi[d]||[],a.put_oi[d-1]||[]),dPe:O,ce:t.fmt.signedOi(w),ceRange:x(m,a.call_oi[d]||[],a.call_oi[d-1]||[]),dCe:w,atmIv:t.fmt.iv(M),dIv:C,note:u(O,w,C,P),tag:null==O||null==w?'Unavailable':'Observed'})}for(let t=0;t<r.length-1;t++)r[t].note=d(r[t+1],r[t]);return r},e.noteFor=u,e.cardText=function(l,n){const a='put'===l.side?'Put':'Call';if(null==l.totalOi)return`No ${a.toLowerCase()} OI captured on these strikes.`;if(null==l.dOi)return`${t.fmt.oi(l.totalOi)} standing; the ${n.ago} baseline was not captured, so no change is measured.`;const s=null==l.dOiPct?'':Math.abs(l.dOiPct)>=15?' - a large move':Math.abs(l.dOiPct)>=5?' - a clear move':Math.abs(l.dOiPct)<1?' - flat':'',o=[`${a} OI ${l.dOi>0?'rose':l.dOi<0?'fell':'held'} ${t.fmt.signedOi(l.dOi)} (${t.fmt.pct(l.dOiPct)}) since ${n.ago}${s}.`];l.builtAt&&l.dOi>0&&o.push(`Mostly at ${t.fmt.range(l.builtAt[0],l.builtAt[1])}.`);l.newStrikes.length?o.push(`New: ${l.newStrikes.map(l=>t.fmt.strike(l)).join(', ')}.`):o.push('No new strikes.');l.closedStrikes.length&&o.push(`${l.closedStrikes.map(l=>t.fmt.strike(l)).join(', ')} emptied.`);null!=l.dIv?o.push(`IV ${Math.abs(l.dIv)<.15?'steady':l.dIv>0?'up '+t.fmt.pts(l.dIv):'down '+t.fmt.pts(l.dIv)} at ${t.fmt.iv(l.avgIv)}.`):null!=l.avgIv&&o.push(`IV ${t.fmt.iv(l.avgIv)}.`);return o.join(' ')},e.maxPainText=function(l,n,a){return null==l?null:null==n?`Max pain ${t.fmt.strike(l)}; no ${a.ago} value to compare.`:n===l?`Max pain unchanged at ${t.fmt.strike(l)} since ${a.ago}.`:`Max pain moved ${l>n?'up':'down'} ${t.fmt.strike(n)} \u2192 ${t.fmt.strike(l)} since ${a.ago}.`},e.changeNote=d;var t=_r(_d[0]);const l=t=>'number'==typeof t&&Number.isFinite(t)?t:null,n=(t,n)=>{if(!t)return null;let a=0,s=!1;for(const o of n){const n=l(t[o]);null!=n&&(a+=n,s=!0)}return s?a:null},a=(t,l,n,a)=>null==t?'':t>0?l:t<0?n:a,s=t=>null==t?'':t>0?"\u25b2":t<0?"\u25bc":"\u25b6";function o(l,n){const a=l.rows.filter(t=>t.otm===n).map(t=>{const l='put'===n?t.putIv:t.callIv,a='put'===n?t.putIvThen:t.callIvThen;return null!=l&&null!=a?l-a:null}).filter(t=>null!=t);if(!a.length)return'no change measured';const s=Math.min(...a),o=Math.max(...a);return Math.abs(o-s)<.15?`${t.fmt.pts((s+o)/2)}
1052 pts`:`${t.fmt.pts(s)} to ${t.fmt.pts(o)} pts`}function i(l,n){const s=l.cards.call.dOi,o=l.cards.put.dOi;if(null==s||null==o)return[{label:'Reading',tag:'Unavailable',text:`The ${l.ago} baseline is missing on one side, so the two sides cannot be compared.`}];const i=null!=l.atmIv&&null!=l.atmIvThen?l.atmIv-l.atmIvThen>.3?' with ATM IV rising':l.atmIv-l.atmIvThen<-.3?' with ATM IV easing':' with ATM IV steady':'',u=Math.abs(s)>1.1*Math.abs(o)?'calls':Math.abs(o)>1.1*Math.abs(s)?'puts':'both sides about equally';let d;d=s>0&&o>0?`Consistent with new option positions opening on both sides, heavier in ${u}; open interest alone does not say which side wrote and which bought.`:s>0&&o<=0?"Consistent with new call positions above spot while put positions below are being closed - or with put holders exiting as spot moved; OI alone does not separate these.":s<=0&&o>0?"Consistent with new put positions below spot while call positions above are being closed - or with call holders exiting as spot moved; OI alone does not separate these.":"Consistent with positions closing on both sides: a shrinking book, which is not a direction.";const r="Build-up words are heuristics from OI and premium; nothing here is a forecast.",p=[{label:'Reading',tag:'Observed',text:`Call OI above spot ${a(s,'rose','fell','held')} ${t.fmt.signedOi(s)} and put OI below spot ${a(o,'rose','fell','held')} ${t.fmt.signedOi(o)} since ${l.ago}${i}.`},{label:'',tag:'Possible explanation',text:d}];if('beginner'===n)p.push({label:'',tag:'Observed',text:r});else{const n=l.totals.call?`${t.fmt.oi(l.totals.put)} / ${t.fmt.oi(l.totals.call)} = ${null!=l.totals.put?(l.totals.put/l.totals.call).toFixed(2):'\u2014'}`:'\u2014';p.push({label:'',tag:'Observed',text:r,state:`state \xb7 \u0394CE(+1..+${l.cards.call.count}) ${t.fmt.signedOi(s)} \xb7 \u0394PE(\u22121..\u2212${l.cards.put.count}) ${t.fmt.signedOi(o)} \xb7 \u0394IV atm ${null!=l.atmIv&&null!=l.atmIvThen?t.fmt.pts(l.atmIv-l.atmIvThen)+' pts':'\u2014'} \xb7 \u0394spot ${null!=l.spot&&null!=l.spotOpen?(l.spot-l.spotOpen>0?'+':'')+(l.spot-l.spotOpen).toFixed(0):'\u2014'} \xb7 PCR (all strikes) ${n}`})}return p}function u(t,l,n,a){if(null==t||null==l)return'One side was not captured at this reading.';const s=(t,l)=>Math.abs(t)>1.25*Math.abs(l);let o;o=l>0&&t>0?s(l,t)?'OI added on both sides, more above spot in calls':s(t,l)?'OI added on both sides, more below spot in puts':'OI added on both sides about equally':l>0&&t<=0?t<0?'Call OI above spot added while put OI below spot came off':'Call OI above spot added; put OI below spot unchanged':l<=0&&t>0?l<0?'Put OI below spot added while call OI above spot came off':'Put OI below spot added; call OI above spot unchanged':l<0&&t<0?'OI came off on both sides':'Little change on either side';return o+(null==a?'':a>0?' as spot rose':a<0?' as spot fell':'')+(null==n?'':n>.3?'; ATM IV up':n<-.3?'; ATM IV down':'; ATM IV steady')+'.'}function d(l,n){const a=(l,n,a)=>{if(null==n||null==a)return'';const s=t=>t>0?'adding':t<0?'unwinding':'flat';if(Math.sign(n)!==Math.sign(a))return`${l} turned to ${s(a)} (${t.fmt.signedOi(n)} \u2192 ${t.fmt.signedOi(a)})`;if(0===a)return`${l} still flat`;const o=Math.abs(a)>1.3*Math.abs(n)?', faster':Math.abs(a)<.7*Math.abs(n)?', slower':'';return`${l} kept ${s(a)}${o}`},s=[a('Puts',l.dPe,n.dPe),a('Calls',l.dCe,n.dCe)].filter(Boolean),o=null!=n.dPe&&null!=n.dCe?n.dPe>0&&n.dCe<0?' \u2192 put OI rising, call OI falling.':n.dCe>0&&n.dPe<0?' \u2192 call OI rising, put OI falling.':n.dPe<0&&n.dCe<0?' \u2192 OI falling on both sides.':n.dPe>0&&n.dCe>0?' \u2192 OI rising on both sides.':'':'';return s.length?s.join('; ')+'.'+o:n.note}},959,[958]); 1053__d(function(g,_r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.sessionStory=function(n,o,c,h){const p={ok:!1,headline:'',headSo:'',lines:[],phases:[],zones:[],keyStrikes:[],counts:{callUp:0,callDown:0,putUp:0,putDown:0},asOf:''};if(!n||!n.readings.length)return{...p,headline:'No reading captured yet in this session.'};const f=(0,l.indexAtOrBefore)(n.readings,c);if(f<1)return{...p,headline:'Only one reading so far - the story starts with the next one.'};const b=(0,l.refSpot)(n,f).value,O=(0,l.refSpot)(n,0).value;if(null==b)return{...p,headline:'No spot captured yet, so above / below the money is unknown.'};const{above:w,below:I}=t(n,b),$=s(n,'call',w,0,f),v=s(n,'put',I,0,f),k=(l,n,t)=>n.filter(n=>{const a=i(l,0,n),s=i(l,f,n);return null!=a&&null!=s&&Math.sign(s-a)===t}).length,_={callUp:k(n.call_oi,w,1),callDown:k(n.call_oi,w,-1),putUp:k(n.put_oi,I,1),putDown:k(n.put_oi,I,-1)},y=a(n.call_oi,0,w),M=a(n.call_oi,f,w),x=a(n.put_oi,0,I),U=a(n.put_oi,f,I),D=null!=y&&null!=M?M-y:null,T=null!=x&&null!=U?U-x:null,B=(l,i)=>null!=l&&i?l/i*100:null,S=d(n,'call',f,w),F=d(n,'put',f,I),C=f-1,N=null!=a(n.call_oi,f,w)&&null!=a(n.call_oi,C,w)?a(n.call_oi,f,w)-a(n.call_oi,C,w):null,V=null!=a(n.put_oi,f,I)&&null!=a(n.put_oi,C,I)?a(n.put_oi,f,I)-a(n.put_oi,C,I):null,j=O?(b-O)/O*100:null,q=n.underlying||'',z=$[0],A=v[0],L=null==D?'':D<0?'thinning':'thickening',P=null==T?'':T>0?'building':'thinning',E=null!=j&&null!=D&&null!=T&&(j<0&&T>0&&D<0||j>0&&D>0&&T<0),G=(null!=D&&null!=T&&(T>0&&D<=0||(D>0&&T<=0||(Math.abs(T),Math.abs(D)))),l=>[...l].reverse().find(l=>'flat'!==l.dir)),H=(G(S),G(F),[]);let J='',K='';const Q=(l,i,n)=>H.push({t:l,so:i,tag:n}),R=`${q} ${l.fmt.spot(b,o?.isIndex)}${null!=j?` (${j>=0?'+':''}${j.toFixed(2)}
1053% since the open)`:''}`;if('beginner'===h){const i=(i,n,t)=>{const a=G(i),s=a?[...i].slice(0,i.indexOf(a)).reverse().find(l=>'flat'!==l.dir&&l.dir!==a.dir):void 0;if(!a)return'call'===n?'call OI above has been quiet':'put OI below has been quiet';const o='call'===n?'unwind'===a.dir?'the call OI wall above is thinning':'the call OI wall above is getting thicker':'build'===a.dir?'the put OI base below is getting stronger':'the put OI base below is thinning';return`${'call'===n?'call':'put'} OI ${'build'===a.dir?'has been building':'has been unwinding'} since ${(0,l.clockOf)(a.from)} (${l.fmt.signedOi(a.delta)})${s?` after ${'build'===s.dir?'building':'unwinding'} ${r(s)}`:''} - ${o}${t?`, most at ${u(t)}`:''}`},n=$.find(l=>l.dir===(G(S)?.dir||'')),t=v.find(l=>l.dir===(G(F)?.dir||'')),a=i(S,'call',n),s=i(F,'put',t);J=`${R}. ${a[0].toUpperCase()}${a.slice(1)}. ${s[0].toUpperCase()}${s.slice(1)}.`;const d=G(S)?.dir,c=G(F)?.dir;K='unwind'===d&&'build'===c?'put OI below the money rising while call OI above falls':'build'===d&&'unwind'===c?'call OI above the money rising while put OI below falls':'build'===d&&'build'===c?'OI rising on both sides of the money':'unwind'===d&&'unwind'===c?'OI falling on both sides of the money':'','unwind'===d&&'build'===c?Q('Put side gaining, call side fading.','put OI below is rising while call OI above falls - consistent with fresh put writing and call unwinding.'):'build'===d&&'unwind'===c?Q('Call side gaining, put side fading.','call OI above is rising while put OI below falls - consistent with fresh call writing and put unwinding.'):'build'===d&&'build'===c?Q('Both sides adding.','OI added on both sides - the call OI wall and the put OI base are both growing.'):'unwind'===d&&'unwind'===c&&Q('Both sides unwinding.','OI is falling on both sides - the call OI wall and the put OI base are both shrinking.'),null!=o?.atmIv&&null!=o.atmIvThen&&Q(o.atmIv<o.atmIvThen?'Option premiums cooling (IV down).':'Option premiums firming (IV up).',o.atmIv<o.atmIvThen?'options are getting cheaper; a smaller implied move.':'options are getting dearer; a larger implied move.','model')}else{J=`${R}; ${E?'the options book is diverging from price - ':''}call OI above the money ${null==D?'unavailable':`${D>=0?'+':''}${l.fmt.signedOi(D).replace(/^\+/,'')} (${(B(D,y)??0).toFixed(1)}%)`}, put OI below ${null==T?'unavailable':`${l.fmt.signedOi(T)} (${(B(T,x)??0).toFixed(1)}%)`} since ${(0,l.clockOf)(n.readings[0].at)}.`;const i=[G(S)&&`call OI ${'build'===G(S).dir?'building':'unwinding'} since ${(0,l.clockOf)(G(S).from)} (${l.fmt.signedOi(G(S).delta)})`,G(F)&&`put OI ${'build'===G(F).dir?'building':'unwinding'} since ${(0,l.clockOf)(G(F).from)} (${l.fmt.signedOi(G(F).delta)})`].filter(Boolean).join('; '),t=G(S)?.dir,a=G(F)?.dir;i&&Q(`Current phase: ${i}.`,'unwind'===t&&'unwind'===a?'OI falling on both sides.':'unwind'===t&&'build'===a?'put OI rising below while call OI above falls.':'build'===t&&'unwind'===a?'call OI rising above while put OI below falls.':'build'===t&&'build'===a?'OI rising on both sides.':''),Q(`Breadth: calls ${_.callUp}\u25b2 ${_.callDown}\u25bc of ${w.length} above; puts ${_.putUp}\u25b2 ${_.putDown}\u25bc of ${I.length} below.`,_.callUp>_.callDown&&_.putUp>_.putDown?'OI rising across most strikes since the open, not at one strike.':_.callDown>_.callUp&&_.putUp>_.putDown?'the call wall is weakening broadly while the put base widens.':_.callUp>_.callDown&&_.putDown>_.putUp?'the call wall is widening while the put base weakens.':'mixed - no side moved as a block.'),z&&Q(`Biggest call move: ${u(z)} ${l.fmt.signedOi(z.delta)}${null!=z.pct?` (${z.pct.toFixed(0)}%)`:''} - the call OI wall ${L}.`,'build'===z.dir?'largest call OI build so far.':'largest call OI drop so far.'),A&&Q(`Biggest put move: ${u(A)} ${l.fmt.signedOi(A.delta)}${null!=A.pct?` (${A.pct.toFixed(0)}%)`:''} - the put OI base ${P}.`,'build'===A.dir?'largest put OI build so far.':'largest put OI drop so far.'),null!=o?.atmIv&&null!=o.atmIvThen&&Q(`ATM IV ${l.fmt.iv(o.atmIvThen)} \u2192 ${l.fmt.iv(o.atmIv)} (${l.fmt.pts(o.atmIv-o.atmIvThen)} pts, ${o.ago}).`,o.atmIv<o.atmIvThen?'premiums cooling.':'premiums firming - the market prices a bigger move.','model'),Q(`Latest reading (${(0,l.clockOf)(n.readings[f].at)}): call OI ${null==N?'\u2014':l.fmt.signedOi(N)}, put OI ${null==V?'\u2014':l.fmt.signedOi(V)}.`,null==N||null==V?'':N<0&&V<0?'OI fell on both sides in the last 5 minutes.':V>0&&N<0?'put side gained in the last 5 minutes.':N>0&&V<0?'call side gained in the last 5 minutes.':N>0&&V>0?'OI added on both sides in the last 5 minutes.':'little change in the last 5 minutes.')}const W=$.find(l=>l.dir===(G(S)?.dir||''))||z,X=v.find(l=>l.dir===(G(F)?.dir||''))||A,Y=[];X&&Y.push({side:'put',k:'build'===X.dir?X.hi:X.lo,why:'build'===X.dir?`most put OI added (${l.fmt.signedOi(X.delta)}) - the put OI base`:`put OI leaving (${l.fmt.signedOi(X.delta)}) - the put OI base is thinning`});W&&Y.push({side:'call',k:W.lo,why:'build'===W.dir?`most call OI added (${l.fmt.signedOi(W.delta)}) - the call OI wall`:`call OI leaving (${l.fmt.signedOi(W.delta)}) - the call OI wall is thinning`});return{ok:!0,headline:J,headSo:K,lines:H,phases:[...F,...S],zones:[...$.slice(0,2),...v.slice(0,2)],keyStrikes:Y,counts:_,asOf:(0,l.clockOf)(n.readings[f].at)}},e.phaseLine=function(i){return`${r(i)} \xb7 ${'call'===i.side?'call OI':'put OI'} ${'build'===i.dir?'building':'unwind'===i.dir?'unwinding':'flat'}${'flat'===i.dir?'':` ${l.fmt.signedOi(i.delta)}`}`};var l=_r(_d[0]);const i=(l,i,n)=>{return t=l[i]?.[n],'number'==typeof t&&Number.isFinite(t)?t:null;var t},n=5;function t(i,t){const a=(0,l.nearestIndex)(i.strikes,t),s=[],o=[];for(let l=1;l<=n;l++)a-l>=0&&o.push(a-l),a+l<i.strikes.length&&s.push(a+l);return{above:s,below:o.reverse()}}const a=(l,n,t)=>{let a=0,s=!1;for(const o of t){const t=i(l,n,o);null!=t&&(a+=t,s=!0)}return s?a:null};function s(l,n,t,a,s){const o='call'===n?l.call_oi:l.put_oi,d=t.map(n=>{const t=i(o,a,n),d=i(o,s,n);return{i:n,k:l.strikes[n],a:t,d:null!=t&&null!=d?d-t:null}}),u=[];let r=[];const c=()=>
1053{if(!r.length)return;const l=r.reduce((l,i)=>l+(i.d||0),0),i=r.reduce((l,i)=>l+(i.a||0),0);u.push({side:n,lo:Math.min(...r.map(l=>l.k)),hi:Math.max(...r.map(l=>l.k)),delta:l,pct:i?l/i*100:null,dir:l>=0?'build':'unwind'}),r=[]};for(const l of d)null!=l.d&&0!==l.d?(r.length&&Math.sign(r[r.length-1].d)!==Math.sign(l.d)&&c(),r.push(l)):c();return c(),u.sort((l,i)=>Math.abs(i.delta)-Math.abs(l.delta))}const o=.06;function d(l,i,n,t){const s='call'===i?l.call_oi:l.put_oi,d=[];for(let i=0;i<=n;i++){const n=a(s,i,t);null!=n&&d.push({t:l.readings[i].at,v:n})}if(d.length<2)return[];const u=[];let r=0,c=0,h=0;for(let l=1;l<d.length;l++){const n=o*Math.max(d[c].v,1);0!==h?1===h&&d[l].v>=d[c].v||-1===h&&d[l].v<=d[c].v?c=l:Math.abs(d[l].v-d[c].v)>n&&(u.push({side:i,dir:1===h?'build':'unwind',from:d[r].t,to:d[c].t,delta:d[c].v-d[r].v}),r=c,h=1===h?-1:1,c=l):Math.abs(d[l].v-d[r].v)>n&&(h=d[l].v>d[r].v?1:-1,c=l)}const p=d.length-1;if(0!==h&&u.push({side:i,dir:1===h?'build':'unwind',from:d[r].t,to:d[c].t,delta:d[c].v-d[r].v}),c<p&&0!==h){const l=d[p].v-d[c].v;u.push({side:i,dir:Math.abs(l)<=o*Math.max(d[c].v,1)?'flat':l>0?'build':'unwind',from:d[c].t,to:d[p].t,delta:l})}return 0===h&&u.push({side:i,dir:'flat',from:d[0].t,to:d[p].t,delta:d[p].v-d[0].v}),u}const u=i=>i.lo===i.hi?l.fmt.strike(i.lo):`${l.fmt.strike(i.lo)}\u2013${l.fmt.strike(i.hi)}`,r=i=>`${(0,l.clockOf)(i.from)}\u2013${(0,l.clockOf)(i.to)}`},960,[958]); 1054__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PROSE",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"MARKS",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"INTERP_TAG",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"SECTION",{enumerable:!0,get:function(){return p}}),_e.storyMs=b,_e.useStoryDone=T,_e.StoryBlock=function({d:e,cue:t,compact:n}){const h=T(e,t),b=y(e.headSo);let x=(0,c.typeMs)(e.headline+b);const j=n?{...u,fontSize:13,lineHeight:19}:{...u,fontSize:14,lineHeight:22};return(0,d.jsxs)(l.default,{style:{gap:n?3:8},children:[(0,d.jsx)(o.T,{style:p,children:e.label}),!!e.headline&&(0,d.jsx)(c.Typed,{text:e.headline,tail:b,at:0,cue:t,marks:f,style:{...u,fontSize:15,lineHeight:23}}),e.lines.map((e,n)=>{const l=y(e.so,'model'===e.tag),s=x;return x+=(0,c.typeMs)(e.t+l),(0,d.jsx)(c.Typed,{text:e.t,tail:l,at:s,cue:t,marks:f,style:j,lead:(0,d.jsx)(o.T,{style:{color:o.C.muted,fontSize:13,lineHeight:19},children:"\u2022 "})},n)}),h&&!!e.watch?.length&&(0,d.jsxs)(l.default,{style:{gap:5,paddingTop:4},children:[(0,d.jsx)(o.T,{style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',letterSpacing:.5,textTransform:'uppercase',color:o.C.muted},children:e.watchTitle||'Strikes to watch'}),e.watch.map(e=>{const t='put'===e.side?s.OI_SIDE_COLOR.put:s.OI_SIDE_COLOR.call;return(0,d.jsxs)(l.default,{style:[o.s.row,{gap:8}],children:[(0,d.jsx)(l.default,{style:{borderWidth:1,borderColor:t,borderRadius:6,paddingHorizontal:8,paddingVertical:2,minWidth:62,alignItems:'center'},children:(0,d.jsx)(o.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:t},children:S(e.k)})}),(0,d.jsx)(o.T,{style:{flex:1,fontSize:12,lineHeight:17,color:o.C.ink},children:e.why})]},`${e.side}${e.k}`)})]})]})};var e,t=r(_d[0]),n=r(_d[1]),l=(e=n)&&e.__esModule?e:{default:e},o=r(_d[2]),s=r(_d[3]),c=r(_d[4]),d=r(_d[5]);const u={fontFamily:c.PROSE_FONT,fontSize:13,lineHeight:19,color:o.C.ink},f={fontFamily:c.KEY_FONT,color:o.C.blue,backgroundColor:o.C.blueBg,borderRadius:4,paddingHorizontal:4,fontSize:'0.88em'},h='Possible explanations \xb7 model estimates \xb7 not advice',p={fontSize:11,lineHeight:15,fontFamily:'InterSemi',letterSpacing:.8,textTransform:'uppercase',color:o.C.amber},y=(e,t)=>e?` \u2192 ${e.replace(/\.$/,'')}`:'',S=e=>e.toLocaleString('en-IN');function b(e){return(0,c.typeMs)(e.headline+y(e.headSo))+e.lines.reduce((e,t)=>e+(0,c.typeMs)(t.t+y(t.so,'model'===t.tag)),0)}function T(e,n){const l=(0,t.useMemo)(()=>b(e),[e]),[o,s]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{s(!1);const e=setTimeout(()=>s(!0),l);return()=>clearTimeout(e)},[l,e.headline,n]),o}},961,[11,13,821,934,962,6]); 1055__d(function(g,r,_i,a,_m,_e,d){"use strict";
1055function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TYPING",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"PROSE_FONT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"KEY_FONT",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"TYPEWRITER_FONT",{enumerable:!0,get:function(){return f}}),_e.typedPrefix=y,_e.useTyped=p,_e.markWords=P,Object.defineProperty(_e,"typeMs",{enumerable:!0,get:function(){return E}}),_e.Typed=function({text:e,tail:n,tailStyle:u,at:c,order:s=0,cue:f=0,animate:m=!0,style:h,arrows:y,marks:x,lead:E}){const M=e+(n||''),S=p(m?M:'',s,f,c),{shown:R,done:_,finish:j}=m?S:{shown:M,done:!0,finish:()=>{}},w=_?M:R,O=w.slice(0,e.length),I=w.slice(e.length),v=e=>y?'\u25b2'===e?y.up:'\u25bc'===e?y.down:'\u25b6'===e?y.flat:void 0:void 0,A={fontFamily:(i.default.flatten(h)||{}).fontFamily},F=(e,n)=>{const t=e.split(/(\s+)/),i=x?P(t,x):[];return t.map((e,t)=>{if(/^\s+$/.test(e))return e;const u=[A,n,_?null:T,v(e)?{color:v(e),fontFamily:'InterSemi'}:null];if(!i[t])return(0,l.jsx)(o.T,{style:u,children:e},t);const c=/^([^A-Za-z-]*)([A-Za-z-]+)([^A-Za-z-]*)$/.exec(e)||['',' ',e,''];return(0,l.jsxs)(o.T,{style:u,children:[c[1],(0,l.jsx)(o.T,{style:[i[t],_?null:T],children:c[2]}),c[3]]},t)})};return null==c||_||R?(0,l.jsx)(t.default,{onPress:_?void 0:j,disabled:_,accessibilityLabel:M,style:{minWidth:0},children:(0,l.jsxs)(o.T,{style:h,children:[E,F(O),!!I&&F(I,u),!_&&!R&&null==c&&(0,l.jsx)(o.T,{style:[b,{color:o.C.muted}],children:"\u25cf"})]})}):null};var n=r(d[0]);r(d[1]);var t=e(r(d[2])),i=e(r(d[3])),o=r(d[4]),l=r(d[5]);const u={SPEED:260,GRAIN:'word',STAGGER_MS:60,RETYPE:'changed',TICK_MS:33},c='Serif',s='KeyMono',f="'Courier Prime','IBM Plex Mono','Courier New',Courier,monospace";let m=null;function h(){if(null==m)try{m=!!globalThis.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches}catch{m=!1}return m}function y(e,n,t=u.SPEED,i=u.GRAIN){const o=Math.min(e.length,Math.floor(n/1e3*t));if(o>=e.length)return e;if('char'===i)return e.slice(0,o);const l=e.lastIndexOf(' ',o);return l<=0?'':e.slice(0,l)}function p(e,t=0,i=0,o){const[l,c]=(0,n.useState)(()=>h()?e:''),s=(0,n.useRef)(null),f=(0,n.useRef)(null),m=(0,n.useRef)(null),p=(0,n.useRef)(i);(0,n.useEffect)(()=>{const n=p.current!==i;if(p.current=i,h()||'changed'===u.RETYPE&&m.current===e&&!n)return c(e),void(m.current=e);m.current=e,c(''),s.current=null;const l=null!=o?o:t*u.STAGGER_MS,T=()=>{const n=performance.now();null==s.current&&(s.current=n);const t=y(e,n-s.current);c(t),t.length<e.length&&(f.current=setTimeout(T,u.TICK_MS))};return f.current=setTimeout(T,l),()=>{f.current&&clearTimeout(f.current)}},[e,t,i,o]);return{shown:l,done:l.length>=e.length,finish:()=>{f.current&&clearTimeout(f.current),c(e)}}}const T={animationKeyframes:[{from:{opacity:0,filter:'blur(5px)',transform:'translateY(2px)'},to:{opacity:1,filter:'blur(0px)',transform:'translateY(0px)'}}],animationDuration:'320ms',animationTimingFunction:'cubic-bezier(.2,.7,.2,1)',animationFillMode:'both'},b={animationKeyframes:[{'0%':{opacity:.25},'50%':{opacity:1},'100%':{opacity:.25}}],animationDuration:'1.1s',animationIterationCount:'infinite'},x=/^(gaining|gained|firming|stronger|building|adding|added|thickening|strengthening|fading|thinning|thins|weakens|weakening|weaker|exit|exits|exiting|unwinding|leaving|loosening|losing|cooling|firming|rising|falling)$/i;function P(e,n){return e.map(e=>{const t=e.replace(/[^A-Za-z-]/g,'');return t&&x.test(t)?n:void 0})}const E=e=>Math.ceil(e.length/u.SPEED*1e3)+80},962,[11,136,375,26,821,6]); 1056__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.OiIvChart=function({frame:t,view:l,width:r,height:v,showIv:b,showChange:O,maxPain:C,active:I,onActive:M}){const T=k(t),S=(0,e.useMemo)(()=>{const t={x:f.left,y:f.top,w:Math.max(10,r-f.left-f.right),h:Math.max(10,v-f.top-f.bottom)},e=T.rows.length,i=t.w/Math.max(1,e),n=t=>'calls'===l?[{side:'call',oi:t.callOi,base:t.callBase}]:'puts'===l?[{side:'put',oi:t.putOi,base:t.putBase}]:'call'===t.otm?[{side:'call',oi:t.callOi,base:t.callBase}]:'put'===t.otm?[{side:'put',oi:t.putOi,base:t.putBase}]:[{side:'put',oi:t.putOi,base:t.putBase},{side:'call',oi:t.callOi,base:t.callBase}];let s=0,a=1/0,u=-1/0;T.rows.forEach(t=>{n(t).forEach(t=>{s=Math.max(s,t.oi??0,O?t.base??0:0)}
1056),b&&[(0,o.ivFor)(t,l),(0,o.ivFor)(t,l,!0)].forEach(t=>{null!=t&&(a=Math.min(a,t),u=Math.max(u,t))})});const h=p(s),c=h[h.length-1]||1;Number.isFinite(a)||(a=0,u=1);const d=Math.max(2,u-a),x=Math.max(0,Math.floor(a-.35*d)),m=Math.ceil(u+.3*d),y=e=>t.x+i*(e+.5),k=Math.max(4,Math.min(.62*i,34));return{plot:t,n:e,band:i,barsOf:n,oiSteps:h,oiTop:c,ivLo:x,ivHi:m,xAt:y,yOi:e=>t.y+t.h-e/c*t.h,yIv:e=>t.y+t.h-(e-x)/(m-x)*t.h,pos:t=>{const e=T.strikes;if(e.length<2)return null;if(t<e[0]||t>e[e.length-1])return null;for(let l=0;l<e.length-1;l++)if(t>=e[l]&&t<=e[l+1]){const r=(t-e[l])/(e[l+1]-e[l]);return y(l)+r*i}return null},barW:k,labelEvery:i>=56?1:i>=30?2:i>=20?3:4,ivLabelEvery:i>=44?1:i>=26?2:i>=16?3:i>=10?5:8}},[T,l,r,v,b,O]),{plot:$,band:F,barsOf:L,oiSteps:A,ivLo:R,ivHi:B,xAt:E,yOi:_,yIv:W,pos:z,barW:P,labelEvery:D,ivLabelEvery:G}=S,V=null!=T.spot?z(T.spot):null,q=(0,e.useMemo)(()=>{const t=[],e=Math.max(1,Math.round((B-R)/4));for(let l=Math.ceil(R);l<=B;l+=e)t.push(l);return t},[R,B]),H=t=>T.rows.map((e,r)=>{const i=(0,o.ivFor)(e,l,t);return null==i?null:{x:E(r),y:W(i),v:i,side:'calls'===l?'call':'puts'===l?'put':e.otm,i:r}}),N=b?H(!1):[],U=b?H(!0):[],X=t=>'call'===t?u.OI_SIDE_COLOR.call:'put'===t?u.OI_SIDE_COLOR.put:n.C.ink,J=t=>{const e=Math.floor((t-$.x)/F);return e>=0&&e<T.rows.length?T.rows[e].strike:null};return(0,h.jsxs)(i.default,{style:{width:r,height:v},...M?{onPointerMove:t=>M(J(t.nativeEvent.offsetX??t.nativeEvent.locationX)),onPointerLeave:()=>M(null)}:{},children:[(0,h.jsxs)(a.default,{width:r,height:v,'aria-hidden':!0,children:[(0,h.jsxs)(s.Defs,{children:[['call','put'].map(t=>(0,h.jsxs)(s.Pattern,{id:`hatch-${t}`,patternUnits:"userSpaceOnUse",width:7,height:7,patternTransform:"rotate(45)",children:[(0,h.jsx)(s.Rect,{width:7,height:7,fill:n.C.paper}),(0,h.jsx)(s.Line,{x1:0,y1:0,x2:0,y2:7,stroke:X(t),strokeWidth:2.4})]},t)),['call','put'].map(t=>(0,h.jsx)(s.Pattern,{id:`ghost-${t}`,patternUnits:"userSpaceOnUse",width:6,height:6,patternTransform:"rotate(-45)",children:(0,h.jsx)(s.Line,{x1:0,y1:0,x2:0,y2:6,stroke:X(t),strokeWidth:1.2,strokeOpacity:.55})},t+'-ghost'))]}),A.map(t=>(0,h.jsxs)(s.G,{children:[(0,h.jsx)(s.Line,{x1:$.x,x2:$.x+$.w,y1:_(t),y2:_(t),stroke:n.C.lineSoft,strokeWidth:1}),(0,h.jsx)(s.Text,{x:$.x-6,y:_(t)+4,fontFamily:c,fontSize:x,fill:n.C.muted,textAnchor:"end",children:m(t)})]},'g'+t)),(0,h.jsx)(s.Text,{x:14,y:$.y+$.h/2,fontFamily:c,fontSize:x,fill:n.C.muted,textAnchor:"middle",transform:`rotate(-90 14 ${$.y+$.h/2})`,children:"Open interest"}),b&&q.map(t=>(0,h.jsxs)(s.Text,{x:$.x+$.w+6,y:W(t)+4,fontFamily:c,fontSize:x,fill:n.C.muted,children:[t,"%"]},'iv'+t)),b&&(0,h.jsx)(s.Text,{x:r-12,y:$.y+$.h/2,fontFamily:c,fontSize:x,fill:n.C.muted,textAnchor:"middle",transform:`rotate(90 ${r-12} ${$.y+$.h/2})`,children:"Implied volatility (%)"}),null!=I&&T.rows.some(t=>t.strike===I)&&(0,h.jsx)(s.Rect,{x:E(T.rows.findIndex(t=>t.strike===I))-F/2,y:$.y,width:F,height:$.h,fill:n.C.hoverBg,rx:4}),T.rows.map((t,e)=>{const l=L(t),r=2===l.length?Math.min(.7*P,.44*F):P;return(0,h.jsx)(s.G,{children:l.map((t,i)=>{if(null==t.oi)return null;const n=2===l.length?E(e)-r-1+i*(r+2):E(e)-r/2,o=X(t.side),a=_(t.oi),u=_(0),c=O&&null!=t.base?t.oi-t.base:null;return(0,h.jsxs)(s.G,{children:[(0,h.jsx)(s.Rect,{x:n,y:null!=c&&c>0?_(t.base):a,width:r,height:Math.max(0,u-(null!=c&&c>0?_(t.base):a)),fill:o,fillOpacity:.78,rx:2}),null!=c&&c>0&&(0,h.jsx)(s.Rect,{x:n,y:a,width:r,height:Math.max(0,_(t.base)-a),fill:`url(#hatch-${t.side})`,stroke:o,strokeWidth:1,rx:2}),null!=c&&c<0&&(0,h.jsx)(s.Rect,{x:n,y:_(t.base),width:r,height:Math.max(0,a-_(t.base)),fill:`url(#ghost-${t.side})`,stroke:o,strokeOpacity:.5,strokeDasharray:"2 2",rx:2})]},t.side)})},t.strike)}),null!=V&&(0,h.jsxs)(s.G,{children:[(0,h.jsx)(s.Line,{x1:V,x2:V,y1:$.y-4,y2:$.y+$.h,stroke:u.SPOT_COLOR,strokeWidth:1.2,strokeDasharray:"4 4"}),(0,h.jsx)(s.Rect,{x:V-46,y:2,width:92,height:28,rx:6,fill:n.C.paper,stroke:n.C.line}),(0,h.jsxs)(s.Text,{x:V,y:13,fontFamily:c,fontSize:x,fill:n.C.muted,textAnchor:"middle",children:["Spot",T.spotFallback?` \xb7 ${T.spotAt?.slice(11,16)}`:'']}),(0,h.jsx)(s.Text,{x:V,y:26,fontFamily:d,fontSize:12,fill:n.C.ink,textAnchor:"middle",children:o.fmt.spot(T.spot,T.isIndex)})]}),b&&(0,h.jsxs)(s.G,{children:[(0,h.jsx)(s.Path,{d:(t=>{let e='',l=!1;return t.forEach(t=>{t?(e+=`${l?'L':'M'}${t.x.toFixed(1)} ${t.y.toFixed(1)} `,l=!0):l=!1}),e})(U),fill:"none",stroke:n.C.curve,strokeWidth:1.6,strokeDasharray:"2 4",strokeLinecap:"round"}),U.map(t=>t&&(0,h.jsx)(s.Circle,{cx:t.x,cy:t.y,r:2.8,fill:n.C.bg,stroke:n.C.curve,strokeWidth:1.4},'t'+t.i)),U.map((t,e)=>{const l=N[e];if(!t||e%G!==0||l&&Math.abs(l.v-t.v)<.3)return null;const r=!l||t.v>l.v;return(0,h.jsx)(y,{x:t.x,y:r?t.y-8:t.y+15,fill:n.C.curve,semi:!1,text:`${t.v.toFixed(1)}%`},'tl'+t.i)}),N.map((t,e)=>{const l=N[e+1];if(!t||!l)return null;const r=X('atm'===t.side?l.side:t.side);return(0,h.jsx)(s.Line,{x1:t.x,y1:t.y,x2:l.x,y2:l.y,stroke:r,strokeWidth:2},'s'+t.i)}),N.map(t=>t&&(0,h.jsx)(s.Circle,{cx:t.x,cy:t.y,r:3.2,fill:n.C.ink,stroke:n.C.bg,strokeWidth:1.2},'n'+t.i)),N.map((t,e)=>{const l=U[e];if(!t||e%G!==0)return null;const r=!l||t.v>=l.v;return(0,h.jsx)(y,{x:t.x,y:r?t.y-8:t.y+15,fill:X(t.side),semi:!0,text:`${t.v.toFixed(1)}%`},'nl'+t.i)})]}),null!=C&&null!=z(C)&&(0,h.jsxs)(s.G,{children:[(0,h.jsx)(s.Path,{d:`M${z(C)} ${$.y+$.h-6} l5 6 l-5 6 l-5 -6 z`,fill:u.MAX_PAIN_COLOR}),(0,h.jsx)(s.Text,{x:z(C),y:$.y+$.h+33,fontFamily:d,fontSize:x,fill:u.MAX_PAIN_COLOR,textAnchor:"middle",children:"Max pain"})]}),(0,h.jsx)(s.Line,{x1:$.x,x2:$.x+$.w,y1:$.y+$.h,y2:$.y+$.h,stroke:n.C.line}),T.rows.map((t,e)=>{const l=t.strike===T.atm;return l||e%D===0?!l&&D>1&&1===Math.abs(e-T.rows.findIndex(t=>t.strike===T.atm))?null:(0,h.jsx)(s.Text,{x:E(e),y:$.y+$.h+17,fontFamily:l?d:c,fontSize:x,fill:l?n.C.ink:n.C.muted,textAnchor:"middle",children:o.fmt.strike(t.strike)},'x'+t.strike):null})]}),O&&(0,h.jsx)(j,{items:T.rows.flatMap((t,e)=>L(t).flatMap((l,r,i)=>{if(null==l.oi||null==l.base)return[];const o=l.oi-l.base;if(!o)return[];const s=l.base?Math.abs(o)/l.base*100:100,a=s>=25?3:s>=3?1:0;if(!a)return[];const u=2===i.length?Math.min(.7*P,.44*F):P,h=2===i.length?E(e)-u-1+r*(u+2)+u/2:E(e);if(u<12)return[];const c=Math.min(_(l.oi),_(l.base));return[{key:`${t.strike}-${l.side}`,x:h,y:c-4,n:a,up:o>0,color:o>0?X(l.side):n.C.muted}]}))}),null!=I&&(()=>{const t=T.rows.findIndex(t=>t.strike===I);if(t<0)return null;const e=T.rows[t],l=E(t);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(i.default,{pointerEvents:"none",style:{position:'absolute',left:l-.5,top:$.y,width:1,height:$.h,backgroundColor:n.C.ink,opacity:.35}}),(0,h.jsx)(w,{frame:T,row:e,x:l,plot:$,width:r,showIv:b})]})})()]})};var e=_r(_d[0]),l=t(_r(_d[1])),r=t(_r(_d[2])),i=t(_r(_d[3])),n=_r(_d[4]),o=_r(_d[5]),s=_r(_d[6]),a=t(s),u=_r(_d[7]),h=_r(_d[8]);const c='Inter',d='InterSemi',x=11,f={top:34,right:46,bottom:42,left:52};function p(t,e=4){if(!(t>0))return[0];const l=t/e,r=10**Math.floor(Math.log10(l)),i=l/r,n=(i<=1?1:i<=2?2:i<=2.5?2.5:i<=5?5:10)*r,o=[];for(let e=0;e<=t+1e-9;e+=n)o.push(e);return o[o.length-1]<t&&o.push(o[o.length-1]+n),o}const m=t=>t>=1e7?`${(t/1e7).toFixed(t%1e7?1:0)}Cr`:t>=1e5?`${(t/1e5).toFixed(t%1e5?1:0)}L`:t>=1e3?`${Math.round(t/1e3)}k`:`${Math.round(t)}`;function y({x:t,y:e,fill:l,semi:r,text:i}){return(0,h.jsxs)(s.G,{children:[(0,h.jsx)(s.Text,{x:t,y:e,fontFamily:r?d:c,fontSize:x,fill:n.C.paper,stroke:n.C.paper,strokeWidth:3,textAnchor:"middle",children:i}),(0,h.jsx)(s.Text,{x:t,y:e,fontFamily:r?d:c,fontSize:x,fill:l,textAnchor:"middle",children:i})]})}const v=700,b=(t,e,l)=>null==e?null:null==t?e:t+(e-t)*l;function k(t){const[l,r]=(0,e.useState)(t),i=(0,e.useRef)(t),n=(0,e.useRef)(null),o=(0,e.useRef)(t);return(0,e.useEffect)(()=>{let e=!1;try{e=!!globalThis.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches}catch{}let l=i.current;if(e||l===t)return i.current=t,o.current=t,void r(t);if(l.at===t.at&&l.ago!==t.ago&&l.strikes.join()===t.strikes.join())l={...t,rows:t.rows.map(t=>({...t,callOi:t.callBase??t.callOi,putOi:t.putBase??t.putOi,callIv:t.callIvThen??t.callIv,putIv:t.putIvThen??t.putIv}))};else if(l.strikes.join()!==t.strikes.join())return i.current=t,o.current=t,void r(t);const s=performance.now(),a=e=>{const u=Math.min(1,(e-s)/v),h=1-(1-u)**3,c=new Map(l.rows.map(t=>[t.strike,t])),d=t.rows.map(t=>{const e=c.get(t.strike);return e?{...t,callOi:b(e.callOi,t.callOi,h),putOi:b(e.putOi,t.putOi,h),callBase:b(e.callBase,t.callBase,h),putBase:b(e.putBase,t.putBase,h),callIv:b(e.callIv,t.callIv,h),putIv:b(e.putIv,t.putIv,h),callIvThen:b(e.callIvThen,t.callIvThen,h),putIvThen:b(e.putIvThen,t.putIvThen,h)}:t}),x={...t,rows:d};o.current=x,r(x),u<1?n.current=requestAnimationFrame(a):i.current=t};return n.current=requestAnimationFrame(a),()=>{null!=n.current&&cancelAnimationFrame(n.current),i.current=o.current}},[t]),l}function w({frame:t,row:e,x:l,plot:r,width:s,showIv:a}){const c=l+12+236>s-4?l-12-236:l+12,d=t.thenAt?(0,o.clockOf)(t.thenAt):'prev close',x=({swatch:t,label:e,value:l,color:r})=>(0,h.jsxs)(i.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,h.jsx)(i.default,{style:{width:10,height:10,borderRadius:3,backgroundColor:'solid'===t?r:'transparent',borderWidth:'hollow'===t?1.5:0,borderColor:r,opacity:'none'===t?0:1}}),(0,h.jsx)(n.T,{style:{flex:1,fontSize:11,lineHeight:15,color:n.C.muted},children:e}),(0,h.jsx)(n.T,{style:{fontSize:12,lineHeight:15,fontFamily:'InterSemi',color:n.C.ink,fontVariant:['tabular-nums']},children:l})]}),f=(e,l,r,n,s,u)=>{const c=null!=l&&null!=r?l-r:null;return(0,h.jsxs)(i.default,{style:{gap:3},children:[(0,h.jsx)(x,{swatch:"solid",label:`${e} OI at ${t.time}`,value:o.fmt.oi(l),color:u}),(0,h.jsx)(x,{swatch:"hollow",label:`${e} OI change`,value:null==c?'\u2014':`${c>0?'\u25b2 ':c<0?'\u25bc ':''}${o.fmt.signedOi(c)}`,color:u}),(0,h.jsx)(x,{swatch:"none",label:`${e} OI at ${d}`,value:o.fmt.oi(r),color:u}),a&&(null!=n||null!=s)&&(0,h.jsx)(x,{swatch:"none",label:`${e} IV ${o.fmt.iv(s)} \u2192 `,value:o.fmt.iv(n),color:u})]})};return(0,h.jsxs)(i.default,{pointerEvents:"none",style:{position:'absolute',left:c,top:r.y+8,width:236,backgroundColor:n.C.paper,borderWidth:1,borderColor:n.C.line,borderRadius:8,padding:10,gap:8,shadowColor:n.C.shadow,shadowOpacity:.35,shadowRadius:20,shadowOffset:{width:0,height:6}},children:[(0,h.jsxs)(n.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:n.C.ink},children:["Strike ",o.fmt.strike(e.strike),e.strike===t.atm?' \xb7 at the money':'']}),f('Put',e.putOi,e.putBase,e.putIv,e.putIvThen,u.OI_SIDE_COLOR.put),f('Call',e.callOi,e.callBase,e.callIv,e.callIvThen,u.OI_SIDE_COLOR.call)]})}function j({items:t}){const i=(0,e.useRef)(new l.default.Value(1)).current,[n,o]=(0,e.useState)(!1);(0,e.useEffect)(()=>{let t=!1;try{t=!!globalThis.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches}catch{}if(o(t),t)return;const e=l.default.loop(l.default.sequence([l.default.timing(i,{toValue:.15,duration:600,easing:r.default.inOut(r.default.quad),useNativeDriver:!0}),l.default.timing(i,{toValue:1,duration:600,easing:r.default.inOut(r.default.quad),useNativeDriver:!0})]));return e.start(),()=>e.stop()},[i]);return(0,h.jsx)(h.Fragment,{children:t.map(t=>(0,h.jsx)(l.default.View,{pointerEvents:"none",style:{position:'absolute',left:t.x-3.75,top:t.y-6-3,width:0,height:0,borderLeftWidth:3.75,borderRightWidth:3.75,borderLeftColor:'transparent',borderRightColor:'transparent',...t.up?{borderBottomWidth:6,borderBottomColor:t.color}:{borderTopWidth:6,borderTopColor:t.color},opacity:t.n>=3&&!n?i:1}},t.key))})}},963,[11,267,345,13,821,958,840,934,6]); 1057__d(function(_g,r,_i,a,m,_e,d){"use strict";
1057function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.MultiStrikeTool=function(e){const{underlying:i,expiry:l,at:s,seq:p}=e.sh,g=e.style?.height??480,[R,L]=(0,t.useState)(()=>{const e=(0,c.readStore)(w,'ms_grid').v;return S.GRID_CHOICES.some(t=>t.id===e)?e:'2x5'}),[I,M]=(0,t.useState)(()=>{const e=(0,c.readStore)(w,'ms_layers').v,t=Array.isArray(e)?e.filter(e=>S.LAYERS.some(t=>t.id===e)):[];return t.length?t:['oi','price']}),[W,H]=(0,t.useState)(()=>{const e=(0,c.readStore)(w,'oi_window').v;return y.WINDOWS.some(t=>t.id===e)?e:'15m'}),[_,E]=(0,t.useState)(()=>'experienced'===(0,c.readStore)(w,'mode').m?'experienced':'beginner'),[F,z]=(0,t.useState)(null),P=(e,t,i="v")=>n=>{t(n),(0,c.writeStore)(w,e,{[i]:n})},A=(0,f.useOiSession)(i?(0,x.oiSessionPath)({underlying:i,expiry:l||null}):null),D='ready'===A?.state?A.session:null,G=(0,t.useMemo)(()=>(0,S.gridStrikes)(D,s,R,F),[D,s,R,F]),N=G.strikes.flatMap(e=>[`CE:${e}`,`PE:${e}`]).join(','),Y=(0,u.useSharedRead)(i&&s&&N?`/api/derivatives/iv-grid-series?underlying=${encodeURIComponent(i)}${l?`&expiry=${encodeURIComponent(l)}`:''}&at=${encodeURIComponent(s)}&legs=${encodeURIComponent(N)}`:null,p),B=(0,t.useMemo)(()=>(0,S.buildGrid)(D,Y.data||null,s,W,G.strikes,G.atm,G.spot),[D,Y.data,s,W,G]),U=(0,t.useMemo)(()=>(0,b.multiStrikeStory)(D,B,s,_),[D,B,s,_]),X=`${B?.at}|${W}|${R}|${_}|${F}`,q=(0,t.useRef)(0),V=(0,t.useRef)('');V.current!==X&&(V.current=X,q.current++);y.WINDOWS.find(e=>e.id===W);const J=(0,t.useMemo)(()=>{const e={};for(const t of S.LAYERS.map(e=>e.id)){const i=(B?.tiles||[]).flatMap(e=>e.points.map(e=>'oi'===t?e.oi:'doi'===t?e.doi:'iv'===t?e.iv:e.price)).filter(e=>null!=e);if(!i.length){e[t]=[0,1];continue}let n=Math.min(...i),o=Math.max(...i);if('oi'===t||'doi'===t){e[t]=[Math.min(n,0),Math.max(o,0)];continue}const l='iv'===t?2:Math.max(1,.02*Math.abs(o)),s=(n+o)/2,h=Math.max(l,1.1*(o-n));e[t]=[s-h/2,s+h/2]}return e},[B]),K='1x1'===R?1:G.strikes.length,Q=B?.tiles.filter(e=>'CE'===e.side)||[],Z=B?.tiles.filter(e=>'PE'===e.side)||[],ee=[Q,Z],te=G.strikes.length?`${y.fmt.strike(G.strikes[0])}${G.strikes.length>1?`\u2013${y.fmt.strike(G.strikes[G.strikes.length-1])}`:''}`:'',ie=I.map((e,t)=>S.LAYERS.find(t=>t.id===e).label+(0===t?' (left axis)':1===t?' (right axis)':' (header)')).join(', '),ne='1x1'===R?`One strike, ${te}: call above, put below - ${ie}. Tap any strike in 2\xd75 to open it here.`:`The ${G.strikes.length} strikes around the money (ATM ${y.fmt.strike(G.atm)} \xb1 ${(G.strikes.length-1)/2}): ${te}. Calls on top, puts below. Lines: ${ie}; each on one scale across the tiles.`;return(0,j.jsx)(k.SplitPanes,{id:"multi",height:g,initial:.62,left:(0,j.jsxs)(o.default,{style:{flex:1,height:g,minWidth:0,borderWidth:1,borderColor:h.C.line,borderRadius:12,backgroundColor:h.C.paper,overflow:'hidden'},children:[(0,j.jsxs)(o.default,{style:[h.s.row,{paddingHorizontal:12,height:44,borderBottomWidth:1,borderColor:h.C.line,gap:10,overflow:'hidden'}],children:[(0,j.jsx)(h.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:11,lineHeight:16,letterSpacing:1,textTransform:'uppercase',color:h.C.ink},children:"Multi-strike"}),(0,j.jsx)(T,{value:R,items:S.GRID_CHOICES,onChange:e=>{P('ms_grid',L)(e),'1x1'!==e&&z(null)},label:"Grid"}),(0,j.jsx)(O,{on:I,onChange:P('ms_layers',M)}),(0,j.jsx)(T,{value:W,items:y.WINDOWS.map(e=>({id:e.id,label:e.label})),onChange:P('oi_window',H),label:"Change window"}),(0,j.jsx)(o.default,{style:{flex:1}}),(0,j.jsxs)(h.T,{numberOfLines:1,style:{...v,color:h.C.ink},children:["as of ",(0,j.jsxs)(h.T,{style:{fontFamily:'InterSemi'},children:[B?B.time:(0,y.clockOf)(s)," IST"]})]})]}),(0,j.jsx)(o.default,{style:{paddingHorizontal:12,height:28,justifyContent:'center'},children:(0,j.jsx)(h.T,{numberOfLines:1,style:v,children:ne})}),(0,j.jsxs)(o.default,{style:{flex:1,minHeight:0,padding:8,paddingTop:0,gap:8},children:[!B&&(0,j.jsx)(o.default,{style:{flex:1,alignItems:'center',justifyContent:'center'},children:(0,j.jsx)(h.T,{style:v,children:A&&'loading'!==A.state?'No reading at or before the one on screen.':'Reading the session\u2026'})}),B&&ee.map((e,t)=>(0,j.jsx)(o.default,{style:[h.s.row,{flex:1,minHeight:0,gap:8,alignItems:'stretch'}],children:e.slice(0,K).map(e=>(0,j.jsx)($,{tile:e,layers:I,domains:J,atm:B.atm,focused:'1x1'===R,onFocus:()=>{z(e.strike),P('ms_grid',L)('1x1')}},e.key))},t))]})]}),right:(0,j.jsxs)(o.default,{style:{flex:1,height:g,minWidth:0,borderWidth:1,borderColor:h.C.line,borderRadius:12,backgroundColor:h.C.paper,overflow:'hidden'},children:[(0,j.jsxs)(o.default,{style:[h.s.row,{paddingHorizontal:12,height:44,borderBottomWidth:1,borderColor:h.C.line,ga
1057p:8}],children:[(0,j.jsx)(h.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:11,lineHeight:16,letterSpacing:1,textTransform:'uppercase',color:h.C.ink,flexShrink:1},children:"What these strikes show"}),(0,j.jsx)(h.T,{numberOfLines:2,style:{fontSize:11,lineHeight:14,color:h.C.muted,flexShrink:1},children:C.INTERP_TAG}),(0,j.jsx)(o.default,{style:{flex:1}}),(0,j.jsx)(T,{value:_,items:[{id:'beginner',label:'Beginner'},{id:'experienced',label:'Experienced'}],onChange:P('mode',E,'m'),label:"How much to show"})]}),(0,j.jsxs)(n.default,{style:{flex:1},contentContainerStyle:{padding:14,gap:0},children:[(0,j.jsx)(C.StoryBlock,{cue:q.current,d:{label:`The story since ${U.since||'the open'} \xb7 as of ${U.asOf||'\u2014'}`,headline:U.headline,headSo:U.headSo,lines:U.lines,watch:U.watch}}),'error'===Y.phase&&(0,j.jsxs)(h.T,{style:{...v,color:h.C.amber,paddingTop:8},children:["Price and IV for these legs could not be read: ",Y.error||'no answer',"."]})]})]})})};var t=r(d[0]),i=e(r(d[1])),n=e(r(d[2])),o=e(r(d[3])),l=r(d[4]),s=e(l),h=r(d[5]),c=r(d[6]),u=r(d[7]),f=r(d[8]),x=r(d[9]),p=r(d[10]),g=r(d[11]),y=r(d[12]),C=r(d[13]),b=r(d[14]),k=r(d[15]),S=r(d[16]),j=r(d[17]);const w='derivative-studio',v={fontSize:11,lineHeight:15,color:h.C.muted};function T({value:e,items:t,onChange:n,label:l}){return(0,j.jsx)(o.default,{accessibilityRole:"radiogroup",accessibilityLabel:l,style:[h.s.row,{gap:0,borderWidth:1,borderColor:h.C.line,borderRadius:g.CTRL.radius,overflow:'hidden'}],children:t.map((t,o)=>{const l=t.id===e;return(0,j.jsx)(i.default,{role:"radio","aria-checked":l,accessibilityState:{checked:l},onPress:()=>n(t.id),style:e=>[{minHeight:g.CTRL.h,paddingHorizontal:g.CTRL.padX,justifyContent:'center',borderLeftWidth:o?1:0,borderColor:h.C.line,backgroundColor:l?h.C.soft:e.hovered?h.C.dark:'transparent'}],children:(0,j.jsx)(h.T,{style:{fontSize:g.CTRL.font,lineHeight:g.CTRL.lineHeight,fontFamily:l?'InterSemi':'InterMedium',color:l?h.C.green:h.C.ink},children:t.label})},String(t.id))})})}const R={oi:h.C.ink,doi:h.C.swing,iv:h.C.muted,price:h.C.curve},L={oi:.85,doi:.75,iv:.9,price:.8},I=(e,t)=>'iv'===e?t.toFixed(1)+'%':'price'===e?Math.abs(t)>=100?t.toFixed(0):t.toFixed(1):y.fmt.oi(t);function M({tile:e,layers:t,width:i,height:n,domains:o}){const c=t[0],u=t[1],f={l:c?40:6,r:u?40:6,t:8,b:18},x=Math.max(10,i-f.l-f.r),p=Math.max(10,n-f.t-f.b),g=e.points.length,C=e=>f.l+(g<=1?x/2:e/(g-1)*x),b=e=>{let[t,i]=o[e];return i===t&&(i+=1,t-=1),{lo:t,hi:i,y:e=>f.t+p-(e-t)/(i-t)*p}},k=e=>{const{lo:t,hi:i}=b(e);return[t,(t+i)/2,i]},S=g>1?x<170?[0,g-1]:[0,Math.floor((g-1)/2),g-1]:[0];return(0,j.jsxs)(s.default,{width:i,height:n,'aria-hidden':!0,children:[[0,.5,1].map(e=>(0,j.jsx)(l.Line,{x1:f.l,x2:f.l+x,y1:f.t+p*e,y2:f.t+p*e,stroke:h.C.lineSoft,strokeWidth:1},e)),(0,j.jsx)(l.Line,{x1:f.l,x2:f.l+x,y1:f.t+p,y2:f.t+p,stroke:h.C.line,strokeWidth:1}),c&&k(c).map((e,t)=>(0,j.jsx)(l.Text,{x:f.l-4,y:b(c).y(e)+4,fontFamily:"Inter",fontSize:11,fill:R[c],fillOpacity:.8,textAnchor:"end",children:I(c,e)},'l'+t)),u&&k(u).map((e,t)=>(0,j.jsx)(l.Text,{x:f.l+x+4,y:b(u).y(e)+4,fontFamily:"Inter",fontSize:11,fill:R[u],fillOpacity:.8,children:I(u,e)},'r'+t)),S.map((t,i)=>e.points[t]&&(0,j.jsx)(l.Text,{x:C(t),y:f.t+p+14,fontFamily:"Inter",fontSize:11,fill:h.C.muted,textAnchor:0===i?'start':i===S.length-1?'end':'middle',children:(0,y.clockOf)(e.points[t].at)},'x'+i)),t.map(t=>{const i=e.points.map(e=>'oi'===t?e.oi:'doi'===t?e.doi:'iv'===t?e.iv:e.price).map((e,t)=>null==e?null:{i:t,v:e}).filter(e=>!!e);if(i.length<2)return null;const{y:n}=b(t);return(0,j.jsxs)(l.G,{children:['doi'===t&&(0,j.jsx)(l.Line,{x1:f.l,x2:f.l+x,y1:n(0),y2:n(0),stroke:h.C.line,strokeWidth:1,strokeDasharray:"2 3"}),(0,j.jsx)(l.Path,{d:i.map((e,t)=>`${t?'L':'M'}${C(e.i).toFixed(1)} ${n(e.v).toFixed(1)}`).join(' '),fill:"none",stroke:R[t],strokeOpacity:L[t],strokeWidth:1.4,strokeLinejoin:"round"})]},t)})]})}function O({on:e,onChange:t}){return(0,j.jsx)(o.default,{accessibilityRole:"toolbar",accessibilityLabel:"What each tile shows",style:[h.s.row,{gap:4}],children:S.LAYERS.map(n=>{const l=e.includes(n.id);return(0,j.jsxs)(i.default,{role:"checkbox","aria-checked":l,accessibilityState:{checked:l},onPress:()=>t(l?e.length>1?e.filter(e=>e!==n.id):e:[...e,n.id]),style:e=>[h.s.row,{gap:5,minHeight:g.CTRL.h,paddingHorizontal:g.CTRL.padX,borderWidth:1,borderRadius:g.CTRL.radius,borderColor:l?R[n.id]:h.C.line,backgroundColor:e.hovered?h.C.dark:'transparent'}],children:[(0,j.jsx)(o.default,{style:{width:12,height:2,backgroundColor:R[n.id],opacity:l?1:.35}}),(0,j.jsx)(h.T,{style:{fontSize:g.CTRL.font,lineHeight:g.CTRL.lineHeight,fontFamily:l?'InterSemi':'InterMedium',color:l?h.C.ink:h.C.muted},children:n.label})]},n.id)})})}function $({tile:e,layers:n,atm:l,focused:s,onFocus:c,domains:u}){const[f,x]=(0,t.useState)({w:0,h:0}),g='CE'===e.side?p.OI_SIDE_COLOR.call:p.OI_SIDE_COLOR.put,C=t=>'oi'===t?y.fmt.oi(e.now?.oi??null):'doi'===t?y.fmt.signedOi(e.dOi):'iv'===t?y.fmt.iv(e.now?.iv??null):null==e.now?.price?'\u2014':e.now.price.toFixed(2);return(0,j.jsxs)(i.default,{onPress:c,accessibilityRole:"button",accessibilityLabel:`${e.strike} ${e.side}. Open as one chart`,style:e=>[{flex:1,minWidth:0,borderWidth:1,borderColor:s?h.C.green:e.hovered?h.C.lineHover:h.C.line,borderRadius:8,backgroundColor:h.C.paper,padding:6,gap:2}],children:[(0,j.jsxs)(o.default,{style:[h.s.row,{gap:6}],children:[(0,j.jsxs)(h.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:g},children:[y.fmt.strike(e.strike)," ",e.side]}),e.strike===l&&(0,j.jsx)(h.T,{style:{...v,color:h.C.green},children:"ATM"}),(0,j.jsx)(o.default,{style:{flex:1}})]}),(0,j.jsx)(o.default,{style:[h.s.row,{gap:8,flexWrap:'wrap'}],children:n.map(t=>{const i='oi'===t||'doi'===t?e.dOi:'iv'===t?e.dIv:e.dPrice,n=null==i?'':' '+(i>=0?'\u25b2':'\u25bc')+('iv'===t?y.fmt.pts(i):'price'===t?y.fmt.pct(e.dPricePct):y.fmt.signedOi(i));return(0,j.jsxs)(h.T,{style:{...v,color:R[t]},children:[S.LAYERS.find(e=>e.id===t).label," ",C(t),'doi'!==t?n:'']},t)}
1057)}),(0,j.jsx)(o.default,{style:{flex:1,minHeight:40},onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout;x(e=>Math.abs(e.w-t)<2&&Math.abs(e.h-i)<2?e:{w:Math.round(t),h:Math.round(i)})},children:f.w>0&&(0,j.jsx)(M,{tile:e,layers:n,width:f.w,height:f.h,domains:u})})]})}},964,[11,375,278,13,840,821,871,921,933,932,934,928,958,961,965,966,967,6]); 1058__d(function(_g,_r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.leaders=l,e.multiStrikeStory=function(i,o,r,u,c=!0){const h={ok:!1,headline:'',headSo:'',lines:[],watch:[],leaders:[],asOf:'',since:''};if(!i||!i.readings.length)return{...h,headline:'No reading captured yet in this session.'};const f=(0,t.indexAtOrBefore)(i.readings,r);if(f<1)return{...h,headline:'Only one reading so far - the story starts with the next one.'};const p=(0,t.clockOf)(i.readings[0].at),g=(0,t.clockOf)(i.readings[f].at),m=(0,t.refSpot)(i,f).value,$=(0,t.refSpot)(i,0).value;if(null==m)return{...h,headline:'No spot captured yet, so the strikes around the money are unknown.',asOf:g,since:p};const O=l(i,f,m),k=t=>O.find(n=>n.side===t&&n.d>0),I=t=>O.find(n=>n.side===t&&n.d<0),b=k('call'),w=k('put'),y=I('call'),v=I('put'),M=t=>{const n=O.filter(n=>n.side===t);return n.length?n.reduce((t,n)=>t+n.d,0):null},P=M('call'),V=M('put'),x=$?(m-$)/$*100:null,S=`${i.underlying||''} ${t.fmt.spot(m,c)}${null!=x?` (${x>=0?'+':''}${x.toFixed(2)}% since ${p})`:''}`.trim(),_=[],B=(t,n,i)=>_.push({t:t,so:n,tag:i}),F=O[0],j=n=>n.half?`, half of it by ${(0,t.clockOf)(n.half)}`:'',C=null==P||null==V?'':V>0&&P<=0?'put OI rising around the money while call OI falls - consistent with fresh put writing and call unwinding.':P>0&&V<=0?'call OI rising around the money while put OI falls - consistent with fresh call writing and put unwinding.':P>0&&V>0?'OI rising on both sides of the money - OI added around spot.':P<0&&V<0?'OI falling on both sides of the money - OI fell around spot.':'',N=o?.tiles.filter(t=>'CE'===t.side)||[],A=o?.tiles.filter(t=>'PE'===t.side)||[],E=d(N),T=d(A),q=N.find(t=>t.strike===o?.atm),z=A.find(t=>t.strike===o?.atm),D=[];w?D.push({side:'put',k:w.k,why:`most put OI added around the money (${t.fmt.signedOi(w.d)}) - the put OI base`}):v&&D.push({side:'put',k:v.k,why:`most put OI leaving (${t.fmt.signedOi(v.d)}) - the put OI base is thinning`});b?D.push({side:'call',k:b.k,why:`most call OI added around the money (${t.fmt.signedOi(b.d)}) - the call OI wall`}):y&&D.push({side:'call',k:y.k,why:`most call OI leaving (${t.fmt.signedOi(y.d)}) - the call OI wall is thinning`});if(!F)return{...h,ok:!0,headline:`${S}. OI around the money has not changed since ${p}.`,asOf:g,since:p};if('beginner'===u){const i=`${S}. The biggest move around the money is ${s(F)} OI ${F.d>0?'building':'unwinding'} ${t.fmt.signedOi(F.d)}${j(F)}.`;C&&B(null!=V&&null!=P?`Calls ${P>=0?'adding':'unwinding'}, puts ${V>=0?'adding':'unwinding'} across the ${n} strikes either side.`:'One side was not captured.',C);const l='call'===F.side?w||v:b||y;if(l&&B(`On the ${l.side} side, ${s(l)} led (${t.fmt.signedOi(l.d)}).`,l.d>0?`the largest ${l.side} OI build near spot.`:`the largest ${l.side} OI drop near spot.`),null!=E||null!=T){const t=((E??0)+(T??0))/((null!=E?1:0)+(null!=T?1:0));B(Math.abs(t)<.2?'Option premiums steady (IV flat) on these strikes.':t<0?'Option premiums cooling (IV down) on these strikes.':'Option premiums firming (IV up) on these strikes.',Math.abs(t)<.2?'no change in how big a move options are pricing.':t<0?'options are getting cheaper; a smaller implied move.':'options are getting dearer; a larger implied move.','model')}return{ok:!0,headline:i,headSo:'',lines:_.slice(0,3),watch:D,leaders:O,asOf:g,since:p}}const G=`${S}; across ${t.fmt.strike(i.strikes[Math.max(0,(0,t.nearestIndex)(i.strikes,m)-n)])}\u2013${t.fmt.strike(i.strikes[Math.min(i.strikes.length-1,(0,t.nearestIndex)(i.strikes,m)+n)])} call OI ${null==P?'unavailable':t.fmt.signedOi(P)}, put OI ${null==V?'unavailable':t.fmt.signedOi(V)} since ${p}.`;C&&B(`Calls ${O.filter(t=>'call'===t.side&&t.d>0).length}\u25b2 ${O.filter(t=>'call'===t.side&&t.d<0).length}\u25bc, puts ${O.filter(t=>'put'===t.side&&t.d>0).length}\u25b2 ${O.filter(t=>'put'===t.side&&t.d<0).length}\u25bc of the strikes either side.`,C);(b||w)&&B(`Biggest builds: ${[w&&`${s(w)} ${t.fmt.signedOi(w.d)}${a(w)}${j(w)}`,b&&`${s(b)} ${t.fmt.signedOi(b.d)}${a(b)}${j(b)}
1058`].filter(Boolean).join('; ')}.`,'where OI was added most since the open.');(y||v)&&B(`Biggest unwinds: ${[v&&`${s(v)} ${t.fmt.signedOi(v.d)}${a(v)}${j(v)}`,y&&`${s(y)} ${t.fmt.signedOi(y.d)}${a(y)}${j(y)}`].filter(Boolean).join('; ')}.`,'where OI fell most since the open.');null!=E||null!=T?B(`IV on screen ${o?.priceFrom||''}: calls ${null==E?'unavailable':`${t.fmt.pts(E)} pts`}, puts ${null==T?'unavailable':`${t.fmt.pts(T)} pts`} on average.`,null!=E&&null!=T&&Math.abs(T-E)>=.5?T>E?'put IV firming relative to calls - put IV above call IV.':'call IV firming relative to puts - call IV above put IV.':'IV moved about the same on both sides.','model'):B('IV was not solved for the legs on screen.','');null==q?.dPricePct&&null==z?.dPricePct||B(`ATM ${t.fmt.strike(o?.atm??null)} premiums ${o?.priceFrom||''}: call ${t.fmt.pct(q?.dPricePct??null)}, put ${t.fmt.pct(z?.dPricePct??null)}.`,(q?.dPricePct??0)>(z?.dPricePct??0)?'the at-the-money call gained on the put.':'the at-the-money put gained on the call.');return{ok:!0,headline:G,headSo:'',lines:_.slice(0,6),watch:D,leaders:O,asOf:g,since:p}};var t=_r(_d[0]);const n=5,i=t=>'number'==typeof t&&Number.isFinite(t)?t:null;function l(l,s,a){const d=(0,t.nearestIndex)(l.strikes,a),o=[];for(let t=Math.max(0,d-n);t<=Math.min(l.strikes.length-1,d+n);t++)for(const n of['call','put']){const a='call'===n?l.call_oi:l.put_oi;let d=-1;for(let n=0;n<=s;n++)if(null!=i(a[n]?.[t])){d=n;break}const r=d>=0?i(a[d][t]):null,u=i(a[s]?.[t]);if(null==r||null==u||u===r)continue;const c=u-r;let h=null;for(let n=d;n<=s;n++){const s=i(a[n]?.[t]);if(null!=s&&Math.abs(s-r)>=Math.abs(c)/2&&Math.sign(s-r)===Math.sign(c)){h=l.readings[n].at;break}}o.push({side:n,k:l.strikes[t],d:c,pct:r?c/r*100:null,half:h})}return o.sort((t,n)=>Math.abs(n.d)-Math.abs(t.d))}const s=n=>`${t.fmt.strike(n.k)} ${'call'===n.side?'call':'put'}`,a=n=>null==n.pct?'':` (${t.fmt.pct(n.pct,0)})`,d=t=>{const n=t.map(t=>t.dIv).filter(t=>null!=t);return n.length?n.reduce((t,n)=>t+n,0)/n.length:null}},965,[958]); 1059__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.SplitPanes=function({id:e,height:n,initial:h=.5,left:f,right:v}){const[y,p]=(0,t.useState)(()=>{const t=(0,s.readStore)(d,`split_${e}`).f;return'number'==typeof t&&t>=.3&&t<=.75?t:h}),[x,b]=(0,t.useState)(0),j=(0,t.useRef)(null),w={onPointerDown:e=>{j.current={x0:e.nativeEvent.clientX??e.nativeEvent.pageX,f0:y},e.target?.setPointerCapture?.(e.nativeEvent.pointerId)},onPointerMove:e=>{const t=j.current;if(!t||!x)return;const n=e.nativeEvent.clientX??e.nativeEvent.pageX;p(Math.min(.75,Math.max(.3,t.f0+(n-t.x0)/x)))},onPointerUp:()=>{j.current&&(j.current=null,p(t=>((0,s.writeStore)(d,`split_${e}`,{f:t}),t)))}};return(0,u.jsxs)(l.default,{style:{height:n,flexDirection:'row'},onLayout:e=>b(Math.round(e.nativeEvent.layout.width)),children:[(0,u.jsx)(l.default,{style:{width:x?Math.round((x-c)*y):void 0,flex:x?void 0:1,minWidth:0},children:f}),(0,u.jsx)(l.default,{...w,accessibilityRole:"adjustable",accessibilityLabel:"Drag to resize the two panels",title:'Drag to resize',style:{width:c,alignItems:'center',justifyContent:'center',cursor:'col-resize'},children:(0,u.jsx)(l.default,{style:{width:4,height:44,borderRadius:2,backgroundColor:o.C.line}})}),(0,u.jsx)(l.default,{style:{flex:1,minWidth:0},children:v})]})};var e,t=r(_d[0]),n=r(_d[1]),l=(e=n)&&e.__esModule?e:{default:e},o=r(_d[2]),s=r(_d[3]),u=r(_d[4]);const d='derivative-studio',c=14},966,[11,13,821,871,6]); 1060__d(function(_g,_r,_i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"LAYERS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"GRID_CHOICES",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"GRID_HALF",{enumerable:!0,get:function(){return i}}),e.gridStrikes=function(l,n,s,r){if(!l||!l.strikes?.length)return{strikes:[],atm:null,spot:null};const u=(0,t.indexAtOrBefore)(l.readings,n);if(u<0)return{strikes:[],atm:null,spot:null};const o=(0,t.refSpot)(l,u).value,a=l.strikes,c=null!=o?(0,t.nearestIndex)(a,o):Math.floor(a.length/2);if('1x1'===s){return{strikes:[null!=r&&a.includes(r)?r:a[c]],atm:a[c],spot:o}}const p=i[s];return{strikes:a.slice(Math.max(0,c-p),Math.min(a.length,c+p+1)),atm:a[c],spot:o}},Object.defineProperty(e,"legsFor",{enumerable:!0,get:function(){return r}}),e.buildGrid=function(l,n,i,u,o,a,c){if(!l||!o.length)return null;const p=(0,t.indexAtOrBefore)(l.readings,i);if(p<0)return null;const f=t.WINDOWS.find(t=>
1060t.id===u)||t.WINDOWS[0],m=null==f.minutes?null:(0,t.readingsBack)(f.minutes,(0,t.readingSpacing)(l.readings)),g=l.strikes,h=l.readings.slice(0,p+1).map(t=>t.at),O=h.map(l=>n?(0,t.indexAtOrBefore)(n.readings,l):-1),b=[];for(const t of['CE','PE'])for(const i of o){const r=g.indexOf(i);if(r<0)continue;const u='CE'===t?l.call_oi:l.put_oi,o='CE'===t?l.prev_close_call[r]:l.prev_close_put[r],c=n?.legs.find(l=>l.present&&l.option_type===t&&l.strike===i)||null,p=h.map((t,l)=>{const n=s(u[l]?.[r]),i=null==m?s(o):l-m>=0?s(u[l-m]?.[r]):null,a=O[l];return{at:t,oi:n,doi:null!=n&&null!=i?n-i:null,iv:c&&a>=0?s(c.iv_pct?.[a]):null,price:c&&a>=0?s(c.last_price?.[a]):null}}),f=p[p.length-1]||null,$=null==m?null:p.length-1-m,k=null!=$&&$>=0?p[$]:null,v=null==m?s(o):k?.oi??null,x=null!=f?.oi&&null!=v?f.oi-v:null,I=null==m?p.find(t=>null!=t.price)||null:k,P=null==m?p.find(t=>null!=t.iv)||null:k,w=null!=f?.price&&null!=I?.price?f.price-I.price:null;b.push({key:`${t}${i}`,side:t,strike:i,offset:null==a?0:Math.round((i-a)/(g[1]-g[0]||1)),points:p,now:f,then:k,dOi:x,dOiPct:null!=x&&v?x/v*100:null,dPrice:w,dPricePct:null!=w&&I?.price?w/I.price*100:null,dIv:null!=f?.iv&&null!=P?.iv?f.iv-P.iv:null})}const $=null==m?null:h[h.length-1-m]||null;return{at:h[h.length-1],time:(0,t.clockOf)(h[h.length-1]),atm:a,spot:c,strikes:o,tiles:b,ago:null==f.minutes?'the previous close':f.ago,thenTime:$?(0,t.clockOf)($):null,legs:r(o),readings:h,priceFrom:null==f.minutes?`since ${(0,t.clockOf)(h[0])}`:`since ${f.ago}`}},e.quadrant=u,e.gridLines=function(l,n){if(!l||!l.tiles.length)return[{label:'Grid',tag:'Unavailable',text:'No reading captured at or before the one on screen.'}];const i=[],s=1===l.strikes.length?t.fmt.strike(l.strikes[0]):`${t.fmt.strike(l.strikes[0])}\u2013${t.fmt.strike(l.strikes[l.strikes.length-1])}`,r=l.tiles.filter(t=>'CE'===t.side),a=l.tiles.filter(t=>'PE'===t.side),c=t=>{const l=t.map(t=>t.dOi).filter(t=>null!=t);return l.length?l.reduce((t,l)=>t+l,0):null},p=c(r),f=c(a);i.push({label:'On screen',tag:'Observed',text:`${1===l.strikes.length?'Strike':'Strikes'} ${s} around the money (ATM ${t.fmt.strike(l.atm)}), calls on top, puts below, as of ${l.time}.`}),null==p&&null==f?i.push({label:'OI',tag:'Unavailable',text:`The ${l.ago} baseline is not captured for these strikes.`}):i.push({label:'OI',tag:'Observed',text:`Since ${l.ago}: call OI ${null==p?'not measured':(p>=0?'\u25b2 ':'\u25bc ')+t.fmt.signedOi(p)}, put OI ${null==f?'not measured':(f>=0?'\u25b2 ':'\u25bc ')+t.fmt.signedOi(f)} across these strikes.`});const m=[...l.tiles].filter(t=>null!=t.dOi).sort((t,l)=>Math.abs(l.dOi)-Math.abs(t.dOi))[0];m&&m.dOi&&i.push({label:'Largest',tag:'Observed',text:`The biggest move is ${t.fmt.strike(m.strike)} ${o(m.side)}: ${t.fmt.signedOi(m.dOi)}${null!=m.dOiPct?` (${t.fmt.pct(m.dOiPct)})`:''}, premium ${null==m.dPrice?'not measured':(m.dPrice>=0?'up ':'down ')+t.fmt.pct(m.dPricePct)+' '+l.priceFrom}.`});const g=l.tiles.filter(t=>null!=t.dIv);if(g.length){const n=g.sort((t,l)=>Math.abs(l.dIv)-Math.abs(t.dIv))[0];i.push({label:'IV',tag:'Model estimate',text:`IV moved most at ${t.fmt.strike(n.strike)} ${o(n.side)} (${t.fmt.pts(n.dIv)} pts ${l.priceFrom}, now ${t.fmt.iv(n.now?.iv??null)}).`})}else i.push({label:'IV',tag:'Unavailable',text:'IV was not solved for these legs over this window.'});for(const s of l.strikes){const o=r.find(t=>t.strike===s),c=a.find(t=>t.strike===s),p=t=>t?u(t.dOi,t.dPrice):null,f=p(o),m=p(c),g=`${t.fmt.strike(s)}${s===l.atm?' (ATM)':''}`;f||m?i.push({label:g,tag:'Possible explanation',text:('experienced'===n?`OI since ${l.ago}, premium ${l.priceFrom}: `:'')+[f?`calls ${f} (OI ${t.fmt.signedOi(o.dOi)}, premium ${t.fmt.pct(o.dPricePct)})`:null,m?`puts ${m} (OI ${t.fmt.signedOi(c.dOi)}, premium ${t.fmt.pct(c.dPricePct)})`:null].filter(Boolean).join('; ')+'.'}):'experienced'===n&&i.push({label:g,tag:'Observed',text:`Calls ${null==o?.dOi?'\u2014':t.fmt.signedOi(o.dOi)}, puts ${null==c?.dOi?'\u2014':t.fmt.signedOi(c.dOi)}; premium too flat or unmeasured to read.`})}return i.push({label:'',tag:'Observed',text:'These readings pair OI with the premium; OI alone does not say who opened a position, and nothing here is a forecast.'}),i};var t=_r(d[0]);const l=[{id:'oi',label:'OI'},{id:'doi',label:'\u0394OI'},{id:'iv',label:'IV'},{id:'price',label:'Price'}],n=[{id:'2x5',label:'2\xd75'},{id:'2x3',label:'2\xd73'},{id:'1x1',label:'1\xd71'}],i={'2x5':2,'2x3':1,'1x1':0},s=t=>'number'==typeof t&&Number.isFinite(t)?t:null;const r=t=>t.flatMap(t=>[`CE:${t}`,`PE:${t}`]).join(',');function u(t,l){return null==t||null==l||Math.abs(t)<1||Math.abs(l)<.05?null:t>0&&l<0?'consistent with new writing':t>0&&l>0?'consistent with new long positions':t<0&&l>0?'consistent with writers covering':'consistent with longs exiting'}const o=t=>'CE'===t?'call':'put'},967,[958]); 1061__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";
1061function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ChainTool=function(e){const{underlying:d,expiry:I,at:T,seq:M}=e.sh,O=e.style?.height??480,[R,E]=(0,t.useState)(()=>'simple'===(0,o.readStore)(x,'ch_view').v?'simple':'terminal'),[L,P]=(0,t.useState)(()=>{const e=(0,o.readStore)(x,'ch_heat').v;return v.some(t=>t.id===e)?e:'oi'}),[F,H]=(0,t.useState)(()=>10===(0,o.readStore)(x,'ch_win').v?10:6),W=(e,t)=>l=>{t(l),(0,o.writeStore)(x,e,{v:l})},z=(0,a.useSharedRead)(d?`/api/derivatives/chain?underlying=${encodeURIComponent(d)}${I?`&expiry=${encodeURIComponent(I)}`:''}${T?`&at=${encodeURIComponent(T)}`:''}&atm_window=${F}`:null,M),B=(0,t.useMemo)(()=>(z.data?.rows||[]).map(e=>e.strike).filter(e=>'number'==typeof e),[z.data]).flatMap(e=>[`CE:${e}`,`PE:${e}`]).join(','),A=(0,a.useSharedRead)(d&&T&&B?`/api/derivatives/iv-grid-series?underlying=${encodeURIComponent(d)}${I?`&expiry=${encodeURIComponent(I)}`:''}&at=${encodeURIComponent(T)}&legs=${encodeURIComponent(B)}`:null,M),V=y(z.data?.spot),U=z.data?.as_of||T||null,D=z.data?.expiry||null,G=(0,t.useMemo)(()=>{const e=A.data,t=e?(0,u.indexAtOrBefore)(e.readings,U||T):-1,l=(0,m.yearsToExpiry)(U,D,e?.expiry_time_ist||'15:30','number'==typeof e?.day_count?e.day_count:365),r='number'==typeof e?.risk_free_rate?e.risk_free_rate:.065,n=(n,i,o)=>{const a=e?.legs?.find(e=>e.present&&e.option_type===i&&e.strike===o),s=a&&t>=0?y(a.iv_pct?.[t]):null,d=y(n?.last_price),u=y(n?.price_change_day_pct),c=null!=d&&null!=u&&u>-100?d-d/(1+u/100):null,h=y(n?.oi),g=y(n?.previous_oi??n?.prev_day_oi);return{ltp:d,chg:c,chgPct:u,oi:h,oiChg:y(n?.oi_change_day??n?.oi_chg_day)??(null!=h&&null!=g?h-g:null),volume:y(n?.volume),buildup:n?.buildup_day||null,iv:s,g:(0,m.greeks)(V,o,l,r,s,i)}};return(z.data?.rows||[]).map(e=>({strike:e.strike,ce:n(e.ce,'CE',e.strike),pe:n(e.pe,'PE',e.strike)}))},[z.data,A.data,V,U,D,T]),N=(0,t.useMemo)(()=>null!=V&&G.length?G.reduce((e,t)=>Math.abs(t.strike-V)<Math.abs(e.strike-V)?t:e).strike:null,[G,V]),[X,Y]=((0,t.useMemo)(()=>{const e=e=>{const t=G.map(t=>{return l=t[e],'oi'===L?l.oi:'volume'===L?l.volume:'iv'===L?l.iv:'delta'===L?l.g?Math.abs(l.g.delta):null:'gamma'===L?l.g?.gamma??null:'theta'===L?l.g?Math.abs(l.g.theta):null:l.g?.vega??null;var l}).filter(e=>null!=e);return t.length?{lo:Math.min(...t),hi:Math.max(...t)}:{lo:0,hi:0}};return{ce:e('ce'),pe:e('pe')}},[G,L]),(0,t.useState)(()=>{const e=(0,o.readStore)(x,'ch_step').v;return[5,15,30,60].includes(e)?e:15}
1061)),q=(0,c.useOiSession)(d?(0,h.oiSessionPath)({underlying:d,expiry:I||null}):null),J='ready'===q?.state?q.session:null,K=(0,t.useMemo)(()=>{if(!J)return[];const e=(0,u.indexAtOrBefore)(J.readings,T);if(e<0)return[];const t=Date.parse(J.readings[e].at.replace(' ','T')),l=[];for(let e=5;e>=0;e--){const r=new Date(t-e*X*6e4),n=e=>String(e).padStart(2,'0'),i=`${r.getFullYear()}-${n(r.getMonth()+1)}-${n(r.getDate())} ${n(r.getHours())}:${n(r.getMinutes())}:${n(r.getSeconds())}`,o=(0,u.indexAtOrBefore)(J.readings,i);o>=0&&!l.includes(o)&&l.push(o)}return l},[J,T,X]),Q=(0,t.useMemo)(()=>K.length>5?K.slice(1):K,[K]),Z=K.length>5?K[0]:null,ee=(e,t,l)=>{if(!J)return null;const r=J.strikes.indexOf(t);if(r<0)return null;if('oi'===L)return y(('CE'===e?J.call_oi:J.put_oi)[l]?.[r]);if('volume'===L)return l===Q[Q.length-1]?G.find(e=>e.strike===t)?.['CE'===e?'ce':'pe'].volume??null:null;const n=A.data;if(!n)return null;const i=(0,u.indexAtOrBefore)(n.readings,J.readings[l].at),o=n.legs?.find(l=>l.present&&l.option_type===e&&l.str
1061ike===t),a=o&&i>=0?y(o.iv_pct?.[i]):null;if('iv'===L)return a;const s=(0,m.greeks)((0,u.refSpot)(J,l).value,t,(0,m.yearsToExpiry)(J.readings[l].at,D,n.expiry_time_ist||'15:30','number'==typeof n.day_count?n.day_count:365),'number'==typeof n.risk_free_rate?n.risk_free_rate:.065,a,e);return s?'delta'===L?s.delta:'gamma'===L?s.gamma:'theta'===L?s.theta:s.vega:null},te=e=>{const t=Q.indexOf(e);return t>0?Q[t-1]:Z},le=(e,t,l)=>{const r=te(l);if(null==r)return null;const n=ee(e,t,l),i=ee(e,t,r);if(null==n||null==i)return null;if('oi'===L||'volume'===L){if(!i)return null;const e=(n-i)/Math.abs(i)*100;return Math.abs(e)<.5?0:e}const o=n-i;return Math.abs(o)<.05*re[L]?0:o},re={oi:20,volume:20,iv:1,delta:.1,gamma:3e-4,theta:2,vega:1},ne=((0,t.useMemo)(()=>{const e=e=>{const t=[];for(const l of G)for(const r of Q){const n=ee(e,l.strike,r);null!=n&&t.push(Math.abs(n))}return t.length?{lo:Math.min(...t),hi:Math.max(...t)}:{lo:0,hi:0}};return{CE:e('CE'),PE:e('PE')}},[G,Q,L,J,A.data]),e=>{const t=Math.abs(e);return t>=1e7?(e/1e7).toFixed(2)+' Cr':t>=1e5?(e/1e5).toFixed(2)+' L':t>=1e3?(e/1e3).toFixed(1)+'k':String(Math.round(e))}),ie=(e,t,l)=>{const r=(e,t)=>parseInt(e.slice(1+2*t,3+2*t),16);return'#'+[0,1,2].map(n=>Math.round(r(e,n)+(r(t,n)-r(e,n))*l).toString(16).padStart(2,'0')).join('')},oe=(e,t)=>{const l=Math.max(0,Math.min(1,t))*(e.length-1),r=Math.min(e.length-2,Math.floor(l));return ie(e[r],e[r+1],l-r)},ae=e=>null==e||0===e?i.C.heatFlat:oe(e>0?[i.C.heatUp0,i.C.heatUp1,i.C.heatUp2,i.C.heatUp3]:[i.C.heatDn0,i.C.heatDn1,i.C.heatDn2,i.C.heatDn3],Math.abs(e)/re[L]),se=e=>null==e?'\u2014':'oi'===L||'volume'===L?ne(e):'iv'===L?e.toFixed(2)+'%':'gamma'===L?e.toFixed(4):e.toFixed(2),de='loading'!==A.phase&&G.length>0&&G.every(e=>!e.ce.g&&!e.pe.g),[ue,ce]=(0,t.useState)(()=>'experienced'===(0,o.readStore)(x,'mode').m?'experienced':'beginner'),he=((0,t.useMemo)(()=>(0,f.chainStory)(G,V,N,ue,d||''),[G,V,N,ue,d]),`${U}|${F}|${ue}`),ge=(0,t.useRef)(0),fe=(0,t.useRef)('');fe.current!==he&&(fe.current=he,ge.current++);const me=(0,t.useMemo)(()=>{const e=v.find(e=>e.id===L)?.label||L,t='oi'!==L&&'volume'!==L,l=Q[0],r=Q[Q.length-1],n=J&&null!=l?(0,u.clockOf)(J.readings[l].at):'',i=(e,t,l)=>{let r=null,n=null;for(const e of G){const i=l(e.strike);
1061null==i||null!=n&&!t(i,n)||(n=i,r=e.strike)}return null==r?null:{k:r,v:n}},o=e=>t=>{if(null==l||null==r)return null;const n=ee(e,t,l),i=ee(e,t,r);return null!=n&&null!=i?i-n:null},a=e=>i(0,(e,t)=>e>t,o(e)),s=e=>i(0,(e,t)=>e>t,t=>null==r?null:ee(e,t,r)),d=a('CE'),c=a('PE'),h=s('CE'),g=s('PE');if(!J||null==l||!G.length)return{label:`${e} \xb7 as of ${(0,u.clockOf)(U)||'\u2014'}`,headline:'',lines:[]};const f=e=>e?0===e.v?"flat":`${u.fmt.strike(e.k)} ${t?e.v>0?'rising':'falling':e.v>0?'building':'unwinding'} (${e.v>0?'+':'\u2212'}${se(Math.abs(e.v))})`:'unavailable',m=[{t:`Calls: ${f(d)}; puts: ${f(c)} since ${n}.`,so:t?`the ${e} shift is computed from each leg's solved IV`:d&&c&&d.v>0&&c.v>0?`${"OI"===e?"OI":e.toLowerCase()} added on both sides`:'',tag:t?'model':void 0},{t:`Largest ${e}: call ${h?`${u.fmt.strike(h.k)} (${se(h.v)})`:'\u2014'}, put ${g?`${u.fmt.strike(g.k)} (${se(g.v)})`:'\u2014'}.`,so:''}];return{label:`${e} \xb7 since ${n} \xb7 as of ${(0,u.clockOf)(U)||'\u2014'}`,headline:'',lines:m}},[L,Q,G,J,U]),pe=((0,g.useStoryDone)(me,ge.current),(0,t.useRef)(null)),be=(0,t.useRef)(null),xe=(0,t.useRef)({l:0,r:0}),Ce=e=>t=>{const l=t.nativeEvent.contentOffset.y,r='l'===e?'r':'l';xe.current[e]=l,Math.abs(xe.current[r]-l)<.5||(xe.current[r]=l,('l'===e?be.current:pe.current)?.scrollTo({y:l,animated:!1}))},[ye,ve]=(0,t.useState)(0);(0,t.useEffect)(()=>{const e=G.findIndex(e=>e.strike===N);if(e<0||!ye)return;const t=Math.max(0,33*e-ye/2+16);xe.current={l:t,r:t},pe.current?.scrollTo({y:t,animated:!1}),be.current?.scrollTo({y:t,animated:!1})},[N,G.length,F,ye]);const ke=(e,t)=>(0,b.jsx)(n.default,{style:{height:26,justifyContent:'center',alignItems:'center',flex:1,backgroundColor:i.C.dark},children:(0,b.jsx)(i.T,{style:{fontSize:11,lineHeight:14,fontFamily:'InterSemi',letterSpacing:1,color:t},children:e})}),we=(e,t=!1)=>(0,b.jsx)(n.default,{style:[i.s.row,{gap:0,borderBottomWidth:1,borderColor:i.C.line}],children:(t?[...e].reverse():e).map(([e,t])=>(0,b.jsx)(n.default,{style:{flex:t,minWidth:0,height:22,justifyContent:'center',paddingHorizontal:5},children:(0,b.jsx)(i.T,{style:{...C,textAlign:'right',color:i.C.heading,fontFamily:'InterSemi'},children:e})},e))}),je=[{id:'ltp',label:'LTP',w:58},{id:'chg',label:'Chg',w:56},{id:'chgPct',label:'Chg %',w:56},{id:'iv',label:'IV',w:48},{id:'delta',label:'\u0394',w:44},{id:'gamma',label:'\u0393',w:56},{id:'theta',label:'\u0398',w:46},{id:'vega',label:'Vega',w:46},{id:'oi',label:'OI',w:56},{id:'oiChg',label:'\u0394OI',w:58},{id:'volume',label:'Volume',w:60},{id:'buildup',label:'Build-up',w:78}],Se={terminal:['ltp','chg','iv','delta','gamma','theta','vega','oi','oiChg','volume'],simple:['ltp','chg','chgPct','oi','oiChg','volume','buildup']},[$e,Ie]=(0,t.useState)(()=>{const e=(0,o.readStore)(x,'ch_cols').v,t=(t,l)=>{if(!Array.isArray(t)||!t.length)return l;let r=t.filter(e=>je.some(t=>t.id===e));if(!e?.oic&&!r.includes('oiChg')){const e=r.indexOf('oi');r=e<0?[...r,'oiChg']:[...r.slice(0,e+1),'oiChg',...r.slice(e+1)]}return r};return{terminal:t(e?.terminal,Se.terminal),simple:t(e?.simple,Se.simple)}}),Te=['ltp','chg','oi','oiChg','iv','volume','chgPct','delta','vega','theta','gamma','buildup'],[Me,Oe]=(0,t.useState)(0),Re={ltp:54,chg:56,chgPct:54,iv:48,delta:42,gamma:54,theta:44,vega:42,oi:50,oiChg:56,volume:62,buildup:76},Ee=je.filter(e=>$e[R].includes(e.id)),Le=(()=>{if(!Me)return Ee.map(e=>e.id);let e=Te.filter(e=>Ee.some(t=>t.id===e));const t=e=>2*e.reduce((e,t)=>e+Re[t],0)+80;for(;e.length>1&&t(e)>Me;)e=e.slice(0,-1);return e})(),Pe=Ee.filter(e=>Le.includes(e.id)),Fe=Ee.length-Pe.length,He=e=>{const t=$e[R],l=t.includes(e)?t.length>1?t.filter(t=>t!==e):t:[...t,e],r={...$e,[R]:l};Ie(r),(0,o.writeStore)(x,'ch_cols',{v:{...r,oic:!0}})},We=Pe.map(e=>[e.label,e.w]),ze=e=>null==e||0===e?i.C.muted:e>0?i.C.green:i.C.red,Be=(e,t=2)=>null==e?'\u2014':(e>0?'+':'')+e.toFixed(t),Ae=(0,t.useMemo)(()=>{const e={};if(!J||!A.data)return e;const t=A.data,l=(0,u.indexAtOrBefore)(J.readings,T);if(l<1)return e;const r=(0,u.indexAtOrBefore)(t.readings,J.readings[l].at),n=(0,u.indexAtOrBefore)(t.readings,J.readings[0].at),i='number'==typeof t.risk_free_rate?t.risk_free_rate:.065,o='number'==typeof t.day_count?t.day_count:365,a=t.expiry_time_ist||'15:30';for(const s of G)for(const d of['CE','PE']){const c=J.strikes.indexOf(s.strike),h=t.legs?.find(e=>e.present&&e.option_type===d&&e.strike===s.strike),g='CE'===d?J.call_oi:J.put_oi,f=(e,t)=>{const l=h&&t>=0?y(h.iv_pct?.[t]):null,r=(0,m.greeks)((0,u.refSpot)(J,e).value,s.str
1061ike,(0,m.yearsToExpiry)(J.readings[e].at,D,a,o),i,l,d);return r?Math.abs(r.theta):null};e[`${d}${s.strike}`]={p0:h&&n>=0?y(h.last_price?.[n]):null,p1:h&&r>=0?y(h.last_price?.[r]):null,o0:c>=0?y(g[0]?.[c]):null,o1:c>=0?y(g[l]?.[c]):null,t0:f(0,n),t1:f(l,r),from:(0,u.clockOf)(J.readings[0].at)}}return e},[J,A.data,G,T,D]),Ve=e=>!!e&&null!=e.p0&&null!=e.p1&&e.p1>e.p0&&null!=e.o0&&null!=e.o1&&e.o1>e.o0&&null!=e.t0&&null!=e.t1&&e.t1>e.t0,Ue=(0,t.useRef)(null),[De,Ge]=(0,t.useState)(null),Ne=(e,t)=>l=>{const r=Ue.current?.getBoundingClientRect?.(),n=l?.nativeEvent||{};r&&null!=n.clientX&&Ge({x:n.clientX-r.left,y:n.clientY-r.top,w:r.width,key:`${e}${t}`,strike:t,side:e})},Xe=(0,t.useMemo)(()=>{const e=e=>[...G].filter(t=>null!=t[e].chgPct).sort((t,l)=>Math.abs(l[e].chgPct)-Math.abs(t[e].chgPct));return{ce:e('ce'),pe:e('pe')}},[G]),Ye=(0,t.useMemo)(()=>({ce:new Set(G.filter(e=>Ve(Ae[`CE${e.strike}`])).map(e=>e.strike)),pe:new Set(G.filter(e=>Ve(Ae[`PE${e.strike}`])).map(e=>e.strike))}),[G,Ae]),qe=(e,t)=>{const l=Xe[e],r=l.findIndex(e=>e.strike===t);if(r<0||r>2)return'';const n=l[r][e].chgPct,i=l.slice(3).map(t=>Math.abs(t[e].chgPct)),o='ce'===e?'call':'put';return`Boxed: ${u.fmt.strike(t)} ${o} moved ${u.fmt.pct(n)} since the previous close - rank ${r+1} of ${l.length} ${o}s on screen by size of % change. Only the 3 largest per side are boxed; the other ${i.length} moved between ${i.length?Math.min(...i).toFixed(1):'\u2014'} % and ${i.length?Math.max(...i).toFixed(1):'\u2014'} % (by size). Note: % change is largest on the cheapest options, so far out-of-the-money strikes tend to be boxed.`},Je=(e,t,l)=>{const r=null!=l&&Ye[t].has(l),n=(r&&null!=l&&qe(t,l),Pe.map(n=>{switch(n.id){case'ltp':return(0,b.jsx)($,{w:n.w,text:S(e.ltp)},n.id);case'chg':return(0,b.jsx)($,{w:n.w,text:Be(e.chg,null!=e.chg&&Math.abs(e.chg)>=100?1:2),color:ze(e.chg),box:r&&!$e[R].includes('chgPct')?i.C.green:void 0,hover:null!=l?{on:Ne('ce'===t?'CE':'PE',l),off:()=>Ge(null)}:void 0},n.id);case'chgPct':return(0,b.jsx)($,{w:n.w,text:null==e.chgPct?'\u2014':u.fmt.pct(e.chgPct),color:ze(e.chgPct),box:r?i.C.green:void 0,hover:null!=l?{on:Ne('ce'===t?'CE':'PE',l),off:()=>Ge(null)}:void 0},n.id);case'iv':return(0,b.jsx)($,{w:n.w,text:u.fmt.iv(e.iv)},n.id);case'delta':return(0,b.jsx)($,{w:n.w,text:j(e.g?.delta??null)},n.id);case'gamma':return(0,b.jsx)($,{w:n.w,text:e.g?e.g.gamma.toFixed(4):'\u2014'},n.id);case'theta':return(0,b.jsx)($,{w:n.w,text:j(e.g?.theta??null,1)},n.id);case'vega':return(0,b.jsx)($,{w:n.w,text:j(e.g?.vega??null,1)},n.id);case'oi':return(0,b.jsx)($,{w:n.w,text:u.fmt.oi(e.oi)},n.id);case'oiChg':return(0,b.jsx)($,{w:n.w,text:null==e.oiChg?'\u2014':`${e.oiChg>0?'+':e.oiChg<0?'\u2212':''}${u.fmt.oi(Math.abs(e.oiChg))}`,color:ze(e.oiChg)},n.id);case'volume':return(0,b.jsx)($,{w:n.w,text:u.fmt.oi(e.volume)},n.id);case'buildup':return(0,b.jsx)($,{w:n.w,text:e.buildup?_[e.buildup]||e.buildup:'\u2014',color:i.C.muted},n.id)}}));return'ce'===t?n:[...n].reverse()};return(0,b.jsx)(p.SplitPanes,{id:"chain",height:O,initial:.58,left:(0,b.jsxs)(n.default,{ref:Ue,onLayout:e=>Oe(Math.round(e.nativeEvent.layout.width)),style:{flex:1,height:O,minWidth:0,borderWidth:1,borderColor:i.C.line,borderRadius:12,backgroundColor:i.C.paper,overflow:'hidden'},children:[(0,b.jsxs)(n.default,{style:[i.s.row,{paddingHorizontal:12,height:44,borderBottomWidth:1,borderColor:i.C.line,gap:10,overflow:'hidden'}],children:[(0,b.jsx)(i.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:11,lineHeight:16,letterSpacing:1,textTransform:'uppercase',color:i.C.ink},children:"Option chain"}),(0,b.jsx)(k,{value:R,items:[{id:'terminal',label:'Terminal'},{id:'simple',label:'Simple'}],onChange:W('ch_view',E),label:"Chain view"}),(0,b.jsx)(k,{value:F,items:[{id:6,label:'\xb16'},{id:10,label:'\xb110'}],onChange:W('ch_win',H),label:"Strikes each side of the money"}),(0,b.jsx)(n.default,{style:{flex:1}}),(0,b.jsxs)(i.T,{numberOfLines:1,style:{...C,color:i.C.ink},children:["Spot ",(0,b.jsx)(i.T,{style:{fontFamily:'InterSemi'},children:u.fmt.spot(V)})," \xb7 as of ",(0,b.jsxs)(i.T,{style:{fontFamily:'InterSemi'},children:[(0,u.clockOf)(U)," IST"]})]})]}),(0,b.jsxs)(n.default,{style:[i.s.row,{gap:4,paddingHorizontal:10,height:30,borderBottomWidth:1,borderColor:i.C.line,overflow:'hidden'}],children:[(0,b.jsx)(i.T,{style:{...C,marginRight:4},children:"Columns"}),je.map(e=>{const t=$e[R].includes(e.id);return(0,b.jsxs)(l.default,{role:"checkbox","aria-checked":t,accessibilityState:{checked:t},onPress:()=>He(e.id),style:e=>[i.s.row,{gap:4,height:22,paddingHorizontal:6,borderRadius:4,borderWidth:1,borderColor:t?i.C.green:i.C.line,backgroundColor:e.hovered?i.C.dark:'transparent'}],children:[(0,b.jsx)(n.default,{style:{width:9,height:9,borderRadius:2,borderWidth:1,borderColor:t?i.C.green:i.C.muted,backgroundColor:t?i.C.green:'transparent'}}),(0,b.jsx)(i.T,{style:{fontSize:11,lineHeight:14,color:t?i.C.ink:i.C.muted},children:e.label})]},e.id)}),Fe>0&&(0,b.jsxs)(i.T,{style:{...C,color:i.C.amber,marginLeft:4},children:["+",Fe," hidden - widen the panel"]})]}),(0,b.jsxs)(n.default,{style:[i.s.row,{gap:0}],children:[ke('CALLS',s.OI_SIDE_COLOR.call),(0,b.jsx)(n.default,{style:{width:76,height:26,backgroundColor:i.C.dark,borderLeftWidth:1,borderRightWidth:1,borderColor:i.C.blue}}),ke('PUTS',s.OI_SIDE_COLOR.put)]}),(0,b.jsxs)(n.default,{style:[i.s.row,{gap:0,justifyContent:'center'}],children:[(0,b.jsx)(n.default,{style:{flex:1},children:we(We)}),(0,b.jsx)(n.default,{style:{width:76,height:23,justifyContent:'center',borderBottomWidth:1,borderLeftWidth:1,borderRightWidth:1,borderLeftColor:i.C.blue,borderRightColor:i.C.blue,borderBottomColor:i.C.line},children:(0,b.jsx)(i.T,{style:{...C,textAlign:'center',color:i.C.heading,fontFamily:'InterSemi'},children:"Strike"})}),(0,b.jsx)(n.default,{style:{flex:1},children:we(We,!0)})]}),(0,b.jsxs)(r.default,{ref:pe,style:{flex:1},showsVerticalScrollIndicator:!1,onScroll:Ce('l'),scrollEventThrottle:16,onLayout:e=>ve(Math.round(e.nativeEvent.layout.height)),children:['loading'===z.phase&&!G.length&&(0,b.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',left:12,top:8,zIndex:2},children:(0,b.jsx)(i.T,{style:C,children:"Reading the chain\u2026"})}),G.map(e=>{const t=e.strike===N;return(0,b.jsxs)(n.default,{style:[i.s.row,{gap:0,borderBottomWidth:1,borderColor:i.C.lineSoft,backgroundColor:t?i.C.blueBg:void 0}],children:[(0,b.jsx)(n.default,{style:[i.s.row,{flex:1,gap:0}],children:Je(e.ce,'ce',e.strike)}),(0,b.jsx)(n.default,{style:{width:76,height:w,justifyContent:'center',borderLeftWidth:1,borderRightWidth:1,borderColor:i.C.blue,backgroundColor:t?i.C.blueBg:i.C.dark},children:(0,b.jsx)(i.T,{style:{fontSize:12,lineHeight:16,textAlign:'center',fontFamily:'InterSemi',color:t?i.C.blue:i.C.ink},children:u.fmt.strike(e.strike)})}),(0,b.jsx)(n.default,{style:[i.s.row,{flex:1,gap:0}],children:Je(e.pe,'pe',e.strike)})]},e.strike)})]}),De&&(()=>{const e=Ae[De.key],t=(e,t,l,r)=>{const o=null!=t&&null!=l?l-t:null;return(0,b.jsxs)(n.default,{style:[i.s.row,{gap:8}],children:[(0,b.jsx)(i.T,{style:{width:16,fontSize:13,lineHeight:17,fontFamily:'InterSemi',color:null==o||0===o?i.C.muted:o>0?i.C.green:i.C.red}
1061,children:null==o?'\xb7':o>0?'\u25b2':o<0?'\u25bc':'\u25b6'}),(0,b.jsx)(i.T,{style:{width:44,fontSize:12,lineHeight:17,color:i.C.muted},children:e}),(0,b.jsxs)(i.T,{style:{fontSize:12,lineHeight:17,color:i.C.ink,fontVariant:['tabular-nums']},children:[null==t?'\u2014':r(t)," \u2192 ",null==l?'\u2014':r(l)]})]},e)};return(0,b.jsxs)(n.default,{pointerEvents:"none",style:{position:'absolute',left:De.x+14+250>De.w?Math.max(4,De.x-264):De.x+14,top:De.y+14,zIndex:100,backgroundColor:i.C.paper,borderWidth:1,borderColor:i.C.lineHover,borderRadius:8,padding:10,gap:3,minWidth:230,shadowColor:i.C.shadow,shadowOpacity:.5,shadowRadius:16,shadowOffset:{width:0,height:6}},children:[(0,b.jsxs)(i.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:i.C.heading},children:[u.fmt.strike(De.strike)," ",De.side," \xb7 since ",e?.from||'\u2014']}),t('Price',e?.p0??null,e?.p1??null,e=>e.toFixed(2)),t('OI',e?.o0??null,e?.o1??null,e=>u.fmt.oi(e)),t('Theta',e?.t0??null,e?.t1??null,e=>e.toFixed(1)+'/day')]})})(),de&&(0,b.jsx)(i.T,{style:{...C,color:i.C.amber,paddingHorizontal:12,paddingVertical:4},children:"IV not solved at this reading - no Greeks"})]}),right:(0,b.jsxs)(n.default,{style:{flex:1,height:O,minWidth:0,borderWidth:1,borderColor:i.C.line,borderRadius:12,backgroundColor:i.C.paper,overflow:'hidden'},children:[(0,b.jsxs)(n.default,{style:[i.s.row,{paddingHorizontal:12,height:44,borderBottomWidth:1,borderColor:i.C.line,gap:8,overflow:'hidden'}],children:[(0,b.jsx)(i.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:11,lineHeight:16,letterSpacing:1,textTransform:'uppercase',color:i.C.ink},children:"Heatmap"}),(0,b.jsx)(i.T,{numberOfLines:2,style:{fontSize:11,lineHeight:14,color:i.C.muted,flexShrink:1},children:g.INTERP_TAG}),(0,b.jsx)(n.default,{style:{flex:1}}),(0,b.jsx)(k,{value:ue,items:[{id:'beginner',label:'Beginner'},{id:'experienced',label:'Experienced'}],onChange:e=>{ce(e),(0,o.writeStore)(x,'mode',{m:e})},label:"How much to show"})]}),(0,b.jsxs)(n.default,{style:[i.s.row,{height:30,paddingHorizontal:10,gap:8,borderBottomWidth:1,borderColor:i.C.line,overflow:'hidden'}],children:[(0,b.jsx)(k,{value:X,items:[{id:5,label:'5m'},{id:15,label:'15m'},{id:30,label:'30m'},{id:60,label:'1h'}],onChange:W('ch_step',Y),label:"Heatmap step"}),(0,b.jsx)(k,{value:L,items:v,onChange:W('ch_heat',P),label:"Heatmap measure"})]}),(0,b.jsxs)(n.default,{style:[i.s.row,{gap:0}],children:[ke('CALLS',s.OI_SIDE_COLOR.call),(0,b.jsx)(n.default,{style:{width:70,height:26,backgroundColor:i.C.dark,borderLeftWidth:1,borderRightWidth:1,borderColor:i.C.blue}}),ke('PUTS',s.OI_SIDE_COLOR.put)]}),(0,b.jsxs)(n.default,{style:[i.s.row,{gap:0,borderBottomWidth:1,borderColor:i.C.line,height:23}],children:[(0,b.jsx)(n.default,{style:[i.s.row,{flex:1,gap:0}],children:Q.map(e=>(0,b.jsx)(n.default,{style:{flex:1,height:22,justifyContent:'center'},children:(0,b.jsx)(i.T,{style:{...C,textAlign:'center',color:i.C.heading,fontFamily:'InterSemi'},children:J?(0,u.clockOf)(J.readings[e].at):''})},e))}),(0,b.jsx)(n.default,{style:{width:70,height:22,justifyContent:'center',borderLeftWidth:1,borderRightWidth:1,borderColor:i.C.blue},children:(0,b.jsx)(i.T,{style:{...C,textAlign:'center',color:i.C.heading,fontFamily:'InterSemi'},children:"Strike"})}),(0,b.jsx)(n.default,{style:[i.s.row,{flex:1,gap:0}],children:[...Q].reverse().map(e=>(0,b.jsx)(n.default,{style:{flex:1,height:22,justifyContent:'center'},children:(0,b.jsx)(i.T,{style:{...C,textAlign:'center',color:i.C.heading,fontFamily:'InterSemi'},children:J?(0,u.clockOf)(J.readings[e].at):''})},e))})]}),(0,b.jsxs)(r.default,{ref:be,style:{flex:1},showsVerticalScrollIndicator:!1,onScroll:Ce('r'),scrollEventThrottle:16,children:[!J&&(0,b.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',left:12,top:8,zIndex:2},children:(0,b.jsx)(i.T,{style:C,children:"Reading the session\u2026"})}),G.map(e=>{const t=e.strike===N,l=(t,l)=>{const r=ee(t,e.strike,l),o=le(t,e.strike,l),a=ae(o),s=null!=o&&0!==o&&Math.abs(o)/re[L]>.55;return(0,b.jsx)(n.default,{style:{flex:1,height:33,justifyContent:'center',backgroundColor:a},children:(0,b.jsx)(i.T,{numberOfLines:1,style:{fontSize:12,lineHeight:16,textAlign:'center',color:s?i.C.bg:i.C.ink,fontFamily:'Inter',fontVariant:['tabular-nums']},children:se(r)})},l)};return(0,b.jsxs)(n.default,{style:[i.s.row,{gap:0,height:33}],children:[(0,b.jsx)(n.default,{style:[i.s.row,{flex:1,gap:0}],children:Q.map(e=>l('CE',e))}),(0,b.jsx)(n.default,{style:{width:70,height:33,justifyContent:'center',borderLeftWidth:1,borderRightWidth:1,borderColor:i.C.blue,backgroundColor:t?i.C.blueBg:i.C.dark},children:(0,b.jsx)(i.T,{style:{fontSize:12,lineHeight:16,textAlign:'center',fontFamily:'InterSemi',color:t?i.C.blue:i.C.ink},children:u.fmt.strike(e.strike)})}),(0,b.jsx)(n.default,{style:[i.s.row,{flex:1,gap:0}],children:[...Q].reverse().map(e=>l('PE',e))})]},e.strike)})]}),(0,b.jsxs)(n.default,{style:{borderTopWidth:1,borderColor:i.C.line,height:96,overflow:'hidden',paddingHorizontal:12,paddingVertical:8},children:[(0,b.jsx)(g.StoryBlock,{cue:ge.current,d:me,compact:!0}),null]})]})})};var t=_r(_d[0]),l=e(_r(_d[1])),r=e(_r(_d[2])),n=e(_r(_d[3])),i=_r(_d[4]),o=_r(_d[5]),a=_r(_d[6]),s=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),f=_r(_d[13]),m=_r(_d[14]),p=_r(_d[15]),b=_r(_d[16]);const x='derivative-studio',C={fontSize:11,lineHeight:15,color:i.C.muted},y=e=>'number'==typeof e&&Number.isFinite(e)?e:null,v=[{id:'oi',label:'OI'},{id:'volume',label:'Volume'},{id:'iv',label:'IV'},{id:'delta',label:'Delta'},{id:'gamma',label:'Gamma'},{id:'theta',label:'Theta'},{id:'vega',label:'Vega'}];function k({value:e,items:t,onChange:r,label:o}){return(0,b.jsx)(n.default,{accessibilityRole:"radiogroup",accessibilityLabel:o,style:[i.s.row,{gap:0,borderWidth:1,borderColor:i.C.line,borderRadius:d.CTRL.radius,overflow:'hidden'}],children:t.map((t,n)=>{const o=t.id===e;return(0,b.jsx)(l.default,{role:"radio","aria-checked":o,accessibilityState:{checked:o},onPress:()=>r(t.id),style:e=>[{minHeight:d.CTRL.h,paddingHorizontal:d.CTRL.padX,justifyContent:'center',borderLeftWidth:n?1:0,borderColor:i.C.line,backgroundColor:o?i.C.soft:e.hovered?i.C.dark:'transparent'}],children:(0,b.jsx)(i.T,{style:{fontSize:d.CTRL.font,lineHeight:d.CTRL.lineHeight,fontFamily:o?'InterSemi':'InterMedium',color:o?i.C.green:i.C.ink},children:t.label})},String(t.id))})})}const w=32,j=(e,t=2)=>null==e?'\u2014':e.toFixed(t),S=e=>null==e?'\u2014':e>=100?e.toFixed(1):e.toFixed(2),_={'Long build-up':'Long build','Short build-up':'Short build','Short covering':'Covering','Long unwinding':'Unwinding'};
1061function $({w:e,text:t,color:r,bold:o,align:a="right",bg:s,heat:d,box:u,why:c,onWhy:h,hover:g}){const f=g?l.default:n.default;return(0,b.jsxs)(f,{...g?{onHoverIn:g.on,onHoverOut:g.off,onPress:g.on}:{},style:{flex:e,minWidth:0,height:w,justifyContent:'center',paddingHorizontal:5,backgroundColor:s,cursor:g?'help':void 0},children:[d&&d.a>0&&(0,b.jsx)(n.default,{style:{position:'absolute',left:1,right:1,top:1,bottom:1,backgroundColor:d.color,opacity:d.a}}),!!u&&(0,b.jsx)(n.default,{style:{position:'absolute',left:3,right:3,top:4,bottom:4,borderWidth:1.5,borderColor:u,borderRadius:4}}),(0,b.jsx)(i.T,{numberOfLines:1,style:{fontSize:12,lineHeight:16,textAlign:a,color:r||i.C.ink,fontFamily:o?'InterSemi':'Inter',fontVariant:['tabular-nums']},children:t})]})}},968,[11,375,278,13,821,871,921,934,928,958,933,932,961,969,970,966,6]); 1062__d(function(g,_r,i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.chainStory=function(a,o,u,d,r="",c=!0){const h={ok:!1,headline:'',headSo:'',lines:[],watch:[],pcr:null,pcrPrev:null};if(!a.length)return{...h,headline:'No chain captured at this reading.'};const p=[],f=(l,t,n)=>p.push({t:l,so:t,tag:n}),$=n(a.map(l=>l.ce.oi)),w=n(a.map(l=>l.pe.oi)),O=n(a.map(l=>l.ce.oiChg)),k=n(a.map(l=>l.pe.oiChg)),I=$&&null!=w?w/$:null,v=null!=$&&null!=w&&null!=O&&null!=k&&$-O>0?(w-k)/($-O):null,b=t(a,'ce',1),y=t(a,'ce',-1),C=t(a,'pe',1),M=t(a,'pe',-1),P=a.reduce((l,t)=>null!=t.ce.oi&&(null==l||t.ce.oi>(l.ce.oi??-1))?t:l,null),V=a.reduce((l,t)=>null!=t.pe.oi&&(null==l||t.pe.oi>(l.pe.oi??-1))?t:l,null),j=a.find(l=>l.strike===u),S=`${r} ${l.fmt.spot(o,c)}`.trim(),B=`${l.fmt.strike(a[0].strike)}\u2013${l.fmt.strike(a[a.length-1].strike)}`;if(null==O&&null==k)return{...h,ok:!0,headline:`${S}. The change since the previous close is not served for this chain, so builds and unwinds are unavailable.`,pcr:I};const _=null==O||null==k?'':k>0&&O<=0?'put OI rising while call OI falls - consistent with fresh put writing and call unwinding.':O>0&&k<=0?'call OI rising while put OI falls - consistent with fresh call writing and put unwinding.':O>0&&k>0?k>1.25*O?'OI added on both sides, more in puts.':O>1.25*k?'OI added on both sides, more in calls.':'OI added on both sides about equally.':O<0&&k<0?'OI fell on both sides since the previous close.':'',x=null==I?'':null!=v&&Math.abs(I-v)>=.05?`more ${I>v?'put':'call'} OI relative to the other side than at the previous close.`:I>1.2?'put OI outweighs call OI in this window.':I<.8?'call OI out
1062weighs put OI in this window.':'call and put OI roughly balanced in this window.',F=()=>{if(!j||null==j.ce.iv&&null==j.pe.iv)return void f('ATM IV is unavailable at this reading.','');const t=null!=j.ce.iv&&null!=j.pe.iv?j.pe.iv-j.ce.iv:null;f(`ATM ${l.fmt.strike(u)} IV: call ${l.fmt.iv(j.ce.iv)}, put ${l.fmt.iv(j.pe.iv)}.`,null==t?'one side of the at-the-money IV is not solved.':Math.abs(t)<.5?'calls and puts priced about the same.':t>0?'puts priced richer than calls - put IV above call IV.':'calls priced richer than puts - call IV above put IV.','model')},T=[];C[0]&&T.push({side:'put',k:C[0].k,why:`most put OI added since the previous close (${l.fmt.signedOi(C[0].d)}) - the put OI base`});V&&V.strike!==C[0]?.k&&T.push({side:'put',k:V.strike,why:`largest standing put OI in the window (${l.fmt.oi(V.pe.oi)})`});b[0]&&T.push({side:'call',k:b[0].k,why:`most call OI added since the previous close (${l.fmt.signedOi(b[0].d)}) - the call OI wall`});P&&P.strike!==b[0]?.k&&T.push({side:'call',k:P.strike,why:`largest standing call OI in the window (${l.fmt.oi(P.ce.oi)})`});if('beginner'===d){const t=`${S}. Since the previous close, ${[C[0]?`put OI was added most at ${l.fmt.strike(C[0].k)} (${l.fmt.signedOi(C[0].d)})`:M[0]?`put OI fell most at ${l.fmt.strike(M[0].k)} (${l.fmt.signedOi(M[0].d)})`:'',b[0]?`call OI most at ${l.fmt.strike(b[0].k)} (${l.fmt.signedOi(b[0].d)})`:y[0]?`call OI fell most at ${l.fmt.strike(y[0].k)} (${l.fmt.signedOi(y[0].d)})`:''].filter(Boolean).join(', and ')||'OI barely changed'}.`;return _&&f(`Calls ${null==O?'unavailable':O>=0?'adding':'unwinding'}, puts ${null==k?'unavailable':k>=0?'adding':'unwinding'} across ${B}.`,_),null!=I&&f(`Put-call ratio of this window: ${I.toFixed(2)}.`,x),F(),{ok:!0,headline:t,headSo:'',lines:p.slice(0,3),watch:T.slice(0,2),pcr:I,pcrPrev:v}}const A=`${S}; across ${B} since the previous close: call OI ${null==O?'unavailable':l.fmt.signedOi(O)}, put OI ${null==k?'unavailable':l.fmt.signedOi(k)}; PCR ${null==I?'\u2014':I.toFixed(2)}${null!=v?` (was ${v.toFixed(2)})`:''}.`;_&&f(`Breadth: calls ${b.length}\u25b2 ${y.length}\u25bc, puts ${C.length}\u25b2 ${M.length}\u25bc of ${a.length} strikes.`,_);(b.length||y.length)&&f(`Call leaders: ${[b.slice(0,2).map(s).join(', '),y[0]&&`unwind ${s(y[0])}`].filter(Boolean).join('; ')}.`,b[0]?'where the call OI wall grew most.':'call OI mostly leaving.');(C.length||M.length)&&f(`Put leaders: ${[C.slice(0,2).map(s).join(', '),M[0]&&`unwind ${s(M[0])}`].filter(Boolean).join('; ')}.`,C[0]?'where the put OI base grew most.':'put OI mostly leaving.');P&&V&&f(`Largest standing OI: call ${l.fmt.strike(P.strike)} (${l.fmt.oi(P.ce.oi)}), put ${l.fmt.strike(V.strike)} (${l.fmt.oi(V.pe.oi)}).`,'the strikes holding the most open positions on each side.');return F(),{ok:!0,headline:A,headSo:'',lines:p.slice(0,6),watch:T,pcr:I,pcrPrev:v}};var l=_r(_d[0]);const t=(l,t,n)=>l.filter(l=>null!=l[t].oiChg&&Math.sign(l[t].oiChg)===n).map(l=>({k:l.strike,d:l[t].oiChg,oi:l[t].oi})).sort((l,t)=>Math.abs(t.d)-Math.abs(l.d)),n=l=>{const t=l.filter(l=>null!=l);return t.length?t.reduce((l,t)=>l+t,0):null},s=t=>`${l.fmt.strike(t.k)} ${l.fmt.signedOi(t.d)}`},969,[958]); 1063__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.cdf=a,_e.greeks=function(t,n,r,u,l,s){if(!(null!=t&&null!=l&&null!=r&&t>0&&n>0&&r>0&&l>0))return null;const c=l/100,h=Math.sqrt(r),o=(Math.log(t/n)+(u+c*c/2)*r)/(c*h),M=o-c*h,f=Math.exp(-u*r),p=e(o)/(t*c*h),b=t*e(o)*h/100;return'CE'===s?{delta:a(o),gamma:p,vega:b,theta:(-t*e(o)*c/(2*h)-u*n*f*a(M))/365}:{delta:a(o)-1,gamma:p,vega:b,theta:(-t*e(o)*c/(2*h)+u*n*f*a(-M))/365}},_e.yearsToExpiry=function(t,e,a="15:30",n=365){if(!t||!e)return null;const r=Date.parse(t.replace(' ','T')+'+05:30'),u=Date.parse(`${e}T${5===a.length?a+':00':a}+05:30`);return!Number.isFinite(r)||!Number.isFinite(u)||u<=r?null:(u-r)/864e5/n};const t=Math.sqrt(2*Math.PI),e=e=>Math.exp(-e*e/2)/t;function a(t){const e=1/(1+.3275911*Math.abs(t)/Math.SQRT2),a=1-((((1.061405429*e-1.453152027)*e+1.421413741)*e-.284496736)*e+.254829592)*e*Math.exp(-t*t/2);return t>=0?(1+a)/2:(1-a)/2}},970,[]); 1064__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";
1064function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.MaxPainTool=function(e){const{underlying:l,expiry:o,at:w,seq:M}=e.sh,$=e.style?.height??480,F=(0,h.useOiSession)(l?(0,c.oiSessionPath)({underlying:l,expiry:o||null}):null),R='ready'===F?.state?F.session:null,H=(e,t)=>t?`&${e}=${encodeURIComponent(t)}`:'',L=(0,a.useSharedRead)(l?`/api/derivatives/maxpain-series?underlying=${encodeURIComponent(l)}${H('expiry',o)}`:null,M),z=(0,a.useSharedRead)(l?`/api/derivatives/futures-chart?underlying=${encodeURIComponent(l)}&interval=15m`:null,M),P=(0,t.useMemo)(()=>(0,C.atmStrike)(R,w),[R,w]),W=(0,a.useSharedRead)(l&&w&&P?`/api/derivatives/iv-grid-series?underlying=${encodeURIComponent(l)}${H('expiry',o)}&at=${encodeURIComponent(w)}&legs=${encodeURIComponent(`CE:${P},PE:${P}`)}`:null,M),O=(0,t.useMemo)(()=>(0,C.buildSeries)(R,w,L.data?.points,z.data?.candles,W.data),[R,w,L.data,z.data,W.data]),_=(0,t.useMemo)(()=>(0,C.readState)(O),[O]),[A,U]=(0,t.useState)({w:0,h:0}),[B,E]=(0,t.useState)(()=>{const e=(0,r.readStore)('derivative-studio','mp_series').v,t=Array.isArray(e)?e.filter(e=>k.some(t=>t.id===e)):[];return t.length?t:['spot','mp','fut','iv']}),N=e=>{const t=B.includes(e)?B.length>1?B.filter(t=>t!==e):B:[...B,e];E(t),(0,r.writeStore)('derivative-studio','mp_series',{v:t})},[Y,V]=(0,t.useState)(()=>'experienced'===(0,r.readStore)('derivative-studio','mode').m?'experienced':'beginner'),D=e=>{V(e),(0,r.writeStore)('derivative-studio','mode',{m:e})},G=(0,t.useMemo)(()=>(0,m.maxPainStory)(O,Y,!1!==e.isIndex),[O,Y,e.isIndex]),K=(0,t.useMemo)(()=>{const e=(0,C.readingRows)(O);return e.map((t,i)=>({...t,note:(0,m.mpChangeNote)(e[i+1]||null,t)}))},[O]),X=O[O.length-1],q=C.STATE_TEXT[_.state],Z=`${X?.at}|${_.state}|${Y}`,J=(0,t.useRef)(0),Q=(0,t.useRef)('');Q.current!==Z&&(Q.current=Z,J.current++);const ee=({k:e,v:t,sub:i,c:l,subC:o})=>(0,b.jsxs)(n.default,{style:{gap:1,minWidth:90},children:[(0,b.jsx)(d.T,{style:j,children:e}),(0,b.jsx)(d.T,{style:{fontSize:15,lineHeight:20,fontFamily:'InterSemi',color:l||d.C.ink,fontVariant:['tabular-nums']},children:t}),!!i&&(0,b.jsx)(d.T,{style:{...j,color:o||d.C.muted},children:i})]}),te=_.gapNow,ie={label:`The story since ${G.since||'the open'} \xb7 as of ${G.asOf||'\u2014'}`,headline:G.headline,headSo:G.headSo,lines:G.lines},ne=(0,x.useStoryDone)(ie,J.current);return(0,b.jsx)(y.SplitPanes,{id:"maxpain",height:$,initial:.62,left:(0,b.jsxs)(n.default,{style:{flex:1,height:$,borderWidth:1,borderColor:d.C.line,borderRadius:12,backgroundColor:d.C.paper,overflow:'hidden'},children:[(0,b.jsxs)(n.default,{style:[d.s.row,{paddingHorizontal:12,height:44,borderBottomWidth:1,borderColor:d.C.line,gap:14,overflow:'hidden'}],children:[(0,b.jsx)(d.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:11,lineHeight:16,letterSpacing:1,textTransform:'uppercase',color:d.C.ink},children:"Max pain trend"}),(0,b.jsx)(n.default,{accessibilityRole:"toolbar",accessibilityLabel:"Lines on the chart",style:[d.s.row,{gap:4}],children:k.map(e=>{const t=B.includes(e.id);return(0,b.jsxs)(s.default,{role:"checkbox","aria-checked":t,accessibilityState:{checked:t},onPress:()=>N(e.id),style:i=>[d.s.row,{gap:6,height:26,paddingHorizontal:8,borderRadius:6,borderWidth:1,borderColor:t?v[e.id]:d.C.line,backgroundColor:i.hovered?d.C.dark:'transparent'}],children:[(0,b.jsx)(n.default,{style:{width:14,height:'spot'===e.id?8:0,borderTopWidth:2,borderColor:v[e.id],backgroundColor:'spot'===e.id?v.spot+'40':void 0,opacity:t?1:.35}}),(0,b.jsxs)(d.T,{style:{fontSize:11,lineHeight:14,fontFamily:t?'InterSemi':'InterMedium',color:t?d.C.ink:d.C.muted},children:[e.label,'iv'===e.id?' (right axis)':'']})]},e.id)})}),(0,b.jsx)(n.default,{style:{flex:1}}),(0,b.jsxs)(d.T,{numberOfLines:1,style:{...j,color:d.C.ink},children:["as of ",(0,b.jsxs)(d.T,{style:{fontFamily:'InterSemi'},children:[X?(0,u.clockOf)(X.at):(0,u.clockOf)(w)," IST"]})]})]}),(0,b.jsxs)(n.default,{style:[d.s.row,{paddingHorizontal:14,paddingVertical:8,gap:22,borderBottomWidth:1,borderColor:d.C.line}],children:[(0,b.jsx)(ee,{k:"Spot",v:u.fmt.spot(X?.spot??null),sub:null!=_.then?.spot&&null!=X?.spot?`${X.spot-_.then.spot>=0?'+':''}${(X.spot-_.then.spot).toFixed(2)} since ${_.from}`:void 0,subC:null!=_.then?.spot&&null!=X?.spot?X.spot>=_.then.spot?d.C.refUp:d.C.red:void 0}),(0,b.jsx)(ee,{k:"Max Pain",v:u.fmt.strike(X?.mp??null),sub:null!=_.then?.mp&&null!=X?.mp?`${X.mp-_.then.mp>=0?'+':''}${X.mp-_.then.mp} since ${_.from}`:void 0}),(0,b.jsx)(ee,{k:"Distance",v:null==te?'\u2014':`${te>=0?'+':''}${te.toFixed(0)}`,c:null==te?void 0:te>=0?d.C.refUp:d.C.red,sub:null==te?void 0:`spot ${te>=0?'above':'below'} max pain`}),(0,b.jsx)(ee,{k:"Futures \xb7 basis",v:u.fmt.spot(X?.fut??null),sub:null==_.basisNow?void 0:`basis ${_.basisNow>=0?'+':''}${_.basisNow.toFixed(0)}`}),(0,b.jsx)(ee,{k:"ATM IV",v:u.fmt.iv(X?.iv??null)})]}),(0,b.jsxs)(n.default,{style:{flex:1,minHeight:120},onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout;U(e=>Math.abs(e.w-t)<2&&Math.abs(e.h-i)<2?e:{w:Math.round(t),h:Math.round(i)})},children:[A.w>0&&O.length>1&&(0,b.jsx)(I,{pts:O,width:A.w,height:A.h,isIndex:!1!==e.isIndex,on:B}),O.length<2&&(0,b.jsx)(n.default,{style:{flex:1,alignItems:'center',justifyContent:'center'},children:(0,b.jsx)(d.T,{style:j,children:F&&'loading'!==F.state?'Not enough readings yet.':'Reading the session\u2026'})})]})]}),right:(0,b.jsxs)(n.default,{style:{flex:1,height:$,borderWidth:1,borderColor:d.C.line,borderRadius:12,backgroundColor:d.C.paper,overflow:'hidden'},children:[(0,b.jsxs)(n.default,{style:[d.s.row,{paddingHorizontal:12,height:44,borderBottomWidth:1,borderColor:d.C.line}],children:[(0,b.jsx)(d.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:11,lineHeight:16,letterSpacing:1,textTransform:'uppercase',color:d.C.ink},children:"Market interpretation"}),(0,b.jsx)(d.T,{numberOfLines:2,style:{fontSize:11,lineHeight:14,color:d.C.muted,flexShrink:1},children:x.INTERP_TAG}),(0,b.jsx)(n.default,{style:{flex:1}}),(0,b.jsx)(n.default,{accessibilityRole:"radiogroup",accessibilityLabel:"How much to show",style:[d.s.row,{borderWidth:1,borderColor:d.C.line,borderRadius:f.CTRL.radius,overflow:'hidden'}],children:['beginner','experienced'].map((e,t)=>{const i=e===Y;return(0,b.jsx)(s.default,{role:"radio","aria-checked":i,accessibilityState:{checked:i},onPress:()=>D(e),style:e=>[{minHeight:f.CTRL.h,paddingHorizontal:f.CTRL.padX,justifyContent:'center',borderLeftWidth:t?1:0,borderColor:d.C.line,backgroundColor:i?d.C.soft:e.hovered?d.C.dark:'transparent'}],children:(0,b.jsx)(d.T,{style:{fontSize:f.CTRL.font,lineHeight:f.CTRL.lineHeight,fontFamily:i?'InterSemi':'InterMedium',color:i?d.C.green:d.C.ink},children:'beginner'===e?'Beginner':'Experienced'})},e)})})]}),(0,b.jsxs)(i.default,{style:{flex:1},contentContainerStyle:{padding:14,gap:14},children:[(0,b.jsxs)(n.default,{style:{borderWidth:1,borderColor:T[_.state],borderRadius:10,padding:12,gap:4,backgroundColor:d.C.dark},children:[(0,b.jsx)(d.T,{style:{fontSize:11,lineHeight:14,fontFamily:'InterSemi',letterSpacing:1,color:T[_.state]},children:q.tag}),(0,b.jsxs)(d.T,{style:{fontSize:18,lineHeight:24,fontFamily:'InterSemi',color:d.C.ink},children:[q.arrow," ",q.title]})]}),(0,b.jsx)(x.StoryBlock,{d:ie,cue:J.current}),ne&&(0,b.jsxs)(d.T,{style:j,children:["The state above is a rule on the last ",C.LOOKBACK_MIN," min of observed moves (since ",_.from||'\u2014',"), not yet back-tested; max pain is a payout calculation, not a forecast."]}),ne&&K.length>0&&(0,b.jsxs)(n.default,{style:{gap:0},children:[(0,b.jsx)(d.T,{style:{...x.SECTION,paddingBottom:4},children:"Reading by reading \xb7 every 5 min"}),(0,b.jsxs)(n.default,{style:[d.s.row,{gap:8,paddingVertical:4,borderBottomWidth:1,borderColor:d.C.line}],children:[[['Time',40],['Spot (\u0394)',74],['Max Pain',62],['Dist',44],['Basis',44],['ATM IV',52]].map(([e,t])=>(0,b.jsx)(d.T,{style:{...j,width:t,color:d.C.heading,fontFamily:'InterSemi'},children:e},e)),(0,b.jsx)(d.T,{style:{...j,flex:1,color:d.C.heading,fontFamily:'InterSemi'},children:"What changed vs the reading before"})]}),K.map((e,t)=>(0,b.jsxs)(n.default,{style:[d.s.row,{gap:8,alignItems:'flex-start',paddingVertical:5,borderBottomWidth:1,borderColor:d.C.lineSoft}],children:[(0,b.jsx)(d.T,{style:{...j,width:40,color:d.C.ink},children:e.time}),(0,b.jsxs)(n.default,{style:{width:74},children:[(0,b.jsx)(d.T,{style:{fontSize:12,lineHeight:16,color:d.C.ink},children:u.fmt.spot(e.spot)}),null!=e.dSpot&&(0,b.jsxs)(d.T,{style:{...j,color:e.dSpot>=0?d.C.refUp:d.C.red},children:[e.dSpot>=0?'+':'',e.dSpot.toFixed(1)]})]}),(0,b.jsxs)(n.default,{style:{width:62},children:[(0,b.jsx)(d.T,{style:{fontSize:12,lineHeight:16,color:d.C.ink},children:u.fmt.strike(e.mp)}),!!e.dMp&&(0,b.jsxs)(d.T,{style:{...j,color:e.dMp>0?d.C.refUp:d.C.red},children:[e.dMp>0?'+':'',e.dMp]})]}),(0,b.jsx)(d.T,{style:{fontSize:12,lineHeight:16,width:44,color:d.C.ink},children:null==e.dist?'\u2014':(e.dist>=0?'+':'')+e.dist.toFixed(0)}),(0,b.jsx)(d.T,{style:{fontSize:12,lineHeight:16,width:44,color:d.C.ink},children:null==e.basis?'\u2014':(e.basis>=0?'+':'')+e.basis.toFixed(0)}),(0,b.jsxs)(n.default,{style:{width:52},children:[(0,b.jsx)(d.T,{style:{fontSize:12,lineHeight:16,color:d.C.ink},children:u.fmt.iv(e.iv)}),null!=e.dIv&&Math.abs(e.dIv)>=.05&&(0,b.jsx)(d.T,{style:{...j},children:u.fmt.pts(e.dIv)})]}),(0,b.jsx)(n.default,{style:{flex:1},children:(0,b.jsx)(p.Typed,{text:e.note,order:0,cue:J.current,animate:0===t,style:{...S,lineHeight:16}})})]},e.at))]})]})]})})};var t=_r(_d[0]),i=e(_r(_d[1])),n=e(_r(_d[2])),l=_r(_d[3]),o=e(l),s=e(_r(_d[4])),r=_r(_d[5]),d=_r(_d[6]),a=_r(_d[7]),h=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]),f=_r(_d[12]),x=_r(_d[13]),m=_r(_d[14]),y=_r(_d[15]),C=_r(_d[16]),b=_r(_d[17]);const j={fontSize:11,lineHeight:15,color:d.C.muted},S={...x.PROSE,fontSize:12,lineHeight:17},v={spot:d.C.refSpot,mp:d.C.refMp,fut:d.C.refFut,iv:d.C.ivLine},k=[{id:'spot',label:'Spot'},{id:'mp',label:'Max Pain'},{id:'fut',label:'Futures'},{id:'iv',label:'ATM IV'}],T={mp_to_price:d.C.refUp,price_to_mp:d.C.red,separation:d.C.ivLine,none:d.C.muted};function I({pts:e,width:t,height:i,isIndex:n,on:s}){const r=58,a=96,h=16,c=26,p=Math.max(10,t-r-a),f=Math.max(10,i-h-c),x=e.length,m=e=>r+(x<=1?p/2:e/(x-1)*p),y=e.flatMap(e=>[s.includes('spot')?e.spot:null,s.includes('mp')?e.mp:null,s.includes('fut')?e.fut:null]).filter(e=>null!=e),C=s.includes('iv');if(!y.length&&!C)return null;y.length||y.push(0,1);let j=Math.min(...y),S=Math.max(...y);const k=Math.max(20,.08*(S-j));j-=k,S+=k;const T=e=>h+f-(e-j)/(S-j)*f,I=e.map(e=>e.iv).filter(e=>null!=e);let w=I.length?Math.min(...I):0,M=I.length?Math.max(...I):1;const $=Math.max(2,M-w),F=(w+M)/2;w=F-.6*$,M=F+.6*$;const R=e=>h+f-(e-w)/(M-w)*f,H=(t,i,n=!1,l=!1)=>{let o='',s=!1,r=0;return e.forEach((e,d)=>{const a=t(e);if(null==a)return void(l||(s=!1));const h=m(d),c=i(a);o+=s?n?`L${h.toFixed(1)} ${r.toFixed(1)} L${h.toFixed(1)} ${c.toFixed(1)} `:`L${h.toFixed(1)} ${c.toFixed(1)} `:`M${h.toFixed(1)} ${c.toFixed(1)} `,s=!0,r=c}),o},L=H(e=>e.spot,T),z=e.findIndex(e=>null!=e.spot),P=x-1-[...e].reverse().findIndex(e=>null!=e.spot),W=Array.from({length:5},(e,t)=>j+(S-j)*t/4),O=x>1?Array.from({length:7},(e,t)=>Math.round(t*(x-1)/6)):[0],_=e[x-1],A=[{k:'spot',v:s.includes('spot')?_.spot:null,c:v.spot,txt:null==_.spot?'':u.fmt.spot(_.spot,n)},{k:'mp',v:s.includes('mp')?_.mp:null,c:v.mp,txt:null==_.mp?'':u.fmt.strike(_.mp)},{k:'fut',v:s.includes('fut')?_.fut:null,c:v.fut,txt:null==_.fut?'':u.fmt.spot(_.fut,n)}].filter(e=>null!=e.v).map(e=>({...e,Y:T(e.v)})).sort((e,t)=>
1064e.Y-t.Y);for(let e=1;e<A.length;e++)A[e].Y-A[e-1].Y<20&&(A[e].Y=A[e-1].Y+20);return(0,b.jsxs)(o.default,{width:t,height:i,'aria-hidden':!0,children:[W.map((e,t)=>(0,b.jsxs)(l.G,{children:[(0,b.jsx)(l.Line,{x1:r,x2:r+p,y1:T(e),y2:T(e),stroke:d.C.lineSoft}),(0,b.jsx)(l.Text,{x:r-6,y:T(e)+4,fontFamily:"Inter",fontSize:11,fill:d.C.muted,textAnchor:"end",children:Math.round(e).toLocaleString('en-IN')})]},t)),C&&I.length>1&&[w+.15*(M-w),F,M-.15*(M-w)].map((e,t)=>(0,b.jsxs)(l.Text,{x:r+p+52,y:R(e)+4,fontFamily:"Inter",fontSize:11,fill:v.iv,fillOpacity:.8,children:[e.toFixed(1),"%"]},'iv'+t)),O.map((t,i)=>e[t]&&(0,b.jsx)(l.Text,{x:m(t),y:h+f+18,fontFamily:"Inter",fontSize:11,fill:d.C.muted,textAnchor:"middle",children:(0,u.clockOf)(e[t].at)},'x'+i)),(0,b.jsx)(l.Defs,{children:(0,b.jsxs)(l.LinearGradient,{id:"spotFade",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,b.jsx)(l.Stop,{offset:"0",stopColor:v.spot,stopOpacity:.3}),(0,b.jsx)(l.Stop,{offset:"1",stopColor:v.spot,stopOpacity:.02})]})}),s.includes('spot')&&L&&z>=0&&(0,b.jsx)(l.Path,{d:`${L} L${m(P).toFixed(1)} ${h+f} L${m(z).toFixed(1)} ${h+f} Z`,fill:"url(#spotFade)"}),s.includes('spot')&&L&&(0,b.jsx)(l.Path,{d:L,fill:"none",stroke:v.spot,strokeWidth:2}),s.includes('mp')&&(0,b.jsx)(l.Path,{d:H(e=>e.mp,T,!0),fill:"none",stroke:v.mp,strokeWidth:2}),s.includes('fut')&&(0,b.jsx)(l.Path,{d:H(e=>e.fut,T),fill:"none",stroke:v.fut,strokeWidth:1.6}),C&&I.length>1&&(0,b.jsx)(l.Path,{d:H(e=>e.iv,R,!1,!0),fill:"none",stroke:v.iv,strokeWidth:1.6}),A.map(e=>(0,b.jsxs)(l.G,{children:[(0,b.jsx)(l.Rect,{x:r+p+4,y:e.Y-9,width:50,height:18,rx:4,fill:e.c}),(0,b.jsx)(l.Text,{x:r+p+29,y:e.Y+4,fontFamily:"InterSemi",fontSize:11,fill:d.C.bg,textAnchor:"middle",children:e.txt.replace(/\.\d+$/,'')})]},e.k))]})}},971,[11,278,13,840,375,871,821,921,933,932,958,962,928,961,972,966,973,6]); 1065__d(function(_g,r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.mpMoves=a,e.gapPhase=s,e.maxPainStory=function(n,l,p=!0){const u={ok:!1,headline:'',headSo:'',lines:[],moves:[],asOf:'',since:''};if(!n.length)return{...u,headline:'No reading captured yet in this session.'};if(n.length<2)return{...u,headline:'Only one reading so far - the story starts with the next one.',asOf:(0,t.clockOf)(n[0].at),since:(0,t.clockOf)(n[0].at)};const m=n[0],d=n[n.length-1],h=(0,t.clockOf)(m.at),f=(0,t.clockOf)(d.at),c=a(n),g=n.find(t=>null!=t.mp)?.mp??null;if(null==d.mp||null==g)return{...u,headline:'Max pain was not reported for this session, so the story cannot be told yet.',asOf:f,since:h};const $=[],v=(t,n,a)=>$.push({t:t,so:n,tag:a}),b=null!=d.spot?d.spot-d.mp:null,M=s(n),w=n.find(t=>null!=t.spot)?.spot??null,k=null!=d.spot&&w?(d.spot-w)/w*100:null,y=c[c.length-1],O=c.length?1===c.length?`Max pain moved ${y.to>y.from?'up':'down'} ${t.fmt.strike(y.from)} \u2192 ${t.fmt.strike(y.to)} at ${(0,t.clockOf)(y.at)}${y.at===d.at?'':', steady since'}`:`Max pain moved ${c.length} times (${t.fmt.strike(g)} \u2192 ${t.fmt.strike(d.mp)}); last ${y.to>y.from?'up':'down'} to ${t.fmt.strike(y.to)} at ${(0,t.clockOf)(y.at)}${y.at===d.at?'':', steady since'}`:`Max pain stayed at ${t.fmt.strike(d.mp)} all session`,x=d.mp-g,S=c.length?0===x?'the payout minimum went back and forth as OI shifted between strikes.':null!=b&&Math.sign(x)===Math.sign(d.spot-g)?'the payout minimum shifted in the same direction as spot.':'the payout minimum shifted against spot\'s direction as OI moved between strikes.':'the OI mix by strike did not shift enough to move the payout minimum.',I=null==b?'Spot was not captured at this reading, so the gap to max pain is unavailable':`Spot ${t.fmt.spot(d.spot,p)} is ${i(b)} ${o(b)} max pain ${t.fmt.strike(d.mp)}`,F=M&&null!=b?'steady'===M.dir?`; the gap has held near ${i(M.b)} since ${(0,t.clockOf)(M.from)}`:`; the gap has been ${M.dir} since ${(0,t.clockOf)(M.from)} (${i(M.a)} \u2192 ${i(M.b)})`:'',V=M&&null!=b?'narrowing'===M.dir?c.length&&y&&M.from<=y.at?'spot and max pain drawing closer, partly because max pain itself moved.':'spot and max pain drawing closer - max pain is a payout calculation, not a level price has to reach.':'widening'===M.dir?'spot moving away from the payout minimum; max pain is recomputed from OI at each reading.':'spot and max pain holding their distance.':'',T=n.find(t=>null!=t.iv),_=[...n].reverse().find(t=>null!=t.iv),j=n.find(t=>null!=t.fut&&null!=t.spot),A=null!=d.fut&&null!=d.spot?d.fut-d.spot:null,N=j?j.fut-j.spot:null;if('beginner'===l){const t=`${I}${F}.`;if(v(`${O}.`,S),M&&null!=b&&'steady'!==M.dir&&v('narrowing'===M.dir?'The distance is shrinking.':'The distance is growing.',V),T&&_&&T!==_){const t=_.iv-T.iv;v(Math.abs(t)<.2?'Option premiums steady (IV flat).':t<0?'Option premiums cooling (IV down).':'Option premiums firming (IV up).',Math.abs(t)<.2?'no change in how big a move options are pricing.':t<0?'options are getting cheaper; a smaller implied move.':'options are getting dearer; a larger implied move.','model')}else T||v('ATM IV is unavailable for this session.','');return{ok:!0,headline:t,headSo:'',lines:$.slice(0,3),moves:c,asOf:f,since:h}}const P=`${null!=d.spot?`${t.fmt.spot(d.spot,p)}${null!=k?` (${k>=0?'+':''}${k.toFixed(2)}% since ${h})`:''}`:'Spot unavailable'}; max pain ${t.fmt.strike(g)} \u2192 ${t.fmt.strike(d.mp)}${x?` (${x>0?'+':''}${x})`:''}${null!=b?`, gap ${b>=0?'+':'\u2212'}${Math.round(Math.abs(b))}`:''}.`;if(v(`${O}${c.length>1?`: ${c.slice(-3).map(n=>`${(0,t.clockOf)(n.at)} ${t.fmt.strike(n.to)}`).join(', ')}`:''}.`,S),null!=b){const t=null!=m.spot&&null!=m.mp?m.spot-m.mp:null;v(`Gap ${null==t?'at the open unavailable':`${t>=0?'+':'\u2212'}${Math.round(Math.abs(t))} at ${h}`} \u2192 ${b>=0?'+':'\u2212'}${Math.round(Math.abs(b))} now${F}.`,V||'distance to max pain measured each reading.')}else v('Spot was not captured at this reading, so the gap is unavailable.','');
1065null!=A?v(`Futures ${t.fmt.spot(d.fut,p)}, basis ${A>=0?'+':''}${A.toFixed(0)}${null!=N?` (was ${N>=0?'+':''}${N.toFixed(0)} at ${(0,t.clockOf)(j.at)})`:''}.`,null==N?'premium of futures over spot.':Math.abs(A-N)<5?'futures premium little changed through the day.':A>N?'futures premium over spot widened.':'futures premium over spot narrowed.'):v('Futures were not captured, so the basis is unavailable.','');if(T&&_&&T!==_){const n=_.iv-T.iv;v(`ATM IV ${t.fmt.iv(T.iv)} \u2192 ${t.fmt.iv(_.iv)} (${t.fmt.pts(n)} pts since ${(0,t.clockOf)(T.at)}).`,Math.abs(n)<.2?'premiums steady.':n<0?'premiums cooling.':'premiums firming - the market prices a bigger move.','model')}else v('ATM IV was not solved over this session.','');const C=n[n.length-2],L=null!=d.spot&&null!=C.spot?d.spot-C.spot:null,G=null!=d.mp&&null!=C.mp?d.mp-C.mp:null;return v(`Latest reading (${f}): spot ${null==L?'\u2014':`${L>=0?'+':''}${L.toFixed(1)}`}, max pain ${null==G?'\u2014':G?`${G>0?'+':''}${G}`:'unchanged'}.`,G?'max pain shifted in the last reading.':null==L?'':Math.abs(L)<2?'little change in the last reading.':'only spot moved in the last reading.'),{ok:!0,headline:P,headSo:'',lines:$.slice(0,6),moves:c,asOf:f,since:h}},e.mpChangeNote=function(n,a){if(!n)return a.note;const s=[];a.dMp&&s.push(`Max pain ${a.dMp>0?'up':'down'} to ${t.fmt.strike(a.mp)}${n.dMp?'':' (first move in a while)'}`);const i=null!=a.dist&&null!=n.dist?Math.abs(a.dist)-Math.abs(n.dist):null;if(null!=i){const t=Math.abs(i)<3?'steady':i<0?'narrowing':'widening';s.push(`gap ${t} (${Math.round(Math.abs(n.dist))} \u2192 ${Math.round(Math.abs(a.dist))})`)}null!=a.dSpot&&null!=n.dSpot&&Math.abs(a.dSpot)>=1&&Math.abs(n.dSpot)>=1&&Math.sign(a.dSpot)!==Math.sign(n.dSpot)&&s.push("spot turned "+(a.dSpot>0?'up':'down'));if(!s.length)return a.note;const o=s.join('; ');return o[0].toUpperCase()+o.slice(1)+'.'};var t=r(_d[0]);const n=15;function a(t){const n=[];let a=null;for(const s of t)null!=s.mp&&(null!=a&&s.mp!==a&&n.push({at:s.at,from:a,to:s.mp}),a=s.mp);return n}function s(t){const a=t.filter(t=>null!=t.spot&&null!=t.mp).map(t=>({at:t.at,v:Math.abs(t.spot-t.mp)}));if(a.length<2)return null;let s=0,i=0,o=0;for(let t=1;t<a.length;t++)0!==o?1===o&&a[t].v>=a[i].v||-1===o&&a[t].v<=a[i].v?i=t:Math.abs(a[t].v-a[i].v)>n&&(s=i,o=1===o?-1:1,i=t):Math.abs(a[t].v-a[s].v)>n&&(o=a[t].v>a[s].v?1:-1,i=t);const l=a[a.length-1];return 0===o?{dir:'steady',from:a[0].at,a:a[0].v,b:l.v}:i<a.length-1&&Math.abs(l.v-a[i].v)>7.5?{dir:l.v>a[i].v?'widening':'narrowing',from:a[i].at,a:a[i].v,b:l.v}:i<a.length-1?{dir:'steady',from:a[i].at,a:a[i].v,b:l.v}:{dir:1===o?'widening':'narrowing',from:a[s].at,a:a[s].v,b:l.v}}const i=t=>`${Math.round(Math.abs(t)).toLocaleString('en-IN')} point${1===Math.round(Math.abs(t))?'':'s'}`,o=t=>t>=0?'above':'below'},972,[958]); 1066__d(function(_g,_r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STATE_TEXT",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"LOOKBACK_MIN",{enumerable:!0,get:function(){return s}}),e.buildSeries=function(l,s,a,o,i){if(!l)return[];const u=(0,t.indexAtOrBefore)(l.readings,s);if(u<0)return[];const p=l.readings[u].at.slice(0,10),r=(a||[]).filter(t=>t.at&&t.at.slice(0,10)===p),f=(o||[]).filter(t=>t.at&&t.at.slice(0,10)===p&&!t.gap),c=(n,l)=>{const s=(0,t.indexAtOrBefore)(n.map(t=>t.at),l);return s>=0?n[s]:null},h=l=>{if(!i||!Array.isArray(i.readings))return null;const s=(0,t.indexAtOrBefore)(i.readings,l);if(s<0)return null;const a=(i.legs||[]).filter(t=>t.present).map(t=>n(t.iv_pct?.[s])).filter(t=>null!=t);return a.length?a.reduce((t,n)=>t+n,0)/a.length:null},d=[];for(let s=0;s<=u;s++){const a=l.readings[s].at;d.push({at:a,spot:(0,t.refSpot)(l,s).value,mp:n(c(r,a)?.max_pain_strike),fut:n(c(f,a)?.close),iv:h(a)})}return d},e.atmStrike=function(n,l){if(!n)return null;const s=(0,t.indexAtOrBefore)(n.readings,l);if(s<0)return null;const a=(0,t.refSpot)(n,s).value;return null==a?null:n.strikes[(0,t.nearestIndex)(n.strikes,a)]},e.readState=function(n,s=50){const o={state:'none',now:null,then:null,from:'',facts:[],inference:l.none.line,ivWord:'',gapNow:null,gapThen:null,basisNow:null,basisThen:null};if(n.length<2)return{...o,facts:['Fewer than two readings so far.']};const i=n[n.length-1],u=((0,t.stampMs)(i.at)??0)-36e5;let p=n[0];for(const l of n){const n=(0,t.stampMs)(l.at);null!=n&&n<=u&&(p=l)}const r=[];if(null==i.spot||null==p.spot||null==i.mp||null==p.mp)return{...o,now:i,then:p,from:(0,t.clockOf)(p.at),facts:['Spot or Max Pain was not captured over this window.']};const f=i.spot-p.spot,c=i.mp-p.mp,h=i.spot-i.mp,d=p.spot-p.mp,b=Math.abs(h)-Math.abs(d),v=null!=i.fut?i.fut-i.spot:null,g=null!=p.fut&&null!=p.spot?p.fut-p.spot:null,$=null!=i.fut&&null!=p.fut?i.fut-p.fut:null,w=(0,t.clockOf)(p.at);r.push(`Spot ${f>=0?'rose':'fell'} ${Math.abs(f).toFixed(0)} points (${t.fmt.spot(p.spot)} \u2192 ${t.fmt.spot(i.spot)}) since ${w}.`),r.push(0===c?`Max Pain stayed at ${t.fmt.strike(i.mp)}.`:`Max Pain moved ${c>0?'up':'down'} from ${t.fmt.strike(p.mp)} to ${t.fmt.strike(i.mp)}.`),r.push(`Spot is ${Math.abs(h).toFixed(0)} points ${h>=0?'above':'below'} Max Pain (was ${Math.abs(d).toFixed(0)} ${d>=0?'above':'below'}).`),null==$?r.push('Futures were not captured over this window.'):r.push(`Futures ${a($,2)===a(f,2)&&0!==a(f,2)?'moved with Spot':'did not follow Spot'} (${$>=0?'+':''}${$.toFixed(0)}); basis ${null==v?'\u2014':(v>=0?'+':'')+v.toFixed(0)} (was ${null==g?'\u2014':(g>=0?'+':'')+g.toFixed(0)}).`);const M=null!=i.iv&&null!=p.iv?i.iv-p.iv:null,x=null==M?'ATM IV was not solved over this window.':Math.abs(M)<.2?`ATM IV is stable (${t.fmt.iv(i.iv)}).`:`ATM IV is ${M>0?'rising':'falling'} (${t.fmt.iv(p.iv)} \u2192 ${t.fmt.iv(i.iv)})${0!==a(f,5)?" while price "+(f>0?'rises':'falls'):''}.`;r.push(x);const O=null!=$&&a($,2)===a(f,2)&&0!==a(f,2),S=Math.abs(c)>=s&&Math.sign(c)===Math.sign(d);let A='none';S&&O?A='mp_to_price':b<=-15&&Math.abs(c)<s&&null!=$&&Math.sign($)===-Math.sign(d)&&Math.sign(f)===-Math.sign(d)?A='price_to_mp':b>=15&&(Math.abs(c)<s||Math.sign(c)!==Math.sign(d))&&(A='separation');return{state:A,now:i,then:p,from:w,facts:r,inference:l[A].line,ivWord:x,gapNow:h,gapThen:d,basisNow:v,basisThen:g}},e.sessionRows=function(n,l){if(n.length<2)return[{label:'Session',tag:'Unavailable',text:'Fewer than two readings so far.'}];const s=n[0],a=n[n.length-1],o=(0,t.clockOf)(s.at),i=[];i.push(null!=s.spot&&null!=a.spot?{label:'Spot',tag:'Observed',text:`${t.fmt.spot(s.spot)} \u2192 ${t.fmt.spot(a.spot)} (${a.spot-s.spot>=0?'+':''}${(a.spot-s.spot).toFixed(2)}) since ${o}.`}:{label:'Spot',tag:'Unavailable',text:'Spot was not captured.'});const u=n.find(t=>null!=t.mp)?.mp??null,p=n.reduce((t,l,s)=>t+(s&&null!=l.mp&&null!=n[s-1].mp&&l.mp!==n[s-1].mp?1:0),0);i.push(null!=u&&null!=a.mp?{label:'Max Pain',tag:'Observed',text:`${t.fmt.strike(u)} \u2192 ${t.fmt.strike(a.mp)} (${a.mp-u>=0?'+':''}${a.mp-u}); it changed ${p} time${1===p?'':'s'} today.`}:{label:'Max Pain',tag:'Unavailable',text:'Max Pain was not reported.'}),null!=a.spot&&null!=a.mp&&i.push({label:'Distance',tag:'Observed',text:`Spot is ${Math.abs(a.spot-a.mp).toFixed(0)} points ${a.spot>=a.mp?'above':'below'}
1066 Max Pain now${null!=s.spot&&null!=u?` (${Math.abs(s.spot-u).toFixed(0)} ${s.spot>=u?'above':'below'} at ${o})`:''}.`});const r=n.find(t=>null!=t.fut&&null!=t.spot);i.push(null!=a.fut&&null!=a.spot?{label:'Futures',tag:'Observed',text:`${t.fmt.spot(a.fut)}, basis ${a.fut-a.spot>=0?'+':''}${(a.fut-a.spot).toFixed(0)}${r?` (was ${r.fut-r.spot>=0?'+':''}${(r.fut-r.spot).toFixed(0)} at ${(0,t.clockOf)(r.at)})`:''}.`}:{label:'Futures',tag:'Unavailable',text:'Futures were not captured.'});const f=n.find(t=>null!=t.iv),c=[...n].reverse().find(t=>null!=t.iv);return i.push(f&&c?{label:'ATM IV',tag:'Model estimate',text:`${t.fmt.iv(f.iv)} \u2192 ${t.fmt.iv(c.iv)} (${t.fmt.pts(c.iv-f.iv)} pts) since ${(0,t.clockOf)(f.at)}.`}:{label:'ATM IV',tag:'Unavailable',text:'ATM IV was not solved.'}),i.push({label:'Last hour',tag:'Observed',text:l.facts.slice(0,3).join(' ')}),i.push({label:'',tag:'Possible explanation',text:l.inference}),i.push({label:'',tag:'Observed',text:'A rule on observed moves, not yet back-tested; nothing here is a forecast.'}),i},e.readingRows=function(n){const l=[];for(let s=n.length-1;s>=1;s--){const a=n[s],o=n[s-1],i=null!=a.spot&&null!=o.spot?a.spot-o.spot:null,u=null!=a.mp&&null!=o.mp?a.mp-o.mp:null,p=null!=a.iv&&null!=o.iv?a.iv-o.iv:null,r=null!=a.spot&&null!=a.mp?a.spot-a.mp:null,f=null!=o.spot&&null!=o.mp?o.spot-o.mp:null;let c='';if(u&&(c=`Max Pain ${u>0?'up':'down'} to ${t.fmt.strike(a.mp)}`),null!=r&&null!=f){const t=Math.abs(r)-Math.abs(f);c+=(c?'; ':'')+(Math.abs(t)<3?'gap unchanged':t<0?'gap narrowed':'gap widened')}null!=i&&Math.abs(i)>=1&&(c+=(c?' as spot ':'Spot ')+(i>0?'rose':'fell')),l.push({at:a.at,time:(0,t.clockOf)(a.at),spot:a.spot,dSpot:i,mp:a.mp,dMp:u,dist:r,basis:null!=a.fut&&null!=a.spot?a.fut-a.spot:null,iv:a.iv,dIv:p,note:(c||'No change')+'.'})}return l};var t=_r(_d[0]);const n=t=>'number'==typeof t&&Number.isFinite(t)?t:null,l={mp_to_price:{tag:'MAX PAIN \u2192 SPOT',title:'Max pain has moved toward spot',arrow:'\u2197',line:'Over the last hour the payout minimum has shifted toward spot.'},price_to_mp:{tag:'SPOT \u2192 MAX PAIN',title:'Spot has moved toward max pain',arrow:'\u2198',line:'Over the last hour spot has moved closer to the payout minimum. Max pain is a payout calculation, not a forecast.'},separation:{tag:'\u2190 GAP WIDENING \u2192',title:'Spot and max pain moving apart',arrow:'\u2194',line:'Over the last hour the gap between spot and the payout minimum has widened.'},none:{tag:'\u2014 NO CONSISTENT CHANGE \u2014',title:'No consistent change',arrow:'\u2014',line:'Over the last hour the gap between spot and the payout minimum shows no consistent change.'}},s=60;const a=(t,n)=>null==t?0:t>n?1:t<-n?-1:0},973,[958]); 1067__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"setInstrument",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"setInstrumentExpiry",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"getInstrument",{enumerable:!0,get:function(){return f}}),e.useInstrument=function(){const[n,u]=(0,t.useState)(o);return(0,t.useEffect)(()=>(s.add(u),u(o),()=>{s.delete(u)}),[]),{u:n.u,exp:n.exp,setU:i,setExp:p}},Object.defineProperty(e,"StudioOpen",{enumerable:!0,get:function(){return l}});var t=r(d[0]),n=r(d[1]);const u=['derivative-wip','oi_symbol'];let o={u:(()=>{const t=(0,n.readStore)(u[0],u[1]).u;return'string'==typeof t&&t?t:'NIFTY'})(),exp:''};const s=new Set,c=()=>s.forEach(t=>t(o)),i=t=>{t&&t!==o.u&&(o={u:t,exp:''},(0,n.writeStore)(u[0],u[1],{u:t}),c())},p=t=>{t!==o.exp&&(o={...o,exp:t},c())},f=()=>o;const l=(0,t.createContext)(null)},974,[11,871]); 1068__d(function(g,_r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Home=function(){const{width:e}=(0,l.default)(),p=e>=900,u=(0,f.useAlertNotifications)(),[j,C]=(0,t.useState)(null),[w,v]=(0,t.useState)(''),[k,T]=(0,t.useState)(''),[z,B]=(0,t.useState)('research'),[P,$]=(0,t.useState)(''),[E,_]=(0,t.useState)('updated'),[R,W]=(0,t.useState)(null),L=(0,t.useCallback)(()=>{T(''),c.sb.list(E).then(e=>C(e.strategies)).catch(e=>T(e.message))},[E]);(0,t.useEffect)(()=>{L()},[L]);const M=(0,t.useMemo)(()=>(j||[]).filter(e=>'archived'===z?!!e.archived_at:!e.archived_at&&('paper'!==z||(e.paper_total||0)+(e.deployments?.open||0)+(e.deployments?.attention||0)+(e.deployments?.closed||0)>0)).filter(e=>!P||`${e.name} ${e.underlying||''} ${e.structure}`.toLowerCase().includes(P.toLowerCase())),[j,z,P]);return(0,b.jsxs)(r.default,{style:{padding:p?24:14,gap:18,maxWidth:1200,width:'100%',alignSelf:'center'},children:[(0,b.jsxs)(r.default,{style:{gap:4},children:[(0,b.jsx)(o.T,{style:{fontFamily:'ManropeBold',fontSize:22},children:"Strategies"}),(0,b.jsx)(o.T,{style:{color:o.C.muted,fontSize:13},children:"Build an options strategy, understand its risk, save it, and paper trade it. Nothing here sends an order."})]}),!!w&&(0,b.jsx)(o.T,{style:{color:o.C.red},children:w}),(0,b.jsxs)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,b.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Go to"}),(0,b.jsx)(o.Button,{label:"Lab",icon:"activity",kind:"soft",onPress:()=>i.router.push({pathname:'/strategies',params:{view:'lab'}})}),(0,b.jsx)(o.Button,{label:"Paper runs",icon:"play",kind:"soft",onPress:()=>i.router.push({pathname:'/strategies',params:{view:'paper'}})}),(0,b.jsx)(o.Button,{label:u.count?`Alerts (${u.count})`:'Alerts',icon:"bell",kind:"soft",onPress:()=>i.router.push({pathname:'/strategies',params:{view:'alerts'}})})]}),(0,b.jsxs)(r.default,{style:[o.s.between,{flexWrap:'wrap',gap:10}],children:[(0,b.jsxs)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,b.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Show"}),['research','paper','archived'].map(e=>(0,b.jsx)(o.Chip,{label:{research:'All active',paper:'Paper traded',archived:'Archived'}[e],active:z===e,onPress:()=>B(e)},e)),(0,b.jsx)(o.T,{style:{fontSize:11,color:o.C.muted,marginLeft:6},children:"Sort"}),[['updated','Recent'],['name','Name'],['expiry','Expiry'],['created','Created']].map(([e,t])=>(0,b.jsx)(o.Chip,{label:t,active:E===e,onPress:()=>_(e)},e))]}),(0,b.jsx)(n.default,{value:P,onChangeText:$,placeholder:"Search name, underlying, structure",placeholderTextColor:o.C.muted,accessibilityLabel:"Search strategies",style:{height:40,minWidth:260,borderWidth:1,borderColor:o.C.line,borderRadius:10,paddingHorizontal:12,color:o.C.ink,fontFamily:'Inter',fontSize:13,backgroundColor:o.C.paper}})]}),k?(0,b.jsx)(h.ErrorRetry,{what:"Your strategies",error:k,onRetry:L}):null===j?(0,b.jsx)(o.Loading,{}):j.length?M.length?(0,b.jsxs)(r.default,{style:{borderWidth:1,borderColor:o.C.line,borderRadius:12,overflow:'hidden'},children:[p&&(0,b.jsx)(r.default,{style:[o.s.row,{backgroundColor:o.C.paper,paddingHorizontal:14,paddingVertical:8}],children:['Name','Structure','Underlying \xb7 expiry','Snapshots','Paper','Updated',''].map((e,t)=>(0,b.jsx)(o.T,{style:{flex:0===t?2.2:6===t?1.4:1,fontSize:11,letterSpacing:.6,textTransform:'uppercase',color:o.C.muted,fontFamily:'InterMedium'},children:e},t))}),M.map(e=>(0,b.jsxs)(r.default,{style:{flexDirection:p?'row':'column',alignItems:'stretch',borderTopWidth:1,borderColor:o.C.line},children:[(0,b.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Open ${e.name}`,onPress:()=>i.router.push({pathname:'/strategies',params:e.portfolio?{view:'desk',id:e.id}:{id:e.id}}),style:({pressed:e})=>[{flex:p?7.2:void 0,flexDirection:p?'row':'column',alignItems:p?'center':'flex-start',gap:p?0:4,paddingLeft:14,paddingRight:p?0:14,paddingTop:12,paddingBottom:p?12:4,backgroundColor:e?o.C.soft:'transparent'}],children:[(0,b.jsxs)(r.default,{style:{flex:p?2.2:void 0,gap:4},children:[(0,b.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:13},children:e.name}),!!(e.badges?.length||e.deployments?.open||e.deployments?.attention)&&(0,b.jsxs)(r.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[e.badges?.includes('expired')&&(0,b.jsx)(o.Badge,{label:"Expired contracts",tone:"red"}),e.badges?.includes('empty')&&(0,b.jsx)(o.Badge,{label:"No legs",tone:"neutral"}),!!e.deployments?.open&&(0,b.jsx)(o.Badge,{label:`${e.deployments.open} paper deployment${e.deployments.open>1?'s':''} open`,tone:"green"}),!!e.deployments?.attention&&(0,b.jsx)(o.Badge,{label:`${e.deployments.attention} need attention`,tone:"red"})]})]}),(0,b.jsxs)(o.T,{style:{flex:p?1:void 0,fontSize:12,color:o.C.muted},children:[e.structure,e.legs?` \xb7 ${e.legs} leg${e.legs>1?'s':''}`:'']}),(0,b.jsx)(o.T,{style:{flex:p?1:void 0,fontSize:12},children:`${e.underlying||'\u2014'} \xb7 ${(0,y.dayMonth)(e.expiry)}`}),(0,b.jsx)(o.T,{style:{flex:p?1:void 0,fontSize:12,color:o.C.muted},children:`${e.snapshots} snapshot${1===e.snapshots?'':'s'}`}),(0,b.jsx)(r.default,{style:{flex:p?1:void 0},children:(()=>{const t=(0,x.libraryPaperBadges)(e);return t.length?(0,b.jsx)(r.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:t.map(e=>(0,b.jsx)(o.Badge,{label:e.label,tone:e.tone},e.label))}):(0,b.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"\u2014"})})()}),(0,b.jsx)(o.T,{style:{flex:p?1:void 0,fontSize:11,color:o.C.muted},children:(0,y.istEpoch)(e.updated_at)})]}),(0,b.jsxs)(r.default,{style:[o.s.row,{flex:p?1.4:void 0,alignSelf:p?void 0:'flex-start',gap:6,justifyContent:'flex-end',paddingRight:14,paddingLeft:p?0:14,paddingTop:p?12:0,paddingBottom:12}],children:[(0,b.jsx)(o.Button,{label:"Duplicate",kind:"outline",onPress:async()=>{try{const t=await c.sb.duplicate(e.id);
1068L(),W({id:t.id,name:t.name})}catch(e){v(e.message)}}}),(0,b.jsx)(o.Button,{label:e.archived_at?'Restore':'Archive',kind:"outline",onPress:async()=>{try{await c.sb.archive(e.id,!e.archived_at),L()}catch(e){v(e.message)}}})]})]},e.id))]}):(0,b.jsxs)(r.default,{style:[o.s.row,{gap:10}],children:[(0,b.jsx)(o.T,{style:{color:o.C.muted},children:"Nothing matches this filter."}),(0,b.jsx)(o.Button,{label:"Clear filters",kind:"outline",onPress:()=>{$(''),B('research')}})]}):(0,b.jsx)(o.Empty,{icon:"layers",title:"No strategies yet",detail:"Start one above. Every change is saved automatically, and snapshots freeze a version you want to keep."}),!!R&&(0,b.jsxs)(r.default,{accessibilityRole:"alert",style:[o.s.row,{gap:10,flexWrap:'wrap',backgroundColor:o.C.soft,borderRadius:10,padding:10,alignItems:'center'}],children:[(0,b.jsx)(o.T,{style:{fontSize:13,flex:1},children:`Copied as "${R.name}". The copy keeps the legs and scenario, not the snapshots or paper history.`}),(0,b.jsx)(o.Button,{label:"Open the copy",kind:"outline",onPress:()=>i.router.push({pathname:'/strategies',params:{id:R.id}})}),(0,b.jsx)(o.Button,{label:"Dismiss",kind:"outline",onPress:()=>W(null)})]}),(0,b.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Archive hides a strategy; it never deletes its snapshots or paper history, and never closes a paper deployment."}),(0,b.jsx)(S,{})]})},_e.StartView=function({kind:e}){const[s,n]=(0,t.useState)(''),{width:c}=(0,l.default)();return(0,b.jsxs)(r.default,{style:{padding:c>=900?24:14,gap:12,maxWidth:1200,width:'100%',alignSelf:'center'},children:[!!s&&(0,b.jsx)(o.T,{style:{color:o.C.red},children:s}),(0,b.jsx)(C,{kind:e,inline:!0,onClose:()=>i.router.push('/strategies'),onError:n})]})};var t=_r(d[0]),s=e(_r(d[1])),n=e(_r(d[2])),r=e(_r(d[3])),l=e(_r(d[4])),i=_r(d[5]),o=_r(d[6]),c=_r(d[7]),p=_r(d[8]),u=_r(d[9]),h=_r(d[10]),y=_r(d[11]),f=_r(d[12]),x=_r(d[13]),j=_r(d[14]),b=_r(d[15]);function C({kind:e,onClose:s,onError:n,inline:l=!1}){const[f,x]=(0,t.useState)([]),[C,S]=(0,t.useState)('NIFTY'),[w,v]=(0,t.useState)([]),[k,T]=(0,t.useState)(''),[z,B]=(0,t.useState)(''),[P,$]=(0,t.useState)(!1);(0,t.useEffect)(()=>{e&&(B(''),c.sb.underlyings().then(e=>x(e.underlyings)).catch(e=>B(e.message)))},[e]),(0,t.useEffect)(()=>{if(!e)return;let t=!0;return v([]),T(''),c.sb.expiries(C).then(e=>{t&&(v(e.expiries),T((e.expiries.find(e=>(e.days_to_expiry??0)>=1)||e.expiries[0])?.expiry||''))}).catch(e=>{t&&B(e.message)}),()=>{t=!1}},[e,C]);const E=(0,b.jsxs)(r.default,{style:{gap:10},children:[(0,b.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Underlying"}),(0,b.jsx)(u.UnderlyingPicker,{list:f,value:C,onPick:S}),(0,b.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Expiry (the first with at least one full day left is chosen for you)"}),(0,b.jsx)(j.ExpiryChips,{expiries:w,selected:k,onSelect:T}),!!z&&(0,b.jsx)(h.ErrorRetry,{what:"Market context",error:z})]});return'template'===e?(0,b.jsx)(p.TemplateSheet,{visible:!0,inline:l,onClose:s,replacing:0,onPick:async function(e,t){if(!P&&k){$(!0);try{const n=(await c.sb.resolve(e.key,C,k,t)).legs.map((e,t)=>({id:`L${t+1}`,type:e.type,side:e.side,strike:e.strike,lots:e.lots,expiry:e.expiry,price_basis:'exec',price:null,include:!0})),r=await c.sb.create({underlying:C,expiry:k,legs:n,scenario:{},template:e.key,param:t},`${C} ${e.name} ${(0,y.dayMonth)(k)}`);s(),i.router.push({pathname:'/strategies',params:{id:r.id}})}catch(e){B(e.message)}finally{$(!1)}}},title:`Use a template on ${C}`,header:E}):(0,b.jsx)(o.Sheet,{visible:'scratch'===e,inline:l,onClose:s,title:"Build from scratch",subtitle:"Choose what you are trading first. Nothing is created until you continue.",footer:(0,b.jsxs)(r.default,{style:[o.s.row,{justifyContent:'flex-end',gap:8}],children:[(0,b.jsx)(o.Button,{label:"Cancel",kind:"outline",onPress:s}),(0,b.jsx)(o.Button,{label:"Create and open the chain",icon:"arrow-right",loading:P,disabled:!C||!k,onPress:async function(){$(!0);try{const e=await c.sb.create({underlying:C,expiry:k,legs:[],scenario:{}},`${C} strategy ${(0,y.dayMonth)(k)}`);s(),i.router.push({pathname:'/strategies',params:{id:e.id,open:'chain'}})}catch(e){n(e.message)}finally{$(!1)}}})]}),children:E})}function S(){const[e,s]=(0,t.useState)(null),[n,l]=(0,t.useState)(!1),[i,p]=(0,t.useState)('');return(0,t.useEffect)(()=>{c.sb.consent().then(s).catch(()=>{})},[]),e?(0,b.jsxs)(r.default,{style:{borderWidth:1,borderColor:o.C.line,borderRadius:12,padding:12,gap:6},children:[(0,b.jsxs)(r.default,{style:[o.s.between,{flexWrap:'wrap',gap:8}],children:[(0,b.jsx)(o.T,{style:{fontFamily:'InterSemi'},children:"Help measure which adjustments work"}),(0,b.jsx)(o.Button,{label:e.consent?'Sharing: on - turn off':'Sharing: off - turn on',kind:"outline",loading:n,onPress:async()=>
1068{l(!0),p('');try{const t=await c.sb.setConsent(!e.consent);s({...e,consent:t.consent})}catch(e){p(e.message)}finally{l(!1)}}})]}),(0,b.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:e.explain}),!!i&&(0,b.jsx)(o.T,{accessibilityRole:"alert",style:{fontSize:12,color:o.C.red},children:i})]}):null}},975,[11,375,385,13,400,252,821,976,977,981,980,979,985,986,982,6]); 1069__d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"sb",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"exec",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"alerts",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"lab",{enumerable:!0,get:function(){return n}});var e=r(d[0]);const s={spreads:(s,p,t,n,o,b=1)=>(0,e.api)(`/api/sb/spreads?underlying=${encodeURIComponent(s)}&expiry=${p}&type=${t}&side=${n}&width=${o}&lots=${b}`),adjustCandidates:(s,p)=>(0,e.api)(`/api/sb/strategies/${s}/adjust/candidates`,{deployment_id:p||null}),adjustApply:(s,p)=>(0,e.api)(`/api/sb/strategies/${s}/adjust/apply`,p),underlyings:()=>(0,e.api)('/api/sb/underlyings'),expiries:s=>(0,e.api)(`/api/sb/expiries?underlying=${encodeURIComponent(s)}`),chain:(s,p,t)=>(0,e.api)(`/api/sb/chain?underlying=${encodeURIComponent(s)}&expiry=${p}`,void 0,{},t),templates:()=>(0,e.api)('/api/sb/templates'),resolve:(s,p,t,n,o=1)=>(0,e.api)('/api/sb/templates/resolve',{template:s,underlying:p,expiry:t,param:n,lots:o}),analyze:(s,p)=>(0,e.api)('/api/sb/analyze',{body:s},{},p),discover:s=>(0,e.api)('/api/sb/discover',s),discoverUse:s=>(0,e.api)('/api/sb/discover/use',{candidate_id:s}),list:(s="updated")=>(0,e.api)(`/api/sb/strategies?sort=${s}`),create:(s,p,t)=>(0,e.api)('/api/sb/strategies',{body:s,name:p,thesis:t}),get:s=>(0,e.api)(`/api/sb/strategies/${s}`),save:(s,p,t)=>(0,e.api)(`/api/sb/strategies/${s}/draft`,{version:p,body:t}),meta:(s,p)=>(0,e.api)(`/api/sb/strategies/${s}/meta`,p),snapshot:(s,p,t)=>(0,e.api)(`/api/sb/strategies/${s}/snapshots`,{name:p,...t||{}}),revision:s=>(0,e.api)(`/api/sb/revisions/${s}`),revisionMeta:(s,p)=>(0,e.api)(`/api/sb/revisions/${s}`,p),restore:(s,p,t)=>(0,e.api)(`/api/sb/strategies/${s}/restore`,{revision_id:p,version:t}),duplicate:(s,p,t)=>(0,e.api)(`/api/sb/strategies/${s}/duplicate`,{revision_id:p,...t||{}}),evidence:s=>(0,e.api)(`/api/sb/strategies/${s}/evidence`),calendar:()=>(0,e.api)('/api/sb/calendar'),archive:(s,p)=>(0,e.api)(`/api/sb/strategies/${s}/archive`,{archived:p}),paperStart:(s,p)=>(0,e.api)(`/api/sb/strategies/${s}/paper`,{confirm:!0,...p||{}}),paperList:()=>(0,e.api)('/api/sb/paper'),consent:()=>(0,e.api)('/api/sb/consent'),setConsent:s=>(0,e.api)('/api/sb/consent',{consent:s}),paperClose:s=>(0,e.api)(`/api/sb/paper/${s}/close`,{confirm:!0}),paperGet:s=>(0,e.api)(`/api/sb/paper/${s}`),paperCancel:s=>(0,e.api)(`/api/sb/paper/${s}/cancel`,{confirm:!0})},p={exitRules:(s,p,t)=>(0,e.api)(`/api/sb/deployments/${s}/exit-rules`,{target_pct:p,stop_pct:t}),autotradeRelease:s=>(0,e.api)(`/api/sb/autotrade/routes/${s}/release`,{confirm:!0}),status:()=>(0,e.api)('/api/sb/status'),preview:(s,p)=>(0,e.api)(`/api/sb/strategies/${s}/preview`,p),deploy:(s,p,t,n=!1)=>(0,e.api)(`/api/sb/strategies/${s}/deployments`,{preview_id:p.id,preview_hash:p.hash,idempotency_key:t,confirm:!0,ack_unlimited:n}),list:()=>(0,e.api)('/api/sb/deployments'),get:s=>(0,e.api)(`/api/sb/deployments/${s}`),cancel:s=>(0,e.api)(`/api/sb/deployments/${s}/cancel`,{}),closePreview:(s,p="marketable")=>(0,e.api)(`/api/sb/deployments/${s}/close-preview`,{price_policy:p}),autotradeCapability:()=>(0,e.api)('/api/sb/autotrade/capability'),autotrade:(s,p,t,n,o=!1)=>(0,e.api)(`/api/sb/strategies/${s}/autotrade`,{preview_id:p.id,preview_hash:p.hash,idempotency_key:t,mode:n,confirm_live:o}),autotradeRoutes:s=>(0,e.api)(`/api/sb/autotrade/routes?strategy_id=${encodeURIComponent(s)}`),autotradeGet:s=>(0,e.api)(`/api/sb/autotrade/routes/${s}`),autotradeCancel:s=>(0,e.api)(`/api/sb/autotrade/routes/${s}/cancel`,{}),adjustPreview:(s,p="marketable",t)=>(0,e.api)(`/api/sb/deployments/${s}/adjust-preview`,{price_policy:p,limits:t}),adjust:(s,p,t,n=!1)=>(0,e.api)(`/api/sb/deployments/${s}/adjust`,{preview_id:p.id,preview_hash:p.hash,idempotency_key:t,confirm:!0,ack_unlimited:n}),close:(s,p,t)=>(0,e.api)(`/api/sb/deployments/${s}/close`,{preview_id:p.id,preview_hash:p.hash,idempotency_key:t,confirm:!0})},t={all:()=>(0,e.api)('/api/sb/alerts'),unacked:()=>(0,e.api)('/api/sb/alerts/unacked'),forStrategy:s=>(0,e.api)(`/api/sb/strategies/${s}/alerts`),create:(s,p)=>(0,e.api)(`/api/sb/strategies/${s}/alerts`,p),update:(s,p)=>(0,e.api)(`/api/sb/alerts/${s}`,p),remove:s=>(0,e.api)(`/api/sb/alerts/${s}/delete`,{}),check:s=>(0,e.api)(`/api/sb/alerts/${s}/check`,{}),ack:s=>(0,e.api)('/api/sb/alert-events/ack',s?{event_id:s}:{})},n={universe:()=>(0,e.api)('/api/sb/lab/universe'),start:s=>(0,e.api)('/api/sb/lab/backtests',s),batches:()=>(0,e.api)('/api/sb/lab/batches'),batch:s=>(0,e.api)(`/api/sb/lab/batches/${s}`),runs:s=>(0,e.api)("/api/sb/lab/runs"+(s?`?strategy_id=${s}`:'')),run:s=>(0,e.api)(`/api/sb/lab/runs/${s}`),cancel:s=>(0,e.api)(`/api/sb/lab/runs/${s}/cancel`,{}),replay:(s,p,t)=>(0,e.api)(`/api/sb/strategies/${s}/replay`,{interval:p,days:t})}},976,[197]); 1070__d(function(g,r,i,a,m,_e,d){"use strict";
1070function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.TemplateSheet=function({visible:e,onClose:b,onPick:C,replacing:S,title:k="Choose a template",header:T,inline:w=!1}){const[$,v]=(0,l.useState)(null),[z,P]=(0,l.useState)(''),[L,_]=(0,l.useState)(!1),[B,R]=(0,l.useState)({}),[D,F]=(0,l.useState)(null),[U,W]=(0,l.useState)(''),[I,M]=(0,l.useState)('all'),[A,E]=(0,l.useState)('all'),H=()=>{P(''),c.sb.templates().then(v).catch(e=>P(e?.message||'Templates could not be loaded.'))};(0,l.useEffect)(()=>{e&&!$&&H()},[e,$]);const N=e=>{if(!L&&'defined'!==e.risk)return!1;if('all'!==I&&e.intent!==I)return!1;if('1-2'===A&&e.legs>2)return!1;if('3-4'===A&&(e.legs<3||e.legs>4))return!1;if('5+'===A&&e.legs<5)return!1;const l=U.trim().toLowerCase();return!l||`${e.name} ${e.recipe} ${e.use}`.toLowerCase().includes(l)},q=(0,l.useMemo)(()=>$?$.templates.filter(N):[],[$,L,I,A,U]);return(0,p.jsxs)(o.Sheet,{visible:e,onClose:b,wide:!0,inline:w,title:k,subtitle:S?`Using a template replaces the ${S} current leg${S>1?'s':''}. You will see the change first, and can undo it.`:'A template is a recipe; it becomes exact contracts from the current chain, all editable.',children:[T,(0,p.jsx)(h.LoadState,{loading:!$&&!z,error:z,onRetry:H,children:$&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(n.default,{style:{gap:8},children:[(0,p.jsx)(s.default,{value:U,onChangeText:W,placeholder:"Search templates (e.g. condor, spread, hedge)",placeholderTextColor:o.C.muted,accessibilityLabel:"Search templates",style:{height:44,borderWidth:1,borderColor:o.C.line,borderRadius:10,paddingHorizontal:12,color:o.C.ink,fontFamily:'Inter',fontSize:13,backgroundColor:o.C.paper}}),(0,p.jsx)(n.default,{style:[o.s.row,{flexWrap:'wrap',gap:6}],children:[['all','All directions'],...f].map(([e,l])=>(0,p.jsx)(o.Chip,{label:l,active:I===e,onPress:()=>M(e)},e))}),(0,p.jsxs)(n.default,{style:[o.s.row,{flexWrap:'wrap',gap:6}],children:[x.map(([e,l])=>(0,p.jsx)(o.Chip,{label:l,active:A===e,onPress:()=>E(e)},e)),(0,p.jsx)(o.Chip,{label:L?'Defined risk + unhedged':'Defined risk only',active:L,onPress:()=>_(!L)})]}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},accessibilityLiveRegion:"polite",children:`${q.length} of ${$.templates.length} templates`})]}),!q.length&&(0,p.jsxs)(n.default,{style:[o.s.row,{gap:10}],children:[(0,p.jsx)(o.T,{style:{color:o.C.muted,fontSize:12},children:"No template matches these filters."}),(0,p.jsx)(o.Button,{label:"Clear filters",kind:"outline",onPress:()=>{W(''),M('all'),E('all')}})]}),f.map(([e,l])=>{const t=q.filter(l=>l.intent===e);return t.length?(0,p.jsxs)(n.default,{style:{gap:8},children:[(0,p.jsx)(o.T,{style:j,children:l}),t.map(e=>(0,p.jsxs)(n.default,{style:[y,{gap:6}],children:[(0,p.jsxs)(n.default,{style:[o.s.between,{gap:8}],children:[(0,p.jsxs)(n.default,{style:[o.s.row,{gap:10,flex:1}],children:[(0,p.jsx)(u.Sketch,{pts:e.sketch}),(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi',flexShrink:1},children:e.name})]}),(0,p.jsx)(o.Badge,{label:'defined'===e.risk?'Defined risk':'UNHEDGED',tone:'defined'===e.risk?'green':'red'})]}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`${e.legs} leg${e.legs>1?'s':''} \xb7 complexity ${e.complexity}/3`}),(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:e.recipe}),(0,p.jsx)(o.T,{style:{fontSize:12},children:`Use: ${e.use}`}),(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.amber},children:`Loses when: ${e.loses}`}),(0,p.jsxs)(n.default,{style:[o.s.row,{flexWrap:'wrap',gap:6}],children:[e.param&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:e.param.label}),e.param.variants.map(l=>(0,p.jsx)(o.Chip,{label:String(l),active:(B[e.key]??e.param.default)===l,onPress:()=>R(t=>({...t,[e.key]:l}))},l))]}),(0,p.jsx)(n.default,{style:{flex:1}}),(0,p.jsx)(o.Button,{label:"Use",icon:"arrow-right",accessibilityLabel:`Use ${e.name}`,onPress:()=>e.intro_required?F(e):C(e,e.param?B[e.key]??e.param.default:null)})]})]},e.key))]},e):null}),(0,p.jsx)(t.default,{accessibilityRole:"button",onPress:()=>_(!L),children:(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.green},children:L?'Hide unhedged structures':'Show unhedged structures (short options - large or unlimited loss)'})}),(0,p.jsxs)(n.default,{style:{gap:4},children:[(0,p.jsx)(o.T,{style:j,children:"Not in this release"}),$.later.map(e=>(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:`${e.name} - ${e.reason}`},e.key))]}
1070),(0,p.jsx)(u.TemplateIntro,{t:D,legging:$.legging||'',onCancel:()=>F(null),onConfirm:()=>{const e=D;F(null),C(e,e.param?B[e.key]??e.param.default:null)}})]})})]})};var l=r(d[0]),t=e(r(d[1])),s=e(r(d[2])),n=e(r(d[3])),o=r(d[4]),c=r(d[5]),u=r(d[6]),h=r(d[7]),p=r(d[8]);const f=[['bullish','Bullish'],['bearish','Bearish'],['range','Range'],['volatility','Big move']],x=[['all','Any legs'],['1-2','1-2 legs'],['3-4','3-4 legs'],['5+','5+ legs']];const y={backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:12,padding:14,gap:12},j={fontFamily:'InterMedium',fontSize:11,letterSpacing:.6,textTransform:'uppercase',color:o.C.muted}},977,[11,375,385,13,821,976,978,980,6]); 1071__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.SpreadsSheet=function({visible:e,onClose:r,underlying:l,expiry:x,lots:f,onPick:p}){const[y,j]=(0,t.useState)(0),[b,S]=(0,t.useState)(2),[C,k]=(0,t.useState)(null),[$,T]=(0,t.useState)(''),[w,v]=(0,t.useState)(null),z=(0,n.default)().width<700,[_,B]=(0,t.useState)(0);(0,t.useEffect)(()=>{if(!e||!l||!x)return;let t=!0;k(null),T(''),v(null);const[s,i]=h[y];return a.sb.spreads(l,x,s,i,b,f).then(e=>{t&&k(e)}).catch(e=>{t&&T(e.message)}),()=>{t=!1}},[e,l,x,y,b,f,_]);const P=C&&null!=w?C.rows[w]:null;return(0,u.jsxs)(o.Sheet,{visible:e,onClose:r,wide:!0,title:"Spreads",subtitle:C?`${C.name} \xb7 ${l} ${x} \xb7 spot ${(0,d.num)(C.spot,2)} \xb7 ${f} lot${f>1?'s':''}`:'Every vertical spread of one kind and width, priced to execute',footer:(0,u.jsxs)(i.default,{style:[o.s.between,{flexWrap:'wrap',gap:8}],children:[(0,u.jsx)(o.T,{style:{fontSize:11,color:o.C.muted,flex:1,minWidth:240},children:C?.basis||''}),(0,u.jsx)(o.Button,{label:P?`Use ${(0,d.strikeText)(P.strikes[0])} / ${(0,d.strikeText)(P.strikes[1])}`:'Pick a row',icon:"check",disabled:!P,onPress:()=>P&&p(P.legs,C.template,b)})]}),children:[(0,u.jsx)(i.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:h.map(([e,t,s],i)=>(0,u.jsx)(o.Chip,{label:s,active:y===i,onPress:()=>j(i)},s))}),(0,u.jsxs)(i.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,u.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Width (strikes)"}),[1,2,4,6,8].map(e=>(0,u.jsx)(o.Chip,{label:String(e),active:b===e,onPress:()=>S(e)},e))]}),!!$&&(0,u.jsx)(c.ErrorRetry,{what:"Spreads",error:$,onRetry:()=>B(e=>e+1)}),!C&&!$&&(0,u.jsx)(o.Loading,{}),C&&!C.rows.length&&(0,u.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"No priced spreads of this kind and width in this expiry."}),C?.excluded_inconsistent>0&&(0,u.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`${C.excluded_inconsistent} spread${C.excluded_inconsistent>1?'s':''} left out: their prices cost more than the spread can ever pay (stale last-traded prices on illiquid strikes).`}),C&&!!C.rows.length&&(0,u.jsx)(c.Scrollable,{narrow:z,min:760,children:(0,u.jsxs)(i.default,{style:{borderWidth:1,borderColor:o.C.line,borderRadius:10,overflow:'hidden'},children:[(0,u.jsx)(i.default,{style:[o.s.row,{backgroundColor:o.C.paper,paddingHorizontal:10,paddingVertical:6}],children:['Strikes','From spot','debit'===C.side?'Debit':'Credit','Max profit','Max loss','Breakeven','POP','Return on risk'].map((e,t)=>(0,u.jsx)(o.T,{style:{flex:0===t?1.4:1,fontSize:11,color:o.C.muted,textAlign:t?'right':'left'},children:e},e))}),C.rows.map((e,t)=>(0,u.jsxs)(s.default,{accessibilityRole:"button",accessibilityState:{selected:w===t},accessibilityLabel:`${e.strikes.join(' / ')} spread`,onPress:()=>v(t),style:[o.s.row,{paddingHorizontal:10,paddingVertical:8,borderTopWidth:1,borderColor:o.C.line,backgroundColor:w===t?o.C.soft:e.atm?o.C.green+'0F':'transparent'}],children:[(0,u.jsx)(o.T,{style:{flex:1.4,fontSize:12,fontFamily:'InterSemi'},children:`${(0,d.strikeText)(e.strikes[0])} / ${(0,d.strikeText)(e.strikes[1])}${e.atm?' \xb7 ATM':''}`}),[`${e.distance_pct>0?'+':''}${e.distance_pct}%`,(0,d.inr)(Math.abs(e.net)),(0,d.signed)(e.max_profit),(0,d.signed)(e.max_loss),(e.breakevens||[]).map(e=>(0,d.num)(e,0)).join(' \xb7 ')||'\u2014',null!=e.pop?`${e.pop}%`:'\u2014',null!=e.return_on_risk?`${e.return_on_risk}%`:'\u2014'].map((e,t)=>(0,u.jsx)(o.T,{style:{flex:1,fontSize:12,textAlign:'right',fontVariant:['tabular-nums']},children:e},t))]},e.anchor))]})}),P&&(0,u.jsxs)(i.default,{style:{gap:3},children:[P.legs.map((e,t)=>(0,u.jsx)(o.T,{style:{fontSize:12,color:'B'===e.side?o.C.green:o.C.red},children:`${'B'===e.side?'Buy':'Sell'} ${e.lots} \xd7 ${(0,d.strikeText)(e.strike)} ${e.type} @ ${(0,d.num)(e.price)}`},t)),(0,u.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Net delta ${(0,d.num)(P.delta,1)} \xb7 theta ${(0,d.num)(P.theta,0)}/day \xb7 charges ~${(0,d.inr)(P.charges)}${P.price_basis.includes('ltp')?' \xb7 some legs priced at the last trade (no live quote)':''}`})]})]})},_e.AboutSheet=function({visible:e,onClose:s,a:i,templateKey:n}){const[r,l]=(0,t.useState)(null),[h,f]=(0,t.useState)(''),p=()=>{f(''),a.sb.templates().then(l).catch(e=>f(e.message))};(0,t.useEffect)(()=>{e&&!r&&p()},[e,r]);const y=r?.templates.find(e=>e.key===n)||null,j=i?.premium?.value,b=i?.max_loss,S=i?.max_profit;return(0,u.jsx)(o.Sheet,{visible:e,onClose:s,wide:!0,title:`About: ${i?.structure?.name||'this
1071strategy'}`,subtitle:"Plain-language basics, this strategy's own numbers, and what to watch",children:h?(0,u.jsx)(c.ErrorRetry,{what:"The strategy explanations",error:h,onRetry:p}):r?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(x,{title:"Basics",children:y?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(o.T,{style:{fontSize:13},children:y.recipe}),(0,u.jsx)(o.T,{style:{fontSize:13},children:`Use: ${y.use}`}),(0,u.jsx)(o.T,{style:{fontSize:13,color:o.C.amber},children:`Loses when: ${y.loses}`})]}):(0,u.jsx)(o.T,{style:{fontSize:13,color:o.C.muted},children:"A custom combination - it does not match a named structure, so read the payoff chart and the numbers below."})}),(0,u.jsxs)(x,{title:"Calculations (this strategy, at the reading)",children:[(0,u.jsx)(o.T,{style:{fontSize:13},children:null==j?'\u2014':j>0?`You receive a net credit of ${(0,d.inr)(j)} when you open it.`:`You pay a net debit of ${(0,d.inr)(-j)} to open it.`}),(0,u.jsx)(o.T,{style:{fontSize:13},children:`Maximum profit at expiry: ${S?.unlimited?'unlimited':(0,d.signed)(S?.value)}. Maximum loss at expiry: ${b?.unlimited?'UNLIMITED':(0,d.signed)(b?.value)}.`}),(0,u.jsx)(o.T,{style:{fontSize:13},children:`Breakeven at expiry: ${i?.breakevens?.value?.length?i.breakevens.value.map(e=>(0,d.num)(e,0)).join(' and '):'none'}.`}),(0,u.jsxs)(o.T,{style:{fontSize:12,color:o.C.muted},children:["These come from the exact expiry payoff of every leg at its entry price, gross of charges (about ",(0,d.inr)(i?.charges?.value)," to open). Before expiry the model value differs - move the what-if date to see it."]})]}),(0,u.jsxs)(x,{title:"What to monitor",children:[(0,u.jsx)(o.T,{style:{fontSize:13},children:y?.monitor||'Watch the underlying against your breakevens and any short strike; check how the payoff changes as the expiry nears.'}),(i?.insights||[]).slice(0,4).map((e,t)=>(0,u.jsx)(o.T,{style:{fontSize:12,color:'warn'===e.level?o.C.amber:o.C.muted},children:`\u2022 ${e.text}`},t))]}),(0,u.jsx)(x,{title:"Can I lose more than the maximum loss?",children:(0,u.jsx)(o.T,{style:{fontSize:13},children:r.legging})})]}):(0,u.jsx)(o.Loading,{})})},_e.TemplateIntro=function({t:e,onCancel:s,onConfirm:n,legging:r}){const[l,a]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{a(!1)},[e?.key]),(0,u.jsx)(o.Sheet,{visible:!!e,onClose:s,title:e?`Before you use: ${e.name}`:'',subtitle:"Complex or advanced structure - read this first",footer:(0,u.jsxs)(i.default,{style:[o.s.row,{justifyContent:'flex-end',gap:8}],children:[(0,u.jsx)(o.Button,{label:"Cancel",kind:"outline",onPress:s}),(0,u.jsx)(o.Button,{label:"Use it",icon:"check",disabled:!l,onPress:n})]}),children:e&&(0,u.jsxs)(i.default,{style:{gap:8},children:[(0,u.jsxs)(i.default,{style:[o.s.row,{gap:8}],children:[(0,u.jsx)(o.Badge,{label:'defined'===e.risk?'Defined risk':'UNHEDGED',tone:'defined'===e.risk?'green':'red'}),(0,u.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:`${e.legs} legs \xb7 complexity ${e.complexity}/3`})]}),(0,u.jsx)(o.T,{style:{fontSize:13},children:e.recipe}),(0,u.jsx)(o.T,{style:{fontSize:13},children:`Use: ${e.use}`}),(0,u.jsx)(o.T,{style:{fontSize:13,color:o.C.amber},children:`Loses when: ${e.loses}`}),!!e.monitor&&(0,u.jsx)(o.T,{style:{fontSize:13},children:`Monitor: ${e.monitor}`}),(0,u.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:r}),(0,u.jsx)(o.Checkbox,{checked:l,onChange:a,tone:'defined'===e.risk?o.C.green:o.C.red,label:'defined'===e.risk?'I understand how this structure makes and loses money':'I understand one or more shorts are UNCOVERED and the loss can be very large'})]})})},_e.Sketch=function({pts:e,width:t=120,height:s=36}){if(!e||e.length<2)return null;const n=s=>2+s/(e.length-1)*(t-4),a=e=>s/2-e*(s/2-3),d=e.map((e,t)=>`${t?'L':'M'}${n(t).toFixed(1)},${a(e).toFixed(1)}`).join('');return(0,u.jsx)(i.default,{accessibilityLabel:"Payoff shape at expiry (illustrative)",children:(0,u.jsxs)(l.default,{width:t,height:s,children:[(0,u.jsx)(r.Line,{x1:2,x2:t-2,y1:s/2,y2:s/2,stroke:o.C.line,strokeWidth:1}),(0,u.jsx)(r.Path,{d:d,stroke:o.C.green,strokeWidth:1.8,fill:"none"})]})})};var t=_r(_d[0]),s=e(_r(_d[1])),i=e(_r(_d[2])),n=e(_r(_d[3])),r=_r(_d[4]),l=e(r),o=_r(_d[5]),a=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]);const h=[['CE','debit','Bull call (debit)'],['PE','credit','Bull put (credit)'],['PE','debit','Bear put (debit)'],['CE','credit','Bear call (credit)']];function x({title:e,children:t}){return(0,u.jsxs)(i.default,{style:{gap:5,borderTopWidth:1,borderColor:o.C.line,paddingTop:10},children:[(0,u.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:13},children:e}),t]})}},978,[11,375,13,400,840,821,976,979,980,6]); 1072__d(function(_g,r,i,a,_m,e,_d){"use strict";
1072Object.defineProperty(e,'__esModule',{value:!0}),e.dayMonth=u,e.weekday=o,e.istStamp=function(t){if(!t)return'\u2014';const n=t.slice(0,10);return`${o(n)} ${u(n)} ${t.slice(11,16)} IST`},e.addDays=function(t,n){const[u,o,c]=t.slice(0,10).split('-').map(Number);return new Date(Date.UTC(u,o-1,c+n)).toISOString().slice(0,10)},e.isWeekend=function(t){const n=o(t);return'Sat'===n||'Sun'===n},Object.defineProperty(e,"inr",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"signed",{enumerable:!0,get:function(){return m}}),Object.defineProperty(e,"num",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"pts",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"strikeText",{enumerable:!0,get:function(){return g}}),e.istEpoch=function(t){if(!t)return'\u2014';const n=new Intl.DateTimeFormat('en-GB',{timeZone:'Asia/Kolkata',weekday:'short',day:'2-digit',month:'short',hour:'2-digit',minute:'2-digit',hour12:!1}).formatToParts(new Date(1e3*t)),u=t=>n.find(n=>n.type===t)?.value||'';return`${u('weekday')} ${Number(u('day'))} ${u('month')} ${u('hour')}:${u('minute')} IST`},e.legText=function(t){return`${'B'===t.side?'Buy':'Sell'} ${t.lots} \xd7 ${g(t.strike)} ${t.type} ${t.expiry?u(t.expiry):''}`.trim()};const t=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],n=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];function u(n){if(!n)return'\u2014';const[u,o,c]=n.slice(0,10).split('-').map(Number);return`${c} ${t[o-1]}`+(2026!==u?` ${u}`:'')}function o(t){const[u,o,c]=t.slice(0,10).split('-').map(Number);return n[new Date(Date.UTC(u,o-1,c)).getUTCDay()]}const c=(t,n=0)=>null!=t&&Number.isFinite(t)?(t<0?'\u2212':'')+'\u20b9'+Math.abs(t).toLocaleString('en-IN',{maximumFractionDigits:n,minimumFractionDigits:n}):'\u2014',m=(t,n=0)=>null!=t&&Number.isFinite(t)?(t>0?'+':t<0?'\u2212':'')+'\u20b9'+Math.abs(t).toLocaleString('en-IN',{maximumFractionDigits:n,minimumFractionDigits:n}):'\u2014',s=(t,n=2)=>null!=t&&Number.isFinite(t)?t.toLocaleString('en-IN',{maximumFractionDigits:n,minimumFractionDigits:0}):'\u2014',l=t=>null==t?'\u2014':t.toLocaleString('en-IN',{maximumFractionDigits:2}),g=t=>Number.isInteger(t)?String(t):t.toFixed(2)},979,[]); 1073__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.LoadState=function({loading:e,error:n,onRetry:t,children:c,what:u="This"}){return n?(0,l.jsx)(s,{error:n,onRetry:t,what:u}):e?(0,l.jsx)(o.Loading,{}):(0,l.jsx)(l.Fragment,{children:c})},_e.ErrorRetry=s,_e.Scrollable=function({narrow:e,min:o=640,children:s}){return e?(0,l.jsx)(n.default,{horizontal:!0,showsHorizontalScrollIndicator:!0,contentContainerStyle:{minWidth:o},accessibilityLabel:"Table - scroll sideways for more columns",children:(0,l.jsx)(t.default,{style:{width:o},children:s})}):(0,l.jsx)(l.Fragment,{children:s})},r(d[0]);var n=e(r(d[1])),t=e(r(d[2])),o=r(d[3]),l=r(d[4]);function s({error:e,onRetry:n,what:s="This"}){return(0,l.jsxs)(t.default,{accessibilityRole:"alert",style:[o.s.row,{flexWrap:'wrap',gap:10,backgroundColor:o.C.redBg,borderRadius:10,padding:12}],children:[(0,l.jsx)(o.T,{style:{color:o.C.red,fontSize:12,flex:1,minWidth:200},children:`${s} could not be loaded: ${e}`}),n&&(0,l.jsx)(o.Button,{label:"Retry",icon:"refresh-cw",kind:"outline",onPress:n})]})}},980,[11,278,13,821,6]); 1074__d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"snap",{enumerable:!0,get:function(){return y}}),_e.LegSheet=function({leg:e,chain:s,moveStrike:l,onApply:c,onClose:u,onRemove:x,expiries:m=[]}){const[f,b]=(0,t.useState)(e),[j,C]=(0,t.useState)(''),[S,k]=(0,t.useState)(''),[v,$]=(0,t.useState)('');(0,t.useEffect)(()=>{b(e),C('manual'===e?.price_basis&&null!=e.price?String(e.price):''),k(''),$('')},[e]);const[T,w]=(0,t.useState)(null),z=f?.expiry||s?.expiry||'';if((0,t.useEffect)(()=>{if(!s||!z||z===s.expiry)return void w(null);const e=new AbortController;return w({expiry:z,chain:null}),a.sb.chain(s.underlying,z,e.signal).then(e=>w({expiry:z,chain:e})).catch(t=>{e.signal.aborted||w({expiry:z,chain:null,err:t.message||'unavailable'})}),()=>e.abort()},[s,z]),!e||!f)return null;const M=s&&z!==s.expiry?T?.expiry===z?T.chain:null:s,P=!M&&!!s&&z!==s.expiry&&!T?.err,_=M?.rows.find(e=>e.strike===f.strike)?.[f.type],B=!!M&&!_,L=_?.symbol||`${s?.underlying||''} ${(0,d.dayMonth)(f.expiry)} ${(0,d.strikeText)(f.strike)} ${f.type}`,R=M?.lot_size;return(0,p.jsx)(o.Sheet,{visible:!0,onClose:u,title:"Edit leg",subtitle:P?`Loading the ${(0,d.dayMonth)(z)} contract\u2026`:`${L} \xb7 ${f.lots} lot${f.lots>1?'s':''} \xd7 ${R||'?'} = ${R?f.lots*R:'?'} units`,footer:(0,p.jsxs)(r.default,{style:[o.s.between,{gap:8,flexWrap:'wrap'}],children:[(0,p.jsx)(o.Button,{label:"Remove leg",icon:"trash-2",kind:"outline",onPress:()=>{x(f.id),u()}}),(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8}],children:[(0,p.jsx)(o.Button,{label:"Cancel",kind:"outline",onPress:u}),(0,p.jsx)(o.Button,{label:"Apply",icon:"check",onPress:function(){if(P)return void k('The selected expiry is still loading.');if(T?.err&&z!==s?.expiry)return void k(`The ${(0,d.dayMonth)(z)} chain could not be read (${T.err}).`);if(B)return void k(`${(0,d.strikeText)(f.strike)} ${f.type} is not listed for ${(0,d.dayMonth)(z)}. Choose a listed strike or another expiry.`);let e={...f};if('manual'===e.price_basis){const t=Number(j);if(!j.trim()||!Number.isFinite(t)||t<0)return void k('Type a price of 0 or more, or choose another price basis.');e={...e,price:y(t,M?.tick_size)}}else e={...e,price:null};c(e)}})]})]}),children:(0,p.jsxs)(r.default,{style:{gap:14},children:[(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted,width:60},children:"Side"}),['B','S'].map(e=>(0,p.jsx)(o.Chip,{label:'B'===e?'Buy':'Sell',active:f.side===e,onPress:()=>b({...f,side:e})},e))]}),(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted,width:60},children:"Type"}),['CE','PE'].map(e=>(0,p.jsx)(o.Chip,{label:'CE'===e?'Call (CE)':'Put (PE)',active:f.type===e,onPress:()=>b({...f,type:e})},e))]}),(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8,alignItems:'center'}],children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted,width:60},children:"Strike"}),(0,p.jsx)(o.Button,{label:"\u2212",accessibilityLabel:"Lower strike",kind:"outline",onPress:()=>
1074b({...f,strike:l(f.strike,-1)})}),(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:15,minWidth:70,textAlign:'center'},children:(0,d.strikeText)(f.strike)}),(0,p.jsx)(o.Button,{label:"+",accessibilityLabel:"Higher strike",kind:"outline",onPress:()=>b({...f,strike:l(f.strike,1)})})]}),m.length>1&&(0,p.jsxs)(r.default,{style:{gap:6},children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Expiry (a leg in another expiry makes a calendar or diagonal)"}),(0,p.jsx)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:m.slice(0,8).map(e=>(0,p.jsx)(o.Chip,{label:`${(0,d.dayMonth)(e.expiry)} \xb7 ${Math.max(0,Math.round(e.days_to_expiry))}d`,active:f.expiry===e.expiry,onPress:()=>b({...f,expiry:e.expiry})},e.expiry))}),f.expiry!==e.expiry&&'manual'===f.price_basis&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.amber},children:`Your typed entry price (${j||'\u2014'}) is kept for the ${(0,d.dayMonth)(z)} contract. Change it or choose a market basis if it no longer applies.`})]}),(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8,alignItems:'center'}],children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted,width:60},children:"Lots"}),(0,p.jsx)(o.Button,{label:"\u2212",accessibilityLabel:"Fewer lots",kind:"outline",onPress:()=>b({...f,lots:Math.max(1,f.lots-1)})}),(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:15,minWidth:70,textAlign:'center'},children:f.lots}),(0,p.jsx)(o.Button,{label:"+",accessibilityLabel:"More lots",kind:"outline",onPress:()=>b({...f,lots:Math.min(500,f.lots+1)})})]}),(0,p.jsxs)(r.default,{style:{gap:8},children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Entry price basis"}),(0,p.jsx)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:h.map(([e,t])=>(0,p.jsx)(o.Chip,{label:t,active:f.price_basis===e,onPress:()=>b({...f,price_basis:e})},e))}),'manual'===f.price_basis&&(0,p.jsx)(n.default,{value:j,onChangeText:e=>{C(e),k(''),$('')},keyboardType:"decimal-pad",accessibilityLabel:"Manual entry price",onBlur:()=>{const e=Number(j);if(j.trim()&&Number.isFinite(e)&&e>=0){const t=y(e,M?.tick_size);t!==e&&(C(String(t)),$(`Rounded from ${j} to the ${M?.tick_size||.05} tick.`))}},style:{minHeight:44,borderWidth:1,borderColor:S?o.C.red:o.C.line,borderRadius:10,paddingHorizontal:12,color:o.C.ink,fontFamily:'InterSemi',fontSize:15,backgroundColor:o.C.paper}}),!!v&&(0,p.jsx)(o.T,{accessibilityLiveRegion:"polite",style:{color:o.C.amber,fontSize:12},children:v}),!!S&&(0,p.jsx)(o.T,{accessibilityRole:"alert",style:{color:o.C.red,fontSize:12},children:S}),(0,p.jsx)(o.T,{style:{fontSize:11,color:B?o.C.red:o.C.muted},children:P?`Loading the ${(0,d.dayMonth)(z)} quote\u2026`:T?.err&&z!==s?.expiry?`The ${(0,d.dayMonth)(z)} chain could not be read.`:_?`${(0,d.dayMonth)(z)} \xb7 Bid ${(0,d.num)(_.bid)} \xb7 Ask ${(0,d.num)(_.ask)} \xb7 LTP ${(0,d.num)(_.ltp)}${M?.quality.live?'':' (stored reading - no bid/ask)'}`:`${(0,d.strikeText)(f.strike)} ${f.type} is not listed for ${(0,d.dayMonth)(z)}.`})]}),(0,p.jsx)(o.Checkbox,{checked:f.include,onChange:e=>b({...f,include:e}),label:"Include in the analysis",detail:"An excluded leg stays in the strategy but is left out of every number."})]})})},_e.ActionsSheet=function({visible:e,onClose:t,actions:s}){return(0,p.jsx)(o.Sheet,{visible:e,onClose:t,title:"Actions",children:(0,p.jsx)(r.default,{style:{gap:8},children:s.map(e=>(0,p.jsxs)(l.default,{accessibilityRole:"button",accessibilityState:{disabled:!!e.disabled},disabled:e.disabled,onPress:()=>{t(),e.onPress()},style:({pressed:t})=>[o.s.row,{gap:12,minHeight:48,paddingHorizontal:14,borderRadius:10,borderWidth:1,borderColor:o.C.line,opacity:e.disabled?.4:t?.7:1}],children:[(0,p.jsx)(o.Icon,{name:e.icon,size:16,color:o.C.green}),(0,p.jsx)(o.T,{style:{fontSize:14},children:e.label})]},e.label))})})},_e.ExpirySheet=function({visible:e,onClose:l,expiries:n,current:c,underlying:y,legs:h,onApply:x}){const[m,f]=(0,t.useState)(''),[b,j]=(0,t.useState)(null),[C,S]=(0,t.useState)(''),[k,v]=(0,t.useState)(!1);(0,t.useEffect)(()=>{e||(f(''),j(null),S(''))},[e]);const $=s.default.useRef(0);const T=new Set(h.map(e=>e.expiry)).size>1,w=!(T||!m||m===c||h.length&&(!b||b.for!==m||b.missing.length));
1074return(0,p.jsxs)(o.Sheet,{visible:e,onClose:l,title:"Choose an expiry",subtitle:h.length?'Every leg moves to the new expiry at the same strike. Nothing changes until you apply, and only if every leg is listed there.':'Pick any listed expiry.',footer:(0,p.jsxs)(r.default,{style:[o.s.row,{justifyContent:'flex-end',gap:8}],children:[(0,p.jsx)(o.Button,{label:"Cancel",kind:"outline",onPress:l}),(0,p.jsx)(o.Button,{label:m?`Move to ${(0,d.dayMonth)(m)}`:'Move',icon:"check",disabled:!w,loading:k,onPress:()=>{x(m),l()}})]}),children:[(0,p.jsx)(u.ExpiryYearList,{expiries:n,selected:m||c,current:c,onPick:async function(e){const t=++$.current;if(f(e),j(null),S(''),h.length){v(!0);try{const s=await a.sb.chain(y,e);if(t!==$.current)return;const l=[],n=[];for(const e of h){const t=s.rows.find(t=>t.strike===e.strike)?.[e.type];(t&&null!=t.ltp?l:n).push(`${'B'===e.side?'Buy':'Sell'} ${(0,d.strikeText)(e.strike)} ${e.type}`)}j({ok:l,missing:n,for:e})}catch(e){t===$.current&&S(e.message)}finally{t===$.current&&v(!1)}}}}),T&&(0,p.jsx)(o.T,{accessibilityRole:"alert",style:{color:o.C.amber,fontSize:12},children:"This strategy spans expiries (a calendar or diagonal). Moving every leg to one expiry would collapse it - change each leg's expiry in its own editor."}),!!C&&(0,p.jsx)(o.T,{accessibilityRole:"alert",style:{color:o.C.red,fontSize:12},children:C}),b&&(0,p.jsxs)(r.default,{style:{gap:4},children:[b.ok.map(e=>(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.green},children:`\u2713 ${e} is listed`},e)),b.missing.map(e=>(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.red},children:`\u2717 ${e} is not listed (or has no price) in ${(0,d.dayMonth)(m)}`},e)),!!b.missing.length&&(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.amber},children:"Not applied: your legs stay as they are. Adjust the strikes first, or pick another expiry."})]})]})},_e.SnapshotSheet=function({rid:e,onClose:s,onSaved:l}){const[u,y]=(0,t.useState)(null),[h,x]=(0,t.useState)(''),[m,f]=(0,t.useState)(''),[b,j]=(0,t.useState)(''),[C,S]=(0,t.useState)(!1),[k,v]=(0,t.useState)(''),$=()=>{e&&(x(''),y(null),a.sb.revision(e).then(e=>{y(e),f(e.name),j(e.notes||'')}).catch(e=>x(e.message)))};if((0,t.useEffect)($,[e]),!e)return null;const T=u?.analysis||{},w=e=>e?e.unlimited?'Unlimited':'available'===e.status?(0,d.signed)(e.value):'\u2014':'\u2014';return(0,p.jsx)(o.Sheet,{visible:!0,onClose:s,wide:!0,title:u?`Snapshot ${u.n}`:'Snapshot',subtitle:"Frozen when it was saved. It is never re-priced; Restore makes a new working version.",children:(0,p.jsx)(c.LoadState,{loading:!u&&!h,error:h,onRetry:$,what:"The snapshot",children:u&&(0,p.jsxs)(r.default,{style:{gap:14},children:[(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,p.jsx)(o.Badge,{label:u.intact?'Checksum verified':'CHECKSUM MISMATCH',tone:u.intact?'green':'red'}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Saved ${(0,d.istEpoch)(u.created_at)} \xb7 priced at ${(0,d.istStamp)(u.reading_at)} \xb7 ${T.model_version||'model ?'} \xb7 ${u.checksum.slice(0,12)}`})]}),(0,p.jsxs)(r.default,{style:{gap:6},children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Name"}),(0,p.jsx)(n.default,{value:m,onChangeText:f,maxLength:80,accessibilityLabel:"Snapshot name",style:{minHeight:44,borderWidth:1,borderColor:o.C.line,borderRadius:10,paddingHorizontal:12,color:o.C.ink,fontFamily:'Inter',fontSize:14,backgroundColor:o.C.paper}}),(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Notes / thesis"}),(0,p.jsx)(n.default,{value:b,onChangeText:j,multiline:!0,maxLength:2e3,accessibilityLabel:"Snapshot notes",style:{minHeight:80,borderWidth:1,borderColor:o.C.line,borderRadius:10,padding:12,color:o.C.ink,fontFamily:'Inter',fontSize:13,backgroundColor:o.C.paper,textAlignVertical:'top'}}),(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8}],children:[(0,p.jsx)(o.Button,{label:"Save name and notes",kind:"outline",loading:C,disabled:m===u.name&&b===(u.notes||''),onPress:async function(){S(!0),v('');
1074try{const t=await a.sb.revisionMeta(e,{name:m,notes:b});y(t),l()}catch(e){v(e.message)}finally{S(!1)}}}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted,flex:1},children:"Renaming or notes never change the terms or the checksum."})]}),!!k&&(0,p.jsx)(o.T,{accessibilityRole:"alert",style:{color:o.C.red,fontSize:12},children:`Not saved: ${k}. Your text is kept - try again.`})]}),(0,p.jsxs)(r.default,{style:{gap:4},children:[(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi'},children:`${u.body.underlying} \xb7 expiry ${(0,d.dayMonth)(u.body.expiry)}`}),u.body.legs.map(e=>(0,p.jsx)(o.T,{style:{fontSize:13,fontVariant:['tabular-nums']},children:`${e.include?'':'(excluded) '}${(0,d.legText)(e)} \xb7 entry ${'manual'===e.price_basis?`${(0,d.num)(e.price)} (manual)`:e.price_basis}`},e.id))]}),(0,p.jsx)(r.default,{style:[o.s.row,{gap:18,flexWrap:'wrap'}],children:[['Max loss',w(T.max_loss)],['Max profit',w(T.max_profit)],['Breakeven',T.breakevens?.value?.map(e=>(0,d.num)(e,0)).join(' \xb7 ')||'\u2014'],['Premium',T.premium?(0,d.signed)(T.premium.value):'\u2014'],['POP (model)','available'===T.pop?.status?`${T.pop.value}%`:'\u2014'],['Spot then',(0,d.num)(T.spot,2)]].map(([e,t])=>(0,p.jsxs)(r.default,{style:{gap:1},children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:e}),(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi'},children:t})]},e))})]})})})},_e.UnderlyingPicker=function({list:e,value:s,onPick:l}){const[a,d]=(0,t.useState)(''),c=e.filter(e=>'stock'!==e.kind),u=e.filter(e=>'stock'===e.kind),y=a.trim()?u.filter(e=>e.symbol.includes(a.trim().toUpperCase())).slice(0,12):[],h=u.some(e=>e.symbol===s);return(0,p.jsxs)(r.default,{style:{gap:8},children:[(0,p.jsxs)(r.default,{style:[o.s.row,{flexWrap:'wrap',gap:8}],children:[c.map(e=>(0,p.jsx)(o.Chip,{label:e.symbol,active:s===e.symbol,onPress:()=>l(e.symbol)},e.symbol)),h&&(0,p.jsx)(o.Chip,{label:`${s} \xb7 stock`,active:!0,onPress:()=>{}})]}),u.length>0&&(0,p.jsxs)(r.default,{style:{gap:6},children:[(0,p.jsx)(n.default,{value:a,onChangeText:d,placeholder:`Search ${u.length} F&O stocks (physically settled)`,placeholderTextColor:o.C.muted,autoCapitalize:"characters",accessibilityLabel:"Search F&O stocks",style:{minHeight:44,borderWidth:1,borderColor:o.C.line,borderRadius:10,paddingHorizontal:12,color:o.C.ink,fontFamily:'Inter',fontSize:13,backgroundColor:o.C.paper,maxWidth:420}}),y.length>0&&(0,p.jsx)(r.default,{style:[o.s.row,{flexWrap:'wrap',gap:6}],children:y.map(e=>(0,p.jsx)(o.Chip,{label:e.symbol,active:s===e.symbol,onPress:()=>{d(''),l(e.symbol)}},e.symbol))}),!!a.trim()&&!y.length&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"No F&O stock matches."})]})]})};var t=_r(_d[0]),s=e(t),l=e(_r(_d[1])),n=e(_r(_d[2])),r=e(_r(_d[3])),o=_r(_d[4]),a=_r(_d[5]),d=_r(_d[6]),c=_r(_d[7]),u=_r(_d[8]),p=_r(_d[9]);const y=(e,t)=>{const s=t||.05;return Math.round(Math.round(e/s)*s*100)/100},h=[['exec','Buy at ask / sell at bid'],['mid','Mid'],['ltp','Last traded'],['manual','Type a price']]},981,[11,375,385,13,821,976,979,980,982,6]); 1075__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ExpiryYearList=x,_e.ExpiryChips=function({expiries:e,selected:b,onSelect:h,onMore:C,nearest:j=p.NEAREST_CHIPS,label:S="Expiry"}){const[w,z]=(0,i.useState)(!1),H=(0,i.useRef)(null),T=(0,i.useMemo)(()=>(0,p.pickChips)(e,b,j),[e,b,j]),P=T.hidden>0||!!C,R=(0,p.moreLabel)(T.hidden);return(0,u.jsxs)(s.default,{role:"group","aria-label":`${S}: ${T.total} listed`,style:[l.s.row,{flexWrap:'wrap',gap:8}],children:[T.chips.map(e=>(0,u.jsx)(f,{item:e,on:e.expiry===b,onPress:()=>h(e.expiry)},e.expiry)),P&&(0,u.jsxs)(t.default,{ref:H,accessibilityRole:"button",accessibilityState:C?void 0:{expanded:w},accessibilityLabel:T.hidden>0?`${R}: every listed expiry, grouped by year`:R,...(0,c.webOnly)(C?{'aria-haspopup':'dialog'}:{'aria-expanded':w,'aria-haspopup':'dialog'}),onPress:()=>C?C():z(e=>!e),style:e=>[l.s.row,{minHeight:y,minWidth:y,gap:7,borderRadius:11,paddingHorizontal:14,paddingVertical:9,borderWidth:1,borderColor:w?l.C.green:e.focused?l.C.mint:l.C.line,backgroundColor:w||e.hovered?l.C.soft:l.C.paper,opacity:e.pressed?.7:1}],children:[(0,u.jsx)(l.Icon,{name:"calendar",size:15,color:w?l.C.green:l.C.muted}),(0,u.jsx)(l.T,{numberOfLines:1,style:{fontSize:12,fontFamily:'InterMedium',color:w?l.C.green:l.C.muted},children:R})]}),!C&&(0,u.jsx)(n.Popover,{open:w,onClose:()=>z(!1),anchor:H,placement:"bottom-start",label:"All expiries",width:340,children:(0,u.jsx)(o.default,{contentContainerStyle:{paddingHorizontal:12,paddingVertical:8},keyboardShouldPersistTaps:"handled",children:(0,u.jsx)(x,{expiries:e,selected:b,autoFocus:!0,onPick:e=>{z(!1),e!==b&&h(e)}})})})]})};
1075var i=r(d[0]),t=e(r(d[1])),o=e(r(d[2])),s=e(r(d[3])),l=r(d[4]),n=r(d[5]),c=r(d[6]),p=r(d[7]),u=r(d[8]);const y=44;function f({item:e,on:i,onPress:o}){return(0,u.jsx)(t.default,{accessibilityRole:"button",accessibilityState:{selected:i},...(0,c.webOnly)({'aria-pressed':i}),accessibilityLabel:e.a11y,onPress:o,style:e=>[l.s.row,{minHeight:y,borderRadius:11,paddingHorizontal:14,paddingVertical:9,borderWidth:1,borderColor:i?l.C.green:e.focused?l.C.mint:l.C.line,backgroundColor:i||e.hovered?l.C.soft:l.C.paper,opacity:e.pressed?.7:1}],children:(0,u.jsx)(l.T,{numberOfLines:1,style:{fontSize:12,fontFamily:'InterMedium',color:i?l.C.green:l.C.muted},children:e.label})})}function x({expiries:e,selected:o,current:n,onPick:f,autoFocus:x}){const b=(0,i.useMemo)(()=>(0,p.groupByYear)(e,o||n),[e,o,n]),h=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!x||!c.web)return;const e=setTimeout(()=>h.current?.focus?.(),0);return()=>clearTimeout(e)},[x]);const C=b[0]?.items[0]?.expiry,j=o&&b.some(e=>e.items.some(e=>e.expiry===o))?o:C;return b.length?(0,u.jsx)(s.default,{style:{gap:12},role:"group","aria-label":"All expiries by year",children:b.map(e=>(0,u.jsxs)(s.default,{style:{gap:6},role:"group","aria-label":`${e.year} expiries`,children:[(0,u.jsx)(l.T,{accessibilityRole:"header",style:{fontSize:11,fontFamily:'InterSemi',color:l.C.muted,letterSpacing:.4},children:e.year}),(0,u.jsx)(s.default,{style:[l.s.row,{flexWrap:'wrap',gap:6}],children:e.items.map(e=>{const i=e.expiry===o,p=!!n&&e.expiry===n;return(0,u.jsxs)(t.default,{ref:e.expiry===j?h:void 0,accessibilityRole:"button",accessibilityState:{selected:i},...(0,c.webOnly)({'aria-pressed':i,tabIndex:0}),accessibilityLabel:`${e.a11y}${p?', the current expiry':''}`,onPress:()=>f(e.expiry),style:e=>[{minHeight:y,flexGrow:1,flexBasis:132,maxWidth:200,justifyContent:'center',paddingHorizontal:10,paddingVertical:4,borderRadius:9,borderWidth:1,borderColor:i?l.C.green:e.focused?l.C.mint:l.C.line,backgroundColor:i||e.hovered?l.C.soft:l.C.bg,opacity:e.pressed?.7:1}],children:[(0,u.jsxs)(s.default,{style:[l.s.row,{gap:6}],children:[(0,u.jsx)(l.T,{numberOfLines:1,style:{fontSize:13,lineHeight:17,fontFamily:'InterMedium',color:i?l.C.green:l.C.ink},children:e.date}),e.monthly&&(0,u.jsx)(l.T,{style:{fontSize:11,lineHeight:15,color:l.C.mint},children:"Monthly"}),p&&(0,u.jsx)(l.T,{style:{fontSize:11,lineHeight:15,color:l.C.green},children:"Now"})]}),!!e.detail&&(0,u.jsx)(l.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:l.C.muted},children:e.detail})]},e.expiry)})})]},e.year))}):(0,u.jsx)(l.T,{style:{fontSize:12,color:l.C.muted,padding:12},children:"No expiries are listed."})}},982,[11,375,278,13,821,871,925,983,6]); 1076__d(function(g,r,_i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NEAREST_CHIPS",{enumerable:!0,get:function(){return n}}),e.orderedExpiries=s,e.isMonthly=a,e.chipLabel=y,e.expiryItems=l,e.pickChips=function(t,i,o=n){const a=l(s(t,i)),y=a.filter(t=>null==t.dte||t.dte>=0),p=new Set(y.slice(0,Math.max(0,o)).map(t=>t.expiry)),u=y.find(t=>t.monthly);u&&p.add(u.expiry);i&&a.some(t=>t.expiry===i)&&p.add(i);const c=a.filter(t=>p.has(t.expiry));return{chips:c,hidden:a.length-c.length,total:a.length,nextMonthly:u?.expiry||''}},e.groupByYear=function(t,n){const i=[];for(const o of l(s(t,n))){const t=i[i.length-1];t&&t.year===o.year?t.items.push(o):i.push({year:o.year,items:[o]})}return i},e.moreLabel=function(t){return t>0?`More expiries (${t})`:'All expiries'};var t=r(d[0]);const n=4,i=t=>'number'==typeof t&&Number.isFinite(t)?t:null,o=t=>t.slice(0,7);function s(n,o){const s=new Map;for(const a of n||[]){const n=(0,t.stamp)(a?.expiry)?.iso;if(!n||s.has(n))continue;const y=i(a.days_to_expiry);null!=y&&y<0&&a.expiry!==o||s.set(n,a)}return Array.from(s.entries()).sort((t,n)=>t[0]<n[0]?-1:t[0]>n[0]?1:0).map(([,t])=>t)}function a(n,i){if('boolean'==typeof n.monthly)return n.monthly;const s=(0,t.stamp)(n.expiry)?.iso;return!!s&&!i.some(n=>{const i=(0,t.stamp)(n.expiry)?.iso;return!!i&&i>s&&o(i)===o(s)})}function y(t,n){const i=null==t.dte?'':` \xb7 ${Math.max(0,Math.round(t.dte))}d`;return`${t.date}${t.year!==n?` ${t.year}`:''} ${t.monthly?'M':'W'}${i}`}function l(n){const o=n.length?((0,t.stamp)(n[0].expiry)?.iso||'').slice(0,4):'';return n.map(s=>{const l=(0,t.stamp)(s.expiry),p=l.iso.slice(0,4),u=i(s.days_to_expiry),c=a(s,n),h=(0,t.shortDate)(s.expiry),x=null==u?'':(0,t.dteText)(u),f={expiry:s.expiry,iso:l.iso,year:p,date:h,dte:u,monthly:c};return{...f,label:y(f,o),detail:x,a11y:`${l.date}, ${c?'monthly':'weekly'} expiry${x?`, ${x}`:''}`}})}},983,[984]); 1077__d(function(e,t,n,r,i,o,a){"use strict";Object.defineProperty(o,'__esModule',{value:!0}),Object.defineProperty(o,"DASH",{enumerable:!0,get:function(){return u}}),Object.defineProperty(o,"MINUS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"RUPEE",{enumerable:!0,get:function(){return l}}),Object.defineProperty(o,"TIMES",{enumerable:!0,get:function(){return c}}),Object.defineProperty(o,"EMPTY_TEXT",{enumerable:!0,get:function(){return d}}),Object.defineProperty(o,"NO_BASELINE",{enumerable:!0,get:function(){return f}}),Object.defineProperty(o,"MONTHS",{enumerable:!0,get:function(){return h}}),o.crore=p,o.units=g,o.compact=b,o.signed=_,o.signedUnits=y,o.price=$,o.strike=v,Object.defineProperty(o,"INDEX_UNDERLYINGS",{enumerable:!0,get:function(){return w}}),o.isIndexUnderlying=S,o.level=O,o.seriesPriceText=function(e,t){return'underlying'===t?.kind||'FUT'===String(t?.instrument_type||'').trim().toUpperCase()?T(e,t?.underlying):$(e)},o.spotLevel=T,o.ratio=N,o.stamp=P,o.asOfText=function(e){const t=P(e);return t?`As of ${t.date}${t.time?` \xb7 ${t.time} IST`:''}`:'Not captured yet'},o.clock=E,o.dteText=I,o.expiryText=function(e,t){const n=P(e);if(!n)return u;const r=I(t);return r===u?n.date:`${n.date} \xb7 ${r}`},Object.defineProperty(o,"BUILDUP_LABELS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(o,"BUILDUP_STATE_LABELS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(o,"BUILDUP_IDS",{enumerable:!0,get:function(){return M}}),Object.defineProperty(o,"BUILDUP_WIRE",{enumerable:!0,get:function(){return L}}),Object.defineProperty(o,"BUILDUP_UNKNOWN",{enumerable:!0,get:function(){return C}}),o.buildupId=k,o.buildupLabel=U,o.buildupChoiceLabel=R,o.buildupTone=function(e){const t=k(e);return'long_buildup'===t||'short_covering'===t?'up':'short_buildup'===t||'long_unwinding'===t?'down':'flat'},Object.defineProperty(o,"BUILDUP_FROM_MOVES",{enumerable:!0,get:function(){return D}}),o.buildupFromMoves=function(e,t){return D[`${String(e||'')}|${String(t||'')}`]||'unknown'},o.buildupPair=function(e){return{fifteen:U(e?.buildup_15m),day:U(e?.buildup_day)}},o.volumeRatio=F,o.volumeRatioShort=function(e,t=3){const n=m(e?.volume_ratio),r=m(e?.volume_baseline_sessions);return'ok'!==e?.volume_baseline||null==n||null==r||r<t?f:`${n.toFixed(1)}${c}`},o.volumeToOi=function(e){const t=m(e?.volume_to_oi);if(null==t)return u;const n=m(e?.volume),r=m(e?.previous_oi),i=null!=n&&null!=r?` (${g(n)} traded vs ${g(r)} standing)`:'';return`${t.toFixed(2)}${c}${i}`},Object.defineProperty(o,"volumeToOiHot",{enumerable:!0,get:function(){return B}}),o.pcrText=G,o.maxPainText=function(e){const t=m(e?.max_pain_strike);if(null==t)return u;const n=m(e?.max_pain_distance);return null==n?v(t):0===Math.round(n)?`${v(t)}
1077 \xb7 spot at max pain`:`${v(t)} \xb7 spot ${g(Math.abs(n))} ${n>0?'above':'below'}`},o.maxPainBasis=function(e,t){const n=m(e),r=m(t);return null==n&&null==r?'Total OI behind it: not captured':`From ${g((n||0)+(r||0))} contracts of open interest (CE ${b(n)} \xb7 PE ${b(r)})`},o.oiShareText=function(e){const t=m(e);return null==t?f:`${t.toFixed(2)}${c} its 20-day average`},o.basisText=V,o.cardState=function(e,t={}){if(t.error)return{phase:'error',text:t.error};if(!e)return{phase:!1===t.loading?'empty':'loading',text:!1===t.loading?d:'Reading the F&O store\u2026'};if(!e.available||!e.captured)return{phase:'empty',text:e.empty_reason||e.empty_text||d};return(e.rows||e.points||e.candles||[]).length?{phase:'ready',text:''}:{phase:'empty',text:e.empty_note||t.emptyText||'Nothing clears the filters at this reading.'}},o.floorsText=function(e,t){return t||(e?`Liquidity floors in force: premium traded \u2265 ${l}${e.premium_cr} cr, OI \u2265 ${e.oi_lots} lot, last price \u2265 ${l}${e.last_price}.`:'')},o.floorsDegradedNote=function(e){if(!e||!e.floors_degraded)return'';const t=e.floors_labels||{},n=(e.floors_applied||[]).map(e=>t[e]||e),r=(e.floors_unmeasured||[]).concat(e.floors_absent||[]).map(e=>t[e]||e);if(!r.length)return'';return`${n.length?`These rows were gated on ${n.length} of the 3 liquidity floors \u2014 ${n.join(', ')}.`:'No liquidity floor could be applied at this reading.'} Not applied here: ${r.join(', ')} \u2014 the number it rests on was not captured at this reading, so no contract in the list failed it.`},Object.defineProperty(o,"MISSING_LABELS",{enumerable:!0,get:function(){return W}}),o.missingText=function(e,t=[]){const n=(e||[]).filter(e=>!t.length||t.includes(e));if(!n.length)return'';const r=n.map(e=>W[e]||e.replace(/_/g,' ')),i=r.slice(0,3).join(', '),o=r.length>3?` and ${r.length-3} more`:'';return`Not captured yet: ${i}${o}.`},o.sourceText=function(e){return'metrics_module'===e?'Signals read from the derivatives metrics.':'store'===e?'Signals read from the stored metrics.':''},o.groupSummary=function(e){const t=[];e.calls&&t.push(`${e.calls} call strike${1===e.calls?'':'s'}`);e.puts&&t.push(`${e.puts} put strike${1===e.puts?'':'s'}`);const n=t.length?`${t.join(' and ')} over the floors`:`${e.strike_count} strikes over the floors`,r=null==e.oi_change_day?'':` \xb7 OI ${y(e.oi_change_day)} today`;return null==e.premium_cr?`${n} \xb7 premium traded not captured at this reading${r}`:`${n} \xb7 ${p(e.premium_cr,e.premium_cr>=10?0:1)} traded${r}`},o.strikeSummary=function(e,t=3){const n='CE'===e.instrument_type?'call':'PE'===e.instrument_type?'put':e.instrument_type||'';return`${v(e.strike)} ${n} \xb7 ${p(e.premium_cr)} \xb7 ${U(e.buildup_day)} \xb7 volume ${F(e,t)}`},o.scaleSeries=function(e,t,n,r){const i=e.map(e=>{const n=e?.[t];return'number'==typeof n&&Number.isFinite(n)?n:null}),o=i.filter(e=>null!=e);if(o.length<2||n<=0||r<=0)return null;const a=Math.min(...o),u=Math.max(...o),s=u-a||Math.abs(u)||1,l=e.length>1?n/(e.length-1):0;return{lo:a,hi:u,points:i.map((e,t)=>null==e?null:{x:t*l,y:r-(e-a)/s*r,i:t})}},o.linePath=function(e){if(!e)return'';let t='',n=!1;for(const r of e.points)r?(t+=`${n?'L':'M'}${r.x.toFixed(2)},${r.y.toFixed(2)}`,n=!0):n=!1;return t},o.nearestStrikeIndex=H,o.oiPeak=function(e){let t=0;for(const n of e||[])for(const e of[n.ce_oi,n.pe_oi]){const n=m(e);null!=n&&n>t&&(t=n)}return t>0?t:null},Object.defineProperty(o,"DEFAULT_FILTERS",{enumerable:!0,get:function(){return X}}),o.sanitizeFilters=function(e,t){const n=e||{},r=(e,t=40)=>'string'==typeof e&&e.length<=t?e:'',i=(e,t)=>'number'==typeof e&&Number.isFinite(e)&&e>=0&&e<=t?e:null,o=r(n.optionType),a=/^[A-Z0-9&._-]{1,40}$/.test(r(n.underlying))?r(n.underlying):'',u=K.test(r(n.expiry))?r(n.expiry):'';return{watchlist:r(n.watchlist,20)||X.watchlist,underlying:a,expiry:t?Y(u,t,a):u,maxDte:i(n.maxDte,400),optionType:'CE'===o||'PE'===o?o:'',minPremiumCr:i(n.minPremiumCr,1e5)}},o.currentExpiry=Y,Object.defineProperty(o,"DTE_CHOICES",{enumerable:!0,get:function(){return q}}),Object.defineProperty(o,"PREMIUM_CHOICES",{enumerable:!0,get:function(){return z}}),o.unusualQuery=function(e){const t=[];e.underlying&&t.push(`underlying=${encodeURIComponent(e.underlying)}`);e.expiry&&t.push(`expiry=${encodeURIComponent(e.expiry)}`);
1077e.watchlist&&'all'!==e.watchlist&&t.push(`watchlist=${encodeURIComponent(e.watchlist)}`);e.optionType&&t.push(`option_type=${e.optionType}`);null!=e.maxDte&&t.push(`max_dte=${Math.max(0,Math.round(e.maxDte))}`);null!=e.minPremiumCr&&t.push(`min_premium_cr=${e.minPremiumCr}`);return t.length?`?${t.join('&')}`:''},o.filterText=function(e,t=""){const n=[];if(n.push(e.underlying||t||'All underlyings'),e.expiry){const t=P(e.expiry);t&&n.push(t.date)}null!=e.maxDte&&n.push(q.find(t=>t.value===e.maxDte)?.label||`Within ${e.maxDte} days`);e.optionType&&n.push('CE'===e.optionType?'Calls only':'Puts only');null!=e.minPremiumCr&&n.push(`\u2265 ${l}${e.minPremiumCr} cr`);return n.join(' \xb7 ')},o.expiriesFor=function(e,t){const n=(e||[]).filter(e=>!t||e.underlying===t),r=new Map;for(const e of n)r.has(e.expiry)||r.set(e.expiry,{expiry:e.expiry,days_to_expiry:e.days_to_expiry});return Array.from(r.values()).sort((e,t)=>e.expiry<t.expiry?-1:1)},Object.defineProperty(o,"OPERATOR_LABELS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(o,"FILTER_COLUMNS",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(o,"filterColumn",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(o,"columnLabel",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(o,"DTE_VALUES",{enumerable:!0,get:function(){return te}}),Object.defineProperty(o,"PREMIUM_VALUES",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(o,"VOLUME_RATIO_VALUES",{enumerable:!0,get:function(){return re}}),Object.defineProperty(o,"VOLUME_TO_OI_VALUES",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(o,"OI_CHANGE_VALUES",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(o,"BUILDUP_VALUES",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(o,"BUILDUP_WINDOWS",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(o,"BUILDUP_WINDOW_DEFAULT",{enumerable:!0,get:function(){return se}}),Object.defineProperty(o,"MONEYNESS_VALUES",{enumerable:!0,get:function(){return le}}),Object.defineProperty(o,"MARKET_VALUES",{enumerable:!0,get:function(){return ce}}),o.sanitizeRules=me,o.currentRules=function(e,t){const n=e||[],r=n.find(e=>'expiry'===e.column);if(!r)return n;const i=n.find(e=>'underlying'===e.column)?.value||'';return Y(r.value,t,i)===r.value?n:n.filter(e=>e!==r)},o.freeColumns=pe,o.newRule=function(e){const t=pe(e||[])[0];return t?{column:t.key,operator:t.operators[0],value:''}:null},o.withColumn=function(e,t){const n=Q(t);return n&&n.key!==e.column?{column:n.key,operator:n.operators[0],value:''}:e},o.rulesToFilters=function(e){const t={...X};for(const n of me(e))'underlying'===n.column?t.underlying=n.value:'expiry'===n.column?t.expiry=n.value:'optionType'===n.column?t.optionType='is_not'===n.operator?'CE'===n.value?'PE':'CE':n.value:'dte'===n.column?t.maxDte=Math.max(0,Math.round(Number(n.value))-1):'premium'===n.column?t.minPremiumCr=Math.round(100*(Number(n.value)+.01))/100:'watchlist'===n.column&&(t.watchlist=n.value);return t},o.customizeLabel=function(e){return e>0?`Customize (${e} filter${1===e?'':'s'})\u2026`:'Customize\u2026'},o.ruleText=ge,o.rulesText=function(e,t){const n=me(e);return n.length?n.map(e=>ge(e,t?.(e))).join(' \xb7 '):'No filters \u2014 every contract over the liquidity floors'},o.nextSort=function(e,t){return e&&e.key===t?'desc'===e.dir?{key:t,dir:'asc'}:null:{key:t,dir:'desc'}},o.compareValues=be,o.sortRows=function(e,t,n){return(e||[]).map((e,t)=>({row:e,i:t})).sort((e,r)=>be(t(e.row),t(r.row),n)||e.i-r.i).map(e=>e.row)},o.shortDate=_e,o.contractSummary=function(e){const t=_e(e?.expiry),n=null==m(e?.strike)?'':`${S(e?.underlying,e?.underlying_kind)?'':l}${v(e?.strike)}`,r=String(e?.instrument_type||'').trim(),i=[t,n,r].filter(Boolean);return i.length?i.join(' '):u},o.optionTone=function(e){const t=String(e||'').toUpperCase();return'CE'===t?'call':'PE'===t?'put':'flat'},o.flattenUnusual=function(e){const t=[];for(const n of e||[])for(const e of n?.strikes||[])t.push(e);return t},o.rowKey=function(e,t=0){return String(e?.instrument_token??e?.tradingsymbol??`${e?.underlying}-${e?.strike}-${e?.instrument_type}-${t}`)},Object.defineProperty(o,"GRID_DIRECTION_LOOKBACK",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(o,"DIRECTION_GRID_MINUTES",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(o,"GRID_DIRECTION_LOOKBACK_MINUTES",{enumerable:!0,get:function(){return ve}}),o.stampSeconds=we,o.lookbackIndex=Se,o.onDecisionGrid=Oe,o.directionAnchor=Te,Object.defineProperty(o,"GRID_FLAT_FRACTION",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(o,"GRID_PRICE_FLAT_FRACTION",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(o,"GRID_BLOCK_BALANCE_RATIO",{enumerable:!0,get:function(){return Ee}}
1077),Object.defineProperty(o,"GRID_NOT_ENOUGH_MARKS",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(o,"GRID_NO_DELTA",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(o,"DIRECTION_CHIPS",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(o,"NO_DIRECTION",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(o,"FLOW_LABELS",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(o,"FLOW_OBSERVATIONS",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(o,"FLOW_ATTRIBUTIONS",{enumerable:!0,get:function(){return je}}),Object.defineProperty(o,"FLOW_FLAT_WHAT",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(o,"FLOW_FLAT_MEANING",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(o,"FLOW_NOT_ENOUGH",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(o,"GRID_BLOCK_BOTH_BUILDING",{enumerable:!0,get:function(){return De}}),Object.defineProperty(o,"GRID_LEGEND_TEXT",{enumerable:!0,get:function(){return Fe}}),o.deltaUnits=Be,o.gridDirection=We,o.gridPriceDirection=He,o.gridFlow=Xe,o.gridDeltaChange=Ke,o.gridBlockRead=function(e,t=Ee){let n=0,r=0,i=0,o=0;for(const t of e||[]){const e=Ke(t?.points);null!=e&&('puts'===t.row?(r+=e,o++):(n+=e,i++))}if(!i||!o||n<=0||r<=0)return'';const a=Math.max(n,r),u=Math.min(n,r);return u<=0||a>t*u?'':De},o.gridPriceSpoken=Ye,o.directionChip=function(e){return Ae[String(e||'')]||''},o.directionTone=function(e){const t=String(e||'');return'building'===t?'up':'unwinding'===t?'down':'flat'},o.gridSlotTitle=qe,o.gridSlotDetail=function(e){if(!e)return'';if(!e.present)return e.label;const t=e.marks_with_delta??0;return`${e.label} \xb7 ${t}
1077 reading${1===t?'':'s'}`},o.gridSlotNote=ze,o.gridSlotLabel=function(e,t){if(!e)return'';if(!e.present)return ze(e);const n=String(t||e.direction||''),r=Ae[n],i=r?r.replace(/^[^ ]+ /,'').toLowerCase():Me;return`${qe(e)}, ${e.label}. Open interest ${Be(e.latest_delta_oi)} against the previous close over ${e.marks_with_delta} captured reading${1===e.marks_with_delta?'':'s'}. ${i}. ${Ye(e)}`},o.scaleDelta=function(e,t,n){const r=(e||[]).map(e=>m(e?.delta_oi)),i=r.filter(e=>null!=e);if(!i.length||t<=0||n<=0)return null;const o=Math.min(0,...i),a=Math.max(0,...i),u=a-o||1,s=e=>n-(e-o)/u*n,l=r.length>1?t/(r.length-1):0;return{lo:o,hi:a,height:n,zero:s(0),real:i.length,points:r.map((e,t)=>null==e?null:{x:t*l,y:s(e),i:t})}},o.scaleGridPrice=function(e,t,n){const r=(e||[]).map(e=>m(e?.price)),i=r.filter(e=>null!=e);if(i.length<2||t<=0||n<=0)return null;const o=Math.min(...i),a=Math.max(...i),u=a-o||Math.abs(a)||1,s=r.length>1?t/(r.length-1):0;return{lo:o,hi:a,points:r.map((e,t)=>null==e?null:{x:t*s,y:n-(e-o)/u*n,i:t})}},o.deltaAxis=function(e){if(!e)return[];const t=e.hi-e.lo||1,n=[];for(const r of[e.hi,0,e.lo]){const i=e.height-(r-e.lo)/t*e.height;n.some(e=>Math.abs(e.y-i)<9)||n.push({v:r,y:i})}return n},o.axisTimes=function(e,t=4){const n=(e||[]).map((e,t)=>({i:t,label:E(e?.at)})).filter(e=>e.label!==u);if(!n.length)return[];const r=n.filter(e=>e.label.endsWith(':30')),i=r.length>=2?r:n;if(i.length<=t)return i;const o=(i.length-1)/(t-1),a=[];for(let e=0;e<t;e++){const t=i[Math.round(e*o)];t&&!a.some(e=>e.i===t.i)&&a.push(t)}return a},o.gridBasis=function(e){if(!e)return'';const t=null==e.atm_strike?u:v(e.atm_strike),n=null==e.spot?u:T(e.spot,e.underlying),r=(e.marks||[]).length,i=r?` ${r} reading${1===r?'':'s'} captured, ${E(e.marks[0])} to ${E(e.marks[r-1])}.`:'',o=e.expiry?P(e.expiry)?.date||e.expiry:'';return`At the money: ${t}, from a captured spot of ${n}${o?` in the ${o} expiry`:''}.${i}`},o.gridSourceText=function(e){return'snapshots'===e?'Readings taken from the live capture.':'candles_15m'===e?'Readings taken from the 15-min candle backfill; the live capture has not written this session yet.':'read_api'===e?'Readings taken from the derivatives reader.':''},Object.defineProperty(o,"FUTURES_INTERVALS",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(o,"FUTURES_DEFAULT_INTERVAL",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(o,"FUTURES_NO_SYMBOL",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(o,"FUTURES_NO_CANDLES",{enumerable:!0,get:function(){return et}}),Object.defineProperty(o,"FUTURES_SHORT_HISTORY",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(o,"FUTURES_GAP_TEXT",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(o,"FUTURES_DISPLAY_TEXT",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(o,"FUTURES_FEW_CANDLES",{enumerable:!0,get:function(){return it}}),Object.defineProperty(o,"FUTURES_INTERVAL_NOTE",{enumerable:!0,get:function(){return ot}}),o.futuresIntervalChoices=function(e){const t=Array.isArray(e?.intervals)?e.intervals:null,n=t?new Map:null;for(const e of t||[]){if('string'==typeof e){e&&n.set(e,{available:!0,note:''});continue}const t=e||{},r=String(t.interval||'');r&&n.set(r,{available:!1!==t.available,note:String(t.note||'').trim()})}return Je.map(e=>{const t=n?n.get(e.key):null;return!n||!!t?.available?{key:e.key,label:e.label,available:!0,reason:''}:{key:e.key,label:e.label,available:!1,reason:t?.note||`No ${e.label.toLowerCase()} stored for this contract yet.`}})},o.futuresIntervalNote=function(e){return(e||[]).filter(e=>!e.available).map(e=>e.reason).join(' ')},o.futuresChartName=at,o.futuresBars=function(e){const t=m(e?.bars);return null!=t?Math.max(0,Math.round(t)):(e?.candles||[]).filter(e=>!e?.gap&&null!=ut(e)).length},o.futuresChartTitle=function(e,t){const n=String(e?.tradingsymbol||'').trim();if(n)return n;const r=String(t||'').trim();return r?`${r} futures`:'Futures chart'},o.futuresChartSubtitle=function(e){const t=[],n=P(e?.contract?.expiry)?.date||'';n&&t.push(n);const r=I(e?.contract?.days_to_expiry);r!==u&&t.push(r);return t.join(' \xb7 ')},o.futuresNote=function(e,t=Ze){return String(e?.note||'').trim()||ot[String(t)]||''},o.futuresShortText=function(e){return e?.short_history?String(e?.short_history_text||'').trim()||tt:''},o.futuresFewText=function(e,t=it){const n=m(e);return null==n||n<=0||n>=t?'':`Only ${Math.round(n)} candle${1===Math.round(n)?'':'s'} stored for this contract \u2014 every one of them is drawn.`},o.storedCandle=ut,o.scaleCandles=st,Object.defineProperty(o,"CANDLE_MIN_STEP",{enumerable:!0,get:function(){return lt}}),o.candleWindow=function(e,t,n=lt){const r=e||[],i=m(t)||0,o=m(n)||lt;if(!r.length||i<=0||o<=0)return{candles:r,shown:r.length,total:r.length,windowed:!1};const a=Math.max(1,Math.floor(i/o));return r.length<=a?{candles:r,shown:r.length,total:r.length,windowed:!1}:{candles:r.slice(r.length-a),shown:a,total:r.length,windowed:!0}},o.candleWindowText=function(e){return e?.windowed?`Showing the latest ${e.shown} of ${e.total} candles in this series; the panel is too narrow for all of them.`:''},o.candleWindowShort=function(e){return e?.windowed?`Latest ${e.shown} of ${e.total} candles`:''},o.candleDrawnText=function(e,t){const n=m(e),r=m(t);if(null==n||n<=0)return'';const i=Math.round(n),o=null==r?null:Math.round(r);return null!=o&&o>i?`${i} of ${o} stored candles drawn`:`${i} stored candle${1===i?'':'s'} drawn`},o.candleAxis=function(e,t){const n=m(t)||0;if(!e||n<=0)return[];const r=e.hi-e.lo||1,i=[];for(const t of[e.hi,(e.hi+e.lo)/2,e.lo]){const o=n-(t-e.lo)/r*n;i.some(e=>Math.abs(e.y-o)<10)||i.push({v:t,y:o})}return i},o.priceTick=function(e){const t=m(e);if(null==t)return u;const n=Math.abs(t)>=1e3?0:Math.abs(t)>=100?1:2;
1077return t.toLocaleString('en-IN',{minimumFractionDigits:n,maximumFractionDigits:n})},o.candleAxisLabel=ct,o.candleSessions=dt,o.candleAxisTimes=function(e,t=Ze,n=4,r){const i=e||[],o=dt(i),a='1d'!==t&&o.length>1?o.map(e=>({i:e.i,label:_e(i[e.i]?.at)})).filter(e=>!!e.label&&e.label!==u):i.map((e,n)=>({i:n,label:ct(e?.at,t)})).filter(e=>e.label!==u&&''!==e.label);let s=a;if(a.length>n){const e=(a.length-1)/(n-1);s=[];for(let t=0;t<n;t++){const n=a[Math.round(t*e)];n&&!s.some(e=>e.i===n.i)&&s.push(n)}}return ht(s,i.length,r)},Object.defineProperty(o,"CANDLE_LABEL_PX",{enumerable:!0,get:function(){return ft}}),o.thinAxisLabels=ht,o.futuresChartSpoken=function(e,t=Ze,n){const r=e?.candles||[],i=st(r,100,100)?.drawn||0,o=Je.find(e=>e.key===t),a=`${at(e?.contract,n)}, ${(o?.label||'candles').toLowerCase()}.`;if(!i)return`${a} ${et}.`;const s='1d'!==t&&dt(r).length>1,l=e=>{const n=P(e?.at);return n?'1d'===t?_e(e?.at)||u:s?n.time?`${_e(e?.at)} ${n.time}`:_e(e?.at):n.time||u:u},c=l(r[0]),d=l(r[r.length-1]);return`${a} ${i} candle${1===i?'':'s'} stored${c!==u&&d!==u?` from ${c} to ${d}`:''}.`},Object.defineProperty(o,"BLOCK_DEFAULT_RANKED",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(o,"BLOCK_DEFAULT_INDEX",{enumerable:!0,get:function(){return pt}}),o.resolveBlockSymbol=gt,Object.defineProperty(o,"SCREENER_PATH",{enumerable:!0,get:function(){return bt}}),o.screenerParam=_t,o.screenerQuery=function(e,t){const n=[];let r=!1;for(const t of me(e)){const e=_t(t);e&&('buildup'===e.key&&(r=!0),n.push(`${e.key}=${encodeURIComponent(e.value)}`))}const i=String(t?.buildupWindow||'').trim();r&&ue.some(e=>e.value===i)&&n.push(`buildup_window=${i}`);const o=String(t?.at||'').trim();o&&n.push(`at=${encodeURIComponent(o)}`);const a=String(t?.group||'').trim();a&&Pn.some(e=>e.value===a)&&n.push(`group=${a}`);return n.length?`?${n.join('&')}`:''},Object.defineProperty(o,"FILTER_PENDING_REASON",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(o,"FILTER_NOT_APPLIED_REASON",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(o,"FILTER_UNSUPPORTED_REASON",{enumerable:!0,get:function(){return vt}}),o.joinWords=wt,o.filterKey=St,o.servedFilters=Ot,o.servedApplied=Tt,o.filterStatuses=function(e,t,n){const r=me(e),i=Tt(t),o=Array.isArray(i),a=new Map;for(const e of i||[]){const t=St(e);t&&a.set(t,e)}const u=Ot(t),s=Array.isArray(u),l=new Map;for(const e of u||[]){const t=St(e);t&&l.set(t,e)}return r.map(e=>{const t=_t(e),r=Q(e.column),i=t?t.key:r?.param||String(e.column),u=l.get(i),c=ee(e.column),d=ge(e,n?.(e));let f='pending';f=o?a.has(i)?'applied':r?.noScreener||s&&!l.has(i)||u&&!1===u.ready?'unsupported':'not_applied':'pending';const h=(u?.missing_columns||[]).filter(Boolean);return{rule:e,key:i,label:c,text:d,state:f,reason:'applied'===f?'':'pending'===f?yt:'unsupported'===f?r?.noScreener?'The screener has no parameter for this filter, so it was not sent. It still narrows the other lists on this tab.':h.length?`This store does not carry ${wt(h)}, so this filter could not be applied.`:vt:$t}})},o.alwaysApplied=function(e){return(Tt(e)||[]).filter(e=>e&&e.always).map(e=>String(e.text||'').trim()).filter(Boolean)},o.appliedCount=function(e){return(e||[]).filter(e=>'applied'===e.state).length},o.notAppliedText=function(e,t){const n=(e||[]).filter(e=>'applied'!==e.state);if(!n.length)return'';if(t&&String(t).trim())return String(t).trim();const r=e=>e.label.toLowerCase(),i=n.filter(e=>'not_applied'===e.state),o=n.filter(e=>'unsupported'===e.state),a=n.filter(e=>'pending'===e.state),u=[];i.length&&u.push(`The server did not apply ${wt(i.map(r))}.`);o.length&&u.push(`The server has no parameter for ${wt(o.map(r))}.`);a.length&&u.push(`The server has not said whether it applied ${wt(a.map(r))}.`);return`${u.join(' ')} The rows below are NOT narrowed by ${1===n.length?'it':'them'}.`},o.appliedText=function(e){const t=(e||[]).filter(e=>'applied'===e.state);return t.length?t.map(e=>e.text).join(' \xb7 '):(e||[]).length?'No filter applied by the server':'No filters \u2014 every contract over the liquidity floors'},o.resolveTabSymbol=function(e,t,n,r,i){return gt(String(e||'').trim()||String(t||'').trim(),n,r,i)},o.symbolBadge=function(e){return e?.symbol?e.defaulted&&e.label?`${e.label}: ${e.symbol}
1077`:e.symbol:''},Object.defineProperty(o,"NO_SYMBOL_TEXT",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(o,"PCR_CHIPS",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(o,"MAX_PAIN_CHIPS",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(o,"IV_CHIPS",{enumerable:!0,get:function(){return It}}),Object.defineProperty(o,"FUTURES_CHIPS",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(o,"NO_SESSION_DIRECTION",{enumerable:!0,get:function(){return At}}),o.sessionChip=function(e,t){return e[String(t||'')]||''},o.sessionTone=function(e,t){const n=Object.keys(e),r=String(t||'');return r===n[0]?'up':r===n[2]?'down':'flat'},Object.defineProperty(o,"SESSION_LOOKBACK",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(o,"SESSION_FLAT_FRACTION",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(o,"PCR_KEYS",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(o,"MAX_PAIN_KEYS",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(o,"IV_KEYS",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(o,"FUTURES_KEYS",{enumerable:!0,get:function(){return Ut}}),o.sessionDirection=Rt,o.servedDirection=function(e,t,n,r){const i=String(e||'').trim();return n.includes(i)?i:Rt(t,n,Mt,Lt,r)},Object.defineProperty(o,"PCR_OI_LABEL",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(o,"PCR_VOLUME_LABEL",{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(o,"PCR_DEFINITION",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(o,"PCR_READING_TEXT",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(o,"PCR_NO_POINTS",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(o,"PCR_THIN_CHAIN",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(o,"MAX_PAIN_DEFINITION",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(o,"MAX_PAIN_GAP_TEXT",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(o,"MAX_PAIN_READING_TEXT",{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(o,"MAX_PAIN_NO_POINTS",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(o,"MAX_PAIN_THIN_CHAIN",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(o,"IV_COMPUTED_TAG",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(o,"IV_COMPUTED_TEXT",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(o,"IV_ATM_LABEL",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(o,"IV_DEFINITION",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(o,"IV_READING_TEXT",{enumerable:!0,get:function(){return en}}),Object.defineProperty(o,"IV_NO_POINTS",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(o,"IV_THIN_CHAIN",{enumerable:!0,get:function(){return nn}}),Object.defineProperty(o,"IV_REASONS",{enumerable:!0,get:function(){return rn}}),o.ivReasonText=on,o.ivText=an,o.ivTagged=function(e){const t=an(e);return t===u?t:`${t} ${zt}`},o.ivModelText=function(e){const t=String(e?.model||'').trim(),n=m(e?.rate),r=String(e?.rate_label||'').trim()||(null==n?'':`${(Math.abs(n)<=1?100*n:n).toFixed(2)}% risk-free rate`);return t||r?`Model: ${t||'not named by the server'}${r?` \xb7 solved at ${r}`:''}.`:'The server did not name the model or the rate these were solved at.'},o.ivComputedText=function(e){return String(e?.computed_text||'').trim()||Jt},o.ivCoverage=un,o.ivCoverageText=function(e){const{total:t,solved:n,withReason:r}=un(e);return t?`${n} of ${t}
1077 reading${1===t?'':'s'} solved`+(r?`; ${r} carr${1===r?'ies':'y'} a reason instead of a number.`:'.'):''},o.ivStrikeSpoken=function(e){const t=`${v(e?.strike)} ${String(e?.option_type||'').toUpperCase()}`.trim(),n=String(e?.moneyness||'').trim(),r=null!=m(e?.iv)?`computed implied volatility ${an(e?.iv)}`:on(e?.reason,e?.reason_text)||'no computed implied volatility';return`${t}${n?`, ${n}`:''}. ${r}.`},Object.defineProperty(o,"FUTURES_BUILDUP_DEFINITION",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(o,"FUTURES_BUILDUP_READING_TEXT",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(o,"FUTURES_BUILDUP_NO_POINTS",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(o,"FUTURES_BUILDUP_THIN",{enumerable:!0,get:function(){return dn}}),o.basisPair=fn,o.oiVsAvgText=hn,o.scaleValues=function(e,t,n,r=!1){const i=(e||[]).map(e=>m(e)),o=i.filter(e=>null!=e);if(o.length<2||t<=0||n<=0)return null;const a=r?Math.min(0,...o):Math.min(...o),u=r?Math.max(0,...o):Math.max(...o),s=u-a||Math.abs(u)||1,l=i.length>1?t/(i.length-1):0;return{lo:a,hi:u,points:i.map((e,t)=>null==e?null:{x:t*l,y:n-(e-a)/s*n,i:t})}},o.scaleTogether=function(e,t,n,r){const i=(e||[]).map(e=>m(e)),o=(t||[]).map(e=>m(e)),a=[...i,...o].filter(e=>null!=e);if(a.length<2||n<=0||r<=0)return null;const u=Math.min(...a),s=Math.max(...a),l=s-u||Math.abs(s)||1,c=e=>{if(!e.some(e=>null!=e))return null;const t=e.length>1?n/(e.length-1):0;return{lo:u,hi:s,points:e.map((e,n)=>null==e?null:{x:n*t,y:r-(e-u)/l*r,i:n})}};return{lo:u,hi:s,a:c(i),b:c(o)}},Object.defineProperty(o,"VALUE_LABEL_PX",{enumerable:!0,get:function(){return mn}}),o.valueAxis=pn,o.valueAxisLabels=function(e,t,n,r=3){const i=[];for(const o of pn(e,t,r)){const e=n(o.v);e&&e!==u&&(i.some(t=>t.label===e)||i.push({...o,label:e}))}return i},o.sessionAxisTimes=function(e,t=4,n,r=ft){const i=e||[],o=[];let a='';if(i.forEach((e,t)=>{const n=P(e);n&&n.time&&(a&&n.time<=a||(a=n.time,o.push({i:t,label:n.time})))}),!o.length)return[];let u=o;if(o.length>t){const e=(o.length-1)/(Math.max(2,t)-1);u=[];for(let n=0;n<t;n++){const t=o[Math.round(n*e)];t&&!u.some(e=>e.i===t.i)&&u.push(t)}}const s=new Set;return ht(u.filter(e=>!s.has(e.label)&&(s.add(e.label),!0)),i.length,n,r)},o.sessionSpoken=function(e,t,n){const r=(t||[]).filter(e=>null!=m(e)).length,i=n||[];if(!r)return`${e}. Nothing captured yet.`;const o=E(i[0]),a=E(i[i.length-1]);return`${e}. ${r} captured reading${1===r?'':'s'}${o!==u&&a!==u?` from ${o} to ${a}`:''}.`},o.directionWords=function(e,t){const n=e||{},r=t?n[t]:n;return r&&'object'==typeof r&&'string'==typeof r.up&&'string'==typeof r.down?r:null},o.directionMissing=function(e,t){const n=String(e||'').trim();return!(!n||n===At)&&(!t||n!==t.up&&n!==t.down&&n!==t.flat)},o.servedChip=function(e,t,n){const r=String(e||'').trim();if(!r||r===At)return'';const i=String(n?.[r]||'').trim()||r.replace(/_/g,' '),o=r===t?.up?'\u2191':r===t?.down?'\u2193':r===t?.flat?'\u2192':'';return`${o?`${o} `:''}${i.toUpperCase()}`},o.servedTone=function(e,t){const n=String(e||'').trim();return n&&n===t?.up?'up':n&&n===t?.down?'down':'flat'},o.directionRule=function(e){return String(e?.direction_text||'').trim()},o.seriesValues=function(e,t){return(e||[]).map(e=>!0===(e||{}).gap?null:m(t(e)))},o.seriesTimes=function(e){return(e||[]).map(e=>e?.at??null)},o.readingsText=gn,o.withheldLines=bn,o.withheldText=function(e){const t=bn(e);if(!t.length)return'';const n=gn(e);return`${n?`${n}. `:''}${t.join(' ')}`},o.maxPainDistanceText=_n,o.maxPainDistanceRule=function(e){return String(e?.distance_definition||'').trim()},o.maxPainLine=function(e){if(!e)return'';const t=m(e.latest_total_oi),n=m(e.latest_spot),r=null==n?'no spot was captured at this reading, so there is no distance to it':`spot ${T(n,e.underlying)} \xb7 ${_n(e.latest_distance)}`;return`Max pain ${v(e.latest_max_pain_strike)} \xb7 ${r}.`+(null==t?' Total OI behind it: not captured.':` From ${b(t)} contracts of open interest.`)},o.pcrLine=function(e){return e?`${Dt} ${G(e.latest_pcr_oi)} \xb7 ${Ft} ${G(e.latest_pcr_volume)}.`:''},o.ivRateText=yn,o.ivRateSourceShort=function(e){const t=yn(e),n=e?.risk_free_rate_source;if(!t&&!n)return'';const r=String(n?.kind||'').trim(),i=[r,!1===n?.live_feed?'no live feed behind it':!0===n?.live_feed?'from a live feed':''].filter(
1077Boolean).join(', ');return`Solved at a risk-free rate of ${t||'a rate the server did not name'}${i?` \u2014 ${i}`:''}.`},o.ivRateSourceText=function(e){const t=e?.risk_free_rate_source,n=String(t?.text||'').trim(),r=String(t?.where||'').trim();return n?r?`${n} It lives in ${r}.`:n:''},o.ivRateIsAssumed=function(e){return!1===e?.risk_free_rate_source?.live_feed},o.ivRateSensitivityText=function(e){const t=m(e);if(null==t)return'';const n=Math.abs(t);return n<.005?'A rate one percentage point higher would not move this reading at all.':`A rate one percentage point higher would move this reading by ${n.toFixed(2)} percentage point${1===n?'':'s'}${t<0?' down':' up'}.`},o.ivRateSensitivity=function(e){let t=null;for(const n of e||[])for(const e of n?.points||[]){const n=m(e?.rate_sensitivity_pct_points);null!=n&&((null==t||Math.abs(n)>Math.abs(t))&&(t=n))}return t},o.ivRejectionLines=function(e){const t=e?.rejections||{},n=e?.reason_text||{};return Object.entries(t).filter(([,e])=>null!=m(e)&&Number(e)>0).sort((e,t)=>Number(t[1])-Number(e[1])).map(([e,t])=>`${Math.round(Number(t))} reading${1===Math.round(Number(t))?'':'s'}: ${n[e]||e}`)},o.ivMethodText=function(e){const t=String(e?.model||'').trim();if(!t)return'The server did not name the model these were solved with.';const n=String(e?.method||'').trim(),r=String(e?.day_count||'').trim(),i=String(e?.expiry_time_ist||'').trim();return`Model: ${t}${n?` \xb7 ${n}`:''}${r?` \xb7 ${r}${i?` to ${i} IST on the expiry date`:''}`:''}.`},o.ivPointReason=$n,o.ivLatestRefusal=function(e,t){const n=[...e||[]].reverse().find(e=>null==m(e?.iv)&&(e?.reason||e?.reason_text));return n?$n(n,t):''},o.futuresLine=function(e,t){if(!e)return'';const n=Sn(e.latest_buildup_day),r=fn(e.latest_basis,e.latest_basis_pct,t??S(e.underlying));return`${hn(e.latest_oi_vs_avg)} \xb7 ${r===u?vn:`basis ${r}`}`+(n===u?'':` \xb7 ${n} on the day`)+"."},Object.defineProperty(o,"BASIS_NO_SPOT",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(o,"BASIS_NO_SPOT_ROW",{enumerable:!0,get:function(){return wn}}),o.servedBuildup=Sn,o.coverageText=On,Object.defineProperty(o,"SESSION_READINGS",{enumerable:!0,get:function(){return Tn}}),o.readingChoices=function(e,t=Tn){const n=e?.readings||[],r=P(n[0]?.at)?.iso||'',i=r?n.filter(e=>P(e?.at)?.iso===r):n;return(i.length?i:n).slice(0,t).map(e=>{const t=String(e?.at||''),n=P(t),r=m(e?.underlyings);return{value:t,label:n?`${n.date} \xb7 ${n.time}
1077`:t,short:n&&n.time?n.time:t,detail:null==r?'':`${Math.round(r)} underlying${1===Math.round(r)?'':'s'} covered`}}).filter(e=>!!e.value)},o.screenerEmptyDetail=function(e){const t=On(e),n=Array.isArray(e?.readings)&&(e?.readings).length>1?' Earlier readings of this session are listed above; choosing one moves this whole block to it.':'';return`${t}${n}`.trim()},o.readingLabel=Nn,o.readingIsFallback=function(e){return!!e&&!1===e.reading_is_newest&&!e.reading_chosen},o.readingNote=function(e){if(!e||!1!==e.reading_is_newest)return'';const t=Nn(e.reading_at),n=Nn(e.newest_at);if(!t)return'';if(e.reading_chosen)return`Showing the reading of ${t}, the one chosen above.${n?` The newest this store holds is ${n}.`:''}`;const r=m(e.reading_skipped)||0,i=r>0?` No contract cleared the liquidity floors at the ${Math.round(r)} reading${1===Math.round(r)?'':'s'} after it.`:'';return`Showing the reading of ${t} \u2014 NOT the newest this store holds${n?` (${n})`:''}.${i} Any reading can be chosen above.`},o.maxPainAgainstSpot=function(e,t,n,r,i,o){const a=m(t);if(null==a)return'No spot was captured for this underlying at any reading of this session, so there is no distance to it.';const u=String(r||'').trim(),s=String(i||'').trim(),l=[];s&&l.push(`strike ${s}`);l.push(`spot ${T(a,o)}${u?` ${u}`:''}`);const c=m(n);null!=c&&l.push(0===c?'the strike is at spot':`the strike is ${v(Math.abs(c))} ${c>0?'above':'below'} it`);return l.join(' \xb7 ')},o.headlineAgainst=function(...e){return e.map(e=>String(e||'').trim()).filter(e=>e&&!e.endsWith(u)&&e!==u).join(' \xb7 ')},o.pcrAgainst=function(e,t){return null==m(e)&&null==m(t)?'':`${b(e)} put open interest against ${b(t)} call`},Object.defineProperty(o,"SCREENER_VIEWS",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(o,"SCREENER_VIEW_DEFAULT",{enumerable:!0,get:function(){return En}}),o.groupContracts=In,o.groupSplit=xn,o.groupOptionsNote=function(e){const t=m(e?.options)??0,n=m(e?.contracts)??0;return t?t===n?`of ${Math.round(n)}`:`of ${Math.round(t)} options`:'no options listed'},o.groupVolumeRatioMax=An,o.groupVolumeRatioText=Mn,Object.defineProperty(o,"MIN_BASELINE_SESSIONS_TEXT",{enumerable:!0,get:function(){return Ln}}),o.groupHot=function(e){const t=m(e?.volume_to_oi_over_1);return null!=t&&m(e?.volume_to_oi_contracts)?`${Math.round(t)}`:u},o.groupHotText=Cn,o.groupBuildupText=jn,Object.defineProperty(o,"SIGNAL_AGGREGATE_TEXT",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(o,"SIGNAL_BASKET_TEXT",{enumerable:!0,get:function(){return Un}}),Object.defineProperty(o,"SIGNAL_CAVEAT_TEXT",{enumerable:!0,get:function(){return Rn}}),Object.defineProperty(o,"SIGNAL_RULE_TEXT",{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(o,"SIGNAL_NO_DATA",{enumerable:!0,get:function(){return Fn}}),Object.defineProperty(o,"SIGNAL_NO_BASELINE",{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(o,"SIGNAL_NO_WINDOW",{enumerable:!0,get:function(){return Gn}}),Object.defineProperty(o,"SIGNAL_NO_STRENGTH",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(o,"SIGNAL_STRENGTH_BANDS",{enumerable:!0,get:function(){return Wn}}),Object.defineProperty(o,"SIGNAL_STRENGTH_TEXT",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(o,"SIGNAL_STRENGTH_WORDS",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(o,"SIGNAL_STRENGTH_MIN",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(o,"SIGNAL_ARROWS",{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(o,"SIGNAL_ARROWS_DOWN",{enumerable:!0,get:function(){return qn}}),Object.defineProperty(o,"SIGNAL_STABLE",{enumerable:!0,get:function(){return zn}}),Object.defineProperty(o,"SIGNAL_LABELS",{enumerable:!0,get:function(){return Jn}}),Object.defineProperty(o,"SIGNAL_DOTS",{enumerable:!0,get:function(){return Zn}}),o.signalLabel=er,Object.defineProperty(o,"SIGNAL_INTERPRETATIONS",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(o,"SIGNAL_MORE_CALLS",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(o,"SIGNAL_MORE_PUTS",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(o,"SIGNAL_BALANCED",{enumerable:!0,get:function(){return ir}}),Object.defineProperty(o,"SIGNAL_WINDOW_MINUTES",{enumerable:!0,get:function(){return or}}),Object.defineProperty(o,"SIGNAL_WINDOW_MAX_MINUTES",{enumerable:!0,get:function(){return ar}}),Object.defineProperty(o,"SIGNAL_RULE_VERSION",{enumerable:!0,get:function(){return ur}}),o.readingMinutes=sr,o.signalBaselineIndex=lr,Object.defineProperty(o,"SIGNAL_INTERVAL_MINUTES",{enumerable:!0,get:function(){return cr}}),o.intervalIndex=function(e,t,n=cr){if(t<=0)return null;const r=sr(e?.[t]);if(null==r)return t-1;for(let i=t-1;i>=0;i--){const t=sr(e?.[i]);if(null!=t&&r-t>=n)return i}return 0},Object.defineProperty(o,"SIGNAL_LEANS",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(o,"signalLean",{enumerable:!0,get:function(){return fr}}),o.signalSide=mr,o.signalInterpretation=pr,o.marketSignal=gr,o.signalRows=function(e,t=or,n=ar){const r=(e||[]).filter(e=>e&&e.present),i=r.filter(e=>'puts'!==e.row),o=r.filter(e=>'puts'===e.row),a=Math.max(0,...r.map(e=>(e.points||[]).length));if(!a)return[];const s=Array.from({length:a},(e,t)=>r.map(e=>e.points?.[t]?.at).find(Boolean)||null),l={calls:{peak:0,pricePeak:0,ranked:0},puts:{peak:0,pricePeak:0,ranked:0}},c=[];for(let e=0;e<a;e++){const a=s[e],d=lr(s,e,t,n),f=null==d?null:s[d],h=null==d?null:(sr(a)??0)-(sr(f)??0),p=(t,n,r)=>{const i={...r};let o=null,a=null;null!=d&&(o=hr(t,e,d,'delta_oi').change,a=hr(t,e,d,'price').change);const u=null==o?i.peak:Math.max(i.peak,Math.abs(o)),s=null==a?i.pricePeak:Math.max(i.pricePeak,Math.abs(a)
1077),l=i.ranked+(null==o?0:1),c=mr(t,e,d,n,u,s,l);return r.peak=u,r.pricePeak=s,r.ranked=l,c},g=p(i,'CE',l.calls),b=p(o,'PE',l.puts),_={at:a,from:f,window_minutes:h,rule_version:ur};if(!g&&!b){const t=r.some(t=>null!=m(t?.points?.[e]?.delta_oi))?null==d?Gn:Bn:Fn;c.push({..._,calls:null,puts:null,interpretation:'',signal:'',label:u,dot:'',reason:t});continue}const y=gr(g,b);c.push({..._,calls:g,puts:b,interpretation:pr(g,b),signal:y,label:er(y,g,b),dot:y?Zn[y]:'',reason:y?'':Bn})}return c.reverse()},Object.defineProperty(o,"UNUSUAL_RULE_DEFS",{enumerable:!0,get:function(){return br}}),Object.defineProperty(o,"UNUSUAL_RULE_UNCLASSIFIED",{enumerable:!0,get:function(){return _r}}),Object.defineProperty(o,"UNUSUAL_RULE_UNCLASSIFIED_LABEL",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(o,"UNUSUAL_RULE_UNCLASSIFIED_SHORT",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(o,"UNUSUAL_RULE_MAX",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(o,"UNUSUAL_WHAT",{enumerable:!0,get:function(){return wr}}),Object.defineProperty(o,"UNUSUAL_COUNTS_TEXT",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(o,"UNUSUAL_RULE_TEXT",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(o,"UNUSUAL_SORT_TEXT",{enumerable:!0,get:function(){return Tr}}),Object.defineProperty(o,"UNUSUAL_COLOUR_TEXT",{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(o,"UNUSUAL_HONEST_TEXT",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(o,"UNUSUAL_EVIDENCE_LABEL",{enumerable:!0,get:function(){return Er}}),Object.defineProperty(o,"UNUSUAL_EVIDENCE_NONE",{enumerable:!0,get:function(){return Ir}}),Object.defineProperty(o,"UNUSUAL_NONE",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(o,"UNUSUAL_NOT_MEASURED",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(o,"UNUSUAL_NOT_MEASURED_TEXT",{enumerable:!0,get:function(){return Mr}}),o.unusualMeasured=Lr,o.unusualRuleWords=Cr,o.unusualRuleOf=jr,o.unusualRules=kr,o.unusualConditions=Ur,o.unusualContractCount=Rr,o.unusualObservations=Dr,o.unusualDegree=Fr,o.unusualText=Br,o.unusualShort=Gr,o.unusualRuleBadge=Vr,o.unusualBadgesText=Wr,o.unusualRuleDetail=function(e){if(!e)return'';const t=[],n=String(e.comparator||'').trim(),r=m(e.threshold);n&&null!=r&&t.push(`Flagged when ${e.measure||'the measurement'} is ${'>='===n?'at least':'more than'} ${N(r,1)} ${e.baseline_label||'its baseline'}`);const i=m(e.value_max);null!=i&&t.push(`Largest in this instrument ${N(i,1)}${e.value_max_symbol?` on ${e.value_max_symbol}`:''}`);const o=m(e.baseline_at_max);null!=o&&t.push(`measured against ${b(o)}`);const a=m(e.sample_count_at_max);null!=a&&t.push(`over ${Math.round(a)} ${e.sample_label||'observation'}${1===Math.round(a)?'':'s'}`);return t.join(' \xb7 ')},o.unusualTriggerText=function(e,t){if(!e)return'';const n=(t||[]).find(t=>t.rule_id===e.rule_id),r=n?.label||br.find(t=>t.rule_id===e.rule_id)?.label||String(e.text||'')||yr,i=m(e.value),o=[r,null!=i?N(i,1):'no value stored'],a=String(e.comparator||'').trim(),u=m(e.threshold);a&&null!=u&&o.push(`${a} ${N(u,1)}`);const s=m(e.baseline);null!=s&&o.push(`baseline ${b(s)}`);const l=m(e.sample_count);null!=l&&o.push(`${Math.round(l)} observation${1===Math.round(l)?'':'s'}`);return o.join(' \xb7 ')},o.unusualEvidence=function(e){const t=e?.unusual_contracts;return Array.isArray(t)?t.filter(e=>e&&e.tradingsymbol):[]},o.unusualEvidenceSummary=function(e){const t=Ur(e),n=Rr(e),r=Dr(e);return`${t} condition${1===t?'':'s'} \xb7 ${n} contract${1===n?'':'s'} flagged \xb7 ${r} observation${1===r?'':'s'}`},o.unusualRank=function(e){return[Ur(e),m(e?.unusual)||0,m(e?.premium_cr)||0,String(e?.underlying||'')]},o.rankingLabel=function(e){return String(e?.label||'').trim()},o.rankingText=function(e){return[String(e?.text||'').trim(),...(e?.keys||[]).map(e=>String(e?.text||'').trim())].filter(Boolean)},Object.defineProperty(o,"SEARCH_WHAT",{enumerable:!0,get:function(){return Hr}}),Object.defineProperty(o,"SEARCH_NOT_FOUND",{enumerable:!0,get:function(){return Xr}}),o.matchesSearch=Kr,o.searchRows=function(e,t){const n=e||[],r=String(t||'').trim();return r?n.filter(e=>Kr(e?.underlying,r)):n.slice()},o.searchNote=function(e,t,n){const r=String(e||'').trim();return r?t?`${t} of ${n} instrument${1===n?'':'s'} at this reading match \u201c${r}\u201d.`:Xr:''},o.groupTopText=Yr,o.groupRowLabel=function(e,t=3){return[`${e?.underlying||''}.`,Fr(e)?`${Gr(e)}: ${Wr(e)}.`:'',`${In(e)} over the liquidity floors, options and futures together.`,`${p(e?.premium_cr)}
1077 traded.`,null==e?.spot?'':`Spot ${T(e.spot,e?.underlying,e?.underlying_kind)}.`,`Open interest ${b(e?.oi)}, change today ${y(e?.oi_change_day)}.`,Mn(e),Cn(e),jn(e)?`Build-up across those contracts: ${jn(e)}.`:'',Yr(e)?`${Yr(e)}.`:'','Click to point the whole tab at it and open its contracts.'].filter(Boolean).join(' ')},o.groupsCountText=function(e){const t=m(e?.groups_total),n=m(e?.contracts_total),r=m(e?.returned);if(null==t)return'';const i=null!=r&&r<t?`, and this list carries ${Math.round(r)} of them`:'';return`${Math.round(t)} instrument${1===Math.round(t)?'':'s'} have a contract over the floors at this reading${null==n?'':`, ${Math.round(n)} contracts between them`}${i}.`},o.figureAt=qr,o.figureAtText=function(e,t){const n=qr(e,t);return n?`at ${n}`:''},Object.defineProperty(o,"CHAIN_LEAD_ROWS",{enumerable:!0,get:function(){return zr}}),o.chainStartRow=function(e,t,n=zr){const r=H(e||[],t);return null==r?0:Math.max(0,r-n)},Object.defineProperty(o,"CHAIN_AT_MONEY_TEXT",{enumerable:!0,get:function(){return Jr}}),Object.defineProperty(o,"CHAIN_NO_SPOT_TEXT",{enumerable:!0,get:function(){return Zr}}),o.deltaRatio=function(e,t=2,n=4){const r=m(e);if(null==r)return u;let i=t;for(;i<n&&0!==r&&0===Number(Math.abs(r).toFixed(i));)i++;const o=Math.abs(r).toFixed(i);return`${0===Number(o)?'':Qr(r)}${o}`},o.deltaStrikePoints=function(e){const t=m(e);return null==t?u:`${Qr(t)}${Math.round(Math.abs(t)).toLocaleString('en-IN')} pts`},o.deltaVolPoints=function(e,t=1){const n=m(e);return null==n?u:`${Qr(n)}${Math.abs(n).toFixed(t)} vol pts`},o.deltaReasonText=ei,o.deltaSince=function(e,t,n){const r=String(e||'').trim();return r&&r!==u?`${r} since the previous session's close`:ei(t,n)},o.previousCloseText=function(e,t){const n=String(e||'').trim();if(!n||n===u)return String(t?.previous_close_reason||'').trim();const r=Nn(t?.previous_close_at);return`Previous close ${n}${r?` \xb7 ${r}`:''}`},o.previousCloseAtText=function(e){const t=Nn(e);return t?`at ${t}`:''},o.deltaReadingsText=function(e){const t=m(e?.readings_with_delta),n=m(e?.total_readings);return null==t||null==n?'':`${Math.round(t)} of ${Math.round(n)} readings carry a change since the previous close`};const u='\u2014',s='\u2212',l='\u20b9',c='\xd7',d='No F&O data captured yet \u2014 capture starts at the next reading',f='no baseline',h=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],m=e=>'number'==typeof e&&Number.isFinite(e)?e:null;function p(e,t=1){const n=m(e);return null==n?u:`${l}${n.toFixed(t)} cr`}function g(e){const t=m(e);return null==t?u:Math.round(t).toLocaleString('en-IN')}function b(e){const t=m(e);if(null==t)return u;const n=Math.abs(t),r=t<0?s:'',i=e=>{const t=e>=100?e.toFixed(0):e.toFixed(1);return t.endsWith('.0')?t.slice(0,-2):t};return n>=1e7?`${r}${i(n/1e7)}Cr`:n>=1e5?`${r}${i(n/1e5)}L`:n>=1e3?`${r}${i(n/1e3)}k`:`${r}${Math.round(n)}`}function _(e,t=1){const n=m(e);return null==n?u:`${n>0?'+':n<0?s:''}${Math.abs(n).toFixed(t)}%`}function y(e){const t=m(e);return null==t?u:`${t>0?'+':t<0?s:''}${Math.abs(Math.round(t)).toLocaleString('en-IN')}`}function $(e,t=2){const n=m(e);return null==n?u:`${l}${n.toLocaleString('en-IN',{minimumFractionDigits:t,maximumFractionDigits:t})}`}function v(e){const t=m(e);return null==t?u:Math.round(t).toLocaleString('en-IN')}const w=new Set(['NIFTY','BANKNIFTY','FINNIFTY','MIDCPNIFTY','NIFTYNXT50','SENSEX','BANKEX','NIFTYFPI']);function S(e,t){const n=String(e||'').trim().toUpperCase();return'boolean'==typeof t?t:'index'===t||'stock'!==t&&(Array.isArray(t)&&t.length?t.some(e=>String(e||'').trim().toUpperCase()===n):w.has(n))}function O(e,t,n=2,r=n){const i=m(e);if(null==i)return u;const o=i.toLocaleString('en-IN',{minimumFractionDigits:r,maximumFractionDigits:n});return t?o:`${l}${o}`}function T(e,t,n,r=2,i=r){return O(e,S(t,n),r,i)}function N(e,t=2){const n=m(e);return null==n?u:`${n.toFixed(t)}${c}`}function P(e){const t=String(e||'').trim(),n=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?/.exec(t);if(!n)return null;const[,r,i,o,a,u]=n,s=h[Number(i)-1];return s?{date:`${Number(o)} ${s} ${r}`,time:null!=a?`${a}:${u}`:'',iso:`${r}-${i}-${o}`}:null}function E(e){const t=P(e);return t&&t.time?t.time:u}function I(e){const t=m(e);return null==t?u:t<0?'expired':0===t?'expires today':`${Math.round(t)} day${1===Math.round(t)?'':'s'} to expiry`}const x={long_buildup:'Long build-up',short_buildup:'Short build-up',short_covering:'Short covering',long_unwinding:'Long unwinding'},A={flat:'Flat',no_data:'no data'},M=['long_buildup','short_buildup','short_covering','long_unwinding','flat','no_data'],L={...x,...A},C='unrecognised build-up',j=(()=>{const e={};for(const t of M)e[L[t].toLowerCase()]=t;return e})();function k(e){if(null==e)return'missing';const t=String(e).trim();if(!t)return'missing';const n=t.toLowerCase().replace(/[\s-]+/g,'_');return M.includes(n)?n:j[t.toLowerCase()]||'unknown'}function U(e){const t=k(e);return'missing'===t||'no_data'===t?u:'unknown'===t?C:L[t]}function R(e){return'no_data'===k(e)?L.no_data:U(e)}const D={'up|building':'long_buildup','down|building':'short_buildup','up|unwinding':'short_covering','down|unwinding':'long_unwinding','up|flat':'flat','down|flat':'flat','flat|building':'flat','flat|unwinding':'flat','flat|flat':'flat'};function F(e,t=3){const n=m(e?.volume_ratio),r=m(e?.volume_baseline_sessions);return'ok'!==e?.volume_baseline||null==n||null==r||r<t?f:`${n.toFixed(1)}${c} its ${Math.round(r)}-session median`}const B=e=>(m(e?.volume_to_oi)??0)>1;function G(e){const t=m(e);return null==t?u:t.toFixed(2)}function V(e,t=!1){const n=m(e);return null==n?u:`${n>0?'+':n<0?s:''}${O(Math.abs(n),t)}`}const W={premium_cr:'premium (\u20b9 cr)',premium_inr:'premium',oi_change_15m:'OI change (15 min)',oi_change_15m_pct:'OI change % (15 min)',buildup_15m:'build-up (15 min)',oi_change_day:'OI change (day)',oi_change_day_pct:'OI change % (day)',buildup_day:'build-up (day)',volume_ratio:'volume vs its average',volume_baseline_sessions:'baseline sessions',volume_to_oi:'volume-to-OI',previous_oi:'previous close OI',basis:'basis',oi_vs_20d_avg:'OI vs 20-day average',days_to_expiry:'days to expiry',spot:'the underlying price',price_change_15m_pct:'price change (15 min)',price_change_day_pct:'price change (day)'};function H(e,t){const n=m(t);if(null==n||!e?.length)return null;let r=0,i=1/0;return e.forEach((e,t)=>{const o=Math.abs((e.strike??NaN)-n);Number.isFinite(o)&&o<i&&(r=t,i=o)}),Number.isFinite(i)?r:null}const X={watchlist:'all',underlying:'',expiry:'',maxDte:null,optionType:'',minPremiumCr:null};const K=/^\d{4}-\d{2}-\d{2}$/;function Y(e,t,n=""){const r='string'==typeof e&&K.test(e)?e:'';if(!r||!t||!Array.isArray(t.expiries))return'';if(!t.expiries.filter(e=>e&&(!n||e.underlying===n)&&!('number'==typeof e.days_to_expiry&&e.days_to_expiry<0)).some(e=>e.expiry===r))return'';const i=t.served,o=!i?.expiry||!K.test(i.expiry)||n&&i.underlying!==n?'':i.expiry;return o&&r<o?'':r}const q=[{value:null,label:'Any expiry'},{value:0,label:'Expiry day only'},{value:7,label:'Within 7 days'},{value:30,label:'Within 30 days'}],z=[{value:null,label:'Floor (\u20b92 cr)'},{value:5,label:'\u20b95 cr and up'},{value:10,label:'\u20b910 cr and up'},{value:25,label:'\u20b925 cr and up'},{value:50,label:'\u20b950 cr and up'}];const J={is:'is',is_not:'is not',gt:'greater than',lt:'less than',in_watchlist:'is in watch list'},Z=[{key:'underlying',label:'Symbol',operators:['is'],param:'underlying'},{key:'expiry',label:'Exp. date',operators:['is'],param:'expiry'},{key:'optionType',label:'Type',operators:['is','is_not'],param:'option_type'},{key:'dte',label:'DTE',operators:['lt'],param:'max_dte',unit:'days'},{key:'premium',label:'Premium',operators:['gt'],param:'min_premium_cr',unit:'\u20b9 cr'},{key:'watchlist',label:'Watch list',operators:['in_watchlist'],param:'watchlist',noScreener:!0},{key:'volumeRatio',label:'Volume vs median',operators:['gt'],param:'min_volume_ratio',unit:'\xd7 median',route:'screener'},{key:'volumeToOi',label:'Volume to OI',operators:['gt'],param:'min_volume_to_oi',unit:'\xd7',route:'screener'},{key:'oiChange15m',label:'OI change (15 min)',operators:['gt','lt'],param:'min_oi_change_15m_pct',twin:'max_oi_change_15m_pct',unit:'%',route:'screener'},{key:'oiChangeDay',label:'OI change (day)',operators:['gt','lt'],param:'min_oi_change_day_pct',twin:'max_oi_change_day_pct',unit:'%',route:'screener'},{key:'buildup',label:'Build-up',operators:['is'],param:'buildup',route:'screener'},{key:'moneyness',label:'Moneyness',operators:['is'],param:'moneyness',route:'screener'},{key:'market',label:'Index or stock',operators:['is'],param:'underlying_kind',route:'screener'}],Q=e=>Z.find(t=>t.key===e)||null,ee=e=>Q(e)?.label||String(e||''),te=[1,3,7,15,31],ne=[2,5,10,25,50],re=[1.5,2,3,5,10],ie=[.5,1,2,5],oe=[1,2,5,10,25],ae=M.map(e=>L[e]),ue=[{value:'15m',label:'Over the last 15 minutes'},{value:'day',label:'Since the previous close'}],se='15m',le=[{value:'itm',label:'In the money'},{value:'atm',label:'At the money'},{value:'otm',label:'Out of the money'}],ce=[{value:'index',label:'Index'},{value:'stock',label:'Stock'}],de=e=>/^\d{1,3}(\.\d{1,2})?$/.test(e)&&Number(e)>=0&&Number(e)<=999,fe={underlying:e=>/^[A-Z0-9&._-]{1,40}$/.test(e),expiry:e=>/^\d{4}-\d{2}-\d{2}$/.test(e),optionType:e=>'CE'===e||'PE'===e,dte:e=>/^\d{1,3}$/.test(e)&&Number(e)>=1&&Number(e)<=400,premium:e=>/^\d{1,6}(\.\d{1,2})?$/.test(e)&&Number(e)>=0&&Number(e)<=1e5,watchlist:e=>/^[a-z][a-z0-9_-]{0,19}$/.test(e),volumeRatio:e=>/^\d{1,3}(\.\d{1,2})?$/.test(e)&&Number(e)>0&&Number(e)<=999,volumeToOi:e=>/^\d{1,3}(\.\d{1,2})?$/.test(e)&&Number(e)>
10770&&Number(e)<=999,oiChange15m:de,oiChangeDay:de,buildup:e=>M.includes(k(e)),moneyness:e=>le.some(t=>t.value===e),market:e=>ce.some(t=>t.value===e)},he={buildup:e=>k(e)};function me(e){const t=Array.isArray(e)?e:[],n=[],r=new Set;for(const e of t){const t=e||{},i=Q(t.column);if(!i||r.has(i.key))continue;const o=t.operator;if(!i.operators.includes(o))continue;const a='string'==typeof t.value?t.value.trim():'';if(a&&fe[i.key](a)&&(r.add(i.key),n.push({column:i.key,operator:o,value:he[i.key]?.(a)??a}),n.length>=Z.length))break}return n}function pe(e,t){const n=new Set((e||[]).map(e=>e.column));return Z.filter(e=>e.key===t||!n.has(e.key))}function ge(e,t){const n=Q(e?.column),r=!t&&n?.unit?` ${n.unit}`:'';return`${ee(e?.column)} ${J[e?.operator]||e?.operator} ${t||e?.value||''}${r}`.trim()}function be(e,t,n){const r=e=>null==e||''===e||'number'==typeof e&&!Number.isFinite(e)?1:0,i=r(e),o=r(t);if(i||o)return i-o;const a='asc'===n?1:-1;if('number'==typeof e&&'number'==typeof t)return(e-t)*a;const u=String(e),s=String(t);return(u<s?-1:u>s?1:0)*a}function _e(e){const t=P(e);if(!t)return'';const[n,r]=t.date.split(' ');return`${n} ${r}`}const ye=4,$e=15,ve=60;function we(e){const t=String(e??'').replace(/T/g,' ').slice(0,19),n=/^(\d{4})-(\d{2})-(\d{2})(?: (\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(t);if(!n)return null;const[r,i,o,a,u,s]=[n[1],n[2],n[3],n[4]??'0',n[5]??'0',n[6]??'0'].map(Number);if(i<1||i>12||o<1||a>23||u>59||s>59)return null;const l=Date.UTC(r,i-1,o);return new Date(l).getUTCDate()!==o?null:l/1e3+3600*a+60*u+s}function Se(e,t=ye,n=t*$e,r=0){const i=e||[],o=i.length;if(!o)return 0;const a=i.map(we);if(a.some(e=>null==e))return Math.max(0,o-1-t);const u=a[o-1]-60*n;let s=null;for(let e=0;e<o&&a[e]<=u;e++)s=e;return null==s?r:s}function Oe(e){const t=we(String(e??'').trim());if(null==t)return!1;const n=(t%86400+86400)%86400,r=Math.floor(n/3600),i=Math.floor(n/60)%60;return n%60==0&&i%15==0&&60*r+i>=570&&60*r+i<=945}function Te(e){const t=e||[],n=t.map((e,t)=>Oe(e)?t:-1).filter(e=>e>=0);if(!n.length)return{anchor:t.map((e,t)=>t),start:0};const r=t.length-1;return{anchor:n[n.length-1]===r?n:[...n,r],start:n[0]}}const Ne=.05,Pe=.05,Ee=1.33,Ie='Not enough readings captured yet \u2014 the first line appears after two readings',xe='No \u0394OI captured for this strike yet',Ae={building:'\u2191 BUILDING',flat:'\u2192 FLAT',unwinding:'\u2193 UNWINDING'},Me='no baseline',Le={'CE|down|building':['Call writing increasing','Call OI rising as premium falls'],'CE|up|unwinding':['Call short covering','Call sellers are exiting'],'CE|up|building':['Call long build-up','Call OI and premium rising together'],'CE|down|unwinding':['Call buyers exiting','Call buyers are closing out'],'CE|flat|building':['New positions added','Premium barely moved'],'CE|flat|unwinding':['Positions closing out','Premium barely moved'],'CE|up|flat':['Premium rose','Open interest barely moved'],'CE|down|flat':['Premium fell','Open interest barely moved'],'CE|flat|flat':['Very little change','Positioning is unchanged'],'PE|down|building':['Put writing increasing','Put OI rising as premium falls'],'PE|up|unwinding':['Put short covering','Put sellers are exiting'],'PE|up|building':['Put long build-up','Put OI and premium rising together'],'PE|down|unwinding':['Put buyers exiting','Put buyers are closing out'],'PE|flat|building':['New positions added','Premium barely moved'],'PE|flat|unwinding':['Positions closing out','Premium barely moved'],'PE|up|flat':['Premium rose','Open interest barely moved'],'PE|down|flat':['Premium fell','Open interest barely moved'],'PE|flat|flat':['Very little change','Positioning is unchanged']},Ce={'up|building':'Premium up, open interest up','down|building':'Premium down, open interest up','up|unwinding':'Premium up, open interest down','down|unwinding':'Premium down, open interest down','flat|building':'Premium flat, open interest up','flat|unwinding':'Premium flat, open interest down','up|flat':'Premium up, open interest flat','down|flat':'Premium down, open interest flat','flat|flat':'Premium flat, open interest flat'},je={'down|building':'Consistent with option writing; who traded is not known','up|building':'Consistent with long build-up; who traded is not known','up|unwinding':'Consistent with short covering; who traded is not known','down|unwinding':'Consistent with holders closing out; who traded is not known'},ke='Very little change',Ue='Positioning is unchanged',Re='Not enough readings yet',De='Both sides building similarly \u2014 no clear directional edge',Fe='Solid line: \u0394OI, on the left scale. Dashed line: the contract\'s own last traded price, on its own scale.';function Be(e){const t=m(e);if(null==t)return u;const n=Math.abs(t),r=t>0?'+':t<0?s:'',i=e=>{const t=e>=100?e.toFixed(0):e.toFixed(1);return t.endsWith('.0')?t.slice(0,-2):t};return n>=1e7?`${r}${i(n/1e7)}Cr`:n>=1e5?`${r}${i(n/1e5)}L`:n>=1e3?`${r}${i(n/1e3)}K`:`${r}${Math.round(n)}`}function Ge(e,t){const n=[];for(const r of e||[]){const e=m(r?.[t]);null!=e&&n.push({v:e,at:r?.at??null})}return n}function Ve(e,t){const n=e.map(e=>
1077e.at),{anchor:r,start:i}=Te(n),o=Se(n,t,t*$e,i);return o===e.length-1?null:{index:o,anchor:r.map(t=>e[t].v)}}function We(e,t=ye,n=Ne){const r=Ge(e,'delta_oi');if(r.length<2)return Me;const i=Ve(r,t);if(!i)return Me;const o=r.map(e=>e.v),a=i.index,u=o[o.length-1]-o[a],s=Math.max(...i.anchor.map(e=>Math.abs(e)));return 0===s||Math.abs(u)<n*s?'flat':u>0?'building':'unwinding'}function He(e,t=ye,n=Pe){const r=Ge(e,'price');if(r.length<2)return Me;const i=Ve(r,t);if(!i)return Me;const o=r.map(e=>e.v),a=i.index,u=o[o.length-1]-o[a],s=i.anchor[0],l=Math.max(...i.anchor.map(e=>Math.abs(e-s)));return 0===l||Math.abs(u)<n*l?'flat':u>0?'up':'down'}function Xe(e,t){const n=We(t),r=He(t),i=String(e||'').toUpperCase();if(r===Me||n===Me)return{price_direction:r,oi_direction:n,what_label:Re,meaning:'',observation:'',attribution:''};const o=Le[`${i}|${r}|${n}`],a=`${r}|${n}`;return{price_direction:r,oi_direction:n,what_label:o?o[0]:Re,meaning:o?o[1]:'',observation:o&&Ce[a]||'',attribution:o&&je[a]||''}}function Ke(e,t=ye){const n=Ge(e,'delta_oi');if(n.length<2)return null;const r=Ve(n,t);return r?n[n.length-1].v-n[r.index].v:null}function Ye(e){if(!e)return'';const t=Xe(e.option_type,e.points),n=[...e.points||[]].reverse().find(e=>null!=m(e?.price));return`${n?`Price ${$(n.price)}.`:'No price captured for this strike yet.'} ${t.what_label}${t.meaning?`. ${t.meaning}`:''}.${t.observation?` ${t.observation}.`:''}${t.attribution?` ${t.attribution}.`:''}`}function qe(e){if(!e)return u;const t=v(e.strike);return t===u?e.label||u:`${t} ${e.option_type}`}function ze(e){return e?e.present?e.marks_with_delta?'':xe:e.missing_text||'This strike is not listed in this expiry.':xe}const Je=[{key:'15m',label:'15-min candles'},{key:'1d',label:'Daily candles'}],Ze='15m',Qe='Choose a symbol in Customize, or click a row in the screener, to see its front futures contract.',et='No candles stored for this futures contract yet',tt='Too few candles stored to read this as a series.',nt='Every candle drawn was stored. A reading with no candle is left blank \u2014 nothing is interpolated and no candle is carried forward.',rt='This panel draws what was stored for the contract named above. Nothing on it says what comes next.',it=3,ot={'15m':'Each candle is one 15-min bar of the front futures contract, oldest on the left.','1d':'Each candle is one session of the front futures contract, oldest on the left.'};function at(e,t){const n=String(e?.tradingsymbol||'').trim()||(String(t||'').trim()?`${String(t).trim()} futures`:'');if(!n)return'Futures chart';const r=P(e?.expiry)?.date||'';return r?`${n} \xb7 ${r}`:n}function ut(e){const t=m(e?.open),n=m(e?.high),r=m(e?.low),i=m(e?.close);return null==t||null==n||null==r||null==i||n<r||n<Math.max(t,i)||r>Math.min(t,i)?null:{o:t,hi:n,lo:r,c:i}}function st(e,t,n){const r=m(t)||0,i=m(n)||0,o=(e||[]).map(e=>ut(e)),a=o.filter(e=>null!=e);if(!a.length||r<=0||i<=0)return null;const u=Math.min(...a.map(e=>e.lo)),s=Math.max(...a.map(e=>e.hi)),l=s-u||Math.abs(s)||1,c=e=>i-(e-u)/l*i,d=o.length?r/o.length:0,f=Math.max(1,Math.min(11,.62*d));return{lo:u,hi:s,step:d,body:f,drawn:a.length,candles:o.map((e,t)=>null==e?null:{i:t,x:d*(t+.5),open:c(e.o),close:c(e.c),high:c(e.hi),low:c(e.lo),direction:e.c>e.o?'up':e.c<e.o?'down':'flat'})}}const lt=3;function ct(e,t=Ze){return'1d'===t?_e(e)||u:E(e)}function dt(e){const t=[];let n='';return(e||[]).forEach((e,r)=>{const i=P(e?.at)?.iso;i&&i!==n&&(n=i,t.push({i:r,iso:i}))}),t}const ft=46;function ht(e,t,n,r=ft){const i=m(n);if(null==i||i<=0||!t)return e;const o=i/t,a=[];for(const t of e){const e=a[a.length-1];(!e||(t.i-e.i)*o>=r)&&a.push(t)}return a}const mt='First in the screener order',pt='Default';function gt(e,t,n,r){const i=String(e||'').trim();if(i)return{symbol:i,defaulted:!1,label:''};const o=String(t||'').trim();if(o)return{symbol:o,defaulted:!0,label:String(r||'').trim()||mt};const a=String(n||'').trim();return a?{symbol:a,defaulted:!0,label:pt}:{symbol:'',defaulted:!1,label:''}}const bt='/api/derivatives/screener';function _t(e){const t=Q(e?.column);if(!t)return null;if(t.noScreener)return null;const n=String(e?.value||'').trim();if(!n)return null;switch(e.column){case'underlying':return{key:'underlying',value:n};case'expiry':return{key:'expiry',value:n};case'optionType':return{key:'option_type',value:'is_not'===e.operator?'CE'===n?'PE':'CE':n};case'dte':return{key:'max_dte',value:String(Math.max(0,Math.round(Number(n))-1))};case'premium':return{key:'min_premium_cr',value:String(Math.round(100*(Number(n)+.01))/100)};case'watchlist':return'all'===n?null:{key:'watchlist',value:n};case'market':return{key:'underlying_kind',value:n};case'volumeRatio':return{key:'min_volume_ratio',value:n};case'volumeToOi':return{key:'min_volume_to_oi',value:n};case'oiChange15m':return{key:'lt'===e.operator?'max_oi_change_15m_pct':'min_oi_change_15m_pct',value:n};case'oiChangeDay':return{key:'lt'===e.operator?'max_oi_change_day_pct':'min_oi_change_day_pct',value:n};case'buildup':{const e=L[k(n)];return e?{key:'buildup',value:e}:null}case'moneyness':return{key:'moneyness',value:n};default:return null}}const yt='The server has not said whether it applied this filter, so it is not shown as active.',$t='The server did not apply this filter, so the rows below are not narrowed by it.',vt='This server has no parameter for this filter, so it was not applied.';
1077function wt(e){const t=(e||[]).filter(Boolean);return t.length?1===t.length?t[0]:`${t.slice(0,-1).join(', ')} and ${t[t.length-1]}`:''}function St(e){if('string'==typeof e)return e;const t=e||{};return'string'==typeof t.key?t.key:''}function Ot(e){return(Array.isArray(e?.available_filters)?e?.available_filters:Array.isArray(e?.filters?.available)?e?.filters?.available:null)||null}function Tt(e){return(Array.isArray(e?.applied)?e?.applied:Array.isArray(e?.filters?.applied)?e?.filters?.applied:null)||null}const Nt='Choose a symbol in Customize, or click any row on this tab, to point every block at it.',Pt={rising:'\u2191 RISING',flat:'\u2192 STABLE',falling:'\u2193 FALLING'},Et={shifting_up:'\u2191 SHIFTING UP',stable:'\u2192 STABLE',shifting_down:'\u2193 SHIFTING DOWN'},It={expanding:'\u2191 EXPANDING',stable:'\u2192 STABLE',cooling:'\u2193 COOLING'},xt={building:'\u2191 BUILDING',flat:'\u2192 FLAT',unwinding:'\u2193 UNWINDING'},At='no baseline';const Mt=4,Lt=.05,Ct=['rising','flat','falling'],jt=['shifting_up','stable','shifting_down'],kt=['expanding','stable','cooling'],Ut=['building','flat','unwinding'];function Rt(e,t,n=Mt,r=Lt,i){const o=(e||[]).map(e=>m(e)).map((e,t)=>({v:e,i:t})).filter(e=>null!=e.v);if(o.length<2)return At;const a=o[o.length-1],u=o.map(e=>i?.[e.i]??null),{anchor:s,start:l}=Te(u),c=Se(u,n,n*$e,l);if(c===o.length-1)return At;const d=o[c],f=a.v-d.v,h=Math.max(...s.map(e=>Math.abs(o[e].v-d.v)),Math.abs(f))||Math.abs(a.v)||1;return Math.abs(f)<=h*r?t[1]:f>0?t[0]:t[2]}const Dt='PCR by open interest',Ft='PCR by volume',Bt='PCR by open interest is put open interest divided by call open interest across every strike of this expiry, at each reading. PCR by volume is the same division over the day\'s volume (\xa73.5).',Gt='Both lines are the ratios as captured. The chip says what the open-interest ratio did over the last hour of readings, and nothing about what it does after that.',Vt='No put-call ratio has been captured for this symbol yet',Wt='Withheld: the chain was too thin at this reading to divide honestly.',Ht='Max pain is the strike where the total payout to option buyers at expiry would be smallest, worked out from the open interest standing at that reading (\xa73.6).',Xt='The second line is the captured spot at the same readings, on the same scale, so the gap between the two is the gap you can see.',Kt='The chip says which way the max-pain strike moved over the last hour of readings. It describes the standing book, and says nothing about where either number goes.',Yt='No max-pain strike has been computed for this symbol yet',qt='Withheld: too few strikes cleared the liquidity floors to compute max pain at this reading.',zt='COMPUTED',Jt='Implied volatility is COMPUTED here, not reported by the exchange: it is what a pricing model returns when it is asked which volatility reproduces the traded price. Every other number on this tab is something the exchange said.',Zt='ATM implied volatility',Qt='The line is the at-the-money implied volatility of this underlying at each reading; the list beside it is the latest solved volatility per strike.',en='The chip says what the at-the-money volatility did over the last hour of readings. It describes what the model solved from captured prices, and nothing after them.',tn='No implied volatility has been computed for this symbol yet',nn='Withheld: the chain was too thin at this reading for an at-the-money volatility.',rn={stale_trade:'No volatility: the last trade in this contract is older than the reading it would be solved at.',no_time_value:'No volatility: at this price the contract has no time value left to solve.',below_intrinsic:'No volatility: the traded price is under the contract\'s intrinsic value, so no volatility reproduces it.',no_convergence:'No volatility: the solver did not settle on an answer for this price.',expiry_today:'No volatility: no time is left before this contract settles.',non_finite_input:'No volatility: an input to the solver was not a finite number.',future_last_trade:'No volatility: the last trade is stamped after this reading, so its price was not known then.'};function on(e,t){const n=String(t||'').trim();if(n)return n;const r=String(e||'').trim();return r?rn[r]||`No volatility: the server gave the reason "${r}".`:''}function an(e){const t=m(e);if(null==t)return u;return`${(Math.abs(t)<=3?100*t:t).toFixed(1)}%`}function un(e){const t=e||[];let n=0,r=0;for(const e of t)null!=m(e?.iv)?n++:String(e?.reason||'').trim()&&r++;return{total:t.length,solved:n,withReason:r}}const sn='Open interest on the front futures contract at each reading, against its own 20-day average, with the basis - the futures price less spot - beside it (\xa73.7).',ln='The chip s
1077ays what open interest on this contract did over the last hour of readings. It describes the standing position and stops there.',cn='No futures readings have been captured for this contract yet',dn='Withheld: this contract did not clear the liquidity floors at this reading.';function fn(e,t,n=!1){const r=m(e),i=m(t);return null==r&&null==i?u:null==r?_(i,2):null==i?V(r,n):`${V(r,n)} (${_(i,2)})`}function hn(e,t){const n=m(e);if(null==n)return f;const r=m(t),i=null==r?null:Math.round(r);return`${n.toFixed(2)}${c} its 20-day average`+(null==i?'':`, from ${i} session${1===i?'':'s'}`)}const mn=11;function pn(e,t,n=3,r=mn){if(!(e&&t>0))return[];const i=e.hi-e.lo||1,o=Math.max(2,Math.round(n)),a=[];for(let n=o-1;n>=0;n--){const u=e.lo+i*(n/(o-1)),s=t-(u-e.lo)/i*t;a.some(e=>Math.abs(e.y-s)<r)||(a.some(e=>e.v===u)||a.push({v:u,y:s}))}return a}function gn(e){const t=m(e?.total_readings),n=m(e?.readings_with_value);return null==t||null==n?'':`${Math.round(n)} of ${Math.round(t)} reading${1===Math.round(t)?'':'s'} carried a value`}function bn(e){const t=e?.withheld_reasons||{},n=e?.reason_text||{};return Object.entries(t).filter(([,e])=>null!=m(e)&&Number(e)>0).sort((e,t)=>Number(t[1])-Number(e[1])).map(([e,t])=>`${Math.round(Number(t))} reading${1===Math.round(Number(t))?'':'s'}: ${n[e]||e}`)}function _n(e){const t=m(e);return null==t?u:0===t?'strike at spot':`strike ${v(Math.abs(t))} ${t>0?'above':'below'} spot`}function yn(e){const t=m(e?.risk_free_rate);return null==t?'':`${(Math.abs(t)<=1?100*t:t).toFixed(2)}% a year`}function $n(e,t){const n=String(e?.reason_text||'').trim();if(n)return n;const r=String(e?.reason||'').trim();return r?String(t?.[r]||'').trim()||rn[r]||`No volatility: the server gave the reason "${r}".`:''}const vn='no spot was captured at this reading, so there is no basis',wn='A basis needs a futures price and a spot at the same reading.';function Sn(e){return U(e)}function On(e){if(!e)return'';const t=m(e.scanned),n=m(e.total),r=m(e.returned);if(null==t&&null==n)return'';const i=m(e.coverage?.underlyings),o=null==i?'':` across ${Math.round(i)} underlying${1===Math.round(i)?'':'s'}`,a=null==n?'':`${Math.round(n)} cleared the floors and the applied filters`,u=null!=r&&null!=n&&r<n?`, and this list carries ${Math.round(r)} of them`:'';return(null==t?'':`${Math.round(t).toLocaleString('en-IN')} row${1===Math.round(t)?'':'s'} at this reading${o}`)+`${null!=t&&a?'; ':''}${a}${u}.`}const Tn=84;function Nn(e){const t=P(e);return t?t.time?`${t.date} \xb7 ${t.time}`:t.date:''}const Pn=[{value:'underlying',label:'Instruments'},{value:'contract',label:'Contracts'}],En='underlying';function In(e){const t=m(e?.contracts);if(null==t)return u;const n=xn(e);return`${Math.round(t)} contract${1===Math.round(t)?'':'s'}`+(n?` \xb7 ${n}`:'')}function xn(e){const t=m(e?.calls)??0,n=m(e?.puts)??0,r=m(e?.options)??t+n,i=m(e?.futures)??0,o=i?`${Math.round(i)}F`:'';return r?[`${Math.round(t)}C / ${Math.round(n)}P`,o].filter(Boolean).join(' \xb7 '):o?`futures only \xb7 ${o}`:''}function An(e){const t=m(e?.volume_ratio_max);return null==t?f:`${t.toFixed(t>=100?0:1)}${c}`}function Mn(e){const t=m(e?.volume_ratio_max),n=m(e?.volume_baseline_contracts)??0,r=m(e?.contracts)??0,i=`${Math.round(n)} of ${Math.round(r)} carried a baseline`;if(null==t)return`No contract of this instrument has ${Ln}, so there is no ratio to show \u2014 ${i}. It is not computed for futures at all.`;const o=String(e?.volume_ratio_max_symbol||'').trim();return`Highest on one contract: ${An(e)}${o?` on ${o}`:''}. This is that contract's own reading, not an average \u2014 ${i}.`}const Ln='the three sessions of history \xa73.2 requires';function Cn(e){const t=m(e?.volume_to_oi_contracts)??0;if(!t)return'Volume against open interest (\xa73.3) is not computed for a futures contract, and no option of this instrument cleared the floors, so there is nothing to count.';const n=m(e?.volume_to_oi_over_1)??0;return`${Math.round(n)} of the ${Math.round(t)} contracts that carry the ratio traded more today than was standing at the previous close (\xa73.3). It is not computed for futures.`}function jn(e){const t=e?.buildup_counts||{},n={};for(const[e,r]of Object.entries(t)){const t=m(r);if(null==t||t<=0)continue;const i=k(e);n[i]=(n[i]||0)+t}const r=[...M,'unknown'].filter(e=>(n[e]||0)>0).map(e=>`${'unknown'===e?C:R(e)} ${n[e]}`);return r.length?r.join(' \xb7 '):''}const kn='Each row aggregates the SAME ten at-the-money contracts the \u
10770394OI tiles draw \u2014 the five calls at and above the money and the five puts at and below it \u2014 and no others. It is not the whole chain, and the ten are the ten at the LATEST reading: the same basket is carried back over the earlier rows, so an earlier row is not a record of which strikes were at the money at that time.',Un='A side is compared with itself an hour earlier \u2014 the latest reading at least 60 minutes before this one, found by the reading times themselves and never by counting four rows back, because four rows is not an hour when a reading is missing. Only the contracts that carried a value at BOTH readings are in the comparison, and the row says how many did. A reading with less than an hour of session behind it, or with no contract in common with the reading an hour back, has no direction at all and says which.',Rn='This is the conventional reading of option positioning at each reading, not a prediction: every opened contract has a buyer and a seller, the tape does not say which side was the aggressor, and this describes where open interest sits rather than what the price does next.',Dn='Each side is read on its price AND its open interest together, and only where both moved: a side whose premium barely moved, or whose open interest barely moved, carries no reading of its own. Open interest alone never decides a row. The Premiums column then says what the premiums of the sides that read did \u2014 both sides named when both read (for example "Call premium up, put premium down", or "Call and put premiums both up" when the two sides read OPPOSITE ways, which stays on screen as it is), one side named when only one reads, and "No paired premium + OI move" when neither does. It describes this reading and nothing about what the price does next. Rule signal/2: signal/1 chose the word from open interest alone and measured every row against the whole session, including readings taken after it.',Fn='No contract carried a value at this reading',Bn='no baseline',Gn='Less than an hour of readings stands behind this one',Vn='not yet ranked',Wn=[.3333333333333333,.6666666666666666],Hn='Strength is a size, not a confidence and not a chance of anything: it says how big this side\'s change is beside the changes that same side had already made, and nothing else. It is measured against that instrument\'s own session AS IT STOOD AT THIS READING \u2014 never a fixed number of contracts and never a reading taken later, so a row cannot be rewritten by what arrives after it. Under 5% of that largest change is stable \u2014 the same 5% band the \u0394OI tiles use \u2014 and the rest is split into equal thirds, which is Mild, Strong and Very strong. Until three measured changes stand behind the ladder the row says the strength is not yet ranked.',Xn=['Mild','Strong','Very strong'],Kn=Xn.length,Yn=['\u2191','\u2191\u2191','\u2191\u2191\u2191'],qn=['\u2193','\u2193\u2193','\u2193\u2193\u2193'],zn='Stable',Jn={strong_bullish:'Call premium up, put premium down',bullish:'One side read: call premium up or put premium down',neutral:'Call and put premiums moved the same way',flat:'No paired premium + OI move',bearish:'One side read: call premium down or put premium up',strong_bearish:'Call premium down, put premium up'},Zn={strong_bullish:'',bullish:'',neutral:'',flat:'',bearish:'',strong_bearish:''},Qn=(e,t)=>t?`${e} premium ${'Call'===e?'up'===t?'up':'down':'up'===t?'down':'up'}`:'';function er(e,t,n){if(!e)return u;const r=t?.lean||'',i=n?.lean||'';if(r&&i&&r!==i)return"Call and put premiums both "+('up'===r?'up':'down');const o=Qn('Call',r),a=Qn('Put',i);return o&&a?`${o}, ${a.charAt(0).toLowerCase()}${a.slice(1)}`:o||a||Jn[e]||u}const tr={'building|building':'Both sides adding positions','building|unwinding':'Call OI rising + put OI falling','unwinding|building':'Call OI falling + put OI rising','unwinding|unwinding':'Both sides reducing positions','building|flat':'Call OI rising; put OI little changed','flat|building':'Put OI rising; call OI little changed','unwinding|flat':'Call OI falling; put OI little changed','flat|unwinding':'Put OI falling; call OI little changed','flat|flat':'No meaningful new positioning'},nr='Both adding; more call OI than put OI',rr='Both adding; more put OI than call OI',ir=De,or=60,ar=120,ur='signal/2';function sr(e){const t=/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})/.exec(String(e||'').trim());if(!t)return null;const n=Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isFinite(n)?n/6e4+60*Number(t[4])+Number(t[5]):null}
1077function lr(e,t,n=or,r=ar){const i=sr(e?.[t]);if(null==i)return null;for(let o=t-1;o>=0;o--){const t=sr(e[o]);if(null==t)continue;const a=i-t;if(!(a<n))return a<=r?o:null}return null}const cr=15;const dr={'CE|up|building':'up','CE|up|unwinding':'up','CE|down|building':'down','CE|down|unwinding':'down','CE|flat|building':'','CE|flat|unwinding':'','CE|up|flat':'','CE|down|flat':'','CE|flat|flat':'','PE|up|building':'down','PE|up|unwinding':'down','PE|down|building':'up','PE|down|unwinding':'up','PE|flat|building':'','PE|flat|unwinding':'','PE|up|flat':'','PE|down|flat':'','PE|flat|flat':''},fr=(e,t,n)=>dr[`${String(e||'').toUpperCase()}|${String(t||'')}|${String(n||'')}`]||'';function hr(e,t,n,r){let i=0,o=0,a=0;for(const u of e){const e=m(u?.points?.[t]?.[r]),s=m(u?.points?.[n]?.[r]);null!=e&&null!=s&&(i+=e,o+=s,a++)}return a?{change:i-o,contracts:a}:{change:null,contracts:0}}function mr(e,t,n,r,i,o,a=0,u=Ne){if(null==n)return null;const s=hr(e,t,n,'delta_oi');if(null==s.change)return null;const l=hr(e,t,n,'price'),c=i>0&&Math.abs(s.change)<u*i,d=i<=0||c?'flat':s.change>0?'building':'unwinding',f=null==l.change?Me:o<=0||Math.abs(l.change)<Pe*o?'flat':l.change>0?'up':'down',h=Le[`${r}|${f}|${d}`],m=i>0?Math.min(1,Math.abs(s.change)/i):0,p=a>=Kn,g=p&&!c&&i?m<Wn[0]?1:m<Wn[1]?2:3:0,b=g?('building'===d?Yn:qn)[g-1]:'',_=g?Xn[g-1]:p?zn:Vn;return{contracts:s.contracts,change:s.change,price_change:l.change,oi_direction:d,price_direction:f,strength:g,lean:fr(r,f,d),ranked:a,what_label:h?h[0]:Re,meaning:h?h[1]:'',text:`${_}${b?' '+b:''}`}}function pr(e,t,n=Ee){if(!e||!t)return'';const r=`${e.oi_direction}|${t.oi_direction}`;if('building|building'===r){const i=Math.abs(e.change||0),o=Math.abs(t.change||0);return i&&o?i>n*o?nr:o>n*i?rr:ir:tr[r]||''}return tr[r]||''}function gr(e,t){if(!e||!t)return'';const n=e.lean,r=t.lean;if(n&&r&&n!==r)return'neutral';const i=n||r;if(!i)return'flat';const o=!(!n||!r);return'up'===i?o?'strong_bullish':'bullish':o?'strong_bearish':'bearish'}const br=[{rule_id:'vol_tod_median',label:'Volume vs its own median',short_label:'Vol vs median',measure:'cumulative volume so far today',baseline_label:"the median of this contract's own cumulative volume at the same clock time",sample_label:'session',comparator:'>=',threshold:2,pattern:/^volume\s+([0-9.]+)x its own time-of-day median$/i},{rule_id:'day_vol_vs_prev_oi',label:'Day volume vs previous-close OI',short_label:'Day vol vs prev OI',measure:"the day's volume",baseline_label:'the open interest standing at the previous close',sample_label:'prior session',comparator:'>',threshold:1,pattern:/^day volume\s+([0-9.]+)x yesterday's OI$/i}],_r='unclassified',yr='Condition this build does not name',$r='Unnamed condition',vr=br.length,wr='A row is flagged when the store flagged one of its contracts under \xa73. The flag is the store\'s own, not a score this tab invents, and the word beside the colour says which conditions were tripped and by how many contracts.',Sr='Three numbers, and they are not the same number. CONDITIONS is how many DISTINCT rules the name\'s contracts tripped between them \u2014 two rules exist, \xa73.2 and \xa73.3, so it is 1 or 2. CONTRACTS is how many of its contracts were flagged. OBSERVATIONS is how many times a rule fired across them. The same rule at twenty different multiples is ONE condition and twenty observations.',Or='Each condition is a rule with a version, a comparator, a threshold and a baseline \u2014 not a sentence. The badge names the rule and how many contracts tripped it; the evidence drawer lists those contracts with the value, the threshold it was compared against, the baseline it was measured against and how many observations that baseline stands on.',Tr='The list opens with the unusual first \u2014 most distinct conditions, then most contracts flagged, then largest premium traded, then instrument name A to Z so a tie comes out in the same order every time. Every column still sorts on its own header, and a sort re-orders these rows without re-querying them.',Nr='Colour never carries the flag on its own: the word and the counts are printed on the row beside it, the conditions are named as badges under them, and the contracts behind them are in the evidence drawer.',Pr='The \xa73.2 figure a flag can rest on is the LARGEST reading among this name\'s contracts, with that contract named - never an average of its contracts.',Er='Evidence',Ir='This reading\'s response carried the rule totals for this instrument but not the contracts behind them.',xr='Nothing flagged',Ar='Not measured',Mr='\xa73.2 and \xa73.3 are not computed for a futures contract. An instrument whose whole book over the floors is futures therefore reads "Not measured", never "Nothing flagged" \u2014 a name nothing was measured on is not a name nothing was found on.';function Lr(e){return(m(e?.volume_to_oi_contracts)||0)>0||(m(e?.volume_baseline_contracts)||0)>0||(m(e?.options)||0)>0}function Cr(e){const t=br.find(t=>t.rule_id===String(e||''));return t?{label:t.label,short_label:t.short_label,measure:t.measure,baseline_label:t.baseline_label,sample_label:t.sample_label,comparator:t.comparator,threshold:t.threshold,unit:'x'}:{label:yr,short_label:$r,measure:null,baseline_label:null,sample_label:null,comparator:null,threshold:null,unit:null}}function jr(e){const t=String(e||'').trim();for(const e of br)if(e.pattern.test(t))return e.rule_id;return t?_r:''}function kr(e){const t=e?.unusual_rules;if(Array.isArray(t))return t.filter(e=>e&&e.rule_id).map(e=>({...Cr(e.rule_id),...Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&''!==e))}));const n=e?.unusual_reasons;
1077if(!n||'object'!=typeof n)return[];const r=br.map(e=>e.rule_id),i=new Map;for(const e of Object.keys(n)){const t=jr(e);if(!t)continue;let r=i.get(t);r||(r={rule_id:t,...Cr(t),contracts:null,observations:0},i.set(t,r)),r.observations+=m(n[e])||0}return[...i.values()].sort((e,t)=>{const n=r.indexOf(e.rule_id),i=r.indexOf(t.rule_id);return(n<0?r.length:n)-(i<0?r.length:i)||e.rule_id.localeCompare(t.rule_id)})}function Ur(e){if(!e)return 0;if((m(e.unusual)||0)<=0)return 0;const t=m(e.unusual_rule_count),n=null!=t?t:kr(e).length;return Math.max(0,Math.round(n))}function Rr(e){return m(e?.unusual)||0}function Dr(e){const t=m(e?.unusual_observations);return null!=t?Math.max(0,Math.round(t)):kr(e).reduce((e,t)=>e+(m(t.observations)||0),0)}function Fr(e){return e?(m(e.unusual)||0)<=0?0:Math.max(1,Math.min(vr,Ur(e))):0}function Br(e){if(!Fr(e))return'';const t=Ur(e),n=Rr(e);return`Unusual \xb7 ${[t>0?`${t} condition${1===t?'':'s'}`:'',`${n} contract${1===n?'':'s'}`].filter(Boolean).join(' \xb7 ')}`}function Gr(e){return Fr(e)?Br(e):Lr(e)?xr:Ar}function Vr(e,t=!1){if(!e)return'';const n=(t?e.short_label:'')||e.label||(t?$r:yr),r=m(e.contracts);if(null!=r)return`${n} \xb7 ${Math.round(r)}`;const i=m(e.observations);return null!=i?`${n} \xb7 ${Math.round(i)} seen`:n}function Wr(e){if(!Fr(e))return'';const t=kr(e).map(e=>Vr(e,!0)).filter(Boolean);return t.length?t.join(' \xb7 '):'the store named no condition'}const Hr='Typing a name narrows the instruments this reading returned. It does not re-query: the as-of, the floors and the applied filters above still describe exactly these rows.',Xr='No instrument in this reading matches that name. A name whose contracts did not clear the liquidity floors is not in this list to be found.';function Kr(e,t){const n=String(t||'').trim().toUpperCase().replace(/\s+/g,'');return!n||String(e||'').toUpperCase().replace(/\s+/g,'').includes(n)}function Yr(e){const t=e?.top;if(!t)return'';const n=String(t.instrument_type||'').toUpperCase();return`Busiest contract ${String(t.tradingsymbol||'').trim()||`${v(t.strike)} ${n}`} at ${p(t.premium_cr)}`}function qr(e,t){const n=String(e||'').trim();if(!n||n===String(t||'').trim())return'';const r=E(n);return r===u?'':r}const zr=3;const Jr='The chain opens at the money: the tinted row is the strike nearest the captured spot at this reading. Every strike of the expiry is still listed above and below it.',Zr='No spot was captured for this underlying at this reading, so the chain cannot say which strike is at the money. It opens at the lowest strike listed.';function Qr(e){return e>0?'+':e<0?s:''}function ei(e,t){const n=String(e?.previous_close_reason||'').trim(),r=String(t||'').trim();return(r?String(e?.delta_reason_text?.[r]||'').trim():'')||n||''}},984,[]); 1078__d(function(g,_r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.useAlertNotifications=x,_e.AlertsPanel=function({strategyId:e,analysis:s,deployments:l,expiry:y,onChanged:x}){const[w,v]=(0,t.useState)(null),[C,S]=(0,t.useState)(''),[_,k]=(0,t.useState)('price_cross'),[T,$]=(0,t.useState)('strategy'),[z,P]=(0,t.useState)({}),[R,A]=(0,t.useState)(!1),[I,W]=(0,t.useState)(''),M=l.filter(e=>!['closed','cancelled'].includes(e.status)),[N,E]=(0,t.useState)(''),B=(0,t.useCallback)(()=>d.alerts.forStrategy(e).then(e=>{v(e),E('')}).catch(e=>E(f(e))),[e]);(0,t.useEffect)(()=>{B();const e=setInterval(B,15e3);return()=>clearInterval(e)},[B]);const L=s?.spot;(0,t.useEffect)(()=>{const e=L?String(50*Math.round(L/50)+('below'===z.direction?-100:100)):'';P(t=>({level:t.level||e,direction:t.direction||'above',points:t.points||'50',amount:t.amount||String(Math.max(500,100*Math.round(.5*Math.abs(s?.capital_at_risk?.value||2e3)/100))),loss:t.loss||'loss',units:t.units||'50',at:t.at||(y?`${y} 13:30`:'')}))},[L,y]);const F=h.filter(e=>e[2].includes('strategy'===T?'strategy':'deployment'));(0,t.useEffect)(()=>{F.find(e=>e[0]===_)||k(F[0][0])},[T]);const D=()=>({price_cross:{level:Number(z.level),direction:z.direction},breakeven_near:{points:Number(z.points)},pnl:{amount:Number(z.amount),direction:z.loss},delta:{units:Number(z.units)},short_itm:{},expiry_time:{at:z.at}}[_]);async function O(t=_,s=D(),r=('strategy'===T?null:T)){A(!0),S(''),W('');try{const n=await d.alerts.create(e,{type:t,params:s,deployment_id:r,channels:['in_app','browser']});W(n.now?.evaluated?`Created. Right now: ${n.now.message}.`:`Created. ${n.now?.reason||'It is evaluated during market hours.'}`),B(),x?.()}catch(e){S(f(e))}finally{A(!1)}}async function Y(t){const r=[['breakeven_near',{points:50}],['pnl',{amount:Math.max(500,100*Math.round(.5*Math.abs(s?.capital_at_risk?.value||2e3)/100)),direction:'loss'}],['short_itm',{}],['expiry_time',{at:`${y} 13:30`}]],n=[];S(''),W('');for(const[s,l]of r)try{await d.alerts.create(e,{type:s,params:l,deployment_id:t.id,channels:['in_app','browser']})}catch(e){n.push(`${s.replace('_',' ')}: ${f(e)}`)}n.length?S(`${r.length-n.length} of ${r.length} suggested alerts added. Not added - ${n.join('; ')}`):W(`All ${r.length} suggested alerts added for this deployment.`),B()}const H=(e,t,s=110)=>(0,p.jsxs)(n.default,{style:{gap:3},children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:t}),(0,p.jsx)(r.default,{value:z[e]||'',onChangeText:t=>P(s=>({...s,[e]:t})),accessibilityLabel:t,style:{width:s,height:32,borderWidth:1,borderColor:o.C.line,borderRadius:8,paddingHorizontal:8,color:o.C.ink,fontFamily:'Inter',fontSize:12}})]});return w?(0,p.jsxs)(n.default,{style:{gap:14},children:[!!N&&(0,p.jsx)(u.ErrorRetry,{what:"The latest alert state",error:N,onRetry:B}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Alerts notify only - they never place, change or cancel an order. They fire once when the condition becomes true, re-arm after it clears, and never fire on missing data."}),(0,p.jsxs)(n.default,{style:{backgroundColor:o.C.bg,borderWidth:1,borderColor:o.C.line,borderRadius:10,padding:12,gap:10},children:[(0,p.jsxs)(n.default,{style:[o.s.row,{flexWrap:'wrap',gap:6}],children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Watch"}),(0,p.jsx)(o.Chip,{label:"This strategy's draft",active:'strategy'===T,onPress:()=>$('strategy')}),M.map(e=>(0,p.jsx)(o.Chip,{label:`Paper deployment \xb7 ${e.status}`,active:T===e.id,onPress:()=>$(e.id)},e.id))]}),(0,p.jsx)(n.default,{style:[o.s.row,{flexWrap:'wrap',gap:6}],children:F.map(([e,t])=>(0,p.jsx)(o.Chip,{label:t,active:_===e,onPress:()=>k(e)},e))}),(0,p.jsxs)(n.default,{style:[o.s.row,{flexWrap:'wrap',gap:10,alignItems:'flex-end'}],children:['price_cross'===_&&(0,p.jsxs)(p.Fragment,{children:[H('level','Level'),(0,p.jsx)(n.default,{style:[o.s.row,{gap:6}],children:['above','below'].map(e=>(0,p.jsx)(o.Chip,{label:'above'===e?'Rises above':'Falls below',active:z.direction===e,onPress:()=>P(t=>({...t,direction:e}))},e))})]}),'breakeven_near'===_&&H('points','Within points'),'pnl'===_&&(0,p.jsxs)(p.Fragment,{children:[H('amount','Amount \u20b9'),(0,p.jsx)(n.default,{style:[o.s.row,{gap:6}],children:['loss','profit'].map(e=>(0,p.jsx)(o.Chip,{label:'loss'===e?'Loss of':'Profit of',active:z.loss===e,onPress:()=>P(t=>({...t,loss:e}))},e))})]}),'delta'===_&&H('units','|Delta| units'),'expiry_time'===_&&H('at','At (IST, YYYY-MM-DD HH:MM)',170),'short_itm'===_&&(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Fires when the underlying moves past any short strike."}),(0,p.jsx)(o.Button,{label:"Create alert",icon:"bell",loading:R,onPress:()=>O()})]}),null!=L&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`${s?.quality?.live?`Live at ${(0,c.istStamp)(s?.as_of)}`:`Stored reading from ${(0,c.istStamp)(s?.as_of)} (not live)`}: spot ${(0,c.num)(L,2)}${s?.breakevens?.value?.length?` \xb7 breakevens ${s.breakevens.value.map(e=>(0,c.num)(e,0)).join(' / ')}`:''}${null!=s?.greeks?.delta?` \xb7 delta ${(0,c.num)(s.greeks.delta,1)}`:''}`}),M.map(e=>(0,p.jsx)(o.Button,{label:"Add suggested alerts for the paper deployment",kind:"outline",icon:"zap",onPress:()=>Y(e)},e.id)),!!I&&(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.green},children:I}),!!C&&(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.red},children:C})]}),(0,p.jsx)(b,{rules:w.rules,onChanged:B}),(0,p.jsx)(j,{events:w.events,onChanged:B})]}):N?(0,p.jsx)(u.ErrorRetry,{what:"Alerts",error:N,onRetry:B}):(0,p.jsx)(o.Loading,{})},_e.RuleList=b,_e.EventList=j,_e.AlertsCenter=function(){const[e,s]=(0,t.useState)(null),[r,c]=(0,t.useState)(''),h=x(),y=(0,t.useCallback)(()=>d.alerts.all().then(e=>{s(e),c('')}).catch(e=>c(f(e))),[]);return(0,t.useEffect)(()=>{y();const e=setInterval(y,15e3);return()=>clearInterval(e)},[y]),(0,p.jsxs)(n.default,{style:{padding:20,gap:16,maxWidth:1100,width:'100%',alignSelf:'center'},children:[(0,p.jsx)(n.default,{style:[o.s.row,{gap:8}],children:(0,p.jsx)(o.Button,{label:"My Strategies",icon:"chevron-left",kind:"outline",onPress:()=>l.router.replace('/strategies')})}),(0,p.jsxs)(n.default,{style:{gap:4},children:[(0,p.jsx)(o.T,{style:{fontFamily:'ManropeBold',fontSize:22},children:"Alerts"}),(0,p.jsx)(o.T,{style:{fontSize:13,color:o.C.muted},children:e?.boundary||''})]}),'default'===h.perm&&(0,p.jsxs)(n.default,{style:[o.s.row,{gap:10,flexWrap:'wrap'}],children:[(0,p.jsx)(o.Button,{label:"Enable browser notifications",icon:"bell",kind:"outline",onPress:h.enable}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Shown only while a KANIDA tab is open."})]}),'denied'===h.perm&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Browser notifications are blocked for this site in your browser settings; alerts still appear here."}),!!r&&(0,p.jsx)(u.ErrorRetry,{what:"Alerts",error:r,onRetry:y}),e?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n.default,{style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:12,padding:14,gap:10},children:(0,p.jsx)(j,{events:e.events,onChanged:y,showStrategy:!0})}),(0,p.jsxs)(n.default,{style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:12,padding:14,gap:10},children:[(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi'},children:"Rules"}),e.rules.length?(0,p.jsx)(b,{rules:e.rules,onChanged:y,showStrategy:!0}):(0,p.jsx)(o.Empty,{icon:"bell",title:"No alerts yet",detail:"Open a strategy and use its Alerts tab. A paper deployment can get suggested alerts in one click."})]})]}):r?null:(0,p.jsx)(o.Loading,{})]})};var t=_r(_d[0]);_r(_d[1]);var s=e(_r(_d[2])),r=e(_r(_d[3])),n=e(_r(_d[4])),l=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),p=_r(_d[10]);const h=[['price_cross','Underlying crosses a level',['strategy','deployment']],['breakeven_near','Spot near a breakeven',['strategy','deployment']],['pnl','Position P&L threshold',['deployment']],['delta','Net delta limit',['strategy','deployment']],['short_itm','A short leg goes in the money',['strategy','deployment']],['expiry_time','Reminder at a time',['strategy','deployment']]],y=e=>'triggered'===e?'red':'armed'===e?'green':'data_unavailable'===e?'amber':'neutral',f=e=>e?.message||'KANIDA could not complete that.';function x(){const e=(0,t.useRef)(null),[s,r]=(0,t.useState)(0),[n,l]=(0,t.useState)('undefined'!=typeof Notification?Notification.permission:'unsupported');(0,t.useEffect)(()=>{let t=!0;const s=()=>d.alerts.unacked().then(s=>{if(!t)return;r(s.unacked);const l=new Set(s.latest.map(e=>e.id));if(e.current&&'granted'===n)for(const t of s.latest)if(!e.current.has(t.id)&&'triggered'===t.kind)try{new Notification('KANIDA alert',{body:t.message,tag:t.id})}catch{}
1078e.current=new Set([...e.current||[],...l])}).catch(()=>{});s();const l=setInterval(s,15e3);return()=>{t=!1,clearInterval(l)}},[n]);return{count:s,perm:n,enable:async()=>{'undefined'!=typeof Notification&&l(await Notification.requestPermission())}}}function b({rules:e,onChanged:r,showStrategy:l}){const[u,h]=(0,t.useState)({}),[x,b]=(0,t.useState)({}),[j,w]=(0,t.useState)(null),v=async(e,t,s)=>{b(t=>{const s={...t};return delete s[e.id],s});try{await t(),r()}catch(r){b(n=>({...n,[e.id]:{text:`${s} failed: ${f(r)}`,retry:()=>v(e,t,s)}}))}};return e.length?(0,p.jsx)(n.default,{style:{gap:8},children:e.map(e=>(0,p.jsxs)(n.default,{style:[o.s.between,{flexWrap:'wrap',gap:8,borderTopWidth:1,borderColor:o.C.line,paddingTop:8}],children:[(0,p.jsxs)(n.default,{style:{flex:1,minWidth:240,gap:3},children:[(0,p.jsxs)(n.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,p.jsx)(o.Badge,{label:e.state.replace('_',' ').toUpperCase(),tone:y(e.state)}),(0,p.jsx)(o.T,{style:{fontSize:13,fontFamily:'InterSemi'},children:e.description})]}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`${l&&e.strategy_name?e.strategy_name+' \xb7 ':''}${'deployment'===e.scope?'Paper deployment':'Research draft'} \xb7 ${'market'===e.session?'market hours':'always'} \xb7 cooldown ${Math.round(e.cooldown/60)}m \xb7 last checked ${e.last_eval_at?e.last_eval_at.slice(11,19)+' IST':'\u2014'}`}),'data_unavailable'===e.state&&!!e.suppressed&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.amber},children:`Suppressed: ${e.suppressed}.${null!=e.last_value?` Last valid value ${(0,c.num)(e.last_value,2)}.`:''} It will not fire on stale data.`}),!!u[e.id]&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.mint},children:u[e.id]}),!!x[e.id]&&(0,p.jsxs)(n.default,{style:[o.s.row,{gap:8}],children:[(0,p.jsx)(o.T,{accessibilityRole:"alert",style:{fontSize:11,color:o.C.red,flex:1},children:x[e.id].text}),(0,p.jsx)(o.Button,{label:"Retry",kind:"outline",onPress:x[e.id].retry})]}),j===e.id&&(0,p.jsxs)(n.default,{style:{gap:6,paddingTop:4},children:[(0,p.jsxs)(n.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Cooldown"}),[[300,'5 min'],[900,'15 min'],[3600,'1 hour'],[14400,'4 hours']].map(([t,s])=>(0,p.jsx)(o.Chip,{label:String(s),active:e.cooldown===t,onPress:()=>v(e,()=>d.alerts.update(e.id,{version:e.version,cooldown:t}),'Changing the cooldown')},t))]}),'expiry_time'!==e.type&&(0,p.jsxs)(n.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"When"}),[['market','Market hours'],['always','Always']].map(([t,s])=>(0,p.jsx)(o.Chip,{label:s,active:e.session===t,onPress:()=>v(e,()=>d.alerts.update(e.id,{version:e.version,session:t}),'Changing when it runs')},t))]}),(0,p.jsxs)(n.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Notify"}),(0,p.jsx)(o.Chip,{label:"In app",active:!0}),(0,p.jsx)(o.Chip,{label:"Browser (tab open)",active:!!e.channels?.includes('browser'),onPress:()=>v(e,()=>d.alerts.update(e.id,{version:e.version,channels:e.channels?.includes('browser')?['in_app']:['in_app','browser']}),'Changing notifications')})]}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Closed-tab push, e-mail and SMS are not available in this release."})]})]}),(0,p.jsxs)(n.default,{style:[o.s.row,{gap:6}],children:[(0,p.jsx)(o.Button,{label:"Check now",kind:"outline",onPress:async()=>{try{const t=await d.alerts.check(e.id);h(s=>({...s,[e.id]:t.evaluated?`${t.message}${t.condition?' - condition TRUE':''}`:t.reason}))}catch(t){h(s=>({...s,[e.id]:f(t)}))}}}),(0,p.jsx)(o.Button,{label:"Settings",kind:"outline",accessibilityState:{expanded:j===e.id},onPress:()=>w(j===e.id?null:e.id)}),(0,p.jsx)(o.Button,{label:'paused'===e.state?'Resume':'Pause',kind:"outline",onPress:()=>v(e,()=>d.alerts.update(e.id,{version:e.version,action:'paused'===e.state?'resume':'pause'}),'paused'===e.state?'Resume':'Pause')}),(0,p.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:`Delete alert: ${e.description}`,onPress:()=>v(e,()=>d.alerts.remove(e.id),'Delete'),style:{padding:12},children:(0,p.jsx)(o.Icon,{name:"trash-2",size:16,color:o.C.muted})})]})]},e.id))}):(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"No alert rules yet."})}function j({events:e,onChanged:r,showStrategy:c}){const[h,y]=(0,t.useState)('');if(!e.length)return(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"No alert events yet."});const x=e.filter(e=>!e.acked_at).length;return(0,p.jsxs)(n.default,{style:{gap:6},children:[(0,p.jsxs)(n.default,{style:o.s.between,children:[(0,p.jsx)(o.T,{style:{fontFamily:'InterMedium',fontSize:11,letterSpacing:.6,textTransform:'uppercase',color:o.C.muted},children:`Events \xb7 ${x} to acknowledge`}),x>0&&(0,p.jsx)(o.Button,{label:"Acknowledge all",kind:"outline",onPress:async()=>{try{await d.alerts.ack(),y('')}catch(e){y(f(e))}r()}})]}),!!h&&(0,p.jsx)(u.ErrorRetry,{what:"Acknowledging",error:h,onRetry:r}),e.map(e=>(0,p.jsxs)(n.default,{style:[o.s.row,{gap:8,alignItems:'flex-start',opacity:e.acked_at?.55:1,borderTopWidth:1,borderColor:o.C.line,paddingTop:6}],children:[(0,p.jsx)(o.Icon,{name:'triggered'===e.kind?'bell':'data_unavailable'===e.kind?'wifi-off'
1078:'rotate-ccw',size:14,color:'triggered'===e.kind?o.C.red:'data_unavailable'===e.kind?o.C.amber:o.C.muted}),(0,p.jsxs)(n.default,{style:{flex:1,gap:2},children:[(0,p.jsx)(o.T,{style:{fontSize:12},children:e.message}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`${c&&e.strategy_name?e.strategy_name+' \xb7 ':''}${e.occurred_at.slice(0,16)} IST \xb7 ${e.kind.replace('_',' ')}`})]}),e.link?(0,p.jsx)(s.default,{accessibilityRole:"link",accessibilityLabel:"Open the screen",onPress:()=>l.router.push(e.link),children:(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.green},children:"Open screen"})}):(0,p.jsxs)(p.Fragment,{children:[c&&(0,p.jsx)(s.default,{onPress:()=>l.router.push({pathname:'/strategies',params:{id:e.strategy_id}}),children:(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.green},children:"Open"})}),(0,p.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Adjust this strategy",onPress:()=>l.router.push({pathname:'/strategies',params:{id:e.strategy_id,open:'adjust'}}),children:(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.green},children:"Adjust"})})]}),!e.acked_at&&(0,p.jsx)(s.default,{accessibilityRole:"button",onPress:async()=>{try{await d.alerts.ack(e.id),y('')}catch(e){y(f(e))}r()},children:(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.green},children:"Acknowledge"})})]},e.id))]})}},985,[11,136,375,385,13,252,821,976,979,980,6]); 1079__d(function(g,_r,i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.dayText=n,_e.clockText=s,_e.openText=r,_e.reopenText=o,_e.isKiteMark=a,_e.liveAllowed=l,_e.pricesText=c,_e.hasReading=u,_e.asOfReading=function(e,t){return!1===t||!e||e.length<10?null:{session_date:e.slice(0,10),prices_at:e}},_e.marketBanner=function(e,r){if(!e||!0===e.open)return null;const a=u(r),l=a?c(e,r):'',p=o(e),d=e.last_close_text||n((e.last_close||'').slice(0,10)||null),h=a?l:d?`Last trading day ${d}`:'',_=(e,n,s,r)=>{const o=s.filter(Boolean);return{kind:e,headline:n,parts:o,text:[n,...o].join(t),reopens:r}};if('unknown'===e.kind)return _('unknown','Market hours unknown',[e.reason||'The exchange calendar could not be read',l],null);if('pre_open'===e.kind){const t=e.next_open&&e.at&&e.next_open.slice(0,10)===e.at.slice(0,10)?s(e.next_open):null;return _('pre_open','Pre-open',[t?`Market opens today at ${t}`:p?`Market opens ${p}`:'The market has not opened yet',l],p)}const f=p?`Reopens ${p}`:'';return'holiday'===e.kind?_('holiday',e.holiday_name?`Market closed for ${e.holiday_name}`:'Market closed for an exchange holiday',[h,f],p):_('closed','Market closed',[h,f],p)},_e.isClosed=p,_e.firstDayLabel=function(t,n,s){return p(n)||!0===s?.is_session_close?`${(0,e.weekday)(t)} ${(0,e.dayMonth)(t)} close`:`${(0,e.weekday)(t)} ${(0,e.dayMonth)(t)} (now)`},_e.queueText=function(e){return`The market is closed. This paper trade will fill at the next open${d(e)} at the opening price plus slippage and charges.`},_e.exitQueueText=function(e){return`The market is closed. This exit will fill at the next open${d(e)} at the opening price plus slippage and charges.`},_e.runState=function(e){const t=e.pending?.fill_at_text||r(e.pending?.fill_at);return'pending'===e.status?{chip:"Waiting for open"+(t?` \xb7 fills ${t}`:''),tone:'amber',line:'P&L starts after the fill.',showPnl:!1,action:'cancel'}:'close_pending'===e.status?{chip:'Exit waits for the next open',tone:'amber',line:t?`The exit fills ${t} at the opening price plus slippage and charges.`:null,showPnl:!0,action:'keep_open'}:'cancelled'===e.status?{chip:'Cancelled',tone:'neutral',line:e.cancel_reason||null,showPnl:!1,action:null}:'open'===e.status?{chip:'Open',tone:'green',line:null,showPnl:!0,action:'close'}:{chip:'Closed',tone:'neutral',line:null,showPnl:!0,action:null}},_e.pctText=_,_e.compactCount=f,_e.oiChangeText=$,_e.spotChangeText=function(e,t){if(null==e||!Number.isFinite(e))return null;const n=_(t,2);return`${e>0?'+':e<0?h:''}${Math.abs(e).toLocaleString('en-IN',{maximumFractionDigits:2,minimumFractionDigits:2})}${n?` (${n})`:''}`},_e.dir=m,Object.defineProperty(_e,"NO_TRADE_TEXT",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"PREV_GAP_TEXT",{enumerable:!0,get:function(){return b}}),_e.changeCell=function(e,t,n,s){if('price'===t)return e?.no_trade_today?{t:x,d:0,muted:!0}
1079:{t:_(e?.change_pct),d:m(e?.change_pct)};if('oi'===t){if(n)return{t:'\u2014',d:0,muted:!0};return{t:s&&null!=e?.oi_change_pct?_(e.oi_change_pct):$(e?.oi_change,e?.oi_change_pct),d:m(e?.oi_change)}}return{t:null,d:0}},_e.plannedRows=function(t){const n='pending'===t.status?'At the open':'Not filled';return t.planned_legs?.length?t.planned_legs.map(t=>[`${t.label}${t.expiry&&!t.label.includes((0,e.dayMonth)(t.expiry))?` \xb7 ${(0,e.dayMonth)(t.expiry)}`:''}`,'EQ'===t.type?`${t.lots} share${1===t.lots?'':'s'}`:`${t.lots} lot${1===t.lots?'':'s'}`,n,'','']):(t.rows||[]).map(e=>[e.label,String(e.units),n,'',''])},_e.libraryPaperBadges=function(e){const t=(e.paper_open||0)+(e.deployments?.open||0),n=e.paper_pending||0,s=[];t&&s.push({label:`${t} open`,tone:'green'});n&&s.push({label:`${n} queued`,tone:'amber'});if(s.length)return s;const r=(null!=e.paper_closed?e.paper_closed:null==e.paper_pending&&e.paper_total||0)+(e.deployments?.closed||0);return r?[{label:`${r} closed`,tone:'neutral'}]:[]},_e.chainSourceText=function(t,n,s){if(p(t?.market_state))return null;const r=(0,e.istStamp)(s||null);return n?l(t,n)?`${r} \xb7 Live (Kite): the chain shows last traded prices; an added leg is priced at buy-at-ask / sell-at-bid`:t&&!1===t.market_open?`${r} \xb7 Market closed \xb7 last traded prices`:`${r} \xb7 Last traded prices`:`${r} \xb7 Stored reading: last traded prices only (this reading has no bid/ask)`},_e.actionErrorText=function(e){const t='string'==typeof e?.message?e.message.trim():'';return t&&'Unable to load KANIDA'!==t?t:'EXPIRES_BEFORE_OPEN'===e?.code?'These contracts expire before the market next opens, so the paper trade cannot be queued.':'PAPER_ALREADY_FILLED'===e?.code?'This paper trade has already filled at the open, so it can no longer be cancelled.':t||'KANIDA could not complete that.'};var e=_r(_d[0]);const t=' \xb7 ';function n(t){return!t||t.length<10?null:`${(0,e.weekday)(t)} ${(0,e.dayMonth)(t)}`}function s(e){if(!e||e.length<16)return null;const t=Number(e.slice(11,13)),n=e.slice(14,16);return Number.isFinite(t)?`${t%12||12}:${n} ${t<12?'AM':'PM'} IST`:null}function r(e){const t=n(e),r=s(e);return t&&r?`${t}, ${r}`:null}function o(e){return e?e.next_open_text||r(e.next_open):null}function a(e){return'live'===e||'live_close'===e}function l(e,t){return!(!t||!e)&&(e.market_state?!0===e.market_state.open:!1!==e.market_open)}function c(t,s){const r=(t.last_close||'').slice(0,10)||null,o=t.last_close_text||n(r),l=(s?.session_date||s?.prices_at||'').slice(0,10)||null;if(s&&a(s.mark_kind)){const e=(l&&r&&l>r?o:n(l))||o;return e?`Prices as of ${e} close (last traded price)`:'Prices are the last traded prices at the latest close'}return s&&!1===s.is_session_close?s.prices_at?`Prices as of ${(0,e.istStamp)(s.prices_at)} (latest stored reading, not the close)`:s.price_label&&!/\blive\b/i.test(s.price_label)?`${s.price_label} (latest stored reading, not the close)`:'Prices are from the latest stored reading, not the close':l&&r&&l!==r?!0===s.is_session_close?`Prices as of ${n(l)} close (last traded price)`:`Prices as of ${s.prices_at?(0,e.istStamp)(s.prices_at):n(l)}`:s&&null==s.is_session_close&&s.prices_at?`Prices as of ${(0,e.istStamp)(s.prices_at)}`:o?`Prices as of ${o} close (last traded price)`:l&&s?.is_session_close?`Prices as of ${n(l)} close (last traded price)`:'Prices are the latest KANIDA has (last traded price)'}function u(e){return!!e&&!!(e.prices_at||e.session_date||e.price_label||a(e.mark_kind))}function p(e){return!!e&&!1===e.open}const d=e=>{const t=o(e);return t?` (${t})`:''};const h='\u2212';function _(e,t=1){if(null==e||!Number.isFinite(e))return null;const n=Number(Math.abs(e).toFixed(t));return`${e>0&&n?'+':e<0&&n?h:''}${n.toFixed(t)}%`}function f(e){const t=Math.abs(e);return t>=1e7?`${(t/1e7).toFixed(1)}Cr`:t>=1e5?`${(t/1e5).toFixed(1)}L`:t>=1e3?`${(t/1e3).toFixed(1)}K`:String(Math.round(t))}function $(e,t){if(null==e||!Number.isFinite(e))return null;const n=_(t);return`${e>0?'+':e<0?h:''}${f(e)}${n?` (${n})`:''}`}function m(e){return null!=e&&Number.isFinite(e)&&0!==e?e>0?1:-1:0}const x='no trade today',b='Previous session missing in the store; change vs the prior day not shown.'},986,[979]); 1080__d(function(g,r,i,a,m,_e,d){"use strict";
1080function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ScratchDesk=function(){const{height:e,width:f}=(0,l.default)(),p=Math.max(560,Math.round(.37*f)),y=(0,n.useSharedRead)('/api/derivatives/filters',0),{u:j,exp:b,setU:v,setExp:S}=(0,u.useInstrument)(),C=Math.max(560,e-172),k={flex:1,height:C,borderWidth:1,borderColor:s.C.line,borderRadius:12,backgroundColor:s.C.paper,overflow:'hidden'},_=e=>v(e);return(0,x.jsx)(t.default,{style:{paddingHorizontal:12,paddingTop:8,width:'100%'},children:(0,x.jsx)(c.Builder,{id:"",embedded:!0,legsFree:!0,height:C-2,draft:{name:`${j} strategy`,body:{underlying:j,expiry:b,legs:[],scenario:{}}},layout:e=>(0,x.jsxs)(t.default,{style:[s.s.row,{gap:8,alignItems:'flex-start'}],children:[(0,x.jsx)(t.default,{style:{flex:1,minWidth:0},children:(0,x.jsx)(h.SplitPanes,{id:"scratch-chain",height:C,initial:.6,left:(0,x.jsxs)(t.default,{style:k,children:[(0,x.jsxs)(t.default,{style:{padding:10,gap:6,borderBottomWidth:1,borderColor:s.C.line,zIndex:30},children:[(0,x.jsx)(o.SymbolSearch,{value:j,data:y.data,onPick:_}),(0,x.jsx)(o.ExpiryPicker,{underlying:j,value:b,data:y.data,onPick:S}),(0,x.jsx)(s.T,{style:{fontSize:11,color:s.C.muted},children:"Tap B or S beside a call or put to add it. Tap again to remove it."})]}),e.chain]}),right:(0,x.jsx)(t.default,{style:k,children:e.legs})})}),(0,x.jsx)(t.default,{style:{width:p,flexShrink:0},children:(0,x.jsx)(t.default,{style:k,children:e.right})})]})},`${j}|${b}`)})},r(d[0]);var t=e(r(d[1])),l=e(r(d[2])),s=r(d[3]),n=r(d[4]),o=r(d[5]),h=r(d[6]),u=r(d[7]),c=r(d[8]),x=r(d[9])},987,[11,13,400,821,921,922,966,974,988,6]); 1081__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Builder=function({id:e,openTemplate:S=!1,openAdjust:F=!1,openChain:q=!1,draft:Q,embedded:J=!1,height:le,extra:ce,layout:ue,legsFree:pe=!1,onLegs:ye}){const fe=!!Q,{width:xe}=(0,a.default)(),me=!J&&xe>=1100,be=xe<700,[je,Ce]=(0,t.useState)(null),[ve,Se]=(0,t.useState)(''),[ke,we]=(0,t.useState)(null),[$e,Te]=(0,t.useState)(0),[ze,Pe]=(0,t.useState)('saved'),[Ie,Le]=(0,t.useState)([]),[Re,Be]=(0,t.useState)([]),[Me,We]=(0,t.useState)(null),[Ee,Ae]=(0,t.useState)(null),[Fe,Ve]=(0,t.useState)(!1),[Ne,Ue]=(0,t.useState)(q),[Oe,De]=(0,t.useState)(S),[He,qe]=(0,t.useState)(!1),[Ye,Ge]=(0,t.useState)(J?ue?'greeks':'legs':'pnl'),[Ke,Qe]=(0,t.useState)(0),[Je,Ze]=(0,t.useState)('');(0,t.useEffect)(()=>{ke&&ye&&ye(ke.legs)},[ke?.legs]);const[Xe,et]=(0,t.useState)([]);(0,t.useEffect)(()=>{if(!Je)return;const e=setTimeout(()=>Ze(''),6e3);return()=>clearTimeout(e)},[Je]);const[tt,st]=(0,t.useState)(''),[nt,rt]=(0,t.useState)(null),[it,lt]=(0,t.useState)([]),[at,ot]=(0,t.useState)(''),[dt,ct]=(0,t.useState)(null),[ut,pt]=(0,t.useState)(0),[ht,gt]=(0,t.useState)([]),yt=dt?.market_state||null,ft=!!dt?.live&&!(0,k.isClosed)(yt),xt=!!dt?.live&&!(0,k.isClosed)(yt),[mt,bt]=(0,t.useState)({open:!1}),[jt,Ct]=(0,t.useState)({open:!1}),[vt,St]=(0,t.useState)(!1),[kt,wt]=(0,t.useState)(!1),$t=(0,t.useRef)([]),Tt=(0,t.useRef)([]),[_t,zt]=(0,t.useState)({u:0,r:0}),[Pt,It]=(0,t.useState)(null),Lt=e=>{if(J&&e)return e.blocked?void ps(e.blocked):(xs(e.apply),void ps(`${e.title} applied.`));It(e?{...e,base:re(es.current)}:null)},[Rt,Bt]=(0,t.useState)(null),[Mt,Wt]=(0,t.useState)(!1),[Et,At]=(0,t.useState)(!1),[Ft,Vt]=(0,t.useState)(!1),[Nt,Ut]=(0,t.useState)(null),[Ot,Dt]=(0,t.useState)(''),[Ht,qt]=(0,t.useState)(0),Yt=(0,t.useRef)(F),Gt=(0,m.useAlertNotifications)(),Kt=(0,t.useRef)(0),Qt=(0,t.useRef)(null),Jt=(0,t.useRef)(null),Zt=(0,t.useRef)(null),Xt=(0,t.useRef)(0);Xt.current=$e;const es=(0,t.useRef)(null),ts=(0,t.useRef)(''),ss=(0,t.useRef)(''),ns=(0,t.useRef)(null),rs=(0,t.useRef)(Promise.resolve()),is=(0,t.useRef)('saved');is.current=ze;const[ls,as]=(0,t.useState)(null),[os,ds]=(0,t.useState)(''),[cs,us]=(0,t.useState)(0),ps=e=>{st(e),setTimeout(()=>st(t=>t===e?'':t),4200)},hs=(0,t.useCallback)(async()=>{if(fe){const e=Q.body;return Ce({id:'',name:Q.name,snapshots:[],activity:[],paper:[]}),ot(Q.name),es.current=e,ts.current=re(e),we(e),void Pe('saved')}try{const t=await u.sb.get(e);Ce(t),ot(t.name);const s=!!es.current&&re(es.current)!==ts.current;if(t.draft&&(s||t.draft.version<Xt.current));else if(t.draft){const s=t.draft.body;ms(),es.current=s,ts.current=re(s),ss.current=t.draft.checksum||'',Xt.current=t.draft.version,we(s),Te(t.draft.version),Pe('saved');const n=ae(e);n&&re(n.body)!==ts.current&&(n.version===t.draft.version?(es.current=n.body,we(n.body),Pe('dirty'),clearTimeout(Qt.current),Qt.current=setTimeout(()=>fs.current(n.body),P),ps('Recovered edits that had not been saved yet.')):(as({local:n.body}),Pe('conflict')))}else Pe('saved')}catch(e){Se(R(e))}},[e]),gs=(0,t.useCallback)(async()=>
1081{if(!fe){try{const t=await u.sb.paperList();lt(t.runs.filter(t=>t.strategy_id===e))}catch{}try{const t=await u.exec.list();gt(t.deployments.filter(t=>t.strategy_id===e))}catch{}}},[e]);(0,t.useEffect)(()=>{let e=!0;const t=()=>u.exec.status().then(t=>{e&&ct(t)}).catch(()=>{});t();const s=setInterval(()=>{t(),pt(e=>e+1)},1e4);return()=>{e=!1,clearInterval(s)}},[]),(0,t.useEffect)(()=>{(ht.some(e=>!['closed','cancelled'].includes(e.status))||it.some(e=>'pending'===e.status||'close_pending'===e.status))&&gs()},[ut]),(0,t.useEffect)(()=>{hs(),gs(),u.sb.underlyings().then(e=>Be(e.underlyings)).catch(()=>{})},[hs,gs]),(0,t.useEffect)(()=>{Yt.current&&je&&ke?.legs?.length&&(Yt.current=!1,Ct({open:!0,deployment:ht.find(e=>'active'===e.status)||null}))},[je,ht]),(0,t.useEffect)(()=>{if(!ke?.underlying)return;let e=!0;return u.sb.expiries(ke.underlying).then(t=>{if(!e)return;Le(t.expiries);const s=t.expiries.find(e=>(e.days_to_expiry??0)>=1)||t.expiries[0];!ke.expiry&&s&&(xs(e=>({...e,expiry:s.expiry})),fe&&es.current&&(ts.current=re(es.current),Pe('saved')))}).catch(e=>Se(R(e))),()=>{e=!1}},[ke?.underlying]),(0,t.useEffect)(()=>{if(!ke?.underlying||!ke.expiry)return void We(null);const e=new AbortController;return u.sb.chain(ke.underlying,ke.expiry,e.signal).then(e=>{We(e),Dt('')}).catch(e=>{'AbortError'!==e?.name&&Dt(R(e))}),()=>e.abort()},[ke?.underlying,ke?.expiry,ft?ut:0,Ht]),(0,t.useEffect)(()=>{if(!ke)return;clearTimeout(Jt.current);const e=++Kt.current;return Ve(!0),Jt.current=setTimeout(async()=>{if(e!==Kt.current)return;Zt.current?.abort();const t=new AbortController;Zt.current=t;try{const s=await u.sb.analyze(ke,t.signal);e===Kt.current&&(Ae(s),Ve(!1),ds(''))}catch(t){'AbortError'!==t?.name&&e===Kt.current&&(Ve(!1),ds(R(t)))}},I),()=>clearTimeout(Jt.current)},[ke,ft?ut:0,cs]);const ys=(0,t.useCallback)(t=>{const s=async()=>{const s=re(t);if(fe)return Pe(s===ts.current?'saved':'dirty'),!1;if('conflict'===is.current)return!1;if(s===ts.current){const t=re(es.current)===s;return Pe(t?'saved':'dirty'),t&&de(e),!0}Pe('saving');try{const n=await u.sb.save(e,Xt.current,t);Xt.current=n.draft.version,ts.current=s,ss.current=n.draft.checksum||'',Te(n.draft.version);const r=re(es.current)===s;return Pe(r?'saved':'dirty'),r?de(e):oe(e,n.draft.version,es.current),!0}catch(e){return e instanceof c.ApiError&&409===e.status?(is.current='conflict',Pe('conflict'),as({local:t}),!1):(Pe('error'),!1)}},n=rs.current.then(s,s);return rs.current=n.catch(()=>!1),n},[e]),fs=(0,t.useRef)(ys);function xs(t,s=!0){const n=es.current;if(!n)return;const r=t(n);r!==n&&(s&&($t.current=[...$t.current.slice(-49),n],Tt.current=[],zt({u:$t.current.length,r:0})),es.current=r,we(r),fe?Pe('dirty'):(oe(e,Xt.current,r),'conflict'!==is.current&&(Pe('dirty'),clearTimeout(Qt.current),Qt.current=setTimeout(()=>ys(r),P))))}function ms(){$t.current=[],Tt.current=[],zt({u:0,r:0})}function bs(){const e=$t.current.pop();e&&es.current&&(Tt.current.push(es.current),zt({u:$t.current.length,r:Tt.current.length}),xs(()=>e,!1))}function js(){const e=Tt.current.pop();e&&es.current&&($t.current.push(es.current),zt({u:$t.current.length,r:Tt.current.length}),xs(()=>e,!1))}async function Cs(){ie(),clearTimeout(Qt.current);const e=es.current;if(!e)return!1;return await ys(e)&&re(es.current)===ts.current}async function vs(e){await Cs()?e():ps(fe?'Save to My strategies first - this is a scratch copy.':'conflict'===is.current?'Resolve the version conflict first - your edits are kept.':'Your latest edit is not saved yet, so nothing was done. Use "Retry now".')}fs.current=ys,(0,t.useEffect)(()=>()=>{clearTimeout(Qt.current),fe||es.current&&re(es.current)!==ts.current&&'conflict'!==is.current&&fs.current(es.current)},[]),(0,t.useEffect)(()=>{if('undefined'==typeof window||!window.addEventListener)return;const e=e=>{fe||es.current&&re(es.current)!==ts.current&&(e.preventDefault(),e.returnValue='')};return window.addEventListener('beforeunload',e),()=>window.removeEventListener('beforeunload',e)},[]);const Ss=(e,t,s,n)=>s&&s!==Me?.expiry?Ee?.legs_quotes?.find(e=>e.id===n)?.ltp??null:Me?.rows.find(t=>t.strike===e)?.[t]?.ltp??null,ks=(0,t.useMemo)(()=>Me?.rows.map(e=>e.strike)??[],[Me]),ws=(e,t)=>{if(!ks.length)return e;const s=ks.indexOf(e),n=Math.max(0,Math.min(ks.length-1,(s<0?ks.findIndex(t=>t>=e):s)+t));return ks[n]};function $s(e,t,s,n){xs(r=>{const i=r.legs.find(s=>(s.expiry||r.expiry)===n&&s.strike===e&&s.type===t);if(i&&i.side===s)return{...r,legs:r.legs.filter(e=>e!==i)};if(i)return{...r,legs:r.legs.map(e=>e===i?{...e,side:s}:e)};const l=new Set(r.legs.map(e=>e.underlying||r.underlying)).size>1?8:16;return r.legs.length>=l?(ps(`At most ${l} legs.`),r):{...r,template:null,legs:[...r.legs,{id:L(),type:t,side:s,strike:e,lots:1,expiry:n,price_basis:'exec',price:null,include:!0}]}})}const Ts=(e,t)=>xs(s=>({...s,template:null,legs:s.legs.map(s=>s.id===e?{...s,...t}:s)}));function _s(e){if(!ke)return;const t=ke.legs.findIndex(t=>t.id===e),s=ke.legs[t];rt({leg:s,index:t}),xs(t=>({...t,legs:t.legs.filter(t=>t.id!==e)})),setTimeout(()=>rt(t=>t?.leg.id===e?null:t),6e3)}function zs(e){xs(t=>{const s=t.legs.reduce((e,t)=>
1081{let s=e,n=t.lots;for(;n;)[s,n]=[n,s%n];return s},0)||1,n=t.legs.map(e=>e.lots/s),r=Math.max(1,s+e);return r===s||n.some(e=>e*r>500)?t:{...t,legs:t.legs.map((e,t)=>({...e,lots:n[t]*r}))}})}function Ps(){'undefined'!=typeof window&&window.confirm&&!window.confirm('Remove every leg? A snapshot keeps anything you want to restore.')||xs(e=>({...e,template:null,param:null,legs:[]}))}function Is(e,t){const s=t.legs;if(!s.length)return'Add legs first.';const n=s.filter(e=>'S'===e.side),r=s.filter(e=>'B'===e.side);return'width'===e&&s.length<2?'Width needs at least two legs.':'wings'!==e||n.length&&r.length?null:'Wings needs short legs with long hedges (a spread, condor or butterfly).'}function Ls(e,t,s){const n=s.legs,r=n.filter(e=>'S'===e.side),i=(r.length?r:n).map(e=>e.strike),l=i.reduce((e,t)=>e+t,0)/i.length,a=[];for(const s of n){let n=0;if('shift'===e?n=t:'width'===e?n='S'!==s.side&&r.length?s.strike>l?t:-t:s.strike>l||s.strike===l&&'CE'===s.type?t:-t:'wings'===e&&'B'===s.side&&r.length&&(n=s.strike>l?t:-t),!n){a.push(s);continue}const i=ks.indexOf(s.strike),o=i+n;if(i<0||o<0||o>=ks.length)return{error:`${(0,$.strikeText)(s.strike)} ${s.type} would move past the listed strikes - nothing was changed.`};a.push({...s,strike:ks[o]})}const o=a.map(e=>`${e.expiry}|${e.type}${e.strike}${e.side}`);if(new Set(o).size<o.length)return{error:'Two legs would land on the same contract - nothing was changed.'};if('width'===e&&r.length){const e=a.filter(e=>'S'===e.side),t=a.filter(e=>'B'===e.side);if(e.some(e=>t.some(t=>t.type===e.type&&t.strike===e.strike)))return{error:'The legs would cross - nothing was changed.'}}return{legs:a}}function Rs(e,t){const s=es.current;if(!s)return;if(!s.linked){const s=ks.indexOf(e.strike),n=s+t;return s<0||n<0||n>=ks.length?void ps(`${(0,$.strikeText)(e.strike)} ${e.type} is at the edge of the listed strikes.`):void Ts(e.id,{strike:ks[n]})}const n=Ls('shift',t,s);'error'in n?ps(n.error):xs(e=>({...e,template:null,legs:n.legs}))}function Bs(e,t){const s=es.current;if(!s)return;const n=Is(e,s);if(n)return void ps(n);const r=Ls(e,t,s);if('error'in r)return void Lt({title:`${{shift:'Shift',width:'Width',wings:'Wings'}[e]} ${t>0?'+':'\u2212'}1`,lines:[],apply:e=>e,blocked:r.error});const i=s.legs.map((e,t)=>e.strike===r.legs[t].strike?null:`${'B'===e.side?'Buy':'Sell'} ${e.type} ${(0,$.dayMonth)(e.expiry)}: ${(0,$.strikeText)(e.strike)} \u2192 ${(0,$.strikeText)(r.legs[t].strike)}
1081`).filter(Boolean);i.length?Lt({title:`${{shift:'Shift',width:'Width',wings:'Wings'}[e]} ${t>0?'+':'\u2212'}1`,lines:i,apply:e=>({...e,template:null,legs:r.legs})}):ps('Nothing to change for this structure.')}async function Ms(e,t){if(ke?.underlying&&ke.expiry)try{const s=(await u.sb.resolve(e.key,ke.underlying,ke.expiry,t)).legs.map(e=>({id:L(),type:e.type,side:e.side,strike:e.strike,lots:e.lots,expiry:e.expiry,price_basis:'exec',price:null,include:!0}));De(!1);const n=n=>({...n,template:e.key,param:t??null,legs:s});es.current?.legs.length?Lt({title:`Replace ${es.current.legs.length} leg${es.current.legs.length>1?'s':''} with ${e.name}`,lines:[...es.current.legs.map(e=>`Remove: ${(0,$.legText)(e)}`),...s.map(e=>`Add: ${(0,$.legText)(e)}`)],apply:n}):(xs(n),ps(`${e.name} loaded - ${s.length} legs. Everything stays editable.`))}catch(e){ps(R(e))}}async function Ws(){vs(async()=>{const t=Xt.current;try{const s=await u.sb.snapshot(e,void 0,{expected_version:t,input_hash:ss.current,request_id:`v${t}`});ps(void 0===s.draft_version?`Snapshot ${s.n} already holds this exact version.`:`Saved snapshot ${s.n} of draft v${t}. It will never change.`),hs(),Ge('snapshots')}catch(e){ps(R(e))}})}async function Es(){vs(async()=>{try{const t=await u.sb.duplicate(e,void 0,{expected_version:Xt.current,input_hash:ss.current});o.router.replace({pathname:'/strategies',params:{id:t.id}}),ps('Copy created - research only, no paper runs copied.')}catch(e){ps(R(e))}})}async function As(){const e=es.current;if(e)try{const t=await u.sb.create(e,at.trim()||Q?.name||'Strategy');o.router.push({pathname:'/strategies',params:{id:t.id}})}catch(e){ps(R(e))}}async function Fs(){if(!fe&&je&&at.trim()&&at!==je.name)try{const t=await u.sb.meta(e,{name:at});Ce(e=>e?{...e,name:t.name}:e)}catch(e){ps(R(e))}}if(ve)return(0,z.jsxs)(l.default,{style:{padding:24},children:[(0,z.jsx)(d.T,{style:{color:d.C.red},children:ve}),(0,z.jsx)(d.Button,{label:"Back to strategies",kind:"outline",onPress:()=>o.router.replace('/strategies')})]});if(!je||!ke)return(0,z.jsx)(d.Loading,{});const Vs=Ee,Ns=(Fe||!!os)&&!!Vs,Us=new Set(ke.legs.map(e=>e.expiry)).size>1,Os=(ke.scenario,Me?.as_of||Vs?.as_of),Ds=(Ie.find(e=>e.expiry===ke.expiry),(0,z.jsxs)(l.default,{style:[B,{flex:me?45:void 0,width:me?void 0:'100%'}],children:[(0,z.jsxs)(l.default,{style:[d.s.between,{flexWrap:'wrap'}],children:[(0,z.jsxs)(l.default,{style:{gap:2},children:[(0,z.jsx)(d.T,{style:M,children:"Legs"}),(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6}],children:[(0,z.jsx)(d.T,{style:{fontFamily:'InterSemi',fontSize:14},children:Vs?.structure?.name||'\u2014'}),ke.legs.length>0&&(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"About this strategy",onPress:()=>wt(!0),children:(0,z.jsx)(d.Icon,{name:"info",size:15,color:d.C.green})})]})]}),(0,z.jsxs)(l.default,{style:[d.s.row,{gap:8,flexWrap:'wrap',flexShrink:1,maxWidth:'100%'}],children:[(0,z.jsx)(d.Button,{label:"Template",icon:"layout",kind:"outline",onPress:()=>De(!0),disabled:!ke.expiry}),(0,z.jsx)(d.Button,{label:"Spreads",icon:"list",kind:"outline",onPress:()=>St(!0),disabled:!ke.expiry||!Me}),(0,z.jsx)(d.Button,{label:"Add from chain",icon:"plus",kind:"soft",onPress:()=>Ue(!0),disabled:!Me})]})]}),ke.legs.length?ke.legs.map(e=>{const t=Vs?.legs?.find(t=>t.id===e.id),s=Ss(e.strike,e.type,e.expiry,e.id);return be?(0,z.jsxs)(n.default,{accessibilityRole:"button",accessibilityLabel:`Edit leg: ${(0,$.legText)(e)}`,onPress:()=>Bt(e),style:({pressed:t})=>[d.s.between,{borderTopWidth:1,borderColor:d.C.line,paddingVertical:10,minHeight:56,opacity:e.include?t?.7:1:.5}],children:[(0,z.jsxs)(l.default,{style:{gap:3,flex:1},children:[(0,z.jsx)(d.T,{style:{fontSize:14,fontFamily:'InterSemi',color:'B'===e.side?d.C.green:d.C.red},children:`${'B'===e.side?'BUY':'SELL'} ${e.lots} \xd7 ${(0,$.strikeText)(e.strike)} ${e.type} \xb7 ${(0,$.dayMonth)(e.expiry)}${e.include?'':' (excluded)'}`}),(0,T.legIsSettled)(Vs,t)&&(0,z.jsx)(_.SettledTag,{}),(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:`${e.lots} lot${e.lots>1?'s':''} \xd7 ${Me?.lot_size||'?'} = ${Me?.lot_size?e.lots*Me.lot_size:'?'} units`}),(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:`Entry ${(0,$.num)(t?.entry)} ${he[Vs?.legs_quotes?.find(t=>
1081t.id===e.id)?.basis_used||'']||''} \xb7 IV ${(0,w.ivText)(t?.iv)} \xb7 \u0394 ${t?.greeks?(0,$.num)(t.greeks.delta,1):'\u2014'}${(0,T.legIsSettled)(Vs,t)?` \xb7 settled at ${(0,$.num)(t.settled_value)}`:''}`})]}),(0,z.jsx)(d.Icon,{name:"edit-2",size:16,color:d.C.muted})]},e.id):(0,z.jsxs)(l.default,{style:[{borderTopWidth:1,borderColor:d.C.line,paddingTop:J?8:10,gap:8,opacity:e.include?1:.5},J&&{flexDirection:'row',flexWrap:'wrap',alignItems:'center',paddingBottom:2}],children:[(0,z.jsxs)(l.default,{style:[d.s.row,{flexWrap:'wrap',gap:8}],children:[(0,z.jsx)(n.default,{role:"checkbox","aria-checked":e.include,accessibilityLabel:`Include ${(0,$.strikeText)(e.strike)} ${e.type} in analysis`,onPress:()=>Ts(e.id,{include:!e.include}),style:{width:22,height:22,borderRadius:5,borderWidth:1.5,borderColor:e.include?d.C.green:d.C.muted,backgroundColor:e.include?d.C.green:'transparent',alignItems:'center',justifyContent:'center'},children:e.include&&(0,z.jsx)(d.Icon,{name:"check",size:13,color:d.C.onGreen})}),(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Side: ${'B'===e.side?'Buy':'Sell'}. Switch`,onPress:()=>Ts(e.id,{side:'B'===e.side?'S':'B'}),style:{paddingHorizontal:10,height:be?44:28,minWidth:be?52:void 0,alignItems:'center',borderRadius:7,justifyContent:'center',backgroundColor:'B'===e.side?d.C.soft:d.C.redBg,borderWidth:1,borderColor:'B'===e.side?d.C.green:d.C.red},children:(0,z.jsx)(d.T,{style:{fontSize:11,fontFamily:'InterSemi',color:'B'===e.side?d.C.green:d.C.red},children:'B'===e.side?'BUY':'SELL'})}),(0,z.jsx)(V,{label:`${ke.linked?'\ud83d\udd17 ':''}${(0,$.strikeText)(e.strike)}`,a11y:`Strike ${(0,$.strikeText)(e.strike)}${ke.linked?' (linked: moves every leg)':''}`,onMinus:()=>Rs(e,-1),onPlus:()=>Rs(e,1)}),(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Expiry ${(0,$.dayMonth)(e.expiry)}. Change`,onPress:()=>Bt(e),style:[W,e.expiry!==ke.expiry&&{borderColor:d.C.amber}],children:(0,z.jsx)(d.T,{style:{fontSize:11,fontFamily:'InterSemi',color:e.expiry!==ke.expiry?d.C.amber:d.C.muted},children:(0,$.dayMonth)(e.expiry)})}),(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Type ${e.type}. Switch to ${'CE'===e.type?'PE':'CE'}`,onPress:()=>Ts(e.id,{type:'CE'===e.type?'PE':'CE'}),style:[W,be&&{height:44,minWidth:44,alignItems:'center'}],children:(0,z.jsx)(d.T,{style:{fontSize:11,fontFamily:'InterSemi'},children:e.type})}),(0,z.jsx)(V,{label:`${e.lots} lot${e.lots>1?'s':''}`,a11y:`${e.lots} lots`,onMinus:()=>e.lots>1&&Ts(e.id,{lots:e.lots-1}),onPlus:()=>e.lots<500&&Ts(e.id,{lots:e.lots+1})}),!J&&(0,z.jsx)(l.default,{style:{flex:1}}),(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Remove ${(0,$.strikeText)(e.strike)} ${e.type}`,onPress:()=>_s(e.id),style:{padding:be?14:6},children:(0,z.jsx)(d.Icon,{name:"trash-2",size:15,color:d.C.muted})})]}),(0,z.jsxs)(l.default,{style:[d.s.row,{flexWrap:'wrap',gap:14}],children:[(0,z.jsx)(Y,{leg:e,ltp:s,quote:Vs?.legs_quotes?.find(t=>t.id===e.id),tick:Me?.tick_size,onManual:(t,s)=>{Ts(e.id,{price_basis:'manual',price:t}),null!=s&&ps(`Rounded ${s} to ${t}, on the ${Me?.tick_size||.05} exchange tick.`)},onBasis:t=>Ts(e.id,{price_basis:t,price:null})}),(0,z.jsx)(N,{k:"IV",v:(0,w.ivText)(t?.iv)}),(0,z.jsx)(N,{k:"\u0394",v:t?.greeks?(0,$.num)(t.greeks.delta,1):'\u2014'}),!J&&(0,z.jsx)(N,{k:"Units",v:String(t?t.units:e.lots*(Me?.lot_size||0))}),(0,T.legIsSettled)(Vs,t)&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(_.SettledTag,{}),(0,z.jsx)(N,{k:"Settled at",v:(0,$.num)(t.settled_value)})]})]})]},e.id)}):(0,z.jsxs)(l.default,{style:{paddingVertical:26,alignItems:'center',gap:8},children:[(0,z.jsx)(d.Icon,{name:"layers",size:22,color:d.C.green}),(0,z.jsx)(d.T,{style:{fontFamily:'InterSemi'},children:"No legs yet"}),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted,textAlign:'center',maxWidth:340},children:"Pick a template for a ready structure, or add exact contracts from the chain."})]}),!!Vs?.legs?.length&&(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted,fontVariant:['tabular-nums']},accessibilityLabel:"Cost formula",children:`${Vs.legs.map((e,t)=>`${t?e.units>0?' \u2212 ':' + ':e.units>0?'\u2212':'+'}${(0,$.num)(e.entry)} \xd7 ${Math.abs(e.units)}`).join('')} = ${(0,$.inr)(Math.abs(Vs.premium?.value||0))} ${(Vs.premium?.value||0)>=0?'credit':'debit'} \xb7 charges ~${(0,$.inr)(Vs.charges?.value)}`}),(0,z.jsx)(_.SettledNote,{text:(0,T.settledLabel)(Vs)}),nt&&(0,z.jsxs)(l.default,{style:[d.s.between,{backgroundColor:d.C.paper,borderRadius:10,padding:10}],children:[(0,z.jsx)(d.T,{style:{fontSize:12},children:`Removed ${(0,$.strikeText)(nt.leg.strike)} ${nt.leg.type}`}),(0,z.jsx)(d.Button,{label:"Undo",kind:"outline",onPress:()=>{const e=nt;rt(null),xs(t=>{const s=[...t.legs];return s.splice(Math.min(e.index,s.length),0,e.leg),{...t,legs:s}})}})]}),ke.legs.length>0&&(0,z.jsxs)(l.default,{style:[d.s.row,{flexWrap:'wrap',gap:10,borderTopWidth:1,borderColor:d.C.line,paddingTop:10}],children:[(0,z.jsx)(d.T,{style:M,children:"Adjust all"}),(0,z.jsx)(V,{label:"Shift",a11y:"Shift all strikes",onMinus:()=>Bs('shift',-1),onPlus:()=>Bs('shift',1)}),(0,z.jsx)(V,{label:"Width",a11y:"Width between legs",onMinus:()=>Bs('width',-1),onPlus:()=>Bs('width',1)}),(0,z.jsx)(V,{label:"Wings",a11y:"Hedge wing distance",onMinus:()=>Bs('wings',-1),onPlus:()=>Bs('wings',1)}),(0,z.jsx)(V,{label:"Size \xd7",a11y:"Multiply or divide every leg's lots, keeping the ratios",onMinus:()=>zs(-1),onPlus:()=>zs(1)}
1081),(0,z.jsx)(d.Chip,{label:ke.linked?'Strikes linked':'Link strikes',icon:"link",active:!!ke.linked,onPress:()=>xs(e=>({...e,linked:!e.linked}))}),(0,z.jsx)(d.Button,{label:"Clear all",icon:"x",kind:"outline",onPress:Ps})]})]})),Hs={chk:24,side:46,strike:112,exp:52,type:36,lots:84,entry:62,mark:62,pnl:72,del:28},qs=(e,t,s,r=22)=>(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:s,onPress:t,hitSlop:6,style:e=>({width:r,height:24,borderRadius:6,alignItems:'center',justifyContent:'center',backgroundColor:e.hovered?d.C.hoverBg:'transparent'}),children:(0,z.jsx)(d.T,{style:{fontSize:13,color:d.C.muted},children:e})}),Ys=(e,t,s=!1)=>(0,z.jsx)(d.T,{style:{width:t,fontSize:11,color:d.C.heading,fontFamily:'InterSemi',textAlign:s?'right':'left'},children:e},e),Gs=(e,t,s,r=!1,i=!1)=>(0,z.jsxs)(n.default,{accessibilityRole:"button",onPress:s,disabled:r,style:e=>[d.s.row,{gap:5,height:28,paddingHorizontal:10,borderRadius:7,borderWidth:1,borderColor:i?d.C.green:d.C.line,backgroundColor:i?d.C.soft:e.hovered?d.C.hoverBg:'transparent',opacity:r?.45:1}],children:[(0,z.jsx)(d.Icon,{name:t,size:13,color:i?d.C.green:d.C.ink}),(0,z.jsx)(d.T,{style:{fontSize:12,color:i?d.C.green:d.C.ink,fontFamily:'InterMedium'},children:e})]},e),Ks={Link:'When on, moving any one strike moves every leg together, keeping the shape',Shift:'Move every strike up or down by one strike step',Width:'Move the legs further apart or closer together',Wings:'Move only the protective (bought) legs further out or in','Size \xd7':'Multiply or divide every leg\'s lots, keeping the ratios'},Qs=e=>(0,z.jsxs)(l.default,{style:{position:'relative',zIndex:Je===e?60:1},children:[Je===e&&(0,z.jsxs)(n.default,{onPress:()=>Ze(''),style:{position:'absolute',bottom:26,left:-110,width:240,padding:10,borderRadius:10,backgroundColor:d.C.paper,borderWidth:1,borderColor:d.C.green,zIndex:60,shadowColor:d.C.shadow,shadowOpacity:.4,shadowRadius:10},children:[(0,z.jsx)(d.T,{style:{fontSize:12,fontFamily:'InterSemi',color:d.C.ink},children:e}),(0,z.jsxs)(d.T,{style:{fontSize:12,color:d.C.muted,marginTop:2},children:[Ks[e],"."]})]}),(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`What does ${e} do?`,onPress:()=>Ze(t=>t===e?'':e),hitSlop:8,style:t=>({width:18,height:18,borderRadius:9,borderWidth:1,borderColor:Je===e||t.hovered?d.C.green:d.C.line,alignItems:'center',justifyContent:'center',marginLeft:-2}),children:(0,z.jsx)(d.T,{style:{fontSize:11,color:Je===e?d.C.green:d.C.muted,fontFamily:'InterSemi'},children:"?"})})]},`h-${e}`),Js=(e,t,s)=>(0,z.jsxs)(l.default,{title:Ks[e],style:[d.s.row,{gap:0,height:28,borderWidth:1,borderColor:d.C.line,borderRadius:7,width:104,justifyContent:'space-between'}],children:[qs('\u2212',t,`${e} down`,26),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.ink},children:e}),qs('+',s,`${e} up`,26)]},e),Zs=!!Vs?.scenario?.active,Xs=e=>e?Zs?e.target_pnl??null:null!=e.mark&&null!=e.entry?(e.mark-e.entry)*e.units:0:null,en=Vs?.premium?.value||0,tn=(Vs?.legs||[]).reduce((e,t)=>e+(Xs(t)||0),0),sn=(0,z.jsxs)(l.default,{style:{gap:8},children:[(0,z.jsxs)(l.default,{style:[d.s.row,{gap:8}],children:[(0,z.jsx)(d.T,{style:{fontSize:11,letterSpacing:1,textTransform:'uppercase',fontFamily:'InterSemi',color:d.C.heading},children:"Legs"}),(0,z.jsx)(d.T,{style:{fontSize:13,fontFamily:'InterSemi',color:d.C.ink},numberOfLines:1,children:Vs?.structure?.name||'\u2014'}),ke.legs.length>0&&(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"About this strategy",onPress:()=>wt(!0),children:(0,z.jsx)(d.Icon,{name:"info",size:14,color:d.C.green})}),(0,z.jsx)(l.default,{style:{flex:1}}),!pe&&(0,z.jsxs)(z.Fragment,{children:[Gs('Template','layout',()=>De(!0),!ke.expiry),Gs('Spreads','list',()=>St(!0),!ke.expiry||!Me),Gs('Chain','plus',()=>Ue(!0),!Me,!0)]})]}),(0,z.jsxs)(l.default,{style:{borderWidth:1,borderColor:d.C.line,borderRadius:10,overflow:'hidden'},children:[(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6,height:30,paddingHorizontal:8,backgroundColor:d.C.dark,borderBottomWidth:1,borderColor:d.C.line}],children:[(0,z.jsx)(l.default,{style:{width:Hs.chk}}
1081),Ys('Side',Hs.side),Ys('Strike',Hs.strike),Ys('Expiry',Hs.exp),Ys('Type',Hs.type),Ys('Lots',Hs.lots),Ys('Price',Hs.entry,!0),(0,z.jsx)(l.default,{title:'Move NIFTY, the date or IV in the Scenario row under the chart to update this P&L',children:Ys(Vs?.scenario?.active?'P&L (scen.)':'P&L today',Hs.pnl,!0)}),(0,z.jsx)(l.default,{style:{width:Hs.del}})]}),!ke.legs.length&&(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted,padding:12},children:pe?'No legs yet - tap B or S in the chain to add one.':'No legs yet - use Template, Spreads or Chain.'}),ke.legs.map(e=>{const t=Vs?.legs?.find(t=>t.id===e.id),s=Ss(e.strike,e.type,e.expiry,e.id),r='B'===e.side;return(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6,height:34,paddingHorizontal:8,borderBottomWidth:1,borderColor:d.C.lineSoft,opacity:e.include?1:.45}],children:[(0,z.jsx)(n.default,{role:"checkbox","aria-checked":e.include,accessibilityLabel:`Include ${(0,$.strikeText)(e.strike)} ${e.type}`,onPress:()=>Ts(e.id,{include:!e.include}),style:{width:Hs.chk,alignItems:'flex-start'},children:(0,z.jsx)(l.default,{style:{width:16,height:16,borderRadius:4,borderWidth:1.5,borderColor:e.include?d.C.green:d.C.muted,backgroundColor:e.include?d.C.green:'transparent',alignItems:'center',justifyContent:'center'},children:e.include&&(0,z.jsx)(d.Icon,{name:"check",size:11,color:d.C.onGreen})})}),(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Side ${r?'Buy':'Sell'}. Switch`,onPress:()=>Ts(e.id,{side:r?'S':'B'}),style:{width:Hs.side,height:22,borderRadius:5,alignItems:'center',justifyContent:'center',backgroundColor:r?d.C.soft:d.C.redBg,borderWidth:1,borderColor:r?d.C.green:d.C.red},children:(0,z.jsx)(d.T,{style:{fontSize:11,fontFamily:'InterSemi',color:r?d.C.green:d.C.red},children:r?'BUY':'SELL'})}),(0,z.jsxs)(l.default,{style:[d.s.row,{width:Hs.strike,gap:0,justifyContent:'space-between'}],children:[qs('\u2212',()=>Rs(e,-1),'Strike down'),(0,z.jsx)(d.T,{style:{fontSize:13,fontFamily:'InterSemi',fontVariant:['tabular-nums']},children:(0,$.strikeText)(e.strike)}),qs('+',()=>Rs(e,1),'Strike up')]}),(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Expiry ${(0,$.dayMonth)(e.expiry)}. Change`,onPress:()=>Bt(e),style:{width:Hs.exp},children:(0,z.jsx)(d.T,{style:{fontSize:12,color:e.expiry!==ke.expiry?d.C.amber:d.C.muted},children:(0,$.dayMonth)(e.expiry)})}),(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Type ${e.type}. Switch`,onPress:()=>Ts(e.id,{type:'CE'===e.type?'PE':'CE'}),style:{width:Hs.type},children:(0,z.jsx)(d.T,{style:{fontSize:12,fontFamily:'InterSemi',color:d.C.ink},children:e.type})}),(0,z.jsxs)(l.default,{style:[d.s.row,{width:Hs.lots,gap:0,justifyContent:'space-between'}],children:[qs('\u2212',()=>e.lots>1&&Ts(e.id,{lots:e.lots-1}),'Fewer lots'),(0,z.jsx)(d.T,{style:{fontSize:12,fontVariant:['tabular-nums']},children:e.lots}),qs('+',()=>e.lots<500&&Ts(e.id,{lots:e.lots+1}),'More lots')]}),(0,z.jsx)(d.T,{style:{width:Hs.entry,fontSize:12,textAlign:'right',fontVariant:['tabular-nums']},children:(0,$.num)(t?.entry??s)}),(0,z.jsx)(d.T,{style:{width:Hs.pnl,fontSize:12,textAlign:'right',fontVariant:['tabular-nums'],color:(Xs(t)||0)>0?d.C.heatUp2:(Xs(t)||0)<0?d.C.heatDn2:d.C.ink},children:(0,$.signed)(Xs(t))}),(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Remove ${(0,$.strikeText)(e.strike)} ${e.type}`,onPress:()=>_s(e.id),style:{width:Hs.del,alignItems:'flex-end'},children:(0,z.jsx)(d.Icon,{name:"trash-2",size:14,color:d.C.muted})})]},e.id)}),ke.legs.length>0&&(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6,height:34,paddingHorizontal:8,backgroundColor:d.C.dark}],children:[(0,z.jsxs)(l.default,{style:[d.s.row,{width:Hs.chk+Hs.side+Hs.strike+Hs.exp+Hs.type+Hs.lots+Hs.entry+36,gap:14,overflow:'hidden'}],children:[(0,z.jsx)(d.T,{style:{fontSize:12,fontFamily:'InterSemi',color:d.C.ink},children:"Total"}),(0,z.jsx)(l.default,{style:{flex:1}}),(0,z.jsxs)(d.T,{numberOfLines:1,style:{fontSize:12,color:d.C.muted},children:[en>=0?'You receive ':'You pay ',(0,z.jsx)(d.T,{style:{fontSize:12,fontFamily:'InterSemi',color:en>=0?d.C.heatUp2:d.C.heatDn2},children:`${(0,$.inr)(Math.abs(en))} (${en>=0?'credit':'debit'})`})]}),(0,z.jsxs)(d.T,{numberOfLines:1,style:{fontSize:12,color:d.C.muted},children:["Charges ",(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.ink},children:(0,$.inr)(Vs?.charges?.value)})]})]}),(0,z.jsx)(d.T,{numberOfLines:1,title:'Move NIFTY, the date or IV in the Scenario row under the chart to update this P&L',style:{width:Hs.pnl,fontSize:12,textAlign:'right',fontFamily:'InterSemi',fontVariant:['tabular-nums'],color:tn>0?d.C.heatUp2:tn<0?d.C.heatDn2:d.C.ink},children:(0,$.signed)(tn)}),(0,z.jsx)(l.default,{style:{width:Hs.del}})]})]}),ke.legs.length>0&&(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6,flexWrap:'wrap'}],children:[Js('Shift',()=>Bs('shift',-1),()=>Bs('shift',1)),Qs('Shift'),Js('Width',()=>Bs('width',-1),()=>Bs('width',1)),Qs('Width'),Js('Wings',()=>Bs('wings',-1),()=>Bs('wings',1)),Qs('Wings'),Js('Size \xd7',()=>zs(-1),()=>zs(1)),Qs('Size \xd7'),(0,z.jsx)(l.default,{style:{flex:1}}),(0,z.jsx)(l.default,{title:Ks.Link,children:Gs(ke.linked?'Linked':'Link','link',()=>xs(e=>({...e,linked:!e.linked})),!1,!!ke.linked)}),Qs('Link'),Gs('Clear','x',Ps)]}),nt&&(0,z.jsxs)(l.default,{style:[d.s.row,{gap:8}],children:[(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:`Removed ${(0,$.strikeText)(nt.leg.strike)} ${nt.leg.type}`}),Gs('Undo','rotate-ccw',()=>{const e=nt;rt(null),xs(t=>{const s=[...t.legs];return s.splice(Math.min(e.index,s.length),0,e.leg),{...t,legs:s}})})]})]}),nn=(0,z.jsxs)(l.default,{style:B,children:[(0,z.jsxs)(l.default,{style:d.s.between,children:[(0,z.jsx)(d.T,{style:M,children:"Payoff"}),Fe&&(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.amber},children:Vs?'Updating\u2026':'Calculating\u2026'}),!Fe&&!!os&&(0,z.jsxs)(l.default,{style:[d.s.row,{gap:8}],children:[(0,z.jsxs)(d.T,{style:{fontSize:11,color:d.C.red},children:[Vs?'Not updated - these numbers are for an earlier version':'Could not calculate',` (${os})`]}),(0,z.jsx)(d.Button,{label:"Retry",kind:"outline",onPress:()=>us(e=>e+1)})]})]}),(0,z.jsx)(C.PayoffChart,{curve:Vs?.curve||[],spot:Vs?.spot||Me?.spot||0,scenarioSp
1081ot:Vs?.scenario?.spot,breakevens:Vs?.breakevens?.value||[],bands:(Vs?.scenario?.active&&Vs?.sd?.bands_to_date?.length?Vs.sd.bands_to_date:Vs?.sd?.bands)||[],dim:Ns,scenarioLabel:Vs?.scenario?.is_expiry?'Scenario (expiry)':`Scenario ${Vs?.scenario?(0,$.istStamp)(Vs.scenario.at):''}`,expiryLabel:H(Vs),empty:'incomplete'===Vs?.status?'No payoff: a leg is not a listed contract, and the rest is a different position.':void 0}),(0,z.jsx)(K,{body:ke,chain:Me,expiry:ke.expiry,onChange:e=>xs(t=>({...t,scenario:e})),result:Vs,state:yt})]});if(J){const e=le||720,t=Ke,a=ue?'table'===Ye?'table':'greeks2'===Ye?'greeks':'chart':'chart',o='chart'!==a,c=ue?Math.max(260,e-212):Math.max(240,Math.round(.46*e)),u=Vs?.max_loss,p=Vs?.max_profit,h=Vs?.breakevens?.value||[],x=D(Vs?.costs?.round_trip)??D(Vs?.charges?.value),m=Vs?.costs||{},j=m.net_all_basis,S=D(m.max_loss_net_all)??(null!=u?.value&&null!=x?u.value-x:u?.value),k=D(m.max_profit_net_all)??(null!=p?.value&&null!=x?p.value-x:p?.value),w=({k:e,v:t,c:s})=>(0,z.jsxs)(d.T,{style:{fontSize:12,color:d.C.muted},children:[e," ",(0,z.jsx)(d.T,{style:{fontSize:13,fontFamily:'InterSemi',color:s||d.C.ink,fontVariant:['tabular-nums']},children:t})]}),T=(0,z.jsxs)(l.default,{style:{height:e,padding:12,gap:8},children:[(0,z.jsxs)(l.default,{style:[d.s.row,{gap:10}],children:[(0,z.jsx)(i.default,{value:at,onChangeText:ot,maxLength:80,accessibilityLabel:"Strategy name",style:{fontFamily:'ManropeBold',fontSize:15,color:d.C.ink,flex:1,minWidth:120,paddingVertical:2}}),(0,z.jsx)(d.T,{style:{fontSize:11,color:'dirty'===ze?d.C.amber:d.C.muted},children:'dirty'===ze?'Edited \xb7 not saved':'Not saved'}),(0,z.jsx)(d.Button,{label:"Save to My strategies",icon:"save",onPress:As,disabled:!ke.legs.length,style:{minHeight:34,paddingVertical:6}})]}),(0,z.jsxs)(l.default,{style:[d.s.row,{gap:16,flexWrap:'wrap',opacity:Ns?.5:1}],children:[(0,z.jsxs)(l.default,{title:(j?`At expiry, ${j}`:"At expiry, after estimated charges"+(null!=x?` (${(0,$.inr)(x)} entry + exit)`:''))+`${p?.basis?`. Max profit: ${p.basis}`:''}${u?.basis?`. Max loss: ${u.basis}`:''}`,style:[d.s.row,{gap:16}],children:[(0,z.jsx)(w,{k:"Max loss",v:u?.unlimited?'Unlimited':(0,$.inr)(S),c:d.C.heatDn2}),(0,z.jsx)(w,{k:"Max profit",v:p?.unlimited?'Unlimited':(0,$.inr)(k),c:d.C.heatUp2}),(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:j?"after charges + slippage":"after charges"})]}),(0,z.jsx)(w,{k:"Breakeven",v:h.length?h.map(e=>Math.round(e).toLocaleString('en-IN')).join(' \xb7 '):'\u2014'}),ue&&'available'===Vs?.greeks?.status&&(0,z.jsxs)(d.T,{style:{fontSize:12,color:d.C.muted},children:['\u0394 ',(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.ink,fontVariant:['tabular-nums']},children:(0,$.num)(Vs.greeks.delta,1)}),' \u0398 ',(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.ink,fontVariant:['tabular-nums']},children:(0,$.num)(Vs.greeks.theta,0)}),' V ',(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.ink,fontVariant:['tabular-nums']},children:(0,$.num)(Vs.greeks.vega,0)})]}),ce]}),(0,z.jsx)(l.default,{style:[d.s.row,{gap:6}],children:(ue?['chart','table','greeks']:['chart','table']).map(e=>{const t=e===a;return(0,z.jsx)(n.default,{onPress:()=>Ge('table'===e?'table':'greeks'===e?'greeks2':'greeks'),accessibilityRole:"button",accessibilityState:{selected:t},style:e=>({height:32,minWidth:120,paddingHorizontal:14,borderRadius:8,alignItems:'center',justifyContent:'center',borderWidth:1,borderColor:t?d.C.green:d.C.line,backgroundColor:t?d.C.soft:e.hovered?d.C.hoverBg:'transparent'}),children:(0,z.jsx)(d.T,{style:{fontSize:13,fontFamily:t?'InterSemi':'InterMedium',color:t?d.C.green:d.C.ink},children:'chart'===e?'Strategy chart':'table'===e?'Payoff table':'Greeks'})},e)})}),o?(0,z.jsx)(r.default,{style:{height:c+24},contentContainerStyle:{paddingRight:6},children:'greeks'===a?(0,z.jsx)(X,{a:Vs,compact:!0}):(0,z.jsx)(ee,{a:Vs,tint:!0})}):(0,z.jsx)(l.default,{onLayout:e=>Qe(Math.round(e.nativeEvent.layout.width)),children:(0,z.jsx)(C.PayoffChart,{premium:!0,width:t||void 0,height:c,curve:Vs?.curve||[],spot:Vs?.spot||Me?.spot||0,scenarioSpot:Vs?.scenario?.spot,breakevens:h,bands:(Vs?.scenario?.active&&Vs?.sd?.bands_to_date?.length?Vs.sd.bands_to_date:Vs?.sd?.bands)||[],dim:Ns,scenarioLabel:Vs?.scenario?.active?`P&L ${O(Vs)}`:'Today (model)',expiryLabel:H(Vs),empty:'incomplete'===Vs?.status?'No payoff: a leg is not a listed contract.':void 0})}),(0,z.jsx)(K,{compact:!0,body:ke,chain:Me,expiry:ke.expiry,onChange:e=>xs(t=>({...t,scenario:e})),result:Vs,state:yt}),!ue&&(0,z.jsxs)(l.default,{style:[B,{flex:1,minHeight:240,padding:0,gap:0,overflow:'hidden'}],children:[(0,z.jsx)(l.default,{style:[d.s.row,{gap:6,padding:8,borderBottomWidth:1,borderColor:d.C.line}],children:(ue?['greeks']:['legs','pnl','greeks','table']).map(e=>
1081(0,z.jsx)(d.Chip,{active:Ye===e,onPress:()=>Ge(e),label:{legs:`Legs (${ke.legs.length})`,pnl:'P&L by leg',greeks:'Greeks',table:'Payoff table'}[e]},e))}),(0,z.jsxs)(r.default,{style:{flex:1},contentContainerStyle:{padding:10,paddingBottom:24},showsVerticalScrollIndicator:!0,children:['legs'===Ye&&(0,z.jsx)(l.default,{style:{gap:8},children:Ds}),'legs'!==Ye&&(0,z.jsxs)(l.default,{style:{opacity:Ns?.5:1},children:['pnl'===Ye&&(0,z.jsx)(Z,{compact:!0,a:Vs}),('greeks'===Ye||ue&&'table'===Ye)&&(0,z.jsx)(X,{a:Vs,compact:!!ue}),!ue&&'table'===Ye&&(0,z.jsx)(ee,{a:Vs})]})]})]}),(0,z.jsx)(b.ChainDrawer,{visible:Ne,chain:Me,legs:ke.legs,state:yt,status:dt,onClose:()=>Ue(!1),onToggle:(e,t,s,n,r)=>$s(e,t,s,r)}),(0,z.jsx)(y.TemplateSheet,{visible:Oe,onClose:()=>De(!1),onPick:Ms,replacing:ke.legs.length}),(0,z.jsx)(g.SpreadsSheet,{visible:vt,onClose:()=>St(!1),underlying:ke.underlying,expiry:ke.expiry,lots:Math.max(1,Math.min(...ke.legs.length?ke.legs.map(e=>e.lots):[1])),onPick:(e,t,s)=>{St(!1);const n=e.map(e=>({id:L(),type:e.type,side:e.side,strike:e.strike,lots:e.lots,expiry:e.expiry,price_basis:'exec',price:null,include:!0}));xs(e=>({...e,template:t,param:[2,4,6,8].includes(s)?s:null,legs:n}))}}),(0,z.jsx)(f.LegSheet,{leg:Rt,chain:Me,moveStrike:ws,onClose:()=>Bt(null),onRemove:_s,expiries:Ie,onApply:e=>{Bt(null),xs(t=>{const s=t.legs.map(t=>t.id===e.id?e:t),n=s.map(e=>e.expiry).sort()[0]||t.expiry;return{...t,template:null,legs:s,expiry:n}})}}),(0,z.jsx)(g.AboutSheet,{visible:kt,onClose:()=>wt(!1),a:Vs,templateKey:Vs?.structure?.exact?Vs.structure.key:null}),!!tt&&(0,z.jsx)(l.default,{style:{position:'absolute',bottom:12,left:0,right:0,alignItems:'center',zIndex:50},children:(0,z.jsx)(l.default,{style:{backgroundColor:d.C.paper,borderWidth:1,borderColor:d.C.green,borderRadius:12,paddingHorizontal:14,paddingVertical:8},children:(0,z.jsx)(d.T,{style:{fontSize:12},children:tt})})})]});if(!ue)return T;const _=pe?(0,z.jsx)(r.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:8},children:sn}):(0,z.jsx)(l.default,{style:{borderBottomWidth:1,borderColor:d.C.line,maxHeight:Math.round(.55*e)},children:(0,z.jsx)(r.default,{contentContainerStyle:{padding:12,gap:8},children:sn})}),P=(e,t)=>ke.legs.find(s=>s.strike===e&&s.type===t&&(s.expiry||ke.expiry)===Me?.expiry),I=(e,t,s)=>['B','S'].map(r=>{const i=P(e,t)?.side===r,l='B'===r?d.C.green:d.C.red;return(0,z.jsx)(n.default,{disabled:null==s,accessibilityRole:"button",accessibilityLabel:`${'B'===r?'Buy':'Sell'} ${(0,$.strikeText)(e)} ${t}`,onPress:()=>Me&&$s(e,t,r,Me.expiry),style:e=>({width:24,height:22,borderRadius:5,alignItems:'center',justifyContent:'center',borderWidth:1,borderColor:i?l:d.C.line,backgroundColor:i?'B'===r?d.C.soft:d.C.redBg:e.hovered?d.C.hoverBg:'transparent',opacity:null==s?.3:1}),children:(0,z.jsx)(d.T,{style:{fontSize:11,fontFamily:'InterSemi',color:i?l:d.C.muted},children:r})},r)}),R=Me?(()=>{const e=Me.rows.findIndex(e=>e.strike>=Me.atm_strike);return Me.rows.slice(Math.max(0,e-12),Math.max(0,e)+13)})():[],M=[['oi','OI'],['volume','Volume'],['iv','IV'],['delta','Delta'],['gamma','Gamma'],['pcr','PCR']],W=Me?Math.max(Me.days_to_expiry,.01)/365:null,E=(e,t,s,n)=>{if(!e)return'\u2014';if('oi'===n||'volume'===n){const t=e[n];return null==t?'\u2014':Math.abs(t)>=1e5?`${(t/1e5).toFixed(1)}L`:Math.abs(t)>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}if('iv'===n)return null==e.iv?'\u2014':`${Number(e.iv).toFixed(1)}`;const r=(0,v.greeks)(Me?.spot??null,t,W,0,e.iv??null,s);return r?'delta'===n?r.delta.toFixed(2):r.gamma.toFixed(4):'\u2014'},A=Xe.filter(e=>'pcr'!==e),F=Xe.includes('pcr'),V=56,N=174+(1+A.length)*V*2+(F?V:0)+16+4*(6+2*A.length),U=(e,t="right",s=d.C.ink,n=!1)=>(0,z.jsx)(d.T,{numberOfLines:1,style:{width:V,fontSize:12,textAlign:t,color:s,fontFamily:n?'InterSemi':'Inter',fontVariant:['tabular-nums']},children:e}),q=(0,z.jsxs)(l.default,{style:{flex:1,minHeight:0},children:[(0,z.jsx)(l.default,{style:[d.s.row,{gap:4,paddingHorizontal:8,paddingVertical:6,flexWrap:'wrap',borderBottomWidth:1,borderColor:d.C.line}],children:M.map(([e,t])=>{const s=Xe.includes(e);return(0,z.jsx)(n.default,{role:"checkbox","aria-checked":s,onPress:()=>et(t=>s?t.filter(t=>t!==e):[...t,e]),style:e=>({height:24,paddingHorizontal:8,borderRadius:6,justifyContent:'center',borderWidth:1,borderColor:s?d.C.green:d.C.line,backgroundColor:s?d.C.soft:e.hovered?d.C.hoverBg:'transparent'}),children:(0,z.jsx)(d.T,{style:{fontSize:11,color:s?d.C.green:d.C.muted,fontFamily:s?'InterSemi':'Inter'},children:t})},e)})}),(0,z.jsx)(r.default,{horizontal:!0,style:{flex:1},contentContainerStyle:{minWidth:'100%'},children:(0,z.jsxs)(l.default,{style:{flex:1,minWidth:N},children:[(0,z.jsxs)(l.default,{style:[d.s.row,{height:28,paddingHorizontal:8,borderBottomWidth:1,borderColor:d.C.line,ga
1081p:4}],children:[(0,z.jsx)(d.T,{style:{width:52,fontSize:11,color:d.C.heading,fontFamily:'InterSemi'},children:"Call"}),[...A].reverse().map(e=>(0,z.jsx)(s.default.Fragment,{children:U(M.find(t=>t[0]===e)[1],'right',d.C.heading,!0)},e)),U('LTP','right',d.C.heading,!0),(0,z.jsx)(l.default,{style:{flex:1}}),(0,z.jsx)(d.T,{style:{width:70,fontSize:11,color:d.C.heading,fontFamily:'InterSemi',textAlign:'center'},children:"Strike"}),F&&U('PCR','center',d.C.heading,!0),(0,z.jsx)(l.default,{style:{flex:1}}),U('LTP','left',d.C.heading,!0),A.map(e=>(0,z.jsx)(s.default.Fragment,{children:U(M.find(t=>t[0]===e)[1],'left',d.C.heading,!0)},e)),(0,z.jsx)(d.T,{style:{width:52,fontSize:11,color:d.C.heading,fontFamily:'InterSemi',textAlign:'right'},children:"Put"})]}),Me?(0,z.jsx)(r.default,{style:{flex:1},children:R.map(e=>{const t=e.strike===Me.atm_strike,n=e.CE?.ltp??null,r=e.PE?.ltp??null,i=e.CE?.oi&&null!=e.PE?.oi?(e.PE.oi/e.CE.oi).toFixed(2):'\u2014';return(0,z.jsxs)(l.default,{style:[d.s.row,{height:30,paddingHorizontal:8,gap:4,borderBottomWidth:1,borderColor:d.C.lineSoft,backgroundColor:t?d.C.blueBg:'transparent'}],children:[(0,z.jsx)(l.default,{style:[d.s.row,{width:52,gap:4}],children:I(e.strike,'CE',n)}),[...A].reverse().map(t=>(0,z.jsx)(s.default.Fragment,{children:U(E(e.CE,e.strike,'CE',t),'right',d.C.muted)},t)),U((0,$.num)(n)),(0,z.jsx)(l.default,{style:{flex:1}}),(0,z.jsx)(d.T,{style:{width:70,fontSize:12,textAlign:'center',fontFamily:'InterSemi',color:t?d.C.blue:d.C.ink,fontVariant:['tabular-nums']},children:(0,$.strikeText)(e.strike)}),F&&U(i,'center',d.C.muted),(0,z.jsx)(l.default,{style:{flex:1}}),U((0,$.num)(r),'left'),A.map(t=>(0,z.jsx)(s.default.Fragment,{children:U(E(e.PE,e.strike,'PE',t),'left',d.C.muted)},t)),(0,z.jsx)(l.default,{style:[d.s.row,{width:52,gap:4,justifyContent:'flex-end'}],children:I(e.strike,'PE',r)})]},e.strike)})}):(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted,padding:12},children:Ot||'Reading the chain\u2026'})]})})]});return(0,z.jsx)(z.Fragment,{children:ue({legs:_,right:T,chain:q})})}return(0,z.jsxs)(l.default,{style:{padding:J?12:me?22:14,gap:J?12:16,maxWidth:J?void 0:1500,width:'100%',alignSelf:'center'},children:[fe?(0,z.jsxs)(l.default,{style:[d.s.row,{flexWrap:'wrap',gap:10}],children:[(0,z.jsx)(i.default,{value:at,onChangeText:ot,maxLength:80,accessibilityLabel:"Strategy name",style:{fontFamily:'ManropeBold',fontSize:15,color:d.C.ink,minWidth:180,flex:1,paddingVertical:4,borderBottomWidth:1,borderColor:d.C.line}}),(0,z.jsx)(d.T,{style:{fontSize:11,color:'dirty'===ze?d.C.amber:d.C.muted},children:'dirty'===ze?'Edited \xb7 not saved':'Scratch copy \xb7 not saved'}),(0,z.jsx)(d.Button,{label:"Save to My strategies",icon:"save",onPress:As,disabled:!ke.legs.length})]}):(0,z.jsxs)(l.default,{style:[d.s.between,{flexWrap:'wrap',gap:10}],children:[(0,z.jsxs)(l.default,{style:[d.s.row,{flexWrap:'wrap',gap:10,flex:1,minWidth:280}],children:[(0,z.jsxs)(n.default,{accessibilityRole:"button",accessibilityLabel:"Back to My Strategies",onPress:()=>{ie(),ys(es.current),o.router.replace('/strategies')},style:[d.s.row,{gap:4}],children:[(0,z.jsx)(d.Icon,{name:"chevron-left",size:16,color:d.C.muted}),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:"My Strategies"})]}),(0,z.jsx)(i.default,{value:at,onChangeText:ot,onBlur:Fs,onSubmitEditing:Fs,maxLength:80,accessibilityLabel:"Strategy name",style:{fontFamily:'ManropeBold',fontSize:22,color:d.C.ink,minWidth:220,flex:1,paddingVertical:4,borderBottomWidth:1,borderColor:d.C.line}}),(0,z.jsx)(E,{state:ze,version:$e}),'error'===ze&&(0,z.jsx)(d.Button,{label:"Retry now",icon:"refresh-cw",kind:"outline",onPress:()=>Cs()})]}),be?(0,z.jsxs)(l.default,{style:[d.s.row,{gap:8,width:'100%'}],children:[(0,z.jsx)(d.Button,{label:xt?'Review orders':'Paper trade',icon:"play",onPress:()=>vs(()=>xt?bt({open:!0}):qe(!0)),disabled:!ke.legs.length||!Vs||'invalid'===Vs.status}),(0,z.jsx)(d.Button,{label:"Undo",icon:"rotate-ccw",kind:"outline",disabled:!_t.u,accessibilityLabel:"Undo the last change",onPress:bs}),(0,z.jsx)(d.Button,{label:"More",icon:"more-horizontal",kind:"outline",accessibilityLabel:"More actions",onPress:()=>Wt(!0)})]}):(0,z.jsxs)(l.default,{style:[d.s.row,{flexWrap:'wrap',gap:8,width:me?void 0:'100%'}],children:[(0,z.jsx)(d.Button,{label:"Undo",icon:"rotate-ccw",kind:"outline",disabled:!_t.u,accessibilityLabel:"Undo the last change",onPress:bs}),(0,z.jsx)(d.Button,{label:"Redo",icon:"rotate-cw",kind:"outline",disabled:!_t.r,accessibilityLabel:"Redo",onPress:js}),(0,z.jsx)(d.Button,{label:"Prove in Lab",icon:"activity",kind:"outline",disabled:!ke.legs.length,onPress:()=>vs(()=>o.router.push({pathname:'/strategies',params:{view:'lab',strategy:e,v:String(Xt.current),underlying:ke.underlying,lots:String(Math.min(...ke.legs.map(e=>e.lots))),structure:Vs?.structure?.name||'',...Vs?.structure?.exact&&Vs.structure.key?{template:Vs.structure.key,...ke.template===Vs.structure.key&&null!=ke.param?{param:String(ke.param)}:{}}:{mode:'replay'}}}))}),(0,z.jsx)(d.Button,{label:"Adjust",icon:"sliders",kind:"outline",disabled:!ke.legs.length,onPress:()=>vs(()=>Ct({open:!0,deployment:ht.find(e=>'active'===e.status)||null}))}),(0,z.jsx)(d.Button,{label:"Save snapshot",icon:"bookmark",kind:"outline",onPress:Ws,disabled:!ke.legs.length}),(0,z.jsx)(d.Button,{label:Gt.count?`Alerts (${Gt.count})`:'Alerts',icon:"bell",kind:"outline",onPress:()=>vs(()=>Vt(!0))}),(0,z.jsx)(d.Button,{label:"Duplicate",icon:"copy",kind:"outline",onPress:Es}
1081),(0,z.jsx)(d.Button,{label:xt?'Review paper orders':'Paper trade',icon:"play",onPress:()=>vs(()=>xt?bt({open:!0}):qe(!0)),disabled:!ke.legs.length||!Vs||'invalid'===Vs.status})]})]}),ls&&(0,z.jsxs)(l.default,{accessibilityRole:"alert",style:{backgroundColor:d.C.amberBg,borderRadius:10,padding:12,gap:8},children:[(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.amber},children:"This strategy was saved from another window or device after your last save. Your edits on this screen are kept - nothing was overwritten. Choose where they go:"}),(0,z.jsxs)(l.default,{style:[d.s.row,{flexWrap:'wrap',gap:8}],children:[(0,z.jsx)(d.Button,{label:"Keep mine as a new copy",kind:"outline",onPress:async function(){if(!ls)return;const t=es.current||ls.local;try{const s=await u.sb.create(t,`${je?.name||'Strategy'} (my edits)`);de(e),as(null),o.router.replace({pathname:'/strategies',params:{id:s.id}}),ps('Your edits were saved as a new strategy. The original is unchanged.')}catch(e){ps(R(e))}}}),(0,z.jsx)(d.Button,{label:"Replace the other version with mine",kind:"outline",onPress:async function(){if(!ls)return;const t=es.current||ls.local;try{const s=await u.sb.get(e),n=await u.sb.save(e,s.draft.version,t);de(e),as(null),is.current='saved',ms(),es.current=t,ts.current=re(t),ss.current=n.draft.checksum||'',Xt.current=n.draft.version,we(t),Te(n.draft.version),Pe('saved'),ps('Your version replaced the other copy as a new draft version.')}catch(e){ps(R(e))}}}),(0,z.jsx)(d.Button,{label:"Discard mine, load the newer copy",kind:"outline",onPress:async function(){ms(),de(e),as(null),is.current='saved',es.current=null,ts.current='',Xt.current=0,await hs(),ps('Loaded the newer saved copy. Your local edits were discarded.')}})]})]}),!J&&(0,z.jsx)(A,{reading:Os,priced:Me?.reading||Vs?.reading||null,live:!!Me?.quality.live,status:dt}),Me&&ke.legs.length>0&&Me.days_to_expiry<1&&(0,z.jsxs)(l.default,{style:{backgroundColor:Me.days_to_expiry<=0?d.C.redBg:d.C.amberBg,borderRadius:10,padding:10},accessibilityRole:"alert",children:[Me.days_to_expiry<=0&&(0,z.jsx)(l.default,{style:{marginBottom:6,alignSelf:'flex-start'},children:(0,z.jsx)(d.Button,{label:"Repair as a new draft",icon:"copy",kind:"outline",onPress:async function(){const e=es.current;if(!e)return;const t=Ie.find(e=>(e.days_to_expiry??0)>=1);if(t)try{const s=(await u.sb.chain(e.underlying,t.expiry)).rows.filter(e=>null!=e.CE?.ltp||null!=e.PE?.ltp).map(e=>e.strike);if(!s.length)return void ps('The new expiry has no priced strikes yet.');const n=e=>s.reduce((t,s)=>Math.abs(s-e)<Math.abs(t-e)?s:t,s[0]),r=e.legs.map(e=>({...e,expiry:t.expiry,strike:n(e.strike),price_basis:'exec',price:null})),i=e.legs.filter((e,t)=>r[t].strike!==e.strike).length,l=await u.sb.create({...e,expiry:t.expiry,legs:r,scenario:{}},`${je?.name||'Strategy'} (repaired to ${(0,$.dayMonth)(t.expiry)})`,je?.thesis||'');o.router.replace({pathname:'/strategies',params:{id:l.id}}),ps(`Repaired as a NEW draft on ${(0,$.dayMonth)(t.expiry)}${i?` - ${i} strike${i>1?'s':''} moved to the nearest listed`:''}. The expired original is unchanged.`)}catch(e){ps(R(e))}else ps('No listed expiry with a full day left to repair into.')}})}),(0,z.jsx)(d.T,{style:{fontSize:12,color:Me.days_to_expiry<=0?d.C.red:d.C.amber},children:Me.days_to_expiry<=0?`Expired: the ${(0,$.dayMonth)(ke.expiry)} contracts have settled and can no longer be traded. "Repair as a new draft" copies the structure to the next expiry and keeps this one as it is.`:"Expiry day: these contracts settle today at 15:30 IST. Premiums and Greeks move very fast now - small moves swing the P&L sharply."})]}),!J&&(0,z.jsx)(f.UnderlyingPicker,{list:Re,value:ke.underlying,onPick:e=>{if(e!==ke.underlying){if(ke.legs.length&&'undefined'!=typeof window&&!window.confirm('Switching the underlying clears the current legs. Continue?'))return;xs(t=>({...t,underlying:e,expiry:'',legs:[],template:null,scenario:{}}))}}}),!J&&(0,z.jsx)(j.ExpiryChips,{expiries:Ie,selected:ke.expiry,onMore:()=>At(!0),onSelect:e=>e===ke.expiry?null:Us?ps('This strategy spans expiries - change each leg\'s expiry in its editor.'):ke.legs.length?At(!0):xs(t=>({...t,expiry:e,scenario:{...t.scenario,at:void 0}}))}),!J&&!!(0,w.chainBasisText)(Me)&&(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted,fontVariant:['tabular-nums']},accessibilityLabel:`Pricing basis: ${(0,w.chainBasisText)(Me)}`,children:(0,w.chainBasisText)(Me)}),!!Ot&&(0,z.jsx)(x.ErrorRetry,{what:"The option chain",error:Ot,onRetry:()=>qt(e=>e+1)}),Pt&&(0,z.jsxs)(l.default,{accessibilityRole:"alert",style:{backgroundColor:Pt.blocked?d.C.redBg:d.C.soft,borderWidth:1,borderColor:Pt.blocked?d.C.red:d.C.green,borderRadius:12,padding:12,gap:6},children:[(0,z.jsx)(d.T,{style:{fontFamily:'InterSemi',color:Pt.blocked?d.C.red:d.C.ink},children:Pt.blocked?`${Pt.title}: not possible`:`Preview - ${Pt.title}`}),Pt.blocked?(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.red},children:Pt.blocked}):Pt.lines.map((e,t)=>(0,z.jsx)(d.T,{style:{fontSize:12,fontVariant:['tabular-nums']},children:e},t)),(0,z.jsxs)(l.default,{style:[d.s.row,{gap:8}],children:[!Pt.blocked&&(0,z.jsx)(d.Button,{label:"Apply",icon:"check",onPress:()=>{const e=Pt;Lt(null),e.base===re(es.current)?(xs(e.apply),ps('Applied. Undo brings back the previous legs.')):ps('The strategy changed after this preview, so it was not applied. Run the change again.')}}
1081),(0,z.jsx)(d.Button,{label:Pt.blocked?'OK':'Cancel',kind:"outline",onPress:()=>Lt(null)})]})]}),(0,z.jsxs)(l.default,{style:{flexDirection:me?'row':'column-reverse',gap:16,alignItems:me?'flex-start':'stretch'},children:[Ds,(0,z.jsxs)(l.default,{style:{flex:me?55:void 0,width:me?void 0:'100%',gap:16},children:[J&&nn,(0,z.jsx)(G,{a:Vs,dim:Ns,onFix:function(e){const t=es.current;if(t&&e){if('snap_tick'===e.action)return Ts(e.leg_id,{price_basis:'manual',price:e.price}),void ps(`Price set to ${e.price}, on the exchange tick.`);if('change_expiry'!==e.action)if('open_adjust'!==e.action){if('add_hedge'===e.action){const s=[];for(const n of e.types){const e=t.legs.filter(e=>e.type===n).reduce((e,t)=>e+('B'===t.side?1:-1)*t.lots,0);if(e>=0)continue;const r=t.legs.filter(e=>e.type===n&&'S'===e.side),i=r.map(e=>e.strike),l='CE'===n?Math.max(...i):Math.min(...i),a=ks.indexOf(l),o='CE'===n?a+2:a-2;if(a<0||o<0||o>=ks.length)return void ps(`No listed strike two steps beyond ${(0,$.strikeText)(l)} ${n} to hedge with.`);const d=r.map(e=>e.expiry).sort().reverse()[0]||t.expiry;s.push({id:L(),type:n,side:'B',strike:ks[o],lots:-e,expiry:d,price_basis:'exec',price:null,include:!0})}if(!s.length)return void ps('Nothing to hedge.');Lt({title:'Add a hedge',lines:s.map(e=>`Add: ${(0,$.legText)(e)} (two strikes beyond the furthest short)`),apply:e=>({...e,template:null,legs:[...e.legs,...s]})})}}else vs(()=>Ct({open:!0,deployment:ht.find(e=>'active'===e.status)||null}));else At(!0)}}}),!!ke.origin&&(0,z.jsx)(U,{o:ke.origin,a:Vs,edited:ke.template!==ke.origin.template}),!fe&&(0,z.jsx)(ge,{id:e,version:$e,onOpen:t=>o.router.push({pathname:'/strategies',params:{view:'lab',strategy:e}})}),!J&&nn,!!Vs?.warnings?.length&&(0,z.jsx)(l.default,{style:[B,{borderColor:d.C.amberLine,backgroundColor:d.C.amberBg,gap:6}],children:Vs.warnings.map((e,t)=>(0,z.jsxs)(l.default,{style:[d.s.row,{alignItems:'flex-start',gap:8}],children:[(0,z.jsx)(d.Icon,{name:"alert-triangle",size:13,color:d.C.amber}),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.amber,flex:1},children:e})]},t))}),(0,z.jsxs)(l.default,{style:B,children:[(0,z.jsx)(l.default,{style:[d.s.row,{flexWrap:'wrap',gap:6}],children:(fe?['pnl','greeks','table']:['pnl','greeks','table','snapshots','paper','alerts','activity']).map(e=>(0,z.jsx)(d.Chip,{active:Ye===e,onPress:()=>Ge(e),label:{legs:'Legs',pnl:'P&L by leg',greeks:'Greeks',table:'Payoff table',snapshots:`Snapshots (${je.snapshots.length})`,paper:`Paper (${it.length+ht.length})`,alerts:"Alerts"+(Gt.count?` (${Gt.count})`:''),activity:'Activity'}[e]},e))}),('pnl'===Ye||'greeks'===Ye||'table'===Ye)&&(!Vs&&Fe?(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},accessibilityLiveRegion:"polite",children:"Calculating\u2026"}):'incomplete'===Vs?.status?(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.red},children:"Unavailable until every included leg resolves to a listed contract."}):(0,z.jsxs)(l.default,{style:{opacity:Ns?.5:1},children:[Ns&&(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.amber},children:Fe?'Updating - these values are for the previous version.':'Not updated - these values are for an earlier version.'}),'pnl'===Ye&&(0,z.jsx)(x.Scrollable,{narrow:be,min:720,children:(0,z.jsx)(Z,{a:Vs})}),'greeks'===Ye&&(0,z.jsx)(x.Scrollable,{narrow:be,min:560,children:(0,z.jsx)(X,{a:Vs})}),'table'===Ye&&(0,z.jsx)(ee,{a:Vs})]})),'snapshots'===Ye&&(0,z.jsx)(te,{detail:je,onView:Ut,onRestore:t=>vs(async()=>{try{const s=await u.sb.restore(e,t,Xt.current);ms(),es.current=s.draft.body,ts.current=re(s.draft.body),ss.current=s.draft.checksum||'',Xt.current=s.draft.version,we(s.draft.body),Te(s.draft.version),Pe('saved'),ps('Snapshot restored as a new draft version.')}catch(e){ps(R(e)),hs()}}),onDuplicate:async t=>{try{const s=await u.sb.duplicate(e,t);o.router.replace({pathname:'/strategies',params:{id:s.id}})}catch(e){ps(R(e))}}}),'paper'===Ye&&(0,z.jsxs)(l.default,{style:{gap:10},children:[ht.map(e=>(0,z.jsxs)(l.default,{style:{gap:6},children:[(0,z.jsx)(p.DeploymentCard,{d:e,onChanged:gs,onClose:e=>bt({open:!0,closing:e}),onAdjust:e=>Ct({open:!0,deployment:e})}),(0,z.jsx)(l.default,{style:{alignSelf:'flex-start'},children:(0,z.jsx)(d.Button,{label:"Open monitor",icon:"external-link",kind:"outline",onPress:()=>o.router.push({pathname:'/strategies',params:{view:'deployment',id:e.id}})})})]},e.id)),!ht.length&&xt&&(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:"No paper deployments yet. \"Review paper orders\" builds the exact plan from live quotes."})]}),'paper'===Ye&&(0,z.jsx)(se,{runs:it,state:yt,onClose:async e=>{try{const t=await u.sb.paperClose(e);ps('close_pending'===t?.status?'Exit queued - it fills at the next open. No order was sent.':'Paper run closed at the stored reading.')}finally{gs(),hs()}},onCancel:async e=>{try{const t=await u.sb.paperCancel(e);ps('open'===t?.status?'Queued exit withdrawn - the paper run stays open.':'Queued paper trade cancelled. Nothing was filled.')}finally{gs(),hs()}},onOpen:()=>o.router.push({pathname:'/strategies',params:{view:'paper'}})}),'alerts'===Ye&&(0,z.jsx)(m.AlertsPanel,{strategyId:e,analysis:Vs,deployments:ht,expiry:ke.expiry,onChanged:hs}),'activity'===Ye&&(0,z.jsx)(l.default,{style:{gap:6},children:je.activity.map((e,t)=>(0,z.jsxs)(l.default,{style:[d.s.between,{borderTopWidth:1,borderColor:d.C.line,paddingTop:6}],children:[(0,z.jsx)(d.T,{style:{fontSize:12,flex:1},children:e.detail}),(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:(0,$.istEpoch)(e.created_at)})]},t))})]})]})]}),(0,z.jsx)(b.ChainDrawer,{visible:Ne,chain:Me,legs:ke.legs,state:yt,status:dt,onClose:()=>Ue(!1),onToggle:(e,t,s,n,r)=>$s(e,t,s,r)}),(0,z.jsx)(g.SpreadsSheet,{visible:vt,onClose:()=>St(!1),underlying:ke.underlying,expiry:ke.expiry,lots:Math.max(1,Math.min(...ke.legs.length?ke.legs.map(e=>e.lots):[1])),onPick:(e,t,s)=>{St(!1);const n=e.map((e,t)=>({id:L(),type:e.type,side:e.side,strike:e.strike,lots:e.lots,expiry:e.expiry,price_basis:'exec',price:null,include:!0})),r=e=>({...e,template:t,param:[2,4,6,8].includes(s)?s:null,legs:n});es.current?.legs.length?Lt({title:`Replace ${es.current.legs.length} leg${es.current.legs.length>1?'s':''} with this spread`,lines:[...es.current.legs.map(e=>`Remove: ${(0,$.legText)(e)}`),...n.map(e=>`Add: ${(0,$.legText)(e)}`)],apply:r}):(xs(r),ps('Spread loaded - every leg stays editable.'))}}),(0,z.jsx)(g.AboutSheet,{visible:kt,onClose:()=>wt(!1),a:Vs,templateKey:Vs?.structure?.exact?Vs.structure.key:null}
1081),(0,z.jsx)(h.AdjustSheet,{visible:jt.open,strategyId:e,version:$e,deployment:jt.deployment||null,onClose:()=>Ct({open:!1}),onApplied:async e=>{const t=jt.deployment;Ct({open:!1}),await hs(),ps(`${e.adjustment.name} saved as a new version.${t?' Review the delta orders next.':''}`),t&&bt({open:!0,adjusting:t})}}),(0,z.jsx)(p.OrderReview,{visible:mt.open,strategyId:e,deployment:mt.closing||null,adjusting:mt.adjusting||null,onClose:()=>bt({open:!1}),draft:{expected_version:Xt.current,input_hash:ss.current},onPlaced:e=>{bt({open:!1}),ps(`Paper ${mt.closing?'close':mt.adjusting?'adjustment':'orders'} placed - deployment ${e.status.replace('_',' ')}. No order reached a broker.`),gs(),hs(),Ge('paper')}}),(0,z.jsx)(y.TemplateSheet,{visible:Oe,onClose:()=>De(!1),onPick:Ms,replacing:ke.legs.length}),(0,z.jsx)(f.LegSheet,{leg:Rt,chain:Me,moveStrike:ws,onClose:()=>Bt(null),onRemove:_s,expiries:Ie,onApply:e=>{Bt(null),xs(t=>{const s=t.legs.map(t=>t.id===e.id?e:t),n=s.map(e=>e.expiry).sort()[0]||t.expiry;return{...t,template:null,legs:s,expiry:n,scenario:n!==t.expiry?{...t.scenario,at:void 0}:t.scenario}})}}),(0,z.jsx)(f.ExpirySheet,{visible:Et,onClose:()=>At(!1),expiries:Ie,current:ke.expiry,underlying:ke.underlying,legs:ke.legs,onApply:e=>xs(t=>({...t,expiry:e,legs:t.legs.map(t=>({...t,expiry:e})),scenario:{...t.scenario,at:void 0}}))}),(0,z.jsx)(f.SnapshotSheet,{rid:Nt,onClose:()=>Ut(null),onSaved:hs}),(0,z.jsxs)(d.Sheet,{visible:Ft,onClose:()=>Vt(!1),wide:!0,title:"Alerts for this strategy",subtitle:"Notify only - an alert never places, changes or cancels an order.",children:[(0,z.jsx)(m.AlertsPanel,{strategyId:e,analysis:Vs,deployments:ht,expiry:ke.expiry,onChanged:hs}),(0,z.jsx)(d.Button,{label:"Open the alerts centre",kind:"outline",onPress:()=>{Vt(!1),o.router.push({pathname:'/strategies',params:{view:'alerts'}})}})]}),(0,z.jsx)(f.ActionsSheet,{visible:Mt,onClose:()=>Wt(!1),actions:[{label:'Redo',icon:'rotate-cw',disabled:!_t.r,onPress:js},{label:'Prove in Lab',icon:'activity',disabled:!ke.legs.length,onPress:()=>vs(()=>o.router.push({pathname:'/strategies',params:{view:'lab',strategy:e,v:String(Xt.current),underlying:ke.underlying,lots:String(Math.min(...ke.legs.map(e=>e.lots))),structure:Vs?.structure?.name||'',...Vs?.structure?.exact&&Vs.structure.key?{template:Vs.structure.key,...ke.template===Vs.structure.key&&null!=ke.param?{param:String(ke.param)}:{}}:{mode:'replay'}}}))},{label:'Adjust',icon:'sliders',disabled:!ke.legs.length,onPress:()=>vs(()=>Ct({open:!0,deployment:ht.find(e=>'active'===e.status)||null}))},{label:'Save snapshot',icon:'bookmark',disabled:!ke.legs.length,onPress:Ws},{label:Gt.count?`Alerts (${Gt.count})`:'Alerts',icon:'bell',onPress:()=>vs(()=>Vt(!0))},{label:'Duplicate',icon:'copy',onPress:Es}]}),(0,z.jsx)(ne,{visible:He,onClose:()=>qe(!1),a:Vs,body:ke,chain:Me,state:yt,onStart:async()=>{try{if(!await Cs())return'Your latest edit is not saved yet, so no paper run was started.';const t=`${e}:v${Xt.current}:${ss.current}`,s=ns.current?.sig===t?ns.current:{sig:t,key:`${e}:v${Xt.current}:${Math.random().toString(36).slice(2,10)}${Date.now().toString(36)}`};ns.current=s;const n=await u.sb.paperStart(e,{expected_version:Xt.current,input_hash:ss.current,request_id:s.key});return ns.current=null,qe(!1),ps(n.queued||'pending'===n.status?`Paper trade queued - it fills at the next open${n.pending?.fill_at_text?` (${n.pending.fill_at_text})`:''}. No order was sent.`:`Paper run started - ${n.fills.length} simulated fills. No order was sent.`),gs(),hs(),Ge('paper'),null}catch(e){return(0,k.actionErrorText)(e)}}}),!!tt&&(0,z.jsx)(l.default,{style:{position:'fixed',bottom:24,left:0,right:0,alignItems:'center',zIndex:50},children:(0,z.jsx)(l.default,{style:{backgroundColor:d.C.paper,borderWidth:1,borderColor:d.C.green,borderRadius:12,paddingHorizontal:16,paddingVertical:10,maxWidth:560},children:(0,z.jsx)(d.T,{style:{fontSize:13},children:tt})})})]})};var t=_r(_d[0]),s=e(t),n=e(_r(_d[1])),r=e(_r(_d[2])),i=e(_r(_d[3])),l=e(_r(_d[4])),a=e(_r(_d[5])),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),p=_r(_d[10]),h=_r(_d[11]),g=_r(_d[12]),y=_r(_d[13]),f=_r(_d[14]),x=_r(_d[15]),m=_r(_d[16]),b=_r(_d[17]),j=_r(_d[18]),C=_r(_d[19]),v=_r(_d[20]),S=_r(_d[21]),k=_r(_d[22]),w=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),_=_r(_d[26]),z=_r(_d[27]);const P=800,I=220,L=()=>'L'+Math.random().toString(36).slice(2,8),R=e=>e?.message||'KANIDA could not complete that.';const B={backgroundColor:d.C.paper,borderWidth:1,borderColor:d.C.line,borderRadius:12,padding:14,gap:12},M={fontFamily:'InterMedium',fontSize:11,letterSpacing:.6,textTransform:'uppercase',color:d.C.muted},W={paddingHorizontal:9,height:28,borderRadius:7,borderWidth:1,borderColor:d.C.line,justifyContent:'center'};function E({state:e,version:t}){const s={saved:['green',`Draft v${t} \xb7 saved`],dirty:['neutral','Unsaved changes\u2026'],saving:['neutral','Saving\u2026'],conflict:['amber','Version conflict - your edits are kept'],error:['red','Not saved']}[e];return(0,z.jsx)(d.Badge,{tone:s[0],label:s[1],dot:!0})}function A({reading:e,priced:t,live:s,status:n}){const r=n?.calendar?.warning||null;if(s&&!n)return null;if((0,k.marketBanner)(n?.market_state,t))return(0,z.jsx)(S.MarketStateBanner,{state:n?.market_state,reading:t,warning:r});const i=s&&!(0,k.liveAllowed)(n,s),a=s&&!i;return(0,z.jsxs)(l.default,{style:[d.s.row,{flexWrap:'wrap',gap:8,backgroundColor:a?d.C.soft:d.C.amberBg,borderRadius:10,paddingHorizontal:12,paddingVertical:8}],children:[(0,z.jsx)(d.Icon,{name:a?'radio':'clock',size:13,color:a?d.C.green:d.C.amber}),!!r&&(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.red,width:'100%'},children:r}),(0,z.jsx)(d.T,{style:{fontSize:12,color:a?d.C.green:d.C.amber,flex:1},children:i?`Market closed \xb7 Zerodha Kite \xb7 last quotes ${(0,$.istStamp)(e)}. Research and practice only - nothing here sends an order.`:s?`Live \xb7 Zerodha Kite \xb7 quotes ${(0,$.istStamp)(e)} \xb7 refreshes every 10 s${n?.market_open?' \xb7 market open':''}. Prices: buy at the ask, sell at the bid. Orders here are paper only.`:`${n?.user_message||'Live option prices are unavailable.'} Showing prices from ${(0,$.istStamp)(e)} (last traded, no bid/ask). Research and practice only - nothing here sends an order.`})]})}function F(){return(0,a.default)().width<700}function V({label:e,a11y:t,onMinus:s,onPlus:r}){const i=F(),a=i?44:28,o=(e,s,r)=>(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`${t}: ${r}`,onPress:s,hitSlop:i?void 0:{top:8,bottom:8},style:({pressed:e})=>({width:i?44:26,height:a,alignItems:'center',justifyContent:'center',opacity:e?.6:1}),children:(0,z.jsx)(d.Icon,{name:e,size:i?16:13,color:d.C.muted})});return(0,z.jsxs)(l.default,{style:[d.s.row,{gap:0,borderWidth:1,borderColor:d.C.line,borderRadius:7,height:a}],children:[o('minus',s,'decrease'),(0,z.jsx)(d.T,{style:{fontSize:12,fontFamily:'InterMedium',minWidth:44,textAlign:'center',fontVariant:['tabular-nums']},children:e}),o('plus',r,'increase')]})}function N({k:e,v:t}){return(0,z.jsxs)(l.default,{style:[d.s.row,{gap:5}],children:[(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:e}),(0,z.jsx)(d.T,{style:{fontSize:12,fontVariant:['tabular-nums']},children:t})]})}function U({o:e,a:t,edited:s}){const n='available'===t?.max_loss?.status?t.max_loss.value:null,r='available'===t?.pop?.status?t.pop.value:null,i=null!=e.max_loss&&(t?.max_loss?.unlimited||null!=n&&-n>e.max_loss),a='up'===e.view||'down'===e.view?`${e.view_label} to ${(0,$.num)(e.target,0)}`:`${e.view_label} ${(0,$.num)(e.low,0)}-${(0,$.num)(e.high,0)}`;return(0,z.jsxs)(l.default,{style:[B,{gap:4}],children:[(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:`FROM DISCOVER \xb7 ${(0,$.istStamp)(e.as_of)}${s?' \xb7 edited since':''}`}),(0,z.jsx)(d.T,{style:{fontSize:13},children:`Your view: ${a}${null!=e.max_loss?` \xb7 loss limit ${(0,$.inr)(e.max_loss)}`:''}`}),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:`Shown then: max loss ${null!=e.shown.max_loss?(0,$.signed)(e.shown.max_loss):'\u2014'}, chance of profit ${null!=e.shown.pop?`${e.shown.pop}%`:'\u2014'}. Now: max loss ${null!=n?(0,$.signed)(n):t?.max_loss?.unlimited?'unlimited':'\u2014'}, chance of profit ${null!=r?`${r}%`:'\u2014'} (today's prices${s?' and your edits':''}).`}),i&&(0,z.jsx)(d.T,{accessibilityRole:"alert",style:{fontSize:12,color:d.C.red},children:`The current max loss is beyond your original ${(0,$.inr)(e.max_loss)} limit.`})]})}function O(e,t=!1){const s=e?.scenario;if(!s)return'today';const n=!!s.active,r=(0,$.dayMonth)(String(s.at||'').slice(0,10));return n?t?`at ${(0,$.num)(s.spot,0)}`:`at ${(0,$.num)(s.spot,0)} on ${r}`:'today'}const D=e=>'number'==typeof e&&Number.isFinite(e)?e:null;function H(e){return'model_near_expiry'===e?.horizon?.kind?`Model at ${(0,$.dayMonth)(e.horizon.expiry)} expiry`:'At expiry'}const q={exec:'mid',mid:'ltp',ltp:'exec',manual:'exec'};function Y({leg:e,ltp:s,quote:r,tick:a,onManual:o,onBasis:c}){const u=r?'exec'===r.basis_used?'B'===e.side?r.ask:r.bid:'mid'===r.basis_used&&r.bid&&r.ask?Math.round(50*(r.bid+r.ask))/100:r.ltp:s,p='manual'===e.price_basis?'manual':'exec'===r?.basis_used?'B'===e.side?'ask':'bid':r?.basis_used||e.price_basis,[h,g]=(0,t.useState)('manual'===e.price_basis?String(e.price):'');(0,t.useEffect)(()=>{g('manual'===e.price_basis?String(e.price):'')},[e.price_basis,e.price]);const y=()=>{const e=Number(h);if(''!==h.trim()){if(Number.isFinite(e)&&e>=0){const t=(0,f.snap)(e,a);g(String(t)),o(t,t!==e?e:void 0)}}else c('exec')};return(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6}],children:[(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:"Entry"}),(0,z.jsx)(i.default,{value:'manual'===e.price_basis?h:null!=u?String(u):'',onChangeText:g,onFocus:()=>{'manual'!==e.price_basis&&g(null!=u?String(u):'')},onBlur:y,onSubmitEditing:y,keyboardType:"decimal-pad",accessibilityLabel:`Entry price for ${(0,$.strikeText)(e.strike)} ${e.type}`,style:{width:74,height:28,borderWidth:1,borderColor:'manual'===e.price_basis?d.C.amber:d.C.line,borderRadius:7,paddingHorizontal:8,color:d.C.ink,fontFamily:'Inter',fontSize:12}}),(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Price basis ${p}. Change`,onPress:()=>c(q[e.price_basis]),style:{paddingHorizontal:6,paddingVertical:3,borderRadius:6,borderWidth:1,borderColor:'manual'===e.price_basis?d.C.amber:d.C.line},children:(0,z.jsxs)(d.T,{style:{fontSize:11,color:'manual'===e.price_basis?d.C.amber:d.C.muted},children:[p,'manual'!==e.price_basis&&r?.bid&&r?.ask?` \xb7 ${r.bid}/${r.ask}`:'']})})]})}function G({a:e,dim:s,onFix:r}){const[i,a]=(0,t.useState)(!1);if(!e||'no_market'===e.status||'empty'===e.status)return(0,z.jsx)(l.default,{style:[B,{minHeight:84,justifyContent:'center'}],children:(0,z.jsx)(d.T,{style:{color:d.C.muted,fontSize:12},children:e?.warnings?.[0]||'Risk numbers appear once the strategy has legs.'})});if('invalid'===e.status)return(0,z.jsx)(l.default,{style:B,children:(0,z.jsx)(d.T,{style:{color:d.C.red,fontSize:12},children:e.warnings[0]})});if('incomplete'===e.status)return(0,z.jsxs)(l.default,{style:[B,{gap:6,borderColor:d.C.redLine}],accessibilityRole:"alert",children:[(0,z.jsx)(d.T,{style:{color:d.C.red,fontFamily:'InterSemi',fontSize:13},children:"Risk unavailable - a leg is not a listed contract"}),(e.unresolved||[]).map(e=>(0,z.jsx)(d.T,{style:{color:d.C.red,fontSize:12},children:`\u2022 ${e.label}`},e.leg_id)),(0,z.jsx)(d.T,{style:{color:d.C.muted,fontSize:12},children:"Max loss, profit and breakevens need every included leg. Change the strike or expiry of the missing leg, or untick \"Include\" to explore the rest deliberately."})]});const o=e.horizon,c='model_near_expiry'===o?.kind,u=o?o.label:'At expiry, gross',p=(e,t="")=>e?'available'!==e.status?'unsupported'===e.status?'Not supported':'Unavailable':e.unlimited?'Unlimited':(0,$.signed)(e.value):'\u2014',h=[['Max loss',p(e.max_loss),(e.max_loss,d.C.red),c?`${u} \xb7 modelled at today's IV, not a guaranteed floor`:`${u} of charges`],['Max profit',p(e.max_profit),d.C.green,c?`${u} \xb7 modelled at today's IV, not a guaranteed cap`:`${u} of charges`],['Breakeven','available'===e.breakevens?.status?e.breakevens.value.length?e.breakevens.value.map(e=>(0,$.num)(e,0)).join(' \xb7 '):'None':'\u2014',d.C.ink,e.scenario?.active&&'available'===e.breakevens_target?.status?`${H(e)} \xb7 on the what-if date: ${e.breakevens_target.value.length?e.breakevens_target.value.map(e=>(0,$.num)(e,0)).join(' \xb7 '):'none in range'}`:u],['Required funds','available'===e.margin?.status?(0,$.inr)(e.margin.value):'Needs live data','available'===e.margin?.status?d.C.ink:d.C.muted,'available'===e.margin?.status?`Exchange margin (Kite) \xb7 hedge benefit ${(0,$.inr)(e.margin.hedge_benefit)}`:'Exchange margin - not the same as max loss'],['Reward : risk','available'===e.reward_risk?.status&&null!=e.reward_risk.value?`${(0,$.num)(e.reward_risk.value,2)} : 1`:'\u2014',d.C.ink,'available'===e.reward_risk?.status?`Max profit \xf7 max loss \xb7 ${H(e).toLowerCase()}`:'Unbounded on one side'],['Capital at risk',e.capital_at_risk?.unlimited?'Unlimited':(0,$.inr)(e.capital_at_risk?.value),d.C.ink,
1081c?'Modelled max loss at the near expiry - not exchange margin':'Structural max loss - not exchange margin'],['credit'===e.premium?.direction?'Net credit':'Net debit',(0,$.inr)(Math.abs(e.premium?.value||0)),d.C.ink,'At entry prices'],[e.scenario?.active&&'available'===e.pop_scenario?.status?'POP (model) \xb7 Scenario':'POP (model)',e.scenario?.active&&'available'===e.pop_scenario?.status?`${e.pop_scenario.value}%`:'available'===e.pop?.status?`${e.pop.value}%`:'\u2014',d.C.ink,e.scenario?.active&&'available'===e.pop_scenario?.status?"From the what-if point \xb7 "+('available'===e.pop?.status?`${e.pop.value}% from now`:''):e.pop?.sigma?`Lognormal at ${(0,w.ivText)(e.pop.sigma)} ${'chain_atm_iv'===e.pop.sigma_basis?'chain ATM IV':'IV of the leg nearest spot (proxy)'}`:'Model value'],['Charges (est.)',null!=e.costs?.round_trip?`${(0,$.inr)(e.costs.round_trip)} round trip`:(0,$.inr)(e.charges?.value),d.C.ink,null!=e.costs?.round_trip?`Entry ${(0,$.inr)(e.costs.entry)} + exit ${(0,$.inr)(e.costs.exit_estimate)} at today's marks (estimate)`:'Entry orders, published rates'],['Net after costs (est.)',null!=e.costs?.max_loss_net||null!=e.costs?.max_profit_net?`${null!=e.costs.max_loss_net?(0,$.signed)(e.costs.max_loss_net):'\u2014'} / ${null!=e.costs.max_profit_net?(0,$.signed)(e.costs.max_profit_net):'\u2014'}`:'\u2014',d.C.ink,'Max loss / max profit less the round-trip estimate'],['Chance of loss (model)','available'===e.outcomes?.status?`${e.outcomes.value.loss}%`:'\u2014',d.C.ink,'available'===e.outcomes?.status?`Profit ${e.outcomes.value.profit}% \xb7 loss ${e.outcomes.value.loss}%${null!=e.outcomes.value.max_loss?` \xb7 max loss ${e.outcomes.value.max_loss}%`:''}${null!=e.outcomes.value.max_profit?` \xb7 max profit ${e.outcomes.value.max_profit}%`:''} \xb7 ${H(e).toLowerCase()}`:'Model value']];return(0,z.jsxs)(l.default,{style:[B,{gap:10,opacity:s?.5:1}],children:[c&&(0,z.jsxs)(l.default,{style:[d.s.row,{gap:8,alignItems:'flex-start'}],children:[(0,z.jsx)(d.Badge,{label:"MODEL",tone:"amber"}),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.amber,flex:1},children:`${o.label}. ${o.note}`})]}),(0,z.jsx)(l.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:14},children:h.slice(0,i?h.length:4).map(([e,t,s,n])=>(0,z.jsxs)(l.default,{style:{minWidth:130,flex:1,gap:2},accessibilityLabel:`${e}: ${t}. ${n}`,children:[(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:e}),(0,z.jsx)(d.T,{style:{fontFamily:'InterSemi',fontSize:15,color:s,fontVariant:['tabular-nums']},children:t}),(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:n})]},e))}),(0,z.jsx)(_.SettledSummaryBlock,{a:e}),(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityState:{expanded:i},onPress:()=>a(!i),style:{minHeight:32,justifyContent:'center'},children:(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.green},children:i?'Fewer numbers':'More numbers: reward:risk, capital at risk, premium, probability, charges'})}),!!e.insights?.length&&(0,z.jsx)(l.default,{style:{gap:4,borderTopWidth:1,borderColor:d.C.line,paddingTop:8},accessibilityLabel:"Risk warnings",children:e.insights.map((e,t)=>(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6,alignItems:'flex-start'}],children:[(0,z.jsx)(d.Icon,{name:'warn'===e.level?'alert-triangle':'info',size:13,color:'warn'===e.level?d.C.amber:d.C.muted}),(0,z.jsx)(d.T,{style:{fontSize:12,flex:1,color:'warn'===e.level?d.C.ink:d.C.muted},children:e.text}),e.fix&&r&&(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`${e.fix.label}: ${e.text}`,onPress:()=>r(e.fix),style:{minHeight:28,justifyContent:'center'},children:(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.green},children:e.fix.label})})]},t))})]})}function K({body:e,chain:s,expiry:n,onChange:r,result:a,state:o,compact:c=!1}){const u=e.scenario||{},p=s?.spot||0,[h,g]=(0,t.useState)(u.spot?String(u.spot):'');(0,t.useEffect)(()=>{g(u.spot?String(u.spot):'')},[u.spot]);const y=(s?.as_of||'').slice(0,10),f=pe(),x=(0,t.useMemo)(()=>{if(!y||!n)return[];const e=[];let t=y;for(let s=0;s<60&&t<=n;s++)(0,$.isWeekend)(t)||f.set.has(t)||e.push(t),t=(0,$.addDays)(t,1);return e.includes(n)||e.push(n),e},[y,n,f]),m=(u.at||'').slice(0,10)||y,b=Math.max(0,x.indexOf(m)),j=e=>{const t=x[Math.max(0,Math.min(x.length-1,e))];t&&r({...u,at:t===y?void 0:`${t} 15:30`})},C=()=>{const e=Number(h);r({...u,spot:''===h.trim()||!Number.isFinite(e)||e<=0?void 0:e})},v=u.spot&&p?100*(u.spot/p-1):0;return(0,z.jsxs)(l.default,{style:{gap:10,borderTopWidth:c?0:1,borderColor:d.C.line,paddingTop:c?0:10},children:[!c&&(0,z.jsx)(d.T,{style:M,children:"Scenario - hypothetical, not a forecast"}),(0,z.jsxs)(l.default,{style:[d.s.row,{flexWrap:'wrap',gap:c?10:14}],children:[c&&(0,z.jsx)(d.T,{style:{fontSize:11,fontFamily:'InterSemi',color:d.C.blue},children:"Scenario"}),(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6}],children:[(0,z.jsxs)(d.T,{style:{fontSize:12,color:d.C.muted},children:[s?.underlying||'Spot'," at"]}),(0,z.jsx)(Q,{what:"price",onMinus:()=>r({...u,spot:Math.round(100*((u.spot||p)-(s?.strike_step||50)))/100}
1081),onPlus:()=>r({...u,spot:Math.round(100*((u.spot||p)+(s?.strike_step||50)))/100}),children:(0,z.jsx)(i.default,{value:h,placeholder:(0,$.num)(p,2),placeholderTextColor:d.C.muted,onChangeText:g,onBlur:C,onSubmitEditing:C,keyboardType:"decimal-pad",accessibilityLabel:"Scenario underlying price",style:{width:90,height:28,color:d.C.ink,fontFamily:'Inter',fontSize:12,textAlign:'center'}})}),(!c||!!u.spot)&&(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted,minWidth:c?0:48},children:u.spot?`${v>=0?'+':''}${v.toFixed(2)}%`:'current'})]}),(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6}],children:[(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:"on"}),(0,z.jsx)(Q,{what:"date",onMinus:()=>j(b-1),onPlus:()=>j(b+1),children:(0,z.jsx)(d.T,{style:{fontSize:12,minWidth:110,textAlign:'center'},children:m===y?(0,k.firstDayLabel)(m,o,s?.reading||a?.reading):`${(0,$.weekday)(m)} ${(0,$.dayMonth)(m)} 15:30`})}),!c&&(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:a?.scenario?`${a.scenario.days_to_expiry}d to expiry`:''})]}),(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6}],children:[(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:"IV"}),(0,z.jsx)(Q,{what:"IV shift",onMinus:()=>r({...u,iv_shift:(u.iv_shift||0)-1}),onPlus:()=>r({...u,iv_shift:(u.iv_shift||0)+1}),children:(0,z.jsx)(d.T,{style:{fontSize:12,minWidth:52,textAlign:'center'},children:`${(u.iv_shift||0)>0?'+':''}${u.iv_shift||0} pts`})})]}),(0,z.jsx)(d.Button,{label:"Reset",kind:"outline",onPress:()=>r({}),style:{minHeight:32,paddingVertical:4}}),c&&!!a?.scenario?.active&&'available'===a?.scenario_pnl?.status&&(0,z.jsx)(d.T,{title:'Move NIFTY, the date or IV in the Scenario row under the chart to update this P&L',style:{fontSize:13,fontFamily:'InterSemi',fontVariant:['tabular-nums'],color:(a.scenario_pnl.value||0)>=0?d.C.heatUp2:d.C.heatDn2},children:`P&L ${(0,$.signed)(a.scenario_pnl.value)}`})]}),!c&&(0,z.jsx)(d.T,{style:{fontSize:13,fontFamily:'InterSemi',color:(a?.scenario_pnl?.value||0)>=0?d.C.green:d.C.red},children:'available'===a?.scenario_pnl?.status?`Scenario P&L: ${(0,$.signed)(a.scenario_pnl.value)} ${a.scenario?.is_expiry?'(at expiry)':(0,w.scenarioModelText)(a.pricing)} \xb7 ${f.version?'weekends and NSE holidays skipped':'weekends skipped; NSE holiday list not loaded'}`:a?.scenario_pnl?`Scenario P&L unavailable: ${a.scenario_pnl.reason}`:''}),(0,z.jsx)(_.SettledNote,{text:(0,T.scenarioSettledLabel)(a)})]})}function Q({children:e,onMinus:t,onPlus:s,what:r="value"}){const i=F();return(0,z.jsxs)(l.default,{style:[d.s.row,{gap:0,borderWidth:1,borderColor:d.C.line,borderRadius:7,height:i?44:30}],children:[(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Decrease scenario ${r}`,onPress:t,style:{width:i?44:26,height:i?44:28,alignItems:'center',justifyContent:'center'},children:(0,z.jsx)(d.Icon,{name:"minus",size:13,color:d.C.muted})}),e,(0,z.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Increase scenario ${r}`,onPress:s,style:{width:i?44:26,height:i?44:28,alignItems:'center',justifyContent:'center'},children:(0,z.jsx)(d.Icon,{name:"plus",size:13,color:d.C.muted})})]})}function J({head:e,rows:t,right:s=[]}){return(0,z.jsx)(l.default,{role:'table',children:[e,...t].map((e,t)=>(0,z.jsx)(l.default,{role:'row',style:[d.s.row,{gap:8,paddingVertical:6,borderTopWidth:t?1:0,borderColor:d.C.line}],children:e.map((e,n)=>(0,z.jsx)(d.T,{role:t?0===n?'rowheader':'cell':'columnheader',style:{flex:0===n?2:1,fontSize:t?12:10,color:t?d.C.ink:d.C.muted,textAlign:s.includes(n)?'right':'left',fontFamily:t?'Inter':'InterMedium',textTransform:t?'none':'uppercase',fontVariant:['tabular-nums']},children:String(e)},n))},t))})}function Z({a:e,compact:t=!1}){if(!e?.legs?.length)return(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:"No legs to value."});const s=e.legs.reduce((e,t)=>e+(t.target_pnl||0),0),n=e.legs.map(e=>(0,w.modelGapText)(e)).filter(e=>!!e),r=(0,w.intrinsicBasisText)(e.legs);return(0,z.jsxs)(l.default,{style:{gap:6},children:[(0,z.jsx)(J,{head:['Leg','Units','Entry (basis)','Mark now','Intrinsic','Time value','Scenario price','Scenario P&L'],right:[1,2,3,4,5,6,7],rows:[...e.legs.map(t=>[(0,T.legLabelText)(e,t),t.units,`${(0,$.num)(t.entry)} ${he[e.legs_quotes?.find(e=>e.id===t.id)?.basis_used||'']||''}`,`${(0,$.num)(t.mark)} ${'mid'===t.mark_basis?'mid':'ltp'===t.mark_basis?'LTP':''}`,(0,$.num)(t.intrinsic),(0,$.num)(t.time_value),(0,$.num)(t.target_price),(0,$.signed)(t.target_pnl)]),['Total (gross)','','','','','','',(0,$.signed)(s)]]}),!t&&n.map((e,t)=>(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.amber},children:e},t)),e.legs.map(t=>{const s=(0,T.legSettledText)(e,t);return s?(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:`${t.label}: ${s}`},`settled-${t.id}`):null}),(0,z.jsx)(_.SettledNote,{text:(0,T.settledLabel)(e)}),!t&&(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:`Scenario: ${e.scenario?(0,$.num)(e.scenario.spot,2):''} on ${e.scenario?(0,$.istStamp)(e.scenario.at):''}. Entry is each leg's cost basis (ask/bid = executable estimate, mid, LTP = last trade, manual = typed); ${(0,w.markExplainText)(e.pricing)}${r?` ${r}`:''} Charges ${(0,$.inr)(e.charges?.value)} not included.`})]})}function X({a:e,compact:s=!1}){const[n,r]=(0,t.useState)('now'),[i,a]=(0,t.useState)('strategy');if(!e?.legs?.length)return(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:"No legs."});if('available'!==e.greeks?.status)return(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.amber},children:`Greeks unavailable: ${e.greeks?.reason||''}`});const o='whatif'===n&&'available'===e.greeks_scenario?.status,c=o?e.greeks_scenario:e.greeks;return(0,z.jsxs)(l.default,{style:{gap:6},children:[(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6,flexWrap:'wrap'}
1081],children:[(0,z.jsx)(d.Chip,{label:"Now",active:'now'===n,onPress:()=>r('now')}),(0,z.jsx)(d.Chip,{label:"At your scenario",active:'whatif'===n,onPress:()=>r('whatif')}),'whatif'===n&&'available'!==e.greeks_scenario?.status&&(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:'AT_EXPIRY'===e.greeks_scenario?.reason?'Not defined at expiry - the position is settled.':'Unavailable'})]}),(0,z.jsx)(J,{head:['Leg','Delta','Gamma','Theta \u20b9/day','Vega \u20b9/IV pt'],right:[1,2,3,4],rows:'whatif'!==n||o?'strategy'===i||o?[...e.legs.map(e=>{const t=o?e.greeks_scenario:e.greeks;return[e.label,(0,$.num)(t?.delta,1),(0,$.num)(t?.gamma,3),(0,$.num)(t?.theta,0),(0,$.num)(t?.vega,0)]}),['Strategy total',(0,$.num)(c.delta,1),(0,$.num)(c.gamma,3),(0,$.num)(c.theta,0),(0,$.num)(c.vega,0)]]:e.legs.map(t=>{const s=t.greeks_per_unit,n=(t.units||0)<0?-1:1,r='lot'===i?n*(e.lot_size||1):n;return[t.label,(0,$.num)(s?s.delta*r:null,'lot'===i?1:3),(0,$.num)(s?s.gamma*r:null,'lot'===i?3:5),(0,$.num)(s?s.theta*r:null,2),(0,$.num)(s?s.vega*r:null,2)]}):e.legs.map(e=>[e.label,'\u2014','\u2014','\u2014','\u2014'])}),!s&&!o&&(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6,flexWrap:'wrap'}],children:[[['strategy','Whole strategy'],['lot','Per lot'],['unit','Per unit']].map(([e,t])=>(0,z.jsx)(d.Chip,{label:t,active:i===e,onPress:()=>a(e)},e)),(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:'strategy'===i?'Signed, all lots of each leg.':'lot'===i?`Signed, one lot (${e.lot_size||'?'} units) of each leg.`:'Signed, one unit (share) of each leg.'})]}),o&&(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:`At ${(0,$.num)(e.greeks_scenario.spot,2)} on ${(0,$.istStamp)(e.greeks_scenario.at)}${e.greeks_scenario.iv_shift?`, IV ${e.greeks_scenario.iv_shift>0?'+':''}${e.greeks_scenario.iv_shift} pts`:''}.`}),!s&&(0,z.jsxs)(d.T,{style:{fontSize:11,color:d.C.muted},children:["Whole-strategy units (lots \xd7 lot size). ",(0,w.deltaUnitText)(e.pricing),"; theta per calendar day; vega per 1 percentage point of IV. ",o?'Model values at the what-if point.':'Model values at the reading.']})]})}function ee({a:e,tint:t=!1}){return e?.table?.length?t?(0,z.jsxs)(l.default,{role:'table',children:[(0,z.jsx)(l.default,{style:[d.s.row,{gap:8,paddingVertical:6}],children:[`${e.underlying||'Underlying'} at`,'% from now',e.scenario?.active?`On ${(0,$.dayMonth)(String(e.scenario.at||'').slice(0,10))}`:'Today (model)',H(e)].map((e,t)=>(0,z.jsx)(d.T,{style:{flex:t?1:1.3,fontSize:11,color:d.C.heading,fontFamily:'InterSemi',textAlign:t?'right':'left'},children:e},e))}),e.table.map((e,t)=>{const s=e=>null==e?d.C.muted:e>0?d.C.heatUp2:e<0?d.C.heatDn2:d.C.ink;return(0,z.jsxs)(l.default,{style:[d.s.row,{gap:8,paddingVertical:5,paddingHorizontal:4,backgroundColor:'transparent',borderBottomWidth:1,borderColor:d.C.lineSoft}],children:[(0,z.jsx)(d.T,{style:{flex:1.3,fontSize:12,fontVariant:['tabular-nums']},children:(0,$.num)(e.s,0)}),(0,z.jsx)(d.T,{style:{flex:1,fontSize:12,textAlign:'right',color:d.C.muted},children:`${e.pct>0?'+':''}${e.pct}%`}),(0,z.jsx)(d.T,{style:{flex:1,fontSize:12,textAlign:'right',color:s(e.target),fontVariant:['tabular-nums']},children:(0,$.signed)(e.target)}),(0,z.jsx)(d.T,{style:{flex:1,fontSize:12,textAlign:'right',fontFamily:'InterSemi',color:s(e.expiry),fontVariant:['tabular-nums']},children:(0,$.signed)(e.expiry)})]},t)})]}):(0,z.jsx)(J,{head:[`${e.underlying||'Underlying'} level`,'% from spot','Scenario date',H(e)],right:[1,2,3],rows:e.table.map(e=>[(0,$.num)(e.s,0),`${e.pct>0?'+':''}${e.pct}%`,(0,$.signed)(e.target),(0,$.signed)(e.expiry)])}):(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:"No payoff table yet."})}function te({detail:e,onRestore:t,onDuplicate:s,onView:n}){return e.snapshots.length?(0,z.jsx)(l.default,{style:{gap:8},children:e.snapshots.map(e=>(0,z.jsxs)(l.default,{style:[d.s.between,{borderTopWidth:1,borderColor:d.C.line,paddingTop:8,flexWrap:'wrap'}],children:[(0,z.jsxs)(l.default,{style:{gap:2,flex:1,minWidth:200},children:[(0,z.jsx)(d.T,{style:{fontSize:13,fontFamily:'InterSemi'},children:`#${e.n} ${e.name}`}),(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:`Priced at ${(0,$.istStamp)(e.reading_at)} \xb7 max loss ${e.summary.unlimited_loss?'unlimited':(0,$.signed)(e.summary.max_loss)} \xb7 max profit ${(0,$.signed)(e.summary.max_profit)} \xb7 ${e.checksum.slice(0,8)}`})]}),!!e.notes&&(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.ink,width:'100%'},numberOfLines:2,children:e.notes}),(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,z.jsx)(d.Button,{label:"View",kind:"outline",onPress:()=>n(e.id)}),(0,z.jsx)(d.Button,{label:"Restore",kind:"outline",onPress:()=>t(e.id)}),(0,z.jsx)(d.Button,{label:"Copy to new",kind:"outline",onPress:()=>s(e.id)})]})]},e.id))}):(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:"No snapshots yet. \"Save snapshot\" freezes the current legs and their analysis; it never changes afterwards."})}function se({runs:e,state:t,onClose:s,onCancel:n,onOpen:r}){return e.length?(0,z.jsxs)(l.default,{style:{gap:10},children:[e.map(e=>{const r='pending'===e.status||'cancelled'===e.status;return(0,z.jsxs)(l.default,{style:{borderTopWidth:1,borderColor:d.C.line,paddingTop:8,gap:4},children:[(0,z.jsxs)(l.default,{style:[d.s.between,{flexWrap:'wrap',alignItems:'flex-start'}],children:[(0,z.jsxs)(l.default,{style:[d.s.row,{gap:8,flexWrap:'wrap',flex:1,minWidth:220,alignItems:'flex-start'}],children:[(0,z.jsx)(S.PaperRunState,{run:e,prefix:"Paper"}),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:`Snapshot #${e.revision.n} \xb7 ${r?`placed ${(0,$.istStamp)(e.pending?.placed_at||e.opened_action_at||null)}`:`opened ${(0,$.istStamp)(e.opened_reading)}`}`})]}),(0,z.jsx)(S.PaperRunAction,{run:e,state:t,onClose:()=>s(e.id),onCancel:()=>n(e.id)})]}
1081),r?(0,z.jsxs)(l.default,{children:[(0,k.plannedRows)(e).map((e,t)=>(0,z.jsxs)(l.default,{style:[d.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,z.jsx)(d.T,{style:{fontSize:12,flex:2},children:e[0]}),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted,flex:1,textAlign:'right'},children:e[1]}),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted,flex:1,textAlign:'right'},children:e[2]})]},t)),'cancelled'===e.status&&(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:"No fills - no P&L."})]}):(0,z.jsxs)(d.T,{style:{fontSize:13},children:[`Net ${(0,$.signed)(e.net)} (realised ${(0,$.signed)(e.realised)}, unrealised ${(0,$.signed)(e.unrealised)}, fees ${(0,$.inr)(e.fees)})`,null!=e.close_now_estimate?` \xb7 if closed now \u2248 ${(0,$.signed)(e.close_now_estimate)}`:'']})]},e.id)}),(0,z.jsx)(d.Button,{label:"All paper runs",kind:"outline",icon:"list",onPress:r})]}):(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:"No paper runs for this strategy. \"Paper trade\" records simulated fills against a frozen snapshot - it never sends an order."})}function ne({visible:e,onClose:s,a:n,body:r,chain:i,state:a,onStart:o}){const[c,u]=(0,t.useState)(!1),[p,h]=(0,t.useState)('');(0,t.useEffect)(()=>{e&&h('')},[e]);const g=!!n?.max_loss?.unlimited,y=(0,k.isClosed)(a),f=(0,T.paperEntryBlock)(n);return(0,z.jsxs)(d.Sheet,{visible:e,onClose:s,title:y?'Queue a paper trade for the next open':'Start a paper run',subtitle:"Simulated fills recorded against a frozen snapshot. No order is sent to any broker.",footer:(0,z.jsxs)(l.default,{style:[d.s.row,{justifyContent:'flex-end',gap:8,flexWrap:'wrap'}],children:[(0,z.jsx)(d.Button,{label:"Cancel",kind:"outline",onPress:s}),(0,z.jsx)(d.Button,{label:y?'Queue for next open':'Record simulated fills',icon:y?'clock':'play',loading:c,disabled:!!f,accessibilityHint:f?.message,onPress:async()=>{u(!0),h('');try{h(await o()||'')}finally{u(!1)}}})]}),children:[!!p&&p!==f?.message&&(0,z.jsx)(l.default,{accessibilityRole:"alert",style:[B,{borderColor:d.C.redLine,backgroundColor:d.C.redBg}],children:(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.red},children:p})}),(y||!!f)&&(0,z.jsxs)(l.default,{accessibilityRole:"alert",style:[B,{gap:6,backgroundColor:d.C.bg}],children:[(0,z.jsx)(d.T,{style:{fontSize:13},children:f?f.message:(0,k.queueText)(a)}),!f&&(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:"Until it fills the run shows no P&L, and you can cancel it."})]}),(0,z.jsx)(l.default,{style:{gap:8},children:r.legs.filter(e=>e.include).map(e=>{const t=i?.rows.find(t=>t.strike===e.strike)?.[e.type]?.ltp,s=(0,T.paperLegSettledText)(n,e.id);return(0,z.jsxs)(l.default,{style:[d.s.between,{flexWrap:'wrap'}],children:[(0,z.jsx)(d.T,{style:{fontSize:13},children:`${'B'===e.side?'Buy':'Sell'} ${e.lots} \xd7 ${(0,$.strikeText)(e.strike)} ${e.type} \xb7 ${(0,$.dayMonth)(e.expiry)}`}),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:y?`Last price ${(0,$.num)(t)} (reference only) \xb7 fills at the next open ${'B'===e.side?'plus':'minus'} slippage`:`Stored LTP ${(0,$.num)(t)} \xb7 simulated fill ${'B'===e.side?'above':'below'} it by slippage`}),!!s&&(0,z.jsxs)(l.default,{style:[d.s.row,{gap:6,width:'100%',flexWrap:'wrap'}],children:[(0,z.jsx)(_.SettledTag,{}),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted,flex:1},children:s})]})]},e.id)})}),(0,z.jsxs)(l.default,{style:[B,{gap:6}],children:[(0,z.jsx)(d.T,{style:{fontSize:12},children:y?'Fill policy: the opening price at the next open, moved against you by slippage. Estimated charges are recorded on every fill.':'Fill policy: last traded price at the stored reading, moved against you by the larger of 0.5% or one tick. Estimated charges are recorded on every fill.'}),(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.muted},children:y?'A snapshot named "Paper entry" is saved now, so the run always points at exactly these legs.':`Priced at ${(0,$.istStamp)(i?.as_of)}. A snapshot named "Paper entry" is saved so the run always points at exactly these legs.`}),g&&(0,z.jsx)(d.T,{style:{fontSize:12,color:d.C.red},children:"This structure has unlimited loss. A paper run is a safe place to learn how that behaves."}),(0,z.jsx)(_.SettledNote,{text:(0,T.settledLabel)(n)})]})]})}function re(e){return JSON.stringify(e??null)}function ie(){try{const e='undefined'!=typeof document?document.activeElement:null;e?.blur?.()}catch{}}const le=e=>`kanida.sb.draft.${e}`;function ae(e){try{const t='undefined'!=typeof localStorage?localStorage.getItem(le(e)):null;return t?JSON.parse(t):null}catch{return null}}function oe(e,t,s){try{'undefined'!=typeof localStorage&&localStorage.setItem(le(e),JSON.stringify({version:t,body:s,at:Date.now()}))}catch{}}function de(e){try{'undefined'!=typeof localStorage&&localStorage.removeItem(le(e))}catch{}}let ce=null,ue=null;function pe(){const[e,s]=(0,t.useState)(ce||{set:new Set,version:null});return(0,t.useEffect)(()=>
1081{if(ce)return void s(ce);ue=ue||u.sb.calendar().then(e=>(ce={set:new Set(e.holidays.map(e=>e.date)),version:e.version},ce)).catch(()=>null);let e=!0;return ue.then(t=>{e&&t&&s(t)}),()=>{e=!1}},[]),e}const he={exec:'(ask/bid)',mid:'(mid)',ltp:'(LTP)',manual:'(manual)'};function ge({id:e,version:s,onOpen:r}){const[i,a]=(0,t.useState)(null),[o,c]=(0,t.useState)('');if((0,t.useEffect)(()=>{let t=!0;const s=setTimeout(()=>u.sb.evidence(e).then(e=>{t&&(a(e),c(''))}).catch(e=>{t&&c(e.message)}),600);return()=>{t=!1,clearTimeout(s)}},[e,s]),o)return(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:`Lab evidence could not be read (${o}).`});if(!i||'none'===i.status)return i?(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:`Lab evidence: ${i.label}.`}):null;const p='tested_significant'===i.status?'green':'tested_not_significant'===i.status?'neutral':'amber';return(0,z.jsxs)(l.default,{style:[B,{gap:4,paddingVertical:10}],accessibilityLabel:`Lab evidence: ${i.label}`,children:[(0,z.jsxs)(l.default,{style:[d.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,z.jsx)(d.T,{style:M,children:"Lab evidence"}),(0,z.jsx)(d.Badge,{label:i.label,tone:p})]}),!!i.note&&(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:i.note}),(0,z.jsxs)(l.default,{style:[d.s.row,{gap:10,flexWrap:'wrap'}],children:[(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:`${i.deciding_run_at?`Deciding run ${(0,$.istEpoch)(i.deciding_run_at)} \xb7 `:''}statistics ${(i.evidence_version||'?').split(':')[0]} \xb7 model-priced, not a forecast`}),!!i.run_id&&(0,z.jsx)(n.default,{accessibilityRole:"button",onPress:()=>r(i.run_id),children:(0,z.jsx)(d.T,{style:{fontSize:11,color:d.C.green},children:"Open the Lab"})})]})]})}},988,[11,375,278,385,13,400,252,821,197,976,989,990,978,977,981,980,985,991,982,994,970,992,986,993,979,995,996,6]); 1082__d(function(_g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.OrderReview=function({visible:e,onClose:s,strategyId:u,deployment:h,adjusting:g,onPlaced:y,draft:x}){const b=!!h,j=!b&&!!g,{width:C}=(0,i.default)(),k=C<600,[S,w]=(0,t.useState)(null),[$,T]=(0,t.useState)(''),[_,v]=(0,t.useState)(!1),[z,I]=(0,t.useState)('NRML'),[R,A]=(0,t.useState)('marketable'),[P,B]=(0,t.useState)({}),[L,E]=(0,t.useState)({}),[q,W]=(0,t.useState)(!1),[N,M]=(0,t.useState)(0),F=(0,t.useRef)(c()),O=(0,t.useCallback)(async()=>{T(''),w(null);try{const e=Object.fromEntries(Object.entries(L).filter(([,e])=>''!==e.trim()).map(([e,t])=>[e,Number(t)])),t=b?await a.exec.closePreview(h.id,R):j?await a.exec.adjustPreview(g.id,R,e):await a.exec.preview(u,{product:z,price_policy:R,limits:e,...x||{}});w(t),F.current=c()}catch(e){T(e.message)}},[b,j,g,h,u,z,R,L]);(0,t.useEffect)(()=>{e&&O()},[e,z,R,L]),(0,t.useEffect)(()=>{e||(B({}),E({}))},[e]),(0,t.useEffect)(()=>{if(!S)return;const e=setInterval(()=>M(Math.max(0,Math.round(S.expires_at-Date.now()/1e3))),500);return()=>clearInterval(e)},[S]);const U=!!S&&N<=0;const Y=S?.orders.reduce((e,t)=>e+t.slices.length,0)||0,D=!!S&&Object.entries(P).some(([e,t])=>t!==(L[e]??String(S.orders.find(t=>t.leg_id===e)?.limit))),H=S?S.checks.filter(e=>'block'===e.status):[],V=(e,t,s)=>(0,d.jsx)(r.default,{value:P[e.leg_id]??String(e.limit),onChangeText:t=>B(s=>({...s,[e.leg_id]:t})),onBlur:()=>E(t=>null!=P[e.leg_id]&&P[e.leg_id]!==t[e.leg_id]?{...t,[e.leg_id]:P[e.leg_id]}:t),keyboardType:"decimal-pad",accessibilityLabel:`Limit price for ${e.symbol}`,style:{width:t,height:s,borderWidth:1,borderColor:n.C.line,borderRadius:7,paddingHorizontal:8,color:n.C.ink,fontFamily:'InterSemi',fontSize:13,textAlign:'right'}});return(0,d.jsxs)(n.Sheet,{visible:e,onClose:s,wide:!0,title:b?'Close paper deployment':j?'Review adjustment orders':'Review paper orders',subtitle:S?`${S.structure} \xb7 quotes ${(0,o.istStamp)(S.as_of)} \xb7 spot ${(0,o.num)(S.spot,2)} \xb7 PAPER - no order reaches a broker`:'Building the exact order plan from live quotes\u2026',footer:(0,d.jsxs)(l.default,{style:[n.s.between,{flexWrap:'wrap',gap:10}],children:[(0,d.jsx)(l.default,{style:{gap:2,flex:1,minWidth:220},children:S&&(0,d.jsx)(n.T,{style:{fontSize:12,color:U||D?n.C.red:n.C.muted},children:D?'You edited a limit - it is priced into a new plan when you leave the field or press Refresh.':U?'Preview expired - quotes move. Refresh to review again (your choices stay).':`This plan is valid for ${N}s \xb7 hash ${S.hash.slice(0,10)}`})}),(0,d.jsxs)(l.default,{style:[n.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,d.jsx)(n.Button,{label:"Refresh",icon:"refresh-cw",kind:"outline",onPress:O}),(0,d.jsx)(n.Button,{label:b?`Place ${Y} close order${1===Y?'':'s'} (paper)`:j?`Place ${Y} adjustment order${1===Y?'':'s'} (paper)`:`Place ${Y} paper order${1===Y?'':'s'}`,icon:"check",loading:_,disabled:!S||!S.can_submit||U||D||S.requires_ack&&!q,onPress:async function(){if(S){v(!0),T('');try{const e=b?await a.exec.close(h.id,S,F.current):j?await a.exec.adjust(g.id,S,F.current,q):await a.exec.deploy(u,S,F.current,q);y(e)}catch(e){T(e.message),/expired|changed/i.test(e.message)&&O()}finally{v(!1)}}}})]})]}),children:[!b&&!j&&(0,d.jsxs)(l.default,{style:[n.s.row,{flexWrap:'wrap',gap:8}],children:[(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:"Product"}),['NRML','MIS'].map(e=>
1082(0,d.jsx)(n.Chip,{label:'NRML'===e?'NRML (carry)':'MIS (intraday)',active:z===e,onPress:()=>I(e)},e)),(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted,marginLeft:8},children:"Limit price"}),[['marketable','At the quote (ask/bid)'],['mid','At the mid']].map(([e,t])=>(0,d.jsx)(n.Chip,{label:t,active:R===e,onPress:()=>A(e)},e))]}),(b||j)&&(0,d.jsx)(l.default,{style:[n.s.row,{gap:8}],children:[['marketable','At the quote'],['mid','At the mid']].map(([e,t])=>(0,d.jsx)(n.Chip,{label:t,active:R===e,onPress:()=>A(e)},e))}),!!$&&(0,d.jsx)(l.default,{style:{backgroundColor:n.C.redBg,borderRadius:10,padding:12},children:(0,d.jsx)(n.T,{style:{color:n.C.red,fontSize:13},children:$})}),!S&&!$&&(0,d.jsx)(n.Loading,{}),S&&(0,d.jsxs)(d.Fragment,{children:[k&&H.length>0&&(0,d.jsxs)(l.default,{accessibilityRole:"alert",style:{backgroundColor:n.C.redBg,borderRadius:10,padding:10,gap:4},children:[(0,d.jsx)(n.T,{style:{fontSize:12,color:n.C.red,fontFamily:'InterSemi'},children:`Cannot place yet - ${H.length} check${H.length>1?'s':''} block these orders`}),H.map(e=>(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.red},children:`${e.label}: ${e.detail}`},e.key))]}),k?(0,d.jsx)(l.default,{style:{gap:8},children:S.orders.map(e=>(0,d.jsxs)(l.default,{style:{borderWidth:1,borderColor:n.C.line,borderRadius:12,padding:12,gap:8},children:[(0,d.jsxs)(l.default,{style:[n.s.between,{gap:8}],children:[(0,d.jsx)(n.T,{style:{fontSize:14,fontFamily:'InterSemi',color:'B'===e.side?n.C.green:n.C.red,flex:1},children:`${'B'===e.side?'BUY':'SELL'} ${(0,o.strikeText)(e.strike)} ${e.type}`}),(0,d.jsx)(n.Badge,{label:`Group ${e.group}`,tone:"neutral"})]}),(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},selectable:!0,children:`${e.symbol} \xb7 LIMIT \xb7 ${S.product}`}),(0,d.jsxs)(l.default,{style:[n.s.row,{flexWrap:'wrap',gap:14}],children:[(0,d.jsx)(p,{k:"Quantity",v:`${e.qty}`,note:`${e.lots} lot${e.lots>1?'s':''} \xd7 ${e.lot_size}`}),(0,d.jsx)(p,{k:"Bid / Ask",v:`${(0,o.num)(e.bid)} / ${(0,o.num)(e.ask)}`}),(0,d.jsx)(p,{k:"Slices",v:e.slices.length>1?e.slices.join(' + '):'1'}),(0,d.jsx)(p,{k:"Charges",v:(0,o.inr)(e.charges)})]}),(0,d.jsxs)(l.default,{style:[n.s.row,{gap:10,alignItems:'center'}],children:[(0,d.jsx)(n.T,{style:{fontSize:12,color:n.C.muted},children:"Limit price"}),b?(0,d.jsx)(n.T,{style:{fontSize:14,fontFamily:'InterSemi'},children:(0,o.num)(e.limit)}):V(e,120,44)]})]},e.leg_id))}):(0,d.jsxs)(l.default,{style:{borderWidth:1,borderColor:n.C.line,borderRadius:12,overflow:'hidden'},children:[(0,d.jsx)(l.default,{style:[n.s.row,{backgroundColor:n.C.paper,paddingHorizontal:12,paddingVertical:8}],children:['#','Order','Qty','Bid / Ask','Limit','Slices','Charges'].map((e,t)=>(0,d.jsx)(n.T,{style:{flex:[.4,2.4,.8,1.3,1.1,1,.9][t],fontSize:11,letterSpacing:.6,color:n.C.muted,textTransform:'uppercase',fontFamily:'InterMedium',textAlign:t>1?'right':'left'},children:e},e))}),S.orders.map(e=>(0,d.jsxs)(l.default,{style:[n.s.row,{paddingHorizontal:12,paddingVertical:10,borderTopWidth:1,borderColor:n.C.line}],children:[(0,d.jsx)(n.T,{style:{flex:.4,fontSize:12,color:n.C.muted},children:e.group}),(0,d.jsxs)(l.default,{style:{flex:2.4,gap:2},children:[(0,d.jsx)(n.T,{style:{fontSize:13,fontFamily:'InterSemi',color:'B'===e.side?n.C.green:n.C.red},children:`${'B'===e.side?'BUY':'SELL'} ${e.symbol}`}),(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:`${(0,o.strikeText)(e.strike)} ${e.type} \xb7 ${e.lots} lot${e.lots>1?'s':''} \xd7 ${e.lot_size} \xb7 LIMIT \xb7 ${S.product}`})]}),(0,d.jsx)(n.T,{style:{flex:.8,fontSize:12,textAlign:'right'},children:e.qty}),(0,d.jsx)(n.T,{style:{flex:1.3,fontSize:12,textAlign:'right',color:n.C.muted},children:`${(0,o.num)(e.bid)} / ${(0,o.num)(e.ask)}`}),(0,d.jsx)(l.default,{style:{flex:1.1,alignItems:'flex-end'},children:b?(0,d.jsx)(n.T,{style:{fontSize:12,fontFamily:'InterSemi'},children:(0,o.num)(e.limit)}):V(e,84,32)}),(0,d.jsx)(n.T,{style:{flex:1,fontSize:12,textAlign:'right',color:e.slices.length>1?n.C.amber:n.C.ink},children:e.slices.length>1?e.slices.join(' + '):'1'}),(0,d.jsx)(n.T,{style:{flex:.9,fontSize:12,textAlign:'right'},children:(0,o.inr)(e.charges)})]},e.leg_id))]}),(0,d.jsx)(n.T,{style:{fontSize:12,color:n.C.muted},children:'close'===S.kind?'Sequence: buy back shorts first; sell longs only after every buy-back has filled.':'adjust'===S.kind?`Only the delta orders that turn what this deployment holds into the new version. ${S.sequence}`:`Sequence: ${S.sequence} Group 1 is sent first.`}),(0,d.jsxs)(l.default,{style:[n.s.row,{flexWrap:'wrap',gap:18}],children:[(0,d.jsx)(p,{k:S.net_premium>=0?'Net credit':'Net debit',v:(0,o.inr)(Math.abs(S.net_premium))}),'open'===S.kind&&(0,d.jsx)(p,{k:"Exchange margin (Kite)",v:S.margin?(0,o.inr)(S.margin.final):'Unavailable',note:S.margin?`Before hedge benefit ${(0,o.inr)(S.margin.initial)}`:'Stated, not guessed'}),(0,d.jsx)(p,{k:"Charges (est.)",v:(0,o.inr)(S.charges),note:"Entry orders"})]}),(0,d.jsx)(l.default,{style:{gap:6},children:S.checks.map(e=>(0,d.jsxs)(l.default,{style:[n.s.row,{gap:8,alignItems:'flex-start'}],children:[(0,d.jsx)(n.Icon,{name:'pass'===e.status?'check-circle':'warn'===e.status?'alert-triangle':'x-octagon',size:14,color:'pass'===e.status?n.C.green:'warn'===e.status?n.C.amber:n.C.red}),(0,d.jsxs)(l.default,{style:{flex:1},children:[(0,d.jsx)(n.T,{style:{fontSize:12},children:e.label}),(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:e.detail})]})]},e.key))}
1082),S.requires_ack&&(0,d.jsx)(n.Checkbox,{checked:q,onChange:W,tone:n.C.red,label:"I understand this structure has unlimited loss",detail:"Even on paper, this is how an unhedged short behaves."}),!b&&!j&&(0,d.jsx)(f,{p:S,strategyId:u,expired:U}),(0,d.jsxs)(l.default,{style:{backgroundColor:n.C.paper,borderRadius:10,padding:12,gap:4},children:[(0,d.jsx)(n.T,{style:{fontSize:12},children:"Fill rule (paper): a BUY fills at the ask once the ask is at or below your limit; a SELL fills at the bid once the bid is at or above your limit. Resting orders are re-checked against live quotes every few seconds while the market is open."}),(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:"Pressing Place sends this exact plan once. Pressing it again cannot create a second set of orders."})]})]})]})},_e.DeploymentCard=function({d:e,onChanged:r,onClose:i,onAdjust:c}){const[u,h]=(0,t.useState)(!1),[f,p]=(0,t.useState)('closed'!==e.status&&'cancelled'!==e.status),g=e.intents.filter(e=>['created','acknowledged','partially_filled'].includes(e.state)).length,y='active'===e.status?'green':'closed'===e.status||'cancelled'===e.status?'neutral':'amber';return(0,d.jsxs)(l.default,{style:{backgroundColor:n.C.paper,borderWidth:1,borderColor:n.C.line,borderRadius:12,padding:12,gap:8},children:[(0,d.jsxs)(s.default,{onPress:()=>p(!f),accessibilityRole:"button",style:[n.s.between,{flexWrap:'wrap'}],children:[(0,d.jsxs)(l.default,{style:[n.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,d.jsx)(n.Badge,{label:`PAPER \xb7 ${e.status.replace('_',' ').toUpperCase()}`,tone:y}),e.strategy_name&&(0,d.jsx)(n.T,{style:{fontFamily:'InterSemi'},children:e.strategy_name}),(0,d.jsx)(n.T,{style:{fontSize:12,color:n.C.muted},children:`${e.product} \xb7 opened ${(0,o.istEpoch)(e.opened_at)}`})]}),(0,d.jsx)(n.T,{style:{fontSize:14,fontFamily:'InterSemi',color:(e.net||0)>=0?n.C.green:n.C.red},children:null==e.net?'Net \u2014':`Net ${(0,o.signed)(e.net)}`})]}),f&&(0,d.jsxs)(d.Fragment,{children:[e.positions.length>0&&(0,d.jsx)(l.default,{children:[['Position','Units','Avg','Mark','Unrealised','Realised'],...e.positions.map(e=>[e.label,String(e.units),(0,o.num)(e.avg),`${(0,o.num)(e.mark)}${'ltp'===e.mark_basis?' LTP':e.mark_basis?` ${e.mark_basis}`:''}`,(0,o.signed)(e.unrealised),(0,o.signed)(e.realised)])].map((e,t)=>(0,d.jsx)(l.default,{style:[n.s.row,{gap:6,paddingVertical:4,borderTopWidth:t?1:0,borderColor:n.C.line}],children:e.map((e,s)=>(0,d.jsx)(n.T,{style:{flex:s?1:1.6,fontSize:t?12:10,color:t?n.C.ink:n.C.muted,textAlign:s?'right':'left',fontVariant:['tabular-nums']},children:e},s))},t))}),(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:`Marked ${(0,o.istStamp)(e.marked_at)} \xb7 ${e.mark_basis} \xb7 fees ${(0,o.inr)(e.fees)}`}),(0,d.jsx)(l.default,{style:{gap:3},children:e.intents.map(e=>(0,d.jsx)(n.T,{style:{fontSize:11,color:'filled'===e.state?n.C.muted:'cancelled'===e.state?n.C.red:n.C.amber},children:`${'close'===e.kind?'close':'open'} \xb7 g${e.grp} \xb7 ${'B'===e.side?'BUY':'SELL'} ${e.qty} ${e.symbol} @ ${(0,o.num)(e.limit_price)} limit \xb7 ${e.state}${e.avg_price?` @ ${(0,o.num)(e.avg_price)}`:''}`},e.id))}),(0,d.jsxs)(l.default,{style:[n.s.row,{gap:8,flexWrap:'wrap'}],children:[g>0&&(0,d.jsx)(n.Button,{label:`Cancel ${g} resting`,kind:"outline",icon:"x",loading:u,onPress:async()=>{h(!0);try{await a.exec.cancel(e.id),r()}finally{h(!1)}}}),'active'===e.status&&c&&(0,d.jsx)(n.Button,{label:"Adjust",kind:"outline",icon:"sliders",onPress:()=>c(e)}),('active'===e.status||'attention_required'===e.status)&&(0,d.jsx)(n.Button,{label:"Close position",kind:"outline",icon:"log-out",onPress:()=>i(e)})]})]})]})};var t=_r(_d[0]),s=e(_r(_d[1])),r=e(_r(_d[2])),l=e(_r(_d[3])),i=e(_r(_d[4])),n=_r(_d[5]),a=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]);const c=()=>'k'+Date.now().toString(36)+Math.random().toString(36).slice(2,8);const u=['completed','dry_run_complete','blocked','failed','cancelled','attention_required','refused','not_received'],h={completed:'green',dry_run_complete:'neutral',accepted:'amber',dispatching:'amber',sending:'amber',blocked:'red',refused:'red',failed:'red',attention_required:'red',cancelled:'neutral',unknown:'red',not_received:'neutral'};function f({p:e,strategyId:s,expired:r}){const i=e.live,[f,p]=(0,t.useState)(null),[g,y]=(0,t.useState)(!1),[x,b]=(0,t.useState)(''),[j,C]=(0,t.useState)(''),[k,S]=(0,t.useState)(!1),w=(0,t.useRef)(c());async function $(t){b(t),C('');try{p(await a.exec.autotrade(s,e,w.current+t,t,'live'===t&&k))}catch(e){C(e.message)}finally{b('')}}(0,t.useEffect)(()=>{p(null),S(!1),w.current=c()},[e.id]),(0,t.useEffect)(()=>
1082{if(!f||u.includes(f.state))return;const e=setInterval(async()=>{try{p(await a.exec.autotradeGet(f.id))}catch{}},2e3);return()=>clearInterval(e)},[f]);const T=!!i.enabled&&e.can_submit&&!r&&!e.requires_ack;return(0,d.jsxs)(l.default,{style:{borderWidth:1,borderColor:n.C.line,borderRadius:12,padding:12,gap:8},children:[(0,d.jsxs)(l.default,{style:[n.s.between,{flexWrap:'wrap',gap:6}],children:[(0,d.jsx)(n.T,{style:{fontFamily:'InterSemi',fontSize:13},children:"AutoTrade hand-off"}),(0,d.jsx)(n.Badge,{label:i.configured?i.reachable?i.live_allowed?'LIVE POSSIBLE':'DRY RUN ONLY':'UNREACHABLE':'NOT CONNECTED',tone:i.live_allowed?'red':i.enabled?'neutral':'amber'})]}),(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:i.reason}),!!i.gates?.length&&(0,d.jsx)(l.default,{style:{gap:4},children:i.gates.map(e=>(0,d.jsxs)(l.default,{style:[n.s.row,{gap:8,alignItems:'flex-start'}],children:[(0,d.jsx)(n.Icon,{name:e.deferred?'clock':e.pass?'check-circle':'x-circle',size:13,color:e.deferred?n.C.muted:e.pass?n.C.green:n.C.muted}),(0,d.jsxs)(l.default,{style:{flex:1},children:[(0,d.jsx)(n.T,{style:{fontSize:12},children:e.label}),(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:e.detail})]})]},e.gate))}),i.configured&&(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:`AutoTrade identity ${i.engine_user}${i.broker_account_id?` \xb7 account ${i.broker_account_id}`:''}. Only the operator can arm it, outside this app.`}),i.live_allowed&&(0,d.jsx)(n.Checkbox,{checked:k,onChange:S,tone:n.C.red,label:"I confirm AutoTrade may place REAL orders on my broker account for this exact plan",detail:"Hedges are bought first; sells go only after every hedge fills. AutoTrade can still refuse."}),(0,d.jsxs)(l.default,{style:[n.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,d.jsx)(n.Button,{label:"Send dry run to AutoTrade",icon:"send",kind:"outline",loading:'dry_run'===x,disabled:!T||!!f,onPress:()=>$('dry_run')}),(0,d.jsx)(n.Button,{label:"Send live",icon:i.live_allowed?'zap':'lock',kind:"outline",loading:'live'===x,disabled:!(T&&i.live_allowed&&k&&!f),accessibilityHint:i.reason,onPress:()=>$('live')})]}),!!j&&(0,d.jsx)(n.T,{style:{fontSize:12,color:n.C.red},children:j}),f&&(0,d.jsxs)(l.default,{style:{backgroundColor:n.C.paper,borderRadius:10,padding:10,gap:4},children:[(0,d.jsxs)(l.default,{style:[n.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,d.jsx)(n.Badge,{label:`${'live'===f.mode?'LIVE':'DRY RUN'} \xb7 ${f.state.replace(/_/g,' ').toUpperCase()}`,tone:h[f.state]||'amber'}),!u.includes(f.state)&&(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:'unknown'===f.state?'Outcome unknown - reconciling with AutoTrade by its key. Nothing will be re-sent.':'Following AutoTrade\u2026'})]}),'unknown'===f.state&&(0,d.jsx)(n.T,{accessibilityRole:"alert",style:{fontSize:12,color:n.C.red},children:"The request left this app but no answer came back, so it may or may not have been accepted. No new orders for this strategy until it resolves."}),'unknown'===f.state&&(0,d.jsx)(n.Checkbox,{checked:g,onChange:y,tone:n.C.red,label:"I checked AutoTrade and this hand-off created no orders",detail:"Only release it after checking AutoTrade yourself. This app cannot confirm it; releasing lets a new hand-off of this strategy go out."}),'unknown'===f.state&&(0,d.jsx)(n.Button,{label:"Release this hand-off",kind:"outline",disabled:!g,onPress:async()=>{try{p(await a.exec.autotradeRelease(f.id))}catch(e){C(e.message)}}}),!!f.reason&&(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:f.reason}),f.intent?.legs.map((e,t)=>(0,d.jsx)(n.T,{style:{fontSize:11,color:'filled'===e.state||'dry_run'===e.state?n.C.muted:n.C.amber},children:`g${e.group} \xb7 ${e.side} ${e.quantity} ${e.tradingsymbol} @ ${(0,o.num)(e.limit_price)} \xb7 ${e.state.replace(/_/g,' ')}${e.avg_price?` @ ${(0,o.num)(e.avg_price)}`:''}${e.error?` \xb7 ${e.error}`:''}`},t)),'dry_run'===f.mode&&u.includes(f.state)&&(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:"A dry run walks the same group order through AutoTrade's broker adapter without sending any order."}),!u.includes(f.state)&&(0,d.jsx)(n.Button,{label:"Stop",kind:"outline",icon:"x",onPress:async()=>{try{p(await a.exec.autotradeCancel(f.id))}catch(e){C(e.message)}}})]})]})}function p({k:e,v:t,note:s}){return(0,d.jsxs)(l.default,{style:{gap:1,minWidth:140},children:[(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:e}),(0,d.jsx)(n.T,{style:{fontSize:15,fontFamily:'InterSemi'},children:t}),s&&(0,d.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:s})]})}},989,[11,375,385,13,400,821,976,979,6]); 1083__d(function(_g,_r,_i,a,m,_e,d){"use strict";
1083function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdjustSheet=function({visible:e,onClose:r,strategyId:l,version:p,deployment:g,onApplied:j}){const{width:y}=(0,s.default)(),b=y>=900,[k,v]=(0,t.useState)(null),[w,C]=(0,t.useState)(''),[_,S]=(0,t.useState)(''),z=async()=>{C(''),v(null);try{v(await o.sb.adjustCandidates(l,g?.id))}catch(e){C(e.message)}};async function $(e){S(e.rule+(e.k??'')),C('');try{j(await o.sb.adjustApply(l,{rule:e.rule,k:e.k,version:p,deployment_id:g?.id}))}catch(e){C(e.message),/changed|conflict/i.test(e.message)&&z()}finally{S('')}}(0,t.useEffect)(()=>{e&&z()},[e,g?.id]);const T=(k?.candidates||[]).filter(e=>e.available),B=(k?.candidates||[]).filter(e=>!e.available);return(0,c.jsxs)(i.Sheet,{visible:e,onClose:r,wide:!0,title:g?'Adjust paper deployment':'Adjust this strategy',subtitle:k?`${k.structure} \xb7 spot ${(0,u.num)(k.spot,2)} \xb7 quotes ${(0,u.istStamp)(k.as_of)} \xb7 entries from ${k.entry_basis}`:'Evaluating adjustments against the market now\u2026',footer:(0,c.jsxs)(n.default,{style:[i.s.between,{flexWrap:'wrap',gap:8}],children:[(0,c.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted,flex:1,minWidth:240},children:["Choosing an adjustment writes a new version of this strategy. ",g?'You then review only the delta orders - nothing is sent before that.':'Nothing is ordered.']}),(0,c.jsx)(i.Button,{label:"Refresh",icon:"refresh-cw",kind:"outline",onPress:z})]}),children:[!!w&&(0,c.jsx)(n.default,{style:{backgroundColor:i.C.redBg,borderRadius:10,padding:12},children:(0,c.jsx)(i.T,{style:{color:i.C.red,fontSize:13},children:w})}),!k&&!w&&(0,c.jsx)(i.Loading,{}),k&&(0,c.jsxs)(c.Fragment,{children:[!!k.horizon&&(0,c.jsxs)(n.default,{style:[i.s.row,{gap:8,alignItems:'flex-start'}],children:[(0,c.jsx)(i.Badge,{label:'model_near_expiry'===k.horizon.kind?'MODEL':'EXACT',tone:'model_near_expiry'===k.horizon.kind?'amber':'green'}),(0,c.jsx)(i.T,{style:{fontSize:12,color:'model_near_expiry'===k.horizon.kind?i.C.amber:i.C.muted,flex:1},children:`Current and every proposal share one horizon: ${k.horizon.label}. ${k.horizon.note}`})]}),(0,c.jsxs)(n.default,{style:[i.s.row,{flexWrap:'wrap',gap:18}],children:[(0,c.jsx)(f,{k:"Tested",v:k.tested?k.tested.label:'No short leg',note:k.tested?""+(k.tested.distance_pct>=0?(0,u.num)(k.tested.distance_pct,2)+'% from the money':(0,u.num)(-k.tested.distance_pct,2)+'% in the money'):'Only resizing or closing applies'}),(0,c.jsx)(f,{k:"Worst case now",v:k.current.unlimited_loss?'Unlimited':(0,u.inr)(k.current.worst)}),(0,c.jsx)(f,{k:"Best case now",v:k.current.unlimited_profit?'Unlimited':null==k.current.best?'\u2014':(0,u.inr)(k.current.best)}),(0,c.jsx)(f,{k:"Breakevens now",v:k.current.breakevens.length?k.current.breakevens.map(e=>(0,u.num)(e,0)).join(' / '):'\u2014'}),(0,c.jsx)(f,{k:"Delta now",v:null==k.current.delta?'Unavailable':(0,u.num)(k.current.delta,2),note:null==k.current.delta?'A leg\'s IV cannot be solved from its price':'Model, \u20b9 per 1-point move'}),(0,c.jsx)(f,{k:"Margin now",v:null==k.current.margin?'Unavailable':(0,u.inr)(k.current.margin),note:null==k.current.margin?'Needs a live broker margin read':'Kite basket margin'})]}),(0,c.jsx)(n.default,{style:{flexDirection:b?'row':'column',flexWrap:'wrap',gap:12},children:T.map(e=>(0,c.jsxs)(n.default,{style:{flexBasis:b?'48%':'auto',flexGrow:1,backgroundColor:i.C.paper,borderWidth:1,borderColor:i.C.line,borderRadius:14,padding:14,gap:8},children:[(0,c.jsxs)(n.default,{style:[i.s.between,{flexWrap:'wrap',gap:6}],children:[(0,c.jsx)(i.T,{style:{fontFamily:'InterSemi',fontSize:15},children:e.name}),(0,c.jsx)(i.Badge,{label:e.evidence.label,tone:h[e.evidence.status||'model_only']||'amber'})]}),(0,c.jsx)(i.T,{style:{fontSize:12,color:i.C.muted},children:`${e.note} \u2192 ${e.structure_after}`}),!!e.evidence.note&&(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:e.evidence.note}),(0,c.jsx)(x,{points:e.overlay||[],spot:k.spot}),(0,c.jsxs)(n.default,{style:[i.s.row,{flexWrap:'wrap',gap:14}],children:[(0,c.jsx)(f,{k:(e.cash||0)>=0?'Credit':'Debit',v:(0,u.inr)(Math.abs(e.cash||0)),note:`charges ${(0,u.inr)(e.charges||0)}`}),(0,c.jsx)(f,{k:"Worst case after",v:e.after?.unlimited_loss?'Unlimited':(0,u.inr)(e.after?.worst??0)}),(0,c.jsx)(f,{k:"Best case after",v:e.after?.unlimited_profit?'Unlimited':null==e.after?.best?'\u2014':(0,u.inr)(e.after.best)}),(0,c.jsx)(f,{k:"Breakevens after",v:e.after?.breakevens.length?e.after.breakevens.map(e=>(0,u.num)(e,0)).join(' / '):'\u2014'}),(0,c.jsx)(f,{k:"Delta change",v:null==e.delta?.change?'Unavailable':(0,u.signed)(e.delta.change),note:null==e.delta?.change?'Model delta not computable':void 0}),(0,c.jsx)(f,{k:"Margin change",v:null==e.margin?.change?'Unavailable':(0,u.signed)(e.margin.change)})]}),(0,c.jsx)(n.default,{style:{gap:2},children:(e.orders||[]).map((e,t)=>(0,c.jsx)(i.T,{style:{fontSize:11,color:'B'===e.side?i.C.green:i.C.red,fontVariant:['tabular-nums']},children:`${'B'===e.side?'BUY':'SELL'} ${e.qty} ${e.symbol} @ ${(0,u.num)(e.price)} (${'exec'===e.basis?'B'===e.side?'ask':'bid':'LTP - no bid/ask'}) \xb7 ${e.effect}`},t))}),(0,c.jsx)(i.Button,{label:"Use this adjustment",icon:"check",loading:_===e.rule+(e.k??''),onPress:()=>$(e)})]},e.rule+(e.k??'')))}),!!B.length&&(0,c.jsxs)(n.default,{style:{gap:4},children:[(0,c.jsx)(i.T,{style:{fontSize:12,fontFamily:'InterSemi'},children:"Not available now"}),B.map(e=>(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:`${e.name}: ${e.reason}`},e.rule+(e.k??'')))]}),(0,c.jsx)(n.default,{style:{backgroundColor:i.C.paper,borderRadius:10,padding:12,gap:3},children:k.notes.map((e,t)=>(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:e},t))})]})]})};var t=_r(d[0]),n=e(_r(d[1])),s=e(_r(d[2])),r=_r(d[3]),l=e(r),i=_r(d[4]),o=_r(d[5]),u=_r(d[6]),c=_r(d[7]);const h={adjust_helped:'green',adjust_hurt:'red',adjust_not_significant:'neutral',insufficient:'amber',model_only:'amber'};function f({k:e,v:t,note:s}){return(0,c.jsxs)(n.default,{style:{gap:1,minWidth:110},children:[(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:e}),(0,c.jsx)(i.T,{style:{fontSize:14,fontFamily:'InterSemi'},children:t}),!!s&&(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:s})]})}function x({points:e,spot:s,height:o=150}){const[u,h]=(0,t.useState)(420),f=(0,t.useMemo)(()=>
1083{if(e.length<2)return null;const t=e[0].s,n=e[e.length-1].s,s=e.flatMap(e=>[e.current,e.after]);let r=Math.min(0,...s),l=Math.max(0,...s);const i=.08*(l-r)||1;r-=i,l+=i;const c=e=>8+(e-t)/(n-t||1)*(u-16),h=e=>6+(l-e)/(l-r||1)*(o-12),f=t=>e.map((e,n)=>`${n?'L':'M'}${c(e.s).toFixed(1)},${h(e[t]).toFixed(1)}`).join('');return{X:c,Y:h,cur:f('current'),aft:f('after'),x0:t,x1:n}},[e,u,o]);return f?(0,c.jsxs)(n.default,{onLayout:e=>h(Math.max(240,e.nativeEvent.layout.width)),accessibilityLabel:"Expiry profit and loss: dashed line now, solid line after the adjustment",children:[(0,c.jsxs)(l.default,{width:u,height:o,children:[(0,c.jsx)(r.Line,{x1:8,x2:u-8,y1:f.Y(0),y2:f.Y(0),stroke:i.C.line,strokeWidth:1}),s>=f.x0&&s<=f.x1&&(0,c.jsx)(r.Line,{x1:f.X(s),x2:f.X(s),y1:4,y2:o-4,stroke:i.C.muted,strokeWidth:1,strokeDasharray:"2,3"}),(0,c.jsx)(r.Path,{d:f.cur,stroke:i.C.muted,strokeWidth:1.5,fill:"none",strokeDasharray:"5,4"}),(0,c.jsx)(r.Path,{d:f.aft,stroke:i.C.green,strokeWidth:2,fill:"none"})]}),(0,c.jsxs)(n.default,{style:[i.s.row,{gap:14}],children:[(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:"- - now"}),(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.green},children:"\u2014\u2014 after"}),(0,c.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:"\u2506 spot"})]})]}):null}},990,[11,13,400,840,821,976,979,6]); 1084__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ChainDrawer=function({visible:e,chain:i,legs:h,onToggle:C,onClose:T,state:P,status:S}){const v=(0,s.default)().width<600,[$,_]=(0,t.useState)(!1),[w,I]=(0,t.useState)('price'),[M,z]=(0,t.useState)(''),[L,V]=(0,t.useState)(!1),[F,H]=(0,t.useState)(0),O=(0,t.useMemo)(()=>{if(!i)return[];const e=!!i.quality?.live,t=f(e);let r=i.rows;L&&(r=r.filter(e=>t(e.CE)||t(e.PE))),F&&(r=r.filter(e=>Math.abs(e.strike/i.spot-1)<=F/100));const l=M.trim();if(l){const e=Number(l);if(Number.isFinite(e)&&e>0){const t=[...r].sort((t,i)=>Math.abs(t.strike-e)-Math.abs(i.strike-e)).slice(0,9).map(e=>e.strike);r=r.filter(e=>t.includes(e.strike))}}if($||F||l)return r;const n=r.findIndex(e=>e.strike>=i.atm_strike);return r.slice(Math.max(0,n-x),Math.max(0,n)+x+1)},[i,$,L,F,M]),A=(0,t.useRef)(null),B=v?56:45,R=e=>'price'===w?`IV ${(0,u.ivText)(e?.iv)}`:'oi'===w?`OI ${m(e?.oi)}`:E(e?.greeks),W=!!i?.prev_session_gap,q=!!i?.rows.some(e=>null!=e.CE?.change_pct||null!=e.PE?.change_pct||!!e.CE?.no_trade_today||!!e.PE?.no_trade_today),G=W||!!i?.rows.some(e=>null!=e.CE?.oi_change||null!=e.PE?.oi_change),N=e=>(0,c.changeCell)(e,w,W),D=e=>(0,c.changeCell)(e,w,W,!0),X=!!(0,c.marketBanner)(P??S?.market_state,i?.reading),J=i?(0,c.chainSourceText)(S??(P?{market_state:P}:null),!!i.quality?.live,i.as_of):null,K=(0,c.spotChangeText)(i?.spot_change,i?.spot_change_pct),Q=i?(0,u.forwardText)(i.pricing,i.expiry,i.spot):null,U=i?(0,u.ivMarkerLegend)(i.rows):null,Y=v?{ltp:1.3,pair:2.5,strike:1.1}:{ltp:1.2,pair:1.6,strike:1.3};(0,t.useEffect)(()=>{if(!e||!i)return;const t=O.findIndex(e=>e.strike===i.atm_strike),r=setTimeout(()=>A.current?.scrollTo?.({y:Math.max(0,t*B-200),animated:!1}),60);return()=>clearTimeout(r)},[e,i,O]);const Z=e=>!!i&&(e.expiry||i.expiry)===i.expiry,ee=(e,t)=>h.find(i=>Z(i)&&i.strike===e&&i.type===t),te=h.filter(e=>!Z(e)),ie=f(!!i?.quality?.live),re=e=>!L||ie(e);return(0,p.jsxs)(o.Sheet,{visible:e,onClose:T,wide:!0,title:"Add from the option chain",subtitle:i?`${i.underlying} \xb7 expiry ${(0,a.dayMonth)(i.expiry)} \xb7 spot ${(0,a.num)(i.spot,2)}${K?` (${K})`:''}${Q?` \xb7 ${Q}`:''}${!X&&J?` \xb7 ${J}`:''}`:'Loading\u2026',footer:(0,p.jsxs)(n.default,{style:[o.s.between,{flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:`${h.length} leg${1===h.length?'':'s'} in this strategy${te.length?` \xb7 ${te.length} in other expiries (${[...new Set(te.map(e=>(0,a.dayMonth)(e.expiry)))].join(', ')}) - not shown in this ${i?(0,a.dayMonth)(i.expiry):''} chain`:''}`}),(0,p.jsx)(o.Button,{label:"Done",icon:"check",onPress:T})]}),children:[(0,p.jsx)(d.MarketStateBanner,{state:P??S?.market_state,reading:i?.reading,compact:!0}),(0,p.jsxs)(n.default,{style:[o.s.row,{flexWrap:'wrap',gap:8}],children:[(0,p.jsx)(o.Chip,{label:"Price & IV",active:'price'===w,onPress:()=>I('price')}),(0,p.jsx)(o.Chip,{label:"Open interest",active:'oi'===w,onPress:()=>I('oi')}),(0,p.jsx)(o.Chip,{label:"Greeks",active:'greeks'===w,onPress:()=>I('greeks')}
1084),(0,p.jsx)(o.Chip,{label:$?'Near the money':'All strikes',active:$,onPress:()=>_(!$),icon:"list"})]}),(0,p.jsxs)(n.default,{style:[o.s.row,{flexWrap:'wrap',gap:8,alignItems:'center'}],children:[(0,p.jsx)(l.default,{value:M,onChangeText:z,keyboardType:"numeric",placeholder:"Go to strike",placeholderTextColor:o.C.muted,accessibilityLabel:"Go to strike",style:{minHeight:40,width:130,borderWidth:1,borderColor:o.C.line,borderRadius:10,paddingHorizontal:10,color:o.C.ink,fontFamily:'Inter',fontSize:13,backgroundColor:o.C.paper}}),[[0,'Any range'],[2,'\xb12%'],[5,'\xb15%'],[10,'\xb110%']].map(([e,t])=>(0,p.jsx)(o.Chip,{label:t,active:F===e,onPress:()=>H(e)},e)),(0,p.jsx)(o.Chip,{label:"Liquid only",icon:"droplet",active:L,onPress:()=>V(!L)}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},accessibilityLiveRegion:"polite",children:`${O.length} strikes shown`})]}),i?(0,p.jsxs)(n.default,{style:{borderWidth:1,borderColor:o.C.line,borderRadius:12,overflow:'hidden'},children:[(0,p.jsxs)(n.default,{style:[o.s.row,{backgroundColor:o.C.paper,paddingVertical:8,paddingHorizontal:8,gap:0}],children:[!v&&(0,p.jsx)(y,{flex:1.2,children:'price'===w?'IV':'oi'===w?"OI"+(G?' \xb7 chg':''):'\u0394 \xb7 \u0398/day'}),(0,p.jsx)(y,{flex:Y.ltp,children:v?"Call LTP \xb7 "+('price'===w?'IV':'oi'===w?'OI':'\u0394\xb7\u0398'):"Call LTP"+(q&&'price'===w?' \xb7 chg':'')}),(0,p.jsx)(y,{flex:Y.pair,children:" "}),(0,p.jsx)(y,{flex:Y.strike,center:!0,children:"Strike"}),(0,p.jsx)(y,{flex:Y.pair,children:" "}),(0,p.jsx)(y,{flex:Y.ltp,right:!0,children:v?"Put LTP \xb7 "+('price'===w?'IV':'oi'===w?'OI':'\u0394\xb7\u0398'):"Put LTP"+(q&&'price'===w?' \xb7 chg':'')}),!v&&(0,p.jsx)(y,{flex:1.2,right:!0,children:'price'===w?'IV':'oi'===w?"OI"+(G?' \xb7 chg':''):'\u0394 \xb7 \u0398/day'})]}),(0,p.jsx)(r.default,{ref:A,style:{maxHeight:520},children:O.map(e=>{const t=e.strike===i.atm_strike,r=e.strike<i.spot;return(0,p.jsxs)(n.default,{style:[o.s.row,{gap:0,paddingHorizontal:8,height:B,borderTopWidth:1,borderColor:o.C.line,backgroundColor:t?o.C.soft:'transparent'}],children:[!v&&(0,p.jsx)(b,{flex:1.2,tone:r,sub:'oi'===w?N(e.CE):void 0,children:'price'===w?(0,u.ivText)(e.CE?.iv):'oi'===w?m(e.CE?.oi):E(e.CE?.greeks)}),v?(0,p.jsx)(k,{flex:Y.ltp,tone:r,a:null!=e.CE?.ltp?(0,a.num)(e.CE.ltp,2):'\u2014',b:R(e.CE),c:D(e.CE)}):(0,p.jsx)(b,{flex:1.2,tone:r,strong:!0,sub:'price'===w?N(e.CE):void 0,children:null!=e.CE?.ltp?(0,a.num)(e.CE.ltp,2):'\u2014'}),(0,p.jsx)(j,{big:v,flex:Y.pair,side:re(e.CE)?e.CE:null,picked:ee(e.strike,'CE'),label:`${(0,a.strikeText)(e.strike)} call ${(0,a.dayMonth)(i.expiry)}`,onPress:t=>null!=e.CE?.ltp&&C(e.strike,'CE',t,e.CE.ltp,i.expiry)}),(0,p.jsxs)(n.default,{style:{flex:Y.strike,alignItems:'center'},children:[(0,p.jsxs)(n.default,{style:[o.s.row,{gap:2}],children:[(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:13,fontVariant:['tabular-nums']},children:(0,a.strikeText)(e.strike)}),(0,p.jsx)(g,{row:e})]}),t&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.green},children:"ATM"})]}),(0,p.jsx)(j,{big:v,flex:Y.pair,side:re(e.PE)?e.PE:null,picked:ee(e.strike,'PE'),label:`${(0,a.strikeText)(e.strike)} put ${(0,a.dayMonth)(i.expiry)}`,onPress:t=>null!=e.PE?.ltp&&C(e.strike,'PE',t,e.PE.ltp,i.expiry)}),v?(0,p.jsx)(k,{flex:Y.ltp,right:!0,tone:!r&&!t,a:null!=e.PE?.ltp?(0,a.num)(e.PE.ltp,2):'\u2014',b:R(e.PE),c:D(e.PE)}):(0,p.jsx)(b,{flex:1.2,right:!0,tone:!r&&!t,strong:!0,sub:'price'===w?N(e.PE):void 0,children:null!=e.PE?.ltp?(0,a.num)(e.PE.ltp,2):'\u2014'}),!v&&(0,p.jsx)(b,{flex:1.2,right:!0,tone:!r&&!t,sub:'oi'===w?N(e.PE):void 0,children:'price'===w?(0,u.ivText)(e.PE?.iv):'oi'===w?m(e.PE?.oi):E(e.PE?.greeks)})]},e.strike)})})]}):(0,p.jsx)(o.T,{style:{color:o.C.muted},children:"Loading the chain\u2026"}),W&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:c.PREV_GAP_TEXT}),(q||G&&!W)&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Changes (chg) are against the previous session's close${i?.reading?.prev_session_at?` (${(0,a.istStamp)(i.reading.prev_session_at)})`:''}; blank where it was not recorded.`}),!!U&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:U}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Shaded cells are in the money. ${(0,u.chainIvNote)(i?.pricing,!!i?.quality.live)} IV is blank where it cannot be solved.`})]})};var t=_r(_d[0]),i=e(_r(_d[1])),r=e(_r(_d[2])),l=e(_r(_d[3])),n=e(_r(_d[4])),s=e(_r(_d[5])),o=_r(_d[6]),a=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),p=_r(_d[12]);const x=12,f=e=>t=>!!t&&null!=t.ltp&&(t.oi||0)>0&&(!e||!!t.bid&&!!t.ask&&t.bid>0&&t.bid<=t.ask);function g({row:e}
1084){const t=(0,u.ivMarker)(e),i=(0,h.useTitle)(t?.title);return t?(0,p.jsx)(n.default,{ref:i,accessible:!0,accessibilityLabel:t.title,children:(0,p.jsx)(o.T,{style:{fontSize:11,lineHeight:13,color:o.C.muted},children:t.mark})}):null}function m(e){return null==e?'\u2014':e>=1e7?`${(e/1e7).toFixed(1)}Cr`:e>=1e5?`${(e/1e5).toFixed(1)}L`:e.toLocaleString('en-IN')}function y({children:e,flex:t,right:i,center:r}){return(0,p.jsx)(o.T,{style:{flex:t,fontSize:11,fontFamily:'InterMedium',letterSpacing:.6,color:o.C.muted,textTransform:'uppercase',textAlign:i?'right':r?'center':'left'},children:e})}const C=e=>e>0?o.C.green:e<0?o.C.red:o.C.muted;function b({children:e,flex:t,right:i,tone:r,strong:l,sub:s}){const a=(0,p.jsx)(o.T,{style:{fontSize:12,lineHeight:s?.t?16:21,textAlign:i?'right':'left',fontVariant:['tabular-nums'],color:r?o.C.amber:o.C.ink,fontFamily:l?'InterMedium':'Inter'},children:e});return s?.t?(0,p.jsxs)(n.default,{style:{flex:t,alignItems:i?'flex-end':'flex-start'},children:[a,(0,p.jsx)(o.T,{style:{fontSize:11,lineHeight:13,color:s.muted?o.C.muted:C(s.d),fontStyle:s.muted?'italic':'normal',fontVariant:['tabular-nums']},numberOfLines:1,children:s.t})]}):(0,p.jsx)(n.default,{style:{flex:t},children:a})}function k({flex:e,a:t,b:i,c:r,right:l,tone:s}){const a=!!r?.t;return(0,p.jsxs)(n.default,{style:{flex:e,alignItems:l?'flex-end':'flex-start'},children:[(0,p.jsx)(o.T,{style:{fontSize:12,lineHeight:a?15:21,fontFamily:'InterMedium',color:s?o.C.amber:o.C.ink,fontVariant:['tabular-nums']},children:t}),(0,p.jsx)(o.T,{style:{fontSize:11,lineHeight:a?13:21,color:o.C.muted,fontVariant:['tabular-nums']},numberOfLines:1,children:i}),a&&(0,p.jsx)(o.T,{style:{fontSize:11,lineHeight:13,color:r.muted?o.C.muted:C(r.d),fontStyle:r.muted?'italic':'normal',fontVariant:['tabular-nums']},numberOfLines:1,children:r.t})]})}function j({flex:e,side:t,picked:r,label:l,onPress:s,big:a}){const d=!t||null==t.ltp,c=e=>{const t=r?.side===e,n='B'===e?o.C.green:o.C.red;return(0,p.jsx)(i.default,{disabled:d,onPress:()=>s(e),accessibilityRole:"button",accessibilityState:{selected:t,disabled:d},accessibilityLabel:`${'B'===e?'Buy':'Sell'} ${l}${t?' (added)':''}`,'aria-pressed':t,hitSlop:a?void 0:{top:8,bottom:8,left:4,right:4},style:({pressed:e})=>({width:a?44:32,height:a?44:30,borderRadius:8,borderWidth:1,borderColor:d?o.C.line:n,backgroundColor:t?n:'transparent',alignItems:'center',justifyContent:'center',opacity:d?.35:e?.7:1}),children:(0,p.jsx)(o.T,{style:{fontSize:11,fontFamily:'InterSemi',color:t?o.C.onGreen:d?o.C.muted:n},children:e})},e)};return(0,p.jsxs)(n.default,{style:[o.s.row,{flex:e,gap:6,justifyContent:'center'}],children:[c('B'),c('S')]})}function E(e){return e?`${e.delta.toFixed(2)} \xb7 ${e.theta.toFixed(1)}`:'\u2014'}},991,[11,375,278,385,13,400,821,979,992,986,993,869,6]); 1085__d(function(g,_r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useSbStatus=function(e=6e4){const[l,i]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!0;const l=(0,n.visiblePoll)(()=>r.exec.status().then(e=>{t&&i(e)}).catch(()=>{}),e);return()=>{t=!1,l()}},[e]),l},_e.MarketStateBanner=function({state:e,reading:t,warning:n,compact:l}){const r=(0,o.marketBanner)(e,t);return r?(0,c.jsxs)(i.default,{accessibilityRole:"summary",accessibilityLabel:r.text,style:[s.s.row,{flexWrap:'wrap',alignItems:'flex-start',gap:8,backgroundColor:s.C.paper,borderWidth:1,borderColor:s.C.line,borderRadius:10,paddingHorizontal:12,paddingVertical:l?6:9,maxWidth:'100%'}],children:[(0,c.jsx)(i.default,{style:{paddingTop:3},children:(0,c.jsx)(s.Icon,{name:'pre_open'===r.kind?'sunrise':'unknown'===r.kind?'help-circle':'moon',size:13,color:s.C.mint})}),(0,c.jsxs)(i.default,{style:{flex:1,minWidth:0,gap:2},children:[!!n&&(0,c.jsx)(s.T,{style:{fontSize:12,color:s.C.amber},children:n}),(0,c.jsxs)(s.T,{style:{fontSize:12,lineHeight:18,color:s.C.muted},children:[(0,c.jsx)(s.T,{style:{fontSize:12,lineHeight:18,fontFamily:'InterSemi',color:s.C.ink},children:r.headline}),r.parts.map((e,t)=>(0,c.jsx)(s.T,{style:{fontSize:12,lineHeight:18,color:s.C.muted},children:` \xb7 ${e}`},t))]})]})]}):null}
1085,_e.PaperRunState=function({run:e,prefix:t}){const n=(0,o.runState)(e);return(0,c.jsxs)(i.default,{style:{gap:4,flexShrink:1,maxWidth:'100%'},children:[(0,c.jsx)(s.Badge,{label:`${t?`${t} \xb7 `:''}${n.chip}`.toUpperCase(),tone:n.tone}),!!n.line&&(0,c.jsx)(s.T,{style:{fontSize:12,color:'cancelled'===e.status?s.C.muted:s.C.amber},children:'cancelled'===e.status?`Cancelled: ${n.line}`:n.line})]})},_e.PaperRunAction=function({run:e,state:n,onClose:l,onCancel:r}){const u=(0,o.runState)(e),[p,x]=(0,t.useState)(!1),[h,f]=(0,t.useState)(!1),[b,y]=(0,t.useState)(''),C=async e=>{f(!0),y('');try{await e()}catch(e){y((0,o.actionErrorText)(e))}finally{f(!1),x(!1)}},j=b?(0,c.jsx)(s.T,{accessibilityRole:"alert",style:{fontSize:12,color:s.C.red,maxWidth:420},children:b}):null,S=e=>j?(0,c.jsxs)(i.default,{style:{gap:6,alignItems:'flex-start',maxWidth:'100%'},children:[e,j]}):(0,c.jsx)(c.Fragment,{children:e});return'cancel'===u.action?S((0,c.jsx)(s.Button,{label:"Cancel",icon:"x",kind:"outline",loading:h,accessibilityLabel:"Cancel this paper trade before it fills",onPress:()=>C(r)})):'keep_open'===u.action?S((0,c.jsx)(s.Button,{label:"Keep open",kind:"outline",loading:h,accessibilityLabel:"Withdraw the queued exit and keep this paper run open",onPress:()=>C(r)})):'close'!==u.action?j:p?(0,c.jsxs)(i.default,{style:{gap:8,backgroundColor:s.C.bg,borderWidth:1,borderColor:s.C.line,borderRadius:10,padding:10,maxWidth:420},children:[(0,c.jsx)(s.T,{style:{fontSize:12},children:(0,o.exitQueueText)(n)}),(0,c.jsxs)(i.default,{style:[s.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,c.jsx)(s.Button,{label:"Queue exit for next open",loading:h,onPress:()=>C(l)}),(0,c.jsx)(s.Button,{label:"Keep open",kind:"outline",onPress:()=>x(!1)})]})]}):S((0,c.jsx)(s.Button,{label:"Close (simulated)",kind:"outline",loading:h,onPress:()=>(0,o.isClosed)(n)?x(!0):C(l)}))};var e,t=_r(d[0]),n=_r(d[1]),l=_r(d[2]),i=(e=l)&&e.__esModule?e:{default:e},s=_r(d[3]),r=_r(d[4]),o=_r(d[5]),c=_r(d[6])},992,[11,920,13,821,976,986,6]); 1086__d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ivText=function(t){return o(t)?`${t.toFixed(1)}%`:'\u2014'},e.modelKind=l,e.fallbackWords=c,e.forwardText=f,e.chainBasisText=function(t){if(!t)return null;const n=f(t.pricing,t.expiry,t.spot);return n?o(t.spot)?`Spot ${r(t.spot)}
1086 \xb7 ${n}`:n:null},e.chainIvNote=function(t,n){const r=l(t);if('b76'===r||'mixed'===r)return"IV: Black-76 on the forward, 0% rate; one IV per strike, from the out-of-the-money option's last price.";const s=n?'bid/ask mid (last trade when there is no valid book)':'last traded price';if('legacy'===r){const n=o(t.rate)?`${Number((100*t.rate).toFixed(2))}% constant rate`:'a constant rate',r=c(t.fallback_reason);return`IV: legacy model - Black-Scholes on the spot, ${n}${r?` (used because: ${r})`:''}; each option's own IV from its ${s}.`}return`IV is computed from each option's ${s} (Black-Scholes, 6.5% constant rate).`},Object.defineProperty(e,"IV_FALLBACK_MARK",{enumerable:!0,get:function(){return m}}),Object.defineProperty(e,"IV_UNTRADED_MARK",{enumerable:!0,get:function(){return p}}),e.ivFromUntraded=h,e.ivMarker=function(t){if(!t)return null;const n=!!t.iv_side_fallback,o=h(t);if(!n&&!o)return null;const r=[];if(n){const n='CE'===t.iv_side?'call':'PE'===t.iv_side?'put':'other option',o='CE'===t.iv_side?'put':'PE'===t.iv_side?'call':'option';r.push(`IV taken from the ${n}: the out-of-the-money ${o} had no usable price.`)}o&&r.push('No trade today: this IV comes from an older last price.');return{mark:`${n?m:''}${o?p:''}`,title:r.join(' ')}},e.ivMarkerLegend=function(t){const n=t.some(t=>!!t.iv_side_fallback),o=t.some(t=>h(t)),r=[];n&&r.push(`${m} IV taken from the in-the-money option (the out-of-the-money one had no usable price).`);o&&r.push(`${p} IV from a price that did not trade today.`);return r.length?r.join(' '):null},e.scenarioModelText=function(t){const n=l(t);return'b76'===n?'(model: Black-76 on the forward)':'legacy'===n?'(legacy model: Black-Scholes on the spot)':'mixed'===n?'(mixed model: Black-76 on the forward for some expiries, legacy Black-Scholes on the spot for others)':'(model, Black-Scholes)'},e.deltaUnitText=function(t){const n=l(t);return'b76'===n?"Delta per 1 point of the "+(u(t)?'synthetic future':'future'):'legacy'===n?'Delta per 1 point of the spot':'mixed'===n?"Delta per 1 point of each expiry's future (the spot for expiries on the legacy model)":'Delta in underlying units per 1 point'},e.markExplainText=function(t){const n=l(t);return'b76'===n||'mixed'===n?"Mark now is the leg's own market price (bid/ask mid, or its last price when there is no valid book). Greeks and the what-if use the strike's IV - one per strike, from its out-of-the-money option.":'Mark now is the market value (bid/ask mid, or LTP when there is no valid book) that the Greeks and IV use.'},e.modelGapText=function(n){const r=n.model_value_now,s=o(n.mark)?n.mark:o(n.ltp)?n.ltp:null;if(!o(r)||null==s)return null;if(Math.abs(r-s)<.499999999)return null;const l=n.label?`${n.label}: `:'';return'mid'===n.mark_basis?`${l}Model value now ${(0,t.inr)(r,2)} vs mid ${(0,t.inr)(s,2)} \u2014 the strike's IV comes from its out-of-the-money option's last trade, so the model and this quote can differ.`:`${l}Model value now ${(0,t.inr)(r,2)} vs last price ${(0,t.inr)(s,2)} \u2014 the strike's call and put last traded at different moments (Sensibull shows the same).`},e.intrinsicBasisText=function(t){const n=new Set(t.map(t=>t.intrinsic_basis).filter(Boolean));return n.size?n.size>1?'Intrinsic and time value are against the forward (legs on the legacy model: the spot).':n.has('vs_forward')?'Intrinsic and time value are against the forward.':'Intrinsic and time value are against the spot.':null};var t=_r(d[0]);const n=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],o=t=>'number'==typeof t&&Number.isFinite(t),r=t=>Math.abs(t).toLocaleString('en-IN',{minimumFractionDigits:2,maximumFractionDigits:2}),s=t=>`${t>0?'+':t<0?"\u2212":''}${r(t)}`;function l(t){return t&&t.model?'black76_forward'===t.model?'b76':'mixed'===t.model?'mixed':'legacy':null}const u=t=>'parity_mid'===t?.forward_source||'parity_ltp'===t?.forward_source;function c(t){if(!t)return null;const n=String(t).split(':')[0].trim().toUpperCase();return'AT_EXPIRY'===n?'expiry day':'NO_FORWARD'===n?'no reliable future price':'NO_SPOT'===n?'no index price':'NO_VALUATION_TIME'===n?'no reading time':'no reliable future price'}function f(r,f,m){const p=l(r);if(!p)return null;if('legacy'===p){const t=c(r.fallback_reason);return t?`Legacy model: ${t}
1086`:'Legacy model (Black-Scholes on the spot)'}const h=r.forward;if(!o(h))return'mixed'===p?'Mixed models across expiries':null;if(u(r))return`Synthetic future ${(0,t.num)(h,2)} (from option prices${'parity_ltp'===r.forward_source?', approx.':''})`;const _=f&&f.length>=7?n[Number(f.slice(5,7))-1]:null,b=o(r.basis)?r.basis:o(m)?h-m:null;return`Priced from ${_?`${_} `:''}future ${(0,t.num)(h,2)}${null!=b?` (${s(b)})`:''}`}const m='\u2020',p='*';function h(t){if(null!=t.iv_from_untraded)return!!t.iv_from_untraded;const n=t.iv_side?t[t.iv_side]:null;return null!=n?.iv_from_untraded?!!n.iv_from_untraded:!(!t.iv_side||!n?.no_trade_today||null==n?.iv)}},993,[979]); 1087__d(function(_g,_r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PayoffChart=function({curve:e,spot:p,scenarioSpot:u,breakevens:f,bands:y,height:j=300,dim:C=!1,scenarioLabel:g,expiryLabel:k="At expiry",empty:b="Add legs to draw the payoff.",premium:S=!1,width:$}){const[M,L]=(0,t.useState)(640),v=$||M,[W,X]=(0,t.useState)(null),w=(0,t.useRef)(!1),F=(0,t.useMemo)(()=>{if(!e.length)return null;const t=e.map(e=>e.s),r=e.flatMap(e=>[e.expiry,e.target]).filter(e=>null!=e),n=t[0],s=t[t.length-1];let o=Math.min(0,...r),i=Math.max(0,...r);const l=.08*(i-o)||1;o-=l,i+=l;const x=e=>h.l+(e-n)/(s-n||1)*(v-h.l-h.r),c=e=>h.t+(i-e)/(i-o||1)*(j-h.t-h.b),p=t=>e.filter(e=>null!=e[t]).map((e,r)=>`${r?'L':'M'}${x(e.s).toFixed(1)},${c(e[t]).toFixed(1)}`).join(''),u=t=>{const r=e.filter(e=>null!=e.expiry);return r.length?`M${x(r[0].s)},${c(0)}`+r.map(e=>`L${x(e.s).toFixed(1)},${c(t>0?Math.max(0,e.expiry):Math.min(0,e.expiry)).toFixed(1)}`).join('')+`L${x(r[r.length-1].s)},${c(0)}Z`:''},f=[0,.25,.5,.75,1].map(e=>o+(i-o)*e),y=[0,.2,.4,.6,.8,1].map(e=>n+(s-n)*e);return{X:x,Y:c,x0:n,x1:s,expiry:p('expiry'),target:p('target'),up:u(1),down:u(-1),ticks:f,xt:y}},[e,v,j]);if(!F)return(0,x.jsx)(n.default,{style:{height:j,alignItems:'center',justifyContent:'center'},children:(0,x.jsx)(i.T,{style:{color:i.C.muted,fontSize:12,textAlign:'center',maxWidth:360},children:b})});const T=t=>{const r=F.x0+(t-h.l)/(v-h.l-h.r)*(F.x1-F.x0);let n=e[0];for(const t of e)Math.abs(t.s-r)<Math.abs(n.s-r)&&(n=t);X(n)},P={onStartShouldSetResponder:e=>e?.nativeEvent?.touches?.length>0||!1,onMoveShouldSetResponder:()=>!1,onResponderGrant:e=>{w.current=!0,T(e.nativeEvent.locationX)},onResponderMove:e=>T(e.nativeEvent.locationX),onResponderTerminationRequest:()=>!0};return(0,x.jsxs)(n.default,{onLayout:e=>L(Math.max(280,e.nativeEvent.layout.width)),style:{opacity:C?.45:1},...P,onMouseMove:e=>{if(w.current)return;const t=e.currentTarget.getBoundingClientRect?.();t&&T(e.clientX-t.left)},onMouseLeave:()=>{w.current||X(null)},accessibilityLabel:`Payoff chart. Solid line: ${k}. Dashed line: ${g}. The payoff table below lists the same values.`,children:[(0,x.jsxs)(o.default,{width:v,height:j,children:[y.slice().reverse().map(e=>(0,x.jsx)(s.Rect,{x:F.X(Math.max(F.x0,e.low)),y:h.t,width:Math.max(0,F.X(Math.min(F.x1,e.high))-F.X(Math.max(F.x0,e.low))),height:j-h.t-h.b,fill:1===e.k?i.C.green+'0F':i.C.green+'08'},e.k)),F.ticks.map((e,t)=>(0,x.jsxs)(r.default.Fragment,{children:[(0,x.jsx)(s.Line,{x1:h.l,x2:v-h.r,y1:F.Y(e),y2:F.Y(e),stroke:i.C.line,strokeWidth:1}),(0,x.jsx)(s.Text,{x:h.l-6,y:F.Y(e)+3,fill:i.C.muted,fontSize:11,textAnchor:"end",children:Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}k`:e.toFixed(0)})]},t)),F.xt.map((e,t)=>(0,x.jsx)(s.Text,{x:F.X(e),y:j-8,fill:i.C.muted,fontSize:11,textAnchor:"middle",children:Math.round(e).toLocaleString('en-IN')},t)),S?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(s.Defs,{children:[(0,x.jsxs)(s.LinearGradient,{id:"pcUp",x1:"0",y1:h.t,x2:"0",y2:F.Y(0),gradientUnits:"userSpaceOnUse",children:[(0,x.jsx)(s.Stop,{offset:"0",stopColor:i.C.heatUp3,stopOpacity:.5}),(0,x.jsx)(s.Stop,{offset:"0.6",stopColor:i.C.heatUp1,stopOpacity:.22}),(0,x.jsx)(s.Stop,{offset:"1",stopColor:i.C.heatUp0,stopOpacity:.04})]}),(0,x.jsxs)(s.LinearGradient,{id:"pcDn",x1:"0",y1:F.Y(0),x2:"0",y2:j-h.b,gradientUnits:"userSpaceOnUse",children:[(0,x.jsx)(s.Stop,{offset:"0",stopColor:i.C.heatDn0,stopOpacity:.04}),(0,x.jsx)(s.Stop,{offset:"0.45",stopColor:i.C.heatDn1,stopOpacity:.28}),(0,x.jsx)(s.Stop,{offset:"1",stopColor:i.C.heatDn2,stopOpacity:.55})]})]}),(0,x.jsx)(s.Path,{d:F.up,fill:"url(#pcUp)"}),(0,x.jsx)(s.Path,{d:F.down,fill:"url(#pcDn)"})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s.Path,{d:F.up,fill:i.C.green+'22'}),(0,x.jsx)(s.Path,{d:F.down,fill:i.C.red+'22'})]}),(0,x.jsx)(s.Line,{x1:h.l,x2:v-h.r,y1:F.Y(0),y2:F.Y(0),stroke:i.C.muted,strokeWidth:1}),f.filter(e=>e>=F.x0&&e<=F.x1).map(e=>(0,x.jsx)(s.Line,{x1:F.X(e),x2:F.X(e),y1:h.t,y2:j-h.b,stroke:i.C.amber,strokeWidth:1,strokeDasharray:"2,3"},e)),(0,x.jsx)(s.Line,{x1:F.X(p),x2:F.X(p),y1:h.t,y2:j-h.b,stroke:i.C.ink,strokeWidth:1}),(0,x.jsx)(s.Text,{x:F.X(p)+4,y:h.t+10,fill:i.C.ink,fontSize:11,children:`Spot ${(0,l.num)(p,2)}`}),null!=u&&Math.abs(u-p)>1e-6&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s.Line,{x1:F.X(u),x2:F.X(u),y1:h.t,y2:j-h.b,stroke:i.C.mint,strokeWidth:1.5,strokeDasharray:"4,3"}),(0,x.jsx)(s.Text,{x:F.X(u)+4,y:h.t+24,fill:i.C.mint,fontSize:11,children:`Scenario ${(0,l.num)(u,0)}`})]}),S?(0,x.jsxs)(x.Fragment,{children:[!!F.expiry&&(0,x.jsx)(s.Path,{d:F.expiry,stroke:i.C.heatUp2,strokeWidth:2,fill:"none",strokeLinejoin:"round"}),!!F.target&&(0,x.jsxs)(s.G,{children:[(0,x.jsx)(s.Path,{d:F.target,stroke:i.C.blue,strokeOpacity:.2,strokeWidth:8,fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),(0,x.jsx)(s.Path,{d:F.target,stroke:i.C.blue,strokeOpacity:.45,strokeWidth:4,fill:"none",strokeLinejoin:"round"}),(0,x.jsx)(s.Path,{d:F.target,stroke:i.C.blue,strokeWidth:2,fill:"none",strokeLinejoin:"round"})]})]}):(0,x.jsxs)(x.Fragment,{children:[!!F.target&&(0,x.jsx)(s.Path,{d:F.target,stroke:i.C.mint,strokeWidth:1.8,fill:"none",strokeDasharray:"6,4"}),!!F.expiry&&(0,x.jsx)(s.Path,{d:F.expiry,stroke:i.C.green,strokeWidth:2,fill:"none"})]}),W&&(0,x.jsx)(s.Line,{x1:F.X(W.s),x2:F.X(W.s),y1:h.t,y2:j-h.b,stroke:i.C.muted,strokeWidth:1}),S&&W&&(()=>{const e=F.X(W.s),t=168,r=e+12+t>v-h.r?e-12-t:e+12,n=h.t+6,o=(e,n,o,h)=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s.Circle,{cx:r+12,cy:e-4,r:3.5,fill:n}),(0,x.jsx)(s.Text,{x:r+22,y:e,fill:i.C.muted,fontSize:11,children:o}),(0,x.jsx)(s.Text,{x:r+t-10,y:e,fill:null==h?i.C.muted:h>=0?i.C.heatUp2:i.C.heatDn2,fontSize:12,fontWeight:"600",textAnchor:"end",children:(0,l.signed)(h)})]});return(0,x.jsxs)(s.G,{children:[null!=W.expiry&&(0,x.jsx)(s.Circle,{cx:e,cy:F.Y(W.expiry),r
1087:4,fill:i.C.heatUp2,stroke:i.C.paper,strokeWidth:1.5}),null!=W.target&&(0,x.jsx)(s.Circle,{cx:e,cy:F.Y(W.target),r:4,fill:i.C.blue,stroke:i.C.paper,strokeWidth:1.5}),(0,x.jsx)(s.Rect,{x:r,y:n,width:t,height:58,rx:8,fill:i.C.paper,stroke:i.C.lineHover,strokeWidth:1}),(0,x.jsx)(s.Text,{x:r+10,y:n+16,fill:i.C.ink,fontSize:11,fontWeight:"600",children:`${(0,l.num)(W.s,0)} ${p?`(${W.s>=p?'+':''}${(100*(W.s/p-1)).toFixed(2)}%)`:''}`}),o(n+33,i.C.heatUp2,k,W.expiry),o(n+50,i.C.blue,g.replace(/^P&L /,'').replace(/^today$/,'Today'),W.target)]})})()]}),(0,x.jsxs)(n.default,{style:[i.s.row,{gap:16,flexWrap:'wrap',minHeight:20}],children:[(0,x.jsx)(c,{color:S?i.C.heatUp2:i.C.green,label:k,solid:!0}),(0,x.jsx)(c,{color:S?i.C.blue:i.C.mint,label:g,solid:S}),(0,x.jsx)(c,{color:i.C.amber,label:"Breakeven"}),S?null:!W&&(0,x.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:'Hover (or tap on a touch screen) for exact values'}),!S&&W&&(0,x.jsx)(i.T,{style:{fontSize:11,color:i.C.ink,fontVariant:['tabular-nums']},children:`${(0,l.num)(W.s,0)} (${p?`${W.s>=p?'+':''}${(100*(W.s/p-1)).toFixed(2)}% from spot`:''}) \xb7 ${k.toLowerCase()} ${(0,l.signed)(W.expiry)} \xb7 scenario ${(0,l.signed)(W.target)}`})]})]})};var t=_r(d[0]),r=e(t);_r(d[1]);var n=e(_r(d[2])),s=_r(d[3]),o=e(s),i=_r(d[4]),l=_r(d[5]),x=_r(d[6]);const h={l:62,r:14,t:14,b:28};function c({color:e,label:t,solid:r}){return(0,x.jsxs)(n.default,{style:[i.s.row,{gap:6}],children:[(0,x.jsx)(n.default,{style:{width:16,height:0,borderTopWidth:2,borderColor:e,borderStyle:r?'solid':'dashed'}}),(0,x.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:t})]})}},994,[11,136,13,840,821,979,6]); 1088__d(function(g,_r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SETTLED_LABEL",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"SETTLED_MIXED_LABEL",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SETTLED_TAG",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"PAPER_ENTRY_BLOCKED_TEXT",{enumerable:!0,get:function(){return r}}),e.isSettled=u,e.settledLabel=c,e.legIsSettled=p,e.scenarioSettledLabel=function(t){const l=t?.scenario_pnl;return u(t)&&l&&'available'===l.status?'closing_spot'===l.settled_basis?o(l.settled_label)||c(t):'mixed'===l.settled_basis?o(l.settled_label)||n:null:null},e.paperEntryBlock=function(t){const l=t?.paper_entry;return l&&!1===l.allowed?{code:o(l.code)||'PAPER_ENTRY_BLOCKED',message:o(l.message)||r}:null},e.legLabelText=function(t,l){return p(t,l)?`${l.label} \xb7 settled`:l.label},e.legSettledText=function(l,n){return n&&p(l,n)?`Settled at ${(0,t.num)(n.settled_value)} (intrinsic at the closing spot) \xb7 P&L ${(0,t.signed)(n.settled_pnl)} gross`:null},e.settledSummary=function(l){if(!u(l))return null;const n=l.legs||[],s=n.filter(t=>!0===t.settled),r=l.settled||{},p=!0===r.all||s.length>0&&s.length===n.length,f=s.length>0&&s.every(t=>a(t.settled_pnl))?s.reduce((t,l)=>t+l.settled_pnl,0):null,_=p?'Every leg settled':s.length?`${s.length} of ${n.length} legs settled`:'Settled at expiry',b=a(r.spot)?` \xb7 closing spot ${(0,t.num)(r.spot,2)}`:'',E=o(r.at)?` on ${(0,t.istStamp)(r.at)}`:'';return{title:p?'Settled P&L':'Settled legs P&L',value:null==f?'\u2014':(0,t.signed)(f),detail:`${_}${b}${E} \xb7 gross, before charges`,label:c(l),tone:null==f||0===f?'none':f>0?'pos':'neg'}},e.paperLegSettledText=function(l,n){const s=(l?.legs||[]).find(t=>t.id===n);return s&&p(l,s)?`Expired and settled at ${(0,t.num)(s.settled_value)} (intrinsic at the closing spot)`:null};var t=_r(d[0]);const l='At expiry, using the 15:30 closing spot \u2014 the official settlement price may differ.',n='Settled legs use the 15:30 closing spot (the official settlement price may differ); later legs are model estimates, not traded prices.',s='Settled',r='A leg here has already expired and settled, so this position cannot be paper traded as it stands.',o=t=>'string'==typeof t&&t.trim()?t:null,a=t=>'number'==typeof t&&Number.isFinite(t);function u(t){return'closing_spot'===t?.settled_basis}function c(t){return u(t)?o(t.settled?.label)||l:null}function p(t,l){return u(t)&&!0===l?.settled}},995,[979]); 1089__d(function(g,r,i,_a,m,_e,d){"use strict";
1089Object.defineProperty(_e,'__esModule',{value:!0}),_e.SettledNote=a,_e.SettledTag=u,_e.SettledSummaryBlock=function({a:e}){const t=(0,o.settledSummary)(e);return t?(0,s.jsxs)(l.default,{style:{gap:4,borderTopWidth:1,borderColor:n.C.line,paddingTop:8},accessibilityLabel:`${t.title}: ${t.value}. ${t.detail}. ${t.label}`,children:[(0,s.jsxs)(l.default,{style:[n.s.row,{gap:8,flexWrap:'wrap',alignItems:'center'}],children:[(0,s.jsx)(u,{}),(0,s.jsx)(n.T,{style:{fontSize:12,color:n.C.muted},children:t.title}),(0,s.jsx)(n.T,{style:{fontFamily:'InterSemi',fontSize:14,color:'pos'===t.tone?n.C.green:'neg'===t.tone?n.C.red:n.C.ink,fontVariant:['tabular-nums']},children:t.value})]}),(0,s.jsx)(n.T,{style:{fontSize:11,color:n.C.muted},children:t.detail}),(0,s.jsx)(a,{text:t.label})]}):null},r(d[0]);var e,t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},n=r(d[2]),o=r(d[3]),s=r(d[4]);function a({text:e}){return e?(0,s.jsxs)(l.default,{style:[n.s.row,{gap:6,alignItems:'flex-start'}],accessibilityLabel:e,children:[(0,s.jsx)(l.default,{style:{paddingTop:2},children:(0,s.jsx)(n.Icon,{name:"info",size:12,color:n.C.muted})}),(0,s.jsx)(n.T,{style:{fontSize:11,color:n.C.muted,flex:1},children:e})]}):null}function u(){return(0,s.jsx)(n.Badge,{label:o.SETTLED_TAG.toUpperCase(),tone:"neutral"})}},996,[11,13,821,995,6]); 1090__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.StrategyGallery=function(){const{height:e}=(0,i.default)(),d=(0,p.useSharedRead)('/api/derivatives/filters',0),{u:c,exp:h,setU:w,setExp:F}=(0,y.useInstrument)(),N=(0,x.readStore)(S,'pick'),[U,A]=(0,t.useState)(!1),B=(0,p.useSharedRead)(c?`/api/sb/gallery?underlying=${encodeURIComponent(c)}${h?`&expiry=${h}`:''}${U?'&include_naked=1':''}`:null,0),E=('object'==typeof B.data?.expiry?B.data?.expiry?.expiry:B.data?.expiry)||h||'',D={data:B.data?{spot:B.data.spot,as_of:B.data.as_of,atm_iv:null}:null,error:B.error},[V,Q]=(0,t.useState)(!1),G=(0,p.useSharedRead)(V&&c?`/api/sb/gallery?underlying=${encodeURIComponent(c)}${h?`&expiry=${h}`:''}&group=time`:null,0),K=(B.data?.groups||[]).map(e=>'not_loaded'===e.status&&'time'===e.group&&G.data?.groups?.[0]?{...G.data.groups[0],group:'time'}:e).map(e=>({key:e.group,label:e.label,icon:b[e.group]||'\u2022',families:(e.families||[]).map(e=>({...e,shape:T(e),shares:(e.variants||[]).some(e=>(e.legs||[]).some(e=>'EQ'===e.type)),axis:e.axis?.label||'Width'}))})),[Z,J]=(0,t.useState)(N.style||'range'),q=K.find(e=>e.key===Z)||K[0]||{key:'',label:'',icon:'',families:[]},[X,Y]=(0,t.useState)(N.fam||'iron_condor'),ee=q.families.find(e=>e.key===X)||q.families[0]||{key:'',name:'',axis:'',variants:[]};(0,t.useEffect)(()=>{q.key&&(0,x.writeStore)(S,'pick',{u:c,style:q.key,fam:ee.key})},[c,q.key,ee.key]);const te=(0,t.useMemo)(()=>B.data?(ee.variants||[]).map(v):null,[B.data,ee.key]),ne=B.error||'',[re,le]=(0,t.useState)('axis'),[oe,ie]=(0,t.useState)('off'),[se,ae]=(0,t.useState)(''),[de,ue]=(0,t.useState)(''),[ce,he]=(0,t.useState)(''),[pe,fe]=(0,t.useState)(''),ge=(e,t)=>{const n=e.curve;if(n.length<2)return null;if(t<=n[0].s)return n[0].y;if(t>=n[n.length-1].s)return n[n.length-1].y;for(let e=1;e<n.length;e++)if(n[e].s>=t){const r=n[e-1],l=n[e];return r.y+(l.y-r.y)*(t-r.s)/(l.s-r.s||1)}return null},me=e=>{if('target'===oe){const t=Number(se);return t>0?ge(e,t):null}if('range'===oe){const t=Number(de),n=Number(ce);if(!(t>0&&n>t))return null;const r=[ge(e,t),ge(e,n),...e.curve.filter(e=>e.s>t&&e.s<n).map(e=>e.y)].filter(e=>null!=e);return r.length?Math.min(...r):null}return null},xe='off'!==oe&&('target'===oe&&Number(se)>0||'range'===oe&&Number(de)>0&&Number(ce)>Number(de)),ye=Number(pe)>0?Number(pe):null,Ce=(0,t.useMemo)(()=>{const e=(te||[]).map((e,t)=>t),t=e=>{const t=te[e];return'pop'===re?-(t.pop??-1):'rr'===re?-(M(t)??-1):'capital'===re?t.ml??1e15:0};let n='axis'===re?e:e.sort((e,n)=>t(e)-t(n));return null!=ye&&(n=n.filter(e=>{const t=te[e];return!t.mlUnl&&null!=t.ml&&t.ml<=ye})),xe&&(n=[...n].sort((e,t)=>(me(te[t])??-1e15)-(me(te[e])??-1e15))),n},[te,re,oe,se,de,ce,pe]),[be,je]=(0,t.useState)(0);(0,t.useEffect)(()=>{je(te?Math.min(Math.floor(te.length/2),te.length-1):0)},[te]);const Se=te?.[be],[ke,$e]=(0,t.useState)({});(0,t.useEffect)(()=>{$e({})},[c,E]);const we=e=>`${ee.key}|${e}`,ve=e=>{const t=te?.[e];
1090if(!t)return;const n=we(e);$e(e=>{const r={...e};return r[n]?delete r[n]:r[n]={label:`${ee.name} ${L(t)}`,legs:t.legs},r})},Te=Object.entries(ke),Me=(0,t.useMemo)(()=>{if(!Te.length)return null;const e=new Map;for(const[,t]of Te)for(const n of t.legs){const t=`${n.type}|${n.strike}|${n.expiry}`,r=('B'===n.side?1:-1)*(n.lots||1),l=e.get(t);e.set(t,{...n,net:(l?.net||0)+r})}return[...e.values()].filter(e=>0!==e.net).map((e,t)=>({id:`C${t+1}`,type:e.type,side:e.net>0?'B':'S',strike:e.strike,lots:Math.abs(e.net),expiry:e.expiry,price_basis:'exec',price:null,include:!0}))},[ke]),[ze,Le]=(0,t.useState)(null);(0,t.useEffect)(()=>{Le(null)},[be,ee.key,c,E,ke]);const Ie=H(c,ze?{...Se||{},legs:ze}:Me?{...Se||{},legs:Me}:Se,String(B.data?.as_of||'')),Fe=Math.max(560,e-172),[He,Ne]=(0,t.useState)(0),[Re,Pe]=(0,t.useState)({w:0,h:0}),We=({t:e,sub:t,right:n})=>(0,C.jsxs)(o.default,{style:[u.s.row,{height:44,paddingHorizontal:14,borderBottomWidth:1,borderColor:u.C.line,gap:10}],children:[(0,C.jsx)(u.T,{style:{fontFamily:'InterSemi',fontSize:11,letterSpacing:1,textTransform:'uppercase',color:u.C.heading},children:e}),!!t&&(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:t}),(0,C.jsx)(o.default,{style:{flex:1}}),n]}),Oe={flex:1,height:Fe,borderWidth:1,borderColor:u.C.line,borderRadius:12,backgroundColor:u.C.paper,overflow:'hidden'};return(0,C.jsx)(o.default,{style:{paddingHorizontal:12,paddingTop:8,gap:8,width:'100%'},children:(0,C.jsx)(o.default,{style:[u.s.row,{gap:8,alignItems:'flex-start'}],children:(0,C.jsx)(o.default,{style:{flex:1},children:(()=>{const e=(e,t)=>(0,C.jsx)(g.SplitPanes,{id:"gallery",height:Fe,initial:.56,left:(0,C.jsxs)(o.default,{style:[Oe,{flexDirection:'row'}],children:[(0,C.jsxs)(o.default,{style:{width:256,borderRightWidth:1,borderColor:u.C.line,zIndex:20},children:[(0,C.jsxs)(o.default,{style:{padding:10,gap:6,borderBottomWidth:1,borderColor:u.C.line,zIndex:30},children:[(0,C.jsx)(f.SymbolSearch,{value:c,data:d.data,onPick:e=>{w(e),F('')}}),(0,C.jsx)(f.ExpiryPicker,{underlying:c,value:E,data:d.data,onPick:F})]}),(0,C.jsx)(o.default,{accessibilityRole:"tablist",style:[u.s.row,{gap:4,padding:8,borderBottomWidth:1,borderColor:u.C.line,flexWrap:'wrap'}],children:K.map(e=>{const t=e.key===q.key;return(0,C.jsxs)(n.default,{role:"tab","aria-selected":t,accessibilityState:{selected:t},accessibilityLabel:e.label,onPress:()=>{J(e.key),'time'===e.key&&Q(!0),Y(e.families[0]?.key),le('axis')},title:e.label,style:e=>[{flex:1,minWidth:0,height:58,borderRadius:10,alignItems:'center',justifyContent:'center',gap:3,opacity:e.pressed?.75:1,transform:[{scale:e.hovered&&!t?1.04:1}]}],children:[(0,C.jsx)(R,{k:e.key,on:t}),(0,C.jsx)(u.T,{style:{fontSize:11,color:t?u.C.green:u.C.muted,fontFamily:t?'InterSemi':'Inter'},numberOfLines:1,children:j[e.key]||e.label})]},e.key)})}),(0,C.jsx)(u.T,{style:{fontSize:11,letterSpacing:1,textTransform:'uppercase',fontFamily:'InterSemi',color:u.C.heading,paddingHorizontal:12,paddingTop:10,paddingBottom:4},children:q.label}),q.families.map(e=>{const t=e.key===ee.key;return(0,C.jsxs)(n.default,{onPress:()=>{Y(e.key),le('axis')},accessibilityRole:"button",accessibilityState:{selected:t},style:e=>[u.s.row,{gap:10,minHeight:40,paddingVertical:5,paddingHorizontal:12,borderLeftWidth:3,borderLeftColor:t?u.C.green:'transparent',backgroundColor:t?u.C.soft:e.hovered?u.C.hoverBg:'transparent'}],children:[(0,C.jsx)(a.default,{width:32,height:14,children:(0,C.jsx)(s.Path,{d:e.shape,fill:"none",stroke:t?u.C.green:u.C.muted,strokeWidth:1.6})}),(0,C.jsxs)(o.default,{style:{flexShrink:1},children:[(0,C.jsx)(u.T,{style:{fontSize:13,color:'unavailable'===e.status?u.C.muted:u.C.ink,fontFamily:t?'InterSemi':'Inter'},numberOfLines:1,children:e.name}),'unavailable'===e.status&&!!e.status_text&&(0,C.jsx)(u.T,{style:{fontSize:11,lineHeight:14,color:u.C.amber},numberOfLines:1,title:e.status_text,children:"Hidden \xb7 prices not reliable now"})]})]},e.key)}),'time'===q.key&&!q.families.length&&(0,C.jsx)(u.T,{style:{fontSize:12,color:u.C.muted,padding:12},children:G.error?`Calendars are not available right now (${G.error}).`:'Reading calendars and diagonals\u2026'}),(0,C.jsx)(o.default,{style:{flex:1}}),(0,C.jsxs)(n.default,{role:"switch","aria-checked":U,onPress:()=>A(e=>!e),title:'Adds strategies whose loss has no cap (short straddle, short strangle, naked short options, ratio spreads, risk reversals)',style:[u.s.row,{gap:8,padding:12,borderTopWidth:1,borderColor:u.C.line}],children:[(0,C.jsx)(o.default,{style:{width:30,height:16,borderRadius:8,backgroundColor:U?u.C.heatDn1:u.C.line,justifyContent:'center',paddingHorizontal:2},children:(0,C.jsx)(o.default,{style:{width:12,height:12,borderRadius:6,backgroundColor:u.C.ink,alignSelf:U?'flex-end':'flex-start'}})}),(0,C.jsx)(u.T,{style:{fontSize:12,color:U?u.C.heatDn2:u.C.muted},children:"Show unlimited risk"})]}),(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.muted,paddingHorizontal:12,paddingBottom:12},children:"1 lot each."})]}),(0,C.jsxs)(o.default,{style:{flex:1},onLayout:e=>Ne(Math.round(e.nativeEvent.layout.width)),children:[e,(0,C.jsx)(We,{t:ee.name,sub:te?`${te.length} \xb7 ${ee.axis.toLowerCase()} \xb7 1 lot`:'',right:Te.length?(0,C.jsxs)(o.default,{style:[u.s.row,{gap:8}],children:[(0,C.jsx)(u.T,{style:{fontSize:12,color:u.C.blue,fontFamily:'InterSemi'},children:`Combining ${Te.length}`}),(0,C.jsx)(n.default,{onPress:()=>$e({}),accessibilityRole:"button",style:{height:24,paddingHorizontal:8,borderRadius:6,borderWidth:1,borderColor:u.C.line,justifyContent:'center'},children:(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:"Clear"})})]}):(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:"Tick rows to combine"})}),(0,C.jsxs)(o.default,{style:[u.s.row,{gap:6,paddingHorizontal:14,paddingVertical:6,borderBottomWidth:1,borderColor:u.C.line,flexWrap:'wrap'}],children:[(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.heading,fontFamily:'InterSemi'},children:"My view"}),['off','target','range'].map(e=>{const t=oe===e;return(0,C.jsx)(n.default,{onPress:()=>ie(e),style:{height:26,paddingHorizontal:9,borderRadius:6,justifyContent:'center',borderWidth:1,borderColor:t?u.C.green:u.C.line,backgroundColor:t?u.C.soft:'transparent'},children:(0,C.jsx)(u.T,{style:{fontSize:11,color:t?u.C.green:u.C.muted},children:'off'===e?'None':'target'===e?'Price at expiry':'Range'})},e)}),'target'===oe&&(0,C.jsx)(l.default,{value:se,onChangeText:ae,placeholder:`e.g. ${Math.round(1.01*(D.data?.spot||0))}`,placeholderTextColor:u.C.muted,keyboardType:"decimal-pad",style:k}),'range'===oe&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(l.default,{value:de,onChangeText:ue,placeholder:"low",placeholderTextColor:u.C.muted,keyboardType:"decimal-pad",style:k}),(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:"to"}),(0,C.jsx)(l.default,{value:ce,onChangeText:he,placeholder:"high",placeholderTextColor:u.C.muted,keyboardType:"decimal-pad",style:k})]}),(0,C.jsx)(o.default,{style:{flex:1}}),(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:"Max loss \u20b9"}
1090),(0,C.jsx)(l.default,{value:pe,onChangeText:fe,placeholder:"any",placeholderTextColor:u.C.muted,keyboardType:"number-pad",style:k})]}),xe&&(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.muted,paddingHorizontal:14,paddingTop:4},children:'target'===oe?`Ordered by P&L at expiry if ${c} ends at ${Number(se).toLocaleString('en-IN')}, after costs.`:`Ordered by the worst P&L at expiry anywhere between ${Number(de).toLocaleString('en-IN')} and ${Number(ce).toLocaleString('en-IN')}, after costs.`}),!!Me&&Te.reduce((e,[,t])=>e+t.legs.length,0)>Me.length&&(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.amber,paddingHorizontal:14,paddingTop:6},children:Te.reduce((e,[,t])=>e+t.legs.length,0)-Me.length+" legs merged or cancelled (same contract); charges and margin are on the net position."}),te?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(o.default,{style:[u.s.row,{height:32,paddingHorizontal:14,borderBottomWidth:1,borderColor:u.C.line}],children:[!ee.shares&&(0,C.jsx)(o.default,{style:{width:26}}),(ee.shares?['Put strike','Capital','collar'===ee.key?'Net option cost':'Put cost','Max loss','Breakeven']:['Strikes','Max profit','Max loss',xe?'At your view':'Reward : risk','Chance of profit']).map((e,t)=>(0,C.jsx)(u.T,{style:{flex:t?1:2.3,fontSize:11,color:u.C.heading,fontFamily:'InterSemi',textAlign:t?'right':'left'},children:e},e))]}),(0,C.jsxs)(r.default,{style:{flex:1},children:[Ce.map(e=>{const t=te[e],r=e===be,l=M(t);return(0,C.jsxs)(n.default,{onPress:()=>je(e),accessibilityRole:"button",accessibilityState:{selected:r},style:e=>[u.s.row,{height:40,paddingHorizontal:14,borderBottomWidth:1,borderColor:u.C.lineSoft,backgroundColor:r?u.C.soft:e.hovered?u.C.hoverBg:'transparent',borderLeftWidth:3,borderLeftColor:r?u.C.green:'transparent'}],children:[!ee.shares&&(0,C.jsx)(n.default,{role:"checkbox","aria-checked":!!ke[we(e)],accessibilityLabel:"Add to the combined position",onPress:()=>ve(e),hitSlop:8,title:'Tick to combine this with other strategies into one position',style:{width:26},children:(0,C.jsx)(o.default,{style:{width:16,height:16,borderRadius:4,borderWidth:1.5,borderColor:ke[we(e)]?u.C.blue:u.C.muted,backgroundColor:ke[we(e)]?u.C.blue:'transparent',alignItems:'center',justifyContent:'center'},children:!!ke[we(e)]&&(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.paper,fontFamily:'InterSemi'},children:"\u2713"})})}),(0,C.jsx)(u.T,{numberOfLines:1,style:{flex:2.3,fontSize:13,color:u.C.ink,fontFamily:r?'InterSemi':'Inter'},children:t.err?'\u2014':L(t)}),ee.shares?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(u.T,{style:{flex:1,fontSize:13,textAlign:'right',color:u.C.ink,fontVariant:['tabular-nums']},children:$(t.cap)}),(0,C.jsx)(u.T,{style:{flex:1,fontSize:13,textAlign:'right',color:u.C.ink,fontVariant:['tabular-nums']},children:$(t.cost)}),(0,C.jsx)(u.T,{style:{flex:1,fontSize:13,textAlign:'right',color:u.C.heatDn2,fontVariant:['tabular-nums']},children:null!=t.ml?$(-t.ml):'\u2014'}),(0,C.jsx)(u.T,{style:{flex:1,fontSize:13,textAlign:'right',color:u.C.ink,fontVariant:['tabular-nums']},children:t.be.length?Math.round(t.be[0]).toLocaleString('en-IN'):'\u2014'})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(u.T,{style:{flex:1,fontSize:13,textAlign:'right',color:u.C.heatUp2,fontVariant:['tabular-nums']},children:t.mpUnl?'open-ended':null!=t.mp?'+'+$(t.mp):'\u2014'}),(0,C.jsx)(u.T,{style:{flex:1,fontSize:13,textAlign:'right',color:u.C.heatDn2,fontVariant:['tabular-nums']},children:t.mlUnl?'unlimited':null!=t.ml?$(-t.ml):'\u2014'}),xe?(()=>{const e=me(t);return(0,C.jsx)(u.T,{style:{flex:1,fontSize:13,textAlign:'right',fontFamily:'InterSemi',color:null==e?u.C.muted:e>=0?u.C.heatUp2:u.C.heatDn2,fontVariant:['tabular-nums']},children:null==e?'\u2014':(e>=0?'+':'')+$(e)})})():(0,C.jsx)(u.T,{title:null==l?'Not defined when the profit or the loss has no cap, or the profit is not above zero':'',style:{flex:1,fontSize:13,textAlign:'right',color:null!=l?u.C.ink:u.C.muted,fontVariant:['tabular-nums']},children:null!=l?`${l.toFixed(2)}\xd7`:'n/a'}),(0,C.jsxs)(o.default,{style:[u.s.row,{flex:1,justifyContent:'flex-end',gap:8}],children:[null!=t.pop&&(0,C.jsx)(o.default,{style:{width:46,height:5,borderRadius:3,backgroundColor:u.C.line,overflow:'hidden'},children:(0,C.jsx)(o.default,{style:{width:`${Math.round(100*t.pop)}%`,height:'100%',backgroundColor:u.C.green}})}),(0,C.jsx)(u.T,{style:{fontSize:13,color:u.C.ink,fontVariant:['tabular-nums']},children:null!=t.pop?`${Math.round(100*t.pop)}%`:'\u2014'})]})]})]},e)}),(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.muted,paddingHorizontal:14,paddingVertical:10},children:z(te,ee)}),!!ee.hidden_variants?.text&&(0,C.jsx)(u.T,{title:Object.entries(ee.hidden_variants.reasons||{}).map(([e,t])=>`${e}: ${t}`).join(' \xb7 '),style:{fontSize:11,color:u.C.amber,paddingHorizontal:14,paddingBottom:10},children:ee.hidden_variants.text}),'unavailable'===ee.status&&!!ee.status_text&&(0,C.jsx)(u.T,{style:{fontSize:12,color:u.C.muted,paddingHorizontal:14,paddingBottom:10},children:ee.status_text})]}),(0,C.jsxs)(u.T,{style:{fontSize:11,color:u.C.muted,padding:10,paddingHorizontal:14,borderTopWidth:1,borderColor:u.C.line},children:[ee.shares?'Shares: P&L over the stock\'s price at the put\'s expiry, after costs; chance of profit is not defined with shares. ':'Chance of profit at expiry: model estimate (implied volatility at the money, after costs). Not tested on history. ',D.data?.as_of?`As of ${String(D.data.as_of).slice(5,16).replace('T',' ')}.`:'']})]}):(0,C.jsx)(o.default,{style:{flex:1,alignItems:'center',justifyContent:'center'},children:(0,C.jsx)(u.T,{style:{fontSize:12,color:u.C.muted},children:ne||D.error||'Reading the gallery\u2026'})})]})]}),right:t});return Me&&Me.length||Se&&!Se.err&&!ee.shares?(0,C.jsx)(m.Builder,{height:Fe-2,extra:(0,C.jsx)(P,{compact:!0,m:Ie}),id:"",embedded:!0,draft:Me?{name:`${c} combined: ${Te.map(([,e])=>e.label).join(' + ')}`.slice(0,80),body:{underlying:c,expiry:E,legs:Me,scenario:{}}}:{name:`${c} ${ee.name} ${L(Se)}`,body:{underlying:c,expiry:E,legs:Se.legs.map(e=>({...e,price_basis:e.price_basis||'exec',price:null,include:!0})),scenario:{}}},layout:t=>e(t.legs,(0,C.jsx)(o.default,{style:Oe,children:t.right})),onLegs:e=>Le(e)},Me?`combo|${c}|${E}|${Object.keys(ke).sort().join(',')}`:`${c}|${E}|${ee.key}|${be}|${B.data?.as_of||''}`):e(null,(0,C.jsxs)(o.default,{style:Oe,onLayout:e=>Pe({w:Math.round(e.nativeEvent.layout.width),h:Math.round(e.nativeEvent.layout.height)}),children:[(0,C.jsx)(We,{t:Se?`${ee.name} \xb7 ${L(Se)}`:ee.name,right:(0,C.jsx)(o.default,{style:{backgroundColor:u.C.amberBg,borderRadius:6,paddingHorizontal:7,paddingVertical:2},children:(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.amber,fontFamily:'InterSemi'},children:"Model only"})})}),Se&&!Se.err?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(u.T,{style:{fontSize:11,color:u.C.muted,paddingHorizontal:16,paddingTop:8},children:[I(Se,c)," \xb7 ",E]}),Re.w>
10900&&(0,C.jsx)(_,{r:Se,spot:D.data?.spot||0,width:Re.w-2,height:Math.max(200,Math.min(300,.45*Re.h))}),(0,C.jsx)(o.default,{style:[u.s.row,{paddingHorizontal:16,gap:14,flexWrap:'wrap'}],children:(ee.shares?[['Capital',$(Se.cap),u.C.ink],['collar'===ee.key?'Net option cost':'Put cost',$(Se.cost),u.C.ink],['Max loss',null!=Se.ml?$(-Se.ml):'\u2014',u.C.heatDn2],['Breakeven',Se.be.length?Math.round(Se.be[0]).toLocaleString('en-IN'):'\u2014',u.C.ink]]:[['Max profit',Se.mpUnl?'open-ended':'+'+$(Se.mp),u.C.heatUp2],['Max loss',Se.mlUnl?'unlimited':$(null!=Se.ml?-Se.ml:null),u.C.heatDn2],['Reward : risk',null!=M(Se)?`${M(Se).toFixed(2)}\xd7`:'n/a',u.C.ink],['Chance of profit',null!=Se.pop?`${Math.round(100*Se.pop)}%`:'\u2014',u.C.ink]]).map(([e,t,n])=>(0,C.jsxs)(o.default,{style:{minWidth:96},children:[(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:e}),(0,C.jsx)(u.T,{style:{fontSize:18,fontFamily:'InterSemi',color:n,fontVariant:['tabular-nums']},children:t})]},e))}),(0,C.jsx)(o.default,{style:{paddingHorizontal:16,paddingTop:8},children:(0,C.jsx)(P,{m:Ie})}),(0,C.jsx)(u.T,{style:{fontSize:14,lineHeight:22,color:u.C.ink,paddingHorizontal:16,paddingTop:10},children:Se.sentence||W(Se,ee,c,E)}),(0,C.jsx)(o.default,{style:{flex:1}}),(0,C.jsx)(o.default,{style:[u.s.row,{padding:16,gap:10}],children:(0,C.jsx)(n.default,{accessibilityRole:"button",onPress:()=>O(Se,ee,c,E),style:e=>[{height:36,paddingHorizontal:14,borderRadius:10,borderWidth:1,borderColor:u.C.green,backgroundColor:e.hovered?u.C.soft:'transparent',justifyContent:'center'}],children:(0,C.jsx)(u.T,{style:{fontSize:13,color:u.C.green,fontFamily:'InterSemi'},children:ee.shares?'Open in Multi-stock desk \u2192':'Open in builder \u2192'})})})]}):(0,C.jsx)(o.default,{style:{flex:1,alignItems:'center',justifyContent:'center',padding:16},children:(0,C.jsx)(u.T,{style:{fontSize:12,color:u.C.muted,textAlign:'center'},children:Se?.err||'Pick one on the left.'})})]}))})()})})})};var t=_r(_d[0]),n=e(_r(_d[1])),r=e(_r(_d[2])),l=e(_r(_d[3])),o=e(_r(_d[4])),i=e(_r(_d[5])),s=_r(_d[6]),a=e(s),d=_r(_d[7]),u=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),f=_r(_d[12]),g=_r(_d[13]),m=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),C=_r(_d[17]);const b={range:'\u25ad',rise:'\u2197',fall:'\u2198',big_move:'\u2195',protect:'\u26e8',hedge:'\u26e8',futures_options:'\u21c4',time:'\u25f7'},j={range:'Range',rise:'Rise',fall:'Fall',big_move:'Move',protect:'Hedge',hedge:'Hedge',futures_options:'F+O',time:'Time'},S='strategy-gallery',k={width:84,height:26,borderWidth:1,borderColor:u.C.line,borderRadius:6,paddingHorizontal:8,color:u.C.ink,fontFamily:'Inter',fontSize:12},$=e=>null==e?'\u2014':(e<0?'\u2212\u20b9':'\u20b9')+Math.abs(Math.round(e)).toLocaleString('en-IN'),w=e=>'number'==typeof e&&Number.isFinite(e)?e:null;function v(e){const t=e.max_profit||{},n=e.max_loss||{},r=e.payoff?.x||[],l=e.payoff?.y||[],o=(e.legs||[]).some(e=>'EQ'===e.type);return{w:e.param,legs:e.legs||[],body:null,strikes:[],mp:w(t.value),mpUnl:!!t.unlimited,ml:null!=w(n.value)?Math.abs(n.value):null,mlUnl:!!n.unlimited,pop:null!=w(e.pop?.value)?e.pop.value/100:null,be:Array.isArray(e.breakevens)?e.breakevens:[],curve:r.map((e,t)=>({s:e,y:l[t]})).filter(e=>null!=w(e.y)),cap:w(e.capital?.value),cost:null!=w(e.premium?.value)?-e.premium.value:null,popNote:o?'not defined with shares':void 0,label:e.variant_label,sentence:e.sentence,rrv:w(e.reward_risk?.value),capLabel:e.capital?.label,warn:e.warnings,ev:e.evidence,size:e.size,span:e.span,shares:o,expiry:e.expiry}}const T=e=>{const t=e.variants?.[Math.floor((e.variants?.length||1)/2)],n=t?.payoff?.x||[],r=t?.payoff?.y||[];if(n.length<2)return'M1 7 L31 7';const l=Math.min(...r),o=Math.max(...r)||1;return n.map((e,t)=>`${t?'L':'M'}${(1+(e-n[0])/(n[n.length-1]-n[0])*30).toFixed(1)} ${(12-(r[t]-l)/(o-l||1)*10).toFixed(1)}`).join(' ')},M=e=>e.rrv??null;function z(e,t){if(e.length<2)return'';const n=e[0],r=e[e.length-1],l=String(t.axis||'width').toLowerCase();if(t.shares)return null!=r.ml&&null!=n.ml&&r.ml>n.ml?"Down the list the put sits further away: it costs less, and protects only a deeper fall."
1090:'';const o=[];null!=n.pop&&null!=r.pop&&Math.abs(r.pop-n.pop)>=.02&&o.push(`chance of profit ${r.pop>n.pop?'rises':'falls'} (${Math.round(100*n.pop)}% \u2192 ${Math.round(100*r.pop)}%)`);const i=M(n),s=M(r);return null!=i&&null!=s&&Math.abs(s-i)>=.02&&o.push(`reward : risk ${s>i?'rises':'falls'} (${i.toFixed(2)}\xd7 \u2192 ${s.toFixed(2)}\xd7)`),null!=n.ml&&null!=r.ml&&Math.abs(r.ml-n.ml)>=1&&o.push(`max loss ${r.ml>n.ml?'grows':'shrinks'} (${$(n.ml)} \u2192 ${$(r.ml)})`),o.length?`As the ${l} grows, ${o.join(', ')}.`:''}const L=e=>{const t=e.legs.filter(e=>'EQ'!==e.type),n=e=>e.toLocaleString('en-IN');if(e.legs.some(e=>'EQ'===e.type))return t.map(e=>`${'PE'===e.type?'put':'call'} ${n(e.strike)}`).join(' \xb7 ');const r=[...new Set(t.map(e=>e.strike))].sort((e,t)=>e-t);return 4===r.length?`${n(r[0])}/${n(r[1])} \u2013 ${n(r[2])}/${n(r[3])}`:r.map(n).join(' \u2013 ')},I=(e,t)=>e.legs.map(e=>'EQ'===e.type?`Buy ${e.lots} ${t} shares`:`${'B'===e.side?'Buy':'Sell'} 1 ${'CE'===e.type?'call':'put'} ${e.strike.toLocaleString('en-IN')}`).join(' \xb7 ');function _({r:e,spot:t,width:n,height:r}){const l=72,i=14,d=18,c=24,h=Math.max(10,n-l-i),p=Math.max(10,r-d-c),f=e.curve;if(f.length<2)return(0,C.jsx)(o.default,{style:{height:r,alignItems:'center',justifyContent:'center'},children:(0,C.jsx)(u.T,{style:{fontSize:12,color:u.C.muted},children:"No payoff for this one."})});const g=f[0].s,m=f[f.length-1].s;let x=Math.min(0,...f.map(e=>e.y)),y=Math.max(0,...f.map(e=>e.y));y===x&&(y+=1,x-=1);const b=.1*(y-x);x-=b,y+=b;const j=e=>l+(e-g)/(m-g||1)*h,S=e=>d+p-(e-x)/(y-x)*p,k=f.map((e,t)=>`${t?'L':'M'}${j(e.s).toFixed(1)} ${S(e.y).toFixed(1)}`).join(' '),w=`${k} L${j(m).toFixed(1)} ${S(0).toFixed(1)} L${j(g).toFixed(1)} ${S(0).toFixed(1)} Z`,v=S(0);return(0,C.jsxs)(a.default,{width:n,height:r,children:[(0,C.jsxs)(s.Defs,{children:[(0,C.jsxs)(s.LinearGradient,{id:"gUp",x1:"0",y1:d,x2:"0",y2:v,gradientUnits:"userSpaceOnUse",children:[(0,C.jsx)(s.Stop,{offset:"0",stopColor:u.C.heatUp3,stopOpacity:.55}),(0,C.jsx)(s.Stop,{offset:"0.55",stopColor:u.C.heatUp1,stopOpacity:.28}),(0,C.jsx)(s.Stop,{offset:"1",stopColor:u.C.heatUp0,stopOpacity:.05})]}),(0,C.jsxs)(s.LinearGradient,{id:"gDn",x1:"0",y1:v,x2:"0",y2:d+p,gradientUnits:"userSpaceOnUse",children:[(0,C.jsx)(s.Stop,{offset:"0",stopColor:u.C.heatDn0,stopOpacity:.05}),(0,C.jsx)(s.Stop,{offset:"0.45",stopColor:u.C.heatDn1,stopOpacity:.3}),(0,C.jsx)(s.Stop,{offset:"1",stopColor:u.C.heatDn2,stopOpacity:.6})]}),(0,C.jsx)(s.ClipPath,{id:"cUp",children:(0,C.jsx)(s.Rect,{x:l,y:d,width:h,height:Math.max(0,v-d)})}),(0,C.jsx)(s.ClipPath,{id:"cDn",children:(0,C.jsx)(s.Rect,{x:l,y:v,width:h,height:Math.max(0,d+p-v)})})]}),(0,C.jsx)(s.G,{clipPath:"url(#cUp)",children:(0,C.jsx)(s.Path,{d:w,fill:"url(#gUp)"})}),(0,C.jsx)(s.G,{clipPath:"url(#cDn)",children:(0,C.jsx)(s.Path,{d:w,fill:"url(#gDn)"})}),(0,C.jsx)(s.Line,{x1:l,x2:l+h,y1:v,y2:v,stroke:u.C.line}),t>=g&&t<=m&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(s.Line,{x1:j(t),x2:j(t),y1:d,y2:d+p,stroke:u.C.muted,strokeDasharray:"3 4"}),(0,C.jsxs)(s.Text,{x:j(t),y:d+p+16,fontSize:11,fontFamily:"Inter",fill:u.C.muted,textAnchor:"middle",children:["now ",Math.round(t).toLocaleString('en-IN')]})]}),e.be.filter(e=>e>=g&&e<=m).map(e=>(0,C.jsx)(s.Text,{x:j(e),y:d-5,fontSize:11,fontFamily:"Inter",fill:u.C.heatUp2,textAnchor:"middle",children:Math.round(e).toLocaleString('en-IN')},e)),(0,C.jsx)(s.Path,{d:k,fill:"none",stroke:u.C.blue,strokeOpacity:.22,strokeWidth:8,strokeLinejoin:"round",strokeLinecap:"round"}),(0,C.jsx)(s.Path,{d:k,fill:"none",stroke:u.C.blue,strokeOpacity:.45,strokeWidth:4,strokeLinejoin:"round",strokeLinecap:"round"}),(0,C.jsx)(s.Path,{d:k,fill:"none",stroke:u.C.blue,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),[y-b,0,x+b].map((e,t)=>(0,C.jsx)(s.Text,{x:l-6,y:S(e)+4,fontSize:11,fontFamily:"Inter",fill:u.C.muted,textAnchor:"end",children:$(e)},t)),(0,C.jsx)(s.Text,{x:l,y:d+p+16,fontSize:11,fontFamily:"Inter",fill:u.C.muted,children:Math.round(g).toLocaleString('en-IN')}),(0,C.jsx)(s.Text,{x:l+h,y:d+p+16,fontSize:11,fontFamily:"Inter",fill:u.C.muted,textAnchor:"end",children:Math.round(m).toLocaleStr
1090ing('en-IN')})]})}const F=new Map;function H(e,n,r){const l=n?`${e}|${r}|${JSON.stringify(n.legs)}`:'',[o,i]=(0,t.useState)(null);return(0,t.useEffect)(()=>{if(!n)return void i(null);const t=F.get(l);if(t)return void i(t);let r=!0;i({status:'loading'});const o=setTimeout(()=>{(0,c.api)('/api/sb/margin',{underlying:e,expiry:n.expiry,legs:n.legs}).then(e=>{F.set(l,e),r&&i(e)}).catch(e=>r&&i({status:'unavailable',reason:e?.code,text:e?.code&&'REQUEST_FAILED'!==e.code&&404!==e?.status&&405!==e?.status?e?.message||'Margin unavailable.':'Margin from Kite is not available yet.'}))},400);return()=>{r=!1,clearTimeout(o)}},[l]),o}const N={range:'M5 9 H21 M5 17 H21 M6 13 C9 10.5 11 15.5 13 13 S17 10.5 20 13',rise:'M5 18 L10 13 L13 15.5 L20 8 M15.5 8 H20 V12.5',fall:'M5 8 L10 13 L13 10.5 L20 18 M15.5 18 H20 V13.5',big_move:'M13 5 V21 M9.5 8.5 L13 5 L16.5 8.5 M9.5 17.5 L13 21 L16.5 17.5 M5 13 H8 M18 13 H21',protect:'M13 4.5 L19.5 7 V12.5 C19.5 16.5 16.6 19.6 13 21 C9.4 19.6 6.5 16.5 6.5 12.5 V7 Z M10 12.8 L12.2 15 L16.2 10.8',time:'M13 5 A8 8 0 1 0 13.01 5 M13 9 V13 L16 15',futures_options:'M6 10 H19 L16 7 M20 16 H7 L10 19'};function R({k:e,on:t}){const n=`si_${e}_${t?1:0}`;return(0,C.jsxs)(a.default,{width:34,height:34,viewBox:"0 0 34 34",children:[(0,C.jsx)(s.Defs,{children:(0,C.jsxs)(s.LinearGradient,{id:n,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,C.jsx)(s.Stop,{offset:"0",stopColor:t?u.C.heatUp1:u.C.hoverBg,stopOpacity:t?.55:1}),(0,C.jsx)(s.Stop,{offset:"1",stopColor:t?u.C.soft:u.C.dark,stopOpacity:1})]})}),(0,C.jsx)(s.Rect,{x:1,y:1,width:32,height:32,rx:9,fill:`url(#${n})`,stroke:t?u.C.green:u.C.glassLine,strokeWidth:1}),(0,C.jsx)(s.Path,{d:N[e]||N.range,transform:"translate(4 4)",fill:"none",stroke:t?u.C.mint:u.C.ink,strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"})]})}function P({m:e,compact:t=!1}){const n=e?.margin,r=n&&'unavailable'!==n.status?n.final_with_hedge_benefit??n.final??n.value??n.initial:null;return(0,C.jsxs)(o.default,{style:[u.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:"Margin"}),null!=r?(0,C.jsxs)(u.T,{style:{fontSize:13,color:u.C.ink,fontFamily:'InterSemi',fontVariant:['tabular-nums']},children:[$(r),(0,C.jsx)(u.T,{style:{fontSize:11,color:u.C.muted,fontFamily:'Inter'},children:` Margin from Kite at ${String(n.as_of||'').slice(11,16)} \xb7 1 lot`})]}):(0,C.jsx)(u.T,{title:n?.text||e?.text||'',style:{fontSize:12,color:u.C.muted},children:'loading'===e?.status?'Asking Kite\u2026':t?/MARKET_CLOSED/.test(n?.reason||e?.reason||'')?'market hours only':'unavailable':n?.text||e?.text||'Margin unavailable.'})]})}function W(e,t,n,r){const l=e.be.map(e=>Math.round(e).toLocaleString('en-IN'));return t.shares?`${null!=e.ml?`However far ${n} falls, the loss stops near ${$(e.ml)}.`:''} ${'collar'===t.key?`The gain is capped near ${$(e.mp)}.`:'If it rises, you keep the rise minus the put\'s cost.'}`:null==e.mp||null==e.ml?'':2===l.length?`Earns up to ${$(e.mp)} if ${n} ends between ${l[0]} and ${l[1]} on ${r}. Outside that band the loss grows, and stops at ${$(e.ml)}.`:1===l.length?`Breaks even at ${l[0]} on ${r}. The most it can earn is ${$(e.mp)}; the most it can lose is ${$(e.ml)}.`:`The most it can earn is ${$(e.mp)}; the most it can lose is ${$(e.ml)}.`}async function O(e,t,n,r){if(t.shares)return(0,x.writeStore)('options-desk','draft',{legs:e.legs.map((e,t)=>({id:`g${t}`,underlying:n,kind:e.type,expiry:'EQ'===e.type?'':r,strike:e.strike??null,side:'B'===e.side?'buy':'sell',lots:e.lots}))}),void d.router.push({pathname:'/strategies',params:{view:'desk'}});const l=await h.sb.create({underlying:n,expiry:r,legs:e.legs,scenario:{}},`${n} ${t.name} ${L(e)}`);d.router.push({pathname:'/strategies',params:{id:l.id}})}N.hedge=N.protect},997,[11,375,278,385,13,400,840,252,821,197,976,921,922,966,988,871,974,6]); 1091__d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.MarketMovers=function(){const{height:e}=(0,n.default)(),[o,l]=(0,t.useState)('gainers'),[h,u]=(0,t.useState)(15),[f,b]=(0,t.useState)(''),[j,k]=(0,t.useState)(0);(0,t.useEffect)(()=>{const e=setInterval(()=>{'undefined'!=typeof document&&'visible'!==document.visibilityState||k(e=>e+1)},6e4);return()=>clearInterval(e)},[]);const z=`/api/derivatives/movers?view=${o}&interval=${h}${'sectors'===o&&f?`§or=${encodeURIComponent(f)}`:''}`,T=(0,c.useSharedRead)(z,j),I=T.data,F=I?.[o]||I?.items||[],W=I?.sectors||[],M=Math.max(560,e-172),R=(e,t,o)=>(0,p.jsxs)(s.default,{style:{width:t},children:[!!o&&(0,p.jsx)(d.T,{style:{fontSize:11,letterSpacing:1,color:d.C.muted,textTransform:'uppercase'},children:o}),(0,p.jsx)(d.T,{style:{fontSize:11,color:d.C.heading,fontFamily:'InterSemi'},children:e})]},e),H=!!T.error&&/404|not found|Unable/i.test(String(T.error));return(0,p.jsx)(s.default,{style:{paddingHorizontal:12,paddingTop:8,width:'100%'},children:(0,p.jsxs)(s.default,{style:{height:M,borderWidth:1,borderColor:d.C.line,borderRadius:12,backgroundColor:d.C.paper,overflow:'hidden'},children:[(0,p.jsxs)(s.default,{style:[d.s.row,{gap:8,padding:10,borderBottomWidth:1,borderColor:d.C.line,flexWrap:'wrap'}],children:[(0,p.jsx)(s.default,{accessibilityRole:"tablist",style:[d.s.row,{gap:0,borderWidth:1,borderColor:d.C.line,borderRadius:8,overflow:'hidden'}],children:y.map(([e,t],r)=>{const s=e===o;return(0,p.jsx)(i.default,{role:"tab","aria-selected":s,onPress:()=>{l(e),b('')},style:e=>({height:32,paddingHorizontal:14,justifyContent:'center',borderLeftWidth:r?1:0,borderColor:d.C.line,backgroundColor:s?d.C.soft:e.hovered?d.C.hoverBg:'transparent'}),children:(0,p.jsx)(d.T,{style:{fontSize:12,fontFamily:s?'InterSemi':'InterMedium',color:s?d.C.green:d.C.ink},children:t})},e)})}),(0,p.jsx)(s.default,{style:{flex:1}}),(0,p.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:"Refresh"}),(0,p.jsx)(s.default,{style:[d.s.row,{gap:0,borderWidth:1,borderColor:d.C.line,borderRadius:8,overflow:'hidden'}],children:[5,15].map((e,t)=>{const o=e===h;return(0,p.jsx)(i.default,{role:"radio","aria-checked":o,onPress:()=>u(e),style:{height:28,paddingHorizontal:10,justifyContent:'center',borderLeftWidth:t?1:0,borderColor:d.C.line,backgroundColor:o?d.C.soft:'transparent'},children:(0,p.jsx)(d.T,{style:{fontSize:12,color:o?d.C.green:d.C.muted},children:`${e} min`})},e)})}),('ath'===o||'atl'===o)&&!!I?.history_since&&(0,p.jsx)(d.T,{style:{fontSize:11,color:d.C.amber},children:`High/low since ${I.history_since} (our adjusted history)`}),(0,p.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:I?.as_of?`F&O stocks \xb7 updated ${_(I.as_of)} \xb7 updates itself when new data lands`:'updates itself when new data lands'})]}),'sectors'===o&&W.length>0&&(0,p.jsx)(r.default,{horizontal:!0,style:{flexGrow:0},contentContainerStyle:{gap:6,padding:8},children:W.slice(0,12).map(e=>{const t=(f||W[0]?.sector)===e.sector,o=C(m(e.chg_pct));return(0,p.jsxs)(i.default,{onPress:()=>b(e.sector),style:e=>({paddingHorizontal:10,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:t?d.C.green:d.C.line,backgroundColor:t?d.C.soft:e.hovered?d.C.hoverBg:'transparent'}),children:[(0,p.jsx)(d.T,{style:{fontSize:12,color:d.C.ink,fontFamily:'InterSemi'},children:e.sector}),(0,p.jsx)(d.T,{style:{fontSize:11,color:x(o)},children:`${w(o)} ${v(m(e.chg_pct))} \xb7 ${e.up??'\u2014'}\u2191 ${e.down??'\u2014'}\u2193`})]},e.sector)})}),(0,p.jsx)(r.default,{horizontal:!0,style:{flex:1},contentContainerStyle:{minWidth:'100%'},children:(0,p.jsxs)(s.default,{style:{flex:1},children:[(0,p.jsxs)(s.default,{style:[d.s.row,{minHeight:42,paddingHorizontal:14,borderBottomWidth:1,borderColor:d.C.line,alignItems:'flex-end',paddingBottom:6}],children:[R('Stock',$.stock),R('Change',$.chg),R('Price',$.price),R('Fibonacci pivot',$.pivot,'Levels'),R('50-day avg',$.ma50,'Levels'),R('200-day avg',$.ma200,'Levels'),R('52-week',$.w52,'Levels'),R('Volume',$.vol,'Activity'),R('Futures OI',$.oi,'Activity'),R('Calls vs puts',$.side,'Activity'),R('ATM IV',$.iv,'Options'),R('ATM theta',$.theta,'Options'),R('Open in',$.open)]}),(0,p.jsx)(r.default,{style:{flex:1},children:I?F.length?F.slice(0,10).map((e,t)=>(0,p.jsx)(S,{it:e,interval:h},`${e.underlying||e.symbol}-${t}`)):(0,p.jsx)(d.T,{style:{fontSize:13,color:d.C.muted,padding:24},children:"No stocks in this list at this reading."}):(0,p.jsx)(s.default,{style:{padding:24,alignItems:'center'},children:(0,p.jsx)(d.T,{style:{fontSize:13,color:d.C.muted,textAlign:'center'},children:H?'Market movers data arrives with the next server update (the data team is building it).':T.error?`Market movers is not available right now (${T.error}).`:'Reading the market\u2026'})})})]})}),(0,p.jsxs)(d.T,{style:{fontSize:11,color:d.C.muted,paddingHorizontal:14,paddingVertical:8,borderTopWidth:1,borderColor:d.C.line},children:["\u25b2 crossed above / rose today \xb7 \u25bc crossed below / fell \xb7 grey = no change today (current level shown). The small line is the last ",h," minutes. Hover any cell for what it measures. Observations from stored readings - not signals."]})]})})};var t=_r(_d[0]),o=e(t),i=e(_r(_d[1])),r=e(_r(_d[2])),s=e(_r(_d[3])),n=e(_r(_d[4])),l=_r(_d[5]),d=_r(_d[6]),c=_r(_d[7]),h=_r(_d[8]),u=_r(_d[9]),p=_r(_d[10]);const y=[['gainers','Top gainers'],['losers','Top losers'],['sectors','Sectors'],['ath','All-time high'],['atl','All-time low'],['volume_shockers','Volume shockers']],m=e=>'number'==typeof e&&Number.isFinite(e)?e:null,f=(e,t=0)=>
1091null==e?'\u2014':e.toLocaleString('en-IN',{maximumFractionDigits:t,minimumFractionDigits:t}),v=(e,t=1)=>null==e?'\u2014':`${e>0?'+':e<0?'\u2212':''}${Math.abs(e).toFixed(t)}%`,b=(e,t=1)=>null==e?'\u2014':`${e>0?'+':e<0?'\u2212':''}${Math.abs(e).toFixed(t)}`,C=e=>null==e||0===e?0:e>0?1:-1,w=e=>e>0?'\u25b2':e<0?'\u25bc':'\xb7',x=e=>e>0?d.C.heatUp2:e<0?d.C.heatDn2:d.C.muted,_=e=>e?String(e).slice(11,16):'';function j({w:e,d:t,top:o,sub:i,tip:r}){return(0,p.jsxs)(s.default,{style:{width:e,paddingRight:8},title:r||'',children:[(0,p.jsx)(d.T,{numberOfLines:1,style:{fontSize:13,fontFamily:t?'InterSemi':'Inter',color:x(t),fontVariant:['tabular-nums']},children:`${w(t)} ${o}`}),!!i&&(0,p.jsx)(d.T,{numberOfLines:1,style:{fontSize:11,color:d.C.muted,fontVariant:['tabular-nums']},children:i})]})}const $={stock:130,chg:92,price:150,pivot:112,ma50:104,ma200:104,w52:104,vol:100,oi:100,side:130,iv:124,theta:136,open:210};function S({it:e,interval:t}){const r=t=>[...e.events||[]].reverse().find(e=>e.kind===t||String(e.kind).startsWith(t)),n=e.levels||{},c=e.price||{},y=e.volume||{},w=e.fut_oi||{},x=e.atm_iv||{},S=e.atm_theta||{},k=e.options||e.calls_puts||{},z=r('pivot_cross'),T=r('ma50_cross'),I=r('ma200_cross'),F=r('new_52w_high'),W=r('new_52w_low'),M=e=>e?/down|low/.test(e.kind)?-1:/up|high/.test(e.kind)||/^above/.test(String(e.to))?1:/^below/.test(String(e.to))?-1:1:0,R=e=>null==e||null==m(c.now)?'\u2014':c.now>=e?'Above':'Below',H=`${t}m`,L=o.default.useContext(h.StudioOpen),O=t=>{if((0,h.setInstrument)(e.underlying||e.symbol),L)L(t);else{if('chain'===t)return(0,u.writeStore)('derivative-studio','tool',{id:'chain'}),void l.router.push('/derivative-studio');(0,u.writeStore)('gallery'===t?'strategy-gallery':'build-scratch','pick',{u:e.underlying||e.symbol}),l.router.push({pathname:'/strategies',params:{view:t}})}},A=(e,t,o=!1)=>(0,p.jsx)(i.default,{accessibilityRole:"button",onPress:t,style:e=>({height:28,paddingHorizontal:10,borderRadius:7,justifyContent:'center',borderWidth:1,borderColor:o?d.C.green:d.C.line,backgroundColor:o?d.C.soft:e.hovered?d.C.hoverBg:'transparent'}),children:(0,p.jsx)(d.T,{style:{fontSize:12,color:o?d.C.green:d.C.ink,fontFamily:'InterMedium'},children:e})}),B='calls'===k.side?1:'puts'===k.side?-1:0;return(0,p.jsxs)(s.default,{style:[d.s.row,{minHeight:52,paddingHorizontal:14,borderBottomWidth:1,borderColor:d.C.lineSoft}],children:[(0,p.jsxs)(s.default,{style:{width:$.stock},children:[(0,p.jsx)(d.T,{style:{fontSize:13,fontFamily:'InterSemi',color:d.C.ink},children:e.underlying||e.symbol}),!!e.sector&&(0,p.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:e.sector})]}),(0,p.jsx)(j,{w:$.chg,d:C(m(c.day_chg_pct??c.chg_pct)),top:v(m(c.day_chg_pct??c.chg_pct)),sub:`${H} ${v(m(c.chg_interval_pct??c.chg_interval),2)}`}),(0,p.jsxs)(s.default,{style:{width:$.price,paddingRight:8},children:[(0,p.jsx)(d.T,{numberOfLines:1,style:{fontSize:13,color:d.C.ink,fontVariant:['tabular-nums']},children:`${f(m(c.prev_close),0)} \u2192 ${f(m(c.now),0)}`}),(0,p.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:"vs prev close"})]}),(0,p.jsx)(j,{w:$.pivot,d:M(z),top:z?String(z.level||'pivot').replace(/^pivot\s*/i,''):'No cross',sub:z?`${f(m(z.value??z.to),1)} \xb7 ${_(z.at)}`:`P ${f(m(n.pivots?.p),1)}`,tip:"Fibonacci pivots from yesterday's high, low and close"}),(0,p.jsx)(j,{w:$.ma50,d:M(T),top:T?M(T)>0?'Crossed up':'Crossed down':R(m(n.ma50)),sub:`${f(m(n.ma50),1)}${T?` \xb7 ${_(T.at)}`:''}`,tip:"50-day average of adjusted daily closes"}),(0,p.jsx)(j,{w:$.ma200,d:M(I),top:I?M(I)>0?'Crossed up':'Crossed down':R(m(n.ma200)),sub:`${f(m(n.ma200),1)}${I?` \xb7 ${_(I.at)}`:''}`,tip:"200-day average of adjusted daily closes"}),(0,p.jsx)(j,{w:$.w52,d:F?1:W?-1:0,top:F?'New high':W?'New low':'\u2014',sub:F?`${f(m(F.to??F.value),1)} \xb7 ${_(F.at)}`:W?`${f(m(W.to??W.value),1)} \xb7 ${_(W.at)}`:`${f(m(n.low_52w),0)} \u2013 ${f(m(n.high_52w),0)}`}),(0,p.jsx)(j,{w:$.vol,d:C(null!=m(y.ratio)?y.ratio-1:null),top:null!=m(y.ratio)?`${y.ratio.toFixed(1)}\xd7`:'\u2014',sub:null!=m(y.chg_interval)?`${H} ${v(m(y.chg_interval),0)}`:'vs usual',tip:"Volume so far vs the usual volume by this time of day (20-session median)"}),(0,p.jsx)(j,{w:$.oi,d:C(m(w.day_chg_pct??w.day_chg)),top:v(m(w.day_chg_pct??w.day_chg),1),sub:`${H} ${v(m(w.chg_interval_pct??w.chg_interval),2)}`,tip:"Futures open interest change today"}),(0,p.jsx)(j,{w:$.side,d:B,top:'calls'===k.side?'Calls busier':'puts'===k.side?'Puts busier':k.side?'Balanced':'\u2014',sub:(()=>{const e=m(k.call_oi_chg?.day??k.call_oi_chg),t=m(k.put_oi_chg?.day??k.put_oi_chg);return null!=e&&null!=t?`OI C ${b(e/1e5,1)}L \xb7 P ${b(t/1e5,1)}L`:''})(),tip:`Where option activity is heavier today${k.basis?` (${k.basis})`:''}; the small line is the open-interest change by side`}),(0,p.jsx)(j,{w:$.iv,d:C(m(x.day_chg)),top:b(m(x.day_chg)),sub:`${f(m(x.now),1)}% \xb7 ${H} ${b(m(x.chg_interval??x.chg_15m))}`,tip:"At-the-money implied volatility (points)"}),(0,p.jsx)(j,{w:$.theta,d:C(m(S.day_chg)),top:b(m(S.day_chg)),sub:`\u20b9${f(m(S.now),0)}/lot \xb7 ${H} ${b(m(S.chg_interval??S.chg_15m),0)}`,tip:"At-the-money theta, \u20b9 per lot per day"}),(0,p.jsxs)(s.default,{style:[d.s.row,{width:$.open,gap:6}],children:[A('Chain',()=>
1091O('chain')),A('Gallery',()=>O('gallery')),A('Build',()=>O('scratch'))]})]})}},998,[11,375,278,13,400,252,821,921,974,871,6]); 1092__d(function(_g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.OptionsScreener=function(){const{height:e}=(0,l.default)(),s=(0,f.readStore)(v,'pick'),[d,C]=(0,t.useState)(s.win||5),[w,I]=(0,t.useState)(s.per||'15'),[O,$]=(0,t.useState)({...Object.fromEntries(y.map(e=>[e.k,'any'])),...s.dirs||{}}),[P,R]=(0,t.useState)((s.order||[]).filter(e=>y.some(t=>t.k===e))),[H,W]=(0,t.useState)((s.visible||b).filter(e=>y.some(t=>t.k===e))),[F,D]=(0,t.useState)(!1),[M,E]=(0,t.useState)('');(0,t.useEffect)(()=>{if(!M)return;const e=setTimeout(()=>E(''),5e3);return()=>clearTimeout(e)},[M]);const A=r.default.useRef(0),U=r.default.useRef(!1),V=(e,t)=>'calls_vs_puts'===t?'rising'===e?'calls':'falling'===e?'puts':'any':'rising'===e?'up':'falling'===e?'down':'any',L=e=>'up'===e||'calls'===e?'rising':'down'===e||'puts'===e?'falling':'any',B=()=>(0,p.api)('/api/me/prefs/options-screener').then(e=>{A.current=e?.version||0;const t=e?.value?.sets?.[0],r=t?{...t,conditions:x(t.conditions)}:t;if(r?.conditions){const e=Object.keys(r.conditions).filter(e=>y.some(t=>t.k===e));e.length&&(W(t=>[...new Set([...t,...e])]),$(t=>({...t,...Object.fromEntries(e.map(e=>[e,L(r.conditions[e])]))})),R(e.filter(e=>'any'!==r.conditions[e]))),r.window&&C(r.window),null!=r.interval&&I(String(r.interval))}U.current=!0}).catch(()=>{U.current=!0}).then(Y),G=(0,c.useLocalSearchParams)(),N=r.default.useRef(!1),Y=()=>{if(!G.conditions&&!G.window)return;N.current=!0,G.window&&Number(G.window)&&C(Number(G.window)),G.interval&&I(String(G.interval));const e=Object.entries(x(Object.fromEntries(String(G.conditions||'').split(',').map(e=>e.split(':')).filter(e=>2===e.length)))).filter(([e,t])=>t&&y.some(t=>t.k===e));e.length&&(W(t=>[...new Set([...t,...e.map(e=>e[0])])]),$(t=>({...Object.fromEntries(Object.keys(t).map(e=>[e,'any'])),...Object.fromEntries(e.map(([e,t])=>[e,L(t)]))})),R(e.map(e=>e[0])))};(0,t.useEffect)(()=>{B()},[]),(0,t.useEffect)(()=>{if(!U.current)return;if(N.current)return void(N.current=!1);const e=setTimeout(async()=>{const e=Object.fromEntries(H.map(e=>[e,V(O[e]||'any',e)])),t=Object.fromEntries(Object.entries(e).filter(([,e])=>'any'!==e)),r=/^\d+$/.test(w)?Number(w):w,n=async e=>(0,p.apiSend)('/api/me/prefs/options-screener','PUT',{sets:[{name:'My screen',window:d,interval:r,conditions:e}]},{'If-Match':String(A.current)});let i=await n(e);422===i.status&&(i=await n(t)),i.ok?A.current=i.data?.version??A.current+1:409===i.status&&(E('Your screen was updated in another tab - reloaded.'),B())},1500);return()=>clearTimeout(e)},[H,O,d,w]);(0,t.useEffect)(()=>{(0,f.writeStore)(v,'pick',{win:d,per:w,dirs:O,order:P,visible:H})},[d,w,O,P,H]);const[Z,q]=(0,t.useState)(0);(0,t.useEffect)(()=>{const e=setInterval(()=>{'undefined'!=typeof document&&'visible'!==document.visibilityState||q(e=>e+1)},6e4);return()=>clearInterval(e)},[]);const J=(0,h.useSharedRead)(`/api/derivatives/options-screener?window=${d}&interval=${w}`,Z),K=J.data?.rows||[],Q=(e,t)=>{$(r=>({...r,[e]:t})),R(r=>'any'===t?r.filter(t=>t!==e):r.includes(e)?r:[...r,e])},X=(e,t)=>{const r=O[t];if('any'===r)return!0;if('calls_vs_puts'===t)return e?.calls_vs_puts?.side===('rising'===r?'calls':'puts');const n=e?.[t]?.direction;return'rising'===r?'rising'===n||'widening'===n:'falling'===n||'narrowing'===n},ee=(0,t.useMemo)(()=>{let e=K;const t=[];for(const r of P)e=e.filter(e=>X(e,r)),t.push({k:r,n:e.length});return{steps:t,final:e}},[K,P,O]),te=ee.final,re=Math.max(560,e-172),ne=r.default.useContext(g.StudioOpen),ie=(e,t)=>{if((0,g.setInstrument)(e),ne)ne(t);else{if('chain'===t)return(0,f.writeStore)('derivative-wip','oi_symbol',{u:e}),(0,f.writeStore)('derivative-studio','tool',{id:'chain'}),void c.router.push('/derivative-studio');(0,f.writeStore)('gallery'===t?'strategy-gallery':'build-scratch','pick',{u:e}),c.router.push({pathname:'/strategies',params:{view:t}})}},oe=(e,t,r=!1)=>(0,m.jsx)(n.default,{accessibilityRole:"button",onPress:t,style:e=>({height:28,paddingHorizontal:10,borderRadius:7,justifyContent:'center',borderWidth:1,borderColor:r?u.C.green:u.C.line,backgroundColor:r?u.C.soft:e.hovered?u.C.hoverBg:'transparent'}),children:(0,m.jsx)(u.T,{style:{fontSize:12,color:r?u.C.green:u.C.ink,fontFamily:'InterMedium'},children:e})}),le=(e,t,r=1,n=!1)=>{const i='rising'===e?.direction?1:'falling'===e?.direction?-1:0,o=n?S(e?.ratio):S(e?.chg_pct)??S(e?.chg),l=null==o?e?.reason_text||e?.reason||e?.reasons&&Object.values(e.reasons)[0]||e?.status||'':e?.coverage?`based on ${e.coverage.own_price}/${e.coverage.total} traded strikes${e.coverage.interpolated?`, ${e.coverage.interpolated} interpolated`:''}`:'';return(0,m.jsx)(u.T,{title:String(l||''),style:{flex:1,fontSize:13,textAlign:'right',fontVariant:['tabular-nums'],color:i>0?u.C.heatUp2:i<0?u.C.heatDn2:u.C.muted},children:`${i>0?'\u25b2':i<0?'\u25bc':'\xb7'} ${n?null==o?'\u2014':`${o.toFixed(1)}\xd7 usual`:_(o,r,null!=e?.chg_pct?'%':t)}`})},ae=!!J.error&&/404|not found|Unable/i.test(String(J.error));return(0,m.jsx)(o.default,{style:{paddingHorizontal:12,paddingTop:8,width:'100%'},children:(0,m.jsxs)(o.default,{style:[u.s.row,{gap:8,alignItems:'flex-start'}],children:[(0,m.jsx)(o.default,{style:{width:300,flexShrink:0,height:re,borderWidth:1,borderColor:u.C.line,borderRadius:12,backgroundColor:u.C.paper,overflow:'hidden'},children:(0,m.jsxs)(o.default,{style:{padding:12,gap:10,flex:1},children:[(0,m.jsxs)(o.default,{style:{gap:6},children:[(0,m.jsx)(u.T,{style:{fontSize:11,letterSpacing:1,textTransform:'uppercase',fontFamily:'InterSemi',color:u.C.heading},children:"Strikes around the money"}),(0,m.jsx)(T,{n:d,onPick:C}
1092)]}),(0,m.jsx)(o.default,{style:{height:1,backgroundColor:u.C.blue,opacity:.45,marginVertical:2}}),(0,m.jsxs)(o.default,{style:{gap:6},children:[(0,m.jsx)(u.T,{style:{fontSize:11,letterSpacing:1,textTransform:'uppercase',fontFamily:'InterSemi',color:u.C.heading},children:"Compared with"}),(0,m.jsx)(o.default,{style:[u.s.row,{gap:4}],children:j.map(([e,t])=>{const r=e===w;return(0,m.jsx)(n.default,{onPress:()=>I(e),title:`Compared with ${k[e]}`,style:{flex:1,minWidth:0,height:28,borderRadius:8,alignItems:'center',justifyContent:'center',borderWidth:1,borderColor:r?u.C.green:u.C.line,backgroundColor:r?u.C.soft:'transparent'},children:(0,m.jsx)(u.T,{style:{fontSize:12,color:r?u.C.green:u.C.ink},children:t})},e)})})]}),(0,m.jsx)(o.default,{style:{height:1,backgroundColor:u.C.blue,opacity:.45,marginVertical:2}}),(0,m.jsxs)(o.default,{style:[u.s.row,{gap:8}],children:[(0,m.jsx)(u.T,{style:{fontSize:11,letterSpacing:1,textTransform:'uppercase',fontFamily:'InterSemi',color:u.C.heading},children:"Conditions"}),(0,m.jsx)(o.default,{style:{flex:1}}),P.length>0&&!F&&(0,m.jsx)(n.default,{onPress:()=>{$(Object.fromEntries(y.map(e=>[e.k,'any']))),R([])},accessibilityRole:"button",accessibilityLabel:"Clear all conditions",title:'Clear all conditions',style:e=>({width:26,height:26,borderRadius:7,alignItems:'center',justifyContent:'center',borderWidth:1,borderColor:e.hovered?u.C.heatDn2:u.C.line}),children:(0,m.jsx)(u.T,{style:{fontSize:13,color:u.C.muted},children:"\u2715"})}),(0,m.jsx)(n.default,{onPress:()=>D(e=>!e),accessibilityRole:"button",style:e=>({height:26,paddingHorizontal:10,borderRadius:7,justifyContent:'center',borderWidth:1,borderColor:F?u.C.green:u.C.line,backgroundColor:F?u.C.soft:e.hovered?u.C.hoverBg:'transparent'}),children:(0,m.jsx)(u.T,{style:{fontSize:11,color:F?u.C.green:u.C.ink,fontFamily:'InterSemi'},children:F?'Done':'\uff0b Conditions store'})})]}),F?(0,m.jsxs)(o.default,{style:{gap:10},children:[(0,m.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:`Tap to add or remove. ${H.length} on your panel - saved to your profile.`}),['Price & activity','Greeks','Higher order'].map(e=>(0,m.jsxs)(o.default,{style:{gap:6},children:[(0,m.jsx)(u.T,{style:{fontSize:11,letterSpacing:1,textTransform:'uppercase',color:u.C.muted},children:e}),(0,m.jsx)(o.default,{style:[u.s.row,{gap:6,flexWrap:'wrap'}],children:y.filter(t=>t.group===e).map(e=>{const t=H.includes(e.k);return(0,m.jsxs)(n.default,{onPress:()=>{return t=e.k,W(e=>e.includes(t)?(Q(t,'any'),e.filter(e=>e!==t)):[...e,t]);var t},title:e.what,style:e=>({flexDirection:'row',alignItems:'center',gap:5,height:30,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:t?u.C.green:u.C.line,backgroundColor:t?u.C.soft:e.hovered?u.C.hoverBg:'transparent'}),children:[(0,m.jsx)(u.T,{style:{fontSize:12,color:t?u.C.green:u.C.muted},children:t?'\u2713':'+'}),(0,m.jsx)(u.T,{style:{fontSize:12,color:t?u.C.green:u.C.ink,fontFamily:t?'InterSemi':'Inter'},children:e.name})]},e.k)})})]},e))]}):(0,m.jsx)(i.default,{style:{flex:1},contentContainerStyle:{gap:10},children:y.filter(e=>H.includes(e.k)).map(e=>{return(0,m.jsx)(z,{m:e,dir:O[e.k],onDir:t=>Q(e.k,t),count:K.length?(t=e.k,ee.steps.find(e=>e.k===t)?.n??null):null},e.k);var t})}),!!M&&(0,m.jsx)(u.T,{style:{fontSize:11,color:u.C.amber},children:M})]})}),(0,m.jsxs)(o.default,{style:{flex:1,height:re,borderWidth:1,borderColor:u.C.line,borderRadius:12,backgroundColor:u.C.paper,overflow:'hidden'},children:[(0,m.jsxs)(o.default,{style:{padding:14,gap:8,borderBottomWidth:1,borderColor:u.C.line},children:[(0,m.jsxs)(o.default,{style:[u.s.row,{gap:10,flexWrap:'wrap'}],children:[(0,m.jsx)(u.T,{style:{fontFamily:'ManropeBold',fontSize:22,color:u.C.ink,fontVariant:['tabular-nums']},children:K.length?`${te.length}`:'\u2014'}),(0,m.jsx)(u.T,{style:{fontSize:13,color:u.C.muted},children:K.length?`of ${K.length} F&O underlyings match`:'underlyings match'}),(0,m.jsx)(o.default,{style:{flex:1}}),(0,m.jsx)(n.default,{onPress:async()=>{const e=Object.fromEntries(P.map(e=>[e,V(O[e]||'any',e)]).filter(([,e])=>'any'!==e));if(Object.keys(e).length)try{await(0,p.api)('/api/screener-alerts',{name:`Screen \xb7 ATM \xb1${d} \xb7 ${Object.keys(e).length} conditions`,window:d,interval:w,conditions:e}),E('Alert saved - the bell tells you when an underlying newly matches this
1092screen.')}catch(e){E('SCREENER_ALERT_LIMIT'===e?.code||409===e?.status?'You already have 10 screen alerts - delete one in the bell to add another.':404===e?.status?'Alerts for screens arrive with the next server update.':e?.message||'The alert could not be saved.')}else E('Set at least one condition first.')},accessibilityRole:"button",style:e=>({flexDirection:'row',alignItems:'center',gap:6,height:30,paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:u.C.green,backgroundColor:e.hovered?u.C.soft:'transparent'}),children:(0,m.jsx)(u.T,{style:{fontSize:12,color:u.C.green,fontFamily:'InterSemi'},children:"\ud83d\udd14 Alert me on new matches"})}),!!J.data?.as_of&&(0,m.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:`ATM \xb1${d} \xb7 vs ${k[w]} \xb7 updated ${String(J.data.as_of).slice(11,16)}`})]}),K.length>0&&P.length>0&&(0,m.jsxs)(o.default,{style:[u.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,m.jsx)(u.T,{style:{fontSize:12,color:u.C.muted,fontVariant:['tabular-nums']},children:K.length}),ee.steps.map(e=>{const t=y.find(t=>t.k===e.k),n='rising'===O[e.k];return(0,m.jsxs)(r.default.Fragment,{children:[(0,m.jsx)(u.T,{style:{fontSize:12,color:u.C.muted},children:"\u2192"}),(0,m.jsxs)(o.default,{style:[u.s.row,{gap:4,paddingHorizontal:8,height:24,borderRadius:12,backgroundColor:n?u.C.heatUp0:u.C.heatDn0}],children:[(0,m.jsx)(u.T,{style:{fontSize:11,color:n?u.C.heatUp2:u.C.heatDn2},children:`${n?'\u25b2':'\u25bc'} ${t.name}`}),(0,m.jsx)(u.T,{style:{fontSize:12,fontFamily:'InterSemi',color:u.C.ink,fontVariant:['tabular-nums']},children:e.n})]})]},e.k)})]})]}),(0,m.jsxs)(o.default,{style:[u.s.row,{height:34,paddingHorizontal:14,borderBottomWidth:1,borderColor:u.C.line}],children:[(0,m.jsx)(u.T,{style:{flex:1.3,fontSize:11,color:u.C.heading,fontFamily:'InterSemi'},children:"Underlying"}),y.filter(e=>H.includes(e.k)).map(e=>(0,m.jsx)(u.T,{numberOfLines:1,style:{flex:1,fontSize:11,color:u.C.heading,fontFamily:'InterSemi',textAlign:'right'},children:e.name},e.k)),(0,m.jsx)(u.T,{style:{flex:2.2,fontSize:11,color:u.C.heading,fontFamily:'InterSemi',paddingLeft:12},children:"Open in"})]}),(0,m.jsx)(i.default,{style:{flex:1},children:J.data?te.length?te.map(e=>{e.oi;return(0,m.jsxs)(o.default,{style:[u.s.row,{minHeight:46,paddingHorizontal:14,borderBottomWidth:1,borderColor:u.C.lineSoft}],children:[(0,m.jsxs)(o.default,{style:{flex:1.3},children:[(0,m.jsx)(u.T,{style:{fontSize:13,fontFamily:'InterSemi',color:u.C.ink},children:e.underlying}),(0,m.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:`${'index'===e.kind?'Index':'Stock'} \xb7 ${String(e.expiry||'').slice(5)}`})]}),y.filter(e=>H.includes(e.k)).map(t=>'calls_vs_puts'===t.k?(0,m.jsx)(u.T,{style:{flex:1,fontSize:12,textAlign:'right',color:'calls'===e.calls_vs_puts?.side?u.C.heatUp2:'puts'===e.calls_vs_puts?.side?u.C.heatDn2:u.C.muted},children:'calls'===e.calls_vs_puts?.side?'Calls adding':'puts'===e.calls_vs_puts?.side?'Puts adding':e.calls_vs_puts?.side?'Balanced':'\u2014'},t.k):(0,m.jsx)(r.default.Fragment,{children:le(e[t.k],'price'===t.k||t.k.startsWith('oi_')?'%':'','price'===t.k?2:'max_pain'===t.k?0:t.k.startsWith('charm')||t.k.startsWith('color')?3:t.k.startsWith('delta')?2:1,'volume'===t.k)},t.k)),(0,m.jsxs)(o.default,{style:[u.s.row,{flex:2.2,gap:6,justifyContent:'flex-start',paddingLeft:12}],children:[oe('Chain',()=>ie(e.underlying,'chain')),oe('Gallery',()=>ie(e.underlying,'gallery')),oe('Build',()=>ie(e.underlying,'scratch'))]})]},e.underlying)}):(0,m.jsxs)(o.default,{style:{padding:24,alignItems:'center',gap:6},children:[(0,m.jsx)(u.T,{style:{fontSize:14,color:u.C.ink},children:"Nothing matches every condition."}),(0,m.jsx)(u.T,{style:{fontSize:12,color:u.C.muted},children:"Set one condition back to Any, or widen the strike window."})]}):(0,m.jsx)(o.default,{style:{padding:24,alignItems:'center'},children:(0,m.jsx)(u.T,{style:{fontSize:13,color:u.C.muted,textAlign:'center'},children:ae?'Options screener data arrives with the next server update (the data team is building it).':J.error?`The screener is not available right now (${J.error}).`:'Reading every underlying\u2026'})})}),(0,m.jsx)(u.T,{style:{fontSize:11,color:u.C.muted,paddingHorizontal:14,paddingVertical:8,borderTopWidth:1,borderColor:u.C.line},children:"Rising / falling compare the same window around the money at each reading. Observations from stored readings - not signals. Hover a condition for what it measures."})]})]})})};var t=_r(_d[0]),r=e(t),n=e(_r(_d[1])),i=e(_r(_d[2])),o=e(_r(_d[3])),l=e(_r(_d[4])),s=_r(_d[5]),d=e(s),c=_r(_d[6]),u=_r(_d[7]),h=_r(_d[8]),p=_r(_d[9]),f=_r(_d[10]),g=_r(_d[11]),m=_r(_d[12]);const y=[{k:'price',name:'Price',group:'Price & activity',what:'The underlying itself'},{k:'volume',name:'Volume',group:'Price & activity',what:'The stock\'s traded volume (an index: its front future\'s) vs its usual at this time of day'},{k:'oi_call',name:'Call OI',group:'Open interest',what:'Open interest of the window\'s calls - call positions being added or closed'},{k:'oi_put',name:'Put OI',group:'Open interest',what:'Open interest of the window\'s puts - put positions being added or closed'},{k:'pcr',name:'PCR',group:'Open interest',what:'Put OI \xf7 call OI in the window - which side is being added faster'},{k:'calls_vs_puts',name:'Calls vs puts',group:'Open interest',what:'Which side is adding more open interest',sideUp:'Calls',sideDown:'Puts'},{k:'fut_premium',name:'Futures premium',group:'Price & activity',what:'Futures price minus spot - widening or narrowing',up:'Widening',down:'Narrowing'},{k:'max_pain',name:'Max pain',group:'Open interest',what:'The strike where option buyers would lose the most at expiry'},{k:'iv_call',name:'Call IV',group:'Greeks',what:'Implied volatility of the at-the-money call'},{k:'iv_put',name:'Put IV',group:'Greeks',what:'Implied volatility of the at-the-money put'},{k:'delta_call',name:'Call delta',group:'Greeks',what:'Delta of the window\'s calls (model estimate, per unit)'},{k:'delta_put',name:'Put delta',group:'Greeks',what:'Delta of the window\'s puts (model estimate, per unit)'},{k:'theta_call',name:'Call theta',group:'Greeks',what:'Daily time decay of the window\'s calls (model estimate)'},{k:'theta_put',name:'Put theta',group:'Greeks',what:'Daily time decay of the window\'s puts (model estimate)'},{k:'charm_call',name:'Call charm',group:'Higher order',what:'How fast the calls\' delta changes as time passes (model estimate)'},{k:'charm_put',name:'Put charm',group:'Higher order',what:'How fast the puts\' delta changes as time passes (model estimate)'},{k:'color_call',name:'Call colour',group:'Higher order',what:'How fast the calls\' gamma changes as time passes (model estimate)'},{k:'color_put',name:'Put colour',group:'Higher order',what:'How fast the puts\' gamma changes as time passes (model estimate)'}],C={oi:['oi_call','oi_put'],iv:['iv_call','iv_put'],delta:['delta_call','delta_put'],theta:['theta_call','theta_put'],charm:['charm_call','charm_put'],color:['color_call','color_put']},x=e=>Object.fromEntries(Object.entries(e||{}).flatMap(([e,t])=>(C[e]||[e]).map(e=>[e,t]))),b=['price','volume','oi_call','oi_put','iv_call','iv_put'],w=[1,2,5,10],j=[['5','5m'],['15','15m'],['60','1h'],['open','Open'],['1d','1D']],k={5:'5 minutes ago',15:'15 minutes ago',60:'1 hour ago',open:'the open','1d':'1 day ago'},v='options-screener',S=e=>'number'==typeof e&&Number.isFinite(e)?e:null,_=(e,t=1,r="")=>null==e?'\u2014':`${e>0?'+':e<0?'\u2212':''}${Math.abs(e).toFixed(t)}${r}`;function T({n:e,onPick:t}){return(0,m.jsxs)(o.default,{style:{gap:8},children:[(0,m.jsxs)(d.default,{width:232,height:38,children:[Array.from({length:21},(t,r)=>{const n=r-10,i=Math.abs(n)<=e,o=0===n;return(0,m.jsx)(s.Rect,{x:4+10.8*r,y:o?2:i?8:14,width:7,height:o?28:i?22:12,rx:2,fill:o?u.C.blue:i?u.C.green:u.C.line,opacity:o||i?1:.7},r)}),(0,m.jsx)(s.Text,{x:116,y:37,fontSize:11,fill:u.C.muted,textAnchor:"middle",children:"ATM"})]}),(0,m.jsx)(o.default,{style:[u.s.row,{gap:6}],children:w.map(r=>{const i=r===e;return(0,m.jsx)(n.default,{role:"radio","aria-checked":i,onPress:()=>t(r),style:e=>({flex:1,height:32,borderRadius:8,alignItems:'center',justifyContent:'center',borderWidth:1,borderColor:i?u.C.green:u.C.line,backgroundColor:i?u.C.soft:e.hovered?u.C.hoverBg:'transparent'}),children:(0,m.jsx)(u.T,{style:{fontSize:12,fontFamily:i?'InterSemi':'InterMedium',color:i?u.C.green:u.C.ink},children:`\xb1${r}`})},r)})})]})}function z({m:e,dir:t,onDir:r,count:i}){const l='any'!==t,c='rising'===t,h=c?u.C.heatUp2:u.C.heatDn2,p=e.sideUp||e.up||'Rising',f=e.sideDown||e.down||'Falling',g=(i,o,l)=>{const s=t===i,d='rising'===i?u.C.heatUp2:'falling'===i?u.C.heatDn2:u.C.muted;return(0,m.jsx)(n.default,{role:"radio","aria-checked":s,accessibilityLabel:`${e.name} ${l}`,onPress:()=>r(s&&'any'!==i?'any':i),title:l,style:e=>({minWidth:34,paddingHorizontal:4,height:26,borderRadius:6,alignItems:'center',justifyContent:'center',backgroundColor:s?'rising'===i?u.C.heatUp0:'falling'===i?u.C.heatDn0:u.C.paper:e.hovered?u.C.hoverBg:'transparent',borderWidth:1,borderColor:s?d:'transparent'}),children:(0,m.jsx)(u.T,{style:{fontSize:13,fontFamily:s?'InterSemi':'Inter',color:s?d:u.C.muted},children:o})},i)};return(0,m.jsxs)(o.default,{title:e.what,style:[u.s.row,{gap:8,height:44,paddingHorizontal:8,borderRadius:10,borderWidth:1,borderColor:l?h:u.C.line,backgroundColor:l?c?u.C.heatUp0:u.C.heatDn0:u.C.paper}],children:[(0,m.jsx)(o.default,{style:{width:26,height:26,borderRadius:7,alignItems:'center',justifyContent:'center',backgroundColor:l?u.C.paper:u.C.dark,borderWidth:1,borderColor:l?h:u.C.line},children:(0,m.jsx)(d.default,{width:14,height:14,viewBox:"0 0 20 20",children:(0,m.jsx)(s.Path,{d:l?c?'M10 2 L18 13 H13 V18 H7 V13 H2 Z':'M10 18 L18 7 H13 V2 H7 V7 H2 Z':'M4 10 H16',fill:l?h:'none',stroke:l?'none':u.C.muted,strokeWidth:2.4,strokeLinecap:"round"})})}),(0,m.jsxs)(o.default,{style:{flex:1},children:[(0,m.jsx)(u.T,{numberOfLines:1,style:{fontSize:13,fontFamily:'InterSemi',color:u.C.ink},children:e.name}),(0,m.jsx)(u.T,{numberOfLines:1,style:{fontSize:11,color:l?h:u.C.muted},children:l?`${c?p:f}${e.sideUp?' adding more':''}${null!=i?` \xb7 ${i} left`:''}`:'Any direction'})]}),(0,m.jsxs)(o.default,{style:[u.s.row,{gap:2,padding:2,borderRadius:8,backgroundColor:u.C.dark}],children:[g('rising',e.sideUp?'C':'\u25b2',p),g('any','\u2013','Any direction'),g('falling',e.sideDown?'P':'\u25bc',f)]})]})}},999,[11,375,278,13,400,840,252,821,921,197,871,974,6]); 1093__d(function(g,r,i,a,m,e,d){"use strict";
1093Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var t=r(d[1]),n=r(d[2]);function u(){return(0,n.jsx)(t.DerivativePage,{})}},1000,[11,1001,6]); 1094__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.DerivativePage=function(){const c=(0,n.useAuth)();return(0,o.uxPreview)(c?.config)?(0,s.jsx)(u.StudioPage,{}):(0,s.jsx)(t.WipPage,{})},r(d[0]);var t=r(d[1]),u=r(d[2]),n=r(d[3]),o=r(d[4]),s=r(d[5])},1001,[11,922,919,198,881,6]); 1095__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.DeviceConnect}});var t=r(d[0])},1002,[894]); 1096__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var t=r(d[1]),n=r(d[2]);function u(){return(0,n.jsx)(t.DiscoverStrategies,{})}},1003,[11,1004,6]); 1097__d(function(g,r,_i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"discoverHref",{enumerable:!0,get:function(){return b.discoverHref}}),Object.defineProperty(_e,"chartHref",{enumerable:!0,get:function(){return b.chartHref}}),Object.defineProperty(_e,"parseDiscoverParams",{enumerable:!0,get:function(){return b.parseDiscoverParams}}),_e.DiscoverStrategies=function(){const e=(0,l.useLocalSearchParams)(),k=(0,b.paramsSig)(e),j=(0,t.useMemo)(()=>(0,b.parseDiscoverParams)(e),[k]),{data:S,error:w,loading:R,reload:P}=(0,u.useCatalog)(),{width:_,height:L}=(0,n.default)(),[M,O]=(0,t.useState)(0),[B,H]=(0,t.useState)(0),[D,T]=(0,t.useState)(()=>{const e=(0,i.readStore)('discover','page').columns;return'2'===e||'4'===e?e:'auto'}),$=(0,y.gridMode)(M||_,D),[z,E]=(0,t.useState)(0),{links:N,setLink:I}=(0,f.useBlockLinks)(),[W,A]=(0,t.useState)(null),[F,K]=(0,t.useState)('half'),[U,Y]=(0,t.useState)(''),q=(0,t.useRef)(null),V=(0,t.useRef)(null),G=(0,c.useProduct)(),[J,Q]=(0,t.useState)(!1),X=(0,t.useRef)(null),Z=(0,t.useRef)(null),ee=(0,t.useRef)({}),te=(0,t.useRef)(''),ae=(0,t.useMemo)(()=>(S?.blocks||[]).filter(e=>e.enabled).sort((e,t)=>e.order-t.order),[S]),re=(0,t.useMemo)(()=>j&&ae.length?j.block&&ae.some(e=>e.key===j.block)?j.block:(ae.find(e=>e.strategies.some(e=>e.key===j.a||e.key===j.bb))||ae[0]).key:'',[j,ae]),se=(0,t.useCallback)(e=>{if(!j||e!==re||te.current===j.sig)return;const t=ee.current[e];null!=t&&(te.current=j.sig,setTimeout(()=>Z.current?.scrollTo?.({y:Math.max(0,t-8),animated:!0}),0))},[j,re]),ne=(0,t.useCallback)((e,t)=>{ee.current[e]=t,se(e)},[se]);(0,t.useEffect)(()=>{re&&se(re)},[re,se]),(0,t.useEffect)(()=>{'stack'!==$&&A(null)},[$]);const le=(0,t.useCallback)(e=>{A(e),K('full')},[]),oe='stack'===$,ie=()=>{(0,u.clearStrategyCache)(),P(!0),E(e=>e+1)},de=S?.universe?.label||'NIFTY 500',ce=S?.universe?.key||'nifty500',ue=ae.find(e=>e.key===W),he=W&&N[W]||null,ge=(0,t.useMemo)(()=>ue?(0,p.renderersFor)(ue):void 0,[ue]),ye=(0,i.formatDataDate)(S?.data_end||void 0),fe=G?.state?.data_status,be=!!fe&&!fe.error&&!0===fe.source?.live&&!0!==fe.stalled?.value&&!0!==fe.stale?.value,me=(0,i.connectionView)(S||G?.state,{error:S?'':w}),pe=(0,u.useScannerNotDeployed)(),xe='not_deployed'===G?.research?.status?G.research.message:pe;let Ce;null!=xe?Ce=(0,v.jsx)(h.ComingSoonPanel,{message:xe,compact:oe}):!S&&R?Ce=(0,v.jsx)(a.default,{style:{height:260,borderWidth:1,borderColor:o.C.line,borderRadius:12,backgroundColor:o.C.paper},children:(0,v.jsx)(x.Skeleton,{chart:!0,lines:3})}):S?ae.length||(Ce=(0,v.jsx)(x.CenterNote,{icon:"layers",text:"No strategy blocks are enabled yet."})):Ce=(0,v.jsx)(i.WidgetError,{title:'offline'===me?.mode?'No scan to show yet':'Strategies unavailable',message:me?`${me.text} ${me.detail}`:"Strategy results are unavailable right now."+(w?` ${w}`:''),onRetry:()=>P(!0)});return(0,v.jsxs)(a.default,{onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width),a=Math.round(e.nativeEvent.layout.height);O(e=>Math.abs(e-t)<2?e:t),H(e=>Math.abs(e-a)<2?e:a)},style:{flex:1,minHeight:0,backgroundColor:o.C.bg},children:[(0,v.jsxs)(s.default,{ref:Z,style:{flex:1},contentContainerStyle:{paddingHorizontal:'stack'===$?12:20,paddingTop:4,paddingBottom:W&&he?Math.round(_>0?420:0):40,gap:18},children:[(0,v.jsxs)(a.default,{style:[o.s.row,{flexWrap:'wrap',gap:oe?8:10,paddingTop:oe?6:10}],children:[(0,v.jsx)(o.T,{role:"heading","aria-level":1,style:{fontFamily:'ManropeBold',fontSize:oe?20:22,lineHeight:oe?28:30,letterSpacing:-.4,marginRight:oe?0:4},children:"Market scans"}),null==xe&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(x.HeaderChip,{ref:q,label:de,a11y:`Universe: ${de}. Change universe`,expanded:'universe'===U,onPress:()=>Y('universe')}),(0,v.jsx)(a.default,{ref:X,style:{flexShrink:1,minWidth:0},children:(0,v.jsx)(i.DataAgePill,{variant:"line",dataEnd:S?.data_end||void 0,ageDays:S?.age_days??void 0,status:G?.state?.data_status,cache:S||G?.state,error:S?'':w,expanded:J,onPress:()=>Q(e=>!e)})}),(0,v.jsx)(a.default,{style:{flex:1}}),(0,v.jsx)(x.HeaderChip,{label:"Pattern history pilot",a11y:"Open Double Bottom and Bullish Engulfing history",icon:"bar-chart-2",onPress:()=>l.router.push('/pattern-history')}),(0,v.jsx)(x.HeaderChip,{label:"Review drawings",a11y:"Review the chart and candlestick pattern drawings",icon:"edit-3",onPress:()=>l.router.push('/pattern-drawing-review')}),!oe&&(0,v.jsx)(x.HeaderChip,{ref:V,label:`Columns: ${'auto'===D?'Auto':D}`,a11y:`Card columns: ${'auto'===D?'Auto':D}. Change density`,expanded:'columns'===U,onPress:()=>Y('columns')}),oe?(0,v.jsx)(i.IconButton,{icon:"refresh-cw",label:"Refresh all strategy cards",tooltip:"Refresh all",onPress:ie,style:{width:32,height:32}}):(0,v.jsx)(x.HeaderChip,{label:"Refresh all",a11y:"Refresh all strategy cards",icon:"refresh-cw",onPress:ie})]})]}),(0,v.jsx)(C.DisclaimerNote,{compact:oe}),null==xe&&!!me&&(0,v.jsxs)(a.default,{role:"status",accessibilityLiveRegion:"polite",accessibilityLabel:me.a11y,style:[o.s.row,{gap:8,padding:10,borderRadius:10,backgroundColor:'very-stale'===me.tone?o.C.redBg:o.C.amberBg,borderWidth:1,borderColor:'very-stale'===me.tone?o.C.red+'55':o.C.amberLine}],children:[(0,v.jsx)(o.Icon,{name:"alert-circle",size:15,color:'very-stale'===me.tone?o.C.red:o.C.amber}),(0,v.jsx)(o.T,{style:{flex:1,fontSize:12,lineHeight:17,color:'very-stale'===me.tone?o.C.red:o.C.amber},children:me.text}),(0,v.jsx)(x.HeaderChip,{label:"Retry",a11y:"Retry the scanner connection",icon:"refresh-cw",onPress:ie})]}),null==xe&&!me&&!!S?.stale&&!be&&(0,v.jsxs)(a.default,{role:"status",style:[o.s.row,{gap:8,padding:10,borderRadius:10,backgroundColor:o.C.amberBg,borderWidth:1,borderColor:o.C.amberLine}],children:[(0,v.jsx)(o.Icon,{name:"alert-circle",size:15,color:o.C.amber}),(0,v.jsxs)(o.T,{style:{flex:1,fontSize:12,lineHeight:17,color:o.C.amber},children:["Research only \u2014 prices are ",null!=S.age_days?`${S.age_days} days old`:'of unknown age',ye?` (data to ${ye})`:'',". Lists are stored scans, not current signals."]})]}),null==xe&&!me&&!!S&&!!w&&(0,v.jsx)(o.T,{style:{fontSize:12,color:o.C.amber},children:"Could not refresh the strategy catalog. Showing the last loaded version."}),Ce,null==xe&&!!S&&ae.map((e,t)=>(0,v.jsx)(p.Block,{block:e,index:t,catalog:S,mode:$,deep:e.key===re?j:null,refreshSeq:z,link:N[e.key]||null,setLink:I,onOpenSheet:le,onLayoutY:ne},e.key))]}),null==xe&&'stack'===$&&!!ue&&!!he&&(0,v.jsx)(i.BottomSheet,{snap:F,onSnapChange:K,label:"Chart and backtest",fullRatio:L>0&&B>0?Math.min(.92,(B-8)/L):.92,halfRatio:L>0&&B>0?Math.min(.5,.55*B/L):.5,header:(0,v.jsxs)(a.default,{style:[o.s.row,{gap:6}],children:[(0,v.jsxs)(o.T,{numberOfLines:1,style:{flex:1,fontFamily:'InterSemi',fontSize:14,lineHeight:20},children:[he.symbol," \xb7 ",he.patternName," \xb7 ",he.timeframe]}),(0,v.jsx)(i.IconButton,{icon:"x",label:"Close chart and backtest",tooltip:"
1097Close",onPress:()=>A(null)})]}),children:(0,v.jsxs)(s.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:12},children:[(0,v.jsx)(p.LinkedCard,{kind:ue.kind,renderers:ge,which:"chart",blockTitle:ue.title,link:he,style:{height:340},color:x.BLOCK_COLORS[Math.max(0,ae.indexOf(ue))%x.BLOCK_COLORS.length],stale:S?.stale,ageDays:S?.age_days}),(0,v.jsx)(p.LinkedCard,{kind:ue.kind,renderers:ge,which:"backtest",blockTitle:ue.title,link:he,style:{height:520},color:x.BLOCK_COLORS[Math.max(0,ae.indexOf(ue))%x.BLOCK_COLORS.length],stale:S?.stale,ageDays:S?.age_days,minTrades:ue.strategies.find(e=>e.key===he.strategyKey)?.min_trades??10})]})}),(0,v.jsx)(i.DataStatusPopover,{open:J,onClose:()=>Q(!1),anchor:X,placement:"bottom-start",status:G?.state?.data_status,dataEnd:S?.data_end||void 0,ageDays:S?.age_days??void 0,cache:S||G?.state,error:S?'':w}),(0,v.jsx)(i.Popover,{open:'universe'===U,onClose:()=>Y(''),anchor:q,label:"Universe",role:"none",width:240,children:(0,v.jsx)(x.RadioMenu,{label:"Universe",value:ce,options:[{value:ce,label:de,detail:S?.universe?.count?`${S.universe.count} stocks`:void 0}],onPick:()=>{},onClose:()=>Y(''),note:"More universes are coming later."})}),(0,v.jsx)(i.Popover,{open:'columns'===U,onClose:()=>Y(''),anchor:V,placement:"bottom-end",label:"Card columns",role:"none",width:250,children:(0,v.jsx)(x.RadioMenu,{label:"Card columns",value:D,onClose:()=>Y(''),onPick:e=>{const t=e;T(t),(0,i.writeStore)('discover','page',{columns:t})},note:'stack'===$?'Phones always stack cards.':void 0,options:[{value:'auto',label:'Auto',detail:'4 wide on large screens, 2 \xd7 2 below 1280 px'},{value:'2',label:'2 columns',detail:'Scanners, then chart and backtest'},{value:'4',label:'4 columns',detail:'All four cards in one row'}]})})]})};var t=r(d[0]),a=e(r(d[1])),s=e(r(d[2])),n=e(r(d[3])),l=r(d[4]),o=r(d[5]),i=r(d[6]),c=r(d[7]),u=r(d[8]),h=r(d[9]),y=r(d[10]),f=r(d[11]),b=r(d[12]),p=r(d[13]),x=r(d[14]),C=r(d[15]),v=r(d[16])},1004,[11,13,278,400,252,821,871,196,1005,883,1010,1011,1012,1013,925,901,6]); 1098__d(function(_g,_r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useScannerNotDeployed=function(){const[t,r]=(0,e.useState)(c);return(0,e.useEffect)(()=>{const e=()=>r(c);return l.add(e),e(),()=>{l.delete(e)}},[]),t},_e.clearStrategyCache=function(){y.clear(),k(),f={data:f.data,at:0,promise:null},i(null)},_e.useCatalog=function(){const[t,r]=(0,e.useState)(f.data),[n,o]=(0,e.useState)(''),[s,u]=(0,e.useState)(!f.data),c=(0,e.useRef)(0),l=(0,e.useCallback)((e=!1)=>{const t=++c.current;u(!0),o(''),h(e).then(e=>{t===c.current&&(r(e),u(!1))},e=>{t===c.current&&(o(e?.message||'Unable to load'),u(!1))})},[]);return(0,e.useEffect)(()=>(l(!1),()=>{c.current++}),[l]),{data:t,error:n,loading:s,reload:l}},Object.defineProperty(_e,"resultsPath",{enumerable:!0,get:function(){return m}}),_e.useStrategyResults=function(r,n="nifty500",o=0){const c=r?`${r}|${n}`:'',l=(0,e.useRef)(0),i=(0,e.useRef)(o),[f,h]=(0,e.useState)({key:'',phase:'idle',data:null,error:'',at:0}),g=(0,e.useCallback)(e=>{const o=++l.current;if(!r)return void h({key:'',phase:'idle',data:null,error:'',at:0});const i=y.get(c);!e&&i&&Date.now()-i.at<u?h({key:c,phase:'done',data:i.data,error:'',at:i.at}):(h({key:c,phase:'loading',data:null,error:'',at:0}),(0,t.api)(m(r,n)).then(e=>{if(o!==l.current)return;const t=d(e);if(t)throw t;const n=s(e);if(!n||!Array.isArray(n.rows)||n.strategy?.key&&n.strategy.key!==r)throw new Error('Strategy results are unavailable right now.');const u=Date.now();y.set(c,{data:n,at:u}),h({key:c,phase:'done',data:n,error:'',at:u})}).catch(e=>{p(e),o===l.current&&h({key:c,phase:'error',data:null,error:e?.message||'Unable to load',at:0})}))},[r,n,c]);(0,e.useEffect)(()=>{const e=o!==i.current;return i.current=o,g(e),()=>{l.current++}},[g,o]);const w=(0,e.useCallback)(()=>{l.current++,h(e=>'loading'===e.phase?{...e,phase:'stopped'}:e)},[]),b=(0,e.useCallback)(()=>g(!0),[g]),k=f.key===c;return{phase:k?f.phase:r?'loading':'idle',data:k?f.data:null,error:k?f.error:'',loadedAt:k?f.at:0,reload:b,stop:w}},Object.defineProperty(_e,"DETECTION_LIMIT",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"detectionsPath",{enumerable:!0,get:function(){return w}}),_e.clearDetectionCache=k,_e.useLiveDetections=function(r,n="today",o=0,s=!0){const c=r&&s?`${r}|${n}`:'',l=(0,e.useRef)(0),i=(0,e.useRef)(o),[f,y]=(0,e.useState)({key:'',phase:'idle',data:null,error:'',at:0}),h=(0,e.useCallback)(e=>{const o=++l.current;if(!r||!s)return void y({key:'',phase:'idle',data:null,error:'',at:0});const i=b.get(c);!e&&i&&Date.now()-i.at<u?y({key:c,phase:'done',data:i.data,error:'',at:i.at}):(y({key:c,phase:'loading',data:null,error:'',at:0}),(0,t.api)(w(r,n)).then(e=>{if(o!==l.current)return;const t=d(e);if(t)throw t;if(!e||!Array.isArray(e.rows)||e.strategy?.key&&e.strategy.key!==r||e.scope&&e.scope!==n)throw new Error('Live detections are unavailable right now.');const s=Date.now();b.set(c,{data:e,at:s}),y({key:c,phase:'done',data:e,error:'',at:s})}).catch(e=>{p(e),o===l.current&&y({key:c,phase:'error',data:null,error:e?.message||'Unable to load',at:0})}))},[r,n,c,s]);(0,e.useEffect)(()=>{const e=o!==i.current;return i.current=o,h(e),()=>{l.current++}},[h,o]);const m=(0,e.useCallback)(()=>{l.current++,y(e=>'loading'===e.phase?{...e,phase:'stopped'}:e)},[]),g=(0,e.useCallback)(()=>h(!0),[h]),k=f.key===c;return{phase:k?f.phase:c?'loading':'idle',data:k?f.data:null,error:k?f.error:'',loadedAt:k?f.at:0,reload:g,stop:m}},_e.useGallery=function(t,r,n=0){const[s,u]=(0,e.useState)({}),c=(0,e.useRef)(new Set),l=(0,e.useRef)(0),i=(0,e.useRef)(r),d=(0,e.useRef)(n);(0,e.useEffect)(()=>()=>
1098{l.current++,c.current=new Set},[]);const p=(0,e.useCallback)((e,t)=>{const r=(0,o.chartKey)(e,t),n=l.current;c.current.add(r);const s=_.peek(e,t);void 0===s?(u(e=>({...e,[r]:{phase:'loading',body:null,error:''}})),_.load(e,t).then(e=>{n===l.current&&u(t=>({...t,[r]:{phase:'done',body:e,error:''}}))},e=>{n===l.current&&u(t=>({...t,[r]:{phase:'error',body:null,error:e?.message||'Unable to load'}}))})):u(e=>({...e,[r]:{phase:'done',body:s,error:''}}))},[]),f=t.map(e=>(0,o.chartKey)(e.symbol,e.timeframe)).join(',');(0,e.useEffect)(()=>{const e=n!==d.current;(e||r!==i.current)&&(d.current=n,i.current=r,l.current++,c.current=new Set,u({}),e&&_.clear());for(const e of t)c.current.has((0,o.chartKey)(e.symbol,e.timeframe))||p(e.symbol,e.timeframe)},[f,r,n,p]);const y=(0,e.useCallback)(e=>{for(const t of e)_.forget(t.symbol,t.timeframe),p(t.symbol,t.timeframe)},[p]);return{charts:s,retry:y}},_e.useBacktestRun=function(t){const[r,n]=(0,e.useState)(D.data);return(0,e.useEffect)(()=>{if(!t)return;let e=!0;return E().then(t=>{e&&n(t)}),()=>{e=!1}},[t]),r};var e=_r(_d[0]),t=_r(_d[1]),r=_r(_d[2]),n=_r(_d[3]),o=_r(_d[4]);function s(e){if('research_index'!==e?.source)return e;const t=e.strategy;return{...e,rows:e.rows.map(e=>(0,n.researchRowToStrategyRow)(e,t)),strategy:{...t,best_low_pct:t.best_edge_low_pct,positive_low_count:t.beats_baseline,tested_count:t.cells_tested,found:t.detections_today??0},research_rows:e.rows}}const u=6e4;let c=null;const l=new Set;function i(e){c!==e&&(c=e,l.forEach(e=>e()))}function d(e){if(!(0,r.isNotDeployed)(e))return null;const n=(0,r.notDeployedMessage)(e);return i(n),new t.ApiError(n,200,r.NOT_DEPLOYED_CODE)}const p=e=>{e?.code===r.NOT_DEPLOYED_CODE&&i((0,r.notDeployedMessage)({code:r.NOT_DEPLOYED_CODE,message:e?.message}))};let f={data:null,at:0,promise:null};const y=new Map;function h(e){if(!e&&f.data&&Date.now()-f.at<u)return Promise.resolve(f.data);if(!e&&f.promise)return f.promise;const r=(0,t.api)('/api/strategies/catalog').then(e=>{const t=d(e);if(t)throw t;if(!e||!Array.isArray(e.blocks))throw new Error('Strategy catalog is unavailable right now.');return f.promise===r&&(f={data:e,at:Date.now(),promise:null}),e},e=>{throw f.promise===r&&(f.promise=null),p(e),e});return f.promise=r,r}const m=(e,t)=>`/api/strategies/${encodeURIComponent(e)}/results?universe=${encodeURIComponent(t)}`;const g=100,w=(e,t,r=g)=>`/api/strategies/${encodeURIComponent(e)}/detections?scope=${encodeURIComponent(t)}&limit=${r}`,b=new Map;function k(){b.clear()}const _=(0,o.createChartLoader)(e=>(0,t.api)(e),{ttl:u});let D={data:null,at:0,promise:null};function E(){if(D.data&&Date.now()-D.at<u)return Promise.resolve(D.data);if(D.promise)return D.promise;const e=(0,t.api)('/api/backtests/state').then(e=>{const t=e&&!(0,r.isNotDeployed)(e)&&(e.source_latest||e.detector_version)?{source_latest:e.source_latest??null,detector_version:e.detector_version??null,run_id:e.id??null}:null;return D={data:t,at:Date.now(),promise:null},t},()=>(D={...D,promise:null},null));return D={...D,promise:e},e}},1005,[11,197,820,1006,1008]); 1099__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CARD_COST_LINE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"EVIDENCE_LOADING_NOTE",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"CARD_SECTIONS",{enumerable:!0,get:function(){return r}}),_e.signed=i,_e.plain=function(e,t=1){return o(e)?`${e.toFixed(t)}%`:'\u2014'},_e.rate=s,_e.count=c,_e.bars=u,_e.evidenceTone=function(e){return'walkforward_result'===e?'good':'limited_sample'===e||'no_walkforward_trades'===e?'weak':'loading'===e?'pending':'neutral'},_e.evidenceLabel=function(t){return e.EVIDENCE_LABELS[t]||e.EVIDENCE_LABELS.incompatible},_e.hasNumbers=function(e){return!!e&&!!e.summary},_e.occurrenceText=function(e){return e&&o(e.occurrences)?`${c(e.occurrences)} occurrence${1===e.occurrences?'':'s'}`:'Occurrences not recorded'},_e.winRateText=function(e){return e?.win_rate_text||'\u2014'},_e.winRateScopeNote=function(e){return'out_of_sample'===e?.win_rate_scope?'out-of-sample':'whole history, descriptive'},_e.windowText=function(e){return e?.window_text||null},_e.barrierText=function(e){return e?.headline||null},_e.barrierTimingText=function(e,t){if(!e)return null;const n=o(e.median_bars_to_target)?`target in ${u(e.median_bars_to_target,t)}`:null,r=o(e.median_bars_to_stop)?`failure in ${u(e.median_bars_to_stop,t)}
1099`:null,i=[n,r].filter(Boolean);return i.length?`Typical time to ${i.join(' \xb7 ')}`:null},_e.curveBars=function(e){if(!e||!e.points?.length)return[];const t=e.points.map(e=>e.median_net_return_pct).filter(o),n=Math.max(...t.map(Math.abs),.001);return e.points.map(t=>{const r=o(t.median_net_return_pct)?t.median_net_return_pct:null;return{h:t.h,value:r,height:null==r?0:Math.abs(r)/n,peak:e.peak_h===t.h,selected:e.selected_h===t.h,label:String(t.h),a11y:`${t.h} ${e.bars_word}: median ${i(r)} after costs${o(t.baseline_mean_net_return_pct)?`, stock alone ${i(t.baseline_mean_net_return_pct)}`:''}${e.peak_h===t.h?', the peak':''}`}})},_e.curveCaption=function(e){if(!e)return'';const t=o(e.peak_h)?`peaks at ${e.peak_h} ${e.bars_word}`:'no peak measured',n=e.dropped_beyond_horizon?.length?` \xb7 ${e.dropped_beyond_horizon.join(', ')} beyond the measured horizon`:'';return`Median net return after costs \xb7 ${t}${n}`},_e.bucketText=l,_e.bucketA11y=function(e,t){return`${t}, ${e.name}, ${c(e.n)} cases: ${e.enough?l(e):'not enough cases to report a rate'}`},Object.defineProperty(_e,"OUTCOME_WORDS",{enumerable:!0,get:function(){return d}}),_e.occurrenceOutcome=function(e){return d[String(e.outcome)]||e.outcome||'\u2014'},_e.lastRead=function(e){return e?.read||null},_e.honestyLines=function(e){if(!e)return[];const t=[...e.honesty||[]];e.significance?.line&&t.push(e.significance.line);return t},Object.defineProperty(_e,"RESEARCH_COLUMNS",{enumerable:!0,get:function(){return _}}),Object.defineProperty(_e,"PLAIN_EVIDENCE",{enumerable:!0,get:function(){return f}}),_e.plainEvidence=p,Object.defineProperty(_e,"STORED_COLUMNS",{enumerable:!0,get:function(){return h}}),_e.researchRowToStrategyRow=function(e,t){return{symbol:e.symbol,company:e.company||e.symbol,sector:e.sector,match_id:`${e.symbol}:${t.timeframe}:${t.pattern_id}:${t.variant}:${t.side}`,timeframe:t.timeframe,side:t.side,direction:'long'===t.side?'bullish':'bearish',state:t.state,price:null,candle_end:e.last_seen,low_pct:e.edge_low_pct,high_pct:e.edge_high_pct,avg_pct:e.walkforward_mean_pct,win_rate:e.win_rate,n:e.walkforward_n??0,sample_label:e.label,status:'walkforward_result'===e.evidence_state?'tested':'no_validated_rule',test:null,evidence_basis:'walkforward_result'===e.evidence_state?'tested_rule':'loading'===e.evidence_state?'none':'hold_period_history',evidence_state:e.evidence_state,has_evidence:e.has_evidence}},_e.researchRowA11y=function(e){return`${e.symbol}, ${p(e.evidence_state)}, edge low ${i(e.edge_low_pct)}, average ${i(e.walkforward_mean_pct)} after costs, ${c(e.walkforward_n)} tested trades`},_e.researchPickerTag=function(e){if(e.evidence_pending)return'past results loading';const t=o(e.best_edge_low_pct)?`best edge low ${i(e.best_edge_low_pct)}`:'no ranked edge yet';if(!e.live_detection){return`${o(e.researched_stocks)?`${e.researched_stocks} stocks`:'history unknown'} \xb7 ${t}`}return`${o(e.detections_live)?`${e.detections_live} now`:'count unknown'} \xb7 ${t}`},Object.defineProperty(_e,"NO_LIVE_DETECTION",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"NO_LIVE_DETECTION_SHORT",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"EVIDENCE_INDEXING",{enumerable:!0,get:function(){return w}}),_e.researchStatusText=function(e,t=!1){const n=`${e.researched.toLocaleString('en-IN')} stock${1===e.researched?'':'s'}`;return'idle'===e.phase?'Choose a strategy to list stocks.':'loading'===e.phase?'Loading history\u2026':'stopped'===e.phase?t?'Stopped before loading.':'Stopped before the history loaded.':'error'===e.phase?t?'History unavailable.':'History is unavailable right now.':e.pending?w:e.revealing?t?`Loading\u2026 ${e.shown} of ${n}`:`Loading history\u2026 ${e.shown} of ${n}`:e.researched?e.live_detection?t?'Past cases by stock':'Stocks where this pattern happened before, and what followed.':t?y:`${b}.`:t?'No history on this timeframe.':'This pattern has no history on this timeframe.'},_e.evidenceCoverageText=function(e){return e&&e.total?e.ready>=e.total?null:`Evidence ready for ${c(e.ready)} of ${c(e.total)} stocks.`:null},Object.defineProperty(_e,"ROW_PENDING",{enumerable:!0,get:function(){return $}}),_e.rowPending=function(e){return!!e&&('loading'===e.evidence_state||!1===e.has_evidence)},_e.coverageText=function(e){if(!e||!e.symbols_research)return null;const t=e.symbols_with_evidence,n=e.symbols_research;return t>=n?`Evidence for all ${c(n)} stocks.`:`Evidence for ${c(t)} of ${c(n)} stocks${'running'===e.current_outcome_status?' \u2014 the rest are still being computed':''}.`},Object.defineProperty(_e,"LIST_MODES",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"LIST_MODE_LABELS",{enumerable:!0,get:function(){return E}}),_e.liveAvailable=O,_e.defaultListMode=N,_e.resolveListMode=function(e,t){return'history'===e?'history':'live'===e&&O(t)?'live':N(t)},Object.defineProperty(_e,"LIVE_OFF",{enumerable:!0,get:function(){return T}}),_e.liveOffText=function(e){return O(e)?null:e?.error?`Current setups are unavailable: ${e.error}`:e?.reason||T},_e.detectionTone=function(e){return'confirmed'===e?'confirmed':'forming'===e?'forming':'done'},Object.defineProperty(_e,"DETECTION_STATE_LABELS",{enumerable:!0,get:function(){return S}}),_e.detectionStateLabel=k,Object.defineProperty(_e,"MONTHS",{enumerable:!0,get:function(){return L}}),_e.detectionTimeText=function(e,t){const n=String(e||'');if(n.length<10)return'\u2014';const r=n.slice(0,10),o=n.length>=16?n.slice(11,16):'';
1099if(t&&r===t)return o||r;const i=/^(\d{4})-(\d{2})-(\d{2})$/.exec(r),s=i?L[Number(i[2])-1]:null,c=i&&s?`${Number(i[3])} ${s}`:r;return o?`${c} ${o}`:c},_e.sinceText=C,_e.latestSession=function(e,t){const n=t?e?.timeframes?.[t]:null,r=n?.session;return'string'==typeof r&&/^\d{4}-\d{2}-\d{2}$/.test(r)?r:null},_e.isNewDetection=x,_e.detectionDetailText=I,_e.detectionAgeText=P,_e.detectionRowA11y=function(e,t){const n=e.drawable?'':', no chart outline for this pattern',r=!1===e.evidence_compatible?', no matching past data':'';return`${e.symbol}, ${e.company}. ${I(e,t)}${n}${r}`},Object.defineProperty(_e,"MARKER_ONLY",{enumerable:!0,get:function(){return D}}),_e.geometryNoteText=function(e){return e&&!1===e.drawable?e.geometry_note||D:null},Object.defineProperty(_e,"NO_COMPATIBLE_EVIDENCE",{enumerable:!0,get:function(){return j}}),_e.evidenceCompatible=A,_e.detectionEvidenceLabel=function(e){return A(e)?null:j},_e.detectionEvidenceNote=function(e){return!e||A(e)?null:e.note||j},Object.defineProperty(_e,"NO_ACTIVE",{enumerable:!0,get:function(){return M}}),_e.liveStatusText=function(e,t=!1){if(!e.available)return t?y:e.reason||T;if('idle'===e.phase)return'Choose a strategy to see setups.';if('loading'===e.phase)return'Loading setups\u2026';if('stopped'===e.phase)return t?'Stopped before loading.':'Stopped before the setups loaded.';if('error'===e.phase)return t?'Setups unavailable.':'Current setups are unavailable right now.';if(!e.total){const n=e.lastDetected?C({detected_at:e.lastDetected}).replace(/^since /,''):'';return t||!n?M:`${M} \xb7 last seen ${n}.`}return e.shown<e.total?`Showing ${c(e.shown)} of ${c(e.total)}`:''},_e.listModeLabel=function(e,t,n){const r='live'===e?t:n;return o(r)?`${E[e]} (${c(r)})`:E[e]};var e=_r(_d[0]);const t='Costs 0.40% included \xb7 next-open entry',n='Evidence for this stock is still being computed.',r=['summary','barriers','forward_curve','conditions','last_occurrences','honesty'],o=e=>'number'==typeof e&&Number.isFinite(e);function i(e,t=1){return o(e)?`${e>0?'+':e<0?'\u2212':''}${Math.abs(e).toFixed(t)}%`:'\u2014'}function s(e){return o(e)?`${Math.round(e)}%`:'\u2014'}function c(e){return o(e)?e.toLocaleString('en-IN'):'\u2014'}function u(e,t){return o(e)?`${Number.isInteger(e)?e:e.toFixed(1)} ${t}`:'\u2014'}function l(e){if(!e.enough)return e.note||'not enough cases';const t=o(e.baseline_mean_net_return_pct)?` vs ${i(e.baseline_mean_net_return_pct)} for the stock alone`:'';return`${s(e.win_rate_pct)} win \xb7 avg ${i(e.mean_net_return_pct)}${t}`}const d={target_hit:'Target first',stop_hit:'Stop first',horizon:'Held to the window',gap_exit:'Gapped out',neither:'Neither'};const _={low:'Edge low',avg:'Avg',n:'Trades'},f={walkforward_result:'tested on later data',limited_sample:'few past cases',no_walkforward_trades:'no tested trades',insufficient_history:'not enough history',no_occurrences:'never happened before',incompatible:'no matching past data',requires_review:'past data being checked',loading:'past results loading'};function p(e){return f[String(e||'')]||'no matching past data'}const h={low:'95% low',avg:'Avg',n:'n'};const b='Not scanning live yet \u2014 showing past cases',y='Not scanning live yet',w='Past results are still loading \u2014 the list fills in when they are ready.';const $='evidence loading';const v=['live','history'],E={live:'Now',history:'History'};function O(e){return!!e&&!0===e.available}function N(e){return O(e)?'live':'history'}const T='Live scanning for these patterns is off, so there are no current setups to show.';const S={forming:'Forming',confirmed:'Confirmed',invalidated:'Invalidated',expired:'Expired'};function k(e){return e&&(e.state_label||S[e.state]||e.state)||'\u2014'}const L=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];function C(e){const t=String(e?.detected_day||e?.detected_at||'').slice(0,10),n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t),r=n?L[Number(n[2])-1]:null;return n&&r?`since ${Number(n[3])} ${r}`:''}function x(e,t){if(!e)return!1;if('boolean'==typeof e.new)return e.new;const n=String(e.detected_day||e.detected_at||'').slice(0,10);return!!t&&n===t}function I(e,t){const n=[k(e)],r=C(e);r&&n.push(r),x(e,t)&&n.push('new');const o=P(e);return o&&n.push(o),e.current||n.push('not in the latest scan'),n.join(' \xb7 ')}function P(e){const t=e?.bars_since_signal;return o(t)?0===t?'latest candle':`${t}
1099 candle${1===t?'':'s'} ago`:null}const D='marker only \u2014 this detector publishes no drawable geometry';const j=e.EVIDENCE_LABELS.incompatible;function A(e){return'identity_match'===e?.status}const M='No setup right now'},1006,[1007]); 1100__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"EVIDENCE_LABELS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"WALKFORWARD_MIN",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"DISPLAY_GRID",{enumerable:!0,get:function(){return o}});const t={insufficient_history:'Not enough historical data',no_occurrences:'No occurrences in this historical sample',no_walkforward_trades:'No selected walk-forward trades',limited_sample:'Limited historical sample',walkforward_result:'Historical walk-forward result',incompatible:'Incompatible historical evidence',requires_review:'Historical data requires review',loading:'Evidence loading'},n=20,o={'1H':[1,2,4,8,12,24],'4H':[1,2,3,5,8,10],'1D':[1,2,3,5,10],'1W':[1,2,4,8,12]}},1007,[]); 1101__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STORED_NO_MATCH",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"storedEpisodeKey",{enumerable:!0,get:function(){return n}}),_e.storedAsDetection=r,_e.storedChartBody=o,_e.storedTileFromChart=function(n,a,s=e.TILE_BARS){const i=(0,e.tileFromChart)(r(n),o(n,a),s);return i.drawable||i.geometry_note!==e.NOTE_NO_EPISODE?i:{...i,geometry_note:t}},_e.storedChipText=function(e){const t='number'==typeof e.n&&Number.isFinite(e.n)?`n ${e.n}`:'n \u2014',n='Small sample'===e.sample_label?' \xb7 small':'No history'===e.sample_label?' \xb7 none':'';return t+n},_e.storedA11y=function(e,n,r,o,a){const s=[`${e.symbol}, ${e.company}.`,`${n||'Stored'} setup from the stored scan.`,`${null==e.n?'No':e.n} past trade${1===e.n?'':'s'}${'Small sample'===e.sample_label?', small sample':'No history'===e.sample_label?', no history':''}.`,r?'Pattern lines drawn from the detector.':`Marker only: ${o||t}.`];a&&s.push('Selected.');return s.join(' ')},_e.storedEmptyText=function(e,t,n){const r=O(n);return`No ${e||'strategy'} setups in ${t||'this universe'} in the stored scan${r?` (data to ${r})`:''}`},Object.defineProperty(_e,"STORED_FAILED_TEXT",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"STORED_FILTER_NOTE",{enumerable:!0,get:function(){return s}}),_e.followSlot=function(e,t,n){const r='B'===e?'B':'A';return'A'===r&&!t&&n?'B':'B'===r&&!n&&t?'A':r},Object.defineProperty(_e,"isSlot",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"EMPTY_FILTER",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"STATE_CHIPS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"UNIVERSE_CHIPS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"UNIVERSE_COMING",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"MARKET_CAP_LABEL",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"MARKET_CAP_NOTE",{enumerable:!0,get:function(){return m}}),_e.filterActive=p,_e.universeAvailable=y,_e.applyFilter=function(e,t){if(!p(t))return e;const n=t.universe&&y(e)?t.universe:null;return e.filter(e=>('all'===t.state||e.state===t.state)&&(!t.sector||e.sector===t.sector)&&(!n||(h(e)||[]).includes(n)))},_e.sectorOptions=function(e){const t=new Map;for(const n of e){const e=(n.sector||'').trim();e&&t.set(e,(t.get(e)||0)+1)}return[...t].map(([e,t])=>({sector:e,count:t})).sort((e,t)=>t.count-e.count||e.sector.localeCompare(t.sector))},_e.filterSummary=function(e){if(!p(e))return'';const t=[];'all'!==e.state&&t.push('forming'===e.state?'Forming':'Confirmed');e.sector&&t.push(e.sector);const n=e.universe?c.find(t=>t.key===e.universe):null;n&&t.push(n.label);return t.join(' \xb7 ')},Object.defineProperty(_e,"FILTERED_OUT_TEXT",{enumerable:!0,get:function(){return b}}),_e.filteredCountText=function(e,t){return e===t?'':`${e} of ${t} match the filters`},Object.defineProperty(_e,"GALLERY_TITLE",{enumerable:!0,get:function(){return _}}),_e.strategyLabel=T,_e.followText=function(e,t,n){const r=T(t,n);return r?`Showing ${e} \xb7 ${r}${n?` \xb7 ${n}`:''}`:`Showing ${e} \xb7 no strategy chosen`},_e.scanDateText=O,_e.emptyText=function(e,t,n){const r=O(n);return`No ${e||'strategy'} setups in ${t||'this universe'} now${r?` (scan as of ${r})`:''}`},Object.defineProperty(_e,"CHOOSE_TEXT",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"HISTORY_TEXT",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"ROWS_FAILED_TEXT",{enumerable:!0,get:function(){return A}}),Object.defineProperty(_e,"PAGE_FAILED_TEXT",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"TILE_FAILED_TEXT",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"LOADING_TEXT",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"CAP_TEXT",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"MORE_LABEL",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"MAX_TILES",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"MAX_CONCURRENT",{enumerable:!0,get:function(){return C}}),_e.mountedCount=function(e,t,n,r=x){return Math.max(0,Math.min(n,r,Math.max(1,e)*Math.max(1,t)))},_e.moreCount=function(e,t,n,r=x){return Math.max(0,Math.min(t,n-e,r-e))},Object.defineProperty(_e,"pageOf",{enumerable:!0,get:function(){return N}}),_e.failedPages=function(e,t){const n=[],r=Math.ceil(e.length/Math.max(1,t));for(let o=0;o<r;o++){const r=e.slice(o*t,(o+1)*t);r.length&&r.every(e=>'error'===e)&&n.push(o)}return n},_e.gridKey=function(e,t,n,r){if(r<=0)return null;const o=Math.max(1,n),a=e=>Math.max(0,Math.min(r-1,e));switch(t.key){case'ArrowRight':return{type:'move',index:a(e+1)};case'ArrowLeft':return{type:'move',index:a(e-1)};case'ArrowDown':return{type:'move',index:e+o<r?e+o:e};case'ArrowUp':return{type:'move',index:e-o>=0?e-o:e};case'Home':return{type:'move',index:0};case'End':return{type:'move',index:r-1};case'Enter':return t.shiftKey?{type:'open',index:e}:{type:'select',index:e};case' ':return{type:'select',index:e};default:return null}},Object.defineProperty(_e,"chartPath",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"chartKey",{enumerable:!0,get:function(){return I}}),_e.createChartLoader=function(e,{limit:t=C,ttl:n=6e4,maxEntries:r=96,now:o=()=>Date.now()}={}){const a=new Map,s=new Map,i=[];let l=0,u=0,c=0;const f=()=>{for(;l<t&&i.length;){i.shift()()}},d=e=>{const t=a.get(e);return t&&o()-t.at<n?t:(t&&a.delete(e),null)};return{load(t,n){const m=I(t,n),p=d(m);if(p)return Promise.resolve(p.data);const h=s.get(m);
1101if(h)return h;const y=new Promise((d,p)=>{i.push(()=>{l++,u=Math.max(u,l),c++,Promise.resolve().then(()=>e(L(t,n))).then(e=>{for(a.delete(m),a.set(m,{data:e,at:o()});a.size>r;){const e=a.keys().next().value;a.delete(e)}d(e)},p).finally(()=>{l--,s.delete(m),f()})}),f()});return s.set(m,y),y},peek:(e,t)=>d(I(e,t))?.data,forget(e,t){a.delete(I(e,t))},clear(){a.clear()},stats:()=>({active:l,queued:i.length,peak:u,requests:c,cached:a.size})}};var e=_r(_d[0]);const t='this stored setup is not in the chart the scanner served, so no lines are drawn',n=e=>`stored:${e.match_id}`;function r(e){return{detection_id:n(e),episode_id:n(e),symbol:e.symbol,company:e.company,sector:e.sector,timeframe:e.timeframe,pattern_id:e.match_id?.split(':')[2]||'',variant:'',side:e.side,family:'chart',pattern_name:'',state:e.state,state_label:'',state_reason:null,state_at:null,detector_state:null,live:!1,bars_since_state:null,bars_since_signal:null,direction:e.direction,fit_score:null,score:null,price:e.price,atr:null,formation_start:'',detected_at:'',signal_at:'',confirmed_at:null,as_of:e.candle_end||'',first_seen:'',last_seen:'',detected_day:null,current:!0,detector_spec_hash:'',live_rules_version:'',geometry_note:'',drawable:!0,quality_tags:[],match_id:e.match_id,evidence:null,evidence_compatible:!1}}function o(e,t){const r=Array.isArray(t?.matches)?t.matches:[];let o=!1;return{...t||{},matches:r.map(t=>!o&&t&&t.id&&t.id===e.match_id?(o=!0,{...t,detection_id:n(e)}):t)}}const a='The stored scan is unavailable right now, so no charts are drawn. This is not the same as no setups.',s='State, sector and universe filters apply to Now setups; the stored scan is shown whole.';const i=e=>'A'===e||'B'===e,l={state:'all',sector:null,universe:null},u=[{value:'all',label:'All'},{value:'forming',label:'Forming'},{value:'confirmed',label:'Confirmed'}],c=[{key:'nifty50',label:'Nifty 50'},{key:'nifty100',label:'Nifty 100'},{key:'nifty200',label:'Nifty 200'},{key:'nifty500',label:'Nifty 500'},{key:'fno',label:'F&O'}],f='Universe filter coming',d='Market cap',m='Market-cap bands not available yet';function p(e){return!(!e||'all'===e.state&&!e.sector&&!e.universe)}function h(e){const t=e?.universes;return Array.isArray(t)?t.map(String):null}function y(e){return e.length>0&&e.every(e=>null!==h(e))}const b='No setups match these filters. Clear a filter to see the rest.';const _='Pattern gallery';function T(e,t){const n=String(e||'').trim(),r=String(t||'').trim();return r&&n.endsWith(` \xb7 ${r}`)?n.slice(0,-(r.length+3)):n}const E=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];function O(e){const t=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?/.exec(String(e||''));if(!t)return'';const n=`${Number(t[3])} ${E[Number(t[2])-1]} ${t[1]}`;return t[4]?`${n} ${t[4]}:${t[5]}`:n}const v='Choose a strategy in scanner A or B to see its setups as charts.',P=e=>`Scanner ${e} is showing History. The gallery draws the setups on its Now list.`,A='Current setups are unavailable right now, so no charts are drawn. This is not the same as no setups.',$='These charts could not be loaded.',w='Chart unavailable',S='Loading setups\u2026',M=(e,t)=>`Showing the first ${e} of ${t} setups as charts. The list above has all of them.`,j=e=>`Show ${e} more`,x=48,C=4;const N=(e,t)=>Math.floor(e/Math.max(1,t));const L=(e,t)=>`/api/chart?symbol=${encodeURIComponent(e)}&timeframe=${encodeURIComponent(t)}`,I=(e,t)=>`${e}|${t}`},1008,[1009]); 1102__d(function(g,r,_i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TILE_BARS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"TILE_BARS_MAX",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"FORMATION_PAD",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"NOTE_NO_CANDLES",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"NOTE_OTHER_CHART",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"NOTE_NO_EPISODE",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"NOTE_TOO_LONG",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"NOTE_NO_GEOMETRY",{enumerable:!0,get:function(){return m}}),e.rebaseLines=u,e.tileFromChart=function(p,_,y=t){const O={detection:p,evidence:null},A=(t,n)=>({...O,bars:t,lines:[],drawable:!1,geometry_note:n});if(_&&(_.symbol&&_.symbol!==p.symbol||_.timeframe&&p.timeframe&&_.timeframe!==p.timeframe))return A(h,s);const E=(Array.isArray(_?.bars)?_.bars:[]).filter(t=>t&&f(t.open)&&f(t.high)&&f(t.low)&&f(t.close)&&'string'==typeof t.time),w=E.length;if(!w)return A(h,o);const M=Math.max(1,Math.min(n,Math.floor(f(y)?y:t))),N=()=>b(E.slice(Math.max(0,w-M))),T=p.detection_id,P=T&&(Array.isArray(_?.matches)?_.matches:[]).find(t=>t&&t.detection_id===T)||null;
1102if(!P)return A(N(),c);const v=(P.lines||[]).filter(t=>t&&Array.isArray(t.points)&&t.points.length>0).flatMap(t=>t.points.map(t=>t.index)).filter(f);if(!1===p.drawable||!1===P.drawable||!v.length)return A(N(),P.geometry_note||p.geometry_note||m);if(v.some(t=>t<0||t>=w))return A(N(),c);const j=Math.min(...v,...f(P.start_index)?[P.start_index]:[]);if(j<w-n)return A(N(),l);const x=Math.min(w,n,Math.max(M,w-j+i)),R=w-x;return{...O,bars:b(E.slice(R)),lines:u(P.lines,R),drawable:!0,geometry_note:null}};const t=120,n=260,i=5,o='no candles were served for this stock',s='the chart served is for a different stock or timeframe, so it is not shown',c='this detection is not in the chart the scanner served, so no lines are drawn',l=`the formation starts more than ${n} candles back, beyond what a tile shows`,m='this detector publishes no drawable structure for this event';function u(t,n){return(t||[]).map(t=>({...t,points:(t.points||[]).map(t=>({...t,index:t.index-n}))}))}const f=t=>'number'==typeof t&&Number.isFinite(t);function b(t){return{t:t.map(t=>String(t.time)),o:t.map(t=>t.open),h:t.map(t=>t.high),l:t.map(t=>t.low),c:t.map(t=>t.close),v:t.map(t=>f(t.volume)?t.volume:null)}}const h={t:[],o:[],h:[],l:[],c:[],v:[]}},1009,[]); 1103__d(function(g,_r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VERDICT_TITLES",{enumerable:!0,get:function(){return n.VERDICT_TITLES}}),Object.defineProperty(e,"verdictTone",{enumerable:!0,get:function(){return n.verdictTone}}),Object.defineProperty(e,"NO_RULE_BADGE",{enumerable:!0,get:function(){return n.NO_RULE_BADGE}}),Object.defineProperty(e,"RANKED_LUCK_LINE",{enumerable:!0,get:function(){return n.RANKED_LUCK_LINE}}),Object.defineProperty(e,"SHORT_STUDY_LINE",{enumerable:!0,get:function(){return n.SHORT_STUDY_LINE}}),Object.defineProperty(e,"backtestRunLine",{enumerable:!0,get:function(){return n.backtestRunLine}}),Object.defineProperty(e,"labelDate",{enumerable:!0,get:function(){return n.labelDate}}),Object.defineProperty(e,"SORT_LABELS",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"CARD_H",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"GRID_H",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"COST_LINE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"HOLD_LABEL",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"TESTED_LABEL",{enumerable:!0,get:function(){return i}}),e.sortRows=function(t,n){return[...t].sort((t,r)=>{if('symbol'===n)return t.symbol.localeCompare(r.symbol)||t.timeframe.localeCompare(r.timeframe);return('n'===n?(r.n||0)-(t.n||0):c(a('low'===n?t.low_pct:t.avg_pct),a('low'===n?r.low_pct:r.avg_pct)))||(r.n||0)-(t.n||0)||t.symbol.localeCompare(r.symbol)})},Object.defineProperty(e,"isSortKey",{enumerable:!0,get:function(){return d}}),e.rowSampleNote=function(t){return'Small sample'===t.sample_label||'No history'===t.sample_label?t.sample_label:''},e.statusText=function(t,n=!1){const r=n?t.date.replace(/\s+\d{4}$/,''):t.date;return'idle'===t.phase?'Choose a strategy to list stocks.':'loading'===t.phase?'Loading stored scan\u2026':'stopped'===t.phase?n?'Stopped before loading.':'Stopped before the stored scan loaded.':'error'===t.phase?n?'Results unavailable.':'Strategy results are unavailable right now.':t.found?t.revealing?n?`Loading\u2026 ${t.shown} found`:`Loading stored scan\u2026 ${t.shown} found`:n?`Stored \xb7 ${t.universe} \xb7 to ${r} \xb7 ${t.found} found`:`Stored scan \xb7 ${t.universe} \xb7 data to ${t.date} \xb7 ${t.found} found`:n?`Stored \xb7 ${t.universe} \xb7 to ${r} \xb7 none match`:`No ${t.universe} stock matches this strategy on data to ${t.date}.`},e.pickerTag=function(n){return`${n.found} found \xb7 95% low ${(0,t.pct)(n.best_low_pct)}`},Object.defineProperty(e,"CHIP_ORDER",{enumerable:!0,get:function(){return f}}),e.pickerChips=function(t){const n=new Set(t.flatMap(t=>t.tags||[])),r=f.filter(t=>n.has(t)),o=[...n].filter(t=>!f.includes(t)).sort();return['All',...r,...o,'Recently used']},e.filterStrategies=function(n,r,o,l){const s=(0,t.searchText)(r||'').split(' ').filter(
1103Boolean),u=n.filter(n=>('All'===o||('Recently used'===o?l.includes(n.key):(n.tags||[]).includes(o)))&&s.every(r=>(0,t.searchText)(`${n.name} ${n.pattern_name} ${n.timeframe} ${n.side} ${(n.tags||[]).join(' ')}`).includes(r)));return'Recently used'===o?u.sort((t,n)=>l.indexOf(t.key)-l.indexOf(n.key)):u},e.pushRecent=function(t,n,r=6){return[n,...(t||[]).filter(t=>t!==n)].slice(0,r)},e.defaultSlots=function(t){const n=[...t].filter(t=>!1!==t.enabled).sort((t,n)=>t.order-n.order),r=n.find(t=>'A'===t.default_slot)?.key??n[0]?.key??null,o=n.find(t=>t.key===r),l=n.filter(t=>t.key!==r),s=l.filter(t=>t.found>0&&(!o||t.side===o.side)).sort((t,n)=>c(a(t.best_low_pct),a(n.best_low_pct)))[0],u=l.find(t=>'B'===t.default_slot)?.key??s?.key??l[0]?.key??null;return{A:r,B:u}},e.resolveSlot=function(t,n,r){return null===t?null:t&&r.some(n=>n.key===t&&!1!==n.enabled)?t:n},e.gridMode=function(t,n){return t<760?'stack':'4'===n?'four':'2'===n?'two':t>=1280?'four':'two'},e.revealStep=function(t){return Math.max(1,Math.ceil(t/40))},e.verdictFor=function(t,n,r){const o=t?.n||0,l=a(t?.expectancy_pct),s=t?.expectancy_ci95;return o>=5&&Array.isArray(s)&&null!=a(s[1])&&s[1]<0?'pass':o>=Math.max(1,n)&&null!=l?l<=0?'pass':'tested_rule'===r?'review':'history':'watch'},e.backtestBadges=function(t,r){const o=[];'no_validated_rule'===t?.status&&o.push(n.NO_RULE_BADGE);'short'===r&&o.push(n.SHORT_STUDY_LINE);return o},e.backtestFootnotes=function(t){return[(0,n.backtestRunLine)(t),n.RANKED_LUCK_LINE]},e.backtestView=function(t){return'tested'===t?.status&&(t.splits?.test?.n||0)>0?{basis:'tested_rule',stats:t.splits.test,trades:(t.trades||[]).filter(t=>'test'===t.split),label:i,rule:t.rule_description||''}:(t?.reference?.n||0)>0?{basis:'hold_period_history',stats:t.reference,trades:t.reference_trades||[],label:u,rule:t.reference.description||''}:{basis:'none',stats:null,trades:[],label:'',rule:''}},e.tradeSummary=function(t){const n=[...t||[]].filter(t=>Number.isFinite(t?.net_return_pct)).sort((t,n)=>String(t.entry_time||'').localeCompare(String(n.entry_time||'')));let r=0;const o=n.map(t=>r+=t.net_return_pct),l=n.map(t=>t.holding_bars).filter(t=>Number.isFinite(t));return{list:n,curve:o,worst:n.length?Math.min(...n.map(t=>t.net_return_pct)):null,avgHold:l.length?l.reduce((t,n)=>t+n,0)/l.length:null,total:n.length?r:null}},e.holdShort=function(t,n){if(null==t||!Number.isFinite(t))return'\u2014';const r=t.toFixed(1);return'1D'===n?`${r}d`:'1W'===n?`${r}w`:`${r} \xd7 ${n}`},e.holdText=function(t,n){if(null==t||!Number.isFinite(t))return'\u2014';const r=t.toFixed(1);return'1D'===n?`${r} trading days`:'1W'===n?`${r} weeks`:`${r} \xd7 ${n} candles`};var t=_r(_d[0]),n=_r(_d[1]);const r={low:'95% low',avg:'Avg',n:'n',symbol:'Symbol'},o=420,l=460,s='Costs 0.40% included \xb7 next-open entry',u='Pattern hold-period history \u2014 not a tested exit rule',i='Tested exit rule \xb7 later-test (out-of-sample)',a=t=>null!=t&&Number.isFinite(t)?t:null,c=(t,n)=>null==t&&null==n?0:null==t?1:null==n?-1:n-t;const d=t=>'low'===t||'avg'===t||'n'===t||'symbol'===t;const f=['Chart patterns','Bullish','Bearish','1H','4H','1D','1W']},1010,[197,250]); 1104__d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.linkFromRow=function(t,n,o){const d=o.match_id?.split(':')[2]||n.pattern;return{slot:t,strategyKey:n.key,strategyName:n.name,symbol:o.symbol,company:o.company,timeframe:o.timeframe||n.timeframe,side:o.side||n.side,matchId:o.match_id,pattern:d,patternName:n.pattern_name,dataEnd:o.candle_end}},e.linkFromDetection=function(t,n,o){return{slot:t,strategyKey:n.key,strategyName:n.name,symbol:o.symbol,company:o.company||o.symbol,timeframe:o.timeframe,side:o.side,matchId:o.match_id,pattern:o.pattern_id,patternName:o.pattern_name||n.pattern_name,dataEnd:o.as_of,detectionId:o.detection_id,detectionState:o.state,detectedAt:o.detected_at,drawable:!1!==o.drawable,geometryNote:o.geometry_note||null,evidenceCompatible:!1!==o.evidence_compatible,evidenceNote:o.evidence?.note||null}},e.linkKey=function(t){if(!t)return'';const o=(0,n.evidenceKey)({symbol:t.symbol,pattern:t.pattern,timeframe:t.timeframe,side:t.side,rule:t.strategyKey,dataEnd:t.dataEnd}
1104)||['lk1',t.strategyKey,t.symbol,t.timeframe,t.side,t.matchId].map(t=>encodeURIComponent(t||'')).join('|');return t.detectionId?`${o}|d:${encodeURIComponent(t.detectionId)}`:o},e.sameRow=function(t,n,o,d){return!!t&&t.slot===n&&t.strategyKey===o&&t.symbol===d.symbol&&t.timeframe===d.timeframe},e.useBlockLinks=function(){const[n,o]=(0,t.useState)({}),d=(0,t.useCallback)((t,n)=>o(o=>o[t]===n?o:{...o,[t]:n}),[]);return{links:n,setLink:d}};var t=r(_d[0]),n=r(_d[1])},1011,[11,251]); 1105__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseDiscoverParams=function(t){const o=c(t?.b),a=c(t?.a),b=c(t?.bb),p=s(t?.s).toUpperCase(),l=n.test(p)?p:'',u='B'===s(t?.sel).toUpperCase()?'B':'A';return o||a||b||l?{block:o,a:a,bb:b,sel:u,symbol:l,sig:[o,a,b,u,l].join('|')}:null},Object.defineProperty(e,"paramsSig",{enumerable:!0,get:function(){return a}}),e.discoverHref=function(t){const n=[['b',t.block],['a',t.a],['bb',t.bb],['sel',t.sel],['s',t.symbol]].filter(([,t])=>!!t).map(([t,n])=>`${t}=${encodeURIComponent(n)}`);return'/discover'+(n.length?'?'+n.join('&'):'')},e.chartHref=function(t,s,c,a,b){const p=(t||'').toUpperCase(),l=(s||'').toUpperCase();return n.test(p)&&o.test(l)?`/chart?s=${encodeURIComponent(p)}&tf=${encodeURIComponent(l)}${c?`&m=${encodeURIComponent(c)}`:''}${a?`&tab=${encodeURIComponent(a)}`:''}${c&&b?`&d=${encodeURIComponent(b)}`:''}`:''};const t=/^[A-Za-z0-9_.:-]{1,80}$/,n=/^[A-Z0-9][A-Z0-9&._-]{0,39}$/,o=/^[0-9]{1,3}[A-Z]{1,2}$/,s=t=>{const n=Array.isArray(t)?t[0]:t;return'string'==typeof n?n.trim():''},c=n=>{const o=s(n);return t.test(o)?o:''};const a=t=>['b','a','bb','sel','s'].map(n=>s(t?.[n])).join('|')},1012,[]); 1106__d(function(g,_r,i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BLOCK_RENDERERS",{enumerable:!0,get:function(){return j}}),_e.renderersFor=R,_e.LinkedCard=I,_e.Block=function(e){return(0,p.uxPreview)((0,f.useAuth)()?.config)?(0,S.jsx)(_,{...e}):(0,S.jsx)(w,{...e})};var t=_r(_d[0]),l=e(_r(_d[1])),s=e(_r(_d[2])),o=_r(_d[3]),n=_r(_d[4]),r=_r(_d[5]),a=_r(_d[6]),c=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),y=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),p=_r(_d[14]),k=_r(_d[15]),x=_r(_d[16]),S=_r(_d[17]);const C=268,v={chart:c.ChartCard,backtest:u.EvidenceCard},j={chart:{chart:c.ChartCard,backtest:d.BacktestCard},candlestick:v,price_action:v,harmonic:v};function R(e){return(e.strategies||[]).some(e=>'research_pattern'===e.source_type)?v:j[e.kind]}function I({kind:e,which:t,blockTitle:l,renderers:s,...o}){const n=(s||j[e])?.[t];return n?(0,S.jsx)(n,{...o}):(0,S.jsx)(b.ComingSoonCard,{title:'chart'===t?'Chart':'Backtest',detail:`${'chart'===t?'Charts':'Backtests'} for ${l} are coming soon.`,style:o.style})}function w({block:e,index:d,catalog:u,mode:f,deep:p,refreshSeq:k,link:x,setLink:v,onOpenSheet:j,onLayoutY:w}){const{setActive:_}=(0,r.useActiveSymbol)(),D=(0,t.useMemo)(()=>e.strategies.filter(e=>!1!==e.enabled).sort((e,t)=>e.order-t.order),[e.strategies]),H=(0,t.useMemo)(()=>(0,h.defaultSlots)(D),[D]),L=`slots.${e.key}`,O=`block.${e.key}`,[B,A]=(0,t.useState)(()=>(0,n.readStore)('discover',L)),F=!!e.superseded,[T,$]=(0,t.useState)(()=>!!(0,n.readStore)('discover',O).collapsed),[E,P]=(0,t.useState)(0),[G,M]=(0,t.useState)(!1),z=(0,t.useRef)(null),K=e=>{(0,n.writeStore)('discover',L,e),A(e)},W=e=>(0,h.resolveSlot)(B[e],H[e],D),q=e=>e&&D.find(t=>t.key===e)||null,Y=(t,l)=>{K({...B,[t]:l}),null===l&&x?.slot===t&&v(e.key,null)},N=()=>$(e=>((0,n.writeStore)('discover',O,{collapsed:!e}),!e)),V=(0,t.useRef)('');(0,t.useEffect)(()=>{if(!p||V.current===p.sig||!D.length)return;V.current=p.sig;const e={...B};p.a&&q(p.a)&&(e.A=p.a),p.bb&&q(p.bb)&&(e.B=p.bb),K(e),T&&N()},[p?.sig,D]);const J=t=>(l,s)=>{v(e.key,(0,y.linkFromRow)(t,s,l)),_({symbol:l.symbol,timeframe:l.timeframe,matchId:l.match_id,side:l.side,source:'discover'}),'stack'===f&&j(e.key)},Q=e=>(t,l)=>(0,c.openChart)((0,y.linkFromRow)(e,l,t)),U=t=>(l,s)=>{v(e.key,(0,y.linkFromDetection)(t,s,l)),_({symbol:l.symbol,timeframe:l.timeframe,matchId:l.match_id,side:l.side,source:'discover'}),'stack'===f&&j(e.key)},X=e=>(t,l)=>(0,c.openChart)((0,y.linkFromDetection)(e,l,t)),Z=b.BLOCK_COLORS[d%b.BLOCK_COLORS.length],ee={stale:u.stale,ageDays:u.age_days},te=q(x?.strategyKey??null)?.min_trades??10,le=(t,l)=>{const s=W(t);return(0,S.jsx)(a.ScannerCard,{blockKey:e.key,slot:t,strategy:q(s),strategies:D,universeKey:u.universe?.key||'nifty500',universeLabel:u.universe?.label||'NIFTY 500',link:x,refreshSeq:k,resetSeq:E,autoSelect:p?.symbol&&p.sel===t?{symbol:p.symbol,sig:p.sig}:null,unavailable:e.unavailable||null,onChoose:e=>Y(t,e),onSelect:J(t),onOpenFull:Q(t),onSelectDetection:U(t),onOpenDetection:X(t),selectedDetectionId:x?.slot===t?x?.detectionId??null:null,style:l},t)},se=(0,t.useMemo)(()=>R(e),[e]),oe=(t,l)=>(0,S.jsx)(I,{kind:e.kind,renderers:se,which:t,blockTitle:e.title,link:x,style:l,minTrades:te,color:Z,...ee},t);if(F)return null;let ne;return ne=D.length?'four'===f?(0,S.jsxs)(l.default,{style:[o.s.row,{alignItems:'stretch',gap:12}],children:[le('A',{flex:.95,minWidth:C,height:h.GRID_H}),le('B',{flex:.95,minWidth:C,height:h.GRID_H}),oe('chart',{flex:1.45,height:h.GRID_H}),oe('backtest',{flex:1.25,height:h.GRID_H})]}):'two'===f?(0,S.jsxs)(l.default,{style:{gap:12},children:[(0,S.jsxs)(l.default,{style:[o.s.row,{alignItems:'stretch',gap:12}],children:[le('A',{flex:1,height:h.GRID_H}),le('B',{flex:1,height:h.GRID_H})]}),(0,S.jsxs)(l.default,{style:[o.s.row,{alignItems:'stretch',gap:12}],children:[oe('chart',{flex:1,height:h.GRID_H}),oe('backtest',{flex:1,height:h.GRID_H})]})]}):(0,S.jsxs)(l.default,{style:{gap:12},children:[le('A',{height:h.CARD_H}),le('B',{height:h.CARD_H}),x?(0,S.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Show chart and backtest for ${x.symbol}`,onPress:()=>j(e.key),style:e=>[o.s.row,{gap:8,minHeight:44,paddingHorizontal:12,borderRadius:10,borderWidth:1,borderColor:o.C.green,backgroundColor:e.pressed?o.C.soft:'transparent'}],children:[(0,S.jsx)(o.Icon,{name:"bar-chart-2",size:15,color:o.C.green}),(0,S.jsxs)(o.T,{style:{fontSize:13,fontFamily:'InterSemi',color:o.C.green},children:["Chart & backtest \xb7 ",x.symbol]})]}):(0,S.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Tap a stock to open its chart and backtest."})]}
1106):(0,S.jsx)(b.ComingSoonCard,{title:e.title,detail:"Strategies for this block are coming soon.",style:{height:160}}),(0,S.jsxs)(l.default,{onLayout:t=>w(e.key,t.nativeEvent.layout.y),role:"region","aria-label":e.title,style:{gap:10},children:[(0,S.jsxs)(l.default,{style:[o.s.row,{gap:10,minHeight:44}],children:[(0,S.jsx)(l.default,{"aria-hidden":!0,style:{width:10,height:10,borderRadius:5,backgroundColor:Z}}),(0,S.jsxs)(l.default,{style:{flex:1,minWidth:0},children:[(0,S.jsx)(o.T,{role:"heading","aria-level":2,numberOfLines:1,style:{fontFamily:'ManropeBold',fontSize:17,lineHeight:23},children:e.title}),!!e.description&&(0,S.jsx)(o.T,{numberOfLines:'stack'===f?1:2,style:{fontSize:12,lineHeight:17,color:o.C.muted},children:e.description})]}),(0,S.jsx)(n.IconButton,{icon:T?'chevron-down':'chevron-up',label:`${T?'Expand':'Collapse'} ${e.title}`,tooltip:T?'Expand':'Collapse',expanded:!T,onPress:N}),(0,S.jsx)(n.IconButton,{ref:z,icon:"more-vertical",label:`${e.title} options`,tooltip:"Options",haspopup:"menu",expanded:G,onPress:()=>M(!0)})]}),!T&&ne,(0,S.jsx)(n.Popover,{open:G,onClose:()=>M(!1),anchor:z,placement:"bottom-end",label:`${e.title} options`,role:"none",width:220,children:(0,S.jsx)(n.MenuList,{label:`${e.title} options`,onClose:()=>M(!1),items:[{label:'Reset block',icon:'rotate-ccw',onPress:()=>{K({}),v(e.key,null),P(e=>e+1),T&&N()}},{label:T?'Expand':'Collapse',icon:T?'chevron-down':'chevron-up',onPress:N}]})})]})}function _({block:e,index:d,catalog:u,mode:f,deep:p,refreshSeq:v,link:j,setLink:w,onOpenSheet:_,onLayoutY:D}){const{setActive:H}=(0,r.useActiveSymbol)(),L=(0,t.useMemo)(()=>e.strategies.filter(e=>!1!==e.enabled).sort((e,t)=>e.order-t.order),[e.strategies]),O=(0,t.useMemo)(()=>(0,h.defaultSlots)(L),[L]),B=`slots.${e.key}`,A=`block.${e.key}`,F=`gallery.${e.key}`,[T,$]=(0,t.useState)(()=>(0,n.readStore)('discover',B)),E=!!e.superseded,[P,G]=(0,t.useState)(()=>!!(0,n.readStore)('discover',A).collapsed),[M,z]=(0,t.useState)(0),[K,W]=(0,t.useState)(!1),q=(0,t.useRef)(null),[Y,N]=(0,t.useState)(()=>{const e=(0,n.readStore)('discover',F).slot;return(0,x.isSlot)(e)?e:'A'}),V=e=>{e!==Y&&(N(e),(0,n.writeStore)('discover',F,{slot:e}))},[J,Q]=(0,t.useState)(x.EMPTY_FILTER),U=(0,t.useCallback)(e=>(0,x.applyFilter)(e,J),[J]),[X,Z]=(0,t.useState)({}),ee=(0,t.useCallback)(e=>Z(t=>({...t,A:e})),[]),te=(0,t.useCallback)(e=>Z(t=>({...t,B:e})),[]),[le,se]=(0,t.useState)({}),oe=(0,t.useCallback)(e=>se(t=>({...t,A:e})),[]),ne=(0,t.useCallback)(e=>se(t=>({...t,B:e})),[]),re=(0,t.useRef)(null),ie=e=>{(0,n.writeStore)('discover',B,e),$(e)},ae=e=>(0,h.resolveSlot)(T[e],O[e],L),ce=e=>e&&L.find(t=>t.key===e)||null,de=(t,l)=>{ie({...T,[t]:l}),null!==l&&V(t),null===l&&j?.slot===t&&w(e.key,null)},ue=()=>G(e=>((0,n.writeStore)('discover',A,{collapsed:!e}),!e)),he=(0,t.useRef)('');(0,t.useEffect)(()=>{if(!p||he.current===p.sig||!L.length)return;he.current=p.sig;const e={...T};p.a&&ce(p.a)&&(e.A=p.a),p.bb&&ce(p.bb)&&(e.B=p.bb),ie(e),P&&ue()},[p?.sig,L]);const ye=t=>(l,s)=>{V(t),w(e.key,(0,y.linkFromRow)(t,s,l)),H({symbol:l.symbol,timeframe:l.timeframe,matchId:l.match_id,side:l.side,source:'discover'}),'stack'===f&&_(e.key)},be=e=>(t,l)=>(0,c.openChart)((0,y.linkFromRow)(e,l,t)),ge=t=>(l,s)=>{V(t),w(e.key,(0,y.linkFromDetection)(t,s,l)),H({symbol:l.symbol,timeframe:l.timeframe,matchId:l.match_id,side:l.side,source:'discover'}),'stack'===f&&_(e.key)},me=e=>(t,l)=>(0,c.openChart)((0,y.linkFromDetection)(e,l,t)),fe=b.BLOCK_COLORS[d%b.BLOCK_COLORS.length],pe={stale:u.stale,ageDays:u.age_days},ke=ce(j?.strategyKey??null)?.min_trades??10,xe=(t,l)=>{const s=ae(t);return(0,S.jsx)(a.ScannerCard,{blockKey:e.key,slot:t,strategy:ce(s),strategies:L,universeKey:u.universe?.key||'nifty500',universeLabel:u.universe?.label||'NIFTY 500',link:j,refreshSeq:v,resetSeq:M,autoSelect:p?.symbol&&p.sel===t?{symbol:p.symbol,sig:p.sig}:null,unavailable:e.unavailable||null,onChoose:e=>de(t,e),onSelect:ye(t),onOpenFull:be(t),onSelectDetection:ge(t),onOpenDetection:me(t),selectedDetectionId:j?.slot===t?j?.detectionId??null:null,style:l,rowFilter:U,onLiveRows:'A'===t?ee:te,onStoredRows:'A'===t?oe:ne},t)},Se=(0,t.useMemo)(()=>R(e),[e]),Ce=(t,l)=>(0,S.jsx)(I,{kind:e.kind,renderers:Se,which:t,blockTitle:e.title,link:j,style:l,minTrades:ke,color:fe,...pe},t),ve=e=>(0,S.jsx)(l.default,{ref:re,style:e,children:Ce('chart',{flex:1})},"chart");if(E)return null;let je;je=L.length?'four'===f?(0,S.jsxs)(l.default,{style:[o.s.row,{alignItems:'stretch',gap:12}],children:[xe('A',{flex:.95,minWidth:C,height:h.GRID_H}),xe('B',{flex:.95,minWidth:C,height:h.GRID_H}),ve({flex:1.45,height:h.GRID_H}),Ce('backtest',{flex:1.25,height:h.GRID_H})]}):'two'===f?(0,S.jsxs)(l.default,{style:{gap:12},children:[(0,S.jsxs)(l.default,{style:[o.s.row,{alignItems:'stretch',gap:12}],children:[xe('A',{flex:1,height:h.GRID_H}),xe('B',{flex:1,height:h.GRID_H})]}),(0,S.jsxs)(l.default,{style:[o.s.row,{alignItems:'stretch',gap:12}],children:[ve({flex:1,height:h.GRID_H}),Ce('backtest',{flex:1,height:h.GRID_H})]})]}):(0,S.jsxs)(l.default,{style:{gap:12},children:[xe('A',{height:h.CARD_H}),xe('B',{height:h.CARD_H}),j?(0,S.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Show chart and backtest for ${j.symbol}`,onPress:()=>_(e.key),style:e=>[o.s.row,{gap:8,minHeight:44,paddingHorizontal:12,borderRadius:10,borderWidth:1,borderColor:o.C.green,backgroundColor:e.pressed?o.C.soft:'transparent'}],children:[(0,S.jsx)(o.Icon,{name:"bar-chart-2",size:15,color:o.C.green}),(0,S.jsxs)(o.T,{style:{fontSize:13,fontFamily:'InterSemi',color:o.C.green},children:["Chart & backtest \xb7 ",j.symbol]})]}):(0,S.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Tap a stock to open its chart and backtest."})]}
1106):(0,S.jsx)(b.ComingSoonCard,{title:e.title,detail:"Strategies for this block are coming soon.",style:{height:160}});const Re=(0,x.followSlot)(Y,!!ae('A'),!!ae('B')),Ie=ce(ae(Re)),we=L.length?(0,S.jsx)(k.PatternGallery,{slot:Re,strategy:Ie,strategies:L,universeLabel:u.universe?.label||'NIFTY 500',snapshot:X[Re]||null,filter:J,onFilter:Q,onChooseStrategy:e=>de(Re,e),selectedId:j?.slot===Re?j?.detectionId??null:null,refreshSeq:v,stale:u.stale,ageDays:u.age_days,onSelect:e=>{Ie&&(ge(Re)(e,Ie),'stack'!==f&&b.web&&setTimeout(()=>re.current?.scrollIntoView?.({block:'nearest',behavior:'smooth'}),0))},onOpenFull:e=>{Ie&&me(Re)(e,Ie)},storedSnapshot:le[Re]||null,isStoredSelected:e=>(0,y.sameRow)(j,Re,Ie?.key??null,e)&&!j?.detectionId,onSelectStored:e=>{Ie&&(ye(Re)(e,Ie),'stack'!==f&&b.web&&setTimeout(()=>re.current?.scrollIntoView?.({block:'nearest',behavior:'smooth'}),0))},onOpenStored:e=>{Ie&&be(Re)(e,Ie)}}):null;return(0,S.jsxs)(l.default,{onLayout:t=>D(e.key,t.nativeEvent.layout.y),role:"region","aria-label":e.title,style:{gap:10},children:[(0,S.jsxs)(l.default,{style:[o.s.row,{gap:10,minHeight:44}],children:[(0,S.jsx)(l.default,{"aria-hidden":!0,style:{width:10,height:10,borderRadius:5,backgroundColor:fe}}),(0,S.jsxs)(l.default,{style:{flex:1,minWidth:0},children:[(0,S.jsx)(o.T,{role:"heading","aria-level":2,numberOfLines:1,style:{fontFamily:'ManropeBold',fontSize:17,lineHeight:23},children:e.title}),!!e.description&&(0,S.jsx)(o.T,{numberOfLines:'stack'===f?1:2,style:{fontSize:12,lineHeight:17,color:o.C.muted},children:e.description})]}),(0,S.jsx)(n.IconButton,{icon:P?'chevron-down':'chevron-up',label:`${P?'Expand':'Collapse'} ${e.title}`,tooltip:P?'Expand':'Collapse',expanded:!P,onPress:ue}),(0,S.jsx)(n.IconButton,{ref:q,icon:"more-vertical",label:`${e.title} options`,tooltip:"Options",haspopup:"menu",expanded:K,onPress:()=>W(!0)})]}),!P&&je,!P&&we,(0,S.jsx)(n.Popover,{open:K,onClose:()=>W(!1),anchor:q,placement:"bottom-end",label:`${e.title} options`,role:"none",width:220,children:(0,S.jsx)(n.MenuList,{label:`${e.title} options`,onClose:()=>W(!1),items:[{label:'Reset block',icon:'rotate-ccw',onPress:()=>{ie({}),w(e.key,null),z(e=>e+1),Q(x.EMPTY_FILTER),N('A'),(0,n.writeStore)('discover',F,{}),P&&ue()}},{label:P?'Expand':'Collapse',icon:P?'chevron-down':'chevron-up',onPress:ue}]})})]})}},1013,[11,13,375,821,871,251,1014,1017,1018,1019,1010,1011,925,198,881,1024,1008,6]); 1107__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ScannerCard=function({blockKey:e,slot:T,strategy:R,strategies:_,universeKey:L,universeLabel:$,link:z,refreshSeq:H,resetSeq:I,autoSelect:O,onChoose:E,onSelect:P,onOpenFull:F,onSelectDetection:N,onOpenDetection:D,selectedDetectionId:M,unavailable:A,style:W,rowFilter:B,onLiveRows:V,onStoredRows:K}){const U=`card.${e}.${T}`,G=R?.key??null,q='research_pattern'===R?.source_type,X=q?p.RESEARCH_COLUMNS:p.STORED_COLUMNS,[J,Q]=(0,t.useState)(()=>{const e=(0,c.readStore)('discover',U).sort;return(0,f.isSortKey)(e)?e:'low'}),Y=e=>{Q(e),(0,c.writeStore)('discover',U,{sort:e,mode:ne})},Z=(0,t.useRef)(I);(0,t.useEffect)(()=>{I!==Z.current&&(Z.current=I,Q('low'),(0,c.writeStore)('discover',U,{}))},[I]);const ee=(0,h.useStrategyResults)(G,L,H),te=ee.data?.live??null,se=q&&(ee.data?(0,p.liveAvailable)(te):!0===R?.live_detection),[ne,oe]=(0,t.useState)(()=>'history'===(0,c.readStore)('discover',U).mode?'history':'live'),le=se?(0,p.resolveListMode)(ne,te):'history',ae=e=>{oe(e),(0,c.writeStore)('discover',U,{sort:J,mode:e})},ie=(0,h.useLiveDetections)(G,'live',H,se&&'live'===le),re=ie.data?.rows||[],de=ie.data?.total??0,ce=(0,t.useMemo)(()=>B?B(re):re,[ie.data,B]),he=(0,p.latestSession)(ie.data?.live||te,R?.timeframe);(0,t.useEffect)(()=>{V&&V({slot:T,strategyKey:G,listMode:le,canLive:!!se,phase:ie.phase,rows:ce,allRows:re,total:de,session:he,asOf:ie.data?.live?.as_of??te?.as_of??null,error:ie.error,errorCode:null,liveOff:se?null:(0,p.liveOffText)(te),reload:ie.reload})},[V,T,G,le,se,ie.phase,ie.data,ie.error,ie.reload,ce,he,te]);const[ue,fe]=(0,t.useState)(!1);(0,t.useEffect)(()=>{i.default.isReduceMotionEnabled().then(fe).catch(()=>{})},[]);const[ge,pe]=(0,t.useState)({data:null,shown:0,stopped:!1});(0,t.useEffect)(()=>{const e=ee.data;if(!e)return void pe({data:null,shown:0,stopped:!1});const t=e.rows.length;if(ue||!t)return void pe({data:e,shown:t,stopped:!1});pe({data:e,shown:0,stopped:!1});const s=(0,f.revealStep)(t);let n=0;const o=setInterval(()=>{n=Math.min(t,n+s),pe(t=>t.data!==e||t.stopped?t:{...t,shown:n}),n>=t&&clearInterval(o)},25);return()=>clearInterval(o)},[ee.data,ue]);const ye=(0,t.useMemo)(()=>(0,f.sortRows)(ee.data?.rows||[],J),[ee.data,J]);(0,t.useEffect)(()=>{K&&K({slot:T,strategyKey:G,stored:!q,phase:ee.phase,rows:ye,asOf:ee.data?.data_end??null,unavailable:ee.data?.unavailable||A||null,reload:ee.reload})},[K,T,G,q,ee.phase,ee.data,ee.reload,ye,A]);const me=ge.data===ee.data?ge.shown:0,be=ye.slice(0,me),xe=ee.data?ee.data.total??ye.length:0,we='loading'===ee.phase,ve='done'===ee.phase&&me<ye.length&&!ge.stopped,Ce='done'===ee.phase&&me<ye.length&&ge.stopped,Se='live'===le?'loading'===ie.phase:we,je='live'===le?'error'===ie.phase||'stopped'===ie.phase:'error'===ee.phase||'stopped'===ee.phase,ke=be.findIndex(e=>(0,y.sameRow)(z,T,G,e)),Te=(0,c.formatDataDate)(ee.data?.data_end||void 0)||'unknown date',Re=ee.data?.universe?.label||$,[Le,$e]=(0,t.useState)(''),ze=(0,t.useRef)('');(0,t.useEffect)(()=>$e(''),[G]);const He=(0,t.useRef)([]);(0,t.useEffect)(()=>
1107{if(!O||!R||'live'!==le||'done'!==ie.phase||!ie.data)return;const e=O.sig+'|'+R.key+'|live';if(ze.current===e)return;ze.current=e;const t=ce.find(e=>e.symbol===O.symbol);t?($e(''),N?.(t,R)):$e(O.symbol)},[O?.sig,R?.key,le,ie.phase,ie.data,ce]),(0,t.useEffect)(()=>{if(!O||!R||'live'===le||'done'!==ee.phase||!ee.data)return;const e=O.sig+'|'+R.key;if(ze.current===e)return;ze.current=e;const t=ye.findIndex(e=>e.symbol===O.symbol);t<0?$e(O.symbol):($e(''),pe({data:ee.data,shown:ye.length,stopped:!1}),P(ye[t],R),setTimeout(()=>He.current[t]?.scrollIntoView?.({block:'nearest'}),80))},[O?.sig,R?.key,le,ee.phase,ee.data,ye]);const Ie=(0,t.useRef)(new l.default.Value(0)).current;(0,t.useEffect)(()=>{if(!Se||ue)return;Ie.setValue(0);const e=l.default.loop(l.default.timing(Ie,{toValue:1,duration:1100,easing:a.default.inOut(a.default.ease),useNativeDriver:!1}));return e.start(),()=>e.stop()},[Se,ue]);const[Oe,Ee]=(0,t.useState)(!1),[Pe,Fe]=(0,t.useState)(!1),[Ne,De]=(0,t.useState)(!1),Me=(0,h.useBacktestRun)(Ne&&!q),Ae=(0,t.useRef)(null),We=(0,t.useRef)(null),Be=(0,t.useRef)(null),Ve=(0,t.useRef)(null),[Ke,Ue]=(0,t.useState)(Ae),Ge=e=>{Ue(e),Ee(!0)},qe=e=>{const t=be[e];t&&R&&(P(t,R),setTimeout(()=>{const t=He.current[e];t?.focus?.(),t?.scrollIntoView?.({block:'nearest'})},0))},Xe=(e,t)=>{const s=t?.key;'ArrowDown'===s||'ArrowUp'===s||'Home'===s||'End'===s?(t.preventDefault?.(),qe('Home'===s?0:'End'===s?be.length-1:Math.max(0,Math.min(be.length-1,e+('ArrowDown'===s?1:-1))))):'Enter'===s&&R&&be[e]&&(t.preventDefault?.(),F(be[e],R))},Je=[{label:'Refresh',icon:'refresh-cw',onPress:ee.reload,disabled:!R},...S.map(e=>({label:`Sort by ${'symbol'===e?f.SORT_LABELS[e]:X[e]}${J===e?' (current)':''}`,icon:J===e?'check':'minus',onPress:()=>Y(e),disabled:!R})),{label:'Open full chart for selected',icon:'maximize-2',disabled:ke<0,onPress:()=>{const e=be[ke];e&&R&&F(e,R)}},{label:'Clear card',icon:'x',danger:!0,disabled:!R,onPress:()=>E(null)}],Qe=`Scanner ${T}`,Ye=(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(n.default,{ref:Ae,accessibilityRole:"button",accessibilityLabel:R?`${Qe}: ${R.name}. Change strategy`:`${Qe}: choose a strategy`,...(0,b.webOnly)({'aria-haspopup':'dialog','aria-expanded':Oe}),onPress:()=>Ge(Ae),style:e=>[r.s.row,{flex:1,minWidth:0,gap:6,minHeight:36,borderRadius:6,paddingHorizontal:4,marginLeft:-4,backgroundColor:e.hovered||e.focused?r.C.soft:'transparent'}],children:[(0,w.jsx)(s.default,{"aria-hidden":!0,style:{width:18,height:18,borderRadius:4,borderWidth:1,borderColor:r.C.line,alignItems:'center',justifyContent:'center'},children:(0,w.jsx)(r.T,{style:{fontSize:10,lineHeight:12,fontFamily:'InterSemi',color:r.C.muted},children:T})}),(0,w.jsx)(r.T,{numberOfLines:2,style:{flexShrink:1,fontFamily:'InterSemi',fontSize:13,lineHeight:16,color:R?r.C.ink:r.C.muted},children:R?R.name:'Choose a strategy'}),(0,w.jsx)(r.Icon,{name:"chevron-down",size:14,color:r.C.muted})]}),(0,w.jsx)(c.IconButton,{ref:Be,icon:"more-vertical",size:14,label:`${Qe} options`,tooltip:"Options",haspopup:"menu",expanded:Pe,onPress:()=>Fe(!0),style:{width:28,height:28}}),!!R&&(0,w.jsx)(c.IconButton,{icon:"x",size:14,label:`Clear ${Qe}`,tooltip:"Clear card",onPress:()=>E(null),style:{width:28,height:28}})]}),[Ze,et]=(0,t.useState)(0),tt=Ze>0&&Ze<400,st={phase:ee.phase,universe:Re,date:Te,found:xe,shown:me,revealing:ve},nt=ee.data,ot={phase:ee.phase,date:Te,researched:xe,shown:me,revealing:ve,live_detection:!!nt?.live_detection,detections_today:nt?.strategy?.detections_today??null,detections_week:nt?.strategy?.detections_week??null,detections_live:nt?.strategy?.detections_live??null,pending:!!nt?.strategy?.evidence_pending},lt=ee.data?.unavailable||A||null,at=ie.data?.strategy||nt?.strategy||R||{},it=at.detections_live??null,rt={phase:ie.phase,total:de,shown:re.length,lastDetected:at.detections_last_detected??null,available:!!se,reason:(0,p.liveOffText)(te)},dt=e=>'live'===le?(0,p.liveStatusText)(rt,e):!lt||'error'!==ee.phase&&xe?q?(0,p.researchStatusText)(ot,e):(0,f.statusText)(st,e):e?'Not in use right now':lt,ct=R?dt(!1):'',ht=R?dt(tt):'',ut=q?(0,p.evidenceCoverageText)(nt?.coverage):null,ft=B&&'live'===le?(0,x.filteredCountText)(ce.length,re.length):'',gt='live'===le?ft?` \xb7 ${ft}`:'':`${Ce?` \xb7 showing ${me}`:''}${Le?` \xb7 ${Le} is not in this list`:''}`,pt=Se||je||'live'!==le&&(ve||Ce),yt=!se||!!ht||!!gt||pt,mt=R?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(c.IconButton,{ref:Ve,icon:"info",size:14,label:`About ${R.name}`,tooltip:"What this strategy is",haspopup:"dialog",expanded:Ne,onPress:()=>De(!0),style:{width:30,height:30}}),(0,w.jsx)(c.IconButton,{icon:"refresh-cw",size:13,label:`Reload ${R.name}`,tooltip:"Reload",disabled:Se,onPress:()=>{ee.reload(),se&&ie.reload()},style:{width:30,height:30}})]}):null,bt={minHeight:28,paddingHorizontal:8,borderRadius:6,justifyContent:'center'};let xt;xt=R&&'live'===le?'error'===ie.phase?(0,w.jsx)(b.CenterNote,{icon:"alert-triangle",text:"No list is shown while current setups are unavailable. This is not the same as no setups."}):'stopped'===ie.phase?(0,w.jsx)(b.CenterNote,{icon:"pause",text:"Stopped. Press \u21bb to load current setups."}):'loading'!==ie.phase&&ie.data?B&&re.length&&!ce.length?(0,w.jsx)(b.CenterNote,{icon:"filter",text:x.FILTERED_OUT_TEXT}):ce.length?(0,w.jsx)(u.LiveList,{rows:ce,total:de,session:he,selectedId:M||null,label:R.name,onSelect:e=>N?.(e,R),onOpenFull:e=>(D||N)?.(e,R)}):(0,w.jsx)(b.CenterNote,{icon:"search",text:ct,children:(0,w.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Show history for ${R.name}`,onPress:()=>ae('history'),style:e=>[{minHeight:32,paddingHorizontal:12,borderRadius:8,borderWidth:1,justifyContent:'center',borderColor:r.C.line,backgroundColor:e.hovered||e.focused?r.C.soft:'transparent'}],children:(0,w.jsx)(r.T,{style:{fontSize:12,fontFamily:'InterSemi',color:r.C.ink},children:"Show history"})})}):(0,w.jsx)(s.default,{"aria-hidden":!0,style:{padding:12,gap:12},children:[0,1,2,3,4,5].map(e=>(0,w.jsxs)(s.default,{style:[r.s.row,{gap:8}],children:[(0,w.jsxs)(s.default,{style:{flex:1,gap:4},children:[(0,w.jsx)(s.default,{style:{height:10,width:'45%',borderRadius:3,backgroundColor:r.C.line}}),(0,w.jsx)(s.default,{style:{height:8,width:'70%',borderRadius:3,backgroundColor:r.C.line,opacity:.6}})]}),(0,w.jsx)(s.default,{style:{width:40,height:10,borderRadius:3,backgroundColor:r.C.line}})]},e))}):R?'error'===ee.phase?(0,w.jsx)(b.CenterNote,{icon:lt?'info':'alert-triangle',text:lt||'No list is shown while results are unavailable. This is not the same as zero matches.'}):'stopped'===ee.phase?(0,w.jsx)(b.CenterNote,{icon:"pause",text:"Stopped. Press \u21bb to load the stored scan."}):we||'done'===ee.phase&&!ee.data?(0,w.jsx)(s.default,{"aria-hidden":!0,style:{padding:12,gap:12},children:[0,1,2,3,4,5].map(e=>(0,w.jsxs)(s.default,{style:[r.s.row,{gap:8}],children:[(0,w.jsxs)(s.default,{style:{flex:1,gap:4},children:[(0,w.jsx)(s.default,{style:{height:10,width:'45%',borderRadius:3,backgroundColor:r.C.line}}),(0,w.jsx)(s.default,{style:{height:8,width:'70%',borderRadius:3,backgroundColor:r.C.line,opacity:.6}})]}),(0,w.jsx)(s.default,{style:{width:40,height:10,borderRadius:3,backgroundColor:r.C.line}})]},e))}):ye.length?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(s.default,{style:[r.s.row,{paddingHorizontal:12,minHeight:24,gap:5}],children:[(0,w.jsx)(r.T,{numberOfLines:1,style:[C,{flex:1,minWidth:0}],children:"Stock"}),(0,w.jsx)(r.T,{numberOfLines:1,style:[C,{width:j.low,textAlign:'right'}],children:X.low}),(0,w.jsx)(r.T,{numberOfLines:1,style:[C,{width:j.avg,textAlign:'right'}],children:X.avg}),(0,w.jsx)(r.T,{numberOfLines:1,style:[C,{width:j.n,textAlign:'right'}],children:X.n})]}),(0,w.jsx)(o.default,{style:{flex:1},contentContainerStyle:{paddingBottom:6},children:(0,w.jsx)(s.default,{"aria-label":`${R.name}: ${xe} stocks`,...(0,b.webOnly)({role:'listbox'}),children:be.map((e,t)=>{const o=t===ke,l=(0,f.rowSampleNote)(e),a=q&&(0,p.rowPending)(e);return(0,w.jsxs)(n.default,{ref:e=>{He.current[t]=e},role:"option","aria-selected":o,accessibilityState:{selected:o},accessibilityLabel:a?`${e.symbol}, ${e.company}. ${p.ROW_PENDING}${o?', selected':''}`:`${e.symbol}, ${e.company}. ${X.low} ${(0,d.pct)(e.low_pct)}, average ${(0,d.pct)(e.avg_pct)} after costs, ${e.n} ${q?'tested trades':'trades'}, ${q?(0,p.plainEvidence)(e.evidence_state):e.sample_label}${o?', selected':''}`,...(0,b.webOnly)({tabIndex:(ke<0?0===t:o)?0:-1,onKeyDown:e=>Xe(t,e)}),onPress:()=>P(e,R),style:e=>[r.s.row,{gap:5,minHeight:44,paddingHorizontal:8,marginHorizontal:3,marginVertical:1,borderRadius:8,borderWidth:1,borderColor:o?r.C.green:'transparent',backgroundColor:o?r.C.soft:e.hovered?r.C.hoverBg:'transparent'},e.focused&&b.web?{outlineStyle:'solid',outlineWidth:2,outlineColor:r.C.mint,outlineOffset:-1}:null],children:[(0,w.jsxs)(s.default,{style:{flex:1,minWidth:0,paddingVertical:3},children:[(0,w.jsx)(r.T,{style:{fontSize:13,lineHeight:17,fontFamily:'InterSemi',color:o?r.C.mint:r.C.ink},children:e.symbol}),(0,w.jsx)(r.T,{style:{fontSize:11,lineHeight:14,color:r.C.muted},children:e.company})]}),a?(0,w.jsx)(s.default,{style:{width:j.low+j.avg+j.n+10,flexShrink:0,alignItems:'flex-end'},children:(0,w.jsx)(r.T,{numberOfLines:1,style:{fontSize:10,lineHeight:16,color:r.C.muted},children:p.ROW_PENDING})}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(r.T,{numberOfLines:1,style:[k,{width:j.low,flexShrink:0,textAlign:'right',fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:v(e.low_pct)}],children:(0,d.pct)(e.low_pct)}),(0,w.jsx)(r.T,{numberOfLines:1,style:[k,{width:j.avg,flexShrink:0,textAlign:'right',fontSize:12,lineHeight:16,color:v(e.avg_pct)}],children:(0,d.pct)(e.avg_pct)}),(0,w.jsxs)(s.default,{style:{width:j.n,flexShrink:0,alignItems:'flex-end'},children:[(0,w.jsx)(r.T,{style:[k,{fontSize:12,lineHeight:16}],children:null==e.n?'\u2014':e.n}),!!l&&(0,w.jsx)(r.T,{numberOfLines:1,style:{fontSize:9,lineHeight:12,color:r.C.amber},children:'Small sample'===l?'small':'none'})]})]})]},e.match_id||`${e.symbol}:${e.timeframe}`)})})})]}):(0,w.jsx)(b.CenterNote,{icon:lt?'info':'search',text:lt||ct}):(0,w.jsx)(b.CenterNote,{icon:"list",text:`Pick one of ${_.length} strategies to list ${$} stocks.`,children:(0,w.jsxs)(n.default,{ref:We,accessibilityRole:"button",accessibilityLabel:`Choose a strategy for ${Qe}`,...(0,b.webOnly)({'aria-haspopup':'dialog','aria-expanded':Oe}),onPress:()=>Ge(We),style:e=>[r.s.row,{gap:6,minHeight:36,paddingHorizontal:14,borderRadius:10,borderWidth:1,borderColor:r.C.green,backgroundColor:e.hovered||e.focused?r.C.soft:'transparent'}],children:[(0,w.jsx)(r.T,{style:{fontSize:13,fontFamily:'InterSemi',color:r.C.green},children:"Choose a strategy"}),(0,w.jsx)(r.Icon,{name:"chevron-down",size:14,color:r.C.green})]})});const wt=R&&(ut||ee.data?.stale)?(0,w.jsxs)(w.Fragment,{children:[!!ut&&(0,w.jsx)(r.T,{style:{fontSize:11,lineHeight:15,color:r.C.muted},children:ut}),!!ee.data?.stale&&(0,w.jsx)(b.StaleLine,{stale:!0,ageDays:ee.data.age_days})]}):null;return(0,w.jsxs)(b.CardShell,{label:R?`${Qe}, ${R.name}
1107`:Qe,style:W,header:Ye,footer:wt,children:[(0,w.jsxs)(s.default,{"aria-hidden":!0,style:{height:2,overflow:'hidden',backgroundColor:Se||'live'!==le&&ve?r.C.line:'transparent'},children:[Se&&(0,w.jsx)(l.default.View,{style:{position:'absolute',top:0,bottom:0,width:'30%',backgroundColor:r.C.green,left:ue?'35%':Ie.interpolate({inputRange:[0,1],outputRange:['-30%','100%']})}}),'live'!==le&&ve&&(0,w.jsx)(s.default,{style:{height:2,width:`${Math.round(me/Math.max(1,ye.length)*100)}%`,backgroundColor:r.C.green}})]}),!!R&&se&&(0,w.jsxs)(s.default,{role:"tablist","aria-label":`${Qe} list`,style:[r.s.row,{gap:6,rowGap:6,flexWrap:'wrap',paddingHorizontal:8,paddingTop:6}],children:[['live','history'].map(e=>{const t=le===e;return(0,w.jsx)(n.default,{role:"tab","aria-selected":t,accessibilityState:{selected:t},accessibilityLabel:'live'===e?`${p.LIST_MODE_LABELS.live}, ${it??'unknown'} setups`:`${p.LIST_MODE_LABELS.history}, ${ee.data?xe:R.researched_stocks??0} stocks`,...(0,b.webOnly)({tabIndex:t?0:-1}),onPress:()=>ae(e),style:e=>[{minHeight:26,paddingHorizontal:9,borderRadius:7,borderWidth:1,justifyContent:'center',borderColor:t?r.C.green:r.C.line,backgroundColor:t||e.hovered||e.focused?r.C.soft:'transparent'}],children:(0,w.jsx)(r.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:t?r.C.mint:r.C.muted},children:(0,p.listModeLabel)(e,it,ee.data?xe:R.researched_stocks??null)})},e)}),!yt&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(s.default,{style:{flex:1}}),mt]})]}),!!R&&yt&&(0,w.jsxs)(s.default,{onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width);et(e=>Math.abs(e-t)<4?e:t)},style:[r.s.row,{gap:0,paddingLeft:4,paddingRight:6,minHeight:34}],children:[mt,(0,w.jsxs)(s.default,{style:[r.s.row,{flex:1,minWidth:0,gap:5}],children:['error'===ee.phase&&(0,w.jsx)(r.Icon,{name:"alert-triangle",size:13,color:r.C.amber}),(0,w.jsxs)(r.T,{accessibilityLiveRegion:"polite",accessibilityLabel:ct+gt,...(0,b.webOnly)({'aria-live':'polite'}),numberOfLines:2,style:{flexShrink:1,fontSize:11,lineHeight:15,color:'error'===ee.phase?r.C.amber:r.C.muted},children:[ht,gt]})]}),(Se||'live'!==le&&ve)&&(0,w.jsxs)(n.default,{accessibilityRole:"button",accessibilityLabel:Se?'Stop loading':'Stop revealing rows',onPress:()=>Se?'live'===le?ie.stop():ee.stop():pe(e=>({...e,stopped:!0})),style:e=>[r.s.row,bt,{gap:4,backgroundColor:e.hovered||e.focused?r.C.soft:'transparent'}],children:[(0,w.jsx)(r.Icon,{name:"pause",size:12,color:r.C.ink}),(0,w.jsx)(r.T,{style:{fontSize:11,fontFamily:'InterSemi'},children:"Stop"})]}),je&&(0,w.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Retry ${R.name}`,onPress:'live'===le?ie.reload:ee.reload,style:e=>[bt,{backgroundColor:e.hovered||e.focused?r.C.soft:'transparent'}],children:(0,w.jsx)(r.T,{style:{fontSize:11,fontFamily:'InterSemi',color:r.C.green},children:"Retry"})}),'live'!==le&&Ce&&(0,w.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Show all ${ye.length} stocks`,onPress:()=>pe(e=>({...e,shown:ye.length,stopped:!1})),style:e=>[bt,{backgroundColor:e.hovered||e.focused?r.C.soft:'transparent'}],children:(0,w.jsx)(r.T,{style:{fontSize:11,fontFamily:'InterSemi',color:r.C.green},children:"Show all"})})]}),(0,w.jsx)(s.default,{style:{flex:1,minHeight:0},children:xt}),(0,w.jsx)(m.StrategyPicker,{open:Oe,onClose:()=>Ee(!1),anchor:Ke,strategies:_,currentKey:G,universeLabel:$,cardLabel:Qe,onChoose:e=>E(e)}),(0,w.jsx)(c.Popover,{open:Pe,onClose:()=>Fe(!1),anchor:Be,placement:"bottom-end",label:`${Qe} options`,role:"none",width:250,children:(0,w.jsx)(c.MenuList,{items:Je,onClose:()=>Fe(!1),label:`${Qe} options`})}),!!R&&(0,w.jsx)(c.Popover,{open:Ne,onClose:()=>De(!1),anchor:Ve,placement:"bottom-start",label:`About ${R.name}`,width:340,children:(0,w.jsxs)(s.default,{style:{paddingHorizontal:14,paddingVertical:8,gap:6},children:[(0,w.jsx)(r.T,{style:{fontFamily:'InterSemi',fontSize:13},children:R.name}),!!ct&&(0,w.jsxs)(r.T,{style:{fontSize:12,lineHeight:17,color:r.C.muted},children:[ct,gt]}),!!ut&&(0,w.jsx)(r.T,{style:{fontSize:12,lineHeight:17,color:r.C.muted},children:ut}),!!R.description&&(0,w.jsx)(r.T,{style:{fontSize:12,lineHeight:17,color:r.C.muted},children:R.description}),(0,w.jsxs)(r.T,{style:{fontSize:12,lineHeight:18},children:["Pattern: ",R.pattern_name," \xb7 Timeframe: ",R.timeframe," \xb7 Side: ",'long'===R.side?'Long (bullish)':'Short (bearish)'," \xb7 Universe: ",$]}),q?(0,w.jsxs)(r.T,{style:{fontSize:12,lineHeight:18},children:["Now lists setups forming or confirmed right now; \"new\" marks one first found in the latest session. History lists stocks where this pattern happened before. \"Edge low\" is a cautious (95% low) estimate of how much better the pattern did than buying the same stock on any day, over the same holding period, after costs. \"Avg\" is the average return after costs on data the pattern was not tuned on, and \"Trades\" is how many of those trades there were. Fewer than ",R.min_trades," trades is a small sample and is never ranked on."]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(r.T,{style:{fontSize:12,lineHeight:18},children:["Setups: stored scan matches on data to ",Te,". That date is for the setups only."]}),(0,w.jsxs)(r.T,{style:{fontSize:12,lineHeight:18},children:["95% low and Avg are this pattern's hold-period history on each stock after costs \u2014 not a tested exit rule unless the Backtest card says \"Tested exit rule\". Rows below ",R.min_trades," trades are small samples."]}),(0,w.jsx)(r.T,{style:{fontSize:12,lineHeight:18,color:r.C.muted},children:(0,f.backtestRunLine)(Me)})]}),(0,w.jsx)(r.T,{style:{fontSize:12,lineHeight:18},children:"Costs: 0.40% round trip included. Entry: next open after the signal candle. Win rate is context only; ranking is by 95% low."}),(0,w.jsx)(r.T,{style:{fontSize:12,lineHeight:18,color:r.C.amber},children:f.RANKED_LUCK_LINE})]})})]})};var t=_r(_d[0]),s=e(_r(_d[1])),n=e(_r(_d[2])),o=e(_r(_d[3])),l=e(_r(_d[4])),a=e(_r(_d[5])),i=e(_r(_d[6])),r=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),h=_r(_d[10]),u=_r(_d[11]),f=_r(_d[12]),p=_r(_d[13]),y=_r(_d[14]),m=_r(_d[15]),b=_r(_d[16]),x=_r(_d[17]),w=_r(_d[18]);const v=e=>null==e?r.C.muted:e>0?r.C.green:e<0?r.C.red:r.C.ink,C={fontSize:10,lineHeight:14,fontFamily:'InterMedium',letterSpacing:.6,textTransform:'uppercase',color:r.C.muted},S=['low','avg','n','symbol'],j={low:52,avg:48,n:28},k={fontVariant:['tabular-nums']}},1014,[11,13,375,278,267,345,265,821,197,871,1005,1015,1010,1006,1011,1016,925,1008,6]); 1108__d(function(g,_r,_i,a,m,_e,_d){"use strict";
1108function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"LIVE_COL",{enumerable:!0,get:function(){return f}}),_e.StateChip=x,_e.LiveList=function({rows:e,total:h,session:y,selectedId:b,onSelect:p,onOpenFull:C,label:j}){const w=(0,t.useRef)([]),S=e.findIndex(e=>e.detection_id===b),H=t=>{const n=e[t];n&&(p(n),setTimeout(()=>{w.current[t]?.focus?.(),w.current[t]?.scrollIntoView?.({block:'nearest'})},0))},T=(t,n)=>{const i=n?.key;'ArrowDown'===i||'ArrowUp'===i||'Home'===i||'End'===i?(n.preventDefault?.(),H('Home'===i?0:'End'===i?e.length-1:Math.max(0,Math.min(e.length-1,t+('ArrowDown'===i?1:-1))))):'Enter'===i&&e[t]&&(n.preventDefault?.(),C(e[t]))};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.default,{style:[o.s.row,{paddingHorizontal:12,minHeight:24,gap:5}],children:[(0,s.jsx)(o.T,{numberOfLines:1,style:[c,{flex:1,minWidth:0}],children:"Stock"}),(0,s.jsx)(o.T,{numberOfLines:1,style:[c,{width:f.state,textAlign:'right'}],children:"Setup"})]}),(0,s.jsx)(r.default,{style:{flex:1},contentContainerStyle:{paddingBottom:6},children:(0,s.jsx)(n.default,{"aria-label":`${j}: ${h} setups now`,...(0,d.webOnly)({role:'listbox'}),children:e.map((e,t)=>{const r=e.detection_id===b,c=(0,l.isNewDetection)(e,y),h=(0,l.sinceText)(e);return(0,s.jsxs)(i.default,{ref:e=>{w.current[t]=e},role:"option","aria-selected":r,accessibilityState:{selected:r},accessibilityLabel:`${(0,l.detectionRowA11y)(e,y)}${r?', selected':''}`,...(0,d.webOnly)({tabIndex:(S<0?0===t:r)?0:-1,onKeyDown:e=>T(t,e)}),onPress:()=>p(e),style:e=>[o.s.row,{gap:8,minHeight:44,paddingHorizontal:8,paddingVertical:4,marginHorizontal:3,marginVertical:1,borderRadius:8,borderWidth:1,borderColor:r?o.C.green:'transparent',backgroundColor:r?o.C.soft:e.hovered?o.C.hoverBg:'transparent'},e.focused&&d.web?{outlineStyle:'solid',outlineWidth:2,outlineColor:o.C.mint,outlineOffset:-1}:null],children:[(0,s.jsxs)(n.default,{style:{flex:1,minWidth:0},children:[(0,s.jsxs)(n.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,s.jsx)(o.T,{style:{fontSize:13,lineHeight:17,fontFamily:'InterSemi',color:r?o.C.mint:o.C.ink},children:e.symbol}),c&&(0,s.jsx)(n.default,{"aria-hidden":!0,style:{paddingHorizontal:5,minHeight:15,justifyContent:'center',borderRadius:4,backgroundColor:o.C.soft},children:(0,s.jsx)(o.T,{style:{fontSize:9.5,lineHeight:13,fontFamily:'InterSemi',color:o.C.mint},children:"new"})})]}),(0,s.jsx)(o.T,{style:{fontSize:11,lineHeight:14,color:o.C.muted},children:e.company})]}),(0,s.jsxs)(n.default,{style:{width:f.state,flexShrink:0,alignItems:'flex-end',gap:2},children:[(0,s.jsx)(x,{d:e}),!!h&&(0,s.jsx)(o.T,{style:[u,{fontSize:10,lineHeight:13,color:o.C.muted,textAlign:'right'}],children:h})]})]},e.detection_id)})})})]})},Object.defineProperty(_e,"detectionDetailText",{enumerable:!0,get:function(){return l.detectionDetailText}});var t=_r(_d[0]),n=e(_r(_d[1])),i=e(_r(_d[2])),r=e(_r(_d[3])),o=_r(_d[4]),l=_r(_d[5]),d=_r(_d[6]),s=_r(_d[7]);const c={fontSize:10,lineHeight:14,fontFamily:'InterMedium',letterSpacing:.6,textTransform:'uppercase',color:o.C.muted},u={fontVariant:['tabular-nums']},f={state:78},h={confirmed:o.C.green,forming:o.C.amber,done:o.C.muted};function x({d:e}){const t=h[(0,l.detectionTone)(e.state)];return(0,s.jsx)(n.default,{"aria-hidden":!0,style:{alignSelf:'flex-end',paddingHorizontal:6,minHeight:17,justifyContent:'center',borderRadius:5,borderWidth:1,borderColor:t},children:(0,s.jsx)(o.T,{numberOfLines:1,style:{fontSize:9.5,lineHeight:13,fontFamily:'InterSemi',color:t},children:(0,l.detectionStateLabel)(e)})})}},1015,[11,13,375,278,821,1006,925,6]); 1109__d(function(g,r,_i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.readRecent=C,_e.StrategyPicker=function({open:e,onClose:h,anchor:x,strategies:S,currentKey:j,universeLabel:k,onChoose:w,cardLabel:z}){const{height:H,width:T}=(0,s.default)(),v=T<760,[R,M]=(0,t.useState)(''),[_,A]=(0,t.useState)('All'),[L,P]=(0,t.useState)([]),I=(0,t.useRef)(null),F=(0,t.useRef)([]);(0,t.useEffect)(()=>
1109{if(!e)return;M(''),A('All'),P(C());const t=setTimeout(()=>I.current?.focus?.(),30);return()=>clearTimeout(t)},[e]);const W=(0,t.useMemo)(()=>[...S].sort((e,t)=>e.order-t.order),[S]),O=(0,t.useMemo)(()=>(0,u.pickerChips)(W),[W]),$=(0,t.useMemo)(()=>{if('All'===_&&!R.trim()){const e=L.map(e=>W.find(t=>t.key===e)).filter(Boolean);return[...e.length?[{title:'Recently used',items:e}]:[],{title:'All strategies',items:W}]}return'Recently used'===_?[{title:'Recently used',items:(0,u.filterStrategies)(W,R,_,L)}]:[{title:'All'===_?'Matching strategies':_,items:(0,u.filterStrategies)(W,R,_,L)}]},[W,_,R,L]),D=$.flatMap(e=>e.items);F.current.length=D.length;const V=e=>{(0,c.writeStore)('discover','recent',{keys:(0,u.pushRecent)(C(),e)}),h(),w(e)},B=e=>{e<0?I.current?.focus?.():F.current[Math.min(e,D.length-1)]?.focus?.()},E=(e,t)=>{const n=t?.key;let i=-2;'ArrowDown'===n?i=Math.min(D.length-1,e+1):'ArrowUp'===n?i=e-1:'Home'===n?i=0:'End'===n&&(i=D.length-1),i<-1||(t.preventDefault?.(),B(i))};let K=-1;return(0,y.jsx)(c.Popover,{open:e,onClose:h,anchor:x,placement:"bottom-start",label:`Choose a strategy for ${z}`,width:480,children:(0,y.jsxs)(n.default,{style:{maxHeight:Math.round(.7*H),minHeight:0,flexShrink:1},children:[(0,y.jsxs)(n.default,{style:[a.s.between,{paddingLeft:14,paddingRight:4}],children:[(0,y.jsx)(a.T,{style:a.s.label,children:"Choose a strategy"}),(0,y.jsx)(c.IconButton,{icon:"x",label:"Close strategy picker",tooltip:"Close",onPress:h})]}),(0,y.jsxs)(n.default,{style:{paddingHorizontal:12,gap:8,paddingBottom:8},children:[(0,y.jsxs)(n.default,{style:[a.s.row,{gap:8,borderWidth:1,borderColor:a.C.line,borderRadius:10,paddingHorizontal:10,backgroundColor:a.C.bg}],children:[(0,y.jsx)(a.Icon,{name:"search",size:14,color:a.C.muted}),(0,y.jsx)(o.default,{ref:I,autoFocus:!0,accessibilityLabel:"Search strategies",value:R,onChangeText:M,placeholder:"Search pattern, side or timeframe\u2026",placeholderTextColor:a.C.muted,onSubmitEditing:()=>{D[0]&&V(D[0].key)},onKeyPress:e=>{'ArrowDown'===e?.nativeEvent?.key&&D.length&&(e.preventDefault?.(),B(0))},style:[{flex:1,minWidth:0,height:36,color:a.C.ink,fontFamily:'Inter',fontSize:13},f.web?{outlineStyle:'none'}:null]})]}),(0,y.jsx)(n.default,{role:"group","aria-label":"Filter strategies",style:[a.s.row,{flexWrap:'wrap',gap:6}],children:O.map(e=>{const t=e===_;return(0,y.jsx)(i.default,{accessibilityRole:"button",accessibilityLabel:`Filter: ${e}`,accessibilityState:{selected:t},...(0,f.webOnly)({'aria-pressed':t}),onPress:()=>A(e),style:e=>({minHeight:28,justifyContent:'center',paddingHorizontal:10,borderRadius:14,borderWidth:1,borderColor:t?a.C.green:a.C.line,backgroundColor:t?a.C.soft:e.hovered||e.focused?a.C.bg:'transparent'}),children:(0,y.jsx)(a.T,{style:{fontSize:11,lineHeight:15,fontFamily:'InterMedium',color:t?a.C.green:a.C.muted},children:e})},e)})})]}),(0,y.jsx)(l.default,{style:{flexShrink:1,minHeight:0,borderTopWidth:1,borderColor:a.C.line},contentContainerStyle:{paddingVertical:4},keyboardShouldPersistTaps:"handled",children:$.map(e=>(0,y.jsxs)(n.default,{role:"group","aria-label":e.title,children:[(0,y.jsx)(a.T,{style:[a.s.label,{fontSize:10,paddingHorizontal:14,paddingTop:8,paddingBottom:4}],children:e.title}),!e.items.length&&(0,y.jsx)(a.T,{style:{fontSize:12,color:a.C.muted,paddingHorizontal:14,paddingVertical:8},children:'Recently used'!==e.title||R?'No strategy matches this search.':'Nothing used yet.'}),e.items.map(t=>{const l=++K,o=t.key===j,s=b(t);return(0,y.jsxs)(i.default,{ref:e=>{F.current[l]=e},accessibilityRole:"button",accessibilityLabel:`${t.name}. ${k} \xb7 ${p(t)}${o?'. Current':''}`,accessibilityState:{selected:o},...(0,f.webOnly)({'aria-current':o?'true':void 0,onKeyDown:e=>E(l,e)}),onPress:()=>V(t.key),style:e=>[a.s.row,{alignItems:'flex-start',gap:10,paddingHorizontal:14,paddingVertical:8,backgroundColor:e.hovered||e.focused?a.C.soft:'transparent'}],children:[(0,y.jsxs)(n.default,{style:{flex:1,minWidth:0,gap:2,opacity:s?.55:1},children:[(0,y.jsxs)(n.default,{style:[a.s.row,{gap:6}],children:[o&&(0,y.jsx)(a.Icon,{name:"check",size:13,color:a.C.green}),(0,y.jsx)(a.T,{numberOfLines:v?2:1,style:{fontSize:13,lineHeight:18,fontFamily:'InterSemi',color:o?a.C.green:a.C.ink,flexShrink:1},children:t.name})]}),(0,y.jsx)(a.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:a.C.muted},children:(t.tags||[]).join(' \xb7 ')})]}),(0,y.jsx)(n.default,{style:{maxWidth:'48%',flexShrink:0,borderRadius:6,paddingHorizontal:7,paddingVertical:3,backgroundColor:s?a.C.bg:a.C.soft,opacity:s?.7:1},children:(0,y.jsx)(a.T,{numberOfLines:1,style:{fontSize:10,lineHeight:14,fontFamily:'InterMedium',color:s?a.C.muted:a.
1109C.green,textAlign:'right',fontVariant:['tabular-nums']},children:p(t)})})]},e.title+t.key)})]},e.title))})]})})};var t=r(d[0]),n=e(r(d[1])),i=e(r(d[2])),l=e(r(d[3])),o=e(r(d[4])),s=e(r(d[5])),a=r(d[6]),c=r(d[7]),u=r(d[8]),h=r(d[9]),f=r(d[10]),y=r(d[11]);const p=e=>'research_pattern'===e?.source_type?(0,h.researchPickerTag)(e):(0,u.pickerTag)(e),b=e=>'research_pattern'===e?.source_type?!e.evidence_pending&&!e.researched_stocks:!e.found;function C(){const e=(0,c.readStore)('discover','recent').keys;return Array.isArray(e)?e.filter(e=>'string'==typeof e):[]}},1016,[11,13,375,278,385,400,821,871,1010,1006,925,6]); 1110__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"openChart",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"cardDate",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"strategyShort",{enumerable:!0,get:function(){return S}}),_e.LinkedHeader=k,Object.defineProperty(_e,"EmptyHeader",{enumerable:!0,get:function(){return I}}),_e.ChartCard=function({link:e,style:n,stale:s,ageDays:p,color:C}){const T=(0,c.useProduct)(),H=(0,y.linkKey)(e),{value:_,error:v,loading:N,reload:O}=(0,m.useKeyedValue)(H,async()=>{const t=e;if(t.detectionId)return{id:t.matchId,symbol:t.symbol,company:t.company,price:0,pattern:t.pattern,pattern_name:t.patternName,timeframe:t.timeframe,direction:'long'===t.side?'bullish':'bearish',state:t.detectionState||'',current:!0,candle_end:t.dataEnd||'',score:0,sector:'',universes:[],history:[],start_index:0};const n=(Array.isArray(T?.matches)?T.matches:[]).find(e=>e.id===t.matchId);if(n)return n;const l=await(0,d.api)(`/api/matches?min_trades=0&symbol=${encodeURIComponent(t.symbol)}&timeframe=${encodeURIComponent(t.timeframe)}&pattern=${encodeURIComponent(t.pattern)}`),s=Array.isArray(l)?l:Array.isArray(l?.matches)?l.matches:[];return s.find(e=>e.id===t.matchId)||s.find(e=>e.symbol===t.symbol&&e.timeframe===t.timeframe&&e.pattern===t.pattern)||null}),[L,z]=(0,t.useState)({key:'',text:''}),A=(0,t.useCallback)(e=>z({key:H,text:e}),[H]),P=e?`${e.symbol} \xb7 ${e.timeframe}`:'Chart',W=e?(0,j.jsx)(k,{title:P,slot:e.slot,color:C,detail:`${S(e)} \xb7 from ${e.slot}`,sourceA11y:`${e.company}. Source: ${e.strategyName}, scanner ${e.slot}`,link:(0,j.jsx)(b.LinkText,{label:"Open full chart \u2192",a11y:`Open ${e.symbol} ${e.timeframe} on the full chart`,onPress:()=>$(e)})}):(0,j.jsx)(I,{title:"Chart"}),D=T?.state?.data_status,R=e?(0,u.cardDataLine)(D,e.dataEnd):'',w=e?(0,u.cardWarning)(D,{stale:s,ageDays:p}):null,E=e?(0,x.geometryNoteText)({drawable:e.drawable,geometry_note:e.geometryNote}):null,F=e?(0,j.jsxs)(o.T,{numberOfLines:1,accessibilityLabel:`${R}. Times are IST.${w?` ${w}.`:''}${L.key===H&&L.text?` ${L.text}`:''}`,style:{fontSize:11,lineHeight:15,color:o.C.muted},children:[R,w?(0,j.jsxs)(o.T,{style:{fontSize:11,lineHeight:15,color:o.C.amber},children:[" \xb7 ",w]}):' \xb7 IST']}):null;let M;M=e?v?(0,j.jsx)(l.default,{style:{padding:12},children:(0,j.jsx)(f.WidgetError,{title:"Chart unavailable",message:`The stored setup for ${e.symbol} ${e.timeframe} could not be loaded. ${v}`,onRetry:O})}):N?(0,j.jsx)(b.Skeleton,{chart:!0,lines:2}):_?(0,j.jsxs)(l.default,{style:{flex:1,minHeight:0,padding:6},children:[!!E&&(0,j.jsxs)(o.T,{accessibilityLiveRegion:"polite",numberOfLines:2,style:{fontSize:11,lineHeight:15,color:o.C.amber,paddingHorizontal:4,paddingBottom:4},children:["Marker only \u2014 ",E]}),(0,j.jsx)(h.PatternCanvas,{match:_,side:e.side,detectionId:e.detectionId||null,fill:!0,hideHeader:!0,compact:!0,controls:!1,onStatus:A},H)]}):(0,j.jsx)(b.CenterNote,{icon:"alert-circle",text:e.detectionId?`This ${e.patternName} detection for ${e.symbol} ${e.timeframe} is no longer in the live scan.`:`The stored ${e.patternName} setup for ${e.symbol} ${e.timeframe} is no longer in the stored scan.`}):(0,j.jsx)(b.CenterNote,{text:"Click a stock in a scanner card to see its chart."});return(0,j.jsx)(b.CardShell,{label:e?`Chart, ${e.symbol} \xb7 ${e.patternName} \xb7 ${e.timeframe}`:'Chart',style:n,header:W,footer:F,children:M})};
1110var e,t=r(_d[0]),n=r(_d[1]),l=(e=n)&&e.__esModule?e:{default:e},s=r(_d[2]),o=r(_d[3]),d=r(_d[4]),c=r(_d[5]),m=r(_d[6]),h=r(_d[7]),f=r(_d[8]),u=r(_d[9]),y=r(_d[10]),p=r(_d[11]),b=r(_d[12]),x=r(_d[13]),j=r(_d[14]);const $=(e,t)=>{const n=(0,p.chartHref)(e.symbol,e.timeframe,e.matchId,t,e.detectionId);n&&s.router.push(n)},C=e=>{const t=(0,f.formatDataDate)(e||void 0);if(!t)return'';const n=String((new Date).getFullYear());return t.endsWith(' '+n)?t.slice(0,-5):t},S=e=>e.strategyName.replace(` \xb7 ${e.timeframe}`,'')||e.patternName;function k({title:e,detail:t,slot:n,color:s,sourceA11y:d,link:c}){return(0,j.jsxs)(l.default,{style:{flex:1,minWidth:0,paddingVertical:3,paddingRight:8},children:[(0,j.jsxs)(l.default,{style:[o.s.row,{gap:8,minHeight:26}],children:[(0,j.jsx)(o.T,{role:"heading","aria-level":3,style:{flexShrink:0,fontFamily:'InterSemi',fontSize:13,lineHeight:18},children:e}),(0,j.jsx)(l.default,{style:{flex:1}}),!!c&&(0,j.jsx)(l.default,{style:{flexShrink:1,minWidth:0},children:c})]}),(0,j.jsxs)(l.default,{accessibilityLabel:d,style:[o.s.row,{gap:5,minWidth:0}],children:[!!n&&(0,j.jsx)(l.default,{"aria-hidden":!0,style:{minWidth:16,height:16,paddingHorizontal:3,borderRadius:4,alignItems:'center',justifyContent:'center',backgroundColor:s||o.C.green},children:(0,j.jsx)(o.T,{style:{fontSize:10,lineHeight:12,fontFamily:'InterSemi',color:o.C.onGreen},children:n})}),(0,j.jsx)(o.T,{numberOfLines:1,style:{flexShrink:1,minWidth:0,fontSize:11,lineHeight:15,color:o.C.muted},children:t})]})]})}const I=({title:e})=>(0,j.jsx)(o.T,{role:"heading","aria-level":3,numberOfLines:1,style:{flex:1,fontFamily:'InterSemi',fontSize:12,lineHeight:16,letterSpacing:1,textTransform:'uppercase'},children:e})},1017,[11,13,252,821,197,196,251,864,871,879,1011,1012,925,1006,6]); 1111__d(function(g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.BacktestCard=function({link:e,minTrades:i=10,style:o,stale:_,ageDays:k,color:w}){const T=(0,y.linkKey)(e),{value:L,error:H,loading:z,reload:N}=(0,u.useKeyedValue)(T,async()=>{const t=e,l=await(0,d.api)(`/api/backtests/cell?symbol=${encodeURIComponent(t.symbol)}&timeframe=${encodeURIComponent(t.timeframe)}&pattern=${encodeURIComponent(t.pattern)}&side=${t.side}`);if(l?.symbol&&(String(l.symbol).toUpperCase()!==t.symbol||l.timeframe&&l.timeframe!==t.timeframe||l.pattern&&l.pattern!==t.pattern||l.side&&l.side!==t.side))throw new Error('The backtest response did not match the selected stock.');return l}),[B,W]=(0,t.useState)(!1);(0,t.useEffect)(()=>W(!1),[T]);const E=(0,t.useMemo)(()=>(0,x.backtestView)(L),[L]),I=(0,t.useMemo)(()=>(0,x.tradeSummary)(E.trades),[E.trades]),A=e?`Backtest \xb7 ${e.symbol} \xb7 ${e.patternName} ${e.timeframe}`:'Backtest',O=e?(0,$.jsx)(p.LinkedHeader,{title:`Backtest \xb7 ${e.symbol} \xb7 ${e.timeframe}`,slot:e.slot,color:w,detail:`${e.patternName} \xb7 ${'long'===e.side?'Long':'Short'}`,sourceA11y:`${e.patternName} ${e.timeframe}, ${e.side}, from scanner ${e.slot}`,link:(0,$.jsx)(b.LinkText,{label:"Evidence \u2192",a11y:`Open evidence and replay for ${e.symbol} ${e.timeframe}`,onPress:()=>(0,p.openChart)(e,'evidence')})}):(0,$.jsx)(p.EmptyHeader,{title:"Backtest"}),F='tested_rule'===E.basis,M=!!e&&!z&&!H&&'none'!==E.basis,R=(0,$.jsxs)($.Fragment,{children:[M&&(0,$.jsx)(c.T,{style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:F?c.C.green:c.C.amber},children:E.label}),(0,$.jsxs)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:[x.COST_LINE,F&&M?' \xb7 later-test only':''," \xb7 ",e&&_?(0,$.jsxs)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.amber},children:["research only",null!=k?` (${k}d old)`:'']}):'research only']}),M&&(0,$.jsx)(c.T,{style:{fontSize:10.5,lineHeight:14,color:c.C.muted},children:(0,x.backtestRunLine)(L)}),!!e&&(0,$.jsx)(c.T,{style:{fontSize:10.5,lineHeight:14,color:c.C.muted},children:x.RANKED_LUCK_LINE})]});let D;if(e)if(H)D=(0,$.jsx)(l.default,{style:{padding:12},children:(0,$.jsx)(f.WidgetError,{title:"Backtest unavailable",message:`Backtest results for ${e.symbol}
1111 ${e.timeframe} could not be loaded. ${H}`,onRetry:N})});else if(z)D=(0,$.jsx)(b.Skeleton,{lines:6});else if('none'===E.basis)D=(0,$.jsx)(b.CenterNote,{icon:"info",text:`No historical ${e.patternName} trades are recorded for ${e.symbol} ${e.timeframe}. Nothing to show \u2014 no result is implied.`});else{const t=E.stats,o=t?.n||0,u=(0,x.verdictFor)(t,i,E.basis),f=(0,x.backtestBadges)(L,e.side),y=(0,h.sampleSize)(o),b=Array.isArray(t?.expectancy_ci95)?t.expectancy_ci95:null,p=[...I.list].reverse(),_=B?p:p.slice(0,5),k=o<i;D=(0,$.jsxs)(n.default,{style:{flex:1},contentContainerStyle:{paddingHorizontal:12,paddingVertical:10,gap:9},children:[(0,$.jsxs)(l.default,{style:[c.s.row,{flexWrap:'wrap',gap:6}],children:[(0,$.jsx)(c.Badge,{label:x.VERDICT_TITLES[u],tone:'review'===u?'green':'pass'===u?'red':'neutral',dot:!0}),(0,$.jsx)(c.Badge,{label:y.label,tone:y.tone}),'small_test_sample'===L?.status&&(0,$.jsx)(c.Badge,{label:"Later-test sample too small",tone:"amber"}),f.map(e=>(0,$.jsx)(c.Badge,{label:e,tone:"neutral"},e))]}),!!E.rule&&(0,$.jsxs)(c.T,{numberOfLines:2,style:{fontSize:10.5,lineHeight:14,color:c.C.muted},children:["Rule: ",E.rule]}),(0,$.jsxs)(l.default,{style:{flexDirection:'row',flexWrap:'wrap',rowGap:5,columnGap:12},children:[(0,$.jsx)(S,{label:"Trades",value:String(o),color:k?c.C.amber:void 0,note:k?`below ${i}`:void 0,a11y:`Trades ${o}${k?`, below the ${i} needed as evidence`:''}`}),(0,$.jsx)(S,{label:"Avg net",value:(0,d.pct)(t?.expectancy_pct),color:C(t?.expectancy_pct),a11y:`Average after costs ${(0,d.pct)(t?.expectancy_pct)}`}),(0,$.jsx)(S,{label:"Worst",value:(0,d.pct)(I.worst),color:C(I.worst),a11y:`Worst trade ${(0,d.pct)(I.worst)}`}),(0,$.jsx)(S,{label:"Avg hold",value:(0,x.holdShort)(I.avgHold,e.timeframe),a11y:`Average hold ${(0,x.holdText)(I.avgHold,e.timeframe)}`}),(0,$.jsx)(S,{full:!0,label:"95% range",value:b?`${(0,d.pct)(b[0])} to ${(0,d.pct)(b[1])}`:'\u2014',color:C(b?.[0]),a11y:"95% range of the average after costs: "+(b?`${(0,d.pct)(b[0])} to ${(0,d.pct)(b[1])}`:'not available')}),(0,$.jsx)(S,{full:!0,label:"Win rate",value:null==t?.win_rate?'\u2014':`${Number(t.win_rate).toFixed(0)}%`,note:"context only",a11y:`Win rate ${null==t?.win_rate?'not available':`${Number(t.win_rate).toFixed(0)}%`}, context only`})]}),(0,$.jsxs)(l.default,{style:{gap:3},children:[(0,$.jsxs)(c.T,{numberOfLines:1,style:{fontSize:10,lineHeight:14,color:c.C.muted},children:["Cumulative \xb7 ",I.list.length," trades \xb7 sum ",(0,d.pct)(I.total)," \xb7 not a portfolio"]}),(0,$.jsx)(v,{curve:I.curve})]}),(0,$.jsxs)(l.default,{style:{gap:1},children:[(0,$.jsx)(c.T,{style:[c.s.label,{fontSize:10}],children:B?'All trades':'Last 5 trades'}),!_.length&&(0,$.jsx)(c.T,{style:{fontSize:11,color:c.C.muted},children:"No individual trades are stored for this history."}),_.map((e,t)=>(0,$.jsxs)(l.default,{accessible:!0,accessibilityLabel:`Entry ${(0,d.dateText)(e.entry_time)} at ${(0,d.money)(e.entry,2)}, exit ${(0,d.money)(e.exit,2)}, ${(0,d.pct)(e.net_return_pct)} after costs${e.exit_reason?`, ${e.exit_reason}`:''}`,style:[c.s.row,{gap:6,minHeight:22,borderTopWidth:t?1:0,borderColor:c.C.line}],children:[(0,$.jsx)(c.T,{numberOfLines:1,style:[j,{fontSize:11,lineHeight:15,width:74,flexShrink:0}],children:(0,d.dateText)(e.entry_time)}),(0,$.jsxs)(c.T,{numberOfLines:1,style:[j,{fontSize:11,lineHeight:15,flex:1,minWidth:0,color:c.C.muted}],children:[(0,d.money)(e.entry,2)," \u2192 ",(0,d.money)(e.exit,2)]}),(0,$.jsx)(c.T,{numberOfLines:1,style:[j,{fontSize:11,lineHeight:15,fontFamily:'InterSemi',width:56,flexShrink:0,textAlign:'right',color:C(e.net_return_pct)}],children:(0,d.pct)(e.net_return_pct)})]},`${e.entry_time}-${t}`)),p.length>5&&(0,$.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:B?'Show last 5 trades':`Show all ${p.length} trades`,accessibilityState:{expanded:B},onPress:()=>W(e=>!e),style:{minHeight:28,justifyContent:'center'},children:(0,$.jsx)(c.T,{style:{fontSize:12,fontFamily:'InterSemi',color:c.C.green},children:B?'Show last 5':`All trades (${p.length})`})})]})]})}else D=(0,$.jsx)(b.CenterNote,{icon:"bar-chart-2",text:"Click a stock in a scanner card to see how this pattern has done on it, after costs."});
1111return(0,$.jsx)(b.CardShell,{label:A,style:o,header:O,footer:R,children:D})};var t=r(_d[0]),l=e(r(_d[1])),n=e(r(_d[2])),s=e(r(_d[3])),i=r(_d[4]),o=e(i),c=r(_d[5]),d=r(_d[6]),h=r(_d[7]),u=r(_d[8]),f=r(_d[9]),y=r(_d[10]),x=r(_d[11]),b=r(_d[12]),p=r(_d[13]),$=r(_d[14]);const j={fontVariant:['tabular-nums']};function S({label:e,value:t,color:n,note:s,full:i,a11y:o}){return(0,$.jsxs)(l.default,{accessible:!0,accessibilityLabel:o||`${e} ${t}${s?`, ${s}`:''}`,style:{flexDirection:'row',alignItems:'baseline',gap:5,flexBasis:i?'100%':'40%',flexGrow:1,minWidth:0},children:[(0,$.jsx)(c.T,{numberOfLines:1,style:{flexShrink:0,fontSize:11,lineHeight:16,color:c.C.muted},children:e}),(0,$.jsx)(c.T,{numberOfLines:1,style:[j,{flexShrink:1,minWidth:0,fontFamily:'InterSemi',fontSize:12.5,lineHeight:17,color:n||c.C.ink}],children:t}),!!s&&(0,$.jsx)(c.T,{numberOfLines:1,style:{flexShrink:1,minWidth:0,fontSize:10,lineHeight:14,color:c.C.amber},children:s})]})}const C=e=>null==e?c.C.muted:e>0?c.C.green:e<0?c.C.red:c.C.ink;function v({curve:e}){const[n,s]=(0,t.useState)(0);if(e.length<2)return(0,$.jsx)(c.T,{style:{fontSize:11,color:c.C.muted},children:"Not enough trades to draw a line."});const h=[0,...e],u=Math.min(...h),f=Math.max(...h),y=f-u||1,x=e=>2+e*(Math.max(n,10)-4)/(h.length-1),b=e=>4+(f-e)/y*48,p=e[e.length-1];return(0,$.jsx)(l.default,{onLayout:e=>s(Math.round(e.nativeEvent.layout.width)),accessibilityLabel:`Trade-by-trade cumulative return across ${e.length} trades, ending ${(0,d.pct)(p)}. Not a portfolio.`,style:{height:56},children:n>0&&(0,$.jsxs)(o.default,{width:n,height:56,children:[(0,$.jsx)(i.Line,{x1:0,x2:n,y1:b(0),y2:b(0),stroke:c.C.line,strokeDasharray:"3 3"}),(0,$.jsx)(i.Path,{d:h.map((e,t)=>`${t?'L':'M'}${x(t).toFixed(1)},${b(e).toFixed(1)}`).join(' '),stroke:p>=0?c.C.green:c.C.red,strokeWidth:1.6,fill:"none"})]})})}},1018,[11,13,278,375,840,821,197,248,251,871,1011,1010,925,1017,6]); 1112__d(function(_g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.EvidenceCard=function(e){const t=(0,y.pilotSelection)(e.link);return t&&e.link?(0,j.jsx)(b.PatternHistoryCard,{link:e.link,selection:t,style:e.style,color:e.color}):(0,j.jsx)($,{...e})};var t=r(_d[0]),n=e(t),i=e(r(_d[1])),l=e(r(_d[2])),o=r(_d[3]),s=e(o),d=r(_d[4]),c=r(_d[5]),h=r(_d[6]),u=r(_d[7]),f=r(_d[8]),x=r(_d[9]),g=r(_d[10]),y=r(_d[11]),b=r(_d[12]),p=r(_d[13]),j=r(_d[14]);const _={fontVariant:['tabular-nums']},C=e=>null!=e&&Number.isFinite(e)?e>0?d.C.green:e<0?d.C.red:d.C.ink:d.C.muted,w={good:d.C.green,weak:d.C.amber,neutral:d.C.muted,pending:d.C.muted};function S({title:e,note:t,children:n}){return(0,j.jsxs)(i.default,{style:{gap:5},children:[(0,j.jsxs)(i.default,{style:[d.s.row,{gap:8,minWidth:0}],children:[(0,j.jsx)(d.T,{role:"heading","aria-level":4,style:[d.s.label,{fontSize:10,flexShrink:0}],children:e}),!!t&&(0,j.jsx)(d.T,{numberOfLines:1,style:{flex:1,minWidth:0,fontSize:10,lineHeight:14,color:d.C.muted,textAlign:'right'},children:t})]}),n]})}function T({label:e,value:t,color:n,note:l,a11y:o,width:s}){return(0,j.jsxs)(i.default,{accessible:!0,accessibilityLabel:o||`${e} ${t}${l?`, ${l}`:''}`,style:{flexBasis:s||'46%',flexGrow:1,minWidth:0,gap:1},children:[(0,j.jsx)(d.T,{numberOfLines:1,style:{fontSize:10,lineHeight:13,color:d.C.muted},children:e}),(0,j.jsx)(d.T,{numberOfLines:1,style:[_,{fontFamily:'InterSemi',fontSize:12.5,lineHeight:17,color:n||d.C.ink}],children:t}),!!l&&(0,j.jsx)(d.T,{numberOfLines:1,style:{fontSize:9.5,lineHeight:13,color:d.C.muted},children:l})]})}function v({curve:e}){const[l,c]=n.default.useState(0),h=(0,t.useMemo)(()=>(0,p.curveBars)(e),[e]);if(!h.length)return(0,j.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:"No forward-return grid was measured for this cell."});const u=l?Math.max(6,(l-6*(h.length-1))/h.length):0;return(0,j.jsxs)(i.default,{style:{gap:3},children:[(0,j.jsx)(i.default,{onLayout:e=>c(Math.round(e.nativeEvent.layout.width)),accessible:!0,accessibilityLabel:`Forward return by holding window. ${h.map(e=>e.a11y).join('. ')}`,style:{height:64},children:l>0&&(0,j.jsxs)(s.default,{width:l,height:64,children:[(0,j.jsx)(o.Line,{x1:0,x2:l,y1:32,y2:32,stroke:d.C.line,strokeDasharray:"3 3"}),h.map((e,t)=>{const n=Math.max(null==e.value?0:2,26*e.height),i=t*(u+6),l=(e.value??0)>=0,s=l?32-n:32;return(0,j.jsx)(o.Rect,{x:i,y:s,width:u,height:n,rx:2,fill:null==e.value?d.C.line:l?d.C.green:d.C.red,opacity:null==e.value?.4:e.peak?1:.62,stroke:e.peak?d.C.ink:void 0,strokeWidth:e.peak?1:0},e.h)})]})}),(0,j.jsx)(i.default,{"aria-hidden":!0,style:[d.s.row,{gap:6}],children:h.map(e=>(0,j.jsx)(d.T,{numberOfLines:1,style:[_,{width:u,textAlign:'center',fontSize:9,lineHeight:12,color:e.peak?d.C.ink:d.C.muted,fontFamily:e.peak?'InterSemi':void 0}],children:e.label},e.h))})]})}function k({b:e,group:t,first:n}){return(0,j.jsxs)(i.default,{accessible:!0,accessibilityLabel:(0,p.bucketA11y)(e,t),style:[d.s.row,{gap:6,minHeight:20,borderTopWidth:n?0:1,borderColor:d.C.line}],children:[(0,j.jsx)(d.T,{numberOfLines:1,style:{width:86,flexShrink:0,fontSize:11,lineHeight:15,color:e.enough?d.C.ink:d.C.muted},children:e.name}),(0,j.jsx)(d.T,{numberOfLines:1,style:[_,{width:34,flexShrink:0,fontSize:10.5,lineHeight:15,color:d.C.muted,textAlign:'right'}],children:(0,p.count)(e.n)}),(0,j.jsx)(d.T,{numberOfLines:1,style:{flex:1,minWidth:0,fontSize:10.5,lineHeight:15,textAlign:'right',color:e.enough?C(e.diff_mean_net_return_pct):d.C.amber},children:(0,p.bucketText)(e)})]})}function $({link:e,style:t,stale:n,ageDays:o,color:s}){const y=(0,f.linkKey)(e),{value:b,error:$,loading:z,reload:H}=(0,h.useKeyedValue)(y,async()=>{const t=e,n=await(0,c.api)(`/api/strategies/${encodeURIComponent(t.strategyKey)}/card?symbol=${encodeURIComponent(t.symbol)}`+(t.detectionId?`&detection_id=${encodeURIComponent(t.detectionId)}`:''));if(n?.identity&&(String(n.identity.symbol).toUpperCase()!==t.symbol||n.identity.timeframe!==t.timeframe))throw new Error('The evidence response did not match the selected stock.');if(t.detectionId&&n?.identity&&n.identity.detection_id&&n.identity.detection_id!==t.detectionId)throw new Error('The evidence response did not match the selected detection.');return n}),L=e?`Backtest \xb7 ${e.symbol} \xb7 ${e.patternName} ${e.timeframe}`:'Backtest',O=e?.detectionId?`Detected ${(0,p.detectionTimeText)(e.detectedAt,null)} \xb7 ${(0,p.detectionStateLabel)({state:e.detectionState||''})}`:null,I=(0,p.detectionEvidenceNote)(b?.live_evidence),N=e?(0,j.jsx)(g.LinkedHeader,{title:`Evidence \xb7 ${e.symbol} \xb7 ${e.timeframe}`,slot:e.slot,color:s,detail:`${e.patternName} \xb7 ${'long'===e.side?'Long':'Short'}${O?` \xb7 ${O}`:''}`,sourceA11y:`${e.patternName} ${e.timeframe}, ${e.side}, from scanner ${e.slot}`,link:(0,j.jsx)(x.LinkText,{label:"Evidence \u2192",a11y:`Open evidence and replay for ${e.symbol}
1112 ${e.timeframe}`,onPress:()=>(0,g.openChart)(e,'evidence')})}):(0,j.jsx)(g.EmptyHeader,{title:"Backtest"}),E=b?.evidence_state,W=(0,j.jsxs)(j.Fragment,{children:[!!b&&(0,j.jsx)(d.T,{style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:w[(0,p.evidenceTone)(E)]},children:b.label}),(0,j.jsxs)(d.T,{style:{fontSize:11,lineHeight:15,color:d.C.muted},children:[p.CARD_COST_LINE," \xb7 ",e&&n?(0,j.jsxs)(d.T,{style:{fontSize:11,lineHeight:15,color:d.C.amber},children:["research only",null!=o?` (${o}d old)`:'']}):'research only']})]});let A;if(e)if($)A=(0,j.jsx)(i.default,{style:{padding:12},children:(0,j.jsx)(u.WidgetError,{title:"Evidence unavailable",message:`Evidence for ${e.symbol} ${e.timeframe} could not be loaded. ${$}`,onRetry:H})});else if(z||!b)A=(0,j.jsx)(x.Skeleton,{lines:7});else if(b.summary){const t=b.summary,n=b.barriers,o=b.forward_curve,s=b.conditions,c=b.last_occurrences,h=(0,p.barrierTimingText)(n,t.horizon_bars_word);A=(0,j.jsxs)(l.default,{style:{flex:1},contentContainerStyle:{paddingHorizontal:12,paddingVertical:10,gap:11},children:[(0,j.jsxs)(i.default,{style:[d.s.row,{flexWrap:'wrap',gap:6}],children:[(0,j.jsx)(d.Badge,{label:b.label,tone:'good'===(0,p.evidenceTone)(E)?'green':'weak'===(0,p.evidenceTone)(E)?'amber':'neutral',dot:!0}),!!t.sample_label&&(0,j.jsx)(d.Badge,{label:t.sample_label,tone:"neutral"}),b.review_required&&(0,j.jsx)(d.Badge,{label:b.review_label||'Historical data requires review',tone:"amber"})]}),!!b.note&&(0,j.jsx)(d.T,{style:{fontSize:10.5,lineHeight:14,color:d.C.amber},children:b.note}),!!I&&(0,j.jsx)(d.T,{style:{fontSize:10.5,lineHeight:14,color:d.C.amber},children:I}),(0,j.jsxs)(S,{title:"Summary",note:(0,p.occurrenceText)(t),children:[(0,j.jsx)(i.default,{accessible:!0,accessibilityLabel:`Win rate ${(0,p.winRateText)(t)}, ${(0,p.winRateScopeNote)(t)}`,style:[d.s.row,{gap:6,minWidth:0}],children:(0,j.jsx)(d.T,{numberOfLines:1,style:[_,{fontFamily:'InterSemi',fontSize:15,lineHeight:20,color:d.C.ink}],children:(0,p.winRateText)(t)})}),(0,j.jsxs)(d.T,{style:{fontSize:10,lineHeight:13,color:d.C.muted},children:["win rate (",(0,p.winRateScopeNote)(t),")"]}),(0,j.jsxs)(i.default,{style:{flexDirection:'row',flexWrap:'wrap',rowGap:6,columnGap:10,marginTop:2},children:[(0,j.jsx)(T,{label:`Median net \xb7 ${t.horizon??'?'} ${t.horizon_bars_word}`,value:(0,p.signed)(t.median_net_return_pct),color:C(t.median_net_return_pct)}),(0,j.jsx)(T,{label:"Mean net",value:(0,p.signed)(t.mean_net_return_pct),color:C(t.mean_net_return_pct),note:Number.isFinite(t.baseline_mean_net_return_pct)?`stock alone ${(0,p.signed)(t.baseline_mean_net_return_pct)}`:null}),(0,j.jsx)(T,{label:"Median best move (MFE)",value:(0,p.plain)(t.median_mfe_pct),color:d.C.green}),(0,j.jsx)(T,{label:"Median worst move (MAE)",value:(0,p.plain)(t.median_mae_pct),color:d.C.red})]}),!!t.window_text&&(0,j.jsxs)(d.T,{style:{fontSize:11,lineHeight:15,color:d.C.ink},children:[t.window_text,"."]})]}),(0,j.jsxs)(S,{title:"Barriers",note:null!=n?.n?`${(0,p.count)(n.n)} decided`:null,children:[(0,p.barrierText)(n)?(0,j.jsx)(d.T,{style:[_,{fontSize:11.5,lineHeight:16,color:d.C.ink}],children:(0,p.barrierText)(n)}):(0,j.jsx)(d.T,{style:{fontSize:11,lineHeight:15,color:d.C.muted},children:"No barrier test was measured for this cell."}),!!h&&(0,j.jsx)(d.T,{style:{fontSize:10.5,lineHeight:14,color:d.C.muted},children:h}),!!n?.tie_rule_text&&(0,j.jsx)(d.T,{style:{fontSize:10,lineHeight:14,color:d.C.muted},children:n.tie_rule_text})]}),!!o&&(0,j.jsxs)(S,{title:`Forward return \xb7 ${o.bars_word}`,note:o.selected_h?`window ${o.selected_h}`:null,children:[(0,j.jsx)(v,{curve:o}),(0,j.jsx)(d.T,{style:{fontSize:10,lineHeight:14,color:d.C.muted},children:(0,p.curveCaption)(o)})]}),!!s&&(0,j.jsxs)(S,{title:"Conditions",note:`min ${s.minimum_sample} cases`,children:[s.groups.length?s.groups.map(e=>(0,j.jsxs)(i.default,{style:{gap:1,marginBottom:4},children:[(0,j.jsx)(d.T,{numberOfLines:1,style:{fontSize:10.5,lineHeight:15,fontFamily:'InterSemi',color:d.C.muted},children:e.title}),e.buckets.map((t,n)=>(0,j.jsx)(k,{b:t,group:e.title,first:0===n},t.bucket))]},e.dimension)):(0,j.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:"No condition buckets were measured for this cell."}),(0,j.jsx)(d.T,{style:{fontSize:9.5,lineHeight:13,color:d.C.muted},children:s.scope})]}),!!c&&(0,j.jsxs)(S,{title:"Last 5 similar occurrences",note:c.rows.length?null:'none recorded',children:[!c.rows.length&&(0,j.jsx)(d.T,{style:{fontSize:11,color:d.C.muted},children:"No individual occurrences are stored for this cell."}),c.rows.map((t,n)=>(0,j.jsxs)(i.default,{accessible:!0,accessibilityLabel:`${t.date}, ${e.symbol}: next move ${(0,p.signed)(t.next_move_pct)}, best ${(0,p.plain)(t.best_move_pct)}, worst ${(0,p.plain)(t.worst_move_pct)}, ${(0,p.occurrenceOutcome)(t)}`,style:[d.s.row,{gap:6,minHeight:21,borderTopWidth:n?1:0,borderColor:d.C.line}],children:[(0,j.jsx)(d.T,{numberOfLines:1,style:[_,{width:62,flexShrink:0,fontSize:10.5,lineHeight:15}],children:t.date}),(0,j.jsx)(d.T,{numberOfLines:1,style:[_,{width:52,flexShrink:0,fontSize:10.5,lineHeight:15,textAlign:'right',fontFamily:'InterSemi',color:C(t.next_move_pct)}],children:(0,p.signed)(t.next_move_pct)}),(0,j.jsx)(d.T,{numberOfLines:1,style:[_,{width:46,flexShrink:0,fontSize:10,lineHeight:15,textAlign:'right',color:d.C.green}],children:(0,p.plain)(t.best_move_pct)}),(0,j.jsx)(d.T,{numberOfLines:1,style:[_,{width:46,flexShrink:0,fontSize:10,lineHeight:15,textAlign:'right',color:d.C.red}],children:(0,p.plain)(t.worst_move_pct)}),(0,j.jsx)(d.T,{numberOfLines:1,style:{flex:1,minWidth:0,fontSize:10,lineHeight:15,textAlign:'right',color:d.C.muted},children:(0,p.occurrenceOutcome)(t)})]},`${t.entry_time}-${n}`)),!!c.read&&(0,j.jsx)(d.T,{style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:d.C.ink,marginTop:2},children:c.read})]}),(0,j.jsxs)(S,{title:"How to read this",children:[(0,p.honestyLines)(b).map((e,t)=>(0,j.jsxs)(i.default,{style:[d.s.row,{gap:6,alignItems:'flex-start'}],children:[(0,j.jsx)(d.T,{"aria-hidden":!0,style:{fontSize:10,lineHeight:15,color:d.C.muted},children:"\xb7"}),(0,j.jsx)(d.T,{style:{flex:1,minWidth:0,fontSize:10,lineHeight:14,color:/chance|requires review/i.test(e)?d.C.amber:d.C.muted},children:e})]},t)),(0,j.jsxs)(d.T,{style:{fontSize:9.5,lineHeight:13,color:d.C.muted,marginTop:2},children:["Run ",b.research_run?.slice(0,8)," \xb7 engine ",b.engine_version||'?',b.snapshot_id?` \xb7 ${b.snapshot_id}`:'']})]})]})}else A=(0,j.jsx)(x.CenterNote,{icon:'loading'===E?'clock':'info',text:I||b.note||b.label,children:(0,j.jsx)(d.Badge,{label:b.label,tone:'loading'===E?'neutral':'amber'})});else A=(0,j.jsx)(x.CenterNote,{icon:"bar-chart-2",text:"Click a stock in a scanner card to see what this pattern has actually done on it, after costs."});return(0,j.jsx)(x.CardShell,{label:L,style:t,header:N,footer:W,children:A})}},1019,[11,13,278,840,821,197,251,871,1011,925,1017,1020,1021,1006,6]); 1113__d(function(g,r,i,a,_m,e,d){"use strict";
1113Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HORIZONS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"signed",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"date",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"stateLabel",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"variantLabel",{enumerable:!0,get:function(){return u}}),e.query=l,e.historyHref=function(t,n=5){return'/pattern-history?'+l(t,{horizon:n}).replace(/(^|&)state=/,'$1phase=')},e.pilotSelection=function(t){if(!t||'1D'!==t.timeframe||'long'!==t.side)return null;const n=/^(ch16|cdlengulfing)-(canonical(?:_context)?)-long-1d$/i.exec(t.strategyKey);return!n||'ch16'===n[1].toLowerCase()&&'canonical'!==n[2]?null:{symbol:t.symbol,pattern_id:n[1].toUpperCase(),variant:n[2],state:['setup','forming'].includes(t.detectionState||'')?'setup':'confirmed',strategy_key:t.strategyKey,...t.detectionId?{detection_id:t.detectionId}:{}}};const t=[1,3,5,10],n=t=>null!=t&&Number.isFinite(t)?`${t>0?'+':''}${t.toFixed(2)}%`:'\u2014',o=t=>t?t.slice(0,10):'\u2014',c=t=>'setup'===t?'Forming / setup':'Confirmed',u=t=>'canonical_context'===t?'With prior downtrend':'Standard definition';function l(t,n={}){return Object.entries({...t,...n}).filter(([,t])=>null!=t&&''!==t).map(([t,n])=>`${encodeURIComponent(t)}=${encodeURIComponent(String(n))}`).join('&')}},1020,[]); 1114__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.PatternHistoryCard=function({link:e,selection:t,style:f,color:h}){return(0,u.jsx)(s.CardShell,{label:`Pattern history \xb7 ${e.symbol}`,style:f,header:(0,u.jsx)(n.LinkedHeader,{title:`History \xb7 ${e.symbol} \xb7 Daily`,slot:e.slot,color:h,detail:`${e.patternName} \xb7 ${(0,y.stateLabel)(t.state)}`,sourceA11y:`${e.patternName} daily history from scanner ${e.slot}`}),footer:(0,u.jsx)(l.T,{style:{color:l.C.muted,fontSize:11},children:"Two-pattern pilot \xb7 historical observations"}),children:(0,u.jsx)(o.default,{contentContainerStyle:{padding:12},children:(0,u.jsx)(c.HistoryPanel,{selection:t,compact:!0},(0,y.query)(t))})})},r(d[0]);var e,t=r(d[1]),o=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]),n=r(d[4]),c=r(d[5]),y=r(d[6]),u=r(d[7])},1021,[11,278,821,925,1017,1022,1020,6]); 1115__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.HistoryPanel=function({selection:e,compact:b=!1,initialHorizon:w=5,onHorizonChange:z}){const[C,S]=(0,t.useState)(p.HORIZONS.includes(w)?w:5),[v,T]=(0,t.useState)(null),[$,k]=(0,t.useState)(!1),H=e=>{S(e),T(null),z?.(e)},O='/api/pattern-history/history?'+(0,p.query)(e,{horizon:C}),{value:L,error:R,loading:F,reload:W}=(0,c.useKeyedValue)(O,async()=>{const t=await(0,d.api)(O);if(t.symbol!==e.symbol||t.pattern_id!==e.pattern_id||t.variant!==e.variant||t.state!==e.state||t.selected_horizon!==C)throw new Error('History does not match this stock, pattern and window.');return t}),q=L?.horizons.find(e=>e.horizon===C),B=q?.observed,I=L?.recent_completed||[],P=I.filter(e=>(e.horizons.find(e=>e.horizon===C)?.gross_return_pct??0)>0).length;return(0,x.jsxs)(n.default,{style:{gap:b?15:24},children:[(0,x.jsxs)(n.default,{style:{gap:8},children:[(0,x.jsx)(l.T,{style:{fontSize:12,color:l.C.muted},children:"What happened after the pattern?"}),(0,x.jsx)(n.default,{style:[l.s.row,{flexWrap:'wrap',gap:5}],children:p.HORIZONS.map(e=>(0,x.jsx)(l.Chip,{label:`${e} candle${1===e?'':'s'}`,active:e===C,onPress:()=>H(e)},e))})]}),R?(0,x.jsx)(u.WidgetError,{title:"History unavailable",message:R,onRetry:W}):!F&&L&&B?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(n.default,{style:[l.s.row,{flexWrap:'wrap',gap:6}],children:[(0,x.jsx)(l.Badge,{label:`History through ${(0,p.date)(L.data_end)}`,tone:"neutral"}),L.review_required&&(0,x.jsx)(l.Badge,{label:L.review_label||'Historical data requires review',tone:"amber"}),!L.coverage.complete&&(0,x.jsx)(l.Badge,{label:`${L.coverage.cached_symbols}/${L.coverage.universe_symbols} stocks prepared`,tone:"amber"})]}),(0,x.jsxs)(n.default,{style:{gap:8},children:[(0,x.jsx)(l.T,{style:{fontFamily:'ManropeBold',fontSize:b?21:30,lineHeight:b?29:39},children:B.n?`${B.up_n} of ${B.n} finished higher`:'No completed observations'}),(0,x.jsxs)(l.T,{style:{color:l.C.muted,fontSize:12},children:["After ",C," daily candle",1===C?'':'s'," \xb7 ",B.down_n," lower \xb7 ",B.unchanged_n," unchanged"]}),(0,x.jsxs)(l.T,{style:{fontSize:12,color:l.C.muted},children:[L.occurrence_count," occurrences \xb7 Last seen ",(0,p.date)(L.last_seen)]})]}),(0,x.jsxs)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:16},children:[(0,x.jsx)(l.Stat,{label:`Median change \xb7 ${C} candles`,value:(0,p.signed)(B.median_gross_return_pct),color:_(B.median_gross_return_pct),size:b?20:28}),(0,x.jsx)(l.Stat,{label:"Typical largest rise",value:(0,p.signed)(B.median_max_up_pct),color:l.C.green,size:b?20:28}),(0,x.jsx)(l.Stat,{label:"Typical largest fall",value:(0,p.signed)(null==B.median_max_down_pct?null:-B.median_max_down_pct),color:l.C.red,size:b?20:28})]}),(0,x.jsx)(l.T,{style:{color:l.C.muted,fontSize:11,lineHeight:17},children:"\u201cTypical\u201d means the median across measured occurrences. Largest rise and fall are extremes inside the window, not captured trading returns."}),!!B.n&&null!=B.median_bars_to_max_up&&(0,x.jsxs)(l.T,{style:{fontSize:12,color:l.C.muted},children:["Largest rise around candle ",B.median_bars_to_max_up,"; largest fall around candle ",B.median_bars_to_max_down," (median timing; 0 means no excursion)."]}),B.n>0&&B.n<20&&(0,x.jsxs)(l.T,{style:{color:l.C.amber,fontSize:12},children:["Only ",B.n," completed cases. Read the individual charts before treating this as a recurring tendency."]}),(0,x.jsxs)(n.default,{style:{backgroundColor:l.C.dark,borderWidth:1,borderColor:l.C.line,borderRadius:12,padding:12,gap:6},children:[(0,x.jsx)(l.T,{style:{fontFamily:'InterSemi',fontSize:12},children:"Does this differ from the stock\u2019s usual movement?"}),(0,x.jsxs)(l.T,{style:{fontSize:12},children:["Average after pattern: ",(0,p.signed)(B.mean_gross_return_pct),b?'\n':' \xb7 ',"On all measured dates: ",(0,p.signed)(q?.baseline.mean_gross_return_pct)]}),(0,x.jsxs)(l.T,{style:{fontSize:11,color:l.C.muted},children:["Same stock and ",C,"-candle window \xb7 ",q?.baseline.n??0," baseline observations. Difference: ",null==q?.mean_difference_pct?'\u2014':`${q.mean_difference_pct>0?'+':''}${q.mean_difference_pct.toFixed(2)} percentage points`,"."]}),!b&&(0,x.jsxs)(l.T,{style:{fontSize:11,color:l.C.muted},children:["Signal dates ",(0,p.date)(L.baseline_window?.[0])," to ",(0,p.date)(L.baseline_window?.[1]),". Includes pattern dates; overlapping windows are not independent. This comparison does not establish a predictive edge."]})]}),!b&&(0,x.jsxs)(y,{title:"Compare fixed windows",children:[(0,x.jsxs)(n.default,{style:{borderWidth:1,borderColor:l.C.line,borderRadius:12,overflow:'hidden'},children:[(0,x.jsx)(n.default,{style:[l.s.row,{padding:12,backgroundColor:l.C.dark}],children:['Candles','Higher / measured','Median change'].map(e=>(0,x.jsx)(l.T,{style:{flex:1,fontSize:11,color:l.C.muted},children:e},e))}),L.horizons.map(e=>(0,x.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Select ${e.horizon} candles`,onPress:()=>H(e.horizon),style:[l.s.row,{padding:12,backgroundColor:e.horizon===C?l.C.soft:'transparent'}],children:[(0,x.jsx)(l.T,{style:{flex:1},children:e.horizon}),(0,x.jsxs)(l.T,{style:{flex:1},children:[e.observed.up_n," / ",e.observed.n]}),(0,x.jsx)(l.T,{style:{flex:1,color:_(e.observed.median_gross_return_pct)},children:(0,p.signed)(e.observed.median_gross_return_pct)})]},e.horizon))]}),(0,x.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:"These windows are fixed in advance. The largest historical number is not presented as the best future holding period."})]}),(0,x.jsxs)(y,{title:`Latest ${I.length||5} completed occurrences`,children:[(0,x.jsxs)(l.T,{style:{fontSize:11,color:l.C.muted},children:["Same stock, variant and state \xb7 next open to candle ",C," close"]}),I.length?I.map(e=>(0,x.jsx)(j,{item:e,horizon:C,onOpen:()=>T(e.id)},e.id)):(0,x.jsx)(l.T,{style:{color:l.C.muted},children:"No completed cases for this window."}),!!I.length&&(0,x.jsxs)(l.T,{style:{fontSize:12},children:[P," of these ",I.length," finished higher. Open a row to inspect its chart."]})]}),(0,x.jsxs)(y,{title:"Unfinished and excluded",children:[(0,x.jsxs)(l.T,{style:{fontSize:12,color:l.C.muted}
1115,children:[B.pending," still unfolding \xb7 ",B.quality_excluded," excluded for data quality. Neither is counted as a gain, loss or unchanged result."]}),(L.recent_pending||[]).map(e=>(0,x.jsx)(j,{item:e,horizon:C,onOpen:()=>T(e.id)},e.id)),(L.recent_excluded||[]).map(e=>(0,x.jsx)(j,{item:e,horizon:C,onOpen:()=>T(e.id)},e.id))]}),b?(0,x.jsx)(l.Button,{kind:"outline",label:"Explore full pattern history",icon:"arrow-up-right",onPress:()=>o.router.push((0,p.historyHref)(e,C))}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(l.Button,{kind:"ghost",label:$?'Hide measurement details':'How these numbers are measured',icon:"info",onPress:()=>k(e=>!e)}),$&&(0,x.jsxs)(n.default,{style:[l.s.card,{padding:16,gap:10}],children:[(0,x.jsxs)(l.T,{children:["1. Read each stored ",(0,p.stateLabel)(e.state).toLowerCase()," occurrence using the frozen ",(0,p.variantLabel)(e.variant).toLowerCase(),"."]}),(0,x.jsx)(l.T,{children:"2. Start at the next daily candle\u2019s open. Candle 1 ends at that same candle\u2019s close."}),(0,x.jsx)(l.T,{children:"3. Measure the closing change and the highest / lowest prices over the selected window."}),(0,x.jsx)(l.T,{children:"4. Keep every matching occurrence, including unfavorable outcomes. Report unfinished and quality-excluded cases separately."}),(0,x.jsx)(l.T,{children:"5. Compare with the same stock over all daily signal dates from its first through last occurrence."}),(0,x.jsxs)(l.T,{style:{color:l.C.muted,fontSize:12},children:["History available: ",(0,p.date)(L.data_start)," to ",(0,p.date)(L.data_end),". Fixed snapshot; \u201cstill unfolding\u201d refers to its data cutoff, not today\u2019s market. No model fitting, trading costs or executed trades are part of this view. Forming history includes setups that never confirmed."]}),(0,x.jsxs)(l.T,{selectable:!0,style:{color:l.C.muted,fontSize:11},children:["Research run ",L.run," \xb7 Source ",L.source_run]})]})]}),(0,x.jsxs)(l.T,{style:{fontSize:11,color:l.C.muted},children:["Gross historical price movement \xb7 data through ",(0,p.date)(L.data_end)," \xb7 no costs deducted"]})]}):(0,x.jsx)(h.Skeleton,{lines:7}),(0,x.jsx)(l.Sheet,{visible:!!v,onClose:()=>T(null),title:`${e.symbol} \xb7 historical occurrence`,subtitle:`${(0,p.stateLabel)(e.state)} \xb7 ${C} daily candles`,wide:!0,children:v&&(0,x.jsx)(f.ReplayChart,{selection:e,id:v,horizon:C},(0,p.query)(e)+v)})]})};var t=r(_d[0]),n=e(r(_d[1])),s=e(r(_d[2])),o=r(_d[3]),l=r(_d[4]),d=r(_d[5]),c=r(_d[6]),u=r(_d[7]),h=r(_d[8]),p=r(_d[9]),f=r(_d[10]),x=r(_d[11]);const _=e=>null==e?l.C.muted:e>0?l.C.green:e<0?l.C.red:l.C.ink;function y({title:e,children:t}){return(0,x.jsxs)(n.default,{style:{gap:10},children:[(0,x.jsx)(l.T,{style:{fontFamily:'InterSemi',fontSize:14},children:e}),t]})}function j({item:e,horizon:t,onOpen:o}){const d=e.horizons.find(e=>e.horizon===t);return(0,x.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Open occurrence ${(0,p.date)(e.signal_time)}, ${(0,p.signed)(d?.gross_return_pct)} after ${t} candles`,onPress:o,style:({pressed:e})=>({paddingVertical:11,borderBottomWidth:1,borderColor:l.C.line,gap:4,opacity:e?.7:1}),children:[(0,x.jsxs)(n.default,{style:l.s.between,children:[(0,x.jsx)(l.T,{style:{fontSize:12,fontFamily:'InterSemi'},children:(0,p.date)(e.signal_time)}),(0,x.jsx)(l.T,{style:{fontSize:13,fontFamily:'InterSemi',color:_(d?.gross_return_pct)},children:'measured'===d?.status?`${(0,p.signed)(d.gross_return_pct)} \u2192`:'pending'===d?.status?'Still unfolding \u2192':'Excluded \u2192'})]}),'measured'===d?.status?(0,x.jsxs)(l.T,{style:{fontSize:11,color:l.C.muted},children:["Largest rise ",(0,p.signed)(d.max_up_pct)," \xb7 fall ",(0,p.signed)(null==d.max_down_pct?null:-d.max_down_pct)]}):(0,x.jsx)(l.T,{style:{fontSize:11,color:l.C.muted},children:d?.reason?.replace(/_/g,' ')})]})}},1022,[11,13,375,252,821,197,251,871,925,1020,1023,6]); 1116__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ReplayChart=function({selection:e,id:y,horizon:p}){const _='/api/pattern-history/replay?'+(0,u.query)(e,{occurrence_id:y}),{value:b,error:j,loading:C,reload:k}=(0,x.useKeyedValue)(_,()=>(0,o.api)(_)),[w,M]=(0,i.useState)(!0),[v,S]=(0,i.useState)(null),[F,z]=(0,i.useState)(650);if(j)return(0,f.jsx)(c.WidgetError,{title:"Historical chart unavailable",message:j,onRetry:k});if(C||!b)return(0,f.jsx)(h.Skeleton,{chart:!0,lines:2});const T=b.occurrence.horizons.find(e=>e.horizon===p),L=b.bars.filter(e=>e.index<=b.signal_index+(w?p:0));if(!L.length)return(0,f.jsx)(s.T,{children:"No historical candles are available for this occurrence."});const N=Math.max(F,280),R=65,W=Math.min(...L.map(e=>e.low)),P=Math.max(...L.map(e=>e.high)),A=Math.max(.12*(P-W),.002*P),B=P-W+2*A,D=(N-12-R)/L.length,G=e=>12+(e-L[0].index+.5)*D,O=e=>
111634+(P+A-e)/B*264,E=b.geometry,$=L[0].index,q=L[L.length-1].index,H=L.find(e=>e.index===v)||L[L.length-1],I=Array.isArray(E.troughs)?E.troughs:[],K=E.trough_levels||[],U=2===I.length&&Number.isFinite(E.intervening_extreme)&&Number.isFinite(E.neckline)?[[I[0],K[0]],[E.intervening_extreme,E.neckline],[I[1],K[1]]].filter(([e,i])=>Number.isFinite(e)&&Number.isFinite(i)):[],V=b.occurrence.formation_start_index,J=b.occurrence.detected_index??b.signal_index,Q=T?.max_up_bar?L.find(e=>e.index===b.signal_index+T.max_up_bar):void 0,X=T?.max_down_bar?L.find(e=>e.index===b.signal_index+T.max_down_bar):void 0;return(0,f.jsxs)(n.default,{style:{gap:12},children:[(0,f.jsxs)(n.default,{style:[s.s.between,{flexWrap:'wrap'}],children:[(0,f.jsxs)(n.default,{children:[(0,f.jsxs)(s.T,{style:{fontFamily:'InterSemi'},children:["Detected ",(0,u.date)(b.occurrence.signal_time)]}),(0,f.jsx)(s.T,{style:{color:s.C.muted,fontSize:12},children:"Original candles and frozen pattern geometry"})]}),(0,f.jsx)(s.Button,{kind:"outline",label:w?'Hide outcome candles':'Show outcome candles',onPress:()=>M(e=>!e)})]}),(0,f.jsx)(n.default,{onLayout:e=>z(Math.round(e.nativeEvent.layout.width)),style:{borderWidth:1,borderColor:s.C.line,borderRadius:12,overflow:'hidden',backgroundColor:s.C.dark},children:(0,f.jsxs)(l.default,{width:"100%",height:330,viewBox:`0 0 ${N} 330`,accessibilityLabel:`${e.symbol} historical daily candles. Amber marks detection; blue marks the next-open reference. Tap a candle for prices.`,role:"img",children:[w&&null!=b.reference_index&&b.reference_index<=q&&(0,f.jsx)(t.Rect,{x:G(b.reference_index)-D/2,y:34,width:Math.max(0,G(q)-G(b.reference_index)+D),height:264,fill:s.C.blueBg}),[0,.25,.5,.75,1].map(e=>{const i=W-A+e*B;return(0,f.jsxs)(t.G,{children:[(0,f.jsx)(t.Line,{x1:12,x2:N-R,y1:O(i),y2:O(i),stroke:s.C.line}),(0,f.jsx)(t.Text,{x:N-R+8,y:O(i)+4,fill:s.C.muted,fontSize:10,children:i.toFixed(2)})]},e)}),'CDLENGULFING'===e.pattern_id&&(0,f.jsx)(t.Rect,{x:G(Math.max($,V))-D/2,y:34,width:Math.max(D,(Math.min(q,J)-Math.max($,V)+1)*D),height:264,fill:s.C.amber,fillOpacity:.1,stroke:s.C.amber,strokeOpacity:.5}),L.map(e=>(0,f.jsxs)(t.G,{onPress:()=>S(e.index),children:[(0,f.jsx)(t.Rect,{x:G(e.index)-D/2,y:34,width:D,height:264,fill:H.index===e.index?s.C.ink:'transparent',fillOpacity:.06}),(0,f.jsx)(t.Line,{x1:G(e.index),x2:G(e.index),y1:O(e.high),y2:O(e.low),stroke:e.close>=e.open?s.C.green:s.C.red}),(0,f.jsx)(t.Rect,{x:G(e.index)-Math.max(1,.58*D)/2,y:O(Math.max(e.open,e.close)),width:Math.max(1,.58*D),height:Math.max(1,Math.abs(O(e.open)-O(e.close))),fill:e.close>=e.open?s.C.green:s.C.red})]},e.index)),3===U.length&&(0,f.jsx)(t.Polyline,{points:U.map(([e,i])=>`${G(e)},${O(i)}`).join(' '),fill:"none",stroke:s.C.amber,strokeWidth:2}),Number.isFinite(E.neckline)&&(0,f.jsx)(t.Line,{x1:G(Math.max($,V)),x2:G(b.signal_index),y1:O(E.neckline),y2:O(E.neckline),stroke:s.C.amber,strokeDasharray:"4 4"}),(0,f.jsx)(t.Line,{x1:G(b.signal_index),x2:G(b.signal_index),y1:27,y2:298,stroke:s.C.amber,strokeDasharray:"3 3"}),(0,f.jsx)(t.Text,{x:Math.min(N-R-70,Math.max(12,G(b.signal_index)-30)),y:20,fill:s.C.amber,fontSize:11,children:"Detected"}),w&&null!=T?.reference_price&&null!=b.reference_index&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(t.Line,{x1:G(b.reference_index),x2:N-R,y1:O(T.reference_price),y2:O(T.reference_price),stroke:s.C.blue,strokeDasharray:"4 4"}),(0,f.jsx)(t.Circle,{cx:G(b.reference_index),cy:O(T.reference_price),r:4,fill:s.C.blue})]}),w&&Q&&(0,f.jsx)(t.Circle,{cx:G(Q.index),cy:O(Q.high),r:4,stroke:s.C.green,strokeWidth:2,fill:s.C.dark}),w&&X&&(0,f.jsx)(t.Circle,{cx:G(X.index),cy:O(X.low),r:4,stroke:s.C.red,strokeWidth:2,fill:s.C.dark}),(0,f.jsx)(t.Text,{x:12,y:320,fill:s.C.muted,fontSize:10,children:(0,u.date)(L[0].time)}),(0,f.jsx)(t.Text,{x:N-R,y:320,textAnchor:"end",fill:s.C.muted,fontSize:10,children:(0,u.date)(L[L.length-1].time)})]})}),(0,f.jsxs)(n.default,{style:[s.s.row,{flexWrap:'wrap'}],children:[(0,f.jsxs)(s.T,{style:{fontSize:12},children:[(0,u.date)(H.time)," \xb7 Open ",H.open.toFixed(2)," \xb7 High ",H.high.toFixed(2)," \xb7 Low ",H.low.toFixed(2)," \xb7 Close ",H.close.toFixed(2)]}),(0,f.jsx)(s.Button,{kind:"ghost",label:"Previous candle",disabled:H.index<=$,onPress:()=>S(H.index-1)}),(0,f.jsx)(s.Button,{kind:"ghost",label:"Next candle",disabled:H.index>=q,onPress:()=>S(H.index+1)})]}),(0,f.jsxs)(s.T,{style:{color:s.C.muted,fontSize:12},children:["Amber: original pattern and detection. Blue: next candle\u2019s opening price; shaded area: the following ",p," daily candle",1===p?'':'s',". Green / red rings: highest / lowest price in that window."]}),(0,f.jsxs)(n.default,{style:[s.s.card,{padding:14,gap:5}],children:[(0,f.jsxs)(s.T,{children:["Reference ",T?.reference_price?.toFixed(2)??'not available'," \xb7 ",(0,u.date)(T?.reference_time)]}),(0,f.jsxs)(s.T,{children:["After ",p," candles: ",(0,u.signed)(T?.gross_return_pct)," \xb7 Largest rise: ",(0,u.signed)(T?.max_up_pct)," \xb7 Largest fall: ",(0,u.signed)(null==T?.max_down_pct?null:-T.max_down_pct)]}),(0,f.jsxs)(s.T,{style:{color:s.C.muted,fontSize:12}
1116,children:["Window ends ",(0,u.date)(T?.end_time),". ",'pending'===T?.status?'Still unfolding in this frozen data.':'quality_excluded'===T?.status?'Excluded because the measurement window has a data-quality issue.':'Gross price movements; no trade or achievable profit is implied.']})]})]})};var i=r(d[0]),n=e(r(d[1])),t=r(d[2]),l=e(t),s=r(d[3]),o=r(d[4]),x=r(d[5]),c=r(d[6]),h=r(d[7]),u=r(d[8]),f=r(d[9])},1023,[11,13,840,821,197,251,871,925,1020,6]); 1117__d(function(g,_r,_i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PatternGallery=function({slot:e,strategy:b,strategies:E,universeLabel:L,snapshot:w,filter:_,onFilter:I,onChooseStrategy:R,selectedId:v,refreshSeq:$,stale:A,ageDays:O,onSelect:F,onOpenFull:k,storedSnapshot:P,isStoredSelected:z,onSelectStored:M,onOpenStored:G}){const H=(0,s.useScannerNotDeployed)(),[D,X]=(0,t.useState)(0),W=D||320,K=(0,y.galleryColumns)(W),Y=(0,y.galleryPageSize)(K),B=(0,y.tileWidth)(W,K,y.TILE_GAP),q=(0,y.tileHeight)(W),N=!!b&&'research_pattern'!==b.source_type,U=!N&&w&&b&&w.strategyKey===b.key?w:null,V=N&&P&&P.stored&&P.strategyKey===b.key?P:null,J='done'===U?.phase?U.rows:null,Q='done'===U?.phase?U.allRows:[],Z='done'===V?.phase?V.rows:null,ee=(0,t.useMemo)(()=>Z?Z.map(e=>({key:`s:${e.match_id||e.symbol+':'+e.timeframe}`,symbol:e.symbol,company:e.company,timeframe:e.timeframe,stored:e})):(J||[]).map(e=>({key:e.detection_id,symbol:e.symbol,company:e.company,timeframe:e.timeframe,live:e})),[Z,J]),te=`${e}|${b?.key||''}`,[le,re]=(0,t.useState)(1),ie=`${te}|${_.state}|${_.sector||''}|${_.universe||''}`;(0,t.useEffect)(()=>re(1),[ie]);const se=(0,f.mountedCount)(le,Y,ee.length),oe=(0,t.useMemo)(()=>ee.slice(0,se),[ee,se]),ne=(0,t.useMemo)(()=>oe.map(e=>({symbol:e.symbol,timeframe:e.timeframe})),[oe]),{charts:ae,retry:de}=(0,s.useGallery)(ne,te,$),ce=(0,t.useMemo)(()=>oe.map(e=>{const t=ae[(0,f.chartKey)(e.symbol,e.timeframe)];if(!t||'queued'===t.phase||'loading'===t.phase)return{row:e,phase:'loading',tile:null};if('error'===t.phase)return{row:e,phase:'error',tile:null};try{return{row:e,phase:'done',tile:e.stored?(0,f.storedTileFromChart)(e.stored,t.body,u.TILE_BARS):(0,u.tileFromChart)(e.live,t.body,u.TILE_BARS)}}catch{return{row:e,phase:'error',tile:null}}}),[oe,ae]),he=(0,f.failedPages)(ce.map(e=>e.phase),Y),ue=(0,t.useRef)(F),ye=(0,t.useRef)(k);ue.current=F,ye.current=k;const fe=(0,t.useCallback)(e=>ue.current(e.detection),[]),me=(0,t.useCallback)(e=>ye.current(e.detection),[]),ge=(0,t.useRef)([]),pe=e=>{const t=ge.current[e],l=t?.querySelector?.('[role="button"]');(l||t)?.focus?.(),t?.scrollIntoView?.({block:'nearest'})},be=(e,t)=>{const l=(0,f.gridKey)(e,{key:t?.key??t?.nativeEvent?.key,shiftKey:x(t)},K,oe.length);l&&'move'===l.type&&(t.preventDefault?.(),l.index!==e&&pe(l.index))},xe=b?(0,f.strategyLabel)(b.name,b.timeframe):'',Te=(0,f.followText)(e,b?.name,b?.timeframe)+(N?' \xb7 Stored scan':''),Ce=(0,f.filterSummary)(_),je=Z?`${ee.length} stored setup${1===ee.length?'':'s'}`:'done'===U?.phase?(0,f.filterActive)(_)?`${ee.length} of ${Q.length} setups match`:`${ee.length} setup${1===ee.length?'':'s'}`:'',Se=e=>(0,p.jsx)(l.default,{accessibilityLabel:f.LOADING_TEXT,style:[i.s.row,{flexWrap:'wrap',gap:y.TILE_GAP}],children:Array.from({length:e}).map((e,t)=>(0,p.jsx)(T,{width:B,height:q},t))});let Ee;if(null!=H)Ee=(0,p.jsx)(o.ComingSoonPanel,{message:H,compact:!0});else if(b)if(!N||V&&'idle'!==V.phase&&'loading'!==V.phase)if(!N||'error'!==V.phase&&'stopped'!==V.phase)if(N&&!ee.length)Ee=(0,p.jsx)(S,{icon:V.unavailable?'info':'search',text:V.unavailable||(0,f.storedEmptyText)(xe,L,V.asOf)});else if(!N&&U&&'history'===U.listMode)Ee=(0,p.jsx)(S,{icon:"clock",text:(0,f.HISTORY_TEXT)(e)});else if(N||!U||U.canLive)if(N||U&&'idle'!==U.phase&&'loading'!==U.phase)if(N||'error'!==U.phase&&'stopped'!==U.phase)if(N||Q.length)if(N||ee.length){const e=(0,f.moreCount)(se,Y,ee.length),t=Math.ceil(ce.length/Y);Ee=(0,p.jsxs)(l.default,{style:{gap:y.TILE_GAP},children:[(0,p.jsx)(l.default,{role:"list","aria-label":`${f.GALLERY_TITLE}: ${xe}, ${ee.length} setups`,style:{gap:y.TILE_GAP},children:Array.from({length:t}).map((e,t)=>{const s=ce.slice(t*Y,(t+1)*Y);return(0,p.jsxs)(l.default,{style:{gap:y.TILE_GAP},children:[(0,p.jsx)(l.default,{style:[i.s.row,{flexWrap:'wrap',gap:y.TILE_GAP,alignItems:'flex-start'}],children:s.map((e,r)=>{const i=t*Y+r,s=e.row,o=s.stored?!!z?.(s.stored):s.live.detection_id===v,a=()=>s.stored?M?.(s.stored):F(s.live),u=()=>s.stored?G?.(s.stored):k(s.live);return(0,p.jsx)(l.default,{ref:e=>{ge.current[i]=e},role:"listitem",...(0,n.webOnly)({onKeyDown:e=>be(i,e)}),style:{width:B,height:q},children:'done'===e.phase&&e.tile&&s.stored?(0,p.jsx)(h.StoredTile,{row:s.stored,tile:e.tile,patternName:b?.pattern_name||'',selected:o,width:B,height:q,onSelect:a,onOpenFull:u}):'done'===e.phase&&e.tile?(0,p.jsx)(c.GalleryTile,{tile:e.tile,selected:o,width:B,height:q,onSelect:fe,onOpenFull:me}):'error'===e.phase?(0,p.jsx)(C,{row:s,width:B,height:q,selected:o,onSelect:a,onOpenFull:u}):(0,p.jsx)(T,{width:B,height:q})},s.key)})}),he.includes(t)&&(0,p.jsx)(S,{icon:"alert-triangle",text:f.PAGE_FAILED_TEXT,children:(0,p.jsx)(r.default,{accessibilityRole:"button",accessibilityLabel:`Retry these ${s.length} charts`,onPress:()=>de(s.map(e=>
1117({symbol:e.row.symbol,timeframe:e.row.timeframe}))),style:e=>j(e),children:(0,p.jsx)(i.T,{style:{fontSize:12,fontFamily:'InterSemi',color:i.C.green},children:"Retry"})})})]},t)})}),e>0&&(0,p.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`${(0,f.MORE_LABEL)(e)} charts`,onPress:()=>re(e=>e+1),style:e=>[j(e),{alignSelf:'flex-start'}],children:[(0,p.jsx)(i.Icon,{name:"chevron-down",size:14,color:i.C.green}),(0,p.jsx)(i.T,{style:{fontSize:13,fontFamily:'InterSemi',color:i.C.green},children:(0,f.MORE_LABEL)(e)})]}),0===e&&se>=f.MAX_TILES&&ee.length>se&&(0,p.jsx)(i.T,{style:{fontSize:12,lineHeight:17,color:i.C.muted},children:(0,f.CAP_TEXT)(f.MAX_TILES,ee.length)})]})}else Ee=(0,p.jsx)(S,{icon:"filter",text:f.FILTERED_OUT_TEXT,children:(0,p.jsx)(r.default,{accessibilityRole:"button",accessibilityLabel:"Clear the gallery filters",onPress:()=>I(f.EMPTY_FILTER),style:e=>j(e),children:(0,p.jsx)(i.T,{style:{fontSize:12,fontFamily:'InterSemi',color:i.C.green},children:"Clear filters"})})});else Ee=(0,p.jsx)(S,{icon:"search",text:(0,f.emptyText)(xe,L,U.asOf)});else Ee=(0,p.jsx)(S,{icon:"alert-triangle",text:f.ROWS_FAILED_TEXT,children:(0,p.jsx)(r.default,{accessibilityRole:"button",accessibilityLabel:`Retry ${xe} setups`,onPress:U.reload,style:e=>j(e),children:(0,p.jsx)(i.T,{style:{fontSize:12,fontFamily:'InterSemi',color:i.C.green},children:"Retry"})})});else Ee=Se(Math.min(Y,2*K));else Ee=(0,p.jsx)(S,{icon:"info",text:U.liveOff||(0,f.HISTORY_TEXT)(e)});else Ee=(0,p.jsx)(S,{icon:V.unavailable?'info':'alert-triangle',text:V.unavailable||f.STORED_FAILED_TEXT,children:!V.unavailable&&(0,p.jsx)(r.default,{accessibilityRole:"button",accessibilityLabel:`Retry ${xe}`,onPress:V.reload,style:e=>j(e),children:(0,p.jsx)(i.T,{style:{fontSize:12,fontFamily:'InterSemi',color:i.C.green},children:"Retry"})})});else Ee=Se(Math.min(Y,2*K));else Ee=(0,p.jsx)(S,{icon:"list",text:f.CHOOSE_TEXT});return(0,p.jsxs)(l.default,{role:"region","aria-label":`${f.GALLERY_TITLE}, scanner ${e}`,style:{gap:10,padding:12,borderRadius:12,borderWidth:1,borderColor:i.C.line,backgroundColor:i.C.bg},children:[(0,p.jsxs)(l.default,{style:[i.s.row,{flexWrap:'wrap',gap:8,rowGap:2,minHeight:28}],children:[(0,p.jsx)(i.Icon,{name:"grid",size:15,color:i.C.muted}),(0,p.jsx)(i.T,{role:"heading","aria-level":3,style:{fontFamily:'InterSemi',fontSize:14,lineHeight:20},children:f.GALLERY_TITLE}),(0,p.jsxs)(i.T,{accessibilityLiveRegion:"polite",...(0,n.webOnly)({'aria-live':'polite'}),style:{flexShrink:1,fontSize:12,lineHeight:17,color:i.C.muted},children:[Te,Ce?` \xb7 ${Ce}`:'',je?` \xb7 ${je}`:'']})]}),null==H&&!!b&&(0,p.jsx)(a.GalleryFilters,{stored:N,slot:e,strategy:b,strategies:E,universeLabel:L,allRows:Q,filter:_,onFilter:I,onChooseStrategy:R}),(0,p.jsx)(l.default,{onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width);X(e=>Math.abs(e-t)<2?e:t)},children:Ee}),(0,p.jsx)(n.StaleLine,{stale:A,ageDays:O})]})};var t=_r(d[0]),l=e(_r(d[1])),r=e(_r(d[2])),i=_r(d[3]),s=_r(d[4]),o=_r(d[5]),n=_r(d[6]),a=_r(d[7]),c=_r(d[8]),h=_r(d[9]),u=_r(d[10]),y=_r(d[11]),f=_r(d[12]),p=_r(d[13]);const b={borderRadius:12,borderWidth:1,borderColor:i.C.line,backgroundColor:i.C.paper,overflow:'hidden'},x=e=>!(!e?.shiftKey&&!e?.nativeEvent?.shiftKey);function T({width:e,height:t}){return(0,p.jsxs)(l.default,{"aria-hidden":!0,style:[b,{width:e,height:t,padding:10,gap:10}],children:[(0,p.jsx)(l.default,{style:{height:12,width:'40%',borderRadius:3,backgroundColor:i.C.line}}),(0,p.jsx)(l.default,{style:{flex:1,borderRadius:6,backgroundColor:i.C.soft,opacity:.5}}),(0,p.jsx)(l.default,{style:{height:10,width:'60%',borderRadius:3,backgroundColor:i.C.line,opacity:.6}})]})}function C({row:e,width:t,height:s,selected:o,onSelect:a,onOpenFull:c}){return(0,p.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`${e.symbol}, ${e.company}. ${f.TILE_FAILED_TEXT}.${o?' Selected.':''}`,accessibilityState:{selected:o},...(0,n.webOnly)({'aria-pressed':o}),onPress:e=>x(e)?c():a(),style:e=>[b,{width:t,height:s,minHeight:44,padding:10,gap:8,borderColor:o?i.C.green:i.C.line,backgroundColor:o?i.C.soft:e.hovered?i.C.dark:i.C.paper},e.focused&&n.web?{outlineStyle:'solid',outlineWidth:2,outlineColor:i.C.mint,outlineOffset:1}:null],children:[(0,p.jsx)(i.T,{numberOfLines:1,style:{fontSize:13,lineHeight:17,fontFamily:'InterSemi',color:o?i.C.mint:i.C.ink},children:e.symbol}),(0,p.jsx)(i.T,{numberOfLines:1,style:{fontSize:11,lineHeight:14,color:i.C.muted},children:e.company}),(0,p.jsxs)(l.default,{style:{flex:1,alignItems:'center',justifyContent:'center',gap:6},children:[(0,p.jsx)(i.Icon,{name:"alert-circle",size:16,color:i.C.muted}),(0,p.jsx)(i.T,{style:{fontSize:12,lineHeight:17,color:i.C.muted},children:f.TILE_FAILED_TEXT})]})]})}const j=(e,t=i.C.green)=>[i.s.row,{gap:6,minHeight:44,paddingHorizontal:14,borderRadius:10,borderWidth:1,justifyContent:'center',borderColor:t,backgroundColor:e.hovered||e.focused?i.C.soft:'transparent',opacity:e.pressed?.75:1}];function S({icon:e,text:t,children:r}){return(0,p.jsxs)(l.default,{style:[i.s.row,{flexWrap:'wrap',gap:10,padding:14,borderRadius:10,borderWidth:1,borderColor:i.C.line}],children:[(0,p.jsx)(i.Icon,{name:e,size:16,color:i.C.muted}),(0,p.jsx)(i.T,{style:{flex:1,minWidth:200,fontSize:13,lineHeight:19,color:i.C.muted},children:t}),r]})}},1024,[11,13,375,821,1005,883,925,1025,1026,1029,1009,1028,1008,6]); 1118__d(function(g,r,i,a,m,_e,d){"use strict";
1118function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Chip",{enumerable:!0,get:function(){return p}}),_e.GalleryFilters=function({slot:e,strategy:s,strategies:o,universeLabel:C,allRows:x,filter:v,onFilter:S,onChooseStrategy:j,stored:_=!1}){const[E,P]=(0,l.useState)(!1),[w,T]=(0,l.useState)(!1),R=(0,l.useRef)(null),A=(0,l.useRef)(null),$=(0,y.sectorOptions)(x),I=(0,y.universeAvailable)(x),L=s?(0,y.strategyLabel)(s.name,s.timeframe):'Choose a strategy';return(0,f.jsxs)(t.default,{style:{gap:8},children:[(0,f.jsxs)(t.default,{style:[n.s.row,{flexWrap:'wrap',gap:8,rowGap:8}],children:[(0,f.jsx)(p,{ref:R,label:`Strategy: ${L}`,icon:"chevron-down",a11y:`Gallery strategy, scanner ${e}: ${L}. Change strategy`,onPress:()=>P(!0)}),_?(0,f.jsx)(n.T,{style:h,children:y.STORED_FILTER_NOTE}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(t.default,{role:"radiogroup","aria-label":"Setup state",style:[n.s.row,{gap:6}],children:y.STATE_CHIPS.map(e=>(0,f.jsx)(p,{role:"radio",label:e.label,a11y:`State: ${e.label}`,on:v.state===e.value,onPress:()=>{return l=e.value,S({...v,state:l});var l}},e.value))}),(0,f.jsx)(p,{ref:A,label:`Sector: ${v.sector||'All'}`,icon:"chevron-down",a11y:`Sector: ${v.sector||'all sectors'}. Change sector`,disabled:!$.length&&!v.sector,onPress:()=>T(!0)}),(0,y.filterActive)(v)&&(0,f.jsx)(p,{label:"Clear filters",icon:"x",onPress:()=>S(y.EMPTY_FILTER)})]})]}),!_&&(0,f.jsxs)(t.default,{style:[n.s.row,{flexWrap:'wrap',gap:8,rowGap:8}],children:[(0,f.jsx)(t.default,{role:"radiogroup","aria-label":"Universe","aria-disabled":!I,style:[n.s.row,{flexWrap:'wrap',gap:6,rowGap:6}],children:y.UNIVERSE_CHIPS.map(e=>(0,f.jsx)(p,{role:"radio",label:e.label,a11y:I?`Universe: ${e.label}`:`${e.label}. ${y.UNIVERSE_COMING}`,on:I&&v.universe===e.key,disabled:!I,onPress:()=>S({...v,universe:v.universe===e.key?null:e.key})},e.key))}),!I&&(0,f.jsx)(n.T,{style:h,children:y.UNIVERSE_COMING}),(0,f.jsx)(p,{label:y.MARKET_CAP_LABEL,a11y:`${y.MARKET_CAP_LABEL}. ${y.MARKET_CAP_NOTE}`,disabled:!0}),(0,f.jsx)(n.T,{style:h,children:y.MARKET_CAP_NOTE})]}),(0,f.jsx)(u.StrategyPicker,{open:E,onClose:()=>P(!1),anchor:R,strategies:o,currentKey:s?.key??null,universeLabel:C,cardLabel:`Scanner ${e}`,onChoose:e=>j(e)}),(0,f.jsx)(c.Popover,{open:w,onClose:()=>T(!1),anchor:A,label:"Sector",role:"none",width:260,children:(0,f.jsx)(b.RadioMenu,{label:"Sector",value:v.sector||'',onClose:()=>T(!1),onPick:e=>S({...v,sector:e||null}),note:"Sectors of the setups loaded now.",options:[{value:'',label:'All sectors'},...$.map(e=>({value:e.sector,label:e.sector,detail:`${e.count} setup${1===e.count?'':'s'}`}))]})})]})};var l=r(d[0]),s=e(l),t=e(r(d[1])),o=e(r(d[2])),n=r(d[3]),c=r(d[4]),u=r(d[5]),b=r(d[6]),y=r(d[7]),f=r(d[8]);const p=s.default.forwardRef(function({label:e,a11y:l,on:s=!1,disabled:t=!1,onPress:c,icon:u,role:b="button"},y){return(0,f.jsxs)(o.default,{ref:y,role:b,"aria-checked":'radio'===b?s:void 0,"aria-disabled":t,accessibilityLabel:l||e,accessibilityState:{selected:s,disabled:t},disabled:t,onPress:c,style:e=>[n.s.row,{gap:6,minHeight:44,paddingHorizontal:12,borderRadius:10,borderWidth:1,borderColor:s?n.C.green:n.C.line,backgroundColor:s||e.hovered||e.focused?n.C.soft:n.C.paper,opacity:t?.5:e.pressed?.75:1}],children:[(0,f.jsx)(n.T,{numberOfLines:1,style:{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:s?n.C.mint:t?n.C.muted:n.C.ink},children:e}),!!u&&(0,f.jsx)(n.Icon,{name:u,size:14,color:n.C.muted})]})}),h={fontSize:11,lineHeight:15,fontFamily:'InterMedium',color:n.C.muted}},1025,[11,13,375,821,871,1016,925,1008,6]); 1119__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"GalleryTile",{enumerable:!0,get:function(){return y}});var t=r(_d[0]),n=e(r(_d[1])),l=e(r(_d[2])),o=r(_d[3]),s=r(_d[4]),d=r(_d[5]),c=r(_d[6]),u=r(_d[7]);const h={confirmed:o.C.green,forming:o.C.amber,done:o.C.muted},f=e=>e&&s.web?{outlineStyle:'solid',outlineWidth:2,outlineColor:o.C.mint,outlineOffset:1}:null,b=e=>!(!e?.shiftKey&&!e?.nativeEvent?.shiftKey),y=(0,t.memo)(function({tile:e,selected:y,onSelect:C,onOpenFull:p,width:x,height:j}){const S=e.detection,H=e.drawable?null:(0,c.markerOnlyText)(e.geometry_note),L=(0,c.tileChartWidth)(x),O=(0,c.tileChartHe
1119ight)(j,!!H),T=h[(0,c.tileTone)(S.state)],_=(0,t.useCallback)(t=>{b(t)?p(e):C(e)},[e,C,p]),E=(0,t.useCallback)(()=>p(e),[e,p]);return(0,u.jsxs)(n.default,{style:{width:x,height:j},children:[(0,u.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:(0,c.tileA11y)(e,y,{numbers:c.EVIDENCE_NUMBERS}),accessibilityHint:c.OPEN_FULL_HINT,accessibilityState:{selected:y},...(0,s.webOnly)({'aria-pressed':y}),onPress:_,style:e=>[{flex:1,minHeight:44,padding:c.TILE_PAD,gap:4,borderRadius:12,borderWidth:1,overflow:'hidden',borderColor:y?o.C.green:o.C.line,backgroundColor:y?o.C.soft:e.hovered?o.C.dark:o.C.paper,opacity:e.pressed?.85:1},f(!!e.focused)],children:[(0,u.jsxs)(n.default,{style:[o.s.row,{gap:6,minHeight:18,paddingRight:100}],children:[(0,u.jsx)(o.T,{numberOfLines:1,style:{fontSize:13,lineHeight:17,fontFamily:'InterSemi',color:y?o.C.mint:o.C.ink,flexShrink:1},children:S.symbol}),(0,u.jsx)(n.default,{style:{paddingHorizontal:6,minHeight:18,justifyContent:'center',borderRadius:5,borderWidth:1,borderColor:T},children:(0,u.jsx)(o.T,{numberOfLines:1,style:{fontSize:11,lineHeight:14,fontFamily:'InterSemi',color:T},children:(0,c.tileStateLabel)(S)})})]}),(0,u.jsx)(o.T,{numberOfLines:1,style:{fontSize:11,lineHeight:14,color:o.C.muted},children:S.company}),(0,u.jsx)(d.MiniPatternChart,{bars:e.bars,lines:e.lines,drawable:e.drawable,width:L,height:O,timeframe:S.timeframe}),(0,u.jsx)(o.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:o.C.muted,fontVariant:['tabular-nums']},children:(0,c.chipText)(S,e.evidence,{numbers:c.EVIDENCE_NUMBERS})}),!!H&&(0,u.jsx)(o.T,{numberOfLines:2,style:{fontSize:11,lineHeight:14,color:o.C.muted},children:H})]}),(0,u.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:`Open full chart, ${S.symbol}`,onPress:E,hitSlop:8,style:e=>[{position:'absolute',top:c.TILE_PAD-2,right:c.TILE_PAD,minHeight:24,paddingHorizontal:4,justifyContent:'center',borderRadius:6,opacity:e.pressed?.7:1},f(!!e.focused)],children:(0,u.jsx)(o.T,{style:{fontSize:11,lineHeight:14,fontFamily:'InterMedium',color:o.C.mint,textDecorationLine:'underline'},children:"Open full chart"})})]})})},1026,[11,13,375,821,869,1027,1028,6]); 1120__d(function(g,_r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TAG_INK",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"TAG_MUTED",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"TAG_FILL",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"MiniPatternChart",{enumerable:!0,get:function(){return u}});var t=_r(d[0]),i=e(_r(d[1]));_r(d[2]);var r=_r(d[3]),n=e(r),o=_r(d[4]),l=_r(d[5]),s=_r(d[6]);const h=o.C.ink,c=o.C.muted,x=o.C.line,y='Inter',f={'aria-hidden':!0},u=(0,t.memo)(function({bars:e,lines:u,drawable:k,width:p,height:m}){const j=(0,t.useMemo)(()=>(0,l.miniChartModel)(e,u,k,p,m),[e,u,k,p,m]);if(!j)return(0,s.jsx)(i.default,{...f,style:{width:p,height:m,borderRadius:8,backgroundColor:o.C.bg}});const{plot:C,volume:b,tag:T}=j;return(0,s.jsx)(i.default,{...f,pointerEvents:"none",style:{width:j.width,height:j.height},children:(0,s.jsxs)(n.default,{width:j.width,height:j.height,children:[j.priceTicks.map(e=>(0,s.jsx)(r.Line,{x1:C.left,x2:C.right,y1:e.y,y2:e.y,stroke:o.C.line,strokeWidth:.6},'g'+e.value)),(0,s.jsx)(r.Line,{x1:C.left,x2:C.right,y1:b.top-2,y2:b.top-2,stroke:o.C.line,strokeWidth:.6}),!!j.volumePath&&(0,s.jsx)(r.Path,{d:j.volumePath,fill:o.C.muted,fillOpacity:.28}),!!j.upWick&&(0,s.jsx)(r.Path,{d:j.upWick,stroke:o.C.green,strokeOpacity:.75,strokeWidth:.8,fill:"none"}),!!j.downWick&&(0,s.jsx)(r.Path,{d:j.downWick,stroke:o.C.red,strokeOpacity:.75,strokeWidth:.8,fill:"none"}),!!j.upBody&&(0,s.jsx)(r.Path,{d:j.upBody,fill:o.C.green,fillOpacity:.8}),!!j.downBody&&(0,s.jsx)(r.Path,{d:j.downBody,fill:o.C.red,fillOpacity:.8}),(0,s.jsxs)(r.G,{children:[j.ranges.map((e,t)=>(0,s.jsx)(r.Rect,{x:e.x,y:e.y,width:e.width,height:e.height,fill:o.C.amber,fillOpacity:.06,stroke:o.C.amber,strokeOpacity:.6,strokeWidth:.8,strokeDasharray:"2 2"},'r'+t)),j.lines.map((e,t)=>(0,s.jsx)(r.Path,{d:e.d,stroke:e.color,strokeOpacity:.7,strokeWidth:1.1,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},'l'+t))]}),j.priceTicks.map(e=>(0,s.jsx)(r.Text,{x:j.axisX,y:e.y+4,fill:o.C.muted,fontSize:l.CHART_FONT,fontFamily:y,children:e.label},'p'+e.value)),j.monthTicks.map(e=>(0,s.jsx)(r.Text,{x:e.x,y:j.axisY,textAnchor:"middle",fill:o.C.muted,fontSize:l.CHART_FONT,fontFamily:y,children:e.label},'m'+e.index)),T&&(0,s.jsxs)(r.G,{children:[(0,s.jsx)(r.Line,{x1:C.left,x2:C.right,y1:T.y,y2:T.y,stroke:c,strokeOpacity:.35,strokeWidth:.6,strokeDasharray:"2 3"}),(0,s.jsx)(r.Rect,{x:C.right+1,y:T.y-T.boxHeight/2,width:j.width-C.right-1,height:T.boxHeight,rx:3,fill:x}),(0,s.jsx)(r.Text,{x:j.axisX,y:T.y+(T.change?-2:4),fill:h,fontSize:l.CHART_FONT,fontFamily:"InterSemi",children:T.price}),!!T.change&&(0,s.jsx)(r.Text,{x:j.axisX,y:T.y+11,fill:c,fontSize:l.CHART_FONT,fontFamily:y,children:T.change})]})]})})})},1027,[11,13,136,840,821,1028,6]); 1121__d(function(g,_r,_i,a,_m,_e,_d){"use strict";
1121Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MINUS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"MONTHS",{enumerable:!0,get:function(){return r}}),_e.galleryColumns=function(e){const n=t(e)?e:0;return n>=1280?4:n>=1024?3:n>=760?2:1},_e.galleryPageSize=function(e){return 3===e?9:12},Object.defineProperty(_e,"TILE_HEIGHT",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"TILE_HEIGHT_PHONE",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"TILE_GAP",{enumerable:!0,get:function(){return l}}),_e.tileHeight=function(e){return(t(e)?e:0)<760?i:o},_e.tileWidth=function(e,t,n=l){const r=Math.max(1,Math.floor(t||1));return Math.max(0,Math.floor((Math.max(0,e||0)-n*(r-1))/r))},Object.defineProperty(_e,"TILE_PAD",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"TILE_CHROME",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"TILE_NOTE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"MIN_CHART_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.tileChartHeight=function(e,t){return Math.max(h,Math.floor(e-u-(t?s:0)))},_e.tileChartWidth=function(e){return Math.max(0,Math.floor(e-16-2))},_e.groupedNumber=f,_e.signedPct=d,Object.defineProperty(_e,"EVIDENCE_NUMBERS",{enumerable:!0,get:function(){return m}}),_e.detectedText=p,_e.evidenceChipText=$,_e.chipText=function(e,t,n={}){const r=$(t,n);return r?`${p(e)} \xb7 ${r}`:p(e)},_e.markerOnlyText=x,_e.priceTag=y,_e.tileTone=function(e){return'confirmed'===e?'confirmed':'forming'===e?'forming':'done'},_e.tileStateLabel=T,_e.tileA11y=function(e,t=!1,n={}){const r=e.detection,o=y(e.bars),i=[`${r.symbol}, ${r.company}.`,`${r.pattern_name||r.pattern_id}, ${T(r)}.`,`${p(r).replace(' \xb7 ',', ')}.`];o&&i.push(`${o.spoken}.`);i.push(e.drawable?'Pattern lines drawn from the detector.':`${x(e.geometry_note).replace(' \u2014 ',': ')}.`);const l=$(e.evidence,n);l&&i.push(`Evidence: ${l.replace(/ \xb7 /g,', ')}.`);t&&i.push('Selected.');return i.join(' ')},Object.defineProperty(_e,"OPEN_FULL_HINT",{enumerable:!0,get:function(){return v}}),_e.priceTicks=H,_e.monthTicks=S,Object.defineProperty(_e,"CHART_FONT",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"labelWidth",{enumerable:!0,get:function(){return w}}),_e.miniChartModel=function(n,r,o,i,l){const c=n?.c?.length||0,u=Math.max(0,Math.floor(i||0)),s=Math.max(0,Math.floor(l||0));if(!c||u<60||s<60)return null;const h=y(n),f=h?Math.max(w(h.price),h.change?w(h.change):0):0,d=Math.max(44,f+10),m=Math.round(.15*s),M=u-d,p=s-15,b=p-m,$=b-4,x={lines:o?r:[]},_=[...n.l,...n.h,...(0,e.visibleDrawingValues)(x,0,c-1)].filter(t);let T=Math.min(..._),v=Math.max(..._);T===v&&(T-=1,v+=1);const O=.04*(v-T),E=v-T+2*O,N=$-6,P=(M-1)/c,j=e=>1+(e+.5)*P,I=e=>6+(v+O-e)/E*N,L=Math.max(.6,Math.min(8,.66*P));let C='',D='',F='',A='',R='';const W=Math.max(0,...n.v.filter(t));for(let e=0;e<c;e++){const r=n.o[e],o=n.h[e],i=n.l[e],l=n.c[e];if(![r,o,i,l].every(t))continue;const c=j(e),u=l>=r,s=I(Math.max(r,l)),h=I(Math.min(r,l)),f=Math.max(.8,h-s),d=`M${k(c)} ${k(I(o))}V${k(I(i))}`,M=`M${k(c-L/2)} ${k(s)}h${k(L)}v${k(f)}h${k(-L)}Z`;u?(C+=d,D+=M):(F+=d,A+=M);const b=n.v[e];if(t(b)&&W>0&&b>0){const e=Math.max(.5,b/W*(m-2));R+=`M${k(c-L/2)} ${k(p-e)}h${k(L)}v${k(e)}h${k(-L)}Z`}}const B=o?(0,e.drawingLines)(x).map(n=>({d:(n.points||[]).filter(e=>t(e?.index)&&t(e?.value)).map((e,t)=>`${t?'L':'M'}${k(j(e.index))} ${k(I(e.value))}`).join(''),color:(0,e.drawingColor)(n),label:String(n.label)})).filter(e=>e.d.includes('L')):[],G=o?(0,e.candleRanges)(x).map(e=>({x:j(e.first)-.5*P,y:I(e.high)-2,width:Math.max(P,(e.last-e.first+1)*P),height:Math.max(4,I(e.low)-I(e.high)+4),label:String(e.label)})):[],J=h?.change?28:16,V=h?Math.max(6+J/2,Math.min($-J/2,I(h.close))):0,U=H(T,v).map(e=>({...e,y:I(e.value)})).filter(e=>e.y>=12&&e.y<=$-2&&(!h||Math.abs(e.y-V)>J/2+7)),Z=S(n.t,Math.ceil(34/Math.max(P,.01))).map(e=>({...e,x:j(e.index)})).filter(e=>e.x>=13&&e.x<=M-12);return{width:u,height:s,plot:{left:1,right:M,top:6,bottom:$},volume:{top:b,bottom:p},axisY:s-3,axisX:M+5,upWick:C,upBody:D,downWick:F,downBody:A,volumePath:R,lines:B,ranges:G,priceTicks:U,monthTicks:Z,tag:h?{...h,y:V,boxHeight:J}:null}};var e=_r(_d[0]);const t=e=>'number'==typeof e&&Number.isFinite(e),n='\u2212',r=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];const o=250,i=220,l=12;const c=8,u=78,s=32,h=110;function f(e,r=2){if(!t(e))return'\u2014';const o=e<0,i=Math.abs(e).toFixed(Math.max(0,r)),[l,c]=i.split('.'),u=l.slice(-3),s=l.slice(0,-3),h=s?s.replace(/\B(?=(\d{2})+(?!\d))/g,',')+',':'';return`${o&&0!==Number(i)?n:''}${h}${u}${null!=c?'.'+c:''}`}function d(e,t=1){const r=Math.abs(e).toFixed(t);return`${0===Number(r)?'':e>0?'+':n}${r}%`}const m=!1;function M(e){const t=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(e||''));return t&&r[Number(t[2])-1]?`${Number(t[3])} ${r[Number(t[2])-1]}`:null}function p(e){const n=e?.bars_since_signal,r=!e?.timeframe||'1D'===e.timeframe?'day':'candle',o=t(n)&&n>=0?0===n?'Detected on the latest candle':`Detected ${n} ${r}${1===n?'':'s'} ago`:null,i=M(e?.detected_day||e?.detected_at);return o?i?`${o} \xb7 since ${i}`:o:i?`Detected ${i}`:'Detected'}function b(e){return!0===e.small_sample||t(e.n)&&t(e.min_trades)&&e.n<e.min_trades}function $(e,n={}){if(!e)return null;const r=(n.numbers??m)&&t(e.n)&&e.n>=0?Math.round(e.n):null;switch(e.basis){case'tested_rule':if(b(e))return null!=r?`Small sample \xb7 n ${r} (later test)`:'Small sample';if(null==r)return'Tested rule';return`Tested rule${t(e.etv_pct)?` \xb7 ETV ${d(e.etv_pct,1)} after costs`:''} \xb7 n ${r} (later test)`;case'history_only':return null!=r?`History only \xb7 not a tested exit rule \xb7 n ${r}`:'History only \xb7 not a tested exit rule';case'mismatch':return'No matching evidence for this detection';case'not_studied':return'Not studied in the research run';default:return null}}function x(e){const t=String(e||'').trim().replace(/^marker only\s*[:\u2014\u2013-]\s*/i,'');return t?`Marker only \u2014 ${t}`:'Marker only'}function y(e){const n=e?.c||[],r=n[n.length-1],o=n[n.length-2];if(!t(r))return null;const i=f(r,2);if(!t(o)||0===o)return{price:i,change:null,spoken:`Last close ${i}`,close:r};const l=(r-o)/o*100,c=d(l,2),u=Math.abs(l).toFixed(2);return{price:i,change:c,spoken:`Last close ${i}, ${0===Number(u)?'unchanged on the day':`${l>0?'up':'down'} ${u}% on the day`}`,close:r}}
1121const _={forming:'Forming',confirmed:'Confirmed',invalidated:'Invalidated',expired:'Expired'};function T(e){return e?.state_label||_[String(e?.state)]||String(e?.state||'\u2014')}const v='Shift+Enter opens the full chart.',O=[10,5,2.5,2,1];function E(e){if(!(e>0))return 1;const t=Math.pow(10,Math.floor(Math.log10(e))),n=e/t;return(n<=1?1:n<=2?2:n<=2.5?2.5:n<=5?5:10)*t}function N(e){const t=Math.pow(10,Math.floor(Math.log10(e)+1e-9)),n=Math.round(e/t*10)/10,r=O.indexOf(n);return r>=0&&r<O.length-1?O[r+1]*t:5*t/10}function P(e){const t=Math.floor(Math.log10(e)+1e-9),n=Math.round(e/Math.pow(10,t)*10)/10;return Math.max(0,(2.5===n?1:0)-t)}function H(e,n,r=3){if(!t(e)||!t(n))return[];n<e&&([e,n]=[n,e]);const o=n-e;if(0===o)return[{value:e,label:f(e,e>=1e3?0:2)}];const i=e+.05*o,l=n-.05*o;let c=E(o/2),u=[];for(let e=0;e<16;e++){u=[];for(let e=Math.ceil(i/c)*c;e<=l+1e-9;e+=c)u.push(Math.round(e/c)*c);if(u.length>=r)break;c=N(c)}if(u.length>r){const e=Math.floor((u.length-1)/(r-1)),t=Math.floor((u.length-1-e*(r-1))/2);u=Array.from({length:r},(n,r)=>u[t+r*e])}const s=P(c);return u.map(e=>({value:e,label:f(e,s)}))}function S(e,t=1){const n=[];let o='';return(e||[]).forEach((e,i)=>{const l=/^(\d{4})-(\d{2})/.exec(String(e||''));if(!l)return;const c=l[1]+l[2];if(i>0&&o&&c!==o){const e=Number(l[2]),o=1===e?`Jan \u2019${l[1].slice(2)}`:r[e-1];(!n.length||i-n[n.length-1].index>=t)&&n.push({index:i,label:o})}o=c}),n}const j=11,w=(e,t=j)=>Math.ceil([...e].reduce((e,t)=>e+(/[0-9]/.test(t)?.62:/[,.:' \u2019]/.test(t)?.3:/[+\u2212%]/.test(t)?.62:.6),0)*t),k=e=>e.toFixed(2)},1028,[866]); 1122__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"StoredTile",{enumerable:!0,get:function(){return p}});var t=r(d[0]),l=e(r(d[1])),n=e(r(d[2])),o=r(d[3]),s=r(d[4]),c=r(d[5]),u=r(d[6]),h=r(d[7]),f=r(d[8]);const b=e=>e&&s.web?{outlineStyle:'solid',outlineWidth:2,outlineColor:o.C.mint,outlineOffset:1}:null,y=e=>!(!e?.shiftKey&&!e?.nativeEvent?.shiftKey),p=(0,t.memo)(function({row:e,tile:t,patternName:p,selected:C,width:_,height:x,onSelect:O,onOpenFull:S}){const T=t.drawable?null:(0,u.markerOnlyText)(t.geometry_note||h.STORED_NO_MATCH),j=(0,u.tileChartWidth)(_),H=(0,u.tileChartHeight)(x,!!T);return(0,f.jsxs)(l.default,{style:{width:_,height:x},children:[(0,f.jsxs)(n.default,{accessibilityRole:"button",accessibilityLabel:(0,h.storedA11y)(e,p,t.drawable,t.geometry_note,C),accessibilityHint:u.OPEN_FULL_HINT,accessibilityState:{selected:C},...(0,s.webOnly)({'aria-pressed':C}),onPress:e=>y(e)?S():O(),style:e=>[{flex:1,minHeight:44,padding:u.TILE_PAD,gap:4,borderRadius:12,borderWidth:1,overflow:'hidden',borderColor:C?o.C.green:o.C.line,backgroundColor:C?o.C.soft:e.hovered?o.C.dark:o.C.paper,opacity:e.pressed?.85:1},b(!!e.focused)],children:[(0,f.jsx)(l.default,{style:[o.s.row,{gap:6,minHeight:18,paddingRight:100}],children:(0,f.jsx)(o.T,{numberOfLines:1,style:{fontSize:13,lineHeight:17,fontFamily:'InterSemi',color:C?o.C.mint:o.C.ink,flexShrink:1},children:e.symbol})}),(0,f.jsx)(o.T,{numberOfLines:1,style:{fontSize:11,lineHeight:14,color:o.C.muted},children:e.company}),(0,f.jsx)(c.MiniPatternChart,{bars:t.bars,lines:t.lines,drawable:t.drawable,width:j,height:H,timeframe:e.timeframe}),(0,f.jsx)(o.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:'Small sample'===e.sample_label||'No history'===e.sample_label?o.C.amber:o.C.muted,fontVariant:['tabular-nums']},children:(0,h.storedChipText)(e)}),!!T&&(0,f.jsx)(o.T,{numberOfLines:2,style:{fontSize:11,lineHeight:14,color:o.C.muted},children:T})]}),(0,f.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Open full chart, ${e.symbol}`,onPress:S,hitSlop:8,style:e=>[{position:'absolute',top:u.TILE_PAD-2,right:u.TILE_PAD,minHeight:24,paddingHorizontal:4,justifyContent:'center',borderRadius:6,opacity:e.pressed?.7:1},b(!!e.focused)],children:(0,f.jsx)(o.T,{style:{fontSize:11,lineHeight:14,fontFamily:'InterMedium',color:o.C.mint,textDecorationLine:'underline'},children:"Open full chart"})})]})})},1029,[11,13,375,821,869,1027,1028,1008,6]); 1123__d(function(g,r,i,a,m,e,d){"use strict";
1123Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=r(d[0]).FalconBrief},1030,[1031]); 1124__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return v}}),_e.FalconBrief=T;var t=_r(_d[0]),n=e(t),o=e(_r(_d[1])),i=e(_r(_d[2])),l=e(_r(_d[3]));_r(_d[4]);var r=e(_r(_d[5])),s=_r(_d[6]),a=_r(_d[7]),c=_r(_d[8]),d=_r(_d[9]),u=_r(_d[10]);const h=6e4,f=6e5,m=e=>Number.isFinite(e)?e.toLocaleString('en-IN'):'\u2013',p=e=>!!e&&/^\s*[\d,]+/.test(e),y=e=>`${p(e.input.scope)?e.input.scope:`${m(e.input.count)} ${e.input.unit}${e.input.scope?` \xb7 ${e.input.scope}`:''}`}${e.input.window?` \xb7 ${e.input.window}`:''}`,b=e=>{const t=e.output,n=[];if(t.labels&&'object'==typeof t.labels)for(const[e,o]of Array.isArray(t.labels)?t.labels.map(e=>[e.label??e.name,e.count]):Object.entries(t.labels))null!=o&&n.push(`${m(Number(o))} ${String(e).replace(/_/g,' ')}`);return Number.isFinite(t.live)&&n.push(`${m(t.live)} still forming or complete`),n.join(' \xb7 ')},x=e=>p(e.output.text)?e.output.text:`${m(e.output.count)}${null!=e.output.of?` of ${m(e.output.of)}`:''} ${e.output.text}`,j=e=>{const t=(0,d.toMs)(e);return Number.isFinite(t)?new Date(t).toLocaleTimeString('en-IN',{hour:'2-digit',minute:'2-digit',hour12:!1,timeZone:'Asia/Kolkata'}):''};function C(){const[e,n]=(0,t.useState)(null),[o,i]=(0,t.useState)(null),[l,r]=(0,t.useState)(!0),[s,a]=(0,t.useState)(0);return(0,t.useEffect)(()=>{let e,t=!0,o=!0;const l=globalThis.document,s=()=>{l&&!l.hidden&&(clearTimeout(e),a())};l?.addEventListener?.('visibilitychange',s);const a=async()=>{if(o||!l?.hidden){o=!1;try{const e=await(0,c.api)('/api/falcon/brief');if(!t)return;e&&!1!==e.available&&Array.isArray(e.insights)?(n(e),i(null)):i({missing:!0,msg:''})}catch(e){if(!t)return;i({missing:404===e?.status,msg:e?.message||''})}finally{t&&(r(!1),e=setTimeout(a,h))}}else e=setTimeout(a,h)};return a(),()=>{t=!1,clearTimeout(e),l?.removeEventListener?.('visibilitychange',s)}},[s]),{brief:e,err:o,loading:l,retry:()=>{r(!0),a(e=>e+1)}}}function M({mods:e,col:o,scanKey:i,lockKey:l,onHub:r}){const s=(0,t.useRef)(null);return(0,t.useEffect)(()=>{const t=s.current;if(!t)return;const n=t.getContext('2d'),i=globalThis.devicePixelRatio||1;let a=0;const c=performance.now(),d=(e,t)=>{const n=1-2*(t+.5)/e,o=Math.sqrt(1-n*n),i=Math.PI*(3-Math.sqrt(5))*t;return[Math.cos(i)*o,n,Math.sin(i)*o]},u=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,h=e.map((t,n)=>d(Math.max(1,e.length),n)),f=[],m=[],p=[];h.forEach((e,t)=>{const n=Array.from({length:90},()=>{const n=.25+.5*Math.random(),o=e.map(e=>e*(.25+.72*Math.random())+(Math.random()-.5)*n),i=Math.hypot(...o);return i>.98&&o.forEach((e,t)=>o[t]*=.98/i),{k:t,v:o,t:Math.random()}});n.forEach(e=>n.filter(t=>t!==e).sort((t,n)=>u(t.v,e.v)-u(n.v,e.v)).slice(0,2).forEach(n=>m.push([e.v,n.v,t]))),n.slice(0,6).forEach(n=>m.push([e,n.v,t])),f.push(...n)});for(let e=0;e<1400;e++){const e=2*Math.random()-1,t=6.28*Math.random(),n=Math.cbrt(Math.random());p.push([Math.sqrt(1-e*e)*Math.cos(t)*n,e*n,Math.sqrt(1-e*e)*Math.sin(t)*n])}const y=()=>{const s=t.width=t.clientWidth*i,d=t.height=t.clientHeight*i,u=(performance.now()-c)/1e3,b=Math.min(e.length,Math.floor(u/.5)),x=s/2,j=d/2,C=.34*Math.min(s,d),M=Math.min(1,u/5),S=.18*u,T=e=>{const t=e[0]*Math.cos(S)-e[2]*Math.sin(S),n=e[0]*Math.sin(S)+e[2]*Math.cos(S),o=e[1]*Math.cos(.3)-n*Math.sin(.3),i=e[1]*Math.sin(.3)+n*Math.cos(.3),l=1/(1.
11246-.45*i);return[x+t*C*M*l*1.55,j+o*C*M*l*1.55,l,i]};n.globalAlpha=1,n.clearRect(0,0,s,d),p.forEach(e=>{const t=T(e);n.fillStyle=(n.globalAlpha=Math.min(1,.05+.13*(t[3]+1)/2),o),n.fillRect(t[0],t[1],1.1*i,1.1*i)}),n.lineWidth=.6*i,m.forEach(([e,t,i])=>{if(i>=b)return;const l=T(e),r=T(t);n.strokeStyle=(n.globalAlpha=Math.min(1,.06+.2*(l[3]+1)/2),o),n.beginPath(),n.moveTo(l[0],l[1]),n.lineTo(r[0],r[1]),n.stroke()}),f.forEach(e=>{if(e.k>=b)return;const[t,l,r,s]=T(e.v),a=.6+.4*Math.sin(3*u+20*e.t);n.fillStyle=(n.globalAlpha=Math.min(1,a*(.25+.6*(s+1)/2)),o),n.fillRect(t-.9*r*i,l-.9*r*i,1.8*r*i,1.8*r*i)}),h.forEach((t,s)=>{const a=e[s],[c,d,u,h]=T(t),f=s<b&&'ok'===a.status,m=f?.35+.65*(h+1)/2:.18,p=Math.atan2(d-j,c-x),y=c+26*Math.cos(p)*i,C=d+26*Math.sin(p)*i;n.strokeStyle=(n.globalAlpha=Math.min(1,.7*m),o),n.lineWidth=i,n.beginPath(),n.moveTo(c,d),n.lineTo(y,C),n.stroke(),n.fillStyle=(n.globalAlpha=Math.min(1,m),o),n.shadowColor=o,n.shadowBlur=f?12:0,n.beginPath(),n.arc(c,d,3.2*u*i,0,7),n.fill(),n.shadowBlur=0,n.font=`600 ${12*i}px Inter`,n.textAlign=Math.cos(p)>0?'left':'right',n.fillText('missing'===a.status?`${a.name} \u2013 not updated`:a.name,y+(Math.cos(p)>0?4:-4)*i,C+4*i),l.current===a.key&&r(a.key,c/i,d/i)}),a=requestAnimationFrame(y)};return y(),()=>cancelAnimationFrame(a)},[e.map(e=>e.key+e.status).join(),o,i]),n.default.createElement('canvas',{ref:s,style:{width:'100%',height:'100%',display:'block'},'aria-hidden':!0})}function S({i:e,name:t,hex:n,onOpen:i}){return(0,u.jsxs)(l.default,{accessibilityRole:"link",accessibilityLabel:`${e.symbol}: ${e.headline}. Scanned ${y(e)}. Found ${x(e)}.`,onPress:i,disabled:!i,style:e=>[{flexGrow:1,flexBasis:300,borderRadius:12,borderWidth:1,borderColor:e.hovered?n:a.C.line,backgroundColor:a.C.paper,padding:14,gap:4},{cursor:i?'pointer':'default'}],children:[(0,u.jsxs)(o.default,{style:{flexDirection:'row',alignItems:'center',justifyContent:'space-between'},children:[(0,u.jsx)(a.T,{style:{fontSize:11,fontFamily:'InterSemi',letterSpacing:1,color:n},children:t.toUpperCase()}),!!e.evidence&&(0,u.jsx)(a.T,{style:{fontSize:11,color:a.C.muted},children:(e.evidence.charAt(0).toUpperCase()+e.evidence.slice(1)).replace(/_/g,' ')})]}),(0,u.jsxs)(a.T,{style:{fontSize:12,color:a.C.muted},children:["Scanned ",(0,u.jsx)(a.T,{style:{fontSize:12,color:a.C.ink,fontFamily:'InterSemi'},children:y(e)})]}),(0,u.jsxs)(a.T,{style:{fontSize:12,color:a.C.muted},children:["Found ",(0,u.jsx)(a.T,{style:{fontSize:12,color:n,fontFamily:'InterSemi'},children:x(e)})]}),!!b(e)&&(0,u.jsx)(a.T,{style:{fontSize:12,color:a.C.muted},children:b(e)}),(0,u.jsx)(a.T,{style:{fontFamily:'ManropeBold',fontSize:18,lineHeight:24,marginTop:4},children:e.symbol}),(0,u.jsx)(a.T,{style:{fontSize:13,lineHeight:19,color:a.C.ink},children:e.headline})]})}function T(){const{brief:e,err:n,loading:c,retry:h}=C(),m=(0,d.useReducedMotion)(),p=(0,s.useRouter)(),{width:b}=(0,r.default)(),T=b<900,v=(e?.scan_no??0)%2==1?a.C.blue:a.C.amber,w=v,$=e?.modules??[],k=e?.insights??[],z=!!e&&(e.stale||Date.now()-(0,d.toMs)(e.as_of)>f),[R,F]=(0,t.useState)(0),[_,A]=(0,t.useState)(null),E=(0,t.useRef)(null),I=(0,t.useRef)(null),H=(0,t.useRef)(null),B=e?`${e.as_of}`:'';(0,t.useEffect)(()=>{F(m?k.length:0),A(null),E.current=null},[B,m]),(0,t.useEffect)(()=>{if(m||!e||R>=k.length)return;const t=R,n=0===t?2500:600,o=setTimeout(()=>{E.current=k[t].module,A({i:t,x:0,y:0,phase:'scan'})},n),i=setTimeout(()=>{E.current=null;const e=H.current?.getBoundingClientRect?.(),t=I.current?.getBoundingClientRect?.();A(n=>n&&e&&t?{...n,x:e.left-t.left+22,y:e.top-t.top+22,phase:'fly'}:n)},n+1900),l=setTimeout(()=>{A(null),F(e=>e+1)},n+3050);return()=>{clearTimeout(o),clearTimeout(i),clearTimeout(l)}},[R,B,m]);const N=R>=k.length&&!!e,P=e?N?`Falcon spotted ${k.length} thing${1===k.length?'':'s'} at ${j(e.as_of)}`:'Falcon is scanning\u2026':'Falcon',W=_&&k[_.i],D=(0,u.jsxs)(o.default,{style:{flex:1,padding:T?16:26,gap:14},children:[(0,u.jsxs)(o.default,{style:{gap:4},children:[(0,u.jsx)(a.T,{role:"heading","aria-level":1,style:{fontFamily:'ManropeBold',fontSize:22,lineHeight:30},children:P}),!!e&&(0,u.jsxs)(a.T,{style:{fontSize:13,color:a.C.muted},children:[j(e.as_of)," scan \xb7 stocks and F&O \xb7 each card shows what was scanned and what came out",e.next_at?` \xb7 next scan ${j(e.next_at)}`:'']})]}),z&&(0,u.jsxs)(o.default,{style:{flexDirection:'row',alignItems:'center',gap:8,backgroundColor:a.C.amberBg,borderRadius:10,paddingHorizontal:12,paddingVertical:8},children:[(0,u.jsx)(a.Icon,{name:"alert-triangle",size:14,color:a.C.amber}),(0,u.jsxs)(a.T,{style:{fontSize:13,color:a.C.amber},children:["This brief is from ",j(e.as_of),"; a newer scan has not arrived."]})]}),c&&!e?(0,u.jsx)(a.T,{style:{fontSize:13,color:a.C.muted},children:"Reading the latest brief\u2026"}):n&&!e?(0,u.jsxs)(o.default,{style:{gap:10,padding:16,borderRadius:12,borderWidth:1,borderColor:a.C.line,borderStyle:'dashed'},children:[(0,u.jsx)(a.T,{style:{fontSize:14,lineHeight:21},children:n.missing?'Falcon\u2019s 5-minute brief is not on the server yet.':'Could not reach the Falcon brief. This is not the same as nothing happening.'}),!n.missing&&(0,u.jsx)(l.default,{accessibilityRole:"button",onPress:h,style:{alignSelf:'flex-start',minHeight:36,paddingHorizontal:14,borderRadius:8,borderWidth:1,borderColor:a.C.line,justifyContent:'center'},children:(0,u.jsx)(a.T,{style:{fontSize:13,fontFamily:'InterSemi',color:a.C.green},children:"Retry"})})]}):e&&!k.length?(0,u.jsxs)(a.T,{style:{fontSize:13,color:a.C.muted},children:["Nothing stood out at ",j(e.as_of),"."]}):(0,u.jsxs)(i.default,{style:{flex:1},contentContainerStyle:{flexDirection:'row',flexWrap:'wrap',gap:12},children:[k.slice(0,R).map((e,t)=>(0,u.jsx)(S,{i:e,name:$.find(t=>t.key===e.module)?.name??e.module.replace(/_/g,' '),hex:v,onOpen:e.deeplink?()=>p.push(e.deeplink):void 0},`${B}-${t}
1124`)),N&&!!(e?.dropped_note||e?.note||e?.dropped?.length)&&(0,u.jsx)(a.T,{style:{width:'100%',fontSize:12,color:a.C.muted},children:e?.dropped_note||e?.note||`Also read, not shown (8-story limit): ${e.dropped.map(e=>$.find(t=>t.key===(e?.module??e))?.name??String(e?.module??e)).join(', ')}`}),!N&&(0,u.jsx)(o.default,{ref:H,style:{flexGrow:1,flexBasis:300,minHeight:120}})]})]});return m||T?(0,u.jsx)(o.default,{style:{flex:1,backgroundColor:a.C.bg},children:D}):(0,u.jsxs)(o.default,{style:{flex:1,flexDirection:'row',backgroundColor:a.C.bg},children:[(0,u.jsxs)(o.default,{ref:I,style:{width:'44%',position:'relative',borderRightWidth:1,borderRightColor:a.C.line,overflow:'visible',zIndex:5},children:[$.length>0?(0,u.jsx)(M,{mods:$,col:w,scanKey:e?.scan_no??0,lockKey:E,onHub:(e,t,n)=>A(o=>o&&'scan'===o.phase&&k[o.i]?.module===e?{...o,x:t,y:n}:o)}):null,!!e&&(0,u.jsxs)(a.T,{style:{position:'absolute',left:20,bottom:14,fontSize:13,color:a.C.muted},children:[(0,u.jsxs)(a.T,{style:{fontSize:13,color:v},children:["\u25cf ",j(e.as_of)," scan"]})," \xb7 ",$.filter(e=>'ok'===e.status).length," of ",$.length," data sets read"]}),W&&_&&(_.x||_.y)?(0,u.jsxs)(o.default,{pointerEvents:"none",style:[{position:'absolute',left:_.x-22,top:_.y-22,flexDirection:'row',alignItems:'flex-start',gap:8},{transitionProperty:'left, top',transitionDuration:'fly'===_.phase?'1.1s':'0s',transitionTimingFunction:'cubic-bezier(.45,0,.2,1)'}],children:[(0,u.jsx)(o.default,{style:{width:44,height:44,borderWidth:2,borderColor:v,borderRadius:3,borderStyle:'dashed',alignItems:'center',justifyContent:'center'},children:(0,u.jsx)(o.default,{style:{width:6,height:6,borderRadius:3,backgroundColor:v}})}),(0,u.jsx)(o.default,{style:{borderWidth:1,borderColor:v,backgroundColor:a.C.bg,borderRadius:3,paddingHorizontal:8,paddingVertical:4},children:(0,u.jsx)(a.T,{style:{fontSize:11,fontFamily:'InterSemi',color:v},children:'scan'===_.phase?`SCANNING ${y(W)}`:`\u2192 ${x(W)}`})})]}):null]}),D]})}var v=T},1031,[11,13,278,375,136,400,252,821,197,948,6]); 1125__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Onboarding}});var t=r(d[0])},1032,[894]); 1126__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=r(d[0]).DrawingReviewPage},1033,[1034]); 1127__d(function(g,_r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DrawingReviewPage=function(){const e=(0,r.useLocalSearchParams)(),{width:m}=(0,n.default)(),b=m>=1e3,[P,T]=(0,t.useState)(j(e.q)),[z,$]=(0,t.useState)(j(e.family)||'all'),[K,k]=(0,t.useState)('all'),[F,I]=(0,t.useState)('detail'===j(e.view)?'detail':'grid'),[M,E]=(0,t.useState)(Math.max(0,(Number(j(e.page))||1)-1)),[B,N]=(0,t.useState)('variants'===j(e.scope)),[A,D]=(0,t.useState)(j(e.pattern_id)||'CH16'),[W,L]=(0,t.useState)(j(e.example)),[O,R]=(0,t.useState)(''),H=(0,p.useKeyedValue)('pattern-drawings-audit',()=>(0,c.api)('/api/pattern-drawings/audit')),G=(0,p.useKeyedValue)('pattern-drawings-review',()=>(0,c.api)('/api/pattern-drawings/review')),[Z,V]=(0,t.useState)(!1),q=(0,h.useProduct)()?.research,U=(0,u.pageNotDeployed)(q,H.value,G.value),J=null!=U||(0,u.isNotDeployed)(H.value)?void 0:H.value,Q=(0,t.useMemo)(()=>J?(0,y.drawingCatalogue)(J):[],[J]),X=J?.drawing_adapter_sha256,Y=J&&G.value&&!(0,u.isNotDeployed)(G.value)&&G.value?.run===J?.run&&G.value?.drawing_adapter_sha256===X?G.value:void 0,ee=Y?.findings.filter(e=>e.status.includes('unresolved'))||[],ae=(0,t.useMemo)(()=>{const e=P.trim().toLowerCase();return Q.filter(t=>('all'===z||t.family===z)&&('all'===K||('available'===K?t.examples.length>0:t.missing.length>0||!t.examples.length))&&(!e||`${t.id} ${t.name} ${t.family} ${t.examples.map(e=>`${e.spec.variant} ${e.symbol}`).join(' ')}`.toLowerCase().includes(e)))},[Q,P,z,K]),te=(0,t.useMemo)(()=>ae.flatMap(e=>B?e.examples:e.examples.slice(0,1)),[ae,B]),se=Math.max(1,Math.ceil(te.length/y.PAGE_SIZE)),ie=Math.min(M,se-1),le=ae.find(e=>e.id===A)||ae[0],ne=le?.examples.find(e=>(0,y.exampleKey)(e)===W),re=le?[...new Map([...le.examples.map(e=>e.spec),...le.missing.map(e=>e.spec)].map(e=>[(0,y.variantKey)(e),e])).values()]:[],oe=re.some(e=>(0,y.variantKey)(e)===O)?O:ne?(0,y.variantKey)(ne.spec):re[0]?(0,y.variantKey)(re[0]):'',de=le?.examples.filter(e=>(0,y.variantKey)(e.spec)===oe)||[],ce=de.find(e=>(0,y.exampleKey)(e)===W)||de[0],pe=e=>{I(e),r.router.setParams({view:e,page:String(ie+1)})},me=e=>{E(e),r.router.setParams({view:'grid',page:String(e+1)})},ue=e=>{D(e.spec.pattern_id),L((0,y.exampleKey)(e)),R((0,y.variantKey)(e.spec)),I('detail'),r.router.setParams({pattern_id:e.spec.pattern_id,example:(0,y.exampleKey)(e),view:'detail'})},he=()=>{E(0),r.router.setParams({page:'1'})},xe=m>=1250?3:m>=800?2:1;return(0,v.jsxs)(s.default,{style:{padding:m<700?14:24,gap:18,maxWidth:1700,width:'100%',alignSelf:'center'},children:[(0,v.jsxs)(s.default,{style:[o.s.between,{flexWrap:'wrap'}],children:[(0,v.jsxs)(s.default,{style:{gap:5,flexShrink:1},children:[(0,v.jsx)(o.Badge,{label:"Frozen drawing review",tone:"neutral"}),(0,v.jsx)(o.T,{role:"heading","aria-level":1,style:o.s.title,children:"Inspect every pattern drawing."}),(0,v.jsx)(o.T,{style:{color:o.C.muted},children:"Real historical candles, the original formation, and its stored drawing."})]}),(0,v.jsx)(o.Button,{label:"Back to Discover",kind:"outline",icon:"arrow-left",onPress:()=>r.router.push('/discover')})]}),null!=U?(0,v.jsx)(x.ComingSoonPanel,{message:U,headline:(0,u.featureAbsentHeadline)('drawings',q,U)}):H.error?(0,v.jsx)(u.WidgetError,{title:"Drawing examples unavailable",message:H.error,onRetry:H.reload}):J?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(s.default,{style:[o.s.card,{padding:16,gap:8}],children:[(0,v.jsxs)(o.T,{style:{fontFamily:'InterSemi'},children:[J.coverage.patterns_with_examples," of ",J.coverage.catalogue_entr
1127ies," patterns \xb7 ",J.coverage.variants_with_examples," of ",J.coverage.directional_variants," directional variants have real examples"]}),Y?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(o.T,{style:{fontSize:12},children:["Recorded visual review: ",Y.coverage.manual_examples_inspected," of ",Y.coverage.available_directional_variants," directional examples across ",Y.coverage.patterns_inspected," of ",Y.coverage.patterns_total," pattern IDs."]}),(0,v.jsx)(o.T,{style:{color:o.C.muted,fontSize:12},children:"Each review is tied to the exact frozen event shown. This does not cover every historical occurrence or every timeframe, and does not certify detector validity."}),ee.map(e=>(0,v.jsxs)(o.T,{style:{color:o.C.amber,fontSize:12},children:["Open concern \xb7 ",e.scope,": ",e.observation]},e.id)),(0,v.jsx)(o.Button,{label:`${Z?'Hide':'Show'} review notes (${Y.findings.length})`,kind:"ghost",accessibilityState:{expanded:Z},onPress:()=>V(e=>!e),style:{alignSelf:'flex-start'}}),Z&&Y.findings.map(e=>(0,v.jsxs)(s.default,{style:{gap:2},children:[(0,v.jsxs)(o.T,{style:{fontSize:12,fontFamily:'InterSemi',color:o.C.amber},children:[e.scope," \xb7 ",e.status.replace(/_/g,' ')]}),(0,v.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:e.observation})]},e.id))]}):(0,v.jsx)(o.T,{style:{color:o.C.amber,fontSize:12},children:G.loading?'Loading the visual review record\u2026':'Visual review status is unavailable for this frozen run. Example availability alone is not an accuracy verdict.'}),(0,v.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"One representative timeframe per variant and direction. Candles stop at the signal. These examples do not show what happened afterward."})]}),(0,v.jsxs)(s.default,{style:{gap:10},children:[(0,v.jsx)(l.default,{accessibilityLabel:"Search pattern drawing catalogue",placeholder:"Search pattern name, ID, variant or stock",placeholderTextColor:o.C.muted,value:P,onChangeText:e=>{T(e),he()},style:o.s.input}),(0,v.jsx)(s.default,{style:[o.s.row,{flexWrap:'wrap'}],children:['all',...new Set(Q.map(e=>e.family))].map(e=>(0,v.jsx)(o.Chip,{label:'all'===e?'All families':(0,y.familyName)(e),active:z===e,onPress:()=>{$(e),he(),r.router.setParams({family:e})}},e))}),(0,v.jsxs)(s.default,{style:[o.s.between,{flexWrap:'wrap'}],children:[(0,v.jsx)(s.default,{style:[o.s.row,{flexWrap:'wrap'}],children:[['all','All availability'],['available','Examples available'],['missing','Missing occurrences']].map(([e,t])=>(0,v.jsx)(o.Chip,{label:t,active:K===e,onPress:()=>{k(e),he()}},e))}),(0,v.jsxs)(s.default,{style:o.s.row,children:[(0,v.jsx)(o.Button,{label:"Single drawing",kind:'detail'===F?'soft':'ghost',accessibilityState:{selected:'detail'===F},onPress:()=>pe('detail')}),(0,v.jsx)(o.Button,{label:"Drawing grid",kind:'grid'===F?'soft':'ghost',accessibilityState:{selected:'grid'===F},onPress:()=>pe('grid')})]})]}),(0,v.jsxs)(o.T,{accessibilityLiveRegion:"polite",style:{fontSize:12,color:o.C.muted},children:[ae.length," patterns \xb7 ",ae.reduce((e,t)=>e+t.examples.length,0)," available directional variants \xb7 one observed timeframe per example"]})]}),'grid'===F?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(s.default,{style:[o.s.row,{flexWrap:'wrap'}],children:[(0,v.jsx)(o.Chip,{label:`One per pattern (${ae.filter(e=>e.examples.length).length})`,active:!B,onPress:()=>{N(!1),he(),r.router.setParams({scope:'patterns'})}}),(0,v.jsx)(o.Chip,{label:`All variants (${ae.reduce((e,t)=>e+t.examples.length,0)})`,active:B,onPress:()=>{N(!0),he(),r.router.setParams({scope:'variants'})}})]}),(0,v.jsxs)(s.default,{style:o.s.between,children:[(0,v.jsxs)(o.T,{style:{fontFamily:'InterSemi'},children:["Examples ",te.length?ie*y.PAGE_SIZE+1:0,"\u2013",Math.min(te.length,(ie+1)*y.PAGE_SIZE)," of ",te.length]}),(0,v.jsxs)(s.default,{style:o.s.row,children:[(0,v.jsx)(o.Button,{label:"Previous page",kind:"outline",disabled:0===ie,onPress:()=>me(ie-1)}),(0,v.jsxs)(o.T,{style:{fontSize:12},children:["Page ",ie+1," / ",se]}),(0,v.jsx)(o.Button,{label:"Next page",kind:"outline",disabled:ie+1>=se,onPress:()=>me(ie+1)})]})]}),(0,v.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:12},children:te.slice(ie*y.PAGE_SIZE,(ie+1)*y.PAGE_SIZE).map(e=>(0,v.jsxs)(s.default,{accessibilityLabel:`Drawing example ${e.spec.pattern_id} ${e.spec.variant} ${e.spec.side}`,style:[o.s.card,{width:3===xe?'32%':2===xe?'48.8%':'100%',padding:12,gap:8}],children:[(0,v.jsxs)(o.T,{role:"heading","aria-level":2,style:{fontFamily:'InterSemi',fontSize:14},children:[e.spec.pattern_id," \xb7 ",e.spec.name]}),(0,v.jsxs)(o.T,{style:{fontSize:11,color:o.C.muted},children:['confirmed'===e.event.state?'Confirmed':'Forming / setup'," \xb7 ",e.spec.variant," \xb7 ",e.spec.side," \xb7 ",e.symbol," \xb7 ",e.timeframe," \xb7 ",w(e.signal_at)]}),(0,v.jsx)(S,{example:e,compact:!0}),(0,v.jsx)(_,{example:e,review:Y,compact:!0}),(0,v.jsx)(o.Button,{label:`Inspect ${e.spec.pattern_id}`,kind:"outline",onPress:()=>ue(e)})]},(0,y.exampleKey)(e)))}),!te.length&&(0,v.jsx)(o.T,{style:{color:o.C.muted},children:"No frozen examples match these filters. Missing occurrences remain listed in the single drawing view."})]}):(0,v.jsxs)(s.default,{style:{flexDirection:b?'row':'column',gap:18,alignItems:'stretch'},children:[(0,v.jsxs)(s.default,{style:[o.s.card,{width:b?290:void 0,padding:12,gap:8,alignSelf:b?'flex-start':void 0}],children:[(0,v.jsxs)(o.T,{style:{fontFamily:'InterSemi'},children:["Pattern catalogue \xb7 ",ae.length]}),(0,v.jsxs)(i.default,{style:{maxHeight:b?660:230},contentContainerStyle:{gap:5},children:[ae.map(e=>(0,v.jsxs)(s.default,{style:{gap:2,paddingBottom:6},children:[(0,v.jsx)(o.Button,{label:`${e.id} \xb7 ${e.name}`,accessibilityLabel:`${e.id}, ${e.name}, ${e.examples.length} real examples, ${e.missing.length} missing variants`,kind:e.id===le?.id?'soft':'ghost',accessibilityState:{selected:e.id===le?.id},onPress:()=>{D(e.id),L(''),R(''),r.router.setParams({pattern_id:e.id,example:void 0})},style:{justifyContent:'flex-start'}}),(0,v.jsx)(s.default,{style:{paddingLeft:10},children:(0,v.jsx)(C,{row:e})})]},e.id)),!ae.length&&(0,v.jsx)(o.T,{style:{color:o.C.muted},children:"No patterns match these filters."})]})]}),(0,v.jsx)(s.default,{style:[o.s.card,{flex:1,minWidth:0,padding:m<700?12:20}],children:le?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(s.default,{style:{gap:4},children:[(0,v.jsxs)(o.T,{role:"heading","aria-level":2,style:{fontFamily:'ManropeBold',fontSize:24,lineHeight:32},children:[le.id," \xb7 ",le.name]}),(0,v.jsxs)(o.T,{style:{fontSize:12,color:o.C.muted},children:[(0,y.familyName)(le.family)," \xb7 ",le.examples.length," real examples \xb7 ",le.missing.length," missing variants"]})]}),(0,v.jsx)(s.default,{style:[o.s.row,{flexWrap:'wrap'}],children:re.map(e=>(0,v.jsx)(o.Chip,{label:`${e.variant} \xb7 ${e.side}`,active:oe===(0,y.variantKey)(e),onPress:()=>{R((0,y.variantKey)(e));const t=le.examples.find(t=>(0,y.variantKey)(t.spec)===(0,y.variantKey)(e));L(t?(0,y.exampleKey)(t):'')}},(0,y.variantKey)(e)))}),de.length>0&&(0,v.jsx)(s.default,{style:[o.s.row,{flexWrap:'wrap'}],children:de.map(e=>(0,v.jsx)(o.Chip,{label:`${e.timeframe} \xb7 ${e.symbol} \xb7 ${w(e.signal_at)}`,active:e===ce,onPress:()=>L((0,y.exampleKey)(e))},(0,y.exampleKey)(e)))}),ce?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(s.default,{style:[o.s.between,{flexWrap:'wrap'}],children:[(0,v.jsx)(o.Badge,{label:"Real example available",tone:"neutral"}),(0,v.jsxs)(o.T,{style:{fontSize:12,color:o.C.muted},children:[ce.event.state," \xb7 ",ce.symbol," \xb7 ",ce.timeframe," \xb7 signal ",w(ce.signal_at)]})]}),(0,v.jsx)(S,{example:ce}),(0,v.jsx)(_,{example:ce,review:Y}),(0,v.jsxs)(o.T,{style:{fontSize:12,color:o.C.muted},children:["Formation ",w(ce.bars[ce.formation_start]?.time)," \xb7 shape detected ",w(ce.detected_at)," \xb7 signal candle ",w(ce.signal_at)]}),(0,v.jsxs)(s.default,{style:{gap:6},children:[(0,v.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:13},children:"Pattern definition"}),(0,v.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:ce.spec.definition||'No definition supplied for this variant.'})]}),(0,v.jsxs)(o.T,{style:{fontSize:11,color:o.C.muted},children:["Frozen run ",ce.source.run," \xb7 ",ce.bars.length," candles \xb7 source ",ce.drawing_source.replace(/_/g,' ')]})]}):(0,v.jsx)(o.T,{style:{color:o.C.amber},children:"No occurrence is available in this frozen research data. A drawing has not been substituted."}),le.missing.map((e,t)=>(0,v.jsxs)(o.T,{style:{color:o.C.amber,fontSize:12},children:[e.spec.variant," \xb7 ",e.spec.side,": ",e.reason||e.note||'No frozen occurrence available.']},(0,y.variantKey)(e.spec)+t))]}):(0,v.jsx)(o.T,{style:{color:o.C.muted},children:"Choose a pattern from the catalogue."})})]}),(0,v.jsxs)(o.T,{style:{color:o.C.muted,fontSize:11},children:["Source: frozen research run ",J.run,". ",J.method]})]}):(0,v.jsx)(f.Skeleton,{lines:6})]})};var t=_r(d[0]),s=e(_r(d[1])),i=e(_r(d[2])),l=e(_r(d[3])),n=e(_r(d[4])),r
1127=_r(d[5]),o=_r(d[6]),c=_r(d[7]),p=_r(d[8]),m=_r(d[9]),u=_r(d[10]),h=_r(d[11]),x=_r(d[12]),f=_r(d[13]),y=_r(d[14]),v=_r(d[15]);const j=e=>'string'==typeof e?e:Array.isArray(e)?String(e[0]||''):'',w=e=>e?.slice(0,10)||'Unavailable';function b(e,t){if(!t||t.run!==e.source.run)return;const s=e,i=Object.values(t.reviews_by_event_identity).find(e=>e.frozen_event_sha256===s.event_sha256&&Object.keys(e.event_identity).every(t=>e.event_identity[t]===s.event_identity?.[t]));if(!i||!s.event_identity||!s.event_sha256||s.event_sha256!==i.frozen_event_sha256)return;const l=Object.keys(i.event_identity);return l.length!==Object.keys(s.event_identity).length||l.some(e=>i.event_identity[e]!==s.event_identity[e])?void 0:i}function _({example:e,review:t,compact:i=!1}){if(!t)return null;const l=b(e,t),n='pending'===l?.checks.post_fix_visual_recheck,r=l?t.findings.filter(e=>l.finding_ids.includes(e.id)):[];return(0,v.jsxs)(s.default,{style:{gap:4},children:[(0,v.jsx)(o.T,{style:{fontSize:11,color:n||!l?o.C.amber:o.C.muted},children:l?.inspected?`This exact example was inspected${n?' \xb7 visual recheck pending':''}.`:'This example has no recorded visual inspection.'}),r.filter(e=>!i||e.status.includes('unresolved')).map(e=>(0,v.jsxs)(o.T,{style:{fontSize:12,color:o.C.amber},children:[e.observation," (",e.status.replace(/_/g,' '),")"]},e.id))]})}function S({example:e,compact:s=!1}){const{match:i,snapshot:l}=(0,t.useMemo)(()=>(0,y.exampleSnapshot)(e),[e]);return(0,v.jsx)(m.PatternCanvas,{match:i,side:e.spec.side,snapshot:l,compact:s,controls:!s,chartHeight:s?220:380},(0,y.exampleKey)(e))}function C({row:e}){return(0,v.jsx)(o.Badge,{tone:e.examples.length?'neutral':'amber',label:e.examples.length?'Real example available':'No frozen occurrence'})}},1034,[11,13,278,385,400,252,821,197,251,864,871,196,883,925,1035,6]); 1128__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PAGE_SIZE",{enumerable:!0,get:function(){return e}}),Object.defineProperty(_e,"exampleKey",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"variantKey",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"familyName",{enumerable:!0,get:function(){return a}}),_e.drawingCatalogue=function(e){const t=new Map,n=e=>{let n=t.get(e.pattern_id);return n||(n={id:e.pattern_id,name:e.name,family:e.family,examples:[],missing:[]},t.set(n.id,n)),n};return(Array.isArray(e?.examples)?e.examples:[]).forEach(e=>n(e.spec).examples.push(e)),(Array.isArray(e?.missing)?e.missing:[]).forEac
1128h(e=>n(e.spec).missing.push(e)),[...t.values()].sort((e,t)=>e.id.localeCompare(t.id,void 0,{numeric:!0}))},_e.exampleSnapshot=function(e){const t={id:`${e.symbol}:${e.timeframe}:${e.spec.pattern_id}:${e.spec.variant}:${e.spec.side}`,symbol:e.symbol,company:e.symbol,pattern:e.spec.pattern_id,pattern_name:e.spec.name,timeframe:e.timeframe,direction:e.event.direction||('short'===e.spec.side?'bearish':'bullish'),state:e.event.state||'setup',current:!1,candle_end:e.signal_close_at,price:e.bars[e.bars.length-1]?.close||0,score:e.event.score||0,sector:'',universes:[],history:[],start_index:e.formation_start,end_index:e.signal_index,detected_index:Number.isFinite(e.event.detected_index)?e.event.detected_index-e.window_offset:e.signal_index,variant:e.spec.variant,side:e.spec.side,family:e.spec.family,lines:e.lines,geometry_note:e.geometry_note,drawable:e.lines.length>0};return{match:t,snapshot:{symbol:e.symbol,timeframe:e.timeframe,bars:e.bars,matches:[t],last_candle:e.signal_close_at}}};const e=9,t=e=>[e.spec.pattern_id,e.spec.variant,e.spec.side,e.timeframe,e.symbol,e.signal_at].join('|'),n=e=>`${e.variant}|${e.side}`,a=e=>({chart:'Chart patterns',candlestick:'Candlesticks',harmonic:'Harmonics',price_action:'Price action'}[e]||e)},1035,[]); 1129__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});var t=r(d[0]).PatternHistoryPage},1036,[1037]); 1130__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PatternHistoryPage=function(){const e=(0,c.useLocalSearchParams)(),{width:C}=(0,n.default)(),[_,w]=(0,t.useState)(S(e.pattern_id)||'CH16'),[P,T]=(0,t.useState)(S(e.variant)||'canonical'),[z,H]=(0,t.useState)(S(e.phase)||S(e.state)||'confirmed'),[L,B]=(0,t.useState)(S(e.symbol).toUpperCase()),[E,F]=(0,t.useState)(!0),[D,N]=(0,t.useState)(''),[W,$]=(0,t.useState)(''),[q,A]=(0,t.useState)(0);(0,t.useEffect)(()=>{const e=setTimeout(()=>{$(D.trim()),A(0)},200);return()=>clearTimeout(e)},[D]);const G=(0,y.useKeyedValue)('pattern-history-catalogue',()=>(0,h.api)('/api/pattern-history/catalogue')),I=(0,p.useProduct)()?.research,M=(0,f.pageNotDeployed)(I,G.value),O='/api/pattern-history/stocks?'+(0,v.query)({symbol:'',pattern_id:_,variant:P,state:z},{q:W,limit:40,offset:q}),U=(0,y.useKeyedValue)(G.value&&null==M?O:'',()=>(0,h.api)(O)),K=null!=M?'':L||U.value?.stocks?.[0]?.symbol||'',R={symbol:K,pattern_id:_,variant:P,state:z,...E&&S(e.strategy_key)?{strategy_key:S(e.strategy_key)}:{},...E&&S(e.detection_id)?{detection_id:S(e.detection_id)}:{}};(0,t.useEffect)(()=>{!L&&U.value?.stocks?.[0]&&B(U.value.stocks[0].symbol)},[L,U.value]),(0,t.useEffect)(()=>{K&&c.router.setParams({symbol:K,pattern_id:_,variant:P,phase:z,state:void 0,strategy_key:R.strategy_key,detection_id:R.detection_id})},[K,_,P,z,R.strategy_key,R.detection_id]);const V=e=>{w(e),T('canonical'),H('confirmed'),F(!1),A(0)},J=G.value?.patterns?.filter(e=>e.pattern_id===_)||[],Q=J.find(e=>e.variant===P),X=C>=950;return(0,k.jsxs)(s.default,{style:{padding:C<700?14:26,gap:22,maxWidth:1500,width:'100%',alignSelf:'center'},children:[(0,k.jsxs)(s.default,{style:[u.s.between,{flexWrap:'wrap'}],children:[(0,k.jsxs)(s.default,{style:{gap:5},children:[(0,k.jsx)(u.Badge,{label:"Pattern history \xb7 pilot",tone:"neutral"}),(0,k.jsx)(u.T,{role:"heading","aria-level":1,style:u.s.title,children:"See what followed."}),(0,k.jsx)(u.T,{style:{color:u.C.muted},children:"One stock. One pattern. Every measured outcome."})]}),(0,k.jsx)(u.Button,{label:"Back to Discover",kind:"outline",icon:"arrow-left",onPress:()=>c.router.push('/discover')})]}),null!=M?(0,k.jsx)(x.ComingSoonPanel,{message:M,headline:(0,f.featureAbsentHeadline)('history',I,M)}):G.error?(0,k.jsx)(f.WidgetError,{title:"Pattern history unavailable",message:G.error,onRetry:G.reload}):G.value?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(s.default,{style:[u.s.card,{padding:18,gap:14}],children:[(0,k.jsxs)(s.default,{style:[u.s.row,{flexWrap:'wrap'}],children:[(0,k.jsx)(u.Chip,{label:"Double Bottom \xb7 chart pattern",active:'CH16'===_,onPress:()=>V('CH16')}),(0,k.jsx)(u.Chip,{label:"Bullish Engulfing \xb7 candlesticks",active:'CDLENGULFING'===_,onPress:()=>V('CDLENGULFING')}),(0,k.jsx)(u.Badge,{label:"Daily candles",tone:"neutral"})]}),(0,k.jsx)(u.T,{style:{fontSize:13,color:u.C.muted},children:'CH16'===_?'Two troughs with a recovery between them. Forming history starts when the detector recognizes the structure; confirmed history starts after its neckline-break rule is met.':'A bullish candle body engulfs the previous bearish body. Forming / setup starts when the two-candle shape is recognized; confirmed history waits for the existing detector\u2019s subsequent confirmation rule.'}),(0,k.jsx)(s.default,{style:[u.s.row,{flexWrap:'wrap'}],children:(Q?.states||['setup','confirmed']).map(e=>(0,k.jsx)(u.Chip,{label:(0,v.stateLabel)(e),active:z===e,onPress:()=>{H(e),F(!1),A(0)}},e))}),J.length>1&&(0,k.jsx)(s.default,{style:[u.s.row,{flexWrap:'wrap'}],children:J.map(e=>(0,k.jsx)(u.Chip,{label:(0,v.variantLabel)(e.variant),active:P===e.variant,onPress:()=>{T(e.variant),F(!1),A(0)}},e.variant))}),(0,k.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:"The same frozen detector rules are used throughout. Each variant and state has its own history."}),E&&!!R.detection_id&&(0,k.jsx)(u.T,{style:{color:u.C.amber,fontSize:12},children:"Linked to your selected scanner detection. Changing the pattern, stock or state opens standalone historical research."})]}),(0,k.jsxs)(s.default,{style:{flexDirection:X?'row':'column',gap:22,alignItems:'stretch'},children:[(0,k.jsxs)(s.default,{style:[u.s.card,{width:X?280:void 0,padding:16,gap:12,alignSelf:X?'flex-start':void 0}],children:[(0,k.jsx)(u.T,{style:{fontFamily:'InterSemi'},children:"Choose a stock"}),(0,k.jsx)(o.default,{accessibilityLabel:"Search historical stocks",placeholder:"Search symbol",placeholderTextColor:u.C.muted,value:D,onChangeText:N,autoCapitalize:"characters",style:[u.s.input,{minHeight:42,fontSize:13}]}),U.error?(0,k.jsx)(f.WidgetError,{title:"Stocks unavailable",message:U.error,onRetry:U.reload}):U.loading?(0,k.jsx)(b.Skeleton,{lines:5}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(u.T,{style:{fontSize:11,color:u.C.muted},children:[U.value?.total??0," stocks \xb7 ordered by latest occurrence"]}),(0,k.jsxs)(l.default,{style:{maxHeight:X?510:190},contentContainerStyle:{gap:4},children:[U.value?.stocks?.map(e=>(0,k.jsx)(u.Button,{label:`${e.symbol} \xb7 ${e.occurrence_count}`,kind:e.symbol===K?'soft':'ghost',accessibilityState:{selected:e.symbol===K},accessibilityLabel:`${e.symbol}, ${e.occurrence_count} occurrences, last seen ${(0,v.date)(e.last_seen)}`,onPress:()=>{B(e.symbol),F(!1)},style:{justifyContent:'flex-start'}},e.symbol)),!U.value?.stocks.length&&(0,k.jsx)(u.T,{style:{color:u.C.muted},children:"No stocks match this search."})]}),(0,k.jsxs)(s.default,{style:u.s.between,children:[(0,k.jsx)(u.Button,{kind:"ghost",label:"Previous",disabled:0===q,onPress:()=>A(e=>Math.max(0,e-40))}),(0,k.jsx)(u.Button,{kind:"ghost",label:"Next",disabled:q+40>=(U.value?.total||0),onPress:()=>A(e=>e+40)})]})]})]}),(0,k.jsx)(s.default,{style:[u.s.card,{flex:1,minWidth:0,padding:X?24:16}],children:K?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(s.default,{style:{gap:4},children:[(0,k.jsxs)(u.T,{role:"heading","aria-level":2,style:{fontFamily:'ManropeBold',fontSize:24,lineHeight:32},children:[K," \xb7 ",Q?.name||_]}),(0,k.jsxs)(u.T,{style:{fontSize:12,color:u.C.muted},children:[(0,v.stateLabel)(z)," \xb7 ",(0,v.variantLabel)(P)," \xb7 Daily"]})]}),(0,k.jsx)(j.HistoryPanel,{selection:R,initialHorizon:Number(S(e.horizon))||5,onHorizonChange:e=>c.router.setParams({horizon:String(e)})}
1130,(0,v.query)(R))]}):(0,k.jsx)(u.T,{style:{color:u.C.muted},children:"Select a stock to explore its historical occurrences."})})]})]}):(0,k.jsx)(b.Skeleton,{lines:5})]})};var t=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),o=e(r(d[3])),n=e(r(d[4])),c=r(d[5]),u=r(d[6]),h=r(d[7]),y=r(d[8]),f=r(d[9]),p=r(d[10]),x=r(d[11]),b=r(d[12]),j=r(d[13]),v=r(d[14]),k=r(d[15]);const S=e=>'string'==typeof e?e:Array.isArray(e)?String(e[0]||''):''},1037,[11,13,278,385,400,252,821,197,251,871,196,883,925,1022,1020,6]); 1131__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var t=r(d[1]),n=r(d[2]);function u(){return(0,n.jsx)(t.Redirect,{href:"/watch"})}},1038,[11,252,6]); 1132__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var t=r(d[1]),n=r(d[2]);function u(){return(0,n.jsx)(t.PilotLegal,{privacy:!0})}},1039,[11,894,6]); 1133__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Recovery}});var t=r(d[0])},1040,[892]); 1134__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var t=r(d[1]),n=r(d[2]);function u(){return(0,n.jsx)(t.ScreenerTab,{})}},1041,[11,1042,6]); 1135__d(function(g,_r,i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ScreenerTab=function(){const e='desktop'===(0,r.useLayoutMode)(),[j,w]=(0,t.useState)(null),[S,k]=(0,t.useState)([]),[C,v]=(0,t.useState)(null),T=(0,f.useSbStatus)(),[A,_]=(0,t.useState)(0),[z,N]=(0,t.useState)(''),[B,P]=(0,t.useState)(null),[E,I]=(0,t.useState)((0,u.newDefinition)()),[D,R]=(0,t.useState)(''),[M,W]=(0,t.useState)(null),[H,O]=(0,t.useState)(!1),[$,L]=(0,t.useState)('visual'),[F,V]=(0,t.useState)(''),[K,J]=(0,t.useState)(''),[G,q]=(0,t.useState)('active'),[Q,U]=(0,t.useState)(null),[X,Y]=(0,t.useState)(!1),[Z,ee]=(0,t.useState)(''),[te,ne]=(0,t.useState)(!1),[se,ae]=(0,t.useState)(''),[ie,le]=(0,t.useState)(!1),[re,de]=(0,t.useState)(!1),[oe,ce]=(0,t.useState)([]),[ue,fe]=(0,t.useState)(''),[he,ye]=(0,t.useState)(''),[pe,xe]=(0,t.useState)(''),ge=(0,t.useRef)(0),be=(0,t.useRef)(void 0),me=B&&'new'!==B.kind&&S.find(e=>e.id===B.id)||null,je=(0,t.useCallback)(async()=>{const e=await d.screenerApi.scanners();return k(e.scanners),v(e.status),_(e.unread),e},[]);(0,t.useEffect)(()=>{(async()=>{try{const[e,t]=await Promise.all([d.screenerApi.vocabulary(),je()]);w(e),be.current=t.status?.as_of;const n=t.scanners[0];P(n?{kind:'view',id:n.id}:{kind:'new'})}catch(e){N(x(e))}})()},[je]);const we=(0,t.useCallback)(async(e,t)=>{const n=++ge.current;Y(!0),ee('');try{const s=await d.screenerApi.results(e,t);n===ge.current&&(U(s),s.scanner&&k(t=>t.map(t=>t.id===e?{...t,counts:s.counts?{...s.counts,through:s.as_of||'',current:!0}:t.counts}:t)))}catch(e){n===ge.current&&(U(null),ee(x(e)))}finally{n===ge.current&&Y(!1)}},[]),Se=(0,t.useCallback)(async(e,t)=>{const n=++ge.current;Y(!0),ee('');try{const s=await d.screenerApi.run(e,t);n===ge.current&&(U(s),ye(JSON.stringify(e)))}catch(e){n===ge.current&&(U(null),ee(x(e)))}finally{n===ge.current&&Y(!1)}},[]);(0,t.useEffect)(()=>{'view'===B?.kind?(U(null),we(B.id,G)):(ge.current++,U(null),Y(!1))},[B,we]);(0,t.useEffect)(()=>{if(!B||'view'===B.kind)return;const e=setTimeout(()=>{d.screenerApi.describe(E).then(e=>{V(e.reads_as),J('')},e=>J(x(e)))},250);return()=>clearTimeout(e)},[E,B]),(0,t.useEffect)(()=>{const e=setInterval(async()=>{try{const e=await d.screenerApi.status();e.as_of&&e.as_of!==be.current&&(be.current=e.as_of,v(e),await je(),'view'===B?.kind?we(B.id,G):Q&&Se(E,G))}catch{}},6e4);return()=>clearInterval(e)},[B,G,Q,E,je,we,Se]);const ke=e=>{xe(e),setTimeout(()=>xe(''),3500)},Ce=()=>{P({kind:'new'}),I((0,u.newDefinition)()),R(''),W(null),L('visual'),q('active')},ve=e=>{P({kind:'edit',id:e.id}),I(e.definition),R(e.nl_text||''),W(null),L('nl'===e.source?'nl':'visual')},Te=async()=>{fe('save');try{if('edit'===B?.kind){const e=await d.screenerApi.update(B.id,{definition:E,nl_text:'nl'===$?D:''});await je(),P({kind:'view',id:e.id}),ke('Scanner saved.')}else{const e=await d.screenerApi.create(se||'My scanner',E,$,'nl'===$?D:void 0);await je(),ne(!1),ae(''),P({kind:'view',id:e.id}),ke(`Saved \u201c${e.name}\u201d.`)}}catch(e){ke(x(e))}finally{fe('')}},Ae=async e=>{fe('dup');try{const t=await d.screenerApi.duplicate(e.id);await je(),ve(t),ke(`Copied to \u201c${t.name}\u201d \u2014 edit it below.`)}catch(e){ke(x(e))}finally{fe('')}},ze=async e=>{fe('del');try{await d.screenerApi.remove(e.id);const t=await je();le(!1),P(t.scanners[0]?{kind:'view',id:t.scanners[0].id}:{kind:'new'}),ke(`Deleted \u201c${e.name}\u201d.`)}catch(e){ke(x(e))}finally{fe('')}},Ne=async(e,t)=>{try{await d.screenerApi.update(e.id,{name:t}),await je()}catch(e){ke(x(e))}},Be=async(e,t,n)=>{try{await d.screenerApi.notify(e.id,{...e.notify,[t]:n}),await je()}catch(e){ke(x(e))}};if(z)return(0,p.jsx)(l.default,{style:{padding:24},children:(0,p.jsx)(r.Empty,{icon:"alert-circle",title:"The screener could not load",detail
1135:z})});if(!j||!B)return(0,p.jsx)(r.Loading,{});const Pe=S.filter(e=>e.is_default),Ee=S.filter(e=>!e.is_default),Ie=e=>{q('active'),P({kind:'view',id:e})},De=e?(0,p.jsxs)(l.default,{style:{width:280,gap:14},children:[(0,p.jsx)(r.Button,{label:"New scanner",icon:"plus",onPress:Ce}),(0,p.jsxs)(l.default,{style:{gap:2},children:[(0,p.jsx)(r.T,{style:[r.s.label,{paddingHorizontal:12,marginBottom:4}],children:"My scanners"}),Ee.length?Ee.map(e=>(0,p.jsx)(b,{sc:e,active:'new'!==B.kind&&B.id===e.id,onPress:()=>Ie(e.id)},e.id)):(0,p.jsx)(r.T,{style:{fontSize:12,color:r.C.muted,paddingHorizontal:12},children:"None yet \u2014 build one, or duplicate a KANIDA scanner."})]}),(0,p.jsxs)(l.default,{style:{gap:2},children:[(0,p.jsx)(r.T,{style:[r.s.label,{paddingHorizontal:12,marginBottom:4}],children:"KANIDA scanners"}),Pe.map(e=>(0,p.jsx)(b,{sc:e,active:'new'!==B.kind&&B.id===e.id,onPress:()=>Ie(e.id)},e.id))]})]}):(0,p.jsxs)(s.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:{flexGrow:0,width:'100%'},contentContainerStyle:{gap:8,paddingVertical:4,alignItems:'center'},children:[(0,p.jsx)(r.Button,{label:"New",icon:"plus",onPress:Ce}),[...Ee,...Pe].map(e=>(0,p.jsx)(n.default,{accessibilityRole:"button",onPress:()=>Ie(e.id),accessibilityState:{selected:'new'!==B.kind&&B.id===e.id},style:{paddingHorizontal:12,paddingVertical:10,borderRadius:10,borderWidth:1,borderColor:'new'!==B.kind&&B.id===e.id?r.C.green:r.C.line,backgroundColor:'new'!==B.kind&&B.id===e.id?r.C.soft:r.C.paper},children:(0,p.jsxs)(r.T,{style:{fontSize:12},children:[e.name,e.counts?` \xb7 ${e.counts.active}`:'']})},e.id))]}),Re=(0,p.jsxs)(l.default,{style:[r.s.between,{flexWrap:'wrap',gap:10}],children:[(0,p.jsxs)(l.default,{style:{gap:4,flex:1,minWidth:240},children:[(0,p.jsx)(r.T,{style:{fontFamily:'ManropeBold',fontSize:e?26:22,letterSpacing:-.5},children:"Options Screener"}),(0,p.jsxs)(r.T,{style:{fontSize:13,color:r.C.muted},children:["Describe the behaviour; KANIDA reads it off every 15-minute reading of index and F&O stock options.",C?.as_of?` Latest reading ${C.as_of.slice(11,16)}, ${C.session}.`:'']})]}),(0,p.jsxs)(n.default,{accessibilityRole:"button",accessibilityLabel:"Alerts"+(A?`, ${A} unread`:''),onPress:async()=>{de(!0);try{const e=await d.screenerApi.alerts();ce(e.alerts),_(e.unread)}catch(e){ke(x(e))}},style:({pressed:e})=>[r.s.row,{gap:6,paddingHorizontal:12,paddingVertical:9,borderRadius:10,borderWidth:1,borderColor:r.C.line,opacity:e?.7:1}],children:[(0,p.jsx)(r.Icon,{name:"bell",size:15,color:A?r.C.green:r.C.muted}),(0,p.jsx)(r.T,{style:{fontSize:12},children:"Alerts"}),A>0&&(0,p.jsx)(r.Badge,{label:String(A)})]})]}),Me='view'!==B.kind,We=me&&'view'===B.kind?(0,p.jsxs)(l.default,{style:[r.s.card,{padding:18,gap:12}],children:[(0,p.jsxs)(l.default,{style:[r.s.between,{flexWrap:'wrap',alignItems:'flex-start'}],children:[(0,p.jsxs)(l.default,{style:{gap:4,flex:1,minWidth:220},children:[(0,p.jsx)(l.default,{style:[r.s.row,{gap:8}],children:(0,p.jsx)(r.Badge,{label:me.is_default?'KANIDA SCANNER':'nl'===me.source?'MINE \xb7 FROM A SENTENCE':'MINE',tone:me.is_default?'neutral':'green'})}),me.is_default?(0,p.jsx)(r.T,{style:{fontFamily:'ManropeBold',fontSize:20},children:me.name}):(0,p.jsx)(a.default,{defaultValue:me.name,accessibilityLabel:"Scanner name",onEndEditing:e=>{const t=e.nativeEvent.text.trim();t&&t!==me.name&&Ne(me,t)},style:{fontFamily:'ManropeBold',fontSize:20,color:r.C.ink,padding:0}},me.id+me.name),!!me.description&&(0,p.jsx)(r.T,{style:{fontSize:13,color:r.C.muted},children:me.description})]}),(0,p.jsxs)(l.default,{style:[r.s.row,{gap:8,flexWrap:'wrap'}],children:[!me.is_default&&(0,p.jsx)(r.Button,{label:"Edit",icon:"edit-2",kind:"soft",onPress:()=>ve(me)}),(0,p.jsx)(r.Button,{label:me.is_default?'Duplicate to edit':'Duplicate',icon:"copy",kind:"outline",loading:'dup'===ue,onPress:()=>Ae(me)}),!me.is_default&&(0,p.jsx)(r.Button,{label:"Delete",icon:"trash-2",kind:"outline",onPress:()=>le(!0)})]})]}),(0,p.jsxs)(l.default,{style:{padding:12,borderRadius:10,backgroundColor:r.C.dark,gap:4},children:[(0,p.jsx)(r.T,{style:r.s.label,children:"Reads as"}),(0,p.jsx)(r.T,{style:{fontSize:13,lineHeight:20},children:me.reads_as}),!!me.nl_text&&(0,p.jsxs)(r.T,{style:{fontSize:12,color:r.C.muted},children:["Started from the sentence: \u201c",me.nl_text,"\u201d"]})]}),(0,p.jsxs)(l.default,{style:[r.s.row,{flexWrap:'wrap',gap:14}],children:[(0,p.jsx)(r.T,{style:{fontSize:12,color:r.C.muted},children:"Notify me when"}),(0,p.jsx)(r.Checkbox,{checked:me.notify.new,onChange:e=>Be(me,'new',e),label:"a new instrument matches"}),(0,p.jsx)(r.Checkbox,{checked:me.notify.ended,onChange:e=>Be(me,'ended',e),label:"a match ends"}),(0,p.jsx)(r.Checkbox,{checked:me.notify.changed,onChange:e=>Be(me,'changed',e),label:"a match strengthens or weakens"})]})]}):null,He=Me?(0,p.jsxs)(l.default,{style:[r.s.card,{padding:e?22:16}],children:[(0,p.jsx)(o.Builder,{vocab:j,draft:E,onChange:e=>{I(e),M&&W({...M,assumptions:[],unmapped:[]})},readsAs:F,error:K,text:D,onText:R,onParse:async()=>
1135{if(D.trim()){O(!0);try{const e=await d.screenerApi.parse(D);W(e),I(e.definition),V(e.reads_as),J(''),L('nl')}catch(e){W(null),J(x(e))}finally{O(!1)}}},parsing:H,parsed:M,compact:!e}),(0,p.jsxs)(l.default,{style:[r.s.row,{flexWrap:'wrap',gap:10}],children:[(0,p.jsx)(r.Button,{label:"Run now",icon:"play",onPress:()=>Se(E,G),disabled:!!K,loading:X&&!Q}),'edit'===B.kind?(0,p.jsx)(r.Button,{label:"Save changes",icon:"save",kind:"soft",loading:'save'===ue,disabled:!!K,onPress:Te}):(0,p.jsx)(r.Button,{label:"Save as\u2026",icon:"save",kind:"soft",disabled:!!K,onPress:()=>ne(!0)}),'edit'===B.kind&&(0,p.jsx)(r.Button,{label:"Cancel",kind:"outline",onPress:()=>P({kind:'view',id:B.id})})]})]}):null,Oe='view'===B.kind?'Matches':'What this scanner finds right now',$e='view'===B.kind||Q||X||Z;return(0,p.jsxs)(l.default,{style:{flex:1,padding:e?28:16,gap:18,backgroundColor:r.C.bg},children:[Re,(0,p.jsx)(h.DisclaimerNote,{compact:!e}),(0,p.jsx)(f.MarketStateBanner,{state:T?.market_state,reading:(0,y.asOfReading)(C?.as_of,C?.available)}),(0,p.jsxs)(l.default,{style:{flexDirection:e?'row':'column',gap:e?28:14,alignItems:'flex-start'},children:[De,(0,p.jsxs)(l.default,{style:{flex:1,gap:16,width:e?void 0:'100%',minWidth:0},children:[We,He,Me&&Q&&he&&he!==JSON.stringify(E)&&(0,p.jsxs)(l.default,{style:[r.s.row,{gap:8,padding:12,borderRadius:10,borderWidth:1,borderColor:r.C.amber}],children:[(0,p.jsx)(r.Icon,{name:"refresh-cw",size:14,color:r.C.amber}),(0,p.jsx)(r.T,{style:{flex:1,fontSize:12,color:r.C.amber},children:"The conditions changed since these results \u2014 press Run now to see what the new scanner finds."})]}),$e&&(0,p.jsx)(l.default,{style:{opacity:Me&&he&&he!==JSON.stringify(E)?.45:1},children:(0,p.jsx)(c.ResultsPanel,{body:Q,loading:X,error:Z,view:G,onView:e=>{q(e),'view'===B?.kind?we(B.id,e):Q&&Se(E,e)},title:Oe,market:T?.market_state})})]})]}),!!pe&&(0,p.jsx)(l.default,{style:{position:'absolute',bottom:24,alignSelf:'center',backgroundColor:r.C.paper,borderColor:r.C.green,borderWidth:1,borderRadius:12,paddingHorizontal:16,paddingVertical:10},children:(0,p.jsx)(r.T,{style:{fontSize:13},children:pe})}),te&&(0,p.jsxs)(r.Sheet,{visible:!0,onClose:()=>ne(!1),title:"Save scanner",subtitle:"Only you can see your scanners",footer:(0,p.jsx)(r.Button,{label:"Save",icon:"save",loading:'save'===ue,onPress:Te}),children:[(0,p.jsx)(a.default,{value:se,onChangeText:ae,placeholder:"Name it \u2014 e.g. Bank Nifty call build-up",placeholderTextColor:r.C.muted,accessibilityLabel:"Scanner name",maxLength:60,autoFocus:!0,style:r.s.input,onSubmitEditing:Te}),(0,p.jsx)(r.T,{style:{fontSize:13,lineHeight:20,color:r.C.muted},children:F})]}),ie&&me&&(0,p.jsx)(r.Sheet,{visible:!0,onClose:()=>le(!1),title:`Delete \u201c${me.name}\u201d?`,subtitle:"Its alerts stop. This cannot be undone.",footer:(0,p.jsxs)(l.default,{style:[r.s.row,{gap:10}],children:[(0,p.jsx)(r.Button,{label:"Delete",icon:"trash-2",loading:'del'===ue,onPress:()=>ze(me)}),(0,p.jsx)(r.Button,{label:"Keep it",kind:"outline",onPress:()=>le(!1)})]}),children:(0,p.jsx)(r.T,{style:{fontSize:13,color:r.C.muted},children:me.reads_as})}),re&&(0,p.jsx)(r.Sheet,{visible:!0,onClose:()=>de(!1),title:"Alerts",subtitle:"Only changes are sent \u2014 a match that is still matching never repeats",footer:A?(0,p.jsx)(r.Button,{label:"Mark all read",icon:"check",kind:"soft",onPress:async()=>{try{const e=await d.screenerApi.readAlerts();_(e.unread),ce(e=>e.map(e=>({...e,read:1})))}catch(e){ke(x(e))}}}):void 0,children:oe.length?oe.map(e=>(0,p.jsxs)(l.default,{style:{gap:4,paddingVertical:10,borderBottomWidth:1,borderColor:r.C.line,opacity:e.read?.65:1},children:[(0,p.jsxs)(l.default,{style:[r.s.row,{gap:8}],children:[(0,p.jsx)(r.Badge,{label:'new'===e.kind?'NEW MATCH':'ended'===e.kind?'ENDED':'CHANGED',tone:'ended'===e.kind?'neutral':'changed'===e.kind?'amber':'green'}),(0,p.jsxs)(r.T,{style:{fontSize:11,color:r.C.muted},children:[e.reading_at.slice(11,16)," \xb7 ",e.scanner_name]})]}),(0,p.jsx)(r.T,{style:{fontFamily:'InterSemi',fontSize:13},children:e.title}),(0,p.jsx)(r.T,{style:{fontSize:12,lineHeight:18,color:r.C.muted},children:e.text})]},e.id)):(0,p.jsx)(r.T,{style:{color:r.C.muted},children:"No alerts yet. Turn on \"Notify me when\u2026\" on any scanner."})})]})};var t=_r(_d[0]),n=e(_r(_d[1])),s=e(_r(_d[2])),a=e(_r(_d[3])),l=e(_r(_d[4])),r=_r(_d[5]),d=_r(_d[6]),o=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),f=_r(_d[10]),h=_r(_d[11]),y=_r(_d[12]),p=_r(_d[13]);const x=e=>e?.message||'KANIDA could not complete that.';function b({sc:e,active:t,onPress:s}){const a=e.counts?.active;return(0,p.jsxs)(n.default,{accessibilityRole:"button",accessibilityState:{selected:t},accessibilityLabel:`${e.name}${null!=a?`, ${a} active`:''}`,onPress:s,style:({pressed:e})=>[r.s.between,{paddingHorizontal:12,paddingVertical:10,borderRadius:10,backgroundColor:t?r.C.soft:'transparent',opacity:e?.7:1,gap:8}],children:[(0,p.jsxs)(l.default,{style:[r.s.row,{gap:8,flex:1}],children:[e.notify.new||e.notify.ended||e.notify.changed?(0,p.jsx)(r.Icon,{name:"bell",size:12,color:r.C.green}):null,(0,p.jsx)(r.T,{numberOfLines:1,style:{flex:1,fontSize:13,color:t?r.C.green:r.C.ink,fontFamily:t?'InterSemi':'Inter'},children:e.name})]}),null!=a&&(0,p.jsx)(r.T,{style:{fontSize:11,color:a?r.C.green:r.C.muted},children:a})]})}},1042,[11,375,278,385,13,821,1043,1044,1046,1045,992,901,986,6]); 1136__d(function(g,r,i,a,m,e,d){"use strict";
1136Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"screenerApi",{enumerable:!0,get:function(){return s}});var n=r(d[0]);const s={vocabulary:()=>(0,n.api)('/api/screener/vocabulary'),status:()=>(0,n.api)('/api/screener/status'),scanners:()=>(0,n.api)('/api/screener/scanners'),create:(s,c,t,p)=>(0,n.api)('/api/screener/scanners',{name:s,definition:c,source:t,nl_text:p}),update:(s,c)=>(0,n.api)(`/api/screener/scanners/${encodeURIComponent(s)}`,c),duplicate:s=>(0,n.api)(`/api/screener/scanners/${encodeURIComponent(s)}/duplicate`,{}),remove:s=>(0,n.api)(`/api/screener/scanners/${encodeURIComponent(s)}/delete`,{}),notify:(s,c)=>(0,n.api)(`/api/screener/scanners/${encodeURIComponent(s)}/notify`,c),results:(s,c,t)=>(0,n.api)(`/api/screener/scanners/${encodeURIComponent(s)}/results?view=${c}&limit=100`,void 0,{},t),run:(s,c)=>(0,n.api)('/api/screener/run',{definition:s,view:c,limit:100}),describe:s=>(0,n.api)('/api/screener/describe',{definition:s}),parse:s=>(0,n.api)('/api/screener/parse',{text:s}),alerts:()=>(0,n.api)('/api/screener/alerts'),readAlerts:s=>(0,n.api)('/api/screener/alerts/read',{ids:s||[]})}},1043,[197]); 1137__d(function(g,r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Pill=u,_e.Builder=function({vocab:e,draft:y,onChange:x,readsAs:m,error:f,text:C,onText:k,onParse:j,parsing:w,parsed:S,compact:T,dense:v}){const[z,A]=(0,i.useState)(null),[P,R]=(0,i.useState)(!1),[I,W]=(0,i.useState)(''),[O,L]=(0,i.useState)('10:15'),N=()=>A(null);let $=null;const M=(D=z?.index,null==D?null:y.conditions[D]);var D;if('metric'===z?.kind&&M)$=(0,a.jsx)(p,{title:"What to watch",subtitle:"Each one is read from the 15-minute readings",onClose:N,options:e.metrics.map(e=>({key:e.key,label:e.label+(e.computed?' \xb7 computed':''),hint:e.help,group:e.group,active:e.key===M.metric})),onPick:i=>{const t=(0,o.metricOf)(e,i);t&&x((0,o.updateCondition)(y,z.index,(0,o.withMetric)(M,t))),N()}});else if('side'===z?.kind&&M){const i=(0,o.metricOf)(e,M.metric);$=(0,a.jsx)(p,{title:"Which side",onClose:N,options:(i?.sides||[]).map(i=>({key:i,label:e.sides.find(e=>e.key===i)?.label||i,active:i===M.side,hint:'either'===i?'Calls or puts \u2014 each contract on its own side':'both'===i?'Calls and puts at the same time':void 0})),onPick:e=>{x((0,o.updateCondition)(y,z.index,{side:e})),N()}})}else if('state'===z?.kind&&M){const i=(0,o.metricOf)(e,M.metric);$=(0,a.jsx)(p,{title:`${i?.label||''} is\u2026`,subtitle:"KANIDA reads what each word means from the readings \u2014 no numbers to set",onClose:N,options:(i?.states||[]).map(e=>({key:e.key,label:e.label,arrow:e.arrow,active:e.key===M.state})),onPick:e=>{x((0,o.updateCondition)(y,z.index,{state:e})),N()}})}else if('window'===z?.kind&&M){const i='custom'===M.window.kind?M.window:null;$=(0,a.jsxs)(p,{title:"Over what time",subtitle:"KANIDA takes a new snapshot every 15 minutes",onClose:N,options:e.windows.filter(e=>'custom'!==e.kind).map((e,i)=>({key:String(i),label:e.label,active:(0,o.sameWindow)(e,M.window)})),onPick:i=>{const t=e.windows.filter(e=>'custom'!==e.kind)[Number(i)],{label:s,...l}=t;x((0,o.updateCondition)(y,z.index,{window:l})),N()},children:[(0,a.jsx)(n.T,{style:[n.s.label,{marginTop:14}],children:"Custom window"}),(0,a.jsx)(n.T,{style:{fontSize:12,color:n.C.muted},children:"From"}),(0,a.jsx)(l.default,{style:[n.s.row,{flexWrap:'wrap',gap:6}],children:o.READING_TIMES.slice(0,-1).map(e=>(0,a.jsx)(t.default,{accessibilityRole:"button",accessibilityLabel:`From ${e}`,onPress:()=>L(e),style:{paddingHorizontal:9,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:(i?.from||O)===e?n.C.green:n.C.line},children:(0,a.jsx)(n.T,{style:{fontSize:12},children:e})},e))}),(0,a.jsx)(n.T,{style:{fontSize:12,color:n.C.muted},children:"To"}),(0,a.jsx)(l.default,{style:[n.s.row,{flexWrap:'wrap',gap:6}],children:o.READING_TIMES.filter(e=>e>(i?.from||O)).map(e=>(0,a.jsx)(t.default,{accessibilityRole:"button",accessibilityLabel:`To ${e}`,onPress:()=>{x((0,o.updateCondition)(y,z.index,{window:{kind:'custom',from:i?.from||O,to:e}})),N()},style:{paddingHorizontal:9,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:i?.to===e?n.C.green:n.C.line},children:(0,a.jsx)(n.T,{style:{fontSize:12},children:e})},e))})]})}else if('universe'===z?.kind){const i='symbols'===y.universe.kind?y.universe.symbols:[],o=I.trim().toUpperCase(),c=e.underlyings.filter(e=>!o||e.includes(o)).slice(0,60),u=e=>{const t=i.includes(e)?i.filter(i=>i!==e):[...i,e];
1137x({...y,universe:t.length?{kind:'symbols',symbols:t}:{kind:'all'}})};$=(0,a.jsxs)(p,{title:"Where to look",onClose:N,options:e.universes.filter(e=>'symbols'!==e.key).map(e=>({key:e.key,label:e.label,active:y.universe.kind===e.key})),onPick:e=>{x({...y,universe:{kind:e}}),N()},children:[(0,a.jsx)(n.T,{style:[n.s.label,{marginTop:14}],children:"Or choose symbols"}),(0,a.jsx)(s.default,{value:I,onChangeText:W,placeholder:"Search NIFTY, RELIANCE\u2026",placeholderTextColor:n.C.muted,accessibilityLabel:"Search symbols",autoCapitalize:"characters",style:n.s.input}),!!i.length&&(0,a.jsx)(n.T,{style:{fontSize:12,color:n.C.green},children:i.join(', ')}),(0,a.jsx)(l.default,{style:[n.s.row,{flexWrap:'wrap',gap:6}],children:c.map(e=>(0,a.jsx)(t.default,{accessibilityRole:"button",accessibilityState:{selected:i.includes(e)},accessibilityLabel:e,onPress:()=>u(e),style:{paddingHorizontal:10,paddingVertical:7,borderRadius:8,borderWidth:1,borderColor:i.includes(e)?n.C.green:n.C.line,backgroundColor:i.includes(e)?n.C.soft:n.C.paper},children:(0,a.jsx)(n.T,{style:{fontSize:12},children:e})},e))})]})}else if('expiry'===z?.kind)$=(0,a.jsx)(p,{title:"Which expiry",onClose:N,options:e.expiries.map(e=>({key:e.key,label:e.label,active:y.expiry===e.key,hint:'nearest'===e.key?'On its own expiry day, IV / delta / gamma conditions read the next expiry':void 0})),onPick:e=>{x({...y,expiry:e}),N()}});else if('strikes'===z?.kind){const i=e.strike_presets.map((e,i)=>({key:`p${i}`,label:e.label,group:'Around the ATM strike',active:JSON.stringify({...e,label:void 0})===JSON.stringify({...y.strikes,label:void 0})})),t=e.delta_bands.map(e=>({key:`d${e.key}`,label:`${e.label} (|\u0394| ${e.lo.toFixed(2)}\u2013${e.hi.toFixed(2)})`,group:'By delta \xb7 computed',active:'delta'===y.strikes.kind&&y.strikes.band===e.key}));$=(0,a.jsx)(p,{title:"Which strikes",subtitle:"ATM is the listed strike nearest spot, re-read at every reading",onClose:N,options:[...i,...t],onPick:i=>{let t;if(i.startsWith('d'))t={kind:'delta',band:i.slice(1)};else{const{label:s,...l}=e.strike_presets[Number(i.slice(1))];t=l}x({...y,strikes:t}),N()}})}const F='atm'===y.strikes.kind?y.strikes:null;return(0,a.jsxs)(l.default,{style:{gap:16},children:[(0,a.jsxs)(l.default,{style:{gap:8},children:[(0,a.jsx)(n.T,{style:v?{fontFamily:'Inter',fontSize:12,lineHeight:18,color:n.C.muted}:{fontFamily:'ManropeBold',fontSize:T?18:20},children:"Tell KANIDA the behaviour you want to find"}),(0,a.jsxs)(l.default,{style:[n.s.row,{gap:8,alignItems:'stretch'}],children:[(0,a.jsx)(s.default,{value:C,onChangeText:k,onSubmitEditing:j,returnKeyType:"go",multiline:T,blurOnSubmit:!0,accessibilityLabel:"Describe the scanner in your own words",placeholder:"e.g. call OI building for 45 min and call IV expanding, F&O stocks",placeholderTextColor:n.C.muted,style:[n.s.input,{flex:1,minHeight:T?84:48,paddingVertical:12,textAlignVertical:'top'}]}),(0,a.jsx)(n.Button,{label:T?'Build':'Build scanner',icon:"zap",onPress:j,loading:w,disabled:!C.trim()})]}),S&&(0,a.jsxs)(l.default,{style:{gap:5},children:[(0,a.jsx)(n.T,{style:{fontSize:12,color:n.C.muted},children:"Understood as the conditions below \u2014 change any chip to adjust."}),S.assumptions.map((e,i)=>(0,a.jsxs)(l.default,{style:[n.s.row,{gap:6,alignItems:'flex-start'}],children:[(0,a.jsx)(n.Icon,{name:"info",size:13,color:n.C.amber}),(0,a.jsx)(n.T,{style:{flex:1,fontSize:12,color:n.C.amber,lineHeight:18},children:e})]},`a${i}`)),S.unmapped.map((e,i)=>(0,a.jsxs)(l.default,{style:[n.s.row,{gap:6,alignSelf:'flex-start',paddingHorizontal:10,paddingVertical:5,borderRadius:8,backgroundColor:n.C.redBg}],children:[(0,a.jsx)(n.Icon,{name:"help-circle",size:13,color:n.C.red}),(0,a.jsxs)(n.T,{style:{fontSize:12,color:n.C.red},children:["Didn\u2019t understand: \u201c",e,"\u201d"]})]},`u${i}`))]})]}),(0,a.jsxs)(l.default,{style:[n.s.row,{flexWrap:'wrap',gap:8}],children:[(0,a.jsx)(n.T,{style:{fontSize:12,color:n.C.muted},children:"Look in"}),(0,a.jsx)(u,{label:(0,o.universeLabel)(y,e),a11y:"Where to look. Change",onPress:()=>A({kind:'universe'})}),(0,a.jsx)(u,{label:e.expiries.find(e=>e.key===y.expiry)?.label||'Nearest expiry',a11y:"Expiry. Change",onPress:()=>A({kind:'expiry'})}),(0,a.jsx)(u,{label:(0,o.strikesLabel)(y.strikes,e),a11y:"Strikes. Change",onPress:()=>A({kind:'strikes'})})]}),(0,a.jsx)(l.default,{style:{gap:8},children:y.conditions.map((i,s)=>{const p=(0,o.metricOf)(e,i.metric),h=p?.states.find(e=>e.key===i.state),m=e.sides.find(e=>e.key===i.side)?.label;return(0,a.jsxs)(l.default,{style:{gap:8},children:[s>0&&(0,a.jsxs)(t.default,{accessibilityRole:"button",accessibilityLabel:`Joined with ${'or'===i.join?'OR':'AND'}. Switch to ${'or'===i.join?'AND':'OR'}`,onPress:()=>x((0,o.toggleJoin)(y,s)),style:({pressed:e})=>[n.s.row,{alignSelf:'flex-start',gap:6,paddingHorizontal:12,paddingVertical:5,borderRadius:8,backgroundColor:'or'===i.join?n.C.amberBg:n.C.soft,opacity:e?.7:1,marginLeft:4}],children:[(0,a.jsx)(n.T,{style:{fontSize:11,fontFamily:'InterSemi',letterSpacing:1.2,color:'or'===i.join?n.C.amber:n.C.green},children:'or'===i.join?'OR':'AND'}),(0,a.jsx)(n.Icon,{name:"repeat",size:12,color:n.C.muted})]}),(0,a.jsxs)(l.default,{style:[n.s.row,{flexWrap:'wrap',gap:6,padding:10,borderRadius:13,borderWidth:1,borderColor:n.C.line,backgroundColor:n.C.dark}],children:[(0,a.jsx)(n.T,{style:{fontSize:11,color:n.C.muted,width:18,textAlign:'center'},children:s+1}),(0,a.jsx)(u,{label:p?.label||i.metric,a11y:`Metric: ${p?.label}. Change`,onPress:()=>A({kind:'metric',index:s})}),!!p?.sides.length&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b,{}),(0,a.jsx)(u,{label:m||'Either side',a11y:`Side: ${m}. Change`,onPress:()=>A({kind:'side',index:s})})]}),(0,a.jsx)(b,{}),(0,a.jsx)(u,{label:h?.label||i.state,arrow:h?.arrow,tone:c[h?.tone||'flat'],a11y:`State: ${h?.label}. Change`,onPress:()=>A({kind:'state',index:s})}),(0,a.jsx)(b,{}),(0,a.jsx)(u,{label:(0,o.windowLabel)(i.window),a11y:`Time window: ${(0,o.windowLabel)(i.window)}. Change`,onPress:()=>A({kind:'window',index:s})}),p?.computed&&(0,a.jsx)(n.Badge,{label:"COMPUTED",tone:"amber"}),(0,a.jsx)(l.default,{style:{flex:1}}),y.conditions.length>1&&(0,a.jsx)(t.default,{accessibilityRole:"button",accessibilityLabel:`Remove c
1137ondition ${s+1}`,onPress:()=>x((0,o.removeCondition)(y,s)),style:({pressed:e})=>({padding:8,opacity:e?.6:1}),children:(0,a.jsx)(n.Icon,{name:"x",size:16,color:n.C.muted})})]})]},s)})}),(0,a.jsxs)(l.default,{style:[n.s.row,{flexWrap:'wrap',gap:10}],children:[y.conditions.length<e.max_conditions&&(0,a.jsx)(n.Button,{label:"Add condition",icon:"plus",kind:"soft",onPress:()=>x((0,o.addCondition)(y,e))}),(0,a.jsx)(n.Button,{label:P?'Fewer options':'More options',icon:"sliders",kind:"outline",onPress:()=>R(e=>!e),accessibilityState:{expanded:P}})]}),P&&(0,a.jsxs)(l.default,{style:[n.s.card,{padding:16,gap:12}],children:[(0,a.jsx)(n.T,{style:n.s.label,children:"Strike range"}),F?(0,a.jsxs)(l.default,{style:{gap:8},children:[(0,a.jsx)(h,{label:"Below ATM",value:F.below,min:0,max:e.max_rungs,onChange:e=>x({...y,strikes:{...F,below:e}})}),(0,a.jsx)(h,{label:"Above ATM",value:F.above,min:0,max:e.max_rungs,onChange:e=>x({...y,strikes:{...F,above:e}})})]}):(0,a.jsxs)(n.T,{style:{fontSize:12,color:n.C.muted},children:[(0,o.str
1137ikesLabel)(y.strikes,e)," \u2014 pick \"ATM \xb15\" under Strikes to set offsets."]}),(0,a.jsx)(n.Checkbox,{checked:y.liquid_only,onChange:e=>x({...y,liquid_only:e}),label:"Liquid strikes only",detail:"Only contracts that clear the Derivative tab's liquidity floors (\u20b92 cr premium traded, open interest, price) at each reading."}),(0,a.jsx)(n.T,{style:{fontSize:11,color:n.C.muted,lineHeight:17},children:"Conditions joined by AND must all hold; OR starts a new group \u2014 \"A AND B OR C\" reads as (A AND B) OR C. Tap AND / OR between two conditions to switch."})]}),(0,a.jsxs)(l.default,{style:{gap:4,padding:14,borderRadius:12,backgroundColor:n.C.dark,borderWidth:1,borderColor:f?n.C.red:n.C.line},children:[(0,a.jsx)(n.T,{style:n.s.label,children:"Reads as"}),(0,a.jsx)(n.T,{style:{fontSize:13,lineHeight:20,color:f?n.C.red:n.C.ink},children:f||m||'\u2026'})]}),$]})};var i=r(d[0]),t=e(r(d[1])),s=e(r(d[2])),l=e(r(d[3])),n=r(d[4]),o=r(d[5]),a=r(d[6]);const c={up:n.C.green,down:n.C.red,warn:n.C.amber,flat:n.C.muted};function u({label:e,arrow:i,onPress:s,tone:l,a11y:o,muted:c}){return(0,a.jsxs)(t.default,{accessibilityRole:"button",accessibilityLabel:o,onPress:s,style:({pressed:e})=>[n.s.row,{gap:6,minHeight:40,paddingHorizontal:12,paddingVertical:7,borderRadius:10,borderWidth:1,borderColor:c?n.C.line:l||n.C.line,backgroundColor:c?n.C.bg:n.C.paper,opacity:e?.7:1}],children:[!!i&&(0,a.jsx)(n.T,{style:{fontSize:14,color:l||n.C.ink,fontFamily:'InterSemi'},children:i}),(0,a.jsx)(n.T,{style:{fontSize:13,fontFamily:'InterMedium',color:c?n.C.muted:n.C.ink},children:e}),(0,a.jsx)(n.Icon,{name:"chevron-down",size:13,color:n.C.muted})]})}const b=()=>(0,a.jsx)(n.Icon,{name:"chevron-right",size:14,color:n.C.muted});function p({title:e,subtitle:i,options:s,onPick:o,onClose:c,children:u}){let b='';return(0,a.jsx)(n.Sheet,{visible:!0,onClose:c,title:e,subtitle:i,children:(0,a.jsxs)(l.default,{style:{gap:6},children:[s.map(e=>{const i=e.group&&e.group!==b?e.group:'';return e.group&&(b=e.group),(0,a.jsxs)(l.default,{style:{gap:6},children:[!!i&&(0,a.jsx)(n.T,{style:[n.s.label,{marginTop:10}],children:i}),(0,a.jsxs)(t.default,{accessibilityRole:"button",accessibilityState:{selected:!!e.active},accessibilityLabel:e.label,onPress:()=>o(e.key),style:({pressed:i})=>[n.s.row,{minHeight:50,paddingHorizontal:14,borderRadius:12,borderWidth:1,borderColor:e.active?n.C.green:n.C.line,backgroundColor:e.active?n.C.soft:n.C.paper,opacity:i?.7:1}],children:[!!e.arrow&&(0,a.jsx)(n.T,{style:{width:26,fontSize:16,textAlign:'center',color:n.C.ink},children:e.arrow}),(0,a.jsxs)(l.default,{style:{flex:1,gap:2,paddingVertical:8},children:[(0,a.jsx)(n.T,{style:{fontFamily:'InterMedium',color:e.active?n.C.green:n.C.ink},children:e.label}),!!e.hint&&(0,a.jsx)(n.T,{style:{fontSize:11,color:n.C.muted,lineHeight:16},children:e.hint})]}),e.active&&(0,a.jsx)(n.Icon,{name:"check",size:16,color:n.C.green})]})]},e.key)}),u]})})}function h({label:e,value:i,min:s,max:o,onChange:c}){const u=(e,i,l)=>(0,a.jsx)(t.default,{accessibilityRole:"button",accessibilityLabel:l,disabled:i<s||i>o,onPress:()=>c(i),style:({pressed:e})=>({width:36,height:36,borderRadius:9,borderWidth:1,borderColor:n.C.line,alignItems:'center',justifyContent:'center',opacity:i<s||i>o?.35:e?.7:1}),children:(0,a.jsx)(n.Icon,{name:e,size:15,color:n.C.ink})});return(0,a.jsxs)(l.default,{style:[n.s.row,{gap:8}],children:[(0,a.jsx)(n.T,{style:{fontSize:12,color:n.C.muted,minWidth:88},children:e}),u('minus',i-1,`Fewer strikes ${e.toLowerCase()}`),(0,a.jsx)(n.T,{style:{minWidth:26,textAlign:'center',fontFamily:'InterSemi'},children:i}),u('plus',i+1,`More strikes ${e.toLowerCase()}`)]})}},1044,[11,375,385,13,821,1045,6]); 1138__d(function(g,r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEFAULT_WINDOW",{enumerable:!0,get:function(){return e}}),_e.newDefinition=function(){return{universe:{kind:'all'},expiry:'nearest',strikes:{kind:'atm',below:5,above:5},liquid_only:!1,conditions:[{metric:'oi',side:'CE',state:'up_cont',window:e}]}},_e.metricOf=n,_e.addCondition=function(t,i){const o=t.conditions[t.conditions.length-1],s='oi'===o?.metric?'iv':'oi',d=n(i,s),u=d?.sides.length?o?.side&&d.sides.includes(o.side)?o.side:'either':null,a={join:'and',metric:s,side:u,state:d?.default_state||'up',window:o?.window||e};return{...t,conditions:[...t.conditions,a]}},_e.withMetric=function(e,n){const t=n.sides.length?e.side&&n.sides.includes(e.side)?e.side:n.sides.includes('either')?'either':n.sides[0]:null,i=n.states.some(n=>n.key===e.state)?e.state:n.default_state,o='maxpain'===n.key&&'open'!==e.window.kind?{kind:'open'}:e.window;return{...e,metric:n.key,side:t,state:i,window:o}},_e.updateCondition=t,_e.removeCondition=function(e,n){const t=e.conditions.filter((e,t)=>
1138t!==n);t[0]&&(t[0]={...t[0],join:void 0});return{...e,conditions:t}},_e.toggleJoin=function(e,n){return t(e,n,{join:'or'===e.conditions[n].join?'and':'or'})},_e.windowLabel=function(e){return'custom'===e.kind?`${e.from}\u2013${e.to}`:'open'===e.kind?'Since open':'minutes'===e.kind?`${e.value} min`:`${e.value} readings`},Object.defineProperty(_e,"sameWindow",{enumerable:!0,get:function(){return i}}),_e.strikesLabel=function(e,n){if('atm'===e.kind)return e.below===e.above?0===e.below?'ATM only':`ATM \xb1${e.below}`:`ATM \u2212${e.below} / +${e.above}`;if('delta'!==e.kind)return`${e.kind.toUpperCase()}, ${e.depth} strikes`;const t=e.band,i=n?.delta_bands.find(e=>e.key===t);return i?`${i.label} (|\u0394| ${i.lo.toFixed(2)}\u2013${i.hi.toFixed(2)})`:'Delta band'},_e.universeLabel=function(e,n){return'symbols'===e.universe.kind?e.universe.symbols.length<=2?e.universe.symbols.join(', '):`${e.universe.symbols.length} symbols`:n?.universes.find(n=>n.key===e.universe.kind)?.label||'Indices + F&O stocks'},Object.defineProperty(_e,"STATUS_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"STATUS_TONE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"TICK_GLYPH",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"hhmm",{enumerable:!0,get:function(){return u}}),_e.nextReading=a,Object.defineProperty(_e,"STALE_READING_MINUTES",{enumerable:!0,get:function(){return l}}),_e.readingNote=function(e,n){if(!u(e))return{text:'',waiting:!1};if(n&&!1===n.open){const e=n.next_open_text||null;return{text:e?`next reading after the open (${e})`:'market closed',waiting:!1}}if(n&&!0===n.open&&n.at){if(String(e).slice(0,10)!==n.at.slice(0,10))return{text:'waiting for today\u2019s first reading',waiting:!0};const t=c(String(e),n.at);if(null!=t&&t>l)return{text:`waiting for the next reading (this one is ${Math.round(t)} min old)`,waiting:!0}}const t=a(e);return{text:t?`next reading ~${t}`:'session closed',waiting:!1}},_e.expiryShort=function(e){if(!e)return'';const[,n,t]=e.split('-');return`${Number(t)} ${['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'][Number(n)-1]||''}`},Object.defineProperty(_e,"READING_TIMES",{enumerable:!0,get:function(){return f}});const e={kind:'minutes',value:45};function n(e,n){return e?.metrics.find(e=>e.key===n)}function t(e,n,t){return{...e,conditions:e.conditions.map((e,i)=>i===n?{...e,...t}:e)}}const i=(e,n)=>JSON.stringify(e)===JSON.stringify(n);const o={new:'NEW MATCH',still:'STILL MATCHING',strengthening:'STRENGTHENING',weakening:'WEAKENING',ended:'CONDITION ENDED'},s={new:'green',still:'green',strengthening:'green',weakening:'amber',ended:'neutral'},d={none:'\xb7',unseen:' ',gap:'\u22ef',new:'\u25cf',still:'\u25a0',strengthening:'\u25b2',weakening:'\u25bc',ended:'\u25cb'},u=e=>String(e||'').slice(11,16);function a(e){const n=u(e);if(!n)return'';const[t,i]=n.split(':').map(Number),o=60*t+i+15;return o>930?'':`${String(Math.floor(o/60)).padStart(2,'0')}:${String(o%60).padStart(2,'0')}`}function c(e,n){const t=e=>{const n=/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})/.exec(e);return n?Date.UTC(+n[1],+n[2]-1,+n[3],+n[4],+n[5]):NaN},i=(t(n)-t(e))/6e4;return Number.isFinite(i)?i:null}const l=20;const f=(()=>{const e=[];for(let n=570;n<=930;n+=15)e.push(`${String(Math.floor(n/60)).padStart(2,'0')}:${String(n%60).padStart(2,'0')}`);return e})()},1045,[]); 1139__d(function(g,r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ResultsPanel=function({body:e,loading:t,error:s,view:c,onView:h,title:p,market:m}){const x=e?.counts,f=(0,l.readingNote)(e?.as_of,m);return(0,o.jsxs)(n.default,{style:{gap:14},children:[(0,o.jsxs)(n.default,{style:[i.s.between,{flexWrap:'wrap'}],children:[(0,o.jsxs)(n.default,{style:{gap:3,flex:1,minWidth:220},children:[(0,o.jsx)(i.T,{style:{fontFamily:'ManropeBold',fontSize:19},children:p}),!!e?.as_of&&(0,o.jsxs)(i.T,{style:{fontSize:12,color:i.C.muted},children:["As of the ",e.as_of.slice(11,16)," reading, ",e.session,f.text?` \xb7 ${f.text}`:'',null!=e.elapsed_ms?` \xb7 evaluated in ${(e.elapsed_ms/1e3).toFixed(1)}s`:'']})]}),(0,o.jsxs)(n.default,{style:[i.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,o.jsx)(i.Chip,{label:`Active ${x?x.active:'\u2013'}`,active:'active'===c,onPress:()=>h('active')}),(0,o.jsx)(i.Chip,{label:`Ended today ${x?x.ended:'\u2013'}`,active:'ended'===c,onPress:()=>h('ended')}),(0,o.jsx)(i.Chip,{label:`All ${x?x.all:'\u2013'}`,active:'all'===c,onPress:()=>h('all')})]})]}),(e?.notes||[]).map((e,t)=>(0,o.jsxs)(n.default,{style:[i.s.row,{gap:8,alignItems:'flex-start',padding:12,borderRadius:10,backgroundColor:i.C.amberBg}],children:[(0,o.jsx)(i.Icon,{name:"info",size:14,color:i.C.amber}),(0,o.jsx)(i.T,{style:{flex:1,fontSize:12,lineHeight:18,color:i.C.amber},children:e.text})]},t)),t&&!e?(0,o.jsx)(i.Loading,{}):s?(0,o.jsx)(i.Empty,{icon:"alert-circle",title:"Could not run this scanner",detail:s}):e?e.available?e.matches.length?(0,o.jsxs)(n.default,{style:{gap:10},children:[t&&(0,o.jsx)(i.T,{style:{fontSize:12,color:i.C.muted},children:"Refreshing\u2026"}),e.matches.map(t=>(0,o.jsx)(u,{m:t,readings:e.readings},t.key)),e.truncated&&(0,o.jsxs)(i.T,{style:{fontSize:12,color:i.C.muted},children:["Showing the first ",e.shown," \u2014 the newest changes first."]})]}):(0,o.jsx)(i.Empty,{icon:"search",title:'ended'===c?'Nothing has ended today':'Nothing matches right now',detail
1139:'active'===c&&x&&x.ended?`${x.ended} instrument${1===x.ended?'':'s'} matched earlier today and ended \u2014 see "Ended today".`:'KANIDA checks again at every 15-minute reading.'}):(0,o.jsx)(i.Empty,{icon:"clock",title:"No readings yet",detail:e.text||''}):null]})};var t=r(d[0]),s=e(r(d[1])),n=e(r(d[2])),i=r(d[3]),l=r(d[4]),o=r(d[5]);const c={none:i.C.line,unseen:'transparent',gap:i.C.muted,new:i.C.green,still:i.C.green,strengthening:i.C.green,weakening:i.C.amber,ended:i.C.muted};function h({m:e,readings:t}){return(0,o.jsxs)(n.default,{style:{gap:8},children:[(0,o.jsx)(n.default,{style:[i.s.row,{flexWrap:'wrap',gap:2}],accessibilityLabel:`Timeline: ${e.timeline.map((e,s)=>`${t[s]} ${e}`).join(', ')}`,children:e.timeline.map((e,s)=>(0,o.jsxs)(n.default,{style:{alignItems:'center',width:30,gap:2},children:[(0,o.jsx)(i.T,{style:{fontSize:13,color:c[e],lineHeight:16},children:l.TICK_GLYPH[e]}),(0,o.jsx)(i.T,{style:{fontSize:9,color:i.C.muted,lineHeight:12},children:(t[s]||'').replace(':','')})]},s))}),(0,o.jsx)(i.T,{style:{fontSize:10,color:i.C.muted},children:"\u25cf new \u25a0 matching \u25b2 strengthening \u25bc weakening \u25cb ended \u22ef reading not captured \xb7 not matching"}),(0,o.jsxs)(i.T,{style:{fontSize:12,color:i.C.ink},children:["First matched ",e.first_matched," \xb7 ",e.readings_matched," matching reading",1===e.readings_matched?'':'s'," today",e.episodes.length>1?` \xb7 ${e.episodes.length} separate episodes`:''," \xb7 ",e.active?'still active':`ended ${e.ended_at}`]}),e.episodes.length>1&&(0,o.jsx)(n.default,{style:{gap:2},children:e.episodes.map((e,t)=>(0,o.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:["Episode ",t+1,": ",e.start," \u2192 ",e.end||'now'," (",e.readings," reading",1===e.readings?'':'s',")"]},t))})]})}function u({m:e,readings:c}){const[u,p]=(0,t.useState)(!1),m=e.episodes.length>1&&'new'===e.status,x=null!=e.strike?`${e.underlying} \xb7 ${(0,l.expiryShort)(e.expiry)} \xb7 ${e.title.split(' \xb7 ')[1]}`:`${e.underlying} \xb7 ${(0,l.expiryShort)(e.expiry)} expiry`;return(0,o.jsxs)(n.default,{style:[i.s.card,{padding:16,gap:10,borderColor:(e.active,i.C.line),opacity:e.active?1:.86}],children:[(0,o.jsxs)(n.default,{style:[i.s.between,{alignItems:'flex-start',flexWrap:'wrap'}],children:[(0,o.jsxs)(n.default,{style:{gap:6,flex:1,minWidth:220},children:[(0,o.jsxs)(n.default,{style:[i.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,o.jsx)(i.Badge,{label:'ended'===e.status?`ENDED ${e.ended_at}`:m?'MATCHED AGAIN':l.STATUS_LABEL[e.status],tone:l.STATUS_TONE[e.status],dot:!0}),e.computed&&(0,o.jsx)(i.Badge,{label:"IV COMPUTED",tone:"amber"}),e.thin&&(0,o.jsx)(i.Badge,{label:"BELOW LIQUIDITY FLOORS",tone:"neutral"})]}),(0,o.jsx)(i.T,{style:{fontFamily:'ManropeBold',fontSize:17},children:x})]}),(0,o.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted,textAlign:'right'},children:[m?`again ${e.episode_started} \xb7 first ${e.first_matched}`:`first ${e.first_matched}`,'\n',e.episode_readings," reading",1===e.episode_readings?'':'s',e.duration_min?` \xb7 ${e.duration_min} min`:'']})]}),(0,o.jsxs)(n.default,{style:{gap:4},children:[(0,o.jsx)(i.T,{style:[i.s.label,{fontSize:10}],children:e.active?'Matched because':`Matched ${e.episode_started}\u2013${e.last_matched} because`}),e.because.map((e,t)=>(0,o.jsx)(i.T,{style:{fontSize:13,lineHeight:20},children:e},t)),!!e.ended_because&&(0,o.jsxs)(i.T,{style:{fontSize:13,lineHeight:20,color:i.C.muted},children:["Ended: ",e.ended_because]})]}),(0,o.jsxs)(s.default,{accessibilityRole:"button",accessibilityState:{expanded:u},accessibilityLabel:u?'Hide timeline':'Show timeline',onPress:()=>p(e=>!e),style:[i.s.row,{gap:6,alignSelf:'flex-start',paddingVertical:4}],children:[(0,o.jsx)(i.Icon,{name:u?'chevron-up':'clock',size:13,color:i.C.green}),(0,o.jsx)(i.T,{style:{fontSize:12,color:i.C.green,fontFamily:'InterMedium'},children:u?'Hide today\u2019s timeline':'Today\u2019s timeline'})]}),u&&(0,o.jsx)(h,{m:e,readings:c})]})}},1046,[11,375,13,821,1045,6]); 1140__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.SignIn}});var t=r(d[0])},1047,[894]); 1141__d(function(g,r,i,a,m,e,d){"use strict";
1141Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var n=r(d[1]),t=r(d[2]);function u(){return(0,t.jsx)(n.SignIn,{signup:!0})}},1048,[11,894,6]); 1142__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.WorkspaceRoute}});var t=r(d[0])},1049,[896]); 1143__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var t=r(d[1]),n=r(d[2]);function u(){return(0,n.jsx)(t.StrategiesTab,{})}},1050,[11,1051,6]); 1144__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.StrategiesTab=function(){const e=(0,p.useLocalSearchParams)(),t=String(e.id||''),n=String(e.view||''),{width:l}=(0,c.default)(),r={library:'mine',gallery:'gallery',scratch:'scratch',movers:'movers',screener:'oscreener'},s=!t&&n in r?r[n]:null;return(0,a.useEffect)(()=>{if(!s)return;const t=Object.fromEntries(Object.entries(e).filter(([e])=>'view'!==e).map(([e,t])=>[e,String(t)]));(0,u.writeStore)('derivative-studio','tool',{id:s}),p.router.replace({pathname:'/derivative-studio',params:{...t,tool:s}})},[s]),s?null:(0,T.jsxs)(d.default,{style:{flexGrow:1},children:[(0,T.jsx)($.DisclaimerNote,{compact:l<700,style:{paddingHorizontal:l>=900?24:14,paddingTop:10,maxWidth:1100,width:'100%',alignSelf:'center',...'gallery'===n||'scratch'===n||'movers'===n||'screener'===n?{display:'none'}:null}}),(0,T.jsx)(d.default,{style:{flexGrow:1},children:(0,T.jsx)(P,{id:t,view:n,open:String(e.open||'')})})]})};var t=_r(_d[0]),n=_r(_d[1]),l=_r(_d[2]),r=_r(_d[3]),s=_r(_d[4]),i=_r(_d[5]),a=_r(_d[6]),o=_r(_d[7]),d=e(_r(_d[8])),c=e(_r(_d[9])),p=_r(_d[10]),u=_r(_d[11]),y=_r(_d[12]),f=_r(_d[13]),x=_r(_d[14]),h=_r(_d[15]),j=_r(_d[16]),S=_r(_d[17]),b=_r(_d[18]),w=_r(_d[19]),v=_r(_d[20]),_=_r(_d[21]),C=_r(_d[22]),k=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]);function P({id:e,view:a,open:o}){return'deployment'===a&&e?(0,T.jsx)(w.DeploymentMonitor,{id:e}):'desk'===a?(0,T.jsx)(s.OptionsDesk,{sid:e||void 0},e||'new'):e?(0,T.jsx)(h.Builder,{id:e,openTemplate:'template'===o,openAdjust:'adjust'===o,openChain:'chain'===o},e):'discover'===a?(0,T.jsx)(j.Discover,{}):'gallery'===a?(0,T.jsx)(t.StrategyGallery,{}):'scratch'===a?(0,T.jsx)(n.ScratchDesk,{}):'movers'===a?(0,T.jsx)(l.MarketMovers,{}):'screener'===a?(0,T.jsx)(r.OptionsScreener,{}):'template'===a?(0,T.jsx)(i.StartView,{kind:a}):'paper'===a?(0,T.jsx)(z,{}):'alerts'===a?(0,T.jsx)(S.AlertsCenter,{}):'lab'===a?(0,T.jsx)(b.LabPage,{}):(0,T.jsx)(s.OptionsDesk,{},"new")}function z(){const{width:e}=(0,c.default)(),t=e>=900,[n,l]=(0,a.useState)(null),[r,s]=(0,a.useState)(''),[i,u]=(0,a.useState)([]),[h,j]=(0,a.useState)(null),[S,b]=(0,a.useState)(null),[w,$]=(0,a.useState)(''),P=(0,C.useSbStatus)(),z=P?.market_state||null,L=(0,a.useCallback)(()=>{s(''),f.sb.paperList().then(e=>l(e.runs)).catch(e=>s(e.message)),f.exec.list().then(e=>{u(e.deployments),j(e.paper_capital),$('')}).catch(e=>$(e.message))},[]);return(0,a.useEffect)(()=>(0,o.visiblePoll)(L,o.LIVE_POLL_MS),[L]),(0,T.jsxs)(d.default,{style:{padding:t?24:14,gap:16,maxWidth:1100,width:'100%',alignSelf:'center'},children:[(0,T.jsx)(d.default,{style:[y.s.row,{gap:8}],children:(0,T.jsx)(y.Button,{label:"My Strategies",icon:"chevron-left",kind:"outline",onPress:()=>p.router.replace('/strategies')})}),(0,T.jsxs)(d.default,{style:{gap:4},children:[(0,T.jsx)(y.T,{style:{fontFamily:'ManropeBold',fontSize:22},children:"Paper runs"}),(0,T.jsxs)(y.T,{style:{fontSize:13,color:y.C.muted},children:["Simulated ledgers only - no order was ever sent to a broker. Two modes, shown on every run: ",(0,T.jsx)(y.T,{style:{fontFamily:'InterSemi',color:y.C.ink},children:"Live-quote paper"})," fills limit orders against live bid/ask, only up to the size on show; ",(0,T.jsx)(y.T,{style:{fontFamily:'InterSemi',color:y.C.ink},children:"Stored-price practice"})," fills at a stored last price moved against you by slippage. Both include estimated charges."]})]}),(0,T.jsx)(C.MarketStateBanner,{state:z}),!!r&&(0,T.jsx)(v.ErrorRetry,{what:"Paper runs",error:r,onRetry:L}),!!w&&(0,T.jsx)(v.ErrorRetry,{what:"Paper deployments",error:w,onRetry:L}),h&&(0,T.jsx)(y.T,{style:{fontSize:12,color:y.C.muted},children:`Live-quote paper capital (deployments only) ${(0,_.inr)(h.capital)} \xb7 margin blocked ${(0,_.inr)(h.blocked)} \xb7 available ${(0,_.inr)(h.available)}. Stored-price practice runs have no capital account.`}),i.length>0&&(0,T.jsxs)(d.default,{style:{gap:10},children:[(0,T.jsx)(y.T,{style:{fontFamily:'InterSemi'},children:"Live-quote paper"}),i.map(e=>(0,T.jsxs)(d.default,{style:{gap:6},children:[(0,T.jsx)(x.DeploymentCard,{d:e,onChanged:L,onClose:b}),(0,T.jsx)(d.default,{style:{alignSelf:'flex-start'},children:(0,T.jsx)(y.Button,{label:"Open monitor",icon:"external-link",kind:"outline",onPress:()=>p.router.push({pathname:'/strategies',params:{view:'deployment',id:e.id}})})})]},e.id))]}),S&&(0,T.jsx)(x.OrderReview,{visible:!0,strategyId:S.strategy_id,deployment:S,onClose:()=>b(null),onPlaced:()=>{b(null),L()}}),(0,T.jsx)(y.T,{style:{fontFamily:'InterSemi'},children:"Stored-price practice"}),null===n?r?null:(0,T.jsx)(y.Loading,{}):n.length?n.map(e=>{const t=(0,k.runState)(e),n='pending'===e.status||'cancelled'===e.status;return(0,T.jsxs)(d.default,{style:{backgroundColor:y.C.paper,borderWidth:1,borderColor:y.C.line,borderRadius:14,padding:14,gap:8},children:[(0,T.jsxs)(d.default,{style:[y.s.between,{flexWrap:'wrap',alignItems:'flex-start'}],children:[(0,T.jsxs)(d.default,{style:[y.s.row,{gap:8,flexWrap:'wrap',flex:1,minWidth:240,alignItems:'flex-start'}],children:[(0,T.jsx)(C.PaperRunState,{run:e,prefix:"Practice"}),(0,T.jsx)(y.T,{style:{fontFamily:'InterSemi'},children:e.strategy_name||'Strategy'}),(0,T.jsx)(y.T,{style:{fontSize:12,color:y.C.muted},children:`snapshot #${e.revision.n} "${e.revision.name}"`})]}),(0,T.jsxs)(d.default,{style:[y.s.row,{gap:8,flexWrap:'wrap',alignItems:'flex-start'}],children:[(0,T.jsx)(y.Button,{label:"Open strategy",kind:"outline",onPress:()=>p.router.push({pathname:'/strategies',params:'portfolio'===e.kind?{view:'desk',id:e.strategy_id}:{id:e.strategy_id}})}),(0,T.jsx)(C.PaperRunAction,{run:e,state:z,onClose:async()=>{try{await f.sb.paperClose(e.id)}finally{L()}},onCancel:async()=>{try{await f.sb.paperCancel(e.id)}finally{L()}}})]})]}),(0,T.jsx)(y.T,{style:{fontSize:12,color:y.C.muted},children:n?`Placed ${(0,_.istStamp)(e.pending?.placed_at||e.opened_action_at||null)}${'pending'===e.status?' \xb7 no fill yet':' \xb7 never filled'}`:`Opened ${(0,_.istStamp)(e.opened_action_at||e.opened_reading)} using prices from ${(0,_.istStamp)(e.opened_reading)}${e.closed_reading?` \xb7 closed ${(0,_.istStamp)(e.closed_action_at||e.closed_reading)} using prices from ${(0,_.istStamp)(e.closed_reading)}`:` \xb7 marked at ${(0,_.istStamp)(e.as_of)}`}`}),!!e.eligible&&!n&&(0,T.jsx)(y.T,{style:{fontSize:11,color:y.C.muted},children:['monitor','alerts','adjust'].filter(t=>e.eligible[t]&&!e.eligible[t].ok).map(t=>
1144e.eligible[t].reason||'').filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(' ')}),(0,T.jsx)(d.default,{children:[['Leg','Units','Entry fill','Exit / mark','P&L'],...n?(0,k.plannedRows)(e):e.rows.map(e=>[e.label,String(e.units),(0,_.num)(e.entry),null!=e.exit?`${(0,_.num)(e.exit)} exit`:null!=e.mark?`${(0,_.num)(e.mark)} mark`:'\u2014',(0,_.signed)(e.pnl)])].map((e,t)=>(0,T.jsx)(d.default,{style:[y.s.row,{gap:8,borderTopWidth:t?1:0,borderColor:y.C.line,paddingVertical:5}],children:e.map((e,n)=>(0,T.jsx)(y.T,{style:{flex:n?1:2,fontSize:t?12:10,color:t?y.C.ink:y.C.muted,textAlign:n?'right':'left',fontVariant:['tabular-nums']},children:e},n))},t))}),t.showPnl&&(0,T.jsx)(y.T,{style:{fontSize:13,fontFamily:'InterSemi',color:(e.net||0)>=0?y.C.green:y.C.red},children:`Net ${(0,_.signed)(e.net)} = realised ${(0,_.signed)(e.realised)} + unrealised ${(0,_.signed)(e.unrealised)} \u2212 fees ${(0,_.inr)(e.fees)}`}),t.showPnl&&null!=e.close_now_estimate&&(0,T.jsx)(y.T,{style:{fontSize:12,color:y.C.muted},children:`If closed now (exit slippage and charges included): ${(0,_.signed)(e.close_now_estimate)}`}),!n&&(e.by_underlying||[]).length>1&&(0,T.jsx)(y.T,{style:{fontSize:12,color:y.C.muted},children:e.by_underlying.map(e=>`${e.underlying} ${(0,_.signed)(e.net??e.pnl??null)}`).join(' \xb7 ')}),!1===e.lab_evidence?.eligible&&(0,T.jsx)(y.T,{style:{fontSize:11,color:y.C.muted},children:`Not usable as Lab evidence: ${e.lab_evidence.reason||''}`}),e.warnings.map((e,t)=>(0,T.jsx)(y.T,{style:{fontSize:12,color:y.C.amber},children:e},t))]},e.id)}):(0,T.jsx)(y.Empty,{icon:"play",title:"No paper runs yet",detail:"Open a strategy and choose Paper trade to record simulated fills against a frozen snapshot."})]})}},1051,[997,987,998,999,1052,975,11,920,13,400,252,871,821,976,989,988,1054,985,1055,1056,980,979,992,986,901,6]); 1145__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.OptionsDesk=function({sid:e}={}){const{height:u}=(0,s.default)(),h=(0,a.useSharedRead)('/api/derivatives/filters',0),[k,v]=(0,t.useState)(()=>{const e=(0,d.readStore)(x,'draft').legs;return Array.isArray(e)&&e.length?e:[{id:C(),underlying:'NIFTY',kind:'CE',expiry:'',strike:null,side:'buy',lots:1}]});(0,t.useEffect)(()=>{(0,d.writeStore)(x,'draft',{legs:k})},[k]);const[T,P]=(0,t.useState)('legs'),[R,F]=(0,t.useState)(''),[_,W]=(0,t.useState)({}),M=(0,t.useCallback)((e,t)=>W(n=>({...n,[e]:t})),[]),L=e=>{for(const t of k){const n=_[t.id];if(t.underlying===e&&null!=n?.spot)return n.spot}return null},B=e=>v(t=>{const n=new Set(t.map(e=>e.underlying));return t.length>=8?(F("A desk holds up to 8 legs."),t):!n.has(e.underlying)&&n.size>=4?(F("A desk holds up to 4 instruments."),t):[...t,{...e,side:'EQ'===e.kind?'buy':e.side,id:C()}]}),$=e=>t=>v(n=>n.map((n,l)=>l===e?t:n)),U=e=>()=>v(t=>t.length>1?t.filter((t,n)=>n!==e):t),H=e=>{const t=k[0]?.underlying||'NIFTY',n=!!h.data?.underlyings?.find(e=>e.underlying===t)?.is_index||/NIFTY/.test(t);v(e.legs(t,n?'RELIANCE':t).map(e=>({...e,id:C()}))),P('legs')},[Q,A]=(0,t.useState)(''),[N,O]=(0,t.useState)(null),[V,q]=(0,t.useState)(''),D=(0,t.useMemo)(()=>(0,f.deskBody)(k,e=>_[e]?.expiry||null),[k,_]),Y=k.every(e=>'EQ'===e.kind||'FUT'===e.kind||null!=e.strike),{res:G,err:J,busy:K}=(0,f.useDeskAnalysis)(D,Y);(0,t.useEffect)(()=>{e&&g.sb.get(e).then(e=>{const t=e.draft?.body;t&&(O({id:e.id,version:e.draft.version}),A(e.name),v(t.legs.map(e=>({id:C(),underlying:e.underlying||t.underlying,kind:e.type,expiry:e.expiry||'',strike:e.strike??null,side:'B'===e.side?'buy':'sell',lots:e.lots}))))}).catch(e=>F(e.message))},[e]);const X=async()=>{const e=Q.trim()||`Desk ${(new Date).toLocaleDateString('en-IN',{day:'numeric',month:'short'})}`;q('save');try{let t;N?(t=await g.sb.save(N.id,N.version,D),e&&await g.sb.meta(N.id,{name:e})):t=await g.sb.create(D,e);const n={id:t.id,version:t.draft?.version??0};return O(n),A(e),F(`Saved "${e}" to My strategies.`),n}catch(e){return F(e.message),null}finally{q('')}},[Z,ee]=(0,t.useState)(null),te=(G?.legs||[]).filter(e=>e.fill_block),ne=(0,t.useMemo)(()=>{let e=0,t=0,n=0,l=0,r=0,i=0,s=!0;for(const o of k){const d=_[o.id];if(!d||null==d.price||null==d.lot){s=!1;continue}const a='buy'===o.side?1:-1,u=d.lot*o.lots;'CE'===o.kind||'PE'===o.kind?e+=-a*d.price*u:t+=a*d.price*u;const c='FUT'===o.kind?d.price:L(o.underlying)??d.spot??d.price;d.g?(n+=a*d.g.delta*u*c*.01,l+=.5*a*d.g.gamma*u*(.01*c)**2,r+=a*d.g.theta*u,i+=a*d.g.vega*u):s=!1}
1145return{net:e,notional:t,dRs:n,gRs:l,th:r,vg:i,greekOk:s}},[k,_]),le=[...new Set(k.map(e=>e.underlying))],re=E(k,_,L,0),[ie,se]=(0,t.useState)({w:0,h:0}),oe=Math.max(640,u-200),de=({k:e,v:t,sub:n,c:l})=>(0,p.jsxs)(i.default,{style:{minWidth:96},children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:e}),(0,p.jsx)(o.T,{style:{fontSize:18,fontFamily:'InterSemi',color:l||o.C.ink},children:t}),!!n&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:n})]});return(0,p.jsxs)(i.default,{style:{padding:16,gap:12,width:'100%'},children:[(0,p.jsxs)(i.default,{style:[o.s.row,{gap:10,flexWrap:'wrap',zIndex:20}],children:[(0,p.jsxs)(i.default,{style:{gap:2,flex:1,minWidth:320},children:[(0,p.jsx)(o.T,{style:{fontFamily:'ManropeBold',fontSize:22,color:o.C.ink},children:"Multi-stock desk"}),(0,p.jsx)(o.T,{style:{fontSize:13,color:o.C.muted},children:"One strategy across instruments - index options, futures, stock options and shares - judged as one portfolio. Research only."})]}),(0,p.jsx)(r.default,{value:Q,onChangeText:A,placeholder:"Name this desk",placeholderTextColor:o.C.muted,style:{width:200,height:32,borderWidth:1,borderColor:o.C.line,borderRadius:8,paddingHorizontal:10,color:o.C.ink,fontFamily:'Inter'}}),(0,p.jsxs)(n.default,{onPress:X,disabled:!!V,accessibilityRole:"button",style:e=>[o.s.row,{gap:6,height:32,paddingHorizontal:12,borderRadius:8,backgroundColor:e.hovered?o.C.dark:o.C.soft,borderWidth:1,borderColor:o.C.green,opacity:V?.6:1}],children:[(0,p.jsx)(o.Icon,{name:"save",size:14,color:o.C.green}),(0,p.jsx)(o.T,{style:{fontSize:12,fontFamily:'InterSemi',color:o.C.green},children:'save'===V?'Saving\u2026':N?'Save changes':'Save'})]}),(0,p.jsxs)(n.default,{onPress:async()=>{const e=await X();if(e){q('paper');try{const t=await g.sb.paperStart(e.id,{expected_version:e.version,request_id:C()+C()});ee(t),F(t.queued?`Paper run queued: ${t.pending?.fill_at_text||'it fills forward at the next reading where every instrument has a fresh price'}.`:'Paper run started at the latest common reading.')}catch(e){F(e.message)}finally{q('')}}},disabled:!!V||!1===G?.paper_entry?.allowed,accessibilityRole:"button",accessibilityHint:"Saves the desk, then starts a simulated paper run - no order is sent",style:e=>[o.s.row,{gap:6,height:32,paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:o.C.line,backgroundColor:e.hovered?o.C.dark:'transparent',opacity:V||!1===G?.paper_entry?.allowed?.55:1}],children:[(0,p.jsx)(o.Icon,{name:"play",size:14,color:o.C.ink}),(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.ink},children:'paper'===V?'Starting\u2026':'Paper trade'})]}),Z&&(0,p.jsx)(n.default,{onPress:()=>y.router.push({pathname:'/strategies',params:{view:'paper'}}),accessibilityRole:"link",children:(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.green},children:"Open Paper runs"})})]}),!!R&&(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.green},children:R}),(0,p.jsx)(c.SplitPanes,{id:"desk",height:oe,initial:.56,left:(0,p.jsxs)(i.default,{style:{flex:1,height:oe,borderWidth:1,borderColor:o.C.line,borderRadius:12,backgroundColor:o.C.dark,overflow:'hidden'},children:[(0,p.jsxs)(i.default,{style:[o.s.row,{paddingHorizontal:12,height:44,borderBottomWidth:1,borderColor:o.C.line,gap:10}],children:[(0,p.jsx)(S,{value:T,items:[{id:'legs',label:'Legs'},{id:'chain',label:'Pick from option chain'}],onChange:P,label:"How to add legs"}),(0,p.jsx)(i.default,{style:{flex:1}}),'legs'===T&&(0,p.jsxs)(n.default,{accessibilityRole:"button",onPress:()=>B({underlying:k[k.length-1]?.underlying||'NIFTY',kind:'CE',expiry:'',strike:null,side:'buy',lots:1}),style:e=>[o.s.row,{gap:6,height:30,paddingHorizontal:10,borderRadius:8,borderWidth:1,borderColor:o.C.green,backgroundColor:e.hovered?o.C.soft:'transparent'}],children:[(0,p.jsx)(o.Icon,{name:"plus",size:14,color:o.C.green}),(0,p.jsx)(o.T,{style:{fontSize:12,fontFamily:'InterSemi',color:o.C.green},children:"Add leg"})]})]}),(0,p.jsxs)(l.default,{style:{flex:1,display:'legs'===T?'flex':'none'},contentContainerStyle:{padding:10,gap:8,paddingBottom:340},children:[(0,p.jsxs)(i.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Start from"}),z.map(e=>(0,p.jsx)(n.default,{onPress:()=>H(e),accessibilityRole:"button",accessibilityHint:e.why,title:e.why,style:e=>[{height:26,paddingHorizontal:9,justifyContent:'center',borderRadius:13,borderWidth:1,borderColor:o.C.line,backgroundColor:e.hovered?o.C.soft:o.C.paper}],children:(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.ink},children:e.label})},e.id))]}),k.map((e,t)=>(0,p.jsx)(w,{leg:e,index:t,filters:h.data,onChange:$(t),onRemove:U(t),onQuote:M},e.id))]}),'chain'===T&&(0,p.jsx)(i.default,{style:{flex:1,padding:10},children:(0,p.jsx)(I,{filters:h.data,onAdd:e=>{B(e),F(`Added ${'buy'===e.side?'Buy':'Sell'} ${e.underlying} ${j[e.kind]}${e.strike?' '+e.strike:''}.`)}})})]}),right:(0,p.jsxs)(i.default,{style:{flex:1,height:oe,borderWidth:1,borderColor:o.C.line,borderRadius:12,backgroundColor:o.C.paper,overflow:'hidden'},children:[(0,p.jsxs)(i.default,{style:[o.s.row,{paddingHorizontal:12,height:44,borderBottomWidth:1,borderColor:o.C.line}],children:[(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:11,letterSpacing:1,textTransform:'uppercase',color:o.C.ink},children:"Portfolio"}),(0,p.jsx)(i.default,{style:{flex:1}}),(0,p.jsxs)(o.T,{style:{fontSize:11,color:o.C.muted},children:[k.length," legs \xb7 ",le.join(', ')]})]}),(0,p.jsxs)(i.default,{style:[o.s.row,{gap:18,paddingHorizontal:14,paddingVertical:10,borderBottomWidth:1,borderColor:o.C.line,flexWrap:'wrap'}],children:[(0,p.jsx)(de,{k:"Net premium",v:b(ne.net),sub:ne.net>=0?'received':'paid',c:ne.net>=0?o.C.green:o.C.ink}),0!==ne.notional&&(0,p.jsx)(de,{k:"Futures + shares",v:b(Math.abs(ne.notional)),sub:ne.notional>=0?'net long notional':'net short notional'}),(0,p.jsx)(de,{k:"P&L at expiry, no move",v:b(re),c:null==re?o.C.muted:re>=0?o.C.green:o.C.red})]}),(0,p.jsxs)(i.default,{style:[o.s.row,{gap:18,paddingHorizontal:14,paddingVertical:10,borderBottomWidth:1,borderColor:o.C.line,flexWrap:'wrap'}],children:[(0,p.jsx)(de,{k:"\u0394 per 1 % move",v:ne.greekOk?b(ne.dRs):'\u2014',c:ne.dRs>=0?o.C.green:o.C.red}),(0,p.jsx)(de,{k:"\u0393 for a 1 % move",v:ne.greekOk?b(ne.gRs):'\u2014'}),(0,p.jsx)(de,{k:"\u0398 per day",v:ne.greekOk?b(ne.th):'\u2014',c:ne.th>=0?o.C.green:o.C.red}),(0,p.jsx)(de,{k:"Vega per IV point",v:ne.greekOk?b(ne.vg):'\u2014'}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted,alignSelf:'center'},children:"model estimates"})]}),te.length>0&&(0,p.jsx)(i.default,{style:{paddingHorizontal:14,paddingVertical:6,borderBottomWidth:1,borderColor:o.C.line},children:te.map(e=>(0,p.jsxs)(o.T,{style:{fontSize:11,color:o.C.muted},children:[e.label,": can't fill at this reading (",m[e.fill_block]||e.fill_block,")."]},e.id))}),(0,p.jsx)(i.default,{style:{flex:1,minHeight:220},onLayout:e=>{const{width:t,height:n}=e.nativeEvent.layout;se({w:Math.round(t),h:Math.round(n)})},children:ie.w>0&&(0,p.jsx)(f.PortfolioViews,{res:G,err:J,busy:K,width:ie.w,height:ie.h})})]})})]})};var t=_r(_d[0]),n=e(_r(_d[1])),l=e(_r(_d[2])),r=e(_r(_d[3])),i=e(_r(_d[4])),s=e(_r(_d[5])),o=_r(_d[6]),d=_r(_d[7]),a=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),y=_r(_d[12]),g=_r(_d[13]),f=_r(_d[14]),p=_r(_d[15]);const x='options-desk',k=e=>'number'==typeof e&&Number.isFinite(e)?e:null,b=e=>null==e?'\u2014':(e<0?'\u2212\u20b9':'\u20b9')+Math.abs(Math.round(e)).toLocaleStr
1145ing('en-IN'),C=()=>Math.random().toString(36).slice(2,9),m={no_trade_time:'the shares carry no trade time',not_in_session:'outside the trading session',not_a_quote:'no valid quote',untraded:'not traded yet at this reading'},j={CE:'Call',PE:'Put',FUT:'Future',EQ:'Shares'};function S({value:e,items:t,onChange:l,label:r}){return(0,p.jsx)(i.default,{accessibilityRole:"radiogroup",accessibilityLabel:r,style:[o.s.row,{gap:0,borderWidth:1,borderColor:o.C.line,borderRadius:6,overflow:'hidden'}],children:t.map((t,r)=>{const i=t.id===e;return(0,p.jsx)(n.default,{role:"radio","aria-checked":i,accessibilityState:{checked:i},onPress:()=>l(t.id),style:e=>[{minHeight:28,paddingHorizontal:9,justifyContent:'center',borderLeftWidth:r?1:0,borderColor:o.C.line,backgroundColor:i?o.C.soft:e.hovered?o.C.dark:'transparent'}],children:(0,p.jsx)(o.T,{style:{fontSize:12,lineHeight:16,fontFamily:i?'InterSemi':'InterMedium',color:i?o.C.green:o.C.ink},children:t.label})},t.id)})})}function v(e,t){const n=(e,t)=>t?`&${e}=${encodeURIComponent(t)}`:'',l='CE'===e.kind||'PE'===e.kind,r=(0,a.useSharedRead)('FUT'!==e.kind&&e.underlying?`/api/derivatives/chain?underlying=${encodeURIComponent(e.underlying)}${n('expiry',l?e.expiry:'')}&atm_window=15`:null,0),i=(0,a.useSharedRead)('FUT'===e.kind&&e.underlying?`/api/derivatives/futures-chart?underlying=${encodeURIComponent(e.underlying)}&interval=15m`:null,0),s=r.data?.as_of||null,o=(0,a.useSharedRead)(l&&null!=e.strike&&s?`/api/derivatives/iv-grid-series?underlying=${encodeURIComponent(e.underlying)}${n('expiry',e.expiry)}&at=${encodeURIComponent(s)}&legs=${encodeURIComponent(`${e.kind}:${e.strike}`)}`:null,0),d=t?.underlyings?.find(t=>t.underlying===e.underlying)?.lot_size??null;if('FUT'===e.kind){const e=(i.data?.candles||[]).filter(e=>!e.gap&&null!=k(e.close)),t=e[e.length-1];return{spot:null,lot:d,price:k(t?.close),strikes:[],at:t?.at||null,expiry:i.data?.contract?.expiry||null,g:{delta:1,gamma:0,theta:0,vega:0}}}const u=k(r.data?.spot);if('EQ'===e.kind)return{spot:u,lot:1,price:u,strikes:[],at:s,expiry:null,g:{delta:1,gamma:0,theta:0,vega:0}};const c=r.data?.rows||[],y=c.find(t=>t.strike===e.strike),g=o.data,f=g?.legs?.find(e=>e.present),p=f?k((f.iv_pct||[]).filter(e=>null!=e).slice(-1)[0]):null,x=r.data?.expiry||e.expiry||null,b=null!=e.strike?(0,h.greeks)(u,e.strike,(0,h.yearsToExpiry)(s,x,g?.expiry_time_ist||'15:30','number'==typeof g?.day_count?g.day_count:365),'number'==typeof g?.risk_free_rate?g.risk_free_rate:.065,p,e.kind):null;return{spot:u,lot:d,price:k(y?.['CE'===e.kind?'ce':'pe']?.last_price),strikes:c.map(e=>e.strike).filter(e=>'number'==typeof e),at:s,expiry:x,g:b}}function w({leg:e,filters:l,onChange:s,onRemove:d,onQuote:a,index:c}){const h=v(e,l);(0,t.useEffect)(()=>{a(e.id,h)},[h.price,h.spot,h.lot,h.strikes.length,h.g?.delta]);const y='CE'===e.kind||'PE'===e.kind;(0,t.useEffect)(()=>{if(y&&h.strikes.length&&null!=h.spot&&(null==e.strike||!h.strikes.includes(e.strike))){const t=h.strikes.reduce((e,t,n)=>Math.abs(t-h.spot)<Math.abs(h.strikes[e]-h.spot)?n:e,0),n=h.strikes[Math.max(0,Math.min(h.strikes.length-1,t+(e.off||0)))];s({...e,strike:n,off:void 0})}},[h.strikes.length,h.spot,e.kind]);const g=t=>
1145{if(!h.strikes.length||null==e.strike)return;const n=h.strikes.indexOf(e.strike);s({...e,strike:h.strikes[Math.max(0,Math.min(h.strikes.length-1,n+t))]})},f=(h.lot??0)*e.lots,x=null!=h.price&&null!=h.lot?h.price*f:null;return(0,p.jsxs)(i.default,{style:{borderWidth:1,borderColor:o.C.line,borderRadius:10,backgroundColor:o.C.paper,padding:10,gap:8,zIndex:200-c},children:[(0,p.jsxs)(i.default,{style:[o.s.row,{gap:8,flexWrap:'wrap',zIndex:2}],children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted,width:16},children:c+1}),(0,p.jsx)(u.SymbolSearch,{value:e.underlying,onPick:t=>s({...e,underlying:t,expiry:'',strike:null}),data:l}),(0,p.jsx)(S,{value:e.kind,items:['CE','PE','FUT','EQ'].map(e=>({id:e,label:j[e]})),onChange:t=>s({...e,kind:t,side:'EQ'===t?'buy':e.side,strike:'CE'===t||'PE'===t?e.strike:null}),label:"Instrument type"}),y&&(0,p.jsx)(u.ExpiryPicker,{underlying:e.underlying,value:e.expiry,onPick:t=>s({...e,expiry:t,strike:null}),data:l}),(0,p.jsx)(i.default,{style:{flex:1}}),(0,p.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Remove this leg",onPress:d,style:{padding:4},children:(0,p.jsx)(o.Icon,{name:"x",size:14,color:o.C.muted})})]}),(0,p.jsxs)(i.default,{style:[o.s.row,{gap:10,flexWrap:'wrap',paddingLeft:24,zIndex:1}],children:['EQ'===e.kind?(0,p.jsx)(i.default,{style:{height:28,paddingHorizontal:9,justifyContent:'center',borderRadius:6,borderWidth:1,borderColor:o.C.green,backgroundColor:o.C.soft},children:(0,p.jsx)(o.T,{style:{fontSize:12,fontFamily:'InterSemi',color:o.C.green},children:"Buy \xb7 shares are long only"})}):(0,p.jsx)(S,{value:e.side,items:[{id:'buy',label:'Buy'},{id:'sell',label:'Sell'}],onChange:t=>s({...e,side:t}),label:"Buy or sell"}),y&&(0,p.jsxs)(i.default,{style:[o.s.row,{gap:4}],children:[(0,p.jsx)(n.default,{onPress:()=>g(-1),accessibilityLabel:"Lower strike",style:{padding:4},children:(0,p.jsx)(o.Icon,{name:"chevron-left",size:14,color:o.C.ink})}),(0,p.jsx)(o.T,{style:{fontSize:13,fontFamily:'InterSemi',minWidth:62,textAlign:'center',color:o.C.ink},children:null==e.strike?'\u2014':e.strike.toLocaleString('en-IN')}),(0,p.jsx)(n.default,{onPress:()=>g(1),accessibilityLabel:"Higher strike",style:{padding:4},children:(0,p.jsx)(o.Icon,{name:"chevron-right",size:14,color:o.C.ink})})]}),(0,p.jsxs)(i.default,{style:[o.s.row,{gap:4}],children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:'EQ'===e.kind?'Qty':'Lots'}),(0,p.jsx)(r.default,{value:String(e.lots),onChangeText:t=>{const n=Math.max(1,Math.min(99999,parseInt(t||'1',10)||1));s({...e,lots:n})},keyboardType:"number-pad",style:{width:'EQ'===e.kind?60:44,height:28,borderWidth:1,borderColor:o.C.line,borderRadius:6,color:o.C.ink,textAlign:'center',fontFamily:'Inter'}}),'EQ'!==e.kind&&(0,p.jsxs)(o.T,{style:{fontSize:11,color:o.C.muted},children:["\xd7 ",h.lot??'\u2014']})]}),(0,p.jsx)(i.default,{style:{flex:1}}),(0,p.jsxs)(i.default,{style:{alignItems:'flex-end'},children:[(0,p.jsx)(o.T,{style:{fontSize:13,fontFamily:'InterSemi',color:o.C.ink},children:null==h.price?'\u2014':h.price.toFixed(2)}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:y?`${'buy'===e.side?'pay':'receive'} ${b(x)}`:`notional ${b(x)}`})]})]})]})}const T=(e,t,n,l=0,r=1)=>({underlying:e,kind:t,side:n,expiry:'',strike:null,lots:r,off:l}),z=[{id:'covered',label:'Covered call',why:'Own the shares, sell a call above',legs:(e,t)=>[{...T(t,'EQ','buy'),lots:500},T(t,'CE','sell',2)]},{id:'protective',label:'Protective put',why:'Own the shares, buy a put below',legs:(e,t)=>[{...T(t,'EQ','buy'),lots:500},T(t,'PE','buy',-2)]},{id:'collar',label:'Collar',why:'Shares + put below + call above',legs:(e,t)=>[{...T(t,'EQ','buy'),lots:500},T(t,'PE','buy',-2),T(t,'CE','sell',2)]},{id:'hedged-fut',label:'Hedged future',why:'Long future, put underneath',legs:e=>[T(e,'FUT','buy'),T(e,'PE','buy',-2)]},{id:'ic-plus',label:'Iron condor +',why:'Index iron condor plus a futures tilt',legs:e=>[T(e,'PE','buy',-6),T(e,'PE','sell',-3),T(e,'CE','sell',3),T(e,'CE','buy',6),T(e,'FUT','buy')]},{id:'cs-plus',label:'Credit spread +',why:'Index put credit spread + stock covered call',legs:(e,t)=>[T(e,'PE','sell',-2),T(e,'PE','buy',-5),{...T(t,'EQ','buy'),lots:500},T(t,'CE','sell',2)]}];function I({filters:e,onAdd:r}){const[s,d]=(0,t.useState)('NIFTY'),[c,h]=(0,t.useState)(''),y=(0,a.useSharedRead)(`/api/derivatives/chain?underlying=${encodeURIComponent(s)}${c?`&expiry=${encodeURIComponent(c)}`:''}&atm_window=10`,0),g=y.data?.rows||[],f=k(y.data?.spot),x=null!=f&&g.length?g.reduce((e,t)=>
1145Math.abs(t.strike-f)<Math.abs(e.strike-f)?t:e).strike:null,b=({onB:e,onS:t})=>(0,p.jsxs)(i.default,{style:[o.s.row,{gap:3}],children:[(0,p.jsx)(n.default,{onPress:e,accessibilityLabel:"Buy",style:e=>[{width:22,height:22,borderRadius:4,alignItems:'center',justifyContent:'center',backgroundColor:e.hovered?o.C.green:o.C.soft}],children:(0,p.jsx)(o.T,{style:{fontSize:11,fontFamily:'InterSemi',color:o.C.green},children:"B"})}),(0,p.jsx)(n.default,{onPress:t,accessibilityLabel:"Sell",style:e=>[{width:22,height:22,borderRadius:4,alignItems:'center',justifyContent:'center',backgroundColor:e.hovered?o.C.red:o.C.dark}],children:(0,p.jsx)(o.T,{style:{fontSize:11,fontFamily:'InterSemi',color:o.C.red},children:"S"})})]}),C=(e,t,n)=>r({underlying:s,kind:e,side:t,expiry:c,strike:n,lots:1});return(0,p.jsxs)(i.default,{style:{flex:1,gap:8},children:[(0,p.jsxs)(i.default,{style:[o.s.row,{gap:8,zIndex:5,flexWrap:'wrap'}],children:[(0,p.jsx)(u.SymbolSearch,{value:s,onPick:e=>{d(e),h('')},data:e}),(0,p.jsx)(u.ExpiryPicker,{underlying:s,value:c,onPick:h,data:e}),(0,p.jsxs)(o.T,{style:{fontSize:12,color:o.C.muted},children:["Spot ",(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi',color:o.C.ink},children:null==f?'\u2014':f.toLocaleString('en-IN')})]})]}),(0,p.jsxs)(i.default,{style:[o.s.row,{gap:14,zIndex:1}],children:[(0,p.jsxs)(i.default,{style:[o.s.row,{gap:6}],children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.ink},children:"Future"}),(0,p.jsx)(b,{onB:()=>C('FUT','buy',null),onS:()=>C('FUT','sell',null)})]}),(0,p.jsxs)(i.default,{style:[o.s.row,{gap:6}],children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.ink},children:"Shares"}),(0,p.jsx)(n.default,{onPress:()=>C('EQ','buy',null),accessibilityLabel:"Buy shares",style:e=>[{width:22,height:22,borderRadius:4,alignItems:'center',justifyContent:'center',backgroundColor:e.hovered?o.C.green:o.C.soft}],children:(0,p.jsx)(o.T,{style:{fontSize:11,fontFamily:'InterSemi',color:o.C.green},children:"B"})})]})]}),(0,p.jsxs)(i.default,{style:[o.s.row,{paddingVertical:4,borderBottomWidth:1,borderColor:o.C.line}],children:[(0,p.jsx)(o.T,{style:{flex:1,fontSize:11,color:o.C.heading,fontFamily:'InterSemi',textAlign:'center'},children:"CALL \xb7 LTP"}),(0,p.jsx)(o.T,{style:{width:80,fontSize:11,color:o.C.heading,fontFamily:'InterSemi',textAlign:'center'},children:"Strike"}),(0,p.jsx)(o.T,{style:{flex:1,fontSize:11,color:o.C.heading,fontFamily:'InterSemi',textAlign:'center'},children:"PUT \xb7 LTP"})]}),(0,p.jsx)(l.default,{style:{flex:1},children:g.map(e=>(0,p.jsxs)(i.default,{style:[o.s.row,{paddingVertical:4,borderBottomWidth:1,borderColor:o.C.lineSoft,backgroundColor:e.strike===x?o.C.blueBg:void 0}],children:[(0,p.jsxs)(i.default,{style:[o.s.row,{flex:1,justifyContent:'center',gap:10}],children:[(0,p.jsx)(b,{onB:()=>C('CE','buy',e.strike),onS:()=>C('CE','sell',e.strike)}),(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.ink,minWidth:56,textAlign:'right'},children:k(e.ce?.last_price)?.toFixed(2)??'\u2014'})]}),(0,p.jsx)(o.T,{style:{width:80,textAlign:'center',fontSize:12,fontFamily:'InterSemi',color:e.strike===x?o.C.blue:o.C.ink},children:e.strike.toLocaleString('en-IN')}),(0,p.jsxs)(i.default,{style:[o.s.row,{flex:1,justifyContent:'center',gap:10}],children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.ink,minWidth:56},children:k(e.pe?.last_price)?.toFixed(2)??'\u2014'}),(0,p.jsx)(b,{onB:()=>C('PE','buy',e.strike),onS:()=>C('PE','sell',e.strike)})]})]},e.strike))})]})}function E(e,t,n,l){let r=0;for(const i of e){const e=t[i.id];if(!e||null==e.price||null==e.lot)return null;const s='buy'===i.side?1:-1,o=e.lot*i.lots;if('FUT'===i.kind||'EQ'===i.kind){r+=s*e.price*l*o;continue}const d=n(i.underlying);if(null==d||null==i.strike)return null;const a=d*(1+l);r+=s*(('CE'===i.kind?Math.max(0,a-i.strike):Math.max(0,i.strike-a))-e.price)*o}return r}},1052,[11,375,278,385,13,400,821,871,921,922,966,970,252,976,1053,6]); 1146__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.deskBody=function(e,t){const l=e[0]?.underlying||'NIFTY',n=e.map(e=>{const n='EQ'===e.kind?void 0:e.expiry||t(e.id)||'';return{id:e.id,type:e.kind,side:'buy'===e.side?'B':'S',lots:e.lots,...null==e.strike||'CE'!==e.kind&&'PE'!==e.kind?{}:{strike:e.strike},...n?{expiry:n}:{},...e.underlying!==l?{underlying:e.underlying}:{},price_basis:'ltp',price:null,include:!0}}),r=n.filter(e=>('CE'===e.type||'PE'===e.type)&&e.expiry).map(e=>e.expiry).sort();return{underlying:l,expiry:r[0]||n.find(e=>e.expiry)?.expiry||'',legs:n,scenario:{}}},_e.useDeskAnalysis=function(e,l){const[n,r]=(0,t.useState)(null),[s,o]=(0,t.useState)(''),[i,d]=(0,t.useState)(!1),c=JSON.stringify(e),h=(0,t.useRef)(null);return(0,t.useEffect)(()=>
1146{if(!l)return;const t=setTimeout(()=>{h.current?.abort();const t=new AbortController;h.current=t,d(!0),(0,a.api)('/api/sb/analyze',{body:e},{},t.signal).then(e=>{r(e),o('')}).catch(e=>{'AbortError'!==e?.name&&o(e?.message||'The analysis is unavailable.')}).finally(()=>{h.current===t&&d(!1)})},600);return()=>clearTimeout(t)},[c,l]),{res:n,err:s,busy:i}},_e.PortfolioViews=function({res:e,err:s,busy:o,width:a,height:j}){const[C,b]=(0,t.useState)('combined'),[S,_]=(0,t.useState)(!1),[v,T]=(0,t.useState)(!1),[z,w]=(0,t.useState)(!1),k=e?.portfolio,I=(e?.hedge||[]).filter(e=>e),$=I.length>0&&1===(e?.underlyings||[]).length;(0,t.useEffect)(()=>{$&&b('hedge')},[$]);const F=(0,d.jsxs)(r.default,{style:[i.s.row,{gap:8,paddingHorizontal:14,paddingTop:10,flexWrap:'wrap'}],children:[(0,d.jsx)(f,{value:C,onChange:b,hedge:I.length>0}),(0,d.jsx)(r.default,{style:{flex:1}}),o&&(0,d.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:"Updating\u2026"}),!!e?.as_of&&(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:["Reading ",String(e.as_of).slice(5,16).replace('T',' ')]})]});if(!e)return(0,d.jsxs)(r.default,{style:{flex:1},children:[F,(0,d.jsx)(r.default,{style:{flex:1,alignItems:'center',justifyContent:'center',padding:16},children:(0,d.jsx)(i.T,{style:{fontSize:12,color:i.C.muted,textAlign:'center'},children:s||'Reading the portfolio\u2026'})})]});if(!k||'unavailable'===k.status||'incomplete'===e.status||'no_market'===e.status||'empty'===e.status)return(0,d.jsxs)(r.default,{style:{flex:1},children:[F,(0,d.jsxs)(r.default,{style:{padding:16,gap:6},children:[(0,d.jsx)(i.T,{style:{fontSize:12,color:i.C.ink},children:e.reason||k?.note||(e.warnings||[])[0]||'The portfolio analysis is unavailable for these legs.'}),(e.unresolved||[]).map(e=>(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:[e.label,": ",e.reason]},e.leg_id))]})]});const L=S?k.same_move_curve:k.combined_curve,N=k.assumptions?.anchor?.underlying||e.anchor,M='available'===L?.status,A=e=>e.pnl_net??e.pnl,W=Math.max(160,j-44),P=e.betas||{},R=e.underlyings||[],H=k.assumptions?.labels||[];let B=null;if('combined'===C)B=M?(0,d.jsxs)(r.default,{style:{flex:1},children:[(0,d.jsxs)(r.default,{style:[i.s.row,{gap:10,paddingHorizontal:14,paddingTop:8,flexWrap:'wrap'}],children:[(0,d.jsxs)(i.T,{style:{fontSize:12,color:i.C.ink,fontFamily:'InterSemi'},children:["P&L ",null!=L.points?.[0]?.pnl_net?'net of charges':'(gross)'," if ",N," moves"]}),(0,d.jsx)(r.default,{style:{flex:1}}),(0,d.jsxs)(l.default,{onPress:()=>_(e=>!e),accessibilityRole:"switch","aria-checked":S,style:e=>[i.s.row,{gap:6,height:26,paddingHorizontal:8,borderRadius:6,borderWidth:1,borderColor:i.C.line,backgroundColor:e.hovered?i.C.dark:'transparent'}],children:[(0,d.jsx)(r.default,{style:{width:12,height:12,borderRadius:3,borderWidth:1,borderColor:S?i.C.green:i.C.muted,backgroundColor:S?i.C.green:'transparent'}}),(0,d.jsx)(i.T,{style:{fontSize:11,color:i.C.ink},children:"Every underlying moves the same %"})]})]}),(0,d.jsx)(i.T,{style:{fontSize:11,color:i.C.muted,paddingHorizontal:14},children:L.label}),(0,d.jsx)(x,{pts:(L.points||[]).map(e=>({m:e.move_pct,y:A(e)})),width:a,height:W-96}),(0,d.jsxs)(r.default,{style:[i.s.row,{gap:16,paddingHorizontal:14,flexWrap:'wrap'}],children:[(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:["Highest on the curve ",(0,d.jsx)(i.T,{style:{fontSize:11,color:i.C.green,fontFamily:'InterSemi'},children:c((L.max_profit_net||L.max_profit)?.value)}),(L.max_profit_net||L.max_profit)?.at_range_edge?' (at the range edge)':'']}),(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:["Lowest ",(0,d.jsx)(i.T,{style:{fontSize:11,color:i.C.red,fontFamily:'InterSemi'},children:c((L.max_loss_net||L.max_loss)?.value)}),(L.max_loss_net||L.max_loss)?.at_range_edge?' (at the range edge)':'']}),(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:["Breakevens ",(L.breakevens_net||L.breakevens||[]).map(e=>u(Number(e.move_pct.toFixed(1)))).join(', ')||'none in range']})]})]}):(0,d.jsx)(i.T,{style:{fontSize:12,color:i.C.muted,padding:14},children:(e.warnings||[]).find(e=>/curve/.test(e))||'The scenario curve is unavailable.'});else if('split'===C){const e=M?L.points:[],t=a>=640?2:1,l=Math.floor((a-28-10*(t-1))/t);B=(0,d.jsxs)(n.default,{contentContainerStyle:{padding:14,gap:10,flexDirection:'row',flexWrap:'wrap'},children:[!M&&(0,d.jsx)(i.T,{style:{fontSize:12,color:i.C.muted},children:"The split needs the scenario curve, which is unavailable."}),M&&R.map(t=>(0,d.jsxs)(r.default,{style:{width:l,borderWidth:1,borderColor:i.C.line,borderRadius:10,paddingTop:8,backgroundColor:i.C.dark},children:[(0,d.jsxs)(r.default,{style:[i.s.row,{gap:8,paddingHorizontal:10}],children:[(0,d.jsx)(i.T,{style:{fontSize:12,fontFamily:'InterSemi',color:i.C.ink},children:t.underlying}),(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted}
1146,children:[null!=t.spot?`spot ${Number(t.spot).toLocaleString('en-IN')}`:''," \xb7 ",t.leg_ids?.length||0," leg",1===t.leg_ids?.length?'':'s']}),(0,d.jsx)(r.default,{style:{flex:1}}),(0,d.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:t.underlying===N?'anchor':S?'same %':m(P[t.underlying])})]}),(0,d.jsx)(x,{compact:!0,pts:e.map(e=>({m:e.move_pct,y:e.by_underlying?.[t.underlying]??0})),width:l-2,height:150})]},t.underlying)),M&&(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted,width:'100%'},children:["Gross, before charges; x-axis = ",N,"'s move",S?'':', each underlying moving \u03b2 \xd7 that move',". ",L.label]})]})}else if('table'===C){const e=k.scenario_table||[],t=e.some(e=>null!=e.beta_weighted_net),l=e=>(0,d.jsx)(i.T,{style:{flex:1,fontSize:12,textAlign:'right',color:null==e?i.C.muted:e>=0?i.C.green:i.C.red,fontVariant:['tabular-nums']},children:c(e)});B=(0,d.jsxs)(n.default,{contentContainerStyle:{paddingHorizontal:14,paddingVertical:8},children:[(0,d.jsx)(r.default,{style:[i.s.row,{height:28,borderBottomWidth:1,borderColor:i.C.line}],children:[`${N} move`,`${N} level`,'Beta-weighted','Same %'].map((e,t)=>(0,d.jsx)(i.T,{style:{flex:1,fontSize:11,color:i.C.heading,fontFamily:'InterSemi',textAlign:t?'right':'left'},children:e},e))}),e.map(e=>(0,d.jsxs)(r.default,{style:[i.s.row,{height:26,backgroundColor:0===e.move_pct?i.C.soft:'transparent'}],children:[(0,d.jsx)(i.T,{style:{flex:1,fontSize:12,color:i.C.ink},children:u(e.move_pct)}),(0,d.jsx)(i.T,{style:{flex:1,fontSize:12,color:i.C.muted,textAlign:'right'},children:null!=e.anchor_level?Number(e.anchor_level).toLocaleString('en-IN',{maximumFractionDigits:0}):'\u2014'}),l(t?e.beta_weighted_net:e.beta_weighted),l(t?e.same_move_net:e.same_move)]},e.move_pct)),(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted,marginTop:6},children:["P&L ",t?'net of charges':'gross'," at the horizon. Scenario, not a forecast."]})]})}else{const t=(t,l)=>{const n=(e.legs||[]).find(e=>e.underlying===t&&'PE'===e.type&&/(^|\s)B/.test(' '+String(e.label||'').replace('Buy','B'))&&String(e.label||'').replace(/,/g,'').includes(String(l))),r=R.find(e=>e.underlying===t)?.lot_size||1;return n?Math.round(Math.abs(n.units)/r):0};B=(0,d.jsxs)(n.default,{contentContainerStyle:{padding:14,gap:14},children:[I.map(e=>{const l=(e.puts||[]).filter(e=>'available'===e.status),n=l.find(l=>t(e.underlying,l.strike)>0)||l[0];return n?(0,d.jsx)(p,{h:e,p:n,startLots:t(e.underlying,n.strike),width:a},e.underlying):null}),(0,d.jsx)(l.default,{onPress:()=>w(e=>!e),accessibilityRole:"button",children:(0,d.jsx)(i.T,{style:{fontSize:12,color:i.C.green},children:z?'\u25be Hide the numbers':'\u25b8 Show the numbers (net of charges, every lot count)'})}),z&&(0,d.jsx)(r.default,{style:{gap:14},children:I.map(e=>(0,d.jsxs)(r.default,{style:{gap:6},children:[(0,d.jsxs)(i.T,{style:{fontSize:12,fontFamily:'InterSemi',color:i.C.ink},children:[e.underlying," \xb7 ",Number(e.shares).toLocaleString('en-IN')," shares",e.lot_size?` \xb7 lot ${e.lot_size}`:'',null!=e.full_cover_lots?` \xb7 full cover ${e.full_cover_lots} lot${1===e.full_cover_lots?'':'s'}`:'']}),(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:[e.label," ",e.note||'']}),'available'!==e.status&&(0,d.jsxs)(i.T,{style:{fontSize:12,color:i.C.muted},children:["Unavailable",e.reason?` (${e.reason})`:'',"."]}),(e.puts||[]).map(t=>(0,d.jsxs)(r.default,{style:{borderWidth:1,borderColor:i.C.line,borderRadius:10,padding:10,gap:4,backgroundColor:i.C.dark},children:[(0,d.jsxs)(i.T,{style:{fontSize:12,color:i.C.ink},children:[t.strike," put \xb7 ",t.expiry," \xb7 \u20b9",t.price,'strategy'===t.source?' \xb7 in this desk':'',null!=t.iv?` \xb7 IV ${t.iv}%`:'']}),'available'!==t.status?(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:["Unavailable",t.reason?` (${t.reason})`:'',"."]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(r.default,{style:[i.s.row,{height:24,borderBottomWidth:1,borderColor:i.C.line}],children:[(0,d.jsx)(i.T,{style:{width:52,fontSize:11,color:i.C.heading,fontFamily:'InterSemi'},children:"Put lots"}),(0,d.jsx)(i.T,{style:{width:80,fontSize:11,color:i.C.heading,fontFamily:'InterSemi',textAlign:'right'},children:"Cost"}),(e.moves_pct||[]).map(e=>(0,d.jsx)(i.T,{style:{flex:1,fontSize:11,color:i.C.heading,fontFamily:'InterSemi',textAlign:'right'},children:u(e)},e))]}),t.rows.map(t=>(0,d.jsxs)(r.default,{title:t.text||'',style:[i.s.row,{height:24}],children:[(0,d.jsxs)(i.T,{style:{width:52,fontSize:12,color:i.C.ink},children:[t.lots,t.over_covers?' *':'']}),(0,d.jsx)(i.T,{style:{width:80,fontSize:12,color:i.C.muted,textAlign:'right'},children:c(t.cost)}),(e.moves_pct||[]).map(e=>{const l=t.pnl?.[String(e)];return(0,d.jsx)(i.T,{style:{flex:1,fontSize:12,textAlign:'right',fontVariant:['tabular-nums'],color:null==l?i.C.muted:l>=0?i.C.green:i.C.red}
1146,numberOfLines:1,children:h(l)},e)})]},t.lots)),(()=>{const e=t.rows.find(e=>e.lots===t.full_cover_lots)||t.rows[t.rows.length-1];return e?.text?(0,d.jsx)(i.T,{style:{fontSize:12,color:i.C.ink,marginTop:4},children:e.text}):null})(),(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:["P&L at the horizon, ",[...new Set(t.rows.map(e=>y[e.basis]||e.basis))].join(' / '),".",t.rows.some(e=>e.over_covers)?' * covers more shares than are held.':'',t.sampled?' Some lot counts skipped to keep the table short.':'']})]})]},`${t.strike}-${t.expiry}`))]},e.underlying))})]})}return(0,d.jsxs)(r.default,{style:{flex:1},children:[F,(0,d.jsx)(r.default,{style:{flex:1},children:B}),(0,d.jsxs)(r.default,{style:{borderTopWidth:1,borderColor:i.C.line,paddingHorizontal:14,paddingVertical:6},children:[(0,d.jsx)(l.default,{onPress:()=>T(e=>!e),accessibilityRole:"button",children:(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:[v?'\u25be':'\u25b8'," Assumptions (",H.length,")",(e.warnings||[]).length?` \xb7 ${(e.warnings||[]).length} note${1===e.warnings.length?'':'s'}`:'']})}),v&&(0,d.jsx)(n.default,{style:{maxHeight:160},children:[...H,...e.warnings||[]].map((e,t)=>(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted,marginTop:3},children:["\u2022 ",e]},t))})]})]})};var t=_r(_d[0]),l=e(_r(_d[1])),n=e(_r(_d[2])),r=e(_r(_d[3])),s=_r(_d[4]),o=e(s),i=_r(_d[5]),a=_r(_d[6]),d=_r(_d[7]);const c=e=>null==e?'\u2014':(e<0?'\u2212\u20b9':'\u20b9')+Math.abs(Math.round(e)).toLocaleString('en-IN'),h=e=>{if(null==e)return'\u2014';const t=Math.abs(e),l=e<0?'\u2212\u20b9':'\u20b9';return t>=1e7?`${l}${(t/1e7).toFixed(2)} Cr`:t>=1e5?`${l}${(t/1e5).toFixed(2)} L`:c(e)},u=e=>`${e>0?'+':''}${Number.isInteger(e)?e:e.toFixed(1)}%`;function f({value:e,onChange:t,hedge:n}){const s=[{id:'combined',label:'Combined'},{id:'split',label:'By instrument'},{id:'table',label:'Scenarios'},...n?[{id:'hedge',label:'Hedge'}]:[]];return(0,d.jsx)(r.default,{accessibilityRole:"tablist",style:[i.s.row,{gap:4}],children:s.map(n=>{const r=n.id===e;return(0,d.jsx)(l.default,{role:"tab","aria-selected":r,accessibilityState:{selected:r},onPress:()=>t(n.id),style:e=>[{height:28,paddingHorizontal:10,justifyContent:'center',borderRadius:6,borderWidth:1,borderColor:r?i.C.green:i.C.line,backgroundColor:r?i.C.soft:e.hovered?i.C.dark:'transparent'}],children:(0,d.jsx)(i.T,{style:{fontSize:12,fontFamily:r?'InterSemi':'InterMedium',color:r?i.C.green:i.C.ink},children:n.label})},n.id)})})}function x({pts:e,width:t,height:l,color:n,compact:a}){const h={l:a?62:74,r:12,t:10,b:a?22:28},f=Math.max(10,t-h.l-h.r),x=Math.max(10,l-h.t-h.b);if(e.length<2)return(0,d.jsx)(r.default,{style:{width:t,height:l,alignItems:'center',justifyContent:'center'},children:(0,d.jsx)(i.T,{style:{fontSize:12,color:i.C.muted},children:"No curve."})});const y=e[0].m,m=e[e.length-1].m;let p=Math.min(0,...e.map(e=>e.y)),j=Math.max(0,...e.map(e=>e.y));j===p&&(j+=1,p-=1);const C=.08*(j-p);p-=C,j+=C;const b=e=>h.l+(e-y)/(m-y||1)*f,S=e=>h.t+x-(e-p)/(j-p)*x,_=e.map((e,t)=>`${t?'L':'M'}${b(e.m).toFixed(1)} ${S(e.y).toFixed(1)}`).join(' '),v=[y,y/2,0,m/2,m].filter((e,t,l)=>l.indexOf(e)===t);return(0,d.jsxs)(o.default,{width:t,height:l,children:[(a?[p,j]:[p,(p+j)/2,j]).map((e,t)=>(0,d.jsx)(s.Text,{x:h.l-6,y:S(e)+4,fontSize:11,fontFamily:"Inter",fill:i.C.muted,textAnchor:"end",children:c(e)},t)),(0,d.jsx)(s.Rect,{x:h.l,y:h.t,width:f,height:Math.max(0,S(0)-h.t),fill:i.C.green,fillOpacity:.05}),(0,d.jsx)(s.Rect,{x:h.l,y:S(0),width:f,height:Math.max(0,h.t+x-S(0)),fill:i.C.red,fillOpacity:.05}),(0,d.jsx)(s.Line,{x1:h.l,x2:h.l+f,y1:S(0),y2:S(0),stroke:i.C.line}),y<0&&m>0&&(0,d.jsx)(s.Line,{x1:b(0),x2:b(0),y1:h.t,y2:h.t+x,stroke:i.C.line,strokeDasharray:"3 4"}),(0,d.jsx)(s.Path,{d:_,fill:"none",stroke:n||i.C.ink,strokeWidth:2}),v.map((e,t)=>(0,d.jsx)(s.Text,{x:b(e),y:h.t+x+(a?16:18),fontSize:11,fontFamily:"Inter",fill:i.C.muted,textAnchor:t===v.length-1?'end':'middle',children:u(e)},e))]})}const y={net_of_charges:'net of charges',net_of_put_charges_only:"net of the puts' charges only",net_of_holding_charges_only:"net of the holding's charges only",gross_charges_unavailable:'gross - charges unavailable'},m=e=>'available'===e?.status||'small_sample'===e?.status?`\u03b2 ${Number(e.beta).toFixed(2)}${'small_sample'===e.status?' (small sample)':''}`:'\u03b2 unavailable';function p({h:e,p:t,startLots:l,width:n}){const a=Number(e.lot_size)||1,c=Number(e.shares)||0,u=Number(e.spot)||0,f=Number(t.strike),x=Number(t.price)||0,y=l,m=y*a,p=c?Math.min(1,m/c):0,j=m*x,C=e=>c*(e-u),b=e=>c*(e-u)+m*(Math.max(f-e,0)-x),S=Math.min(.85*u,.95*f),_=1.15*u,v=Array.from({length:61},(e,t)=>
1146S+(_-S)*t/60).concat([f,u]).sort((e,t)=>e-t),T=n-28,z=70,w=12,k=T-z-90,I=220-w-26,$=v.flatMap(e=>[C(e),b(e)]);let F=Math.min(0,...$),L=Math.max(0,...$);const N=.08*(L-F);F-=N,L+=N;const M=e=>z+(e-S)/(_-S)*k,A=e=>w+I-(e-F)/(L-F)*I,W=e=>v.map((t,l)=>`${l?'L':'M'}${M(t).toFixed(1)} ${A(e(t)).toFixed(1)}`).join(' '),P=C(S),R=b(S),H=b(f),B=u+(c?j/c:0),E=e=>'\u20b9'+Math.round(e).toLocaleString('en-IN'),D=e=>h(e),O=0===y?[`With no puts, all ${c.toLocaleString('en-IN')} shares rise and fall with ${e.underlying}: every \u20b91 drop costs ${E(c)}.`]:[`You paid ${E(j)} (\u20b9${x} \xd7 ${m.toLocaleString('en-IN')}) to protect ${m.toLocaleString('en-IN')} of your ${c.toLocaleString('en-IN')} shares (${Math.round(100*p)}%).`,p>=1?`If ${e.underlying} falls below \u20b9${f}, the loss stops growing: it stays near ${D(H)} however far the price falls.`:`Below \u20b9${f}, the ${m.toLocaleString('en-IN')} protected shares stop losing. The other ${(c-m).toLocaleString('en-IN')} keep falling - every \u20b91 drop still costs ${E(c-m)}.`,`If ${e.underlying} rises, you keep the rise minus the ${E(j)} paid - above \u20b9${B.toFixed(1)} you are ahead.`];return(0,d.jsxs)(r.default,{style:{gap:10},children:[(0,d.jsxs)(r.default,{style:[i.s.row,{gap:10,flexWrap:'wrap'}],children:[(0,d.jsxs)(i.T,{style:{fontSize:13,fontFamily:'InterSemi',color:i.C.ink},children:[c.toLocaleString('en-IN')," ",e.underlying," shares + ",y," put lot",1===y?'':'s'," (\u20b9",f,")"]}),(0,d.jsx)(r.default,{style:{flex:1}})]}),(0,d.jsxs)(r.default,{style:{gap:4},children:[(0,d.jsx)(r.default,{style:{height:10,borderRadius:5,backgroundColor:i.C.dark,borderWidth:1,borderColor:i.C.line,overflow:'hidden'},children:(0,d.jsx)(r.default,{style:{width:100*p+"%",height:'100%',backgroundColor:i.C.green}})}),(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:["Protected ",m.toLocaleString('en-IN')," of ",c.toLocaleString('en-IN')," shares \xb7 full cover = ",e.full_cover_lots," lot",1===e.full_cover_lots?'':'s'," (change Lots on the put leg)"]})]}),(0,d.jsxs)(o.default,{width:T,height:220,children:[[F,0,L].map((e,t)=>(0,d.jsx)(s.Text,{x:z-6,y:A(e)+4,fontSize:11,fontFamily:"Inter",fill:i.C.muted,textAnchor:"end",children:D(e)},t)),(0,d.jsx)(s.Line,{x1:z,x2:z+k,y1:A(0),y2:A(0),stroke:i.C.line}),(0,d.jsx)(s.Line,{x1:M(u),x2:M(u),y1:w,y2:w+I,stroke:i.C.line,strokeDasharray:"3 4"}),(0,d.jsxs)(s.Text,{x:M(u),y:w+I+18,fontSize:11,fontFamily:"Inter",fill:i.C.muted,textAnchor:"middle",children:["now \u20b9",u.toFixed(0)]}),y>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(s.Line,{x1:M(f),x2:M(f),y1:w,y2:w+I,stroke:i.C.green,strokeOpacity:.4,strokeDasharray:"2 3"}),(0,d.jsxs)(s.Text,{x:M(f)-4,y:w+10,fontSize:11,fontFamily:"Inter",fill:i.C.green,textAnchor:"end",children:["protected below \u20b9",f]})]}),(0,d.jsxs)(s.Text,{x:z,y:w+I+18,fontSize:11,fontFamily:"Inter",fill:i.C.muted,children:["\u20b9",S.toFixed(0)]}),(0,d.jsxs)(s.Text,{x:z+k,y:w+I+18,fontSize:11,fontFamily:"Inter",fill:i.C.muted,textAnchor:"end",children:["\u20b9",_.toFixed(0)]}),(0,d.jsx)(s.Path,{d:W(C),fill:"none",stroke:i.C.muted,strokeWidth:1.5,strokeDasharray:"5 4"}),y>0&&(0,d.jsx)(s.Path,{d:W(b),fill:"none",stroke:i.C.green,strokeWidth:2.5}),(0,d.jsx)(s.Text,{x:z+k+6,y:A(C(_))+4,fontSize:11,fontFamily:"Inter",fill:i.C.muted,children:"shares alone"}),y>0&&(0,d.jsx)(s.Text,{x:z+6,y:A(R)-6,fontSize:11,fontFamily:"InterSemi",fill:i.C.green,children:"with puts"})]}),(0,d.jsxs)(r.default,{style:[i.s.row,{gap:18,flexWrap:'wrap'}],children:[(0,d.jsxs)(r.default,{children:[(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:["If ",e.underlying," falls to \u20b9",S.toFixed(0)]}),(0,d.jsxs)(i.T,{style:{fontSize:13,color:i.C.ink},children:["alone ",(0,d.jsx)(i.T,{style:{color:i.C.red,fontFamily:'InterSemi'},children:D(P)})," \xb7 with puts ",(0,d.jsx)(i.T,{style:{color:R>=0?i.C.green:i.C.red,fontFamily:'InterSemi'},children:D(R)})]})]}),(0,d.jsxs)(r.default,{children:[(0,d.jsx)(i.T,{style:{fontSize:11,color:i.C.muted},children:"Cost of protection"}),(0,d.jsx)(i.T,{style:{fontSize:13,color:i.C.ink,fontFamily:'InterSemi'},children:E(j)})]})]}),O.map((e,t)=>(0,d.jsx)(i.T,{style:{fontSize:13,lineHeight:19,color:i.C.ink},children:e},t)),(0,d.jsxs)(i.T,{style:{fontSize:11,color:i.C.muted},children:["At the put's expiry (",t.expiry,"), before charges. Scenario, not a forecast."]})]})}},1053,[11,375,278,13,840,821,197,6]); 1147__d(function(g,_r,_i,_a,m,_e,d){"use strict";
1147function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Discover=function(){const{width:e}=(0,a.default)(),n=e>=1e3,[r,j]=(0,t.useState)([]),[C,k]=(0,t.useState)('NIFTY'),[w,_]=(0,t.useState)([]),[$,T]=(0,t.useState)(''),[M,z]=(0,t.useState)(null),[P,W]=(0,t.useState)(null),[B,F]=(0,t.useState)('up'),[L,I]=(0,t.useState)(''),[R,E]=(0,t.useState)(''),[U,N]=(0,t.useState)(''),[A,D]=(0,t.useState)(''),[O,V]=(0,t.useState)(''),[q,Y]=(0,t.useState)(!0),[G,H]=(0,t.useState)(1),[J,K]=(0,t.useState)(null),[Z,Q]=(0,t.useState)(''),[X,ee]=(0,t.useState)(!1),[te,se]=(0,t.useState)([]);(0,t.useEffect)(()=>{u.sb.underlyings().then(e=>j(e.underlyings)).catch(()=>{})},[]);const ie=(0,t.useRef)(0),ae=JSON.stringify([C,$,B,L,R,U,A,O,q,G]),[ne,re]=(0,t.useState)(''),le=!!J&&ne!==ae;(0,t.useEffect)(()=>{J&&ne!==ae&&(se([]),ie.current++,ee(!1))},[ae]),(0,t.useEffect)(()=>{K(null),u.sb.expiries(C).then(e=>{_(e.expiries),T((e.expiries.find(e=>(e.days_to_expiry??0)>=1)||e.expiries[0])?.expiry||''),W(e.as_of)}).catch(e=>Q(e.message))},[C]);const[oe,de]=(0,t.useState)(null),ue=(0,h.useSbStatus)(),ce=(J&&!le?J.reading:null)||oe?.reading||null,pe=!!(0,f.marketBanner)(ue?.market_state,ce);async function he(){const e=++ie.current,t=ae;ee(!0),Q(''),se([]);try{const s=await u.sb.discover({underlying:C,expiry:$,view:B,target:L||void 0,low:R||void 0,high:U||void 0,max_loss:A||void 0,budget:O||void 0,hedged_only:q,lots:G});e===ie.current&&(K(s),re(t))}catch(t){e===ie.current&&(Q(t.message),K(null))}finally{e===ie.current&&ee(!1)}}async function me(e){if(!le&&e.candidate_id)try{const t=await u.sb.discoverUse(e.candidate_id);l.router.push({pathname:'/strategies',params:{id:t.id}})}catch(e){Q(e.message)}}(0,t.useEffect)(()=>{$&&u.sb.chain(C,$).then(e=>{z(e.spot),de({live:!!e.quality?.live,as_of:e.as_of,reading:e.reading||null});const t=e.strike_step||50,s=e=>String(Math.round(e/t)*t);I(s(1.01*e.spot)),E(s(.99*e.spot)),N(s(1.01*e.spot))}).catch(()=>{})},[C,$]),(0,t.useEffect)(()=>{if(!M)return;const e=e=>String(50*Math.round(e/50));'up'===B&&I(e(1.01*M)),'down'===B&&I(e(.99*M)),'big_move'===B&&(E(e(.98*M)),N(e(1.02*M))),'range'===B&&(E(e(.99*M)),N(e(1.01*M)))},[B,M]);const fe=(0,t.useMemo)(()=>(J?.candidates||[]).filter(e=>te.includes(e.template)),[J,te]),xe=(e,t,a,n="")=>(0,y.jsxs)(i.default,{style:{gap:4,minWidth:130,flex:1},children:[(0,y.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:e}),(0,y.jsx)(s.default,{value:t,onChangeText:a,placeholder:n,placeholderTextColor:o.C.muted,keyboardType:"decimal-pad",accessibilityLabel:e,style:{height:40,borderWidth:1,borderColor:o.C.line,borderRadius:10,paddingHorizontal:12,color:o.C.ink,fontFamily:'Inter',fontSize:13,backgroundColor:o.C.bg}})]});return(0,y.jsxs)(i.default,{style:{padding:n?24:14,gap:16,maxWidth:1200,width:'100%',alignSelf:'center'},children:[(0,y.jsx)(i.default,{style:[o.s.row,{gap:8}],children:(0,y.jsx)(o.Button,{label:"My Strategies",icon:"chevron-left",kind:"outline",onPress:()=>l.router.replace('/strategies')})}),(0,y.jsxs)(i.default,{style:{gap:4},children:[(0,y.jsx)(o.T,{style:{fontFamily:'ManropeBold',fontSize:22},children:"Find a strategy"}),(0,y.jsx)(o.T,{style:{fontSize:13,color:o.C.muted},children:"Your view and your limits in; a short list of structures that match them out. It is a matching tool, not a forecast or advice."})]}),(0,y.jsxs)(i.default,{style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:14,padding:16,gap:14},children:[(0,y.jsx)(c.UnderlyingPicker,{list:r,value:C,onPick:k}),(0,y.jsx)(x.ExpiryChips,{expiries:w,selected:$,onSelect:T}
1147),pe?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(h.MarketStateBanner,{state:ue?.market_state,reading:ce}),(0,f.hasReading)(ce)?(0,y.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:`Spot ${(0,p.num)(M,2)} \xb7 structures below are priced at the prices in this banner.`}):null]}):oe?.live?(0,y.jsx)(o.T,{style:{fontSize:12,color:(0,f.liveAllowed)(ue,!0)?o.C.green:o.C.muted},children:(0,f.liveAllowed)(ue,!0)?`Live \xb7 Zerodha Kite \xb7 ${(0,p.istStamp)(oe.as_of)} \xb7 spot ${(0,p.num)(M,2)}`:`${ue?'Market closed \xb7 last traded prices':'Last traded prices'} \xb7 ${(0,p.istStamp)(oe.as_of)} \xb7 spot ${(0,p.num)(M,2)}`}):(0,y.jsx)(o.T,{style:{fontSize:12,color:o.C.amber},children:`Stored reading \xb7 ${(0,p.istStamp)(oe?.as_of||P)} \xb7 spot ${(0,p.num)(M,2)} \xb7 not live`}),(0,y.jsxs)(i.default,{style:{gap:6},children:[(0,y.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:`Where do you think ${C} goes by ${(0,p.dayMonth)($)}?`}),(0,y.jsx)(i.default,{style:[o.s.row,{flexWrap:'wrap',gap:8}],children:b.map(([e,t])=>(0,y.jsx)(o.Chip,{label:t,active:B===e,onPress:()=>F(e)},e))})]}),(0,y.jsxs)(i.default,{style:[o.s.row,{flexWrap:'wrap',gap:12}],children:[('up'===B||'down'===B)&&xe(`Target on expiry (${'up'===B?'above':'below'} spot)`,L,I),('range'===B||'big_move'===B)&&(0,y.jsxs)(y.Fragment,{children:[xe('range'===B?'Range low':'Move below',R,E),xe('range'===B?'Range high':'Move above',U,N)]}),xe('Most I am willing to lose (\u20b9, optional)',A,D,'e.g. 5000'),(0,y.jsxs)(i.default,{style:{gap:4},children:[(0,y.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Lots"}),(0,y.jsxs)(i.default,{style:[o.s.row,{gap:6}],children:[(0,y.jsx)(o.Button,{label:"\u2212",kind:"outline",onPress:()=>H(Math.max(1,G-1))}),(0,y.jsx)(o.T,{style:{minWidth:24,textAlign:'center'},children:G}),(0,y.jsx)(o.Button,{label:"+",kind:"outline",onPress:()=>H(Math.min(50,G+1))})]})]})]}),(0,y.jsx)(o.Checkbox,{checked:q,onChange:Y,label:"Defined risk only",detail:"Leaves out naked short options, whose loss is unlimited (calls) or runs to a zero price (puts)."}),(0,y.jsxs)(i.default,{style:[o.s.row,{gap:10}],children:[(0,y.jsx)(o.Button,{label:"Find strategies",icon:"search",loading:X,disabled:!$,onPress:he}),!!Z&&(0,y.jsx)(o.T,{style:{color:o.C.red,fontSize:12,flex:1},children:Z})]})]}),J&&le&&(0,y.jsxs)(i.default,{accessibilityRole:"alert",style:[o.s.row,{gap:8,backgroundColor:o.C.amberBg,borderRadius:10,padding:10}],children:[(0,y.jsx)(o.Icon,{name:"alert-circle",size:14,color:o.C.amber}),(0,y.jsx)(o.T,{style:{fontSize:12,color:o.C.amber,flex:1},children:"Your inputs changed - these results are for the previous inputs. Find again to act on them."}),(0,y.jsx)(o.Button,{label:"Find again",kind:"outline",onPress:he})]}),J&&(0,y.jsxs)(i.default,{style:{gap:12,opacity:le?.45:1},pointerEvents:le?'none':'auto',children:[(0,y.jsx)(o.T,{style:{fontSize:13},children:J.candidates.length?`${J.candidates.length} of ${J.considered} structures match - ${J.view_label.toLowerCase()} ${'up'===J.view||'down'===J.view?`to ${(0,p.num)(J.inputs.target,0)}`:`${(0,p.num)(J.inputs.low,0)}-${(0,p.num)(J.inputs.high,0)}`} by ${(0,p.dayMonth)(J.expiry)}.`:'Nothing matches these limits.'}),J.evidence&&(0,y.jsx)(o.T,{style:{fontSize:12},children:J.evidence.tests?`${J.evidence.tests} rule test${1===J.evidence.tests?'':'s'} in your Lab (n \u2265 ${J.evidence.min_oos} out of sample); ${J.evidence.survivors} survive the ${Math.round(100*J.evidence.fdr_q)}% false-discovery correction.`:'No rule in your Lab has enough out-of-sample trades yet - every card is Model only. Prove one in the Lab to rank by evidence.'}),(0,y.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:J.basis}),!J.candidates.length&&J.binding&&(0,y.jsxs)(i.default,{style:{backgroundColor:o.C.amberBg,borderRadius:12,padding:14,gap:6},children:[(0,y.jsx)(o.T,{style:{color:o.C.amber,fontFamily:'InterSemi'},children:`Most were excluded for: ${J.binding.label}`}),(0,y.jsx)(o.T,{style:{color:o.C.amber,fontSize:12},children:J.binding.suggestion}),(0,y.jsx)(o.T,{style:{color:o.C.muted,fontSize:11},children:J.excluded.map(e=>`${e.count} \xd7 ${e.label}`).join(' \xb7 ')})]}),(0,y.jsx)(i.default,{style:{flexDirection:n?'row':'column',flexWrap:'wrap',gap:12},children:J.candidates.map((e,t)=>(0,y.jsxs)(i.default,{style:{flexBasis:n?'31%':'auto',flexGrow:1,backgroundColor:o.C.paper,borderWidth:1,borderColor:te.includes(e.template)?o.C.green:o.C.line,borderRadius:14,padding:14,gap:8},children:[(0,y.jsxs)(i.default,{style:{gap:6},children:[(0,y.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:15},children:e.name}),(0,y.jsx)(i.default,{style:{flexDirection:'row',flexWrap:'wrap',maxWidth:'100%'},children:(0,y.jsx)(i.default,{style:{flexShrink:1,maxWidth:'100%'},children:(0,y.jsx)(o.Badge,{label:e.evidence.label,tone:{tested_significant:'green',tested_not_significant:'neutral'}[e.evidence.status]||'amber'})})})]}),!!e.evidence.note&&(0,y.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:e.evidence.note}),(0,y.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:'tested_significant'===e.evidence.status?'Model-priced Lab history (one IV, no skew). Past results do not guarantee future results.':'tested_not_significant'===e.evidence.status?'Tested in your Lab; the out-of-sample result does not survive the correction for everything tested.':'Model only - no reliable history for this structure. Numbers are model values at this reading.'}),(0,y.jsxs)(o.T,{style:{fontSize:12,color:o.C.muted},children:[e.recipe,null!=e.param?` \xb7 ${e.param_label} ${e.param}`:'']}),e.legs.map((e,t)=>(0,y.jsx)(o.T,{style:{fontSize:12,fontVariant:['tabular-nums']},children:`${'B'===e.side?'Buy':'Sell'} ${e.lots} \xd7 ${(0,p.strikeText)(e.strike)} ${e.type} @ ${(0,p.num)(e.price)} LTP`},t)),e.why.map((e,t)=>(0,y.jsxs)(i.default,{style:[o.s.row,{gap:6,alignItems:'flex-start'}],children:[(0,y.jsx)(o.Icon,{name:t?'check':'target',size:12,color:t?o.C.green:o.C.mint}),(0,y.jsx)(o.T,{style:{fontSize:12,flex:1},children:e})]},t)),(0,y.jsxs)(i.default,{style:[o.s.row,{flexWrap:'wrap',gap:12}],children:[(0,y.jsx)(v,{k:"Max loss",v:e.max_loss.unlimited?'Unlimited':(0,p.signed)(e.max_loss.value),tone:o.C.red}),(0,y.jsx)(v,{k:"Max profit",v:e.max_profit.unlimited?'Unlimited':(0,p.signed)(e.max_profit.value),tone:o.C.green}),(0,y.jsx)(v,{k:"Breakeven",v:e.breakevens.map(e=>(0,p.num)(e,0)).join(' \xb7 ')}),(0,y.jsx)(v,{k:"Max loss (structural)",v:(0,p.inr)(e.capital_at_risk)}),(0,y.jsx)(v,{k:"Funds / margin",v:"Not estimated here"}),(0,y.jsx)(v,{k:"POP (model)",v:null!=e.pop?`${e.pop}%`:'\u2014'})]}),(0,y.jsxs)(i.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,y.jsx)(o.Checkbox,{checked:te.includes(e.template),onChange:t=>{le||se(s=>t?s.length>=3?s:[...s,e.template]:s.filter(t=>t!==e.template))},label:"Compare"}),(0,y.jsx)(i.default,{style:{flex:1}}),(0,y.jsx)(o.Button,{label:"Use as draft",icon:"arrow-right",disabled:le,onPress:()=>me(e)})]}),(0,y.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Priced at last traded (LTP). The draft reprices at buy-at-ask / sell-at-bid where live quotes exist, so its numbers can differ."})]},e.template))}),fe.length>1&&(0,y.jsx)(S,{list:fe,target:'up'===J.view||'down'===J.view?J.inputs.target:null})]})]})};var t=_r(d[0]),s=e(_r(d[1])),i=e(_r(d[2])),a=e(_r(d[3])),n=_r(d[4]),r=e(n),l=_r(d[5]),o=_r(d[6]),u=_r(d[7]),c=_r(d[8]),p=_r(d[9]),h=_r(d[10]),f=_r(d[11]),x=_r(d[12]),y=_r(d[
114713]);const b=[['up','Rise'],['down','Fall'],['range','Stay in a range'],['big_move','Big move either way']],j=[o.C.green,o.C.amber,o.C.blue];function v({k:e,v:t,tone:s}){return(0,y.jsxs)(i.default,{style:{gap:1,minWidth:90},children:[(0,y.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:e}),(0,y.jsx)(o.T,{style:{fontSize:13,fontFamily:'InterSemi',color:s||o.C.ink,fontVariant:['tabular-nums']},children:t})]})}function C(e,t){return e.reduce((e,s)=>e+('B'===s.side?1:-1)*s.lots*s.lot_size*(('CE'===s.type?Math.max(t-s.strike,0):Math.max(s.strike-t,0))-s.price),0)}function S({list:e,target:s}){const[a,l]=(0,t.useState)(700),u=e.flatMap(e=>e.legs.map(e=>e.strike)),c=.985*Math.min(...u),h=1.015*Math.max(...u),f=Array.from({length:120},(e,t)=>c+(h-c)*t/119),x=e.map(e=>f.map(t=>C(e.legs,t))),b=x.flat(),v=Math.min(0,...b),S=Math.max(0,...b),k=e=>40+(e-c)/(h-c)*(a-50),w=e=>10+(S-e)/(S-v||1)*190;return(0,y.jsxs)(i.default,{onLayout:e=>l(e.nativeEvent.layout.width),style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:14,padding:14,gap:10},children:[(0,y.jsx)(o.T,{style:{fontFamily:'InterSemi'},children:"Compare at expiry (same lots, gross of charges)"}),(0,y.jsxs)(r.default,{width:a,height:220,children:[(0,y.jsx)(n.Line,{x1:40,x2:a-10,y1:w(0),y2:w(0),stroke:o.C.muted}),null!=s&&(0,y.jsx)(n.Line,{x1:k(s),x2:k(s),y1:10,y2:200,stroke:o.C.mint,strokeDasharray:"4,3"}),x.map((e,t)=>(0,y.jsx)(n.Path,{d:e.map((e,t)=>`${t?'L':'M'}${k(f[t]).toFixed(1)},${w(e).toFixed(1)}`).join(''),stroke:j[t],strokeWidth:2,fill:"none"},t))]}),(0,y.jsx)(i.default,{style:{gap:4},children:[['',...e.map(e=>e.name)],['Max loss',...e.map(e=>e.max_loss.unlimited?'Unlimited':(0,p.signed)(e.max_loss.value))],['Max profit',...e.map(e=>e.max_profit.unlimited?'Unlimited':(0,p.signed)(e.max_profit.value))],['Capital at risk',...e.map(e=>(0,p.inr)(e.capital_at_risk))],['At your view',...e.map(e=>(0,p.signed)(e.pnl_at_view))],['Return on risk',...e.map(e=>null!=e.return_on_risk?`${e.return_on_risk}%`:'\u2014')],['POP (model)',...e.map(e=>null!=e.pop?`${e.pop}%`:'\u2014')]].map((e,t)=>(0,y.jsx)(i.default,{style:[o.s.row,{gap:8,borderTopWidth:t?1:0,borderColor:o.C.line,paddingVertical:5}],children:e.map((e,s)=>(0,y.jsx)(o.T,{style:{flex:1,fontSize:12,color:s&&0===t?j[s-1]:0===t||0===s?o.C.muted:o.C.ink,fontFamily:0===t?'InterSemi':'Inter'},children:e},s))},t))})]})}},1054,[11,385,13,400,840,252,821,976,981,979,992,986,982,6]); 1148__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.LabPage=function(){const e=(0,i.useLocalSearchParams)(),a=String(e.strategy||''),{width:l}=(0,s.default)(),n=l>=1e3,[d,c]=(0,t.useState)('replay'===String(e.mode||'')&&a?'replay':'experiments'===String(e.mode||'')?'experiments':'backtest');return(0,p.jsxs)(r.default,{style:{padding:n?24:14,gap:16,maxWidth:1200,width:'100%',alignSelf:'center'},children:[(0,p.jsx)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:(0,p.jsx)(o.Button,{label:a?'Back to strategy':'My Strategies',icon:"chevron-left",kind:"outline",onPress:()=>i.router.replace(a?{pathname:'/strategies',params:{id:a}}:'/strategies')})}),(0,p.jsxs)(r.default,{style:{gap:4},children:[(0,p.jsx)(o.T,{style:{fontFamily:'ManropeBold',fontSize:22},children:"Lab"}),(0,p.jsx)(o.T,{style:{fontSize:13,color:o.C.muted},children:"Replay shows how exact contracts traded. A backtest asks whether a rule would have made money - with modelled option prices, costs on every fill, and an out-of-sample check."})]}),(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8}],children:[(0,p.jsx)(o.Chip,{label:"Rule backtest (model-priced)",active:'backtest'===d,onPress:()=>c('backtest')}),(0,p.jsx)(o.Chip,{label:"Replay this strategy's contracts",active:'replay'===d,onPress:()=>a&&c('replay')}),(0,p.jsx)(o.Chip,{label:"Experiments (pre-registered grids)",active:'experiments'===d,onPress:()=>c('experiments')}),!a&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Open the Lab from a strategy to replay its contracts."})]}),'experiments'===d?(0,p.jsx)(v,{}):'backtest'===d?(0,p.jsx)(f,{strategyId:a,preset:{template:String(e.template||''),param:null!=e.param&&''!==e.param?Number(e.param):void 0,underlying:e.underlying?String(e.underlying):void 0,lots:e.lots?Number(e.lots):void 0,structure:e.structure?String(e.structure):void 0}}):(0,p.jsx)(j,{strategyId:a})]})};var t=_r(_d[0]);_r(_d[1]);var a=e(_r(_d[2])),r=e(_r(_d[3])),s=e(_r(_d[4])),l=_r(_d[5]),n=e(l),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]);const h=[['0','Mon'],['1','Tue'],['2','Wed'],['3','Thu'],['4','Fri'],['daily','Every day']],m=e=>e?.message||'KANIDA could not complete that.';function f({strategyId:e,preset:s}){const[l,n]=(0,t.useState)([]),[i,u]=(0,t.useState)(s.template||'iron_condor'),[f,y]=(0,t.useState)(s.param??null),[b,j]=(0,t.useState)(['
1148NIFTY']),[S,w]=(0,t.useState)('NIFTY');(0,t.useEffect)(()=>{d.lab.universe().then(e=>{j(e.underlyings.length?e.underlyings:['NIFTY']),s.underlying&&e.underlyings.includes(s.underlying)&&w(s.underlying)}).catch(()=>{})},[]);const[T,v]=(0,t.useState)('2'),[k,z]=(0,t.useState)({dte_min:'1',dte_max:'7',target_pct:'',stop_pct:'',exit_dte:'',from:'2016-01-01',to:'',split:'',slippage_pct:'0.5'}),[I,W]=(0,t.useState)(null),[F,R]=(0,t.useState)(''),[N,L]=(0,t.useState)([]),[P,q]=(0,t.useState)({rule:'',k:'2',trigger_pct:'0.3'});(0,t.useEffect)(()=>{d.sb.templates().then(e=>n(e.templates)).catch(()=>{}),d.lab.runs(e||void 0).then(e=>L(e.runs)).catch(()=>{})},[e]);const M=l.find(e=>e.key===i);(0,t.useEffect)(()=>{!M||!M.param||null!=f&&M.param.variants.includes(f)||y(M.param.default),M&&!M.param&&y(null)},[M]);const E=!!s.template,B=null==s.param||s.param===f,O=!s.underlying||s.underlying===S,A=E?[`From your draft: ${s.underlying||'NIFTY'} ${s.structure||s.template.replace(/_/g,' ')}${null!=s.param?` (${M?.param?.label||'width'} ${s.param})`:''}${s.lots?`, ${s.lots} lot${s.lots>1?'s':''}`:''}.`,`This test: ${S} ${M?.name||i}${null!=f?` (${M?.param?.label||'width'} ${f})`:''}, one set per trade at the current lot size - results scale linearly with lots.`,...B?[]:[`The ${M?.param?.label||'width'} differs from your draft.`],...s.underlying&&!b.includes(s.underlying)?[`${s.underlying} is not in the Lab's universe, so it is tested on ${S}.`]:O?[]:['The underlying differs from your draft.']]:[],V='running'===I?.status||'queued'===I?.status;(0,t.useEffect)(()=>{if(!I||!V)return;const t=setInterval(()=>d.lab.run(I.id).then(t=>{W(t),'running'!==t.status&&'queued'!==t.status&&d.lab.runs(e||void 0).then(e=>L(e.runs))}).catch(e=>R(m(e))),700);return()=>clearInterval(t)},[I,e,V]);const Y=(e,t,s=90,l="")=>(0,p.jsxs)(r.default,{style:{gap:3},children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:t}),(0,p.jsx)(a.default,{value:k[e],onChangeText:t=>z(a=>({...a,[e]:t})),placeholder:l,placeholderTextColor:o.C.muted,accessibilityLabel:t,style:{width:s,height:34,borderWidth:1,borderColor:o.C.line,borderRadius:8,paddingHorizontal:8,color:o.C.ink,fontFamily:'Inter',fontSize:12,backgroundColor:o.C.bg}})]});return(0,p.jsxs)(r.default,{style:{gap:14},children:[(0,p.jsxs)(r.default,{style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:14,padding:16,gap:12},children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:(b.length>1?`NIFTY and ${b.length-1} F&O stocks (today's list - past members that left are not included)`:'NIFTY')+". Option prices are modelled from the underlying and India VIX (stocks: scaled volatility) - no traded option history this deep exists here."}),b.length>1&&(0,p.jsxs)(r.default,{style:[o.s.row,{flexWrap:'wrap',gap:6,alignItems:'center'}],children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Underlying"}),(b.includes(S)&&'NIFTY'!==S?['NIFTY',S]:['NIFTY']).map(e=>(0,p.jsx)(o.Chip,{label:e,active:S===e,onPress:()=>w(e)},e)),(0,p.jsx)(a.default,{defaultValue:'NIFTY'===S?'':S,onChangeText:e=>{const t=e.trim().toUpperCase();t?b.includes(t)&&w(t):w('NIFTY')},placeholder:"Stock symbol",placeholderTextColor:o.C.muted,accessibilityLabel:"Stock symbol for the Lab",autoCapitalize:"characters",style:{width:130,height:32,borderWidth:1,borderColor:o.C.line,borderRadius:8,paddingHorizontal:8,color:o.C.ink,fontFamily:'Inter',fontSize:12,backgroundColor:o.C.bg}})]}),A.length>0&&(0,p.jsx)(r.default,{style:{backgroundColor:A.length>2?o.C.amberBg:o.C.soft,borderRadius:10,padding:10,gap:2},children:A.map((e,t)=>(0,p.jsx)(o.T,{style:{fontSize:12,color:A.length>2&&t>1?o.C.amber:o.C.ink},children:e},t))}),(0,p.jsx)(r.default,{style:[o.s.row,{flexWrap:'wrap',gap:6}],children:l.filter(e=>!e.multi_expiry).map(e=>(0,p.jsx)(o.Chip,{label:e.name+('unhedged'===e.risk?' \u26a0':''),active:i===e.key,onPress:()=>u(e.key)},e.key))}),l.some(e=>e.multi_expiry)&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Not testable in the Lab yet: ${l.filter(e=>e.multi_expiry).map(e=>e.name).join(', ')} - rule tests value one expiry at a time. Use the builder's model and replay for these.`}),M?.param&&(0,p.jsxs)(r.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:M.param.label}),M.param.variants.map(e=>(0,p.jsx)(o.Chip,{label:String(e),active:f===e,onPress:()=>y(e)},e))]}),M&&(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:`Rule: ${M.recipe}`}),(0,p.jsxs)(r.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Decide at the close on"}),h.map(([e,t])=>(0,p.jsx)(o.Chip,{label:t,active:T===e,onPress:()=>v(e)},e))]}),(0,p.jsxs)(r.default,{style:[o.s.row,{gap:12,flexWrap:'wrap',alignItems:'flex-end'}],children:[Y('dte_min','Min days to expiry'),Y('dte_max','Max days to expiry'),Y('target_pct','Take profit at % of max profit',110,'hold'),Y('stop_pct','Stop at % of max loss',110,'hold'),Y('exit_dte','Exit at days to expiry',110,'hold')]}),(0,p.jsxs)(r.default,{style:{gap:6},children:[(0,p.jsxs)(r.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Adjustment (one per trade)"}),C.map(([e,t])=>(0,p.jsx)(o.Chip,{label:t,active:P.rule===e,onPress:()=>q(t=>({...t,rule:e}))},e))]}),!!P.rule&&(0,p.jsxs)(r.default,{style:[o.s.row,{gap:12,flexWrap:'wrap',alignItems:'flex-end'}],children:[(0,p.jsx)(_,{label:"Trigger: tested short within % of spot (at a close)",value:P.trigger_pct,onChange:e=>q(t=>({...t,trigger_pct:e}))}
1148),$.includes(P.rule)&&(0,p.jsx)(_,{label:"Strikes (k)",value:P.k,onChange:e=>q(t=>({...t,k:e}))}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted,maxWidth:420},children:"Applied at the next open with slippage and charges. Tested with hold-to-expiry or a time exit only, paired with the same rule without the adjustment."})]})]}),(0,p.jsxs)(r.default,{style:[o.s.row,{gap:12,flexWrap:'wrap',alignItems:'flex-end'}],children:[Y('from','First decision date',120),Y('to','Last decision date',120,'latest'),Y('split','Out-of-sample from',120,'midpoint'),Y('slippage_pct','Slippage % (min 0.5)'),(0,p.jsx)(o.Button,{label:"Run backtest",icon:"play",onPress:async function(){R('');try{const t={template:i,param:f,weekday:T,underlying:S,strategy_id:e||void 0};for(const[e,a]of Object.entries(k))''!==a.trim()&&(t[e]=['from','to','split'].includes(e)?a:Number(a));P.rule&&(t.adjust={rule:P.rule,k:$.includes(P.rule)?Number(P.k):null,trigger_pct:Number(P.trigger_pct)}),W(await d.lab.start(t))}catch(e){R(m(e))}},loading:V}),V&&(0,p.jsx)(o.Button,{label:"Cancel run",icon:"x",kind:"outline",onPress:()=>d.lab.cancel(I.id).then(W).catch(e=>R(m(e)))})]}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"The dates bound the DECISION days. A trade decided on the last decision date is held to its own exit, which can fall after that date (up to its expiry)."}),!!F&&(0,p.jsx)(o.T,{style:{color:o.C.red,fontSize:12},children:F}),'queued'===I?.status&&(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.amber},children:`Queued${I.queue_ahead?` behind ${I.queue_ahead} other run${I.queue_ahead>1?'s':''}`:''} - the Lab runs two at a time so live quotes and analysis stay fast.`}),'cancelled'===I?.status&&(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Cancelled. Nothing from this run was saved."}),'running'===I?.status&&(0,p.jsxs)(r.default,{style:{gap:4},children:[(0,p.jsx)(r.default,{style:{height:6,backgroundColor:o.C.line,borderRadius:3},children:(0,p.jsx)(r.default,{style:{height:6,width:`${Math.round(100*I.progress)}%`,backgroundColor:o.C.green,borderRadius:3}})}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Running \xb7 ${Math.round(100*I.progress)}% (simulation, bootstrap, random-entry control)`})]}),'failed'===I?.status&&(0,p.jsx)(o.T,{style:{color:o.C.red,fontSize:12},children:`Run failed: ${I.error}`})]}),'completed'===I?.status&&I.result&&(0,p.jsx)(x,{run:I}),N.length>0&&(0,p.jsxs)(r.default,{style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:14,padding:14,gap:6},children:[(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi'},children:"Earlier runs"}),N.map(e=>(0,p.jsxs)(r.default,{style:[o.s.between,{borderTopWidth:1,borderColor:o.C.line,paddingTop:6,flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontSize:12,flex:1},children:`${e.spec.template}${null!=e.spec.param?` (${e.spec.param})`:''} \xb7 ${e.spec.from}\u2192${e.spec.to} \xb7 ${(0,c.istEpoch)(e.created_at)}`}),(0,p.jsx)(o.T,{style:{fontSize:11,color:'model_positive'===e.result?.badge.status?o.C.green:o.C.muted},children:'completed'===e.status?e.result?.badge.label:e.status}),e.evidence&&(0,p.jsx)(o.Badge,{label:'tested_significant'===e.evidence.status?`Tested \u2713 (${e.evidence.tests} rule${1===e.evidence.tests?'':'s'} corrected)`:'tested_not_significant'===e.evidence.status?`Not significant (p=${e.evidence.p?.toFixed(3)}, ${e.evidence.tests} rules)`:`not a test (n=${e.evidence.n_oos} < 30)`,tone:'tested_significant'===e.evidence.status?'green':'neutral'}),'completed'===e.status&&(0,p.jsx)(o.Button,{label:"Open",kind:"outline",onPress:()=>d.lab.run(e.id).then(W)})]},e.id))]})]})}function y(e,t){return[e,String(t.n||0),(0,c.signed)(t.expectancy),t.ci95?`${(0,c.signed)(t.ci95[0])} to ${(0,c.signed)(t.ci95[1])}`:'\u2014',null!=t.per_100_capital?`\u20b9${(0,c.num)(t.per_100_capital,2)}`:'\u2014',(0,c.signed)(t.total),(0,c.signed)(t.max_drawdown),(0,c.signed)(t.worst),null!=t.win_rate?`${t.win_rate}%`:'\u2014',null!=t.avg_hold_days?`${t.avg_hold_days}d`:'\u2014']}function x({run:e}){const t=(0,s.default)().width<700,a=e.result,l=a.provenance||{},n='model_positive'===a.badge.status?'green':'insufficient'===a.badge.status?'amber':'neutral';return(0,p.jsxs)(r.default,{style:{gap:12},children:[(0,p.jsxs)(r.default,{style:{backgroundColor:o.C.amberBg,borderRadius:10,padding:12,gap:4},children:[(0,p.jsx)(o.T,{style:{color:o.C.amber,fontFamily:'InterSemi'},children:l.label||'Model-priced'}),(0,p.jsx)(o.T,{style:{color:o.C.amber,fontSize:12}
1148,children:"Option prices are Black-Scholes values from the NIFTY 50 daily series and India VIX. They are not prices anyone traded at, and one volatility for every strike misprices the wings."})]}),(0,p.jsxs)(r.default,{style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:14,padding:16,gap:12},children:[(0,p.jsxs)(r.default,{style:[o.s.row,{gap:10,flexWrap:'wrap'}],children:[(0,p.jsx)(o.Badge,{label:a.badge.label,tone:n}),(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:`${e.spec.template}${null!=e.spec.param?` \xb7 ${e.spec.param}`:''} \xb7 ${e.spec.from}\u2192${e.spec.to} \xb7 out-of-sample from ${e.spec.split} \xb7 lot ${a.lot_size}`})]}),(0,p.jsx)(u.Scrollable,{narrow:t,min:900,children:(0,p.jsx)(r.default,{children:[['','Trades','Expectancy / trade','95% CI','Per \u20b9100 at risk','Total','Max drawdown','Worst','Win rate','Avg hold'],y('Discovery',a.stats.discovery),y('Out-of-sample',a.stats.oos),y('All',a.stats.all)].map((e,t)=>(0,p.jsx)(r.default,{style:[o.s.row,{gap:6,borderTopWidth:t?1:0,borderColor:o.C.line,paddingVertical:6}],children:e.map((e,a)=>(0,p.jsx)(o.T,{style:{flex:3===a?2.2:a?1:1.3,fontSize:t?12:10,color:t?0===a?o.C.muted:o.C.ink:o.C.muted,fontFamily:2===t&&a<4?'InterSemi':'Inter',textAlign:a?'right':'left',fontVariant:['tabular-nums']},children:e},a))},t))})}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Expectancy after charges and slippage decides; win rate is context only. The badge reads only the out-of-sample 95% lower bound and needs at least 30 out-of-sample trades."}),(0,p.jsx)(o.T,{style:{fontSize:12},children:`Random-entry control (${a.control.reps} runs of the same rule on random days): mean expectancy ${(0,c.signed)(a.control.mean_expectancy)} per trade; this rule beat ${a.control.actual_percentile??'\u2014'}% of them.${null!=a.control.oos_mean_expectancy?` Out of sample only: control ${(0,c.signed)(a.control.oos_mean_expectancy)}; this rule beat ${a.control.oos_actual_percentile??'\u2014'}%.`:''}`}),a.adjustment&&(0,p.jsx)(S,{a:a.adjustment}),a.equity&&a.equity.length>1&&(0,p.jsx)(b,{points:a.equity}),(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,p.jsx)(o.Button,{label:"Download trades (CSV)",icon:"download",kind:"outline",onPress:()=>{if(!a.trades)return;const t=a.trades.map(e=>[e.decision,e.entry,e.exit,e.expiry,e.reason,e.spot_entry,e.vix,'"'+(e.legs||[]).map(e=>`${e.side}${e.strike}${e.type}@${e.entry}->${e.exit}`).join(' ')+'"',e.gross,e.fees,e.net,e.capital_at_risk??''].join(',')).join('\n'),r=document.createElement('a');r.href=URL.createObjectURL(new Blob(['decision,entry,exit,expiry,reason,spot_entry,vix,legs,gross,fees,net,capital_at_risk\n'+t],{type:'text/csv'})),r.download=`kanida-backtest-${e.id}.csv`,r.click()}}),a.skipped&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Skipped: ${Object.entries(a.skipped).map(([e,t])=>`${t} ${e.replace(/_/g,' ')}`).join(' \xb7 ')}`})]})]}),a.trades&&(0,p.jsxs)(r.default,{style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:14,padding:14,gap:4},children:[(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi'},children:`Last ${Math.min(25,a.trades.length)} of ${a.trades.length} trades`}),[['Entry','Exit','Why','Legs','Net'],...a.trades.slice(-25).reverse().map(e=>[e.entry,e.exit,e.reason,(e.legs||[]).map(e=>`${e.side}${(0,c.num)(e.strike,0)}${e.type}`).join(' ')+(e.adjustment?.applied?` \xb7 adj ${e.adjustment.day}`:''),(0,c.signed)(e.net)])].map((e,t)=>(0,p.jsx)(r.default,{style:[o.s.row,{gap:6,borderTopWidth:t?1:0,borderColor:o.C.line,paddingVertical:4}],children:e.map((e,a)=>(0,p.jsx)(o.T,{style:{flex:3===a?3:1,fontSize:t?11:10,color:t?o.C.ink:o.C.muted,textAlign:4===a?'right':'left',fontVariant:['tabular-nums']},children:e},a))},t))]}),(0,p.jsxs)(r.default,{style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:14,padding:14,gap:4},children:[(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi'},children:"Data and assumptions"}),l.underlying&&Object.entries(l.underlying).filter(([,e])=>e).map(([e,t])=>(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`NIFTY 50 daily from ${e}: ${t[0]} \u2192 ${t[1]} (${t[2]} days)`},e)),l.volatility&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Volatility: ${l.volatility.series}`}),l.expiry_calendar&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:l.expiry_calendar}),(l.assumptions||[]).map((e,t)=>(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`\u2022 ${e}`},t)),a.manifest&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},selectable:!0,children:`Reproducible from: request ${String(a.manifest.request_hash).slice(0,12)} \xb7 ${a.manifest.model} \xb7 fees ${a.manifest.fees} \xb7 data ${a.manifest.underlying_hash} \xb7 code ${a.manifest.code_version||"?"} \xb7 lot ${a.manifest.lot_size} (${a.manifest.lot_basis})${a.manifest.underlying_days?` \xb7 underlying ${a.manifest.underlying_days[0]} \u2192 ${a.manifest.underlying_days[1]} (${a.manifest.underlying_days[2]} days)`:''}${a.manifest.volatility_days?` \xb7 volatility ${a.manifest.volatility_days[2]} days`:''} \xb7 computed ${a.manifest.computed_at}`})]})]})}function b({points:e}){const[a,s]=(0,t.useState)(700),i=e.map(e=>e.equity),d=Math.min(0,...i),c=Math.max(0,...i),u=t=>40+t/(e.length-1)*(a-50),h=e=>10+(c-e)/(c-d||1)*160,m=e.findIndex(e=>'oos'===e.split),f=(t,a)=>e.slice(t,a).map((e,a)=>`${a?'L':'M'}${u(t+a).toFixed(1)},${h(e.equity).toFixed(1)}`).join('');return(0,p.jsxs)(r.default,{onLayout:e=>s(e.nativeEvent.layout.width),accessibilityLabel:"Cumulative net P&L of the closed trades, discovery then out-of-sample",children:[(0,p.jsxs)(n.default,{width:a,height:180,children:[m>0&&(0,p.jsx)(l.Rect,{x:u(m),y:10,width:a-10-u(m),height:160,fill:o.C.green+'0D'}),(0,p.jsx)(l.Line,{x1:40,x2:a-10,y1:h(0),y2:h(0),stroke:o.C.muted}),(0,p.jsx)(l.Path,{d:f(0,m>0?m+1:e.length),stroke:o.C.muted,strokeWidth:1.6,fill:"none"}),m>=0&&(0,p.jsx)(l.Path,{d:f(Math.max(0,m),e.length),stroke:o.C.green,strokeWidth:1.8,fill:"none"})]}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Cumulative net P&L (\u20b9) of closed trades \xb7 grey = discovery, green = out-of-sample (shaded)"})]})}function j({strategyId:e}){const[a,s]=(0,t.useState)('15minute'),[i,u]=(0,t.useState)(5),[h,f]=(0,t.useState)(null),[y,x]=(0,t.useState)(!1),[b,j]=(0,t.useState)(''),C=(0,t.useCallback)(async()=>{x(!0),j('');try{f(await d.lab.replay(e,a,i))}catch(e){j(m(e))}finally{x(!1)}},[e,a,i]);(0,t.useEffect)(()=>{C()},[]);const[$,_]=(0,t.useState)(700),S=h?.points||[],w=S.map(e=>e.pnl),T=Math.min(0,...w),v=Math.max(0,...w),k=e=>40+e/Math.max(1,S.length-1)*($-50),z=e=>10+(v-e)/(v-T||1)*180;return(0,p.jsxs)(r.default,{style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:14,padding:16,gap:12},children:[(0,p.jsxs)(r.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[[['5minute','5 min'],['15minute','15 min'],['60minute','1 hour'],['day','Daily']].map(([e,t])=>(0,p.jsx)(o.Chip,{label:t,active:a===e,onPress:()=>s(e)},e)),[2,5,10,30].map(e=>(0,p.jsx)(o.Chip,{label:`${e} days`,active:i===e,onPress:()=>u(e)},e)),(0,p.jsx)(o.Button,{label:"Replay",icon:"rotate-ccw",loading:y,onPress:C})]}),!!b&&(0,p.jsx)(o.T,{style:{color:o.C.red,fontSize:12},children:b}),h?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:`${'kite_historical'===h.source?'Zerodha Kite historical candles':'Captured 15-minute candles (db/derivatives.db)'} \xb7 ${h.legs.map(e=>e.label).join(', ')}`}),!!h.request?.changed?.length&&(0,p.jsxs)(r.default,{accessibilityRole:"alert",style:{backgroundColor:o.C.amberBg,borderRadius:10,padding:10,gap:2},children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.amber,fontFamily:'InterSemi'},children:"Not exactly what you asked for"}),h.request.changed.map((e,t)=>(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.amber},children:e},t)),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Asked: ${h.request.requested.interval}, ${h.request.requested.from} \u2192 ${h.request.requested.to}. Got: ${h.request.effective.interval}${h.request.effective.from?`, ${h.request.effective.from} \u2192 ${h.request.effective.to}`:''}.`})]}),h.coverage_detail&&(0,p.jsxs)(r.default,{style:{gap:2},children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Coverage: ${h.coverage_detail.common_bars} bars with a price for every leg - ${'expected_session_bars'===h.coverage_detail.denominator?`${Math.round(100*h.coverage_detail.share)}% of the ${h.coverage_detail.expected_bars} exchange-session bars in the window`:`${Math.round(100*h.coverage_detail.share)}% of the best-covered leg (the expected session count was not available)`}; minimum ${Math.round(100*h.coverage_detail.minimum)}%${h.coverage_detail.longest_intraday_gap_minutes?` \xb7 longest gap ${h.coverage_detail.longest_intraday_gap_minutes} min`:''}. Gross traded prices - not a net strategy test.`}),h.coverage_detail.legs.map(e=>(0,p.jsx)(o.T,{style:{fontSize:11,color:e.bars?o.C.muted:o.C.red},children:`${e.label}: ${e.bars} bars${e.first?` (${e.first.slice(0,16)} \u2192 ${(e.last||'').slice(0,16)})`:''}`},e.symbol))]}),h.status&&'ok'!==h.status?(0,p.jsx)(o.T,{accessibilityRole:"alert",style:{color:o.C.amber},children:h.reason}):S.length?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r.default,{onLayout:e=>
1148_(e.nativeEvent.layout.width),children:(0,p.jsxs)(n.default,{width:$,height:200,children:[(0,p.jsx)(l.Line,{x1:40,x2:$-10,y1:z(0),y2:z(0),stroke:o.C.muted}),(0,p.jsx)(l.Path,{d:S.map((e,t)=>`${t?'L':'M'}${k(t).toFixed(1)},${z(e.pnl).toFixed(1)}`).join(''),stroke:o.C.green,strokeWidth:1.8,fill:"none"})]})}),(0,p.jsx)(r.default,{style:[o.s.row,{gap:18,flexWrap:'wrap'}],children:[['Entered at',`${h.entry_at?.slice(0,16)} IST`],['Now / last',(0,c.signed)(h.last)],['Best',(0,c.signed)(h.best)],['Worst',(0,c.signed)(h.worst)],['Bars',String(S.length)],['Bars skipped (a leg missing)',String(h.skipped_bars)]].map(([e,t])=>(0,p.jsxs)(r.default,{style:{gap:1},children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:e}),(0,p.jsx)(o.T,{style:{fontSize:14,fontFamily:'InterSemi'},children:t})]},e))}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:h.note})]}):(0,p.jsx)(o.T,{style:{color:o.C.amber},children:"No bar where every leg traded in this window. Nothing is filled in."})]}):(0,p.jsx)(o.Loading,{})]})}const C=[['','None'],['roll_tested_short','Roll tested short'],['add_hedge_wing','Add hedge wing'],['close_tested_side','Close tested side'],['reduce_half','Halve'],['close_all','Close all']],$=['roll_tested_short','add_hedge_wing'];function _({label:e,value:t,onChange:s}){return(0,p.jsxs)(r.default,{style:{gap:3},children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:e}),(0,p.jsx)(a.default,{value:t,onChangeText:s,accessibilityLabel:e,keyboardType:"decimal-pad",style:{width:110,height:34,borderWidth:1,borderColor:o.C.line,borderRadius:8,paddingHorizontal:8,color:o.C.ink,fontFamily:'Inter',fontSize:12,backgroundColor:o.C.bg}})]})}function S({a:e}){const t={adjust_helped:'green',adjust_hurt:'red',adjust_not_significant:'neutral',insufficient:'amber'}[e.badge?.status]||'amber',a=(e,t)=>[e,String(t?.n??0),t?.n?(0,c.signed)(t.mean):'\u2014',t?.n?`${(0,c.signed)(t.ci95[0])} \u2026 ${(0,c.signed)(t.ci95[1])}`:'\u2014',t?.n?`${t.helped} / ${t.hurt}`:'\u2014'],s=e.improvement_per_triggered_trade||{};return(0,p.jsxs)(r.default,{style:{borderWidth:1,borderColor:o.C.line,borderRadius:12,padding:12,gap:6},children:[(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi'},children:"Adjustment vs the same rule without it"}),(0,p.jsx)(o.Badge,{label:e.badge?.label||'\u2014',tone:t})]}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`${e.rule.rule.replace(/_/g,' ')}${e.rule.k?` +${e.rule.k}`:''} \xb7 trigger ${e.rule.trigger_pct}% \xb7 triggered in ${e.triggered.all} of ${e.pairs} trades (${e.triggered.oos} out of sample)${e.not_applicable?` \xb7 ${e.not_applicable} triggers could not apply`:''}`}),(0,p.jsx)(r.default,{children:[['','Triggered','Improvement / triggered trade','95% CI','Helped / hurt'],a('Discovery',s.discovery),a('Out-of-sample',s.oos),a('All',s.all)].map((e,t)=>(0,p.jsx)(r.default,{style:[o.s.row,{gap:6,borderTopWidth:t?1:0,borderColor:o.C.line,paddingVertical:5}],children:e.map((e,a)=>(0,p.jsx)(o.T,{style:{flex:3===a?2:a?1:1.2,fontSize:t?12:10,color:t?o.C.ink:o.C.muted,textAlign:a?'right':'left',fontVariant:['tabular-nums']},children:e},a))},t))}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Paired: each adjusted trade against its twin without the adjustment (same entry and exit days). Untriggered trades are identical, so only triggered trades are compared. The badge reads the out-of-sample 95% interval and needs 30 out-of-sample triggers."})]})}const w=['Mon','Tue','Wed','Thu','Fri'],T={tested_significant:['Tested \u2713','green'],tested_not_significant:['Not significant','neutral'],insufficient:['Too few trades','amber']};function v(){const e=(0,s.default)().width<700,[a,l]=(0,t.useState)(null),[n,i]=(0,t.useState)(null),[h,f]=(0,t.useState)(''),[y,x]=(0,t.useState)(60);return(0,t.useEffect)(()=>{d.lab.batches().then(e=>{l(e.batches),e.batches[0]&&d.lab.batch(e.batches[0].id).then(i).catch(e=>f(m(e)))}).catch(e=>f(m(e)))},[]),h?(0,p.jsx)(o.T,{style:{color:o.C.red},children:h}):a?a.length?(0,p.jsxs)(r.default,{style:{gap:12},children:[(0,p.jsx)(r.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:a.map(e=>(0,p.jsx)(o.Chip,{label:`${e.name} \xb7 ${e.planned} rules`,active:n?.id===e.id,onPress:()=>d.lab.batch(e.id).then(i)},e.id))}),n&&(0,p.jsxs)(r.default,{style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:14,padding:14,gap:8},children:[(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:15},children:n.name}),(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:n.grid.why}),(0,p.jsx)(o.T,{style:{fontSize:12},children:`Pre-registered ${(0,c.istEpoch)(n.created_at)} \xb7 plan hash ${n.plan_hash.slice(0,12)} \xb7 ${n.planned} rules planned, ${n.done} completed, ${n.failed} failed \xb7 ${n.grid.underlying} ${n.grid.from}\u2192${n.grid.to||'latest'}, out of sample from ${n.grid.split}, slippage ${n.grid.slippage_pct}%`}),(0,p.jsx)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:Object.entries(n.counts).map(([e,t])=>(0,p.jsx)(o.Badge,{label:`${T[e][0]}: ${t}`,tone:T[e][1]},e))}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Every rule of the batch is listed. Each is one hypothesis in the ${n.grid.underlying} family (${n.family?.tests??0} rules tested in your Lab), corrected together with Benjamini-Hochberg at FDR 10%, with Johnson's skew-adjusted test and a tail stress for rarely-seen maximum losses. Model-priced (India VIX, no skew).`}),(0,p.jsx)(u.Scrollable,{narrow:e,min:860,children:(0,p.jsx)(r.default,{children:[['Status','Structure','Decide','DTE','OOS n','Mean \u20b9/trade','p','95% low','Why'],...n.rules.slice(0,y).map(e=>[T[e.status][0],`${e.template.replace(/_/g,' ')}${null!=e.param?` ${e.param}`:''}`,'daily'===e.weekday?'daily':w[e.weekday],`${e.dte[0]}-${e.dte[1]}`,String(e.n_oos),null==e.mean_oos?'\u2014':(0,c.signed)(e.mean_oos),null==e.p?'\u2014':e.p.toFixed(4),null==e.low?'\u2014':`${e.low>0?'+':''}${e.low.toFixed(2)}`,e.reason?String(e.reason).replace(/_/g,' '):''])].map((e,t)=>(0,p.jsx)(r.default,{style:[o.s.row,{gap:6,borderTopWidth:t?1:0,borderColor:o.C.line,paddingVertical:4}],children:e.map((e,a)=>(0,p.jsx)(o.T,{style:{flex:[1.1,1.8,.6,.6,.6,1,.7,.8,1.2][a],fontSize:t?11:10,color:t?0===a&&'Tested \u2713'===e?o.C.green:o.C.ink:o.C.muted,textAlign:a>=4&&a<=7?'right':'left',fontVariant:['tabular-nums']},children:e},a))},t))})}),n.rules.length>y&&(0,p.jsx)(o.Button,{label:`Show all ${n.rules.length}`,kind:"outline",onPress:()=>x(1e4)}),!!n.quarantine&&(0,p.jsxs)(r.default,{accessibilityRole:"alert",style:{backgroundColor:o.C.amberBg,borderRadius:10,padding:10,gap:4},children:[(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.amber,fontFamily:'InterSemi'},children:"Not usable as evidence"}),(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.amber},children:n.quarantine}),(n.failure_summary||[]).map((e,t)=>(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted}
1148,children:`${e.count.toLocaleString('en-IN')} \xd7 ${e.reason}`},t)),n.failure_kinds>3&&(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`\u2026and ${n.failure_kinds-3} other kinds of failure. Full diagnostics stay on the server.`})]})]})]}):(0,p.jsx)(o.T,{style:{color:o.C.muted,fontSize:12},children:"No experiment batch has run yet."}):(0,p.jsx)(o.Loading,{})}},1055,[11,136,385,13,400,840,252,821,976,979,980,6]); 1149__d(function(g,_r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DeploymentMonitor=function({id:e}){const l=(0,s.default)().width<700,[f,x]=(0,t.useState)(null),[y,b]=(0,t.useState)(''),[j,C]=(0,t.useState)(!1),S=(0,t.useCallback)(()=>{i.exec.get(e).then(e=>{x(e),b('')}).catch(e=>b(e.message))},[e]);(0,t.useEffect)(()=>{S();const e=setInterval(S,1e4);return()=>clearInterval(e)},[S]);const k=f;return(0,p.jsxs)(r.default,{style:{padding:l?14:24,gap:16,maxWidth:1e3,width:'100%',alignSelf:'center'},children:[(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,p.jsx)(o.Button,{label:"My Strategies",icon:"chevron-left",kind:"outline",onPress:()=>n.router.replace('/strategies')}),f&&(0,p.jsx)(o.Button,{label:"Open the strategy",kind:"outline",onPress:()=>n.router.push({pathname:'/strategies',params:{id:f.strategy_id}})}),f&&(0,p.jsx)(o.Button,{label:"Alerts",icon:"bell",kind:"outline",onPress:()=>n.router.push({pathname:'/strategies',params:{view:'alerts'}})}),f&&'active'===f.status&&(0,p.jsx)(o.Button,{label:"Adjust",icon:"sliders",kind:"outline",onPress:()=>n.router.push({pathname:'/strategies',params:{id:f.strategy_id,open:'adjust'}})})]}),(0,p.jsxs)(r.default,{style:{gap:4},children:[(0,p.jsx)(o.T,{style:{fontFamily:'ManropeBold',fontSize:22},children:"Paper deployment"}),(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:"Simulated fills against live quotes. No order reaches a broker; live monitoring is not part of this release."})]}),(0,p.jsx)(c.LoadState,{loading:!f&&!y,error:y,onRetry:S,what:"The deployment",children:f&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(r.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,p.jsx)(o.Badge,{label:`PAPER \xb7 ${f.status.replace('_',' ').toUpperCase()}`,tone:'active'===f.status?'green':'attention_required'===f.status?'red':'neutral'}),f.revision&&(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.muted},children:`Version #${f.revision.n} "${f.revision.name}"`})]}),k.exposure_mismatch&&(0,p.jsxs)(r.default,{accessibilityRole:"alert",style:{backgroundColor:o.C.redBg,borderRadius:12,padding:12,gap:6},children:[(0,p.jsx)(o.T,{style:{color:o.C.red,fontFamily:'InterSemi'},children:"What is held is not what the plan intended"}),(0,p.jsx)(o.T,{style:{color:o.C.red,fontSize:12},children:"A partly filled structure carries a different risk - for example a hedge bought without its short, or a short without its hedge. Complete, cancel the resting orders, or close."}),(0,p.jsx)(c.Scrollable,{narrow:l,min:420,children:(0,p.jsx)(r.default,{children:[['Leg','Planned units','Held units','Residual'],...k.exposure.map(e=>[e.label||e.leg_id,String(e.planned??'\u2014'),String(e.held),null==e.residual?'\u2014':String(e.residual)])].map((e,t)=>(0,p.jsx)(r.default,{style:[o.s.row,{gap:6,paddingVertical:3,borderTopWidth:t?1:0,borderColor:o.C.redLine}],children:e.map((e,l)=>(0,p.jsx)(o.T,{style:{flex:l?1:1.4,fontSize:t?12:10,color:t&&3===l&&'0'!==e?o.C.red:o.C.ink,textAlign:l?'right':'left',fontVariant:['tabular-nums']},children:e},l))},t))})})]}),null==f.net&&k.last_known&&(0,p.jsxs)(r.default,{accessibilityRole:"alert",style:{backgroundColor:o.C.amberBg,borderRadius:12,padding:12,gap:4},children:[(0,p.jsx)(o.T,{style:{color:o.C.amber,fontFamily:'InterSemi'},children:"Current marks are unavailable"}),(0,p.jsx)(o.T,{style:{color:o.C.amber,fontSize:12},children:`Last good valuation: net ${(0,u.signed)(k.last_known.net)} (unrealised ${(0,u.signed)(k.last_known.unrealised)}), marked ${(0,u.istStamp)(k.last_known.marked_at)} - ${Math.round(k.last_known.age_seconds/60)} min ago. This is not a current value.`})]}),null==f.net&&!k.last_known&&(0,p.jsx)(o.T,{style:{color:o.C.amber,fontSize:12},children:"No current mark and no earlier valuation - net P&L is unavailable, not zero."}),'active'===f.status&&(0,p.jsx)(h,{d:f,onSaved:x}),(0,p.jsx)(d.DeploymentCard,{d:f,onChanged:S,onClose:()=>C(!0),onAdjust:()=>n.router.push({pathname:'/strategies',params:{id:f.strategy_id,open:'adjust'}})}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:`Realised ${(0,u.signed)(f.realised)} \xb7 unrealised ${null==f.unrealised?'unavailable':(0,u.signed)(f.unrealised)} \xb7 fees ${(0,u.num)(f.fees)} \xb7 marked ${(0,u.istStamp)(f.marked_at)}. Refreshes every 10 s.`}),j&&(0,p.jsx)(d.OrderReview,{visible:!0,strategyId:f.strategy_id,deployment:f,onClose:()=>C(!1),onPlaced:()=>{C(!1),S()}})]})})]})};var t=_r(_d[0]),l=e(_r(_d[1])),r=e(_r(_d[2])),s=e(_r(_d[3])),n=_r(_d[4]),o=_r(_d[5]),i=_r(_d[6]),d=_r(_d[7]),u=_r(_d[8]),c=_r(_d[9]),p=_r(_d[10]);function h({d:e,onSaved:s}){const n=e.exit_rules,[d,u]=(0,t.useState)(null!=n?.target_pct?String(n.target_pct):''),[c,h]=(0,t.useState)(null!=n?.stop_pct?String(n.stop_pct):''),[f,x]=(0,t.useState)(!1),[y,b]=(0,t.useState)(''),j=e=>''===e.trim()?null:Number(e);const C={minHeight:44,width:110,borderWidth:1,borderColor:o.C.line,borderRadius:10,paddingHorizontal:10,color:o.C.ink,fontFamily:'Inter',fontSize:13,backgroundColor:o.C.paper};return(0,p.jsxs)(r.default,{style:{backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:12,padding:12,gap:8},children:[(0,p.jsx)(o.T,{style:{fontFamily:'InterSemi'},children:"Paper exit rules"}),(0,p.jsxs)(r.default,{style:[o.s.row,{gap:12,flexWrap:'wrap',alignItems:'flex-end'}],children:[(0,p.jsxs)(r.default,{style:{gap:3},children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Take profit at % of max profit"}),(0,p.jsx)(l.default,{value:d,onChangeText:u,keyboardType:"decimal-pad",placeholder:"none",placeholderTextColor:o.C.muted,accessibilityLabel:"Take profit percent",style:C})]}),(0,p.jsxs)(r.default,{style:{gap:3},children:[(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Stop at % of max loss"}),(0,p.jsx)(l.default,{value:c,onChangeText:h,keyboardType:"decimal-pad",placeholder:"none",placeholderTextColor:o.C.muted,accessibilityLabel:"Stop loss percent",style:C})]}),(0,p.jsx)(o.Button,{label:null==j(d)&&null==j(c)?'Clear rules':'Save rules',kind:"outline",loading:f,onPress:async function(){x(!0),b('');try{s(await i.exec.exitRules(e.id,j(d),j(c)))}catch(e){b(e.message)}finally{x(!1)}}})]}),!!n?.last_note&&(0,p.jsx)(o.T,{style:{fontSize:12,color:o.C.amber},children:n.last_note}),!!y&&(0,p.jsx)(o.T,{accessibilityRole:"alert",style:{fontSize:12,color:o.C.red},children:y}),(0,p.jsx)(o.T,{style:{fontSize:11,color:o.C.muted},children:"Checked every few seconds while the market is open. A met rule places the normal reviewed close orders (paper). Positions still open after expiry settle at intrinsic value."})]})}},1056,[11,385,13,400,252,821,976,989,979,980,6]); 1150__d(function(g,r,i,a,m,e,d){"use strict";
1150Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.PilotLegal}});var t=r(d[0])},1057,[894]); 1151__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.WorkspaceRoute}});var t=r(d[0])},1058,[896]); 1152__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Welcome}});var t=r(d[0])},1059,[1060]); 1153__d(function(g,r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Welcome=function(){const e=(0,f.useAuth)(),x=!1!==e.config?.invitation_required,p=(0,o.useLayoutMode)(),j='desktop'===p,C='phone'===p,{matches:b,state:w,loading:T,error:S,refresh:z,setDetail:k}=(0,l.useProduct)(),L=b.find(e=>'MUTHOOTFIN'===e.symbol&&'symmetrical_triangle'===e.pattern&&'1D'===e.timeframe)||b.find(e=>'symmetrical_triangle'===e.pattern)||b[0];return(0,y.jsxs)(t.default,{style:{width:'100%',maxWidth:1440,alignSelf:'center',paddingHorizontal:C?20:42,paddingTop:C?28:54,paddingBottom:48,gap:j?42:30},children:[(0,y.jsxs)(t.default,{style:{flexDirection:j?'row':'column',gap:j?56:28,alignItems:j?'center':'stretch'},children:[(0,y.jsxs)(t.default,{style:{flex:j?.85:void 0,gap:22},children:[(0,y.jsxs)(t.default,{style:o.s.row,children:[(0,y.jsx)(t.default,{style:{width:22,height:1,backgroundColor:o.C.green}}),(0,y.jsx)(o.T,{style:{fontSize:11,letterSpacing:2,color:o.C.green,fontFamily:'InterSemi'},children:"MEET YOUR CHART AGENT"})]}),(0,y.jsxs)(o.T,{accessibilityRole:"header",style:{fontFamily:'ManropeBold',fontSize:C?40:j?53:48,lineHeight:C?48:62,letterSpacing:-1.8},children:["See the setup.",'\n',"Understand the move."]}),(0,y.jsx)(o.T,{style:{fontSize:16,lineHeight:27,color:o.C.muted,maxWidth:510},children:"A chart that shows its thinking. KANIDA finds the structure, draws the pattern, and brings that stock\u2019s own history into the decision."}),(0,y.jsxs)(t.default,{style:{gap:10,alignItems:j?'flex-start':'stretch'},children:[(0,y.jsx)(o.Button,{label:e.user?'Open my workspace':x?'Enter the private pilot':'Create my account',icon:"arrow-right",onPress:()=>i.router.push(e.user?'/':x?'/signin':'/signup'),style:{minHeight:54,paddingHorizontal:24}}),(0,y.jsxs)(o.T,{style:{fontSize:14,color:o.C.muted},children:[x?'Invitation only':'Registration open'," \xb7 your research, plans and broker connection"]})]}),(0,y.jsx)(t.default,{style:{borderTopWidth:1,borderColor:o.C.line,paddingTop:18,flexDirection:'row',gap:22},children:[['01','Discover'],['02','See the evidence'],['03','Make a plan']].map(([e,n])=>(0,y.jsxs)(t.default,{style:{flex:1,gap:7},children:[(0,y.jsx)(o.T,{style:{fontSize:11,color:o.C.green,fontFamily:'InterSemi'},children:e}),(0,y.jsx)(o.T,{style:{fontSize:12,lineHeight:18,color:o.C.muted},children:n})]},e))})]}),(0,y.jsxs)(s.LinearGradient,{colors:[o.C.heroA,o.C.heroB,o.C.paper],start:{x:0,y:0},end:{x:1,y:1},style:{flex:j?1.15:void 0,borderRadius:24,borderWidth:1,borderColor:o.C.greenLine,padding:C?14:24,gap:18},children:[(0,y.jsxs)(t.default,{style:[o.s.between,{alignItems:'flex-start'}],children:[(0,y.jsxs)(t.default,{style:[o.s.row,{flex:1}],children:[(0,y.jsx)(u.AgentMark,{size:34}),(0,y.jsxs)(t.default,{style:{flex:1,gap:3},children:[(0,y.jsx)(o.T,{style:{fontSize:15,fontFamily:'InterSemi'},children:"Let me show you how."}),(0,y.jsx)(o.T,{style:{fontSize:13,color:o.C.muted},children:L?'An example from your stored scan':'Your chart agent, in action'})]})]}),(0,y.jsx)(o.Badge,{label:L?'RESEARCH':'ILLUSTRATION',tone:"amber"})]}),T?(0,y.jsx)(o.Loading,{}):L?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(t.default,{style:[o.s.between,{flexWrap:'wrap'}],children:[(0,y.jsxs)(t.default,{style:{gap:4},children:[(0,y.jsx)(o.T,{style:{fontFamily:'ManropeBold',fontSize:23},children:L.symbol}),(0,y.jsxs)(o.T,{style:{fontSize:14,color:o.C.muted},children:[L.pattern_name," \xb7 ",L.timeframe]})]}),(0,y.jsx)(o.T,{style:{fontSize:13,color:o.C.muted},children:(0,c.dateText)(L.candle_end)})]}),(0,y.jsx)(h.PatternCanvas,{match:L,compact:!0},L.id),(0,y.jsx)(o.Button,{label:`Understand ${L.symbol}`,icon:"arrow-up-right",kind:"outline",onPress:function(){L&&(i.router.push('/chart'),k(L))}})]}):(0,y.jsx)(m,{})]})]}),(0,y.jsx)(t.default,{style:{flexDirection:C?'column':'row',gap:14},children:[['aperture','The pattern, made visible','Watch the agent trace the boundaries and inner swings on actual candles.'],['bar-chart-2','Evidence for this stock','Past return per trade, win rate and holding time stay tied to the exact pattern and timeframe.'],['shield','A plan you can inspect','Review capital, entry, stop and target. Then test the order journey with a virtual account.']].map(([e,n,i])=>(0,y.jsxs)(t.default,{style:{flex:1,padding:22,gap:12,backgroundColor:o.C.paper,borderWidth:1,borderColor:o.C.line,borderRadius:16},children:[(0,y.jsx)(o.Icon,{name:e,color:o.C.green,size:22}),(0,y.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:15},children:n}),(0,y.jsx)(o.T,{style:{fontSize:13,lineHeight:22,color:o.C.muted},children:i})]},n))}),(0,y.jsxs)(t.default,{style:{borderTopWidth:1,borderColor:o.C.line,paddingTop:24,gap:17},children:[(0,y.jsxs)(t.default,{style:[o.s.between,{flexWrap:'wrap'}],children:[(0,y.jsx)(o.T,{style:{fontFamily:'InterSemi',fontSize:17},children:"Your workspace, at a glance"}),(0,y.jsx)(o.T,{style:{fontSize:12,color:o.C.muted}
1153,children:e.user?'Research through '+(0,c.dateText)(w?.source_latest):'Your private research workspace'})]}),(0,y.jsx)(t.default,{style:{flexDirection:C?'column':'row',gap:12},children:[['Research',e.user?S?'Connection interrupted':T?'Loading':w?'Available':'Unavailable':'Sign in to explore','Inspect stored setups and stock-specific backtests.',!!w&&!S],['Kite connection','Secure broker login','Connect your own account inside your private workspace.',!1],['AutoTrade','Virtual workflow','Test order handling. Live execution remains disabled.',!1]].map(([e,n,i,s])=>(0,y.jsxs)(t.default,{style:{flex:1,gap:7,borderLeftWidth:2,borderColor:s?o.C.green:o.C.line,paddingLeft:14,paddingVertical:6},children:[(0,y.jsxs)(t.default,{style:o.s.between,children:[(0,y.jsx)(o.T,{style:{fontSize:13,fontFamily:'InterSemi'},children:e}),(0,y.jsx)(o.T,{style:{fontSize:11,color:s?o.C.green:o.C.amber},children:n})]}),(0,y.jsx)(o.T,{style:{fontSize:12,color:o.C.muted,lineHeight:20},children:i})]},String(e)))})]}),(0,y.jsxs)(n.default,{accessibilityRole:"link",accessibilityLabel:"Preview KANIDA on iPhone",onPress:()=>i.router.push('/connect'),style:{minHeight:48,flexDirection:'row',gap:9,alignItems:'center',justifyContent:'center'},children:[(0,y.jsx)(o.Icon,{name:"smartphone",size:16,color:o.C.green}),(0,y.jsx)(o.T,{style:{fontSize:13,color:o.C.green},children:"Take KANIDA to your iPhone"}),(0,y.jsx)(o.Icon,{name:"arrow-right",size:16,color:o.C.green})]})]})},r(d[0]);var t=e(r(d[1])),n=e(r(d[2])),i=r(d[3]),s=r(d[4]),l=r(d[5]),o=r(d[6]),c=r(d[7]),h=r(d[8]),u=r(d[9]),f=r(d[10]),x=r(d[11]),p=e(x),y=r(d[12]);function m(){return(0,y.jsxs)(t.default,{style:{gap:16},children:[(0,y.jsx)(t.default,{style:o.s.between,children:(0,y.jsx)(o.T,{style:{fontFamily:'ManropeBold',fontSize:23},children:"The structure becomes clear."})}),(0,y.jsx)(o.T,{style:{fontSize:14,color:o.C.muted},children:"An illustrative triangle \xb7 not a stock or forecast"}),(0,y.jsxs)(p.default,{width:"100%",height:230,viewBox:"0 0 500 230",accessibilityLabel:"Illustrative chart showing narrowing swings inside a triangle",children:[(0,y.jsx)(x.Line,{x1:20,y1:190,x2:480,y2:190,stroke:o.C.greenLine}),[60,105,150].map(e=>(0,y.jsx)(x.Line,{x1:20,y1:e,x2:480,y2:e,stroke:o.C.line},e)),(0,y.jsx)(x.Path,{d:"M 24 178 L 58 139 L 78 150 L 112 51 L 174 171 L 230 76 L 290 146 L 340 101 L 382 128 L 410 119",stroke:o.C.mint,fill:"none",strokeWidth:2}),(0,y.jsx)(x.Path,{d:"M 112 51 L 435 123 M 174 171 L 435 123",stroke:o.C.green,fill:"none",strokeWidth:2.5,strokeDasharray:"6 4"}),[[112,51],[174,171],[230,76],[290,146],[340,101],[382,128]].map(([e,t],n)=>(0,y.jsx)(x.Circle,{cx:e,cy:t,r:4,fill:o.C.green},n)),(0,y.jsx)(x.Text,{x:22,y:219,fill:o.C.muted,fontSize:13,children:"Earlier swings"}),(0,y.jsx)(x.Text,{x:350,y:219,fill:o.C.muted,fontSize:13,children:"Tighter structure"})]}),(0,y.jsx)(o.T,{style:{fontSize:14,lineHeight:24,color:o.C.muted},children:"Open a real setup to watch your agent draw its boundaries, connect the internal swings and explain the risk zones."})]})}},1060,[11,13,375,252,1061,196,821,197,864,839,198,840,6]); 1154__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"LinearGradient",{enumerable:!0,get:function(){return l}});var e=r(d[0]),t=r(d[1]);r(d[2]),r(d[3]);var n,o=r(d[4]),s=(n=o)&&n.__esModule?n:{default:n};class l extends t.Component{render(){const{colors:t,locations:n,start:o,end:l,dither:u,...f}=this.props;let h=n;return n&&t.length!==n.length&&(console.warn('LinearGradient colors and locations props should be arrays of the same length'),h=n.slice(0,t.length)),(0,e.jsx)(s.default,{...f,colors:t,dither:void 0,locations:h,startPoint:c(o),endPoint:c(l)})}}function c(e){if(e){if(!Array.isArray(e)||2===e.length)return Array.isArray(e)?e:[e.x,e.y];console.warn('start and end props for LinearGradient must be of the format [x,y] or {x, y}')}}},1061,[6,11,136,33,1062]); 1155__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return c}}
1155),_e.getLinearGradientBackgroundImage=s;var t,e=r(_d[0]),n=(function(t){if(t&&t.__esModule)return t;var e={};return t&&Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),e.default=t,e})(r(_d[1])),o=r(_d[2]),u=(t=o)&&t.__esModule?t:{default:t},l=r(_d[3]);function c({colors:t,locations:o,startPoint:l,endPoint:c,...d}){const[{height:h,width:f},y]=n.useState({height:1,width:1}),b=n.useMemo(()=>s(t,o,l,c,f,h),[t,o,l,c,f,h]);return(0,e.jsx)(u.default,{...d,style:[d.style,{backgroundImage:b}],onLayout:t=>{const{width:e,height:n}=t.nativeEvent.layout;y(t=>e!==t.width||n!==t.height?{height:n,width:e}:t),d.onLayout&&d.onLayout(t)}})}function s(t,e,n,o,u=1,l=1){const c=h(t,e);return`linear-gradient(${d(u,l,n,o)}deg, ${c.join(', ')})`}function d(t,e,n,o){const[u=[0,0],l=[0,0]]=(()=>{let t=[0,0];Array.isArray(n)&&(t=[null!=n[0]?n[0]:0,null!=n[1]?n[1]:0]);let e=[0,1];return Array.isArray(o)&&(e=[null!=o[0]?o[0]:0,null!=o[1]?o[1]:1]),[t,e]})();u[0]*=t,l[0]*=t,u[1]*=e,l[1]*=e;const c=l[1]-u[1],s=l[0]-u[0];return 90+180*Math.atan2(c,s)/Math.PI}function h(t,e){return t.map((t,n)=>{const o=(0,l.normalizeColor)(t);if(e&&e[n]){return`${o} ${100*Math.max(0,Math.min(1,e[n]))}%`}return o})}},1062,[6,11,13,1063]); 1156__d(function(_g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.normalizeColor=function(e,r=1){if(null==e)return;if('string'==typeof e&&n(e))return e;const o=(0,t.default)(e);if('number'==typeof o){return`rgba(${o>>16&255},${o>>8&255},${255&o},${((o>>24&255)/255*r).toFixed(2)})`}};var e,r=_r(d[0]),t=(e=r)&&e.__esModule?e:{default:e};const n=e=>'currentcolor'===e||'currentColor'===e||'inherit'===e||0===e.indexOf('var(')},1063,[33]); 1157__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var t=r(d[1]),n=r(d[2]);function u(){return(0,n.jsx)(t.WorkbenchTab,{})}},1064,[11,1065,6]); 1158__d(function(g,_r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.WorkbenchTab=function(){const e='phone'===(0,d.useLayoutMode)(),{width:A,height:z}=(0,l.default)(),[I,M]=(0,t.useState)(null),[L,H]=(0,t.useState)([]),[W,Y]=(0,t.useState)([]),[$,D]=(0,t.useState)(null),[O,B]=(0,t.useState)(null),[N,q]=(0,t.useState)(''),[G,U]=(0,t.useState)('saved'),[V,F]=(0,t.useState)(0),[K,J]=(0,t.useState)(null),[Q,X]=(0,t.useState)(null),[Z,ee]=(0,t.useState)(null),[te,ie]=(0,t.useState)(null),[ne,se]=(0,t.useState)({}),[re,le]=(0,t.useState)(null),[de,oe]=(0,t.useState)(0),[ae,ce]=(0,t.useState)(null),[ue,ge]=(0,t.useState)(null),[we,he]=(0,t.useState)(null),pe=(0,t.useRef)({}),fe=(0,t.useRef)(null),me=(0,t.useRef)(null),ye=(0,t.useRef)(0),be=(0,t.useRef)(!1),{available:xe,measure:Ce}=E(me,z);(0,t.useEffect)(()=>{(0,w.installHub)();const e=(0,h.installScrollRule)();return()=>{(0,w.uninstallHub)(),e()}},[]);const ke=(0,t.useCallback)((e,t)=>{le({text:e,undo:t}),setTimeout(()=>le(t=>t&&t.text===e?null:t),t?6e3:3500)},[]),je=(0,t.useCallback)(e=>{D(e),B(T(e)),ye.current=e.version,be.current=!1,ie(null),(0,c.writeStore)('workbench','last',{id:e.id})},[]);(0,t.useEffect)(()=>{(async()=>{try{const[e,t,i]=await Promise.all([p.wsApi.registry(),p.wsApi.templates(),p.wsApi.list()]);M(e),H(t.templates),Y(i.workspaces);const n=(0,c.readStore)('workbench','last').id,s=i.workspaces.find(e=>e.id===n)||i.workspaces[0];s&&je(s)}catch(e){q(S(e))}})()},[je]),(0,t.useEffect)(()=>{let e=null;const t=async()=>{try{const t=await(0,o.api)('/api/screener/status');t?.as_of&&t.as_of!==e&&(e&&((0,w.nextReading)(),F(e=>e+1)),e=t.as_of,J(t.as_of))}catch{}};t();const i=setInterval(t,6e4);return()=>clearInterval(i)},[]);const ve=(0,t.useCallback)(e=>{B(t=>t?(be.current=!0,e(t)):t)},[]);(0,t.useEffect)(()=>{if(!$||!O||!be.current)return;U('saving');const e=setTimeout(async()=>{try{const e=await p.wsApi.save($.id,O,ye.current);ye.current=e.version,be.current=!1,U('saved'),Y(t=>t.map(t=>
1158t.id===e.id?e:t))}catch(e){if(409===e?.status){const e=await p.wsApi.list();Y(e.workspaces);const t=e.workspaces.find(e=>e.id===$.id);t&&je(t),ke('This workspace changed in another window \u2014 the newer copy is loaded.'),U('saved')}else U('error'),ke(S(e))}},_);return()=>clearTimeout(e)},[O,$,je,ke]);const Se=O?.widgets||[],Te=(0,t.useCallback)(e=>I?.widgets.find(t=>t.type===e),[I]),Re=e=>e.map((e,t)=>({...e,position:t})),Pe=e=>{he(e),setTimeout(()=>he(t=>t===e?null:t),1600)},Ee=(e,t)=>{const i=Te(e);if(!i)return;const n={widget_id:v(),widget_type:e,position:0,size:i.size,height:i.height,follow_workspace:i.instrument,instrument:null,expiry:null,strike_range:null,timeframe:null,scanner_id:'screener_results'===e?'call-oi-building':null,settings:{}};ve(e=>{const i=[...e.widgets];return i.splice(null==t?i.length:Math.max(0,Math.min(t,i.length)),0,n),{...e,widgets:Re(i)}}),Pe(n.widget_id),ke(`Added ${i.label} \u2014 the layout re-balanced.`)},Ae=(e,t)=>ve(i=>({...i,widgets:i.widgets.map(i=>i.widget_id===e?{...i,...t}:i)})),ze=e=>{const t=O?.widgets||[],i=t.find(t=>t.widget_id===e);ve(t=>({...t,widgets:Re(t.widgets.filter(t=>t.widget_id!==e))})),te===e&&ie(null),ke(`Removed ${Te(i?.widget_type||'')?.label||'widget'}.`,()=>ve(e=>({...e,widgets:Re(t)})))},Ie=e=>{const t=v();ve(i=>{const n=i.widgets.findIndex(t=>t.widget_id===e);if(n<0)return i;const s={...i.widgets[n],widget_id:t,settings:{...i.widgets[n].settings}},r=[...i.widgets];return r.splice(n+1,0,s),{...i,widgets:Re(r)}}),Pe(t)},Me=(0,t.useCallback)(e=>ve(t=>({...t,selected:e})),[ve]),Le=(0,t.useCallback)(e=>ve(t=>{const i=t.widgets.findIndex(e=>'screener_results'===e.widget_type);if(i>=0)return{...t,widgets:t.widgets.map((t,n)=>n===i?{...t,scanner_id:e}:t)};const n={widget_id:v(),widget_type:'screener_results',position:0,size:'M',height:'tall',follow_workspace:!1,instrument:null,expiry:null,strike_range:null,timeframe:null,scanner_id:e,settings:{}};return{...t,widgets:Re([n,...t.widgets])}}),[ve]),He=e=>ve(t=>({...t,layout:{columns:e}})),We=e=>{fe.current={id:e,over:null,side:'before'},ce(fe.current)},Ye=(e,t)=>{let i=null,n='before';for(const[s,r]of Object.entries(pe.current)){const l=r?.getBoundingClientRect?.();if(l&&e>=l.left&&e<=l.right&&t>=l.top&&t<=l.bottom){i=s,n=e<l.left+l.width/2?'before':'after';break}}const s=fe.current;s&&(s.over===i&&s.side===n||(fe.current={...s,over:i,side:n},ce(fe.current)))},$e=()=>{const e=fe.current;var t,i,n;fe.current=null,ce(null),e?.over&&e.over!==e.id&&(t=e.id,i=e.over,n=e.side,ve(e=>{const s=e.widgets.findIndex(e=>e.widget_id===t);if(s<0||t===i)return e;const r=[...e.widgets],[l]=r.splice(s,1);let d=r.findIndex(e=>e.widget_id===i);return d<0?e:('after'===n&&(d+=1),r.splice(d,0,l),{...e,widgets:Re(r)})}))},De=(e,t,i,n)=>{n?i&&ge(n=>{const s=n||{};return s[e]===i[0]&&s[t]===i[1]?n:{...s,[e]:i[0],[t]:i[1]}}):(ge(null),i&&ve(n=>({...n,widgets:n.widgets.map(n=>n.widget_id===e?{...n,size:i[0]}:n.widget_id===t?{...n,size:i[1]}:n)})))},Oe=(0,t.useMemo)(()=>O?{selected:O.selected,select:Me,seq:V,asOf:K,strike:Q,setStrike:X,widgets:O.widgets,openScanner:Le}:null,[O,Me,V,K,Q,Le]),Be=O?.layout?.columns||'auto',Ne=(0,t.useMemo)(()=>(0,b.layout)(Se.map(e=>({id:e.widget_id,size:ue?.[e.widget_id]||e.size,tall:'tall'===e.height,min:I?.widgets.find(t=>t.type===e.widget_type)?.min_width||0})),{width:de||A-48,viewport:xe,gap:k,columns:Be,phone:e}),[Se,ue,de,A,xe,Be,e,I]);if(N)return(0,C.jsx)(r.default,{style:{padding:24},children:(0,C.jsx)(d.Empty,{icon:"alert-circle",title:"The workspace could not load",detail:N})});if(!(I&&$&&O&&Oe))return(0,C.jsx)(d.Loading,{});const qe=Object.fromEntries(Se.map(e=>[e.widget_id,e])),Ge=O.selected,Ue=Ge.focus,Ve='settings'===Z?.kind?Se.find(e=>e.widget_id===Z.id):null,Fe=te?Se.find(e=>e.widget_id===te):null,Ke=(t,i,n,s,r,l=!1)=>{const d=Te(t.widget_type);return d?(0,C.jsx)(y.Tile,{w:t,spec:d,weight:i.weight,minWidth:i.min,height:n,phone:e,next:s,flash:we===t.widget_id,dragging:ae?.id===t.widget_id,drop:ae&&ae.over===t.widget_id&&ae.id!==t.widget_id?ae.side:null,register:(e,t)=>{l||(t?pe.current[e]=t:delete pe.current[e])},onDragStart:We,onDragMove:Ye,onDragEnd:$e,onEdge:De,onPatch:e=>Ae(t.widget_id,e),onSettings:()=>ee({kind:'settings',id:t.widget_id}),onExpand:()=>ie(e=>e===t.widget_id?null:t.widget_id),onRemove:()=>ze(t.widget_id),collapsed:e&&!!ne[t.widget_id],onCollapse:()=>se(e=>({...e,[t.widget_id]:!e[t.widget_id]})),expandedView:l,eager:r},t.widget_id+(l?'-x':'')):null};return(0,C.jsxs)(u.Ctx.Provider,{value:Oe,children:[(0,C.jsxs)(r.default,{dataSet:{kwRoot:'1'},style:{flex:1,paddingHorizontal:e?12:24,paddingTop:e?10:16,paddingBottom:24,gap:12,backgroundColor:d.C.bg},children:[(0,C.jsxs)(r.default,{onLayout:Ce,style:[d.s.row,{flexWrap:'wrap',gap:10,minHeight:36},e&&j?{position:'sticky',top:0,zIndex:5,backgroundColor:d.C.bg,paddingVertical:8,marginTop:-8}:null],children:[(0,C.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Workspace: ${O.name}. Switch or manage`,onPress:()=>ee({kind:'menu'}),style:({pressed:e})=>[d.s.row,{gap:4,opacity:e?.7:1}],children:[(0,C.jsx)(d.T,{style:x.TYPE.page,children:O.name}),(0,C.jsx)(d.Icon,{name:"chevron-down",size:15,color:d.C.muted})]}),(0,C.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Selected instrument ${Ge.underlying||'none'}. Change`,onPress:()=>ee({kind:'instrument'}),style:({pressed:e})=>[d.s.row,{gap:6,paddingHorizontal:10,height:30,borderRadius:8,borderWidth:1,borderColor:d.C.green,backgroundColor:d.C.soft,opacity:e?.7:1}],children:[(0,C.jsx)(r.default,{style:{width:6,height:6,borderRadius:3,backgroundColor:d.C.green}}),(0,C.jsx)(d.T,{style:[x.TYPE.title,{color:d.C.green}],children:Ge.underlying||'Pick an instrument'}),!!Ge.expiry&&(0,C.jsx)(d.T,{style:x.TYPE.helper,children:Ge.expiry}),(0,C.jsx)(d.Icon,{name:"chevron-down",size:12,color:d.C.green})]}),Ue&&(0,C.jsxs)(r.default,{style:[d.s.row,{gap:6,paddingHorizontal:10,height:30,borderRadius:8,backgroundColor:d.C.dark,maxWidth:520,flexShrink:1}],children:[(0,C.jsx)(d.Icon,{name:"crosshair",size:12,color:d.C.amber}),(0,C.jsxs)(d.T,{numberOfLines:1,style:[x.TYPE.helper,{color:d.C.ink,flexShrink:1}],children:[Ue.source?`${Ue.source} \xb7 `:'',Ue.strikes.length?`${Ue.strikes.map(e=>
1158e.toLocaleString('en-IN')).join(', ')} ${Ue.side||''} \xb7 `:'',Ue.from?`since ${Ue.from}`:'']}),(0,C.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Clear the focus",onPress:()=>Me({...Ge,focus:null}),children:(0,C.jsx)(d.Icon,{name:"x",size:12,color:d.C.muted})})]}),(0,C.jsx)(r.default,{style:{flex:1,minWidth:8}}),!e&&(0,C.jsxs)(r.default,{accessibilityLabel:"Widgets per row",style:[d.s.row,{height:30,borderRadius:8,borderWidth:1,borderColor:d.C.line,overflow:'hidden'}],children:[(0,C.jsx)(d.T,{style:[x.TYPE.helper,{paddingHorizontal:8}],children:"Per row"}),R.map(e=>(0,C.jsx)(s.default,{accessibilityRole:"button",accessibilityState:{selected:Be===e},accessibilityLabel:'auto'===e?'As many as fit':`At most ${e} per row`,onPress:()=>He(e),style:{paddingHorizontal:9,height:30,justifyContent:'center',backgroundColor:Be===e?d.C.soft:'transparent',borderLeftWidth:1,borderColor:d.C.line},children:(0,C.jsx)(d.T,{style:[x.TYPE.helper,{color:Be===e?d.C.green:d.C.ink}],children:'auto'===e?'Auto':e})},String(e)))]}),(0,C.jsxs)(d.T,{style:[x.TYPE.helper,{color:'error'===G?d.C.red:d.C.muted}],children:['saving'===G?'Saving\u2026':'error'===G?'Not saved':'Saved',K?` \xb7 ${K.slice(11,16)}`:'']}),(0,C.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:"Add widget",onPress:()=>ee({kind:'add'}),style:({pressed:e})=>[d.s.row,{gap:6,paddingHorizontal:12,height:30,borderRadius:8,backgroundColor:d.C.green,opacity:e?.8:1}],children:[(0,C.jsx)(d.Icon,{name:"plus",size:14,color:d.C.onGreen}),(0,C.jsx)(d.T,{style:[x.TYPE.title,{color:d.C.onGreen}],children:"Add widget"})]})]}),Se.length?(0,C.jsxs)(r.default,{ref:me,onLayout:e=>{oe(e.nativeEvent.layout.width),Ce()},style:{gap:0},children:[Ne.map((t,n)=>{const s=(l=t.items[0].id,Se.findIndex(e=>e.widget_id===l));var l;return(0,C.jsxs)(i.default.Fragment,{children:[n>0&&!e&&(0,C.jsx)(P,{onPress:()=>ee({kind:'add',at:s})}),n>0&&e&&(0,C.jsx)(r.default,{style:{height:k}}),(0,C.jsx)(r.default,{style:{flexDirection:'row',gap:k,height:e&&ne[t.items[0].id]?void 0:t.height},children:t.items.map((e,i)=>{const s=qe[e.id];if(!s)return null;const r=t.items[i+1];return Ke(s,e,t.height,r?qe[r.id]:null,n<2)})})]},t.items.map(e=>e.id).join('|'))}),!e&&(0,C.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:"Add a widget at the end",onPress:()=>ee({kind:'add'}),style:({hovered:e})=>[d.s.row,{gap:6,alignSelf:'flex-start',marginTop:k,paddingHorizontal:8,height:28,borderRadius:7,backgroundColor:e?d.C.dark:'transparent'}],children:[(0,C.jsx)(d.Icon,{name:"plus",size:12,color:d.C.green}),(0,C.jsx)(d.T,{style:[x.TYPE.helper,{color:d.C.green}],children:"Add widget"})]})]}):(0,C.jsx)(d.Empty,{icon:"grid",title:"An empty workspace",detail:"Add a screener to find something, then the widgets you want to investigate it with.",action:(0,C.jsxs)(r.default,{style:[d.s.row,{gap:10,flexWrap:'wrap',justifyContent:'center'}],children:[(0,C.jsx)(d.Button,{label:"Add widget",icon:"plus",onPress:()=>ee({kind:'add'})}),(0,C.jsx)(d.Button,{label:"Start from a template",kind:"outline",onPress:()=>ee({kind:'menu'})})]})}),!!ae&&(0,C.jsx)(d.T,{style:[x.TYPE.helper,{textAlign:'center'}],children:"Drop on the left or right half of a widget to place it there."}),!!re&&(0,C.jsxs)(r.default,{style:[d.s.row,{position:'absolute',bottom:24,alignSelf:'center',gap:12,backgroundColor:d.C.paper,borderColor:d.C.green,borderWidth:1,borderRadius:10,paddingHorizontal:14,height:40}],children:[(0,C.jsx)(d.T,{style:x.TYPE.body,children:re.text}),re.undo&&(0,C.jsx)(s.default,{accessibilityRole:"button",onPress:()=>{re.undo(),le(null)},children:(0,C.jsx)(d.T,{style:[x.TYPE.title,{color:d.C.green}],children:"Undo"})})]})]}),Fe&&(0,C.jsx)(n.default,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:()=>ie(null),children:(0,C.jsx)(r.default,{dataSet:{kwRoot:'1'},style:{flex:1,backgroundColor:d.C.scrimStrong,padding:e?8:28},children:Ke(Fe,{weight:1,min:0},0,null,!0,!0)})}),'add'===Z?.kind&&(0,C.jsx)(f.AddWidgetSheet,{registry:I,onAdd:e=>Ee(e,Z.at),onClose:()=>ee(null)}),'instrument'===Z?.kind&&(0,C.jsx)(f.InstrumentSheet,{value:Ge.underlying,onPick:e=>Me({underlying:e,expiry:null,focus:null}),onClose:()=>ee(null)}),'menu'===Z?.kind&&(0,C.jsx)(f.WorkspaceMenu,{workspaces:W,current:$,templates:L,onOpen:e=>{const t=W.find(t=>
1158t.id===e);t&&je(t)},onCreate:async e=>{try{const t=await p.wsApi.create(e);Y(e=>[...e,t]),je(t),ke(`Created \u201c${t.name}\u201d.`)}catch(e){ke(S(e))}},onRename:e=>ve(t=>({...t,name:e})),onDuplicate:async()=>{if($)try{const e=await p.wsApi.duplicate($.id);Y(t=>[...t,e]),je(e),ke(`Created \u201c${e.name}\u201d.`)}catch(e){ke(S(e))}},onDelete:async()=>{if($)try{const e=await p.wsApi.remove($.id);Y(e.workspaces),e.workspaces[0]&&je(e.workspaces[0]),ke(`Deleted \u201c${$.name}\u201d.`)}catch(e){ke(S(e))}},onClose:()=>ee(null)}),Ve&&Te(Ve.widget_type)&&(0,C.jsx)(f.SettingsSheet,{w:Ve,spec:Te(Ve.widget_type),selectedSymbol:Ge.underlying,onPatch:e=>Ae(Ve.widget_id,e),onDuplicate:()=>Ie(Ve.widget_id),onMove:e=>{return t=Ve.widget_id,i=e,ve(e=>{const n=e.widgets.findIndex(e=>e.widget_id===t),s=n+i;if(n<0||s<0||s>=e.widgets.length)return e;const r=[...e.widgets];return[r[n],r[s]]=[r[s],r[n]],{...e,widgets:Re(r)}});var t,i},onRemove:()=>ze(Ve.widget_id),onClose:()=>ee(null),canUp:Se.indexOf(Ve)>0,canDown:Se.indexOf(Ve)<Se.length-1})]})};var t=_r(_d[0]),i=e(t),n=e(_r(_d[1]));_r(_d[2]);var s=e(_r(_d[3])),r=e(_r(_d[4])),l=e(_r(_d[5])),d=_r(_d[6]),o=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),w=_r(_d[10]),h=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]),b=_r(_d[15]),x=_r(_d[16]),C=_r(_d[17]);const k=x.CHROME.gutter,_=800,j=!0,v=()=>Math.random().toString(36).slice(2,12),S=e=>e?.message||'KANIDA could not complete that.',T=e=>({name:e.name,selected:e.selected,widgets:e.widgets,layout:e.layout||{columns:'auto'}}),R=['auto',2,3,4,5];function P({onPress:e}){const[i,n]=(0,t.useState)(!1);return(0,C.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Add a widget here",onPress:e,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{height:k,alignItems:'center',justifyContent:'center',zIndex:2},children:i&&(0,C.jsxs)(r.default,{style:[d.s.row,{gap:4,paddingHorizontal:10,height:22,borderRadius:11,backgroundColor:d.C.soft,borderWidth:1,borderColor:d.C.green}],children:[(0,C.jsx)(d.Icon,{name:"plus",size:11,color:d.C.green}),(0,C.jsx)(d.T,{style:[x.TYPE.helper,{color:d.C.green,lineHeight:14}],children:"Add widget here"})]})})}function E(e,i){const[n,s]=(0,t.useState)(190),r=(0,t.useCallback)(()=>{const t=e.current;if(!t?.getBoundingClientRect)return;let i=0,n=t.parentElement;for(;n;)i+=n.scrollTop||0,n=n.parentElement;s(Math.max(80,Math.round(t.getBoundingClientRect().top+i)))},[e]);return{available:Math.max(360,i-n-2*x.CHROME.gutter),measure:r}}},1065,[11,368,136,375,13,400,821,197,871,1066,1067,1068,1069,1070,1073,1106,1072,6]); 1159__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Ctx",{enumerable:!0,get:function(){return o}}),_e.useWorkspace=function(){const e=n.default.useContext(o);if(!e)throw new Error('outside a workspace');return e},_e.instrumentOf=function(e,t){return e.follow_workspace?t.underlying||'':e.instrument||''},_e.expiryOf=function(e,t){return e.expiry?e.expiry:e.follow_workspace&&t.expiry||''};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};const o=n.default.createContext(null)},1066,[11]); 1160__d(function(g,_r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"hubStats",{enumerable:!0,get:function(){return u}}),_e.installHub=function(){if(r++,r>1||'function'!=typeof globalThis.fetch)return;o=globalThis.fetch.bind(globalThis),globalThis.fetch=(r,b)=>{const p=(b?.method||('string'==typeof r||r instanceof URL?'GET':r.method)||'GET').toUpperCase(),v=f(r);if('GET'!==p||!e.test(v)||t.test(v))return o(r,b);const E=l.get(v);if(E&&E.epoch===s)return u.cached++,h(Promise.resolve(E.res.clone()),b?.signal);let w=c.get(v);if(w)u.shared++;else{u.network++;const e=s,{signal:t,...f}=b||{};w=o(r,f).then(t=>(c.delete(v),t.ok&&e===s&&(l.set(v,{epoch:e,res:t.clone()}),l.size>n&&l.delete(l.keys().next().value)),t),e=>{throw c.delete(v),e}),c.set(v,w)}return h(w.then(e=>e.clone()),b?.signal)}},_e.uninstallHub=function(){r=Math.max(0,r-1),0===r&&o&&(globalThis.fetch=o,o=null,l.clear(),c.clear())},_e.nextReading=function(){s++,l.clear()};const e=/\/api\/(derivatives|screener|workspace)\//,t=/\/status\b|\/alerts\b/,n=240;let r=0,o=null,s=0;const c=new Map,l=new Map,u={network:0,shared:0,cached:0};function f(e){return'string'==typeof e?e:e instanceof URL?e.href:e.url}function h(e,t){return t?t.aborted?Promise.reject(new DOMException('Aborted','AbortError')):new Promise((n,r)=>{const o=()=>r(new DOMException('Aborted','AbortError'));t.addEventListener('abort',o,{once:!0}),e.then(e=>{t.removeEventListener('abort',o),n(e)},e=>{t.removeEventListener('abort',o),r(e)})}):e}},1067,[]); 1161__d(function(g,r,i,a,m,e,d){"use strict";
1161Object.defineProperty(e,'__esModule',{value:!0}),e.installScrollRule=function(){if('undefined'==typeof document)return()=>{};if(document.getElementById(o))return()=>{};const t=document.createElement('style');return t.id=o,t.textContent=n(),document.head.appendChild(t),()=>{t.remove()}},r(d[0]);var t=r(d[1]);const o='kanida-workspace-scroll',n=()=>`\n[data-kw-root] *{scrollbar-width:thin;scrollbar-color:transparent transparent}\n[data-kw-root] *:hover{scrollbar-color:${t.C.lineHover} transparent}\n[data-kw-root] *::-webkit-scrollbar{width:4px;height:0;background:transparent}\n[data-kw-root] *::-webkit-scrollbar-track{background:transparent}\n[data-kw-root] *::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}\n[data-kw-root] *:hover::-webkit-scrollbar-thumb{background:${t.C.lineHover}}\n[data-kw-root] [data-kw-tile] *{overscroll-behavior:contain}\n`},1068,[136,821]); 1162__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"wsApi",{enumerable:!0,get:function(){return s}});var p=r(d[0]);const s={registry:()=>(0,p.api)('/api/workspace/registry'),templates:()=>(0,p.api)('/api/workspace/templates'),list:()=>(0,p.api)('/api/workspace/workspaces'),create:(s,t)=>(0,p.api)('/api/workspace/workspaces',{template:s,name:t}),save:(s,t,c)=>(0,p.api)(`/api/workspace/workspaces/${s}`,{definition:t,version:c}),duplicate:s=>(0,p.api)(`/api/workspace/workspaces/${s}/duplicate`,{}),remove:s=>(0,p.api)(`/api/workspace/workspaces/${s}/delete`,{}),summary:s=>(0,p.api)('/api/workspace/summary',s)}},1069,[197]); 1163__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.useUnderlyings=w,_e.InstrumentSheet=function({value:e,onPick:t,onClose:s}){return(0,h.jsx)(o.Sheet,{visible:!0,onClose:s,title:"Point the workspace at",subtitle:"Every widget that follows the workspace moves with it",children:(0,h.jsx)(C,{value:e,onPick:e=>{t(e),s()}})})},_e.AddWidgetSheet=function({registry:e,onAdd:c,onClose:u}){const[x,y]=(0,t.useState)(''),b=x.trim().toLowerCase(),j=e.widgets.filter(e=>!b||e.label.toLowerCase().includes(b)||e.blurb.toLowerCase().includes(b)||e.category.toLowerCase().includes(b));return(0,h.jsxs)(o.Sheet,{visible:!0,onClose:u,title:"Add widget",subtitle:"Each one is backed by live KANIDA data \u2014 add the same one twice to compare",children:[(0,h.jsx)(l.default,{value:x,onChangeText:y,placeholder:"Search \u2014 e.g. IV, chain, alerts",placeholderTextColor:o.C.muted,autoFocus:!0,accessibilityLabel:"Search widgets",style:o.s.input}),e.categories.map(e=>{const t=j.filter(t=>t.category===e);return t.length?(0,h.jsxs)(n.default,{style:{gap:6},children:[(0,h.jsx)(o.T,{style:p.TYPE.label,children:e}),t.map(e=>(0,h.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Add ${e.label}`,onPress:()=>{c(e.type),u()},style:({pressed:e,hovered:t})=>[o.s.row,{gap:12,padding:12,borderRadius:12,borderWidth:1,borderColor:t?o.C.green:o.C.line,backgroundColor:o.C.paper,opacity:e?.7:1}],children:[(0,h.jsxs)(n.default,{style:{flex:1,gap:3},children:[(0,h.jsxs)(n.default,{style:[o.s.row,{gap:8}],children:[(0,h.jsx)(o.T,{style:p.TYPE.title,children:e.label}),e.instrument?(0,h.jsx)(o.Badge,{label:"FOLLOWS",tone:"green"}):(0,h.jsx)(o.Badge,{label:"SETS THE INSTRUMENT",tone:"neutral"})]}),(0,h.jsx)(o.T,{style:[p.TYPE.body,{color:o.C.muted}],children:e.blurb})]}),(0,h.jsx)(o.Icon,{name:"plus",size:16,color:o.C.green})]},e.type))]},e):null}),!j.length&&(0,h.jsxs)(o.T,{style:{color:o.C.muted},children:["No widget matches \u201c",x,"\u201d."]})]})},_e.SettingsSheet=function({w:e,spec:s,selectedSymbol:l,onPatch:w,onDuplicate:v,onMove:P,onRemove:T,onClose:k,canUp:S,canDown:E}){const[_,A]=(0,t.useState)(!1),R=e.follow_workspace?l:e.instrument,L=(0,c.useDerivativeRead)(s.settings.expiry?'/api/derivatives/filters':null,0),M=R&&L.data?(0,u.expiriesFor)(L.data.expiries||[],R).slice(0,2):[],D=(0,c.useDerivativeRead)(s.settings.scanner_id?'/api/screener/scanners':null,0),Y=(t,s)=>w({settings:{...e.settings,[t]:s}});return(0,h.jsxs)(o.Sheet,{visible:!0,onClose:k,title:`${s.label}
1163 settings`,subtitle:s.blurb,footer:(0,h.jsxs)(n.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,h.jsx)(o.Button,{label:"Duplicate",icon:"copy",kind:"soft",onPress:()=>{v(),k()}}),(0,h.jsx)(o.Button,{label:"Move up",icon:"arrow-up",kind:"outline",disabled:!S,onPress:()=>P(-1)}),(0,h.jsx)(o.Button,{label:"Move down",icon:"arrow-down",kind:"outline",disabled:!E,onPress:()=>P(1)}),(0,h.jsx)(o.Button,{label:"Remove",icon:"trash-2",kind:"outline",onPress:()=>{T(),k()}})]}),children:[s.instrument&&(0,h.jsxs)(f,{title:"Instrument",children:[(0,h.jsx)(j,{label:"Follow workspace"+(l?` (${l})`:''),active:e.follow_workspace,onPress:()=>{A(!1),w({follow_workspace:!0,instrument:null})}}),(0,h.jsx)(j,{label:!e.follow_workspace&&e.instrument?`Pinned to ${e.instrument}`:'Pin to an instrument\u2026',active:!e.follow_workspace,onPress:()=>A(!0)})]}),_&&(0,h.jsx)(C,{value:e.instrument,onPick:e=>{w({follow_workspace:!1,instrument:e,expiry:null}),A(!1)}}),!!s.settings.expiry&&(0,h.jsxs)(f,{title:"Expiry",children:[(0,h.jsx)(j,{label:e.follow_workspace?'Follow workspace':'Nearest',active:!e.expiry,onPress:()=>w({expiry:null})}),M.map(t=>(0,h.jsx)(j,{label:`${t.expiry}${null!=t.days_to_expiry?` \xb7 ${t.days_to_expiry}d`:''}`,active:e.expiry===t.expiry,onPress:()=>w({expiry:t.expiry})},t.expiry)),!M.length&&(0,h.jsx)(o.T,{style:[p.TYPE.body,{color:o.C.muted}],children:R?'No expiries listed for this instrument.':'Pick an instrument first.'}),!!M.length&&(0,h.jsx)(o.T,{style:[p.TYPE.helper,{color:o.C.muted,width:'100%'}],children:"KANIDA captures the front two expiries of each instrument."})]}),!!s.settings.scanner_id&&(0,h.jsx)(f,{title:"Scanner",children:(D.data?.scanners||[]).map(t=>(0,h.jsx)(j,{label:t.is_default?t.name:`${t.name} \xb7 mine`,active:e.scanner_id===t.id,onPress:()=>w({scanner_id:t.id})},t.id))}),Object.entries(s.settings).filter(([,e])=>Array.isArray(e)).map(([t,s])=>(0,h.jsx)(f,{title:b[t]||t,children:s.map(l=>(0,h.jsx)(j,{label:y[t]?.[l]||l,active:(e.settings[t]??s[0])===l,onPress:()=>Y(t,l)},l))},t)),(0,h.jsx)(f,{title:"Size",children:['S','M','L','F'].map(t=>(0,h.jsx)(j,{label:x[t],active:e.size===t,onPress:()=>w({size:t})},t))}),(0,h.jsxs)(f,{title:"Height",children:[(0,h.jsx)(j,{label:"Short",active:'short'===e.height,onPress:()=>w({height:'short'})}),(0,h.jsx)(j,{label:"Tall",active:'tall'===e.height,onPress:()=>w({height:'tall'})})]})]})},_e.WorkspaceMenu=function({workspaces:e,current:c,templates:u,onOpen:x,onCreate:y,onRename:b,onDuplicate:j,onDelete:f,onClose:w}){const[C,v]=(0,t.useState)(c.name),[P,T]=(0,t.useState)(!1);return(0,h.jsxs)(o.Sheet,{visible:!0,onClose:w,title:"Workspaces",subtitle:"Saved to your profile automatically \xb7 private to you",children:[(0,h.jsx)(n.default,{style:{gap:6},children:e.map(e=>(0,h.jsxs)(s.default,{accessibilityRole:"button",onPress:()=>{x(e.id),w()},style:({pressed:t})=>[o.s.between,{padding:12,borderRadius:10,borderWidth:1,borderColor:e.id===c.id?o.C.green:o.C.line,backgroundColor:e.id===c.id?o.C.soft:o.C.paper,opacity:t?.7:1}],children:[(0,h.jsx)(o.T,{style:{fontFamily:'InterMedium'},children:e.name}),(0,h.jsxs)(o.T,{style:[p.TYPE.helper,{color:o.C.muted}],children:[e.widgets.length," widgets"]})]},e.id))}),(0,h.jsxs)(n.default,{style:{gap:8},children:[(0,h.jsx)(o.T,{style:p.TYPE.label,children:"This workspace"}),(0,h.jsxs)(n.default,{style:[o.s.row,{gap:8}],children:[(0,h.jsx)(l.default,{value:C,onChangeText:v,maxLength:60,accessibilityLabel:"Workspace name",style:[o.s.input,{flex:1}],onSubmitEditing:()=>C.trim()&&b(C.trim())}),(0,h.jsx)(o.Button,{label:"Rename",kind:"soft",disabled:!C.trim()||C.trim()===c.name,onPress:()=>b(C.trim())})]}),(0,h.jsxs)(n.default,{style:[o.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,h.jsx)(o.Button,{label:"Duplicate",icon:"copy",kind:"outline",onPress:()=>{j(),w()}}),P?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(o.Button,{label:"Delete it",icon:"trash-2",onPress:()=>{f(),w()}}),(0,h.jsx)(o.Button,{label:"Keep",kind:"outline",onPress:()=>T(!1)})]}):(0,h.jsx)(o.Button,{label:"Delete",icon:"trash-2",kind:"outline",disabled:e.length<=1,onPress:()=>T(!0)})]})]}),(0,h.jsxs)(n.default,{style:{gap:6},children:[(0,h.jsx)(o.T,{style:p.TYPE.label,children:"New workspace from a template"}),u.map(e=>(0,h.jsxs)(s.default,{accessibilityRole:"button",onPress:()=>{y(e.key),w()},style:({pressed:e})=>({gap:3,padding:12,borderRadius:10,borderWidth:1,borderColor:o.C.line,opacity:e?.7:1}),children:[(0,h.jsx)(o.T,{style:p.TYPE.title,children:e.name}),(0,h.jsx)(o.T,{style:[p.TYPE.body,{color:o.C.muted}],children:e.description})]},e.key))]})]})};var t=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),n=e(r(d[3])),o=r(d[4]),c=r(d[5]),u=r(d[6]),p=r(d[7]),h=r(d[8]);const x={S:'Small',M:'Medium',L:'Large',F:'Full width'}
1163,y={view:{auto:'Fit to size',both:'Chart + readings',chart:'Chart only',readings:'Readings only',active:'Active',ended:'Ended today',all:'All'},atm:{2:'ATM \xb12',3:'ATM \xb13',5:'ATM \xb15'},scope:{connected:'Connected widgets only',all:'Every source'},list:{all:'All scanners',kanida:'KANIDA scanners',mine:'My scanners'}},b={view:'Show',atm:'Strikes',scope:'Read from',list:'List'};function j({label:e,active:t,onPress:l,a11y:n}){return(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityState:{selected:!!t},accessibilityLabel:n||e,onPress:l,style:({pressed:e})=>({paddingHorizontal:12,paddingVertical:8,borderRadius:9,borderWidth:1,borderColor:t?o.C.green:o.C.line,backgroundColor:t?o.C.soft:o.C.paper,opacity:e?.7:1}),children:(0,h.jsx)(o.T,{style:[p.TYPE.body,{color:t?o.C.green:o.C.ink}],children:e})})}const f=({title:e,children:t})=>(0,h.jsxs)(n.default,{style:{gap:8},children:[(0,h.jsx)(o.T,{style:p.TYPE.label,children:e}),(0,h.jsx)(n.default,{style:[o.s.row,{flexWrap:'wrap',gap:8}],children:t})]});function w(){const e=(0,c.useDerivativeRead)('/api/screener/vocabulary',0),s=e.data?.underlyings||[],l=e.data?.index_underlyings||[];return(0,t.useMemo)(()=>[...l.filter(e=>s.includes(e)),...s.filter(e=>!l.includes(e))],[s,l])}function C({value:e,onPick:s}){const c=w(),[u,p]=(0,t.useState)(''),x=c.filter(e=>!u.trim()||e.includes(u.trim().toUpperCase())).slice(0,80);return(0,h.jsxs)(n.default,{style:{gap:10},children:[(0,h.jsx)(l.default,{value:u,onChangeText:p,placeholder:"Search NIFTY, BANKNIFTY, RELIANCE\u2026",placeholderTextColor:o.C.muted,autoCapitalize:"characters",accessibilityLabel:"Search instruments",style:o.s.input}),(0,h.jsx)(n.default,{style:[o.s.row,{flexWrap:'wrap',gap:6}],children:x.map(t=>(0,h.jsx)(j,{label:t,active:e===t,onPress:()=>s(t)},t))})]})}},1070,[11,375,385,13,821,1071,984,1072,6]); 1164__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useDerivativeRead=function(n,u=0){const[o,s]=(0,e.useState)({path:'',data:null,error:'',phase:'idle'}),c=(0,e.useRef)(0),l=(0,e.useRef)(null),d=(0,e.useCallback)(()=>{const e=++c.current;if(l.current?.abort(),!n)return l.current=null,void s({path:'',data:null,error:'',phase:'idle'});const u=new AbortController;l.current=u,s({path:n,data:null,error:'',phase:'loading'}),(0,t.api)(n,void 0,void 0,u.signal).then(t=>{e===c.current&&s({path:n,data:t,error:'',phase:'done'})},t=>{e!==c.current||u.signal.aborted||s({path:n,data:null,error:t?.message||'Unable to load',phase:'error'})})},[n]);(0,e.useEffect)(()=>(d(),()=>{c.current++,l.current?.abort(),l.current=null}),[d,u]);const f=o.path===(n||'');return{data:f?o.data:null,error:f?o.error:'',phase:f?o.phase:n?'loading':'idle',reload:d}},Object.defineProperty(_e,"LIVE_POLL_MS",{enumerable:!0,get:function(){return n}}),_e.readingAdvanced=u,_e.useFollowLatest=function(o,s){const c=(0,e.useRef)(''),l=(0,e.useRef)(s);l.current=s,(0,e.useEffect)(()=>{if(!o)return;let e=!0;const s=()=>{(0,t.api)('/api/derivatives/status').then(t=>{if(!e)return;const n=String(t?.as_of||'');u(c.current,n)&&l.current(),n&&(c.current=n)},()=>{})};s();const d=setInterval(s,n),f=()=>{'undefined'!=typeof document&&'visible'===document.visibilityState&&s()};return'undefined'!=typeof document&&document.addEventListener('visibilitychange',f),()=>{e=!1,clearInterval(d),'undefined'!=typeof document&&document.removeEventListener('visibilitychange',f)}},[o])};var e=r(_d[0]),t=r(_d[1]);const n=1e4;function u(e,t){return!!e&&!!t&&t!==e}},1071,[11,197]); 1165__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TYPE",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"CHROME",{enumerable:!0,get:function(){return o}});var t=r(d[0]);const n={page:{fontFamily:'ManropeBold',fontSize:20,lineHeight:28,letterSpacing:-.3,color:t.C.ink},title:{fontFamily:'InterSemi',fontSize:13,lineHeight:18,color:t.C.ink},label:{fontFamily:'InterMedium',fontSize:10,lineHeight:14,letterSpacing:.6,textTransform:'uppercase',color:t.C.muted},body:{fontFamily:'Inter',fontSize:12,lineHeight:18,color:t.C.ink},helper:{fontFamily:'Inter',fontSize:11,lineHeight:16,color:t.C.muted},metric:{fontFamily:'InterSemi',fontSize:15,lineHeight:20,color:t.C.ink,fontVariant:['tabular-nums']}}
1165,o={header:40,pad:12,gap:8,radius:12,border:1,gutter:12,control:28,icon:14}},1072,[821]); 1166__d(function(_g,_r,i,a,m,_e2,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e2,'__esModule',{value:!0}),_e2.Tile=function(e){const{w:r,spec:d,weight:h,minWidth:p,height:v,phone:y,dragging:j,drop:E,flash:P,next:S,expandedView:M,collapsed:O}=e,_=(0,u.useWorkspace)(),H=(0,t.useRef)(null),k=C(H,!!e.eager||!!M),[I,L]=(0,t.useState)(!1),[T,z]=(0,t.useState)(0),B=d.instrument?(0,u.instrumentOf)(r,_.selected):'',$=(0,t.useRef)(e);$.current=e;const D=(0,t.useRef)(n.default.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderGrant:()=>$.current.onDragStart($.current.w.widget_id),onPanResponderMove:e=>$.current.onDragMove(e.nativeEvent.pageX,e.nativeEvent.pageY),onPanResponderRelease:()=>$.current.onDragEnd(),onPanResponderTerminate:()=>$.current.onDragEnd()})).current,W=(0,t.useRef)({left:0,right:0}),G=(0,t.useRef)(n.default.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderGrant:()=>{const e=H.current?.getBoundingClientRect?.(),t=H.current?.nextElementSibling?.getBoundingClientRect?.();W.current={left:e?.width||0,right:t?.width||0}},onPanResponderMove:(e,t)=>{const n=$.current.next;if(!n)return;const{left:r,right:o}=W.current,s=Math.max(40,r+t.dx),l=Math.max(40,o-t.dx);$.current.onEdge($.current.w.widget_id,n.widget_id,R(s,l),!0)},onPanResponderRelease:(e,t)=>{const n=$.current.next;if(!n)return;const{left:r,right:o}=W.current;$.current.onEdge($.current.w.widget_id,n.widget_id,R(r+t.dx,o-t.dx),!1)},onPanResponderTerminate:()=>{const e=$.current.next;e&&$.current.onEdge($.current.w.widget_id,e.widget_id,null,!1)}})).current;(0,t.useEffect)(()=>{P&&x&&H.current?.scrollIntoView?.({block:'nearest',behavior:'smooth'})},[P]);const Y=c.BODIES[r.widget_type],F=M?900:v-g.CHROME.header,V=T||600,N=Y?b((0,f.jsx)(Y,{w:r,spec:d,width:V,height:F,expanded:!!M,onPatch:e.onPatch,openSettings:e.onSettings})):null,X=T>0&&T<340,q=d.instrument?r.follow_workspace?(0,f.jsxs)(s.default,{accessibilityLabel:"Follows the workspace"+(B?`: ${B}`:''),style:[l.s.row,{gap:4,paddingHorizontal:6,height:20,borderRadius:6,backgroundColor:l.C.soft,flexShrink:0}],children:[(0,f.jsx)(l.Icon,{name:"link",size:10,color:l.C.green}),!X&&(0,f.jsx)(l.T,{style:[g.TYPE.helper,{color:l.C.green,lineHeight:14}],children:B||'follows'})]}):(0,f.jsxs)(s.default,{accessibilityLabel:`Pinned to ${B}`,style:[l.s.row,{gap:4,paddingHorizontal:6,height:20,borderRadius:6,backgroundColor:l.C.amberBg,flexShrink:0}],children:[(0,f.jsx)(l.Icon,{name:"map-pin",size:10,color:l.C.amber}),!X&&(0,f.jsx)(l.T,{style:[g.TYPE.helper,{color:l.C.amber,lineHeight:14}],children:B})]}):null,A=P?l.C.green:l.C.line;return(0,f.jsxs)(s.default,{ref:t=>{H.current=t,e.register(r.widget_id,t)},onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width);z(e=>e===t?e:t)},style:{flexGrow:y||M?void 0:h,flexShrink:1,flexBasis:y||M?void 0:0,minWidth:y||M?void 0:p,width:y?'100%':void 0,height:M?void 0:O?g.CHROME.header+2:v,flex:M?1:void 0,borderRadius:g.CHROME.radius,borderWidth:g.CHROME.border,borderColor:A,backgroundColor:l.C.paper,overflow:'hidden',opacity:j?.4:1,transition:'border-color .6s ease, opacity .15s ease'},children:[(0,f.jsxs)(s.default,{style:[l.s.row,{height:g.CHROME.header,paddingLeft:4,paddingRight:6,gap:6,borderBottomWidth:O?0:1,borderColor:l.C.line}],children:[y||M?(0,f.jsx)(s.default,{style:{width:8}}):(0,f.jsx)(s.default,{...D.panHandlers,accessibilityLabel:`Drag ${d.label} to move it`,style:{width:20,height:g.CHROME.control,alignItems:'center',justifyContent:'center',cursor:'grab'},children:(0,f.jsx)(l.Icon,{name:"more-vertical",size:13,color:l.C.muted})}),(0,f.jsx)(l.T,{numberOfLines:1,role:"heading","aria-level":3,style:[g.TYPE.title,{flexShrink:1}],children:d.label}),q,(0,f.jsx)(s.default,{style:{flex:1}}),y&&e.onCollapse&&(0,f.jsx)(w,{icon:O?'chevron-down':'chevron-up',label:O?'Show':'Collapse',onPress:e.onCollapse}),(0,f.jsx)(w,{icon:"settings",label:`${d.label} settings`,onPress:e.onSettings}),(0,f.jsx)(w,{icon:M?'minimize-2':'maximize-2',label:M?'Close full screen':`Expand ${d.label}`,onPress:e.onExpand}),!M&&(0,f.jsx)(w,{icon:"x",label:`Remove ${d.label}`,onPress:e.onRemove})]}),!O&&(k?c.FIT.has(r.widget_type)&&!M?(0,f.jsx)(s.default,{style:{flex:1,minHeight:0,padding:g.CHROME.pad,overflow:'hidden'},children:N}):c.SELF_SCROLLING.has(r.widget_type)&&!M?(0,f.jsx)(s.default,{style:{flex:1,minHeight:0},children:N}):(0,f.jsx)(o.default,{style:{flex:1},contentContainerStyle:{padding:g.CHROME.pad,gap:g.CHROME.gap},children:N}):(0,f.jsx)(s.default,{style:{flex:1}})),!!E&&(0,f.jsx)(s.default,{pointerEvents:"none",style:{position:'absolute',top:6,bottom:6,width:3,borderRadius:2,backgroundColor:l.C.green,['before'===E?'left':'right']:2}}),!y&&!M&&!!S&&(0,f.jsx)(s.default,{...G.panHandlers,accessibilityLabel:`Resize ${d.label} against ${S?'its neighbour':''}`,onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),style:{position:'absolute',right:-1,top:0,bottom:0,width:8,alignItems:'center',justifyContent:'center',cursor:'col-resize'},children:(0,f.jsx)(s.default,{style:{width:2,height:36,borderRadius:1,backgroundColor:I?l.C.green:'transparent'}})})]})};var t=_r(_d[0]),n=e(_r(_d[1]));_r(_d[2]);var r=e(_r(_d[3])),o=e(_r(_d[4])),s=e(_r(_d[5])),l=_r(_d[6]),d=(function(e){if(e&&e.__esMo
1166dule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(_r(_d[7])),c=_r(_d[8]),u=_r(_d[9]),g=_r(_d[10]),h=_r(_d[11]),f=_r(_d[12]);const p=d.BlockBareContext,b=e=>p?(0,f.jsx)(p.Provider,{value:!0,children:e}):e,x=!0;function C(e,n){const[r,o]=(0,t.useState)(n||void 0===globalThis.IntersectionObserver);return(0,t.useEffect)(()=>{if(r)return;const t=e.current;if(!t||'function'!=typeof t.getBoundingClientRect)return void o(!0);const n=new globalThis.IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(o(!0),n.disconnect())},{rootMargin:'400px 0px'});return n.observe(t),()=>n.disconnect()},[r,e]),r}function w({icon:e,label:t,onPress:n}){return(0,f.jsx)(r.default,{accessibilityRole:"button",accessibilityLabel:t,onPress:n,style:({pressed:e,hovered:t})=>({width:g.CHROME.control,height:g.CHROME.control,borderRadius:7,alignItems:'center',justifyContent:'center',backgroundColor:t?l.C.dark:'transparent',opacity:e?.6:1}),children:(0,f.jsx)(l.Icon,{name:e,size:g.CHROME.icon,color:l.C.muted})})}const R=(e,t)=>(0,h.snapPair)(e,t)},1073,[11,355,136,375,278,13,821,1074,1075,1066,1072,1106,6]); 1167__d(function(_g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"webOnly",{enumerable:!0,get:function(){return f.webOnly}}),Object.defineProperty(_e,"CenterNote",{enumerable:!0,get:function(){return f.CenterNote}}),Object.defineProperty(_e,"head",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"tab",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"tone",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"buildupColor",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"typeColor",{enumerable:!0,get:function(){return C}}),_e.Pill=j,Object.defineProperty(_e,"SCALE",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"IDLE_H",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"bodyText",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"metaText",{enumerable:!0,get:function(){return H}}),_e.infoGroups=L,_e.InfoDisclosure=function({label:e="How to read this",title:i,groups:h}){const[b,x]=t.default.useState(!1),y=t.default.useRef(null),C=L(h);return C.length?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(l.default,{ref:y,accessibilityRole:"button",accessibilityState:{expanded:b},accessibilityLabel:`${e}: ${i}. ${b?'Hide the definitions':'Read the definitions'}`,...(0,f.webOnly)({'aria-expanded':b,'aria-haspopup':'dialog'}),onPress:()=>x(e=>!e),hitSlop:w,style:e=>[s.s.row,{gap:5,minHeight:30,paddingHorizontal:9,borderRadius:8,borderWidth:1,borderColor:b?s.C.green:s.C.line,backgroundColor:b||e.hovered||e.focused?s.C.soft:'transparent'}],children:[(0,p.jsx)(u.HitArea,{slop:w}),(0,p.jsx)(s.Icon,{name:"info",size:13,color:b?s.C.green:s.C.muted}),(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:b?s.C.green:s.C.muted},children:e})]}),(0,p.jsx)(c.Popover,{open:b,onClose:()=>x(!1),anchor:y,placement:"bottom-end",label:i,width:400,children:(0,p.jsx)(o.default,{contentContainerStyle:{paddingHorizontal:14,paddingVertical:8,gap:12},children:C.map(e=>(0,p.jsxs)(n.default,{style:{gap:4},children:[(0,p.jsx)(s.T,{style:g,children:e.heading}),e.lines.map((e,t)=>(0,p.jsx)(s.T,{accessibilityRole:"text",style:{fontSize:12,lineHeight:18,color:'amber'===e.tone?s.C.amber:s.C.ink},children:e.text},t))]},e.heading))})})]}):null},_e.captureView=W,Object.defineProperty(_e,"CaptureContext",{enumerable:!0,get:function(){return I}}),_e.CaptureChip=$,_e.BlockCaptureChip=v,_e.DirectionChip=F,_e.Tag=B,_e.EmptyPanel=V,_e.LoadingPanel=N,_e.stateOf=function(e,t){return(0,h.cardState)(e.data,{loading:'loading'===e.phase,error:'error'===e.phase?e.error:'',emptyText:t})},_e.SourceLine=function({body:e}){const t=(0,h.sourceText)(e?.source);return t?(0,p.jsx)(s.T,{style:{fontSize:10,lineHeight:14,color:s.C.muted},children:t}):null}
1167,_e.Section=function({title:e,subtitle:t,stacked:l,asOf:i,badge:o,info:c,actions:u,children:f}){const h=!!(i||o||c||u);return(0,p.jsxs)(n.default,{style:{gap:8},children:[(0,p.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',flexWrap:'wrap',gap:10},children:[(0,p.jsxs)(n.default,{style:{gap:2,flexShrink:1,minWidth:0},children:[(0,p.jsx)(s.T,{role:"heading","aria-level":2,style:{fontFamily:'ManropeBold',fontSize:19,lineHeight:26,letterSpacing:-.3},children:e}),!!t&&(0,p.jsx)(s.T,{style:{fontSize:12,lineHeight:17,color:s.C.muted},children:t})]}),h&&(0,p.jsxs)(n.default,{style:{flex:1,minWidth:190,flexDirection:'row',flexWrap:'wrap',alignItems:'center',justifyContent:'flex-end',gap:10},children:[!!o&&(0,p.jsx)(n.default,{children:(0,p.jsx)(j,{label:o})}),!!i&&(0,p.jsxs)(n.default,{style:[s.s.row,{gap:5}],children:[(0,p.jsx)(s.Icon,{name:"clock",size:12,color:s.C.muted}),(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:s.C.muted},children:i})]}),c,u]})]}),(0,p.jsx)(n.default,{style:{flexDirection:l?'column':'row',alignItems:'stretch',gap:12},children:f})]})},_e.WidgetFrame=function({name:e,subtitle:t,body:i,state:o,showsSignals:g,filterCount:b,onCustomize:x,onRefresh:y,onExpand:C,expanded:j,onClose:S,toolbar:z,note:T,emptyDetail:w,footer:_,inBlock:k,children:L,style:P}){const R=(0,h.missingText)(i?.missing,g||[]),W=o?.phase||'ready';let I=L;'loading'===W?I=(0,p.jsx)(N,{}):'error'===W?I=(0,p.jsx)(f.CenterNote,{icon:"alert-triangle",text:`No rows are shown while this widget is unavailable. This is not the same as nothing happening. ${o?.text||''}`,children:!!y&&(0,p.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`Retry ${e}`,onPress:y,hitSlop:O,style:e=>[{minHeight:32,paddingHorizontal:12,borderRadius:8,borderWidth:1,borderColor:s.C.line,justifyContent:'center',backgroundColor:e.hovered||e.focused?s.C.soft:'transparent'}],children:[(0,p.jsx)(u.HitArea,{slop:O}),(0,p.jsx)(s.T,{style:{fontSize:12,fontFamily:'InterSemi',color:s.C.green},children:"Retry"})]})}):'empty'===W&&(I=(0,p.jsx)(V,{text:o?.text||'',detail:w}));
1167const $=k?26:30,v=k?10:12,F=k?6:10,B=u.TOUCH_MIN,E=u.TOUCH_MIN-$,A=E/2,D=(0,u.touchSlop)($,$),M=!!y||!!C||!!S;return(0,p.jsxs)(n.default,{role:"region","aria-label":e,style:[{backgroundColor:s.C.paper,borderWidth:1,borderColor:s.C.line,borderRadius:12,overflow:'hidden',minWidth:0},P],children:[(0,p.jsxs)(n.default,{style:[s.s.row,{paddingLeft:v,paddingRight:M?A:2,minHeight:B,borderBottomWidth:1,borderColor:s.C.line,gap:F}],children:[(0,p.jsxs)(n.default,{style:{minWidth:0,flexShrink:1},children:[(0,p.jsx)(s.T,{role:"heading","aria-level":3,numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:11,lineHeight:16,letterSpacing:1,textTransform:'uppercase'},children:e}),!!t&&(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:s.C.muted},children:t})]}),!!x&&(0,p.jsx)(f.LinkText,{label:(0,h.customizeLabel)(b||0),a11y:`Customize ${e}: ${b||0} filters in force. Open the filter builder`,onPress:x}),(0,p.jsx)(n.default,{style:{flex:1,minWidth:4}}),M&&(0,p.jsxs)(n.default,{style:[s.s.row,{gap:E}],children:[!!y&&(0,p.jsx)(c.IconButton,{icon:"refresh-cw",size:13,label:`Refresh ${e}`,tooltip:"Refresh",onPress:y,style:{width:$,height:$},slop:D}),!!C&&(0,p.jsx)(c.IconButton,{icon:j?'minimize-2':'maximize-2',size:13,pressed:j,label:`${j?'Restore':'Expand'} ${e}`,tooltip:j?'Restore':'Expand',onPress:C,style:{width:$,height:$},slop:D}),!!S&&(0,p.jsx)(c.IconButton,{icon:"x",size:14,label:`Close ${e}`,tooltip:"Close",onPress:S,style:{width:$,height:$},slop:D})]})]}),!!z&&(0,p.jsx)(n.default,{style:{paddingHorizontal:v,paddingVertical:k?6:8,borderBottomWidth:1,borderColor:s.C.line,gap:5,zIndex:1},children:z}),(0,p.jsx)(n.default,{style:{flex:1,minHeight:0},children:I}),k?(!!T||!!R)&&(0,p.jsxs)(n.default,{style:{borderTopWidth:1,borderColor:s.C.line,paddingHorizontal:v,paddingVertical:6,gap:3},children:[!!T&&('string'==typeof T?(0,p.jsx)(s.T,{style:H,children:T}):T),!!R&&(0,p.jsx)(s.T,{style:{...H,color:s.C.amber},children:R})]}):void 0!==_?null!==_&&(0,p.jsx)(n.default,{style:{borderTopWidth:1,borderColor:s.C.line,paddingHorizontal:12,paddingVertical:7,gap:3},children:_}):(0,p.jsxs)(n.default,{style:{borderTopWidth:1,borderColor:s.C.line,paddingHorizontal:12,paddingVertical:7,gap:3},children:[(0,p.jsxs)(n.default,{style:[s.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,p.jsx)(s.Icon,{name:"clock",size:11,color:s.C.muted}),(0,p.jsx)(s.T,{style:{fontSize:11,lineHeight:15,color:s.C.muted},children:(0,h.asOfText)(i?.as_of)})]}),(0,p.jsx)(s.T,{style:{fontSize:10,lineHeight:14,color:s.C.muted},children:(0,h.floorsText)(i?.floors,i?.floors_text)}),!!T&&('string'==typeof T?(0,p.jsx)(s.T,{style:{fontSize:10,lineHeight:14,color:s.C.muted},children:T}):T),!!R&&(0,p.jsx)(s.T,{style:{fontSize:10,lineHeight:14,color:s.C.amber},children:R})]})]})},Object.defineProperty(_e,"BLOCK_H",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"BLOCK_CHART_FLEX",{enumerable:!0,get:function(){return A}}),Object.defineProperty(_e,"BLOCK_CONTENT_FLEX",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"BLOCK_BESIDE",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"BLOCK_PIN_COLUMN",{enumerable:!0,get:function(){return K}}),Object.defineProperty(_e,"BLOCK_GAP",{enumerable:!0,get:function(){return X}}),_e.paneStyles=q,_e.Headline=U,_e.SymbolPill=J,_e.Block=function({title:e,subtitle:l,asOf:i,badge:o,linked:c,headline:u,info:f,actions:h,stacked:g,height:b,idle:x,chart:y,content:C}){const j=q(!!g,b||(x?z:E)),S=y(j.chart),T=C(j.content);if(!S&&!T)return null;const H=t.default.useContext(I),w=!!H&&!1===H.healthy,O=!!i||!!o||!!f||!!h||w;return(0,p.jsxs)(n.default,{style:{gap:8},children:[(0,p.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'flex-start',flexWrap:'wrap',gap:10},children:[(0,p.jsxs)(n.default,{style:{gap:2,flexShrink:1,minWidth:0},children:[(0,p.jsx)(s.T,{role:"heading","aria-level":2,style:{fontFamily:'ManropeBold',fontSize:19,lineHeight:26,letterSpacing:-.3},children:e}),!!l&&(0,p.jsx)(s.T,{style:{fontSize:12,lineHeight:17,color:s.C.muted},children:l})]}),O&&(0,p.jsxs)(n.default,{style:{flex:1,minWidth:190,flexDirection:'row',flexWrap:'wrap',alignItems:'center',justifyContent:'flex-end',gap:10},children:[!!o&&(0,p.jsx)(n.default,{children:(0,p.jsx)(J,{label:o,linked:c})}),!!i&&(0,p.jsxs)(n.default,{style:[s.s.row,{gap:5}],children:[(0,p.jsx)(s.Icon,{name:"clock",size:12,color:s.C.muted}),(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:s.C.muted},children:i})]}),(0,p.jsx)(v,{}),f,h]})]}),!!u&&(0,p.jsx)(U,{...u}),(0,p.jsxs)(n.default,{style:[s.s.row,{alignItems:'stretch',gap:X}],children:[!!c&&(0,p.jsx)(n.default,{style:{width:2,borderRadius:2,backgroundColor:s.C.green,opacity:.55}}),(0,p.jsxs)(n.default,{style:{flex:1,minWidth:0,flexDirection:g?'column':'row',alignItems:'stretch',gap:X},children:[S,T]})]})]})},_e.useHoverIndex=function(e){const[n,l]=t.default.useState(null),i=t.default.useRef(e);i.current=e;const o=t.default.useRef(0),s=t.default.useRef(null);t.default.useEffect(()=>()=>{o.current&&cancelAnimationFrame(o.current)},[]);const c=t.default.useMemo(()=>({onPointerMove:e=>{const t=e?.nativeEvent||e;'touch'!==t?.pointerType&&(s.current={target:e.currentTarget,clientX:t.clientX},o.current||(o.current=requestAnimationFrame(()=>{o.current=0;const e=s.current,t=e?.target?.getBoundingClientRect?.();if(!e||!t||!Number.isFinite(e.clientX))return;
1167const n=i.current(e.clientX-t.left,t.width);l(e=>null==n?null:n===e?e:n)})))},onPointerLeave:e=>{const t=e?.nativeEvent||e;'touch'!==t?.pointerType&&(o.current&&(cancelAnimationFrame(o.current),o.current=0),s.current=null,l(null))}}),[]);return{cursor:n,hover:c}},_e.CrosshairReadout=function({time:e,rows:t}){return(0,p.jsxs)(n.default,{style:[s.s.row,{gap:10,flexWrap:'wrap',paddingHorizontal:8,paddingVertical:4,borderRadius:8,borderWidth:1,borderColor:s.C.line,backgroundColor:s.C.dark}],children:[(0,p.jsxs)(n.default,{style:[s.s.row,{gap:4}],children:[(0,p.jsx)(s.Icon,{name:"clock",size:10,color:s.C.green}),(0,p.jsx)(s.T,{style:{fontSize:10,lineHeight:14,fontFamily:'InterSemi',color:s.C.green,fontVariant:['tabular-nums']},children:e})]}),t.map(e=>(0,p.jsxs)(n.default,{style:[s.s.row,{gap:5}],children:[(0,p.jsx)(n.default,{style:{width:8,height:2,backgroundColor:e.color}}),(0,p.jsxs)(s.T,{numberOfLines:1,style:[H,{color:s.C.ink,fontVariant:['tabular-nums']}],children:[e.label," ",e.value,e.tag?` ${e.tag}`:'']})]},e.label))]})};var t=e(r(d[0])),n=e(r(d[1])),l=e(r(d[2])),i=e(r(d[3])),o=e(r(d[4]));r(d[5]);var s=r(d[6]),c=r(d[7]),u=r(d[8]),f=r(d[9]),h=r(d[10]),p=r(d[11]);const g={fontSize:10,lineHeight:14,fontFamily:'InterMedium',letterSpacing:.6,textTransform:'uppercase',color:s.C.muted},b={fontVariant:['tabular-nums']},x=e=>null==e?s.C.muted:e>0?s.C.green:e<0?s.C.red:s.C.ink,y=e=>'up'===e?s.C.green:'down'===e?s.C.red:s.C.muted,C=e=>'call'===e?s.C.green:'put'===e?s.C.red:s.C.muted;function j({label:e,tone:t=s.C.muted}){return(0,p.jsx)(n.default,{style:{alignSelf:'flex-start',paddingHorizontal:6,paddingVertical:2,borderRadius:5,backgroundColor:t===s.C.muted?s.C.bg:s.C.soft},children:(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:10,lineHeight:14,fontFamily:'InterSemi',color:t},children:e})})}const S={title:11,sub:11,body:11,meta:10,pad:10,gap:6},z=190,T={fontSize:S.body,lineHeight:15,color:s.C.muted},H={fontSize:S.meta,lineHeight:14,color:s.C.muted},w=(0,u.touchSlop)(30),O=(0,u.touchSlop)(32),_=(0,u.touchSlop)(26),k=(0,u.touchSlop)(22);function L(e){return(e||[]).map(e=>({heading:e.heading,lines:(e.lines||[]).map(e=>'string'==typeof e?{text:e}:e).filter(e=>!!e&&!!String(e.text||'').trim())})).filter(e=>e.lines.length>0)}const P={missing_capture:'Nothing captured',partial_capture:'Partial capture',complete:'Capture complete',no_eligible_rows:'Capture complete',filtered_out:'Capture complete',failed:'Store unavailable'},R={missing_capture:'amber',partial_capture:'amber',failed:'amber',complete:'green',no_eligible_rows:'green',filtered_out:'green'};function W(e){if(!e||!e.state)return null;const t=e.state,n=[e.state_text].filter(Boolean),l=Number(e.rows)||0,i=(e.required_fields||[]).concat(['spot']).map(t=>({key:t,entry:(e.coverage||{})[t]})).filter(e=>e.entry&&e.entry.column).map(e=>`${e.entry.label}: ${Number(e.entry.present||0).toLocaleString()} of ${l.toLocaleString()}`);l&&i.length&&n.push(`At this reading \u2014 ${i.join(' \xb7 ')}.`),'candles_15m'===e.source&&n.push("This reading was rebuilt from 15-minute candles. A candle carries no traded-price average, so there is no premium traded here to measure anything against.");const o=(e.floors_applied||[]).map(t=>(e.floors_labels||{})[t]||t);e.floors_degraded&&o.length&&n.push(`The rows at this reading were gated on ${o.length} of the 3 liquidity floors: ${o.join(', ')}.`);for(const t of e.floors_unmeasured_text||[])n.push(t);return null!=e.cleared&&null!=e.matched&&e.cleared>0&&0===e.matched&&n.push(`${e.cleared.toLocaleString()} contracts cleared the floors here; the filters in force excluded every one of them.`),e.latest_complete_at&&!e.latest_complete_is_here?n.push(`The newest reading with every required field captured is ${(0,h.asOfText)(e.latest_complete_at)}. Choose it above to move the tab there \u2014 nothing is substituted for you.`):e.latest_complete_at||'complete'===t||n.push('No recent reading has every required field captured.'),e.capture_text&&n.push(e.capture_text),{state:t,label:P[t]||t,tone:R[t]||'muted',detail:e.state_text||'',lines:n}}const I=t.default.createContext(null);function $({capture:e,compact:n}){const i=W(e),[b,x]=t.default.useState(!1),y=t.default.useRef(null);if(!i)return null;const C='amber'===i.tone?s.C.amber:'green'===i.tone?s.C.green:s.C.muted;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(l.default,{ref:y,accessibilityRole:"button",accessibilityState:{expanded:b},accessibilityLabel:`F&O capture: ${i.label}. ${i.detail} ${b?'Hide the detail':'Read the detail'}`,...(0,f.webOnly)({'aria-expanded':b,'aria-haspopup':'dialog'}),onPress:()=>x(e=>!e),hitSlop:n?k:_,style:e=>[s.s.row,{gap:5,minHeight:n?22:26,paddingHorizontal:7,borderRadius:7,borderWidth:1,borderColor:C,backgroundColor:b||e.hovered||e.focused?s.C.soft:'transparent'}],children:[(0,p.jsx)(u.HitArea,{slop:n?k:_}
1167),(0,p.jsx)(s.Icon,{name:'amber'===i.tone?'alert-triangle':'check-circle',size:n?11:12,color:C}),(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:n?10:11,lineHeight:n?14:15,fontFamily:'InterSemi',color:C},children:i.label})]}),(0,p.jsx)(c.Popover,{open:b,onClose:()=>x(!1),anchor:y,placement:"bottom-end",label:"F&O capture health",width:420,children:(0,p.jsxs)(o.default,{contentContainerStyle:{paddingHorizontal:14,paddingVertical:10,gap:8},children:[(0,p.jsx)(s.T,{style:g,children:e?.at?`F&O capture at ${(0,h.asOfText)(e.at)}`:'F&O capture'}),i.lines.map((e,t)=>(0,p.jsx)(s.T,{accessibilityRole:"text",style:{fontSize:12,lineHeight:18,color:0===t&&'amber'===i.tone?s.C.amber:s.C.ink},children:e},t))]})})]})}function v(){const e=t.default.useContext(I);return e&&!1===e.healthy?(0,p.jsx)($,{capture:e,compact:!0}):null}function F({label:e,tone:t="flat",size:l=9}){if(!e)return(0,p.jsx)(s.T,{style:{fontSize:l,lineHeight:l+4,color:s.C.muted},children:"no baseline"});const i='flat'===t?s.C.muted:y(t);return(0,p.jsx)(n.default,{style:{alignSelf:'flex-start',paddingHorizontal:5,paddingVertical:1,borderRadius:4,borderWidth:1,borderColor:'flat'===t?s.C.line:i},children:(0,p.jsx)(s.T,{style:{fontSize:l,lineHeight:l+4,fontFamily:'InterSemi',color:i},children:e})})}function B({label:e,a11y:t}){return(0,p.jsx)(n.default,{accessibilityLabel:t||e,style:{alignSelf:'flex-start',paddingHorizontal:4,paddingVertical:1,borderRadius:3,borderWidth:1,borderColor:s.C.mint},children:(0,p.jsx)(s.T,{style:{fontSize:8,lineHeight:11,letterSpacing:.7,fontFamily:'InterSemi',color:s.C.mint},children:e})})}function V({text:e,detail:t}){return(0,p.jsx)(f.CenterNote,{icon:"clock",text:e,children:!!t&&(0,p.jsx)(s.T,{style:{fontSize:11,lineHeight:16,color:s.C.muted,textAlign:'center',maxWidth:340},children:t})})}function N(){return(0,p.jsxs)(n.default,{style:{flex:1,alignItems:'center',justifyContent:'center',gap:10,padding:20},children:[(0,p.jsx)(i.default,{color:s.C.green}),(0,p.jsx)(s.T,{style:{fontSize:12,color:s.C.muted},children:"Reading the F&O store\u2026"})]})}const E=530,A=1,D=1.5,M=1200,K=760,X=12;function q(e,t){return e?{chart:{height:t},content:{height:t}}:{chart:{flex:A,minWidth:0,height:t},content:{flex:D,minWidth:0,height:t}}}function U({label:e,value:t,against:l,chip:i,chipTone:o,tag:c,reason:u}){const f=!t||t===G,h=f?u||'not captured':`${t}${c?` ${c}`:''}${l?`. ${l}`:''}${i?`. ${i}`:''}`;return(0,p.jsxs)(n.default,{accessibilityRole:"text",accessibilityLabel:`${e}: ${h}`,style:[s.s.row,{gap:14,flexWrap:'wrap',paddingHorizontal:14,paddingVertical:10,borderRadius:12,borderWidth:1,borderColor:s.C.line,backgroundColor:s.C.dark}],children:[(0,p.jsxs)(n.default,{style:{gap:1,minWidth:0},children:[(0,p.jsx)(s.T,{numberOfLines:1,style:g,children:e}),(0,p.jsxs)(n.default,{style:[s.s.row,{gap:7}],children:[(0,p.jsx)(s.T,{numberOfLines:1,style:{fontFamily:'ManropeBold',fontSize:26,lineHeight:32,letterSpacing:-.6,color:f?s.C.muted:s.C.ink,fontVariant:['tabular-nums']},children:t}),!!c&&!f&&(0,p.jsx)(B,{label:c})]})]}),(0,p.jsx)(s.T,{numberOfLines:2,style:{flex:1,minWidth:150,fontSize:12,lineHeight:17,color:s.C.muted},children:f?u||'':l||''}),!f&&!!i&&(0,p.jsx)(F,{label:i,tone:o,size:10})]})}const G='\u2014';function J({label:e,linked:t,large:l}){return e?(0,p.jsxs)(n.default,{style:[s.s.row,{gap:5,alignSelf:'flex-start',paddingHorizontal:l?10:7,paddingVertical:l?4:2,borderRadius:7,borderWidth:1,borderColor:t?s.C.green:s.C.line,backgroundColor:t?s.C.soft:s.C.bg}],children:[!!t&&(0,p.jsx)(n.default,{style:{width:5,height:5,borderRadius:3,backgroundColor:s.C.green}}),(0,p.jsx)(s.T,{numberOfLines:1,style:{fontSize:l?12:10,lineHeight:l?17:14,fontFamily:'InterSemi',color:t?s.C.green:s.C.muted},children:e})]}):null}},1074,[11,13,375,360,278,136,821,871,832,925,984,6]); 1168__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Idle=R,_e.ScreenerResultsBody=F,_e.ScreenerBuilderBody=H,_e.ScannersBody=U,_e.MarketScanBody=V,_e.OptionChainBody=z,_e.OiByStrikeBody=K,_e.OiSessionBody=J,_e.IvBody=X,_e.PcrBody=Z,_e.MaxPainBody=ee,_e.FuturesBuildupBody=te,_e.GreeksBody=ne,_e.KeyStrikesBody=ie,_e.PriceChartBody=le,_e.VolumeBody=ae,_e.SignalBody=de,_e.SessionHistoryBody=ce,_e.AiSummaryBody=he,_e.SignalNoiseBody=ge,_e.IndexDashboardBody=ye,_e.FuturesListBody=pe,_e.WatchlistBody=xe,_e.AlertsBody=fe,Object.defineProperty(_e,"BODIES",{enumerable:!0,get:function(){return me}}),Object.defineProperty(_e,"SELF_SCROLLING",{enumerable:!0,get:function(){return je}}),Object.defineProperty(_e,"FIT",{enumerable:!0,get:function(){return be}});var t=_r(_d[0]),s=e(t),r=e(_r(_d[1])),n=e(_r(_d[2])),i=e(_r(_d[3])),l=_r(_d[4]),a=e(l),o=_r(_d[5]),d=_r(_d[6]),c=_r(_d[7]),u=_r(_d[8]),h=_r(_d[9]),g=_r(_d[10]),y=_r(_d[11]),p=_r(_d[12]),x=_r(_d[13]),f=_r(_d[14]),m=_r(_d[15]),j=_r(_d[16]),b=_r(_d[17]),T=_r(_d[18]),k=_r(_d[19]),C=_r(_d[20]),_=_r(_d[21]),v=(function(e){if(e&&e.__esMo
1168dule)return e;var t={};return e&&Object.keys(e).forEach(function(s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}),t.default=e,t})(_r(_d[22])),w=_r(_d[23]),S=_r(_d[24]),E=_r(_d[25]);const P=e=>encodeURIComponent(e),O=(e,t)=>t?`${e}&expiry=${P(t)}`:e,W=()=>{};function R({icon:e="crosshair",title:t,detail:s}){return(0,E.jsxs)(i.default,{style:{flex:1,alignItems:'center',justifyContent:'center',gap:8,padding:20},children:[(0,E.jsx)(o.Icon,{name:e,size:20,color:o.C.muted}),(0,E.jsx)(o.T,{style:[_.TYPE.title,{textAlign:'center'}],children:t}),!!s&&(0,E.jsx)(o.T,{style:[_.TYPE.body,{color:o.C.muted,textAlign:'center',maxWidth:320}],children:s})]})}const Y=(0,E.jsx)(R,{title:"No instrument selected",detail:"Pick one from a screener, the market scan or the instrument chip above \u2014 every connected widget follows."}),A=900,B=v.BlockBareContext?64:128;function q(e,t,s,r,n){const i=!s||'auto'===s,l=i?e<A:'both'!==s;return{hidden:i&&l||'chart'===s?{[n]:!0}:'readings'===s?{[r]:!0}:{},stacked:!l&&e<A,height:Math.max(180,t-2*_.CHROME.pad-B)}}function D(e,t,s,r,n){return{symbol:e,choice:{symbol:e,defaulted:!1,label:''},badge:e,linked:!0,expiry:t,seq:s,stacked:r.stacked,height:r.height,hidden:r.hidden,onTarget:n,target:null}}function I(){const e=(0,w.useWorkspace)();return t=>{t?.underlying&&t.underlying!==e.selected.underlying&&e.select({underlying:t.underlying,expiry:null,focus:null})}}function N(e,t){return e.strike??(e.selected.underlying===t&&e.selected.focus?.strikes?.[0]||null)}function L({m:e,active:t,onPress:s}){const n=e.episodes.length>1&&'new'===e.status;return(0,E.jsxs)(r.default,{accessibilityRole:"button",accessibilityState:{selected:t},onPress:s,accessibilityLabel:`${e.title}, ${C.STATUS_LABEL[e.status]}. Point the workspace at it`,style:({pressed:e})=>({gap:4,paddingHorizontal:10,paddingVertical:9,borderRadius:10,borderWidth:1,borderColor:t?o.C.green:o.C.line,backgroundColor:t?o.C.soft:o.C.dark,opacity:e?.75:1}),children:[(0,E.jsxs)(i.default,{style:[o.s.between,{gap:6}],children:[(0,E.jsxs)(o.T,{numberOfLines:1,style:[_.TYPE.title,{flex:1}],children:[e.title,(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:[" ",(0,C.expiryShort)(e.expiry)]})]}),(0,E.jsx)(o.Badge,{label:'ended'===e.status?`ENDED ${e.ended_at}`:n?'AGAIN':C.STATUS_LABEL[e.status].replace(' MATCH','').replace('STILL MATCHING','STILL'),tone:C.STATUS_TONE[e.status]})]}),(0,E.jsx)(o.T,{numberOfLines:2,style:[_.TYPE.helper,{color:o.C.muted}],children:e.because[0]}),(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:["first ",e.first_matched," \xb7 ",e.episode_readings," reading",1===e.episode_readings?'':'s']})]})}function $({body:e,scannerId:t,scannerName:s,loading:r,error:n}){const l=(0,w.useWorkspace)();if(n)return(0,E.jsx)(R,{icon:"alert-circle",title:"Could not run this scanner",detail:n});if(!e)return(0,E.jsx)(R,{icon:"loader",title:r?'Running the scanner\u2026':'\u2014'});if(!e.available)return(0,E.jsx)(R,{icon:"clock",title:"No readings yet",detail:e.text});if(!e.matches.length)return(0,E.jsx)(R,{icon:"search",title:"Nothing matches right now",detail:e.counts?.ended?`${e.counts.ended} matched earlier today and ended.`:'KANIDA checks again at every 15-min reading.'});const a=e=>l.select({underlying:e.underlying,expiry:e.expiry,focus:{side:e.type||null,strikes:null!=e.strike?[e.strike]:[],from:e.episode_started,to:e.last_matched,source:s,because:e.because.slice(0,2),scanner_id:t,match_key:e.key}});return(0,E.jsxs)(i.default,{style:{gap:6},children:[e.matches.map(e=>(0,E.jsx)(L,{m:e,active:l.selected.focus?.match_key===e.key,onPress:()=>a(e)},e.key)),e.truncated&&(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:["Showing the first ",e.shown,"."]})]})}function M(e){return(0,d.useDerivativeRead)('/api/screener/scanners',e)}function F({w:e,openSettings:t}){const s=(0,w.useWorkspace)(),n=M(s.seq),l=e.scanner_id,a=e.settings.view||'active',c=(0,d.useDerivativeRead)(l?`/api/screener/scanners/${P(l)}/results?view=${a}&limit=100`:null,s.seq),u=n.data?.scanners.find(e=>e.id===l);return l?(0,E.jsxs)(i.default,{style:{gap:8},children:[(0,E.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:"Change scanner",onPress:t,style:[o.s.between,{gap:6}],children:[(0,E.jsxs)(o.T,{numberOfLines:1,style:[_.TYPE.title,{flex:1,color:o.C.green}],children:[u?.name||l," \u25be"]}),c.data?.counts&&(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:[c.data.counts.active," active \xb7 ",c.data.counts.ended," ended"]})]}),!!u&&(0,E.jsx)(o.T,{numberOfLines:2,style:[_.TYPE.helper,{color:o.C.muted}],children:u.reads_as}),(0,E.jsx)($,{body:c.data,scannerId:l,scannerName:u?.name||'',loading:'loading'===c.phase,error:c.error})]}
1168):(0,E.jsx)(R,{icon:"filter",title:"Choose a scanner",detail:"Open settings to pick a KANIDA scanner or one of yours."})}function H({width:e}){const s=(0,w.useWorkspace)(),r=(0,d.useDerivativeRead)('/api/screener/vocabulary',0),[l,a]=(0,t.useState)((0,C.newDefinition)()),[c,u]=(0,t.useState)(''),[h,g]=(0,t.useState)(null),[y,p]=(0,t.useState)(!1),[x,f]=(0,t.useState)(''),[m,j]=(0,t.useState)(''),[b,v]=(0,t.useState)(null),[S,P]=(0,t.useState)(!1),[O,W]=(0,t.useState)(''),[Y,A]=(0,t.useState)('');if((0,t.useEffect)(()=>{const e=setTimeout(()=>k.screenerApi.describe(l).then(e=>{f(e.reads_as),j('')},e=>j(e?.message||'')),250);return()=>clearTimeout(e)},[l]),!r.data)return(0,E.jsx)(R,{icon:"loader",title:"Loading the vocabulary\u2026"});return(0,E.jsxs)(i.default,{style:{gap:12},children:[(0,E.jsx)(T.Builder,{vocab:{...r.data,underlyings:r.data.underlyings||[]},draft:l,onChange:a,readsAs:x,error:m,text:c,onText:u,onParse:async()=>{if(c.trim()){p(!0);try{const e=await k.screenerApi.parse(c);g(e),a(e.definition)}catch(e){j(e?.message||'')}finally{p(!1)}}},parsing:y,parsed:h,compact:e<700,dense:!0}),(0,E.jsxs)(i.default,{style:[o.s.row,{flexWrap:'wrap',gap:8}],children:[(0,E.jsx)(o.Button,{label:"Run",icon:"play",onPress:async()=>{P(!0);try{v(await k.screenerApi.run(l,'active'))}catch(e){j(e?.message||'')}finally{P(!1)}},loading:S,disabled:!!m}),(0,E.jsx)(n.default,{value:O,onChangeText:W,placeholder:"Name to save as",placeholderTextColor:o.C.muted,maxLength:60,accessibilityLabel:"Scanner name",style:[o.s.input,{minHeight:42,flex:1,minWidth:160}]}),(0,E.jsx)(o.Button,{label:"Save scanner",icon:"save",kind:"soft",onPress:async()=>{try{const e=await k.screenerApi.create(O||'My scanner',l,h?'nl':'visual',h?c:void 0);A(`Saved \u201c${e.name}\u201d to your scanners.`),s.openScanner(e.id)}catch(e){j(e?.message||'')}},disabled:!!m})]}),!!Y&&(0,E.jsx)(o.T,{style:[_.TYPE.body,{color:o.C.green}],children:Y}),b&&(0,E.jsx)($,{body:b,scannerId:null,scannerName:"Draft scanner",loading:S,error:""})]})}function U({w:e}){const t=(0,w.useWorkspace)(),s=M(t.seq),n=e.settings.list||'all',l=(s.data?.scanners||[]).filter(e=>'all'===n||('mine'===n?!e.is_default:e.is_default));if(!s.data)return(0,E.jsx)(R,{icon:"loader",title:"Loading scanners\u2026"});const a=new Set(t.widgets.filter(e=>'screener_results'===e.widget_type).map(e=>e.scanner_id));return(0,E.jsxs)(i.default,{style:{gap:4},children:[!l.length&&(0,E.jsx)(o.T,{style:[_.TYPE.body,{color:o.C.muted}],children:"No scanners of yours yet \u2014 build one in a Screener builder widget."}),l.map(e=>(0,E.jsxs)(r.default,{accessibilityRole:"button",accessibilityLabel:`Open ${e.name} in the results widget`,onPress:()=>t.openScanner(e.id),style:({pressed:t})=>[o.s.between,{paddingHorizontal:10,paddingVertical:9,borderRadius:9,backgroundColor:a.has(e.id)?o.C.soft:'transparent',opacity:t?.7:1}],children:[(0,E.jsx)(o.T,{numberOfLines:1,style:[_.TYPE.body,{flex:1,color:a.has(e.id)?o.C.green:o.C.ink}],children:e.name}),(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:[e.is_default?'KANIDA':'mine',e.counts?` \xb7 ${e.counts.active}`:'']})]},e.id))]})}function V({height:e}){const t=(0,w.useWorkspace)(),s=I(),r=(0,d.useDerivativeRead)(`${b.SCREENER_PATH}${(0,b.screenerQuery)([],{group:b.SCREENER_VIEW_DEFAULT})}`,t.seq);return(0,E.jsx)(f.WhatsHappening,{read:r,at:r.data?.reading_at||'',seq:t.seq,symbol:t.selected.underlying||'',onTarget:s,table:null,showTable:!1,onShowTable:W,style:{height:Math.max(300,e-8),borderWidth:0}})}function z({w:e,height:t}){const s=(0,w.useWorkspace)(),r=I(),n=(0,w.instrumentOf)(e,s.selected),i=(0,w.expiryOf)(e,s.selected);return n?(0,E.jsx)(c.ChainWidget,{underlying:n,expiry:i,seq:s.seq,target:null,onTarget:r,highlight:N(s,n),onHighlight:s.setStrike,style:{height:Math.max(340,t-8),borderWidth:0}}):Y}function K({w:e,width:t,height:s,openSettings:r}){const n=(0,w.useWorkspace)(),i=I(),l=(0,w.instrumentOf)(e,n.selected),a=(0,w.expiryOf)(e,n.selected);return l?(0,E.jsx)(u.OiByStrikeSection,{underlying:l,badge:l,linked:!0,expiry:a,seq:n.seq,onTarget:i,...q(t,s,e.settings.view,'oi_chart','oi_table'),pinFirst:t<640,onCustomize:r,highlight:N(n,l),onHighlight:n.setStrike}):Y}function G(e,t,s){return(0,d.useDerivativeRead)(e?O(`/api/derivatives/oi-grid?underlying=${P(e)}`,t):null,s)}function J({w:e,width:t,height:s,openSettings:r}){const n=(0,w.useWorkspace)(),i=I(),l=(0,w.instrumentOf)(e,n.selected),a=(0,w.expiryOf)(e,n.selected),o=G(l,a,n.seq);return l?(0,E.jsx)(h.OiGridSection,{symbol:l,badge:l,linked:!0,expiry:a,seq:n.seq,read:o,rules:[],target:null,onTarget:i,onCustomize:r,...q(t,s,e.settings.view,'oi_grid_futures','oi_grid'),highlight:N(n,l),onHighlight:n.setStrike}):Y}function Q(e,t){const s=(0,d.useDerivativeRead)(e&&!t?'/api/derivatives/filters':null,0);if(t||!e)return{expiry:t,rolled:''};const r=(s.data?.expiries||[]).filter(t=>t.underlying===e).sort((e,t)=>
1168e.expiry<t.expiry?-1:1);return r.length>1&&0===r[0].days_to_expiry?{expiry:r[1].expiry,rolled:r[0].expiry}:{expiry:'',rolled:''}}function X({w:e,width:t,height:s}){const r=(0,w.useWorkspace)(),n=I(),l=(0,w.instrumentOf)(e,r.selected),{expiry:a,rolled:d}=Q(l,(0,w.expiryOf)(e,r.selected)),c=G(l,a,r.seq);return l?(0,E.jsxs)(i.default,{style:{gap:8},children:[!!d&&(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.amber}],children:[l," options expiring ",d," expire today, and implied volatility cannot be solved on expiry day \u2014 this reads the next expiry (",a,")."]}),(0,E.jsx)(g.IvSection,{...D(l,a,r.seq,q(t,s-(d?36:0),e.settings.view,'iv_chart','iv_strikes'),n),gridRead:c,highlight:N(r,l),onHighlight:r.setStrike})]}):Y}function Z({w:e,width:t,height:s}){const r=(0,w.useWorkspace)(),n=I(),i=(0,w.instrumentOf)(e,r.selected),l=(0,w.expiryOf)(e,r.selected);return i?(0,E.jsx)(g.PcrSection,{...D(i,l,r.seq,q(t,s,e.settings.view,'pcr_chart','pcr_readings'),n)}):Y}function ee({w:e,width:t,height:s}){const r=(0,w.useWorkspace)(),n=I(),i=(0,w.instrumentOf)(e,r.selected),l=(0,w.expiryOf)(e,r.selected);return i?(0,E.jsx)(g.MaxPainSection,{...D(i,l,r.seq,q(t,s,e.settings.view,'max_pain_chart','max_pain_readings'),n)}):Y}function te({w:e,width:t,height:s}){const r=(0,w.useWorkspace)(),n=I(),i=(0,w.instrumentOf)(e,r.selected);return i?(0,E.jsx)(g.FuturesBuildupSection,{...D(i,'',r.seq,q(t,s,e.settings.view,'fut_oi','fut_readings'),n)}):Y}function se(e){return'number'==typeof e&&isFinite(e)?e:null}function re(e){return e.toLocaleString('en-IN',{maximumFractionDigits:1})}function ne({w:e}){const t=(0,w.useWorkspace)(),s=(0,w.instrumentOf)(e,t.selected),n=(0,w.expiryOf)(e,t.selected),l=e.settings.atm||'3',a=(0,d.useDerivativeRead)(s?O(`/api/workspace/greeks?underlying=${P(s)}&atm=${l}`,n):null,t.seq);if(!s)return Y;const c=a.data;if(!c)return(0,E.jsx)(R,{icon:"loader",title:a.error||'Solving IV, delta and gamma\u2026'});if(!c.available)return(0,E.jsx)(R,{icon:"clock",title:c.text});const u=new Set(t.selected.underlying===s&&t.selected.focus?.strikes||[]),h=(e,t)=>{const s=se(e?.[t]);return null==s?'\u2014':'iv_pct'===t?`${s.toFixed(1)}%`:'delta'===t?s.toFixed(2):s.toFixed(4)},g={width:54,textAlign:'right',fontSize:11};return(0,E.jsxs)(i.default,{style:{gap:6},children:[(0,E.jsxs)(i.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,E.jsx)(o.Badge,{label:"COMPUTED",tone:"amber"}),(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:[c.expiry," \xb7 ATM ",re(c.atm_strike)," \xb7 as of ",String(c.as_of).slice(11,16)]})]}),!!c.note&&(0,E.jsx)(o.T,{style:[_.TYPE.helper,{color:o.C.amber}],children:c.note}),(0,E.jsxs)(i.default,{style:[o.s.row,{gap:4,paddingVertical:4,borderBottomWidth:1,borderColor:o.C.line}],children:[(0,E.jsx)(o.T,{style:[g,{color:o.C.muted}],children:"IV"}),(0,E.jsx)(o.T,{style:[g,{color:o.C.muted}],children:"\u0394"}),(0,E.jsx)(o.T,{style:[g,{color:o.C.muted}],children:"\u0393"}),(0,E.jsx)(o.T,{numberOfLines:1,style:[_.TYPE.helper,{flex:1,textAlign:'center',color:o.C.muted}],children:"CE \xb7 K \xb7 PE"}),(0,E.jsx)(o.T,{style:[g,{color:o.C.muted}],children:"\u0393"}),(0,E.jsx)(o.T,{style:[g,{color:o.C.muted}],children:"\u0394"}),(0,E.jsx)(o.T,{style:[g,{color:o.C.muted}],children:"IV"})]}),c.rows.map(e=>{const s=e.strike===c.atm_strike||u.has(e.strike);return(0,E.jsxs)(r.default,{onHoverIn:()=>t.setStrike(e.strike),onHoverOut:()=>t.setStrike(null),style:[o.s.row,{gap:4,paddingVertical:5,borderRadius:6,backgroundColor:t.strike===e.strike||u.has(e.strike)?o.C.soft:'transparent'}],children:[(0,E.jsx)(o.T,{style:g,children:h(e.CE,'iv_pct')}),(0,E.jsx)(o.T,{style:g,children:h(e.CE,'delta')}),(0,E.jsx)(o.T,{style:g,children:h(e.CE,'gamma')}),(0,E.jsx)(o.T,{style:[_.TYPE.title,{flex:1,textAlign:'center',fontFamily:s?'InterSemi':'Inter',color:s?o.C.green:o.C.ink}],children:re(e.strike)}),(0,E.jsx)(o.T,{style:g,children:h(e.PE,'gamma')}),(0,E.jsx)(o.T,{style:g,children:h(e.PE,'delta')}),(0,E.jsx)(o.T,{style:g,children:h(e.PE,'iv_pct')})]},e.strike)}),(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:[c.computed_text," A dash is a price the model could not solve (for example, stale or at intrinsic value)."]})]})}function ie({w:e}){const t=(0,w.useWorkspace)(),s=(0,w.instrumentOf)(e,t.selected),n=(0,d.useDerivativeRead)(s?`/api/workspace/key-strikes?underlying=${P(s)}`:null,t.seq);if(!s)return Y;const l=n.data;if(!l)return(0,E.jsx)(R,{icon:"loader",title:n.error||'Reading\u2026'});if(!l.available)return(0,E.jsx)(R,{icon:"clock",title:l.text});const a=l.key_strikes||[];return(0,E.jsxs)(i.default,{style:{gap:6},children:[(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:["At the ",String(l.as_of).slice(11,16)," reading \xb7 ",l.headline||'']}),!a.length&&(0,E.jsx)(o.T,{style:[_.TYPE.body,{color:o.C.muted}],children:"No strike changed materially at this reading."}),a.map(e=>(0,E.jsxs)(r.default,{onHoverIn:()=>t.setStrike(e.strike),onHoverOut:()=>t.setStrike(null),style:[o.s.between,{paddingHorizontal:10,paddingVertical:8,borderRadius:9,borderWidth:1,borderColor:e.lead?o.C.green:o.C.line,backgroundColor:t.strike===e.strike?o.C.soft:o.C.dark}],children:[(0,E.jsxs)(o.T,{style:[_.TYPE.title,{color:'CE'===e.side?o.C.green:o.C.red}],children:[re(e.strike)," ",e.side]}),(0,E.jsx)(o.T,{style:[_.TYPE.helper,{color:e.lead?o.C.green:o.C.muted}],children:e.note})]},`${e.strike}${e.side}`))]})}function le({w:e,height:t}){const s=(0,w.useWorkspace)(),r=(0,w.instrumentOf)(e,s.selected);return r?(0,E.jsx)(y.FuturesChartPanel,{underlying:r,seq:s.seq,style:{height:Math.max(320,t-8),borderWidth:0}}):Y}function ae({w:e,width:t,height:r}){const n=(0,w.useWorkspace)(),c=(0,w.instrumentOf)(e,n.selected),u=(0,w.expiryOf)(e,n.selected),h=(0,d.useDerivativeRead)(c?O(`/api/workspace/volume?underlying=${P(c)}`,u):null,n.seq);if(!c)return Y;const g=h.data;if(!g)return(0,E.jsx)(R,{icon:"loader",title:h.error||'Reading volume\u2026'});if(!g.available)return(0,E.jsx)(R,{icon:"clock",title:g.text});const y=(g.points||[]).filter(e=>!e.opening),p=Math.max(1,...y.map(e=>Math.max(e.ce||0,e.pe||0))),x=Math.max(200,t-40),f=Math.max(120,r-150),m=Math.max(2,x/Math.max(1,y.length)/2.6);return(0,E.jsxs)(i.default,{style:{gap:6},children:[(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:[g.expiry," \xb7 per 15-min interval \xb7 ",(0,E.jsx)(o.T,{style:[_.TYPE.helper,{color:o.C.green}],children:"calls"})," / ",(0,E.jsx)(o.T,{style:[_.TYPE.helper,{color:o.C.red}],children:"puts"})]}),(0,E.jsxs)(a.default,{width:x,height:f,children:[(0,E.jsx)(l.Line,{x1:0,y1:f-1,x2:x,y2:f-1,stroke:o.C.line}),y.map((e,t)=>{const r=(t+.5)*x/y.length;return(0,E.jsx)(s.default.Fragment,{children:e.gap?null:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(l.Rect,{x:r-m-1,y:f-(e.ce||0)/p*(f-4),width:m,height:(e.ce||0)/p*(f-4),fill:o.C.green,opacity:.85}),(0,E.jsx)(l.Rect,{x:r+1,y:f-(e.pe||0)/p*(f-4),width:m,height:(e.pe||0)/p*(f-4),fill:o.C.red,opacity:.85})]})},e.at)})]}),(0,E.jsxs)(i.default,{style:o.s.between,children:[(0,E.jsx)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:y[0]?.at}),(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:["peak ",(j=p,j>=1e7?`${(j/1e7).toFixed(1)}Cr`:j>=1e5?`${(j/1e5).toFixed(1)}L`:`${Math.round(j/1e3)}K`)]}),(0,E.jsx)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:y[y.length-1]?.at})]}),(0,E.jsx)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:g.definition})]});var j}function oe({symbol:e}){const t=(0,w.useWorkspace)(),s=t.selected.underlying===e?t.selected.focus:null,r=(0,d.useDerivativeRead)(s?.scanner_id?`/api/workspace/scanner
1168-context?underlying=${P(e)}&scanner_id=${P(s.scanner_id)}&match_key=${P(s.match_key||'')}`:null,t.seq),n=r.data?.context;return n?(0,E.jsxs)(i.default,{style:{gap:4,padding:10,borderRadius:10,borderWidth:1,borderColor:o.C.greenLine,backgroundColor:o.C.soft,marginBottom:8},children:[(0,E.jsxs)(o.T,{style:[_.TYPE.label,{color:o.C.green}],children:[n.mine?'YOUR SCANNER':'KANIDA SCANNER'," \xb7 ",n.scanner]}),(0,E.jsx)(o.T,{style:_.TYPE.body,children:n.status_text}),(n.agreement||[]).map((e,t)=>(0,E.jsxs)(i.default,{style:[o.s.row,{gap:6,alignItems:'flex-start'}],children:[(0,E.jsx)(o.Icon,{name:!0===e.agrees?'check-circle':!1===e.agrees?'git-branch':'minus-circle',size:12,color:!0===e.agrees?o.C.green:!1===e.agrees?o.C.amber:o.C.muted}),(0,E.jsx)(o.T,{style:[_.TYPE.helper,{flex:1,color:!1===e.agrees?o.C.amber:o.C.ink}],children:e.text})]},t))]}):null}function de({w:e,height:t}){const s=(0,w.useWorkspace)(),r=(0,w.instrumentOf)(e,s.selected),n=(0,w.expiryOf)(e,s.selected),l=G(r,n,s.seq),a=e=>r?O(`/api/derivatives/${e}?underlying=${P(r)}`,n):null,o=(0,d.useDerivativeRead)(a('pcr-series'),s.seq),c=(0,d.useDerivativeRead)(a('maxpain-series'),s.seq),u=(0,d.useDerivativeRead)(a('iv-series'),s.seq),h=(0,d.useDerivativeRead)(a('oi-by-strike'),s.seq);return r?(0,E.jsxs)(i.default,{style:{flex:1},children:[(0,E.jsx)(oe,{symbol:r}),(0,E.jsx)(m.SignalPanel,{symbol:r,read:l,pcr:o.data,maxPain:c.data,iv:u.data,standing:h.data,style:{height:Math.max(360,t-8),width:'100%',borderWidth:0}})]}):Y}function ce({w:e,height:t}){const s=(0,w.useWorkspace)(),r=(0,w.instrumentOf)(e,s.selected),n=G(r,(0,w.expiryOf)(e,s.selected),s.seq);return r?(0,E.jsx)(j.SignalTable,{symbol:r,read:n,style:{height:Math.max(320,t-8),borderWidth:0}}):Y}const ue={scanner:'Your scanner',context:'Why this instrument',changed:'What changed',where:'Where',persistent:'Persistent',conflicting:'Conflicting',key_strikes:'Key strikes',unusual:'Unusual'};function he({w:e}){const s=(0,w.useWorkspace)(),r=(0,w.instrumentOf)(e,s.selected),n=e.settings.scope||'connected',l=(0,t.useMemo)(()=>Array.from(new Set(s.widgets.filter(t=>t.widget_id!==e.widget_id&&(0,w.instrumentOf)(t,s.selected)===r).map(e=>e.widget_type))).sort(),[s.widgets,s.selected,r,e.widget_id]),a=s.selected.underlying===r?s.selected.focus:null,[d,c]=(0,t.useState)(null),[u,h]=(0,t.useState)(''),g=JSON.stringify([r,l,n,a,s.seq]);if((0,t.useEffect)(()=>{if(!r)return;let e=!0;return h(''),S.wsApi.summary({underlying:r,sources:l,scope:n,focus:a}).then(t=>{e&&c(t)},t=>{e&&h(t?.message||'')}),()=>{e=!1}},[g]),!r)return Y;if(u)return(0,E.jsx)(R,{icon:"alert-circle",title:"The summary could not be read",detail:u});if(!d||d.underlying!==r)return(0,E.jsx)(R,{icon:"loader",title:"Reading the connected widgets\u2026"});if(!d.available)return(0,E.jsx)(R,{icon:"clock",title:d.text||''});return(0,E.jsxs)(i.default,{style:{gap:12},children:[(0,E.jsxs)(i.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,E.jsx)(o.Badge,{label:"AI SUMMARY \xb7 RULES, NOT A MODEL",tone:"neutral"}),(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:[r," \xb7 ",d.expiry," \xb7 the ",String(d.as_of).slice(11,16)," reading"]})]}),['scanner','context','changed','where','persistent','conflicting','key_strikes','unusual'].map(e=>{const t=d.sections?.[e]||[];return t.length?(0,E.jsxs)(i.default,{style:{gap:4},children:[(0,E.jsx)(o.T,{style:[_.TYPE.label,{fontSize:10,color:'conflicting'===e?o.C.amber:'scanner'===e?o.C.green:o.C.muted}],children:'scanner'===e?d.scanner?.mine?'Your scanner':'KANIDA scanner':ue[e]}),t.map((e,t)=>(0,E.jsxs)(i.default,{style:[o.s.row,{gap:8,alignItems:'flex-start'}],children:[(0,E.jsx)(o.T,{style:[_.TYPE.body,{flex:1}],children:e.text}),(0,E.jsx)(o.T,{style:[_.TYPE.helper,{color:o.C.muted,paddingTop:4}],children:e.source})]},t))]},e):null}),(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:["Read from: ",(d.read_from||[]).join(', '),".",d.not_read?.length?` Not read (no widget on this workspace): ${d.not_read.join(', ')} \u2014 add one, or set the summary to read all sources.`:''," ",d.caveat]})]})}function ge(){const e=(0,w.useWorkspace)(),t=(0,d.useDerivativeRead)('/api/derivatives/signal-noise',e.seq),s=t.data;if(!s)return(0,E.jsx)(R,{icon:"loader",title:t.error||'Reading the audit\u2026'});if(!s.insights)return(0,E.jsx)(R,{icon:"clock",title:"No readings audited for this session yet"});const r=e=>'number'==typeof e?`${Math.round(100*e)}%`:'\u2014',n=s.final||{},l=(e,t,s)=>(0,E.jsxs)(i.default,{style:{flex:1,minWidth:110,gap:2},children:[(0,E.jsx)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:e}),(0,E.jsx)(o.T,{style:_.TYPE.metric,children:t}),!!s&&(0,E.jsx)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:s})]});return(0,E.jsxs)(i.default,{style:{gap:10},children:[(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:["Session ",s.session," \xb7 ",s.insights," readings recorded \xb7 ",s.sn_version]}),(0,E.jsxs)(i.default,{style:[o.s.row,{gap:10,flexWrap:'wrap'}],children:[l('Signal',String(n.signal||0)),l('Noise',String(n.noise||0)),l('Pending',String(n.pending||0)),l('Confirmed at 15 min',r(s.confirmed_15m_rate),`baseline ${r(s.baseline_15m_rate)}`)]}),(0,E.jsx)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:"An audit of what the 15-min readings said against what followed them. It grades the readings, not a trade."})]})}function ye({height:e}){const t=(0,w.useWorkspace)(),s=I();return(0,E.jsx)(p.IndexWidget,{seq:t.seq,target:null,onTarget:s,style:{height:Math.max(320,e-8),borderWidth:0}})}function pe({height:e}){const t=(0,w.useWorkspace)(),s=I();return(0,E.jsx)(x.FuturesWidget,{underlying:"",watchlist:"all",seq:t.seq,target:null,onTarget:s,style:{height:Math.max(320,e-8),borderWidth:0}})}function xe(){const e=(0,w.useWorkspace)(),t=(0,d.useDerivativeRead)('/api/product',e.seq),s=(0,d.useDerivativeRead)('/api/screener/vocabulary',0),n=new Set(s.data?.underlyings||[]),l=t.data?.watchlist||[];return t.data?l.length?(0,E.jsx)(i.default,{style:{gap:4},children:l.map(t=>{const s=String(t.symbol||'').toUpperCase(),i=n.has(s);return(0,E.jsxs)(r.default,{disabled:!i,accessibilityRole:"button",onPress:()=>e.select({underlying:s,expiry:null,focus:null}),style:({pressed:t})=>[o.s.between,{paddingHorizontal:10,paddingVertical:8,borderRadius:9,opacity:i?t?.7:1:.5,backgroundColor:e.selected.underlying===s?o.C.soft:'transparent'}],children:[(0,E.jsx)(o.T,{style:_.TYPE.title,children:s}),(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:[t.pattern_name||t.pattern," \xb7 ",t.timeframe,i?'':' \xb7 no F&O']})]},t.id)})}):(0,E.jsx)(R,{icon:"eye",title:"Your watchlist is empty",detail
1168:"Add setups to watch from Discover or the chart."}):(0,E.jsx)(R,{icon:"loader",title:"Reading your watchlist\u2026"})}function fe(){const e=(0,w.useWorkspace)(),t=(0,d.useDerivativeRead)(`/api/screener/alerts?seq=${e.seq}`,e.seq),s=t.data?.alerts||[];return t.data?s.length?(0,E.jsx)(i.default,{style:{gap:6},children:s.map(t=>{const s=String(t.entity_key||'').split('|')[0];return(0,E.jsxs)(r.default,{onPress:()=>s&&e.select({underlying:s,expiry:String(t.entity_key).split('|')[1]||null,focus:null}),style:({pressed:e})=>({gap:3,padding:9,borderRadius:9,borderWidth:1,borderColor:o.C.line,opacity:t.read?e?.5:.7:e?.7:1}),children:[(0,E.jsxs)(i.default,{style:[o.s.row,{gap:6}],children:[(0,E.jsx)(o.Badge,{label:'new'===t.kind?'NEW':'ended'===t.kind?'ENDED':'CHANGED',tone:'ended'===t.kind?'neutral':'changed'===t.kind?'amber':'green'}),(0,E.jsxs)(o.T,{style:[_.TYPE.helper,{color:o.C.muted}],children:[String(t.reading_at).slice(11,16)," \xb7 ",t.scanner_name]})]}),(0,E.jsx)(o.T,{style:_.TYPE.title,children:t.title}),(0,E.jsx)(o.T,{numberOfLines:2,style:[_.TYPE.helper,{color:o.C.muted}],children:t.text})]},t.id)})}):(0,E.jsx)(R,{icon:"bell",title:"No alerts yet",detail:'Turn on "Notify me when\u2026" on any scanner. Only changes are sent.'}):(0,E.jsx)(R,{icon:"loader",title:"Reading alerts\u2026"})}const me={screener_results:F,screener_builder:H,scanners:U,market_scan:V,option_chain:z,oi_by_strike:K,oi_session:J,iv:X,pcr:Z,max_pain:ee,greeks:ne,key_strikes:ie,price_chart:le,volume:ae,signal:de,ai_summary:he,session_history:ce,signal_noise:ge,futures_buildup:te,index_dashboard:ye,futures_list:pe,watchlist:xe,alerts:fe},je=new Set(['option_chain','market_scan','price_chart','signal','session_history','index_dashboard','futures_list']),be=new Set(['pcr','max_pain','iv','futures_buildup','oi_by_strike','oi_session'])},1075,[11,375,385,13,840,821,1071,1076,1077,1094,1096,1095,1099,1100,1101,1102,1105,984,1044,1043,1045,1072,1074,1066,1069,6]); 1169__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.ChainWidget=function({underlying:e,expiry:f,at:T,seq:k,target:w,onTarget:S,filterCount:$,onCustomize:v,onExpand:H,expanded:z,onClose:O,highlight:P,onHighlight:I,style:R}){const A=e?`/api/derivatives/chain?underlying=${encodeURIComponent(e)}${f?`&expiry=${encodeURIComponent(f)}`:''}${T?`&at=${encodeURIComponent(T)}`:''}`:null,E=(0,h.useDerivativeRead)(A,k),L=E.data,W=(0,c.stateOf)(E,'No strike of this expiry has been captured yet.'),M=L?.baseline_sessions_required??3,q=e=>S({underlying:e.underlying,instrumentToken:e.instrument_token,label:e.tradingsymbol||e.underlying,detail:`${(0,p.strike)(e.strike)} ${e.instrument_type} \xb7 ${(0,p.dteText)(e.days_to_expiry)}`}),F=L?.rows||[],N=(0,t.useMemo)(()=>(0,p.nearestStrikeIndex)(F,L?.spot),[F,L?.spot]),U=(0,t.useRef)(null),B=n.default.useCallback(e=>{null!=N&&U.current?.scrollTo?.({y:(0,p.chainStartRow)(F,L?.spot)*j,animated:e})},[N,F,L?.spot]);(0,t.useEffect)(()=>{B(!1)},[e,L?.expiry,N,B]);const X=e?`${e}${L?.expiry?` \xb7 ${L.expiry}`:''}${null!=L?.days_to_expiry?` \xb7 ${(0,p.dteText)(L.days_to_expiry)}`:''}${null!=L?.spot?` \xb7 spot ${(0,p.spotLevel)(L.spot,e)}`:''}`:'';return e?(0,x.jsxs)(c.WidgetFrame,{name:"Option chain",subtitle:X,body:L,state:W,onRefresh:E.reload,filterCount:$,onCustomize:v,onExpand:H,expanded:z,onClose:O,showsSignals:['oi_change_day','buildup_day','premium_cr','volume_ratio'],style:R,toolbar:null==N?void 0:(0,x.jsxs)(s.default,{style:[u.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,x.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`Scroll the chain back to ${(0,p.strike)(F[N]?.strike)}, the strike nearest the captured spot`,onPress:()=>B(!0),hitSlop:b,style:e=>[u.s.row,{gap:5,minHeight:24,paddingHorizontal:8,borderRadius:6,borderWidth:1,borderColor:e.hovered||e.focused?u.C.green:u.C.line,backgroundColor:e.hovered||e.focused?u.C.soft:'transparent'}],children:[(0,x.jsx)(y.HitArea,{slop:b}),(0,x.jsx)(u.Icon,{name:"crosshair",size:11,color:u.C.mint}),(0,x.jsxs)(u.T,{numberOfLines:1,style:{fontSize:10,lineHeight:14,color:u.C.mint},children:["At the money ",(0,p.strike)(F[N]?.strike)]})]}),(0,x.jsxs)(u.T,{style:c.metaText,children:["Spot ",(0,p.spotLevel)(L?.spot,e)," at this reading"]})]}),inBlock:!0,note:(0,x.jsxs)(s.default,{style:{gap:2},children:[(0,x.jsxs)(u.T,{style:c.metaText,children:[(0,p.asOfText)(L?.as_of)," \xb7 ",(0,p.floorsText)(L?.floors,L?.floors_text)]}),(0,x.jsx)(u.T,{style:c.metaText,children:null==N?p.CHAIN_NO_SPOT_TEXT:p.CHAIN_AT_MONEY_TEXT}),(0,x.jsx)(u.T,{style:c.metaText,children:"Build-up here is the day-on-day reading; the 15-minute reading is a separate label and is never mixed into it (\xa73.1). Pointing at a strike lights the same strike wherever else it is on this tab."})]}),children:[(0,x.jsxs)(s.default,{style:[u.s.row,{paddingHorizontal:9,minHeight:22,gap:5}],children:[(0,x.jsx)(u.T,{style:[c.head,{flex:1}],children:"Calls"}),(0,x.jsx)(u.T,{style:[c.head,{width:C.oi,textAlign:'right'}],children:"OI"}),(0,x.jsx)(u.T,{style:[c.head,{width:C.prem,textAlign:'right'}],children:"Premium"}),(0,x.jsx)(u.T,{style:[c.head,{width:58,textAlign:'center'}],children:"Strike"}),(0,x.jsx)(u.T,{style:[c.head,{flex:1}],children:"Puts"}),(0,x.jsx)(u.T,{style:[c.head,{width:C.oi,textAlign:'right'}],children:"OI"}),(0,x.jsx)(u.T,{style:[c.head,{width:C.prem,textAlign:'right'}],children:"Premium"})]}),(0,x.jsx)(o.default,{ref:U,style:{flex:1},contentContainerStyle:{paddingBottom:8},children:(0,x.jsx)(s.default,{...(0,c.webOnly)({role:'listbox'}),"aria-label":`Option chain for ${e}`,children:F.map(e=>{const t=null!=L?.spot&&Math.abs(e.strike-L.spot)<=Math.max(1,.002*(L.spot||0)),n=null!=P&&Math.abs(e.strike-P)<.5;return(0,x.jsxs)(s.default,{onPointerEnter:I?()=>I(e.strike):void 0,onPointerLeave:I?()=>I(null):void 0,style:[u.s.row,{gap:4,height:j,paddingHorizontal:3,borderRadius:8,borderWidth:1,borderColor:n||t?u.C.mint:'transparent',backgroundColor:n?u.C.dark:t?'#0C1E1A':'transparent'}],children:[(0,x.jsx)(_,{row:e.ce,side:"CE",selected:!!e.ce&&w?.instrumentToken===e.ce.instrument_token,required:M,onPress:q}),(0,x.jsx)(s.default,{style:{width:58,alignItems:'center',justifyContent:'center',paddingVertical:2},children:(0,x.jsx)(u.T,{style:[c.tab,{fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:n||t?u.C.mint:u.C.ink}],children:(0,p.strike)(e.strike)})}),(0,x.jsx)(_,{row:e.pe,side:"PE",selected:!!e.pe&&w?.instrumentToken===e.pe.instrument_token,required:M,onPress:q})]},e.strike)})})})]}):(0,x.jsx)(c.WidgetFrame,{name:"Option chain",body:null,filterCount:$,onCustomize:v,onClose:O,state:{phase:'empty',text:'Click any row on the screener above, or choose a symbol in Customize, to see a chain.'},footer:null,style:R})};var t=r(d[0]),n=e(t),s=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),u=r(d[4]),h=r(d[5]),c=r(d[6]),p=r(d[7]),y=r(d[8]),x=r
1169(d[9]);const f=(0,y.touchSlop)(38),b=(0,y.touchSlop)(24),C={oi:52,prem:58},j=44;function _({row:e,side:t,selected:n,required:o,onPress:h}){if(!e)return(0,x.jsx)(s.default,{style:{flex:1,minHeight:38,justifyContent:'center',paddingHorizontal:6},children:(0,x.jsx)(u.T,{style:{fontSize:11,color:u.C.muted},children:"\u2014"})});const b=`${'CE'===t?'Call':'Put'} ${(0,p.strike)(e.strike)}. Open interest ${(0,p.compact)(e.oi)}, change ${(0,p.signedUnits)(e.oi_change_day)}, premium ${(0,p.crore)(e.premium_cr)}, ${(0,p.buildupLabel)(e.buildup_day)} on the day, volume ${(0,p.volumeRatioShort)(e,o)} of its own median`;return(0,x.jsxs)(l.default,{role:"option","aria-selected":n,accessibilityLabel:b,...(0,c.webOnly)({tabIndex:0}),onPress:()=>h(e),hitSlop:f,style:e=>[u.s.row,{flex:1,gap:5,minHeight:38,paddingHorizontal:6,borderRadius:7,borderWidth:n||e.focused?2:1,borderColor:n||e.focused?u.C.green:'transparent',backgroundColor:n?u.C.soft:e.hovered||e.focused?'#0F1F28':'transparent'}],children:[(0,x.jsx)(y.HitArea,{slop:f}),(0,x.jsxs)(s.default,{style:{flex:1,minWidth:0},children:[(0,x.jsx)(u.T,{numberOfLines:1,style:[c.tab,{fontSize:12,lineHeight:16}],children:(0,p.price)(e.last_price)}),(0,x.jsx)(u.T,{numberOfLines:1,style:{fontSize:9,lineHeight:12,color:(0,c.buildupColor)((0,p.buildupTone)(e.buildup_day))},children:(0,p.buildupLabel)(e.buildup_day)})]}),(0,x.jsxs)(s.default,{style:{width:C.oi,alignItems:'flex-end'},children:[(0,x.jsx)(u.T,{style:[c.tab,{fontSize:11,lineHeight:15}],children:(0,p.compact)(e.oi)}),(0,x.jsx)(u.T,{style:[c.tab,{fontSize:9,lineHeight:12,color:(0,c.tone)(e.oi_change_day)}],children:(0,p.signedUnits)(e.oi_change_day)})]}),(0,x.jsxs)(s.default,{style:{width:C.prem,alignItems:'flex-end'},children:[(0,x.jsx)(u.T,{style:[c.tab,{fontSize:11,lineHeight:15}],children:(0,p.crore)(e.premium_cr)}),(0,x.jsx)(u.T,{style:[c.tab,{fontSize:9,lineHeight:12,color:u.C.muted}],children:(0,p.volumeRatioShort)(e,o)})]})]})}},1076,[11,13,278,375,821,1071,1074,984,832,6]); 1170__d(function(g,_r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"OI_LINK_TEXT",{enumerable:!0,get:function(){return j}}),_e.OiByStrikeSection=function({underlying:e,badge:i,linked:l,expiry:n,at:s,seq:o,onTarget:b,stacked:k,pinFirst:f,filterCount:w,onCustomize:j,height:M,hidden:T,onHide:S,expanded:I,onExpand:R,highlight:O,onHighlight:P}){const L=e?`/api/derivatives/oi-by-strike?underlying=${encodeURIComponent(e)}${n?`&expiry=${encodeURIComponent(n)}`:''}${s?`&at=${encodeURIComponent(s)}`:''}`:null,H=(0,r.useDerivativeRead)(L,o),E=H.data,U=(0,h.stateOf)(H,'No open interest has been captured for this expiry yet.'),[z,F]=(0,t.useState)(null),$=E?.rows||[],W=e?e+(E?.expiry?' \xb7 '+E.expiry:'')+(null!=E?.days_to_expiry?' \xb7 '+(0,c.dteText)(E.days_to_expiry):''):'',B=(0,t.useMemo)(()=>[{key:'strike',label:'Strike',width:80,value:C.strike,render:e=>(0,y.jsx)(u.Cell,{text:(0,c.strike)(e.strike),bold:!0,size:12})},{key:'ce_oi',label:'Call OI',width:74,align:'right',value:C.ce_oi,render:e=>(0,y.jsx)(u.Cell,{text:(0,c.compact)(e.ce_oi)})},{key:'ce_chg',label:'Call chg',width:84,align:'right',value:C.ce_chg,render:e=>(0,y.jsx)(u.Cell,{text:(0,c.signedUnits)(e.ce_oi_change_day),color:(0,h.tone)(e.ce_oi_change_day)})},{key:'ce_buildup',label:'Call build-up',width:108,value:C.ce_buildup,render:e=>(0,y.jsx)(u.Cell,{text:(0,c.buildupLabel)(e.ce_buildup_day),color:(0,h.buildupColor)((0,c.buildupTone)(e.ce_buildup_day))})},{key:'pe_oi',label:'Put OI',width:74,align:'right',value:C.pe_oi,render:e=>(0,y.jsx)(u.Cell,{text:(0,c.compact)(e.pe_oi)})},{key:'pe_chg',label:'Put chg',width:84,align:'right',value:C.pe_chg,render:e=>(0,y.jsx)(u.Cell,{text:(0,c.signedUnits)(e.pe_oi_change_day),color:(0,h.tone)(e.pe_oi_change_day)})},{key:'pe_buildup',label:'Put build-up',width:108,grow:!0,value:C.pe_buildup,render:e=>(0,y.jsx)(u.Cell,{text:(0,c.buildupLabel)(e.pe_buildup_day),color:(0,h.buildupColor)((0,c.buildupTone)(e.pe_buildup_day))})}],[]),D=(0,t.useMemo)(()=>(z?(0,c.sortRows)($,C[z.key]||(()=>null),z.dir):$).map(e=>({kind:'row',key:'s-'+e.strike,row:e})),[$,z]),N=!e,A=e=>!(T?.[e]||I&&I!==e),q=e?U:{phase:'empty',text:'Click any row on the screener above, or choose a symbol in Customize, to see open interest by strike.'}
1170,K=e?{label:'Max pain strike',value:(0,c.strike)(E?.max_pain_strike),against:(0,c.maxPainAgainstSpot)(E?.max_pain_strike,E?.spot,null!=E?.max_pain_strike&&null!=E?.spot?E.max_pain_strike-E.spot:null,void 0,void 0,e),reason:'No max-pain strike has been computed for this expiry at this reading.'}:{label:'Max pain strike',value:c.DASH,reason:'Click any row on the screener above, or choose a symbol in Customize, to point this block at one.'},X=(0,_.uxPreview)((0,p.useAuth)()?.config),G=X&&E&&null==E.spot&&null==E.spot_last&&e?`/api/derivatives/maxpain-series?underlying=${encodeURIComponent(e)}${E?.expiry||n?`&expiry=${encodeURIComponent(E?.expiry||n)}`:''}`:null,J=(0,r.useDerivativeRead)(G,o),Q=(0,t.useMemo)(()=>X?(0,_.resolveSpot)(E,J.data?.points):null,[X,E,J.data]);return(0,y.jsx)(h.Block,{title:"OI by strike",subtitle:"Where the open interest actually stands at this reading, and the strike the standing book pays least at.",asOf:(0,c.asOfText)(E?.as_of),badge:i,linked:l,headline:K,stacked:k,height:M,idle:N,chart:t=>A('oi_chart')?X?(0,y.jsx)(x.OiStrikeChart,{body:E,spot:Q,state:q,underlying:e,subtitle:W,onRefresh:H.reload,onExpand:R?()=>R('oi_chart'):void 0,expanded:'oi_chart'===I,onClose:S?()=>S('oi_chart'):void 0,highlight:O,onHighlight:P,style:t},"oi_chart"):(0,y.jsx)(v,{body:E,state:q,underlying:e,subtitle:W,onRefresh:H.reload,onExpand:R?()=>R('oi_chart'):void 0,expanded:'oi_chart'===I,onClose:S?()=>S('oi_chart'):void 0,highlight:O,onHighlight:P,style:t},"oi_chart"):null,content:t=>A('oi_table')?(0,y.jsx)(h.WidgetFrame,{name:"OI by strike",subtitle:W,body:E,state:q,onRefresh:H.reload,filterCount:w,onCustomize:j,onExpand:R?()=>R('oi_table'):void 0,expanded:'oi_table'===I,onClose:S?()=>S('oi_table'):void 0,showsSignals:['oi_change_day','buildup_day'],inBlock:!0,note:N?void 0:(0,c.maxPainBasis)(E?.total_ce_oi,E?.total_pe_oi),style:t,children:(0,y.jsx)(u.Table,{label:"Open interest by strike",columns:B,items:D,sort:z,pinFirst:f,onSort:e=>F(t=>(0,c.nextSort)(t,e)),onRowHover:e=>P?.(e?Number(e.strike):null),lit:e=>null!=O&&Math.abs(Number(e.strike)-O)<.5,onRowPress:t=>b({underlying:e,instrumentToken:null,label:e,detail:'Strike '+(0,c.strike)(t.strike)}),rowLabel:e=>'Strike '+(0,c.strike)(e.strike)+'. Call open interest '+(0,c.compact)(e.ce_oi)+', change '+(0,c.signedUnits)(e.ce_oi_change_day)+', '+(0,c.buildupLabel)(e.ce_buildup_day)+'. Put open interest '+(0,c.compact)(e.pe_oi)+', change '+(0,c.signedUnits)(e.pe_oi_change_day)+', '+(0,c.buildupLabel)(e.pe_buildup_day)})},"oi_table"):null})};var t=_r(d[0]),i=e(t),l=e(_r(d[1])),n=_r(d[2]),s=e(n),o=_r(d[3]),r=_r(d[4]),h=_r(d[5]),u=_r(d[6]),c=_r(d[7]),p=_r(d[8]),x=_r(d[9]),_=_r(d[10]),y=_r(d[11]);const b='#F17D87',k='#39E5A3',f=18,w="Each bar is the open interest standing at this reading. Max pain is computed from that same standing book (\xa73.6); neither is a forecast.",j='Pointing at a bar lights that strike in the table beside it, and wherever else the same strike is on this tab. It highlights; it changes nothing.',C={strike:e=>e.strike,ce_oi:e=>e.ce_oi,ce_chg:e=>e.ce_oi_change_day,ce_buildup:e=>e.ce_buildup_day,pe_oi:e=>e.pe_oi,pe_chg:e=>e.pe_oi_change_day,pe_buildup:e=>e.pe_buildup_day};function v({body:e,state:r,underlying:u,subtitle:p,onRefresh:x,onExpand:_,expanded:C,onClose:v,highlight:M,onHighlight:T,style:S}){const[I,R]=(0,t.useState)({w:0,h:0}),O=e?.rows||[],P=(0,c.oiPeak)(O),L=(0,c.nearestStrikeIndex)(O,e?.spot),H=(0,c.nearestStrikeIndex)(O,e?.max_pain_strike),E=Math.max(80,I.h),U=Math.max(0,I.w-16),z=O.length?U/O.length:0,F=Math.max(2,Math.min(9,z/2-1)),$=E-f,W=e=>null!=e&&P?Math.max(e>0?1:0,e/P*$):0,{cursor:B,hover:D}=(0,h.useHoverIndex)((e,t)=>{if(!O.length||z<=0)return null;const i=t>0&&I.w>0?I.w/t:1;return Math.max(0,Math.min(O.length-1,Math.floor((e*i-8)/z)))}),N=null!=B?O[B]:null;i.default.useEffect(()=>{T?.(N?Number(N.strike):null)},[N,T]);const A=null==M?null:(0,c.nearestStrikeIndex)(O,M);return(0,y.jsx)(h.WidgetFrame,{name:u?u+' \xb7 call and put open interest by strike':'OI by strike',subtitle:p,body:e,state:r,onRefresh:x,onExpand:_,expanded:C,onClose:v,showsSignals:['oi_change_day'],inBlock:!0,style:S,note:(0,y.jsxs)(l.default,{style:{gap:3},children:[(0,y.jsx)(o.T,{style:h.metaText,children:w}),(0,y.jsx)(o.T,{style:h.metaText,children:j})]}),children:(0,y.jsxs)(l.default,{style:{flex:1,minHeight:0,padding:10,gap:8}
1170,children:[N?(0,y.jsx)(h.CrosshairReadout,{time:(0,c.strike)(N.strike),rows:[{label:'Call OI',value:(0,c.compact)(N.ce_oi),color:b},{label:'Put OI',value:(0,c.compact)(N.pe_oi),color:k}]}):(0,y.jsxs)(l.default,{style:[o.s.row,{gap:12,flexWrap:'wrap',minHeight:24}],children:[(0,y.jsxs)(l.default,{style:[o.s.row,{gap:5}],children:[(0,y.jsx)(l.default,{style:{width:9,height:9,borderRadius:2,backgroundColor:b}}),(0,y.jsx)(o.T,{style:h.metaText,children:"Call OI"})]}),(0,y.jsxs)(l.default,{style:[o.s.row,{gap:5}],children:[(0,y.jsx)(l.default,{style:{width:9,height:9,borderRadius:2,backgroundColor:k}}),(0,y.jsx)(o.T,{style:h.metaText,children:"Put OI"})]}),(0,y.jsx)(l.default,{style:{flex:1}}),(0,y.jsxs)(o.T,{style:h.metaText,children:["Max pain ",null!=e?.max_pain_strike?(0,c.strike)(e.max_pain_strike):c.DASH,null!=e?.spot?' \xb7 spot '+(0,c.spotLevel)(e.spot,u):'']})]}),(0,y.jsx)(l.default,{style:{flex:1,minHeight:80},...D,onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout,l=Math.round(t),n=Math.round(i);R(e=>Math.abs(e.w-l)<3&&Math.abs(e.h-n)<3?e:{w:l,h:n})},children:I.w>0&&!!P&&(0,y.jsxs)(s.default,{width:I.w,height:E,accessibilityLabel:'Open interest by strike for '+u+'. Largest position '+(0,c.compact)(P)+' contracts.',children:[null!=A&&(0,y.jsx)(n.Rect,{x:8+A*z-2,y:0,width:2*F+5,height:$,fill:o.C.mint,opacity:.14,rx:2}),O.map((e,t)=>{const l=8+t*z,s=W(e.ce_oi),o=W(e.pe_oi);return(0,y.jsxs)(i.default.Fragment,{children:[(0,y.jsx)(n.Rect,{x:l,y:$-s,width:F,height:s,fill:b,opacity:.85,rx:1}),(0,y.jsx)(n.Rect,{x:l+F+1,y:$-o,width:F,height:o,fill:k,opacity:.85,rx:1})]},e.strike)}),(0,y.jsx)(n.Line,{x1:0,x2:I.w,y1:$,y2:$,stroke:o.C.line,strokeWidth:1}),null!=H&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(n.Line,{x1:8+H*z+F,x2:8+H*z+F,y1:0,y2:$,stroke:o.C.amber,strokeDasharray:"3 3",strokeWidth:1}),(0,y.jsx)(n.Text,{x:Math.min(I.w-46,8+H*z+F+3),y:11,fill:o.C.amber,fontSize:9,children:"max pain"})]}),null!=L&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(n.Line,{x1:8+L*z+F,x2:8+L*z+F,y1:0,y2:$,stroke:o.C.mint,strokeWidth:1}),(0,y.jsx)(n.Text,{x:Math.min(I.w-28,8+L*z+F+3),y:$-4,fill:o.C.mint,fontSize:9,children:"spot"})]}),O.map((e,t)=>t%Math.max(1,Math.ceil(O.length/6))===0?(0,y.jsx)(n.Text,{x:8+t*z,y:E-4,fill:o.C.muted,fontSize:9,children:(0,c.strike)(e.strike)},'t'+e.strike):null)]})}),(0,y.jsx)(o.T,{style:h.metaText,children:(0,c.maxPainBasis)(e?.total_ce_oi,e?.total_pe_oi)})]})})}},1077,[11,13,840,821,1071,1074,1078,984,198,1079,1080,6]); 1171__d(function(g,r,_i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Table=function({label:e,columns:i,items:f,sort:h,onSort:b,onRowPress:y,selected:C,lit:p,onRowHover:w,rowLabel:x,pinFirst:j,rowHeight:k=34}){const H=i.reduce((e,o)=>e+o.width,0),z=(e,o,t)=>[{width:e.width,paddingHorizontal:6,justifyContent:'center',alignItems:c(e.align)},e.grow?{flex:1,minWidth:e.width,width:void 0}:null,u(!!j&&0===o,t)];return(0,a.jsx)(t.default,{horizontal:!0,showsHorizontalScrollIndicator:!0,style:{flex:1},contentContainerStyle:{minWidth:'100%',flexGrow:1},children:(0,a.jsxs)(o.default,{style:{flex:1,minWidth:H},children:[(0,a.jsx)(o.default,{role:"row",style:[l.s.row,{gap:0,minHeight:26,borderBottomWidth:1,borderColor:l.C.line,backgroundColor:l.C.paper,paddingHorizontal:6}],children:i.map((e,t)=>{const i=h?.key===e.key,u=!!e.value&&!!b,f=(0,a.jsxs)(o.default,{style:[l.s.row,{gap:3,minWidth:0,overflow:'hidden',justifyContent:c(e.align)}],children:[(0,a.jsx)(l.T,{numberOfLines:1,style:[s.head,{flexShrink:1,minWidth:0,color:i?l.C.ink:l.C.muted}],children:e.label}),i&&(0,a.jsx)(l.Icon,{name:'asc'===h?.dir?'arrow-up':'arrow-down',size:11,color:l.C.green}),!!e.filter&&(0,a.jsx)(l.Icon,{name:"filter",size:10,color:l.C.muted})]}),y=i?'asc'===h?.dir?'ascending':'descending':u?'none':void 0;return u?(0,a.jsx)(n.default,{role:"columnheader",accessibilityRole:"button",accessibilityLabel:`Sort by ${e.label}`,...(0,s.webOnly)({'aria-sort':y,tabIndex:0}),onPress:()=>b?.(e.key),style:o=>[z(e,t,l.C.paper),{backgroundColor:o.hovered||o.focused?l.C.soft:l.C.paper}],children:f},e.key):(0,a.jsx)(o.default,{role:"columnheader",...(0,s.webOnly)({'aria-sort':y}),style:z(e,t,l.C.paper),children:f},e.key)})}),(0,a.jsx)(t.default,{style:{flex:1},contentContainerStyle:{paddingBottom:6},children:(0,a.jsx)(o.default,{...(0,s.webOnly)({role:'rowgroup'}),children:f.map(e=>{if('group'===e.kind)return(0,a.jsxs)(o.default,{role:"row",style:[l.s.row,{minHeight:26,paddingHorizontal:12,gap:8,backgroundColor:l.C.bg,borderTopWidth:1,borderBottomWidth:1,borderColor:l.C.line}],children:[(0,a.jsx)(l.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:l.C.mint},children:e.label}),!!e.detail&&(0,a.jsx)(l.T,{numberOfLines:1,style:{flex:1,fontSize:10,lineHeight:14,color:l.C.muted},children:e.detail})]},e.key);const t=e.row,c=!!C?.(t),u=!c&&!!p?.(t),f=c?l.C.soft:u?l.C.dark:l.C.paper,h=i.map((e,n)=>(0,a.jsx)(o.default,{style:z(e,n,f),children:e.render(t)},e.key));return y?(0,a.jsx)(n.default,{role:"row","aria-selected":c,accessibilityState:{selected:c},accessibilityLabel:x(t),...(0,s.webOnly)({tabIndex:0}),onPress:()=>y(t),onHoverIn:()=>w?.(t),onHoverOut:()=>w?.(null),onFocus:()=>w?.(t),onBlur:()=>w?.(null),style:e=>[l.s.row,{gap:0,minHeight:k,paddingHorizontal:3,borderBottomWidth:1,borderLeftWidth:3,borderLeftColor:c||e.focused?l.C.green:u?l.C.mint:'transparent',borderColor:'#0F1B22',backgroundColor:c?l.C.soft:u?l.C.dark:e.hovered||e.focused?'#0F1F28':'transparent'}],children:h},e.key):(0,a.jsx)(o.default,{role:"row",style:[l.s.row,{gap:0,minHeight:k,paddingHorizontal:6,borderBottomWidth:1,borderColor:'#0F1B22'}],children:h},e.key)})})})]})})},_e.Cell=function({text:e,color:o,bold:t,size:n=11}
1171){return(0,a.jsx)(l.T,{numberOfLines:1,style:[{fontVariant:['tabular-nums']},{fontSize:n,lineHeight:n+4,color:o||l.C.ink,fontFamily:t?'InterSemi':'Inter'}],children:e})},r(d[0]);var o=e(r(d[1])),t=e(r(d[2])),n=e(r(d[3])),l=r(d[4]),i=r(d[5]),s=r(d[6]),a=r(d[7]);const c=e=>'right'===e?'flex-end':'center'===e?'center':'flex-start',u=(e,o)=>e&&i.web?{position:'sticky',left:0,zIndex:2,backgroundColor:o}:null},1078,[11,13,278,375,821,869,1074,6]); 1172__d(function(g,_r,_i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"NARROW_BELOW",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"NARROW_CHART_H",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"TIGHT_BELOW",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"SPOT_MARK",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"HINT_FROM",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"STRIKE_BAND_OPACITY",{enumerable:!0,get:function(){return W}}),Object.defineProperty(_e,"ATM_BAND_OPACITY",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"FALL_OPACITY",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"BOTH_NOTE",{enumerable:!0,get:function(){return N}}),_e.OiStrikeChart=function({body:e,spot:s,state:r,underlying:O,subtitle:v,onRefresh:W,onExpand:M,expanded:z,onClose:K,highlight:q,onHighlight:J,style:Q}){const Z=(0,u.useAuth)(),ee=(0,y.orientationKey)(Z?.user?.id),te='phone'===(0,c.useLayoutMode)(),ne=(0,o.default)().width<P,[ie,le]=(0,t.useState)(()=>D(ee));(0,t.useEffect)(()=>{le(D(ee))},[ee]);const[oe,ae]=(0,t.useState)('oi'),[se,re]=(0,t.useState)(T.DEFAULT_CHANGE_WINDOW),[de,ce]=(0,t.useState)(y.WINDOW_DEFAULT),[ue,he]=(0,t.useState)(!0),[xe,ye]=(0,t.useState)({w:0,h:0}),[fe,pe]=(0,t.useState)({x:0,y:0}),[be,ge]=(0,t.useState)(!1),me=(be||'oi'!==oe)&&O&&e?`${(0,b.oiSessionPath)({underlying:O,expiry:e.expiry,session:e.session})}${e.as_of?`&at=${encodeURIComponent(e.as_of)}`:''}`:null,Ce=(0,p.useOiSession)(me),Oe=Ce&&'ready'===Ce.state?Ce.session:null,we=(0,p.useReplay)(Oe),Se=be&&Oe?we.frame:null,je=be&&O?`/api/derivatives/maxpain-series?underlying=${encodeURIComponent(O)}${e?.expiry?`&expiry=${encodeURIComponent(e.expiry)}`:''}`:null,Te=(0,x.useDerivativeRead)(je,0),ke=Se?(0,y.frameSpot)(Se,O):s,Le=(0,t.useMemo)(()=>(0,y.toStrikeRows)(e?.rows),[e]),Ae=Se?Se.rows:Le,ve='oi'!==oe&&'prev_close'!==se,Pe=Oe?Se?Se.index:(0,y.currentIndex)(Oe.readings,e?.as_of)??Oe.readings.length-1:null,Ie=(0,t.useMemo)(()=>ve&&Oe&&null!=Pe?(0,T.changeView)(Oe,Pe,se):null,[ve,Oe,Pe,se]),Re=Ie?Ie.rows:Ae,Ee='oi'===oe?null:ve?Ie?Ie.footer:T.CHANGE_WINDOW_NOT_LOADED:'Change since previous close',He=Ie&&Ie.ok&&Ie.baseline.ok?Ie.baseline.time:null,We=ve?He?`since ${He}`:void 0:'since prev close',Me=(0,t.useMemo)(()=>{if(!be||!Oe)return null;if(!ve)return(0,y.replayExtent)(Oe,oe,(0,b.replayScaleMax)(Oe),(0,b.replayChangeScaleMax)(Oe));if('change'===oe){const e=(0,T.changeWindowScaleMax)(Oe,se);return e&&e>0?{lo:-e,hi:e}:null}const e=(0,b.replayScaleMax)(Oe);return e&&e>0?{lo:0,hi:1.04*e}:null},[be,Oe,oe,se,ve]),ze=Se?(0,y.frameTotals)(Ae):{ce:e?.total_ce_oi??null,pe:e?.total_pe_oi??null},Ne=Se?(0,y.maxPainAt)(Te.data?.points,Se.at):(0,w.maxPainStrike)(e),De=(0,t.useMemo)(()=>(0,y.windowCentre)(Re,ke?.value,Ne),[Re,ke,Ne]),$e=(0,t.useMemo)(()=>(0,y.windowRows)(Re,De.index,de),[Re,De,de]),Fe=(0,t.useMemo)(()=>(0,y.atmIndex)($e.rows,ke?.value),[$e,ke]),Be=(0,t.useMemo)(()=>(0,y.highestInView)($e.rows,Re,'call'),[$e,Re]),Ge=(0,t.useMemo)(()=>(0,y.highestInView)($e.rows,Re,'put'),[$e,Re]),Ye=(0,y.chooseOrientation)(ie,xe.w,xe.h,te),Ve=(0,t.useMemo)(()=>xe.w>0&&xe.h>0&&$e.rows.length?(0,y.layoutChart)({rows:$e.rows,mode:oe,orientation:Ye,width:xe.w,height:xe.h,spot:ke?.value??null,atm:Fe,maxPainBand:ue&&null!=Ne&&'across'===Ye?w.MAX_PAIN_BAND:0,extent:Me,labelSample:(0,y.replayLabelSample)(oe,Me),peaks:'change'===oe?{call:(0,y.topChange)($e.rows,'call')?.strike??null,put:(0,y.topChange)($e.rows,'put')?.strike??null}
1172:{call:Be.top?.strike??null,put:Ge.top?.strike??null}}):null,[$e,oe,Ye,xe,ke,Fe,ue,Ne,Me,Be,Ge]);(0,t.useEffect)(()=>{pe({x:0,y:0})},[Ye,de,oe]);const Ue=(0,j.useStrikeCursor)($e.rows,Ye,{indexAt:(e,t)=>Ve?Ve.scale.indexAt('across'===Ye?e:t):null,onActive:J,startIndex:Fe,valueText:(e,t)=>`Strike ${e.strike}${null!=Fe?", ATM"+(t-Fe===0?'':(t-Fe>0?'+':'\u2212')+Math.abs(t-Fe)):''}`}),Xe=null!=Ue.activeIndex?$e.rows[Ue.activeIndex]??null:null,Ke=(0,j.atmOffsetOf)(Ue.activeIndex,Fe),qe=Ve&&null!=Ue.activeIndex?Y(Ve,Ue.activeIndex,fe):null,Je=ue?(0,w.maxPainReason)(Ne,Ve?.scale??null):null,Qe=!ne&&xe.w>0&&xe.w<R,Ze=ne||Qe,et=(0,L.jsxs)(n.default,{style:[c.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,L.jsx)(F,{label:"Show",value:oe,onChange:e=>ae(e),options:['oi','change','both'].map(e=>({value:e,text:y.MODE_LABELS[e]}))}),'oi'!==oe&&(0,L.jsx)(k.ChangeWindowPicker,{value:se,onChange:re,disabled:!Oe,compact:Ze,reason:Oe?void 0:Ce&&'loading'!==Ce.state&&'ready'!==Ce.state?Ce.message:T.CHANGE_WINDOW_NOT_LOADED}),(0,L.jsx)(F,{label:"Strikes around ATM",value:de,onChange:ce,options:y.WINDOW_CHOICES.map(e=>({value:e,text:(0,y.windowLabel)(e)}))}),!te&&(0,L.jsx)(F,{label:"Layout",value:ie,onChange:e=>{le(e),$(ee,e)},options:['auto','across','down'].map(e=>({value:e,text:y.ORIENTATION_LABELS[e]}))})]}),tt=!!(ke&&Ve&&(0,y.placeSpotPill)(Ve,E)),nt=ke?`${E}${Ve?.spotOutside?` ${y.OUTSIDE_TEXT[Ve.spotOutside]}`:''}`:y.NO_SPOT_TEXT,it=(0,L.jsxs)(n.default,{style:[c.s.row,{gap:ne?8:12,flexWrap:'wrap',minHeight:28}],children:['both'===oe?(0,L.jsx)(n.default,{style:{flexShrink:1,minWidth:0,maxWidth:'100%'},children:(0,L.jsx)(C.OiBothLegend,{baseline:"prev_close",compact:!0,since:!1})}):'change'===oe?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(G,{color:_,label:Ze?'Call':'Call OI change'}),(0,L.jsx)(G,{color:A,label:Ze?'Put':'Put OI change'}),(0,L.jsx)(G,{color:c.C.muted,light:!0,label:Ze?'Fall':'Fall (lighter, below 0)'})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(G,{color:_,label:"Calls"}),(0,L.jsx)(G,{color:A,label:"Puts"})]}),!ne&&(0,L.jsx)(U,{}),!!Je&&(0,L.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:Je}),(0,L.jsx)(n.default,{style:{flex:1}}),tt?null:ke?(0,L.jsx)(n.default,{style:{borderWidth:1,borderColor:m.SPOT_COLOR,borderRadius:10,paddingHorizontal:7,paddingVertical:1},children:(0,L.jsx)(c.T,{style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:m.SPOT_COLOR,fontVariant:['tabular-nums']},children:nt})}):(0,L.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:nt}),(0,L.jsx)(B,{label:y.MAX_PAIN_TOGGLE,on:ue,onChange:he}),!ne&&xe.w>=H&&!be&&(0,L.jsx)(c.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:c.C.muted,flexShrink:1},children:y.PLAY_HINT}),!ne&&(0,L.jsx)(B,{label:y.PLAY_TOGGLE,on:be,onChange:ge,hint:y.PLAY_HINT})]}),lt=null!=q&&$e.rows.length?(()=>{const e=$e.rows.findIndex(e=>Math.abs(e.strike-q)<.5);return e<0?null:e})():null,ot=O?`Open interest by strike for ${O}, ${'down'===Ve?.orientation?'calls left and puts right':'calls and puts side by side'}, ${$e.rows.length} strikes${ke?`, ${ke.label}`:''}. Use the arrow keys to move across strikes.`:'Open interest by strike',at=Ve?(0,L.jsx)(n.default,{...Ue.handlers,focusable:!0,accessible:!0,accessibilityRole:"adjustable",accessibilityLabel:ot,style:{width:Ve.scale.width,height:Ve.scale.height},children:(0,L.jsx)(X,{layout:Ve,lit:lt,active:Ue.activeIndex,spot:ke,painStrike:Ne,showPain:ue})}):null,st=(0,y.statTiles)({rows:Re,totals:ze,spot:ke,changeLabel:We}),rt=Qe?st.map(e=>'call'===e.key||'put'===e.key?{...e,sub:e.sub?.replace(/\s+since .*$/,'')}:'pcr'===e.key?{...e,sub:void 0}:e):st,dt=`${(0,y.highestText)('call',Be)} \xb7 ${(0,y.highestText)('put',Ge)}`,ct=['change'===oe?y.CHANGE_NOTE:'both'===oe?N:y.OI_NOTE,Ee,...(0,y.statCoverage)(Re),'max_pain'===De.basis||'middle'===De.basis?y.CENTRE_TEXT[De.basis]:null].filter(Boolean),ut=ne?{...Q,height:void 0}:Q;return(0,L.jsx)(h.WidgetFrame,{name:O?O+' \xb7 open interest by strike':'OI by strike',subtitle:v,body:e,state:r,onRefresh:W,onExpand:M,expanded:z,onClose:K,showsSignals:['oi_change_day'],inBlock:!0,style:ut,toolbar:et,note:ne?(0,L.jsx)(n.default,{style:{gap:3},children:ct.map(e=>(0,L.jsx)(c.T,{style:h.metaText,children:e},e))}):(0,L.jsx)(c.T,{numberOfLines:2,style:h.metaText,children:ct.join(' \xb7 ')}),children:(0,L.jsxs)(n.default,{style:{flex:1,minHeight:0,paddingHorizontal:10,paddingTop:8,paddingBottom:4,gap:6},children:[!!e&&(0,L.jsx)(V,{tiles:rt,narrow:ne,tight:Qe}),!!e&&(0,L.jsx)(c.T,{numberOfLines:ne?2:1,style:{fontSize:12,lineHeight:17,color:c.C.ink,fontVariant:['tabular-nums']},children:dt}),it,(0,L.jsxs)(n.default,{testID:"oi-chart-area",style:ne?{height:I,position:'relative'}:{flex:1,minHeight:120,position:'relative'},onLayout:e=>{const{width:t,height:n}=e.nativeEvent.layout,i=Math.round(t),l=Math.round(n);ye(e=>Math.abs(e.w-i)<3&&Math.abs(e.h-l)<3?e:{w:i,h:l})},children:[at&&(Ve?.scrolls?(0,L.jsx)(i.default,{horizontal:'across'===Ve.orientation,style:{flex:1},scrollEventThrottle:32,onScroll:e=>{const t=e.nativeEvent.contentOffset;pe({x:t.x,y:t.y})},contentOffset:'down'===Ve.orientation&&null!=Fe?{x:0,y:Math.max(0,Ve.scale.at(Fe)-xe.h/2)}:void 0,children:at}):at),!ne&&Xe&&qe&&(0,L.jsx)(S.OiDetailCard,{row:Xe,atmOffset:Ke??0,pinned:Ue.pinned,onClose:Ue.clear,anchor:qe,orientation:Ye,bounds:{width:xe.w,height:xe.h}}),(0,L.jsx)(S.StrikeAnnouncer,{row:Xe,atmOffset:Ke})]}),ne&&!!e&&(0,L.jsxs)(n.default,{style:{gap:4},children:[(0,L.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:be?y.REPLAY_CLOSE:y.PLAY_TOGGLE,accessibilityHint:y.PLAY_HINT,accessibilityState:{selected:be},'aria-pressed':be,onPress:()=>ge(e=>!e),style:e=>[c.s.row,{minHeight:44,paddingHorizontal:14,borderRadius:11,borderWidth:1,alignSelf:'flex-start',borderColor:be?c.C.line:c.C.green,backgroundColor:e.pressed?c.C.dark:c.C.paper,gap:8}],children:(0,L.jsx)(c.T,{style:{fontSize:12,lineHeight:16,fontFamily:'InterMedium',color:be?c.C.muted:c.C.green},children:be?y.REPLAY_CLOSE:y.PLAY_TOGGLE})}),!be&&(0,L.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:y.PLAY_HINT})]}),be&&(0,L.jsx)(f.OiReplay,{session:Oe,load:Ce,value:we.value,onChange:we.setValue,playing:we.playing,onPlay:we.setPlaying,speed:we.speed,onSpeed:we.setSpeed,wide:!ne}),ne&&Xe&&(0,L.jsx)(S.OiDetailCard,{inline:!0,row:Xe,atmOffset:Ke??0,pinned:Ue.pinned,onClose:Ue.clear,anchor:{x:0,y:0},orientation:Ye})]})})},_e.cardAnchor=Y;var t=_r(d[0]),n=e(_r(d[1])),i=e(_r(d[2])),l=e(_r(d[3])),o=e(_r(d[4])),s=_r(d[5]),r=e(s),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),y=_r(d[
117210]),f=_r(d[11]),p=_r(d[12]),b=_r(d[13]),m=_r(d[14]),C=_r(d[15]),O=_r(d[16]),w=_r(d[17]),S=_r(d[18]),j=_r(d[19]),T=_r(d[20]),k=_r(d[21]),L=_r(d[22]);const _=m.OI_SIDE_COLOR.call,A=m.OI_SIDE_COLOR.put,v='Inter',P=600,I=420,R=900,E='Spot',H=1200,W=.035,M=.09,z=.45,N='Both: each bar is one side at one strike - dim = held since the baseline, bright = added, hatched = unwound.';function D(e){try{return(0,y.parseOrientationChoice)('undefined'!=typeof window?window.localStorage?.getItem(e):null)}catch{return'auto'}}function $(e,t){try{'undefined'!=typeof window&&window.localStorage?.setItem(e,t)}catch{}}function F({label:e,options:t,value:i,onChange:o}){return(0,L.jsx)(n.default,{accessibilityLabel:e,style:[c.s.row,{gap:0,borderWidth:1,borderColor:c.C.line,borderRadius:8,overflow:'hidden'}],children:t.map((t,n)=>{const s=t.value===i;return(0,L.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:`${e}: ${t.text}`,accessibilityState:{selected:s},'aria-pressed':s,onPress:()=>o(t.value),style:e=>[{minHeight:28,minWidth:34,paddingHorizontal:9,justifyContent:'center',alignItems:'center',borderLeftWidth:n?1:0,borderColor:c.C.line,backgroundColor:s?c.C.soft:e.hovered||e.focused?c.C.dark:'transparent'}],children:(0,L.jsx)(c.T,{style:{fontSize:12,lineHeight:16,fontFamily:s?'InterSemi':'Inter',color:s?c.C.green:c.C.muted},children:t.text})},String(t.value))})})}function B({label:e,on:t,onChange:i,hint:o}){return(0,L.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{selected:t},accessibilityHint:o,'aria-pressed':t,title:o,onPress:()=>i(!t),style:e=>[c.s.row,{gap:6,minHeight:28,paddingHorizontal:9,borderRadius:8,borderWidth:1,borderColor:t?c.C.amber:c.C.line,backgroundColor:e.hovered||e.focused?c.C.dark:'transparent'}],children:[(0,L.jsx)(n.default,{style:{width:8,height:8,borderRadius:2,backgroundColor:t?c.C.amber:'transparent',borderWidth:1,borderColor:t?c.C.amber:c.C.muted}}),(0,L.jsx)(c.T,{style:{fontSize:12,lineHeight:16,color:t?c.C.amber:c.C.muted},children:e})]})}function G({color:e,light:t,label:i}){return(0,L.jsxs)(n.default,{style:[c.s.row,{gap:5}],children:[(0,L.jsx)(n.default,{style:{width:10,height:10,borderRadius:2,backgroundColor:e,opacity:t?z:1}}),(0,L.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:i})]})}function Y(e,t,n){if('across'===e.orientation){const i=e.bars.filter(e=>e.index===t).map(e=>e.box.y);return{x:e.scale.at(t)-n.x,y:(i.length?Math.min(...i):e.zero)-n.y}}return{x:e.zero-n.x,y:e.scale.at(t)-n.y}}function V({tiles:e,narrow:t,tight:i=!1}){return(0,L.jsx)(n.default,{accessibilityRole:"summary",accessibilityLabel:e.map(e=>`${e.label} ${e.value}${e.sub?`, ${e.sub}`:''}`).join('. '),style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:e.map(e=>{return(0,L.jsxs)(n.default,{style:{flexGrow:1,flexBasis:t?'45%':0,minWidth:t?130:i?96:120,paddingHorizontal:i?8:10,paddingVertical:i?4:6,borderRadius:10,borderWidth:1,borderColor:c.C.line,backgroundColor:c.C.dark,gap:1},children:[(0,L.jsxs)(n.default,{style:[c.s.row,{gap:6}],children:[('call'===e.key||'put'===e.key)&&(0,L.jsx)(n.default,{style:{width:8,height:8,borderRadius:2,backgroundColor:(l=e.key,'call'===l?_:'put'===l?A:'spot'===l?m.SPOT_COLOR:c.C.ink)}}),(0,L.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:e.label})]}),(0,L.jsx)(c.T,{style:{fontFamily:'InterSemi',fontSize:i?15:17,lineHeight:i?19:22,color:'spot'===e.key?m.SPOT_COLOR:c.C.ink,fontVariant:['tabular-nums']},children:e.value}),!!e.sub&&(0,L.jsx)(c.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,color:c.C.muted,fontVariant:['tabular-nums']},children:e.sub})]},e.key);var l})})}function U(){return(0,L.jsxs)(n.default,{style:[c.s.row,{gap:5}],children:[(0,L.jsx)(n.default,{style:{width:14,height:0,borderTopWidth:2,borderStyle:'dashed',borderColor:m.SPOT_COLOR}}),(0,L.jsx)(c.T,{style:{fontSize:11,lineHeight:15,color:c.C.muted},children:"Spot"})]})}function X({layout:e,lit:t,active:n,spot:i,painStrike:l,showPain:o}){const{scale:u,bars:h,orientation:x}=e,{plot:f}=u,p='across'===x,b=i?(0,y.placeSpotPill)(e,E):null,w=(e,t,n,i)=>p?(0,L.jsx)(s.Rect,{x:u.at(e)-u.band/2,y:f.y,width:u.band,height:f.h,fill:t,opacity:n},i):(0,L.jsx)(s.Rect,{x:f.x,y:u.at(e)-u.band/2,width:f.w,height:u.band,fill:t,opacity:n},i);return(0,L.jsxs)(r.default,{width:u.width,height:u.height,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:[(0,L.jsx)(C.OiHatchDefs,{}),null!=t&&w(t,c.C.mint,.12,'lit'),null!=n&&n!==t&&w(n,c.C.mint,.1,'act'),p&&e.ticks.map(e=>(0,L.jsxs)(s.G,{children:[(0,L.jsx)(s.Line,{x1:f.x,x2:f.x+f.w,y1:e.pos,y2:e.pos,stroke:c.C.line,strokeWidth:1,strokeDasharray:0===e.value?void 0:'2 4'}),(0,L.jsx)(s.Text,{x:f.x-6,y:e.pos+4,fill:c.C.muted,fontSize:y.SMALL,fontFamily:v,textAnchor:"end",children:e.text})]},'t'+e.value)),!p&&e.headers&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(s.Text,{x:e.headers.call.x+e.headers.call.w-4,y:e.headers.call.y+12,fill:_,fontSize:y.SMALL,fontFamily:v,fontWeight:"600",textAnchor:"end",children:y.SIDE_HEADERS.call}),(0,L.jsx)(s.Text,{x:e.headers.put.x+4,y:e.headers.put.y+12,fill:A,fontSize:y.SMALL,fontFamily:v,fontWeight:"600",textAnchor:"start",children:y.SIDE_HEADERS.put}),(0,L.jsx)(s.Text,{x:e.zero,y:e.headers.call.y+12,fill:c.C.muted,fontSize:y.SMALL,fontFamily:v,textAnchor:"middle",children:"Strike"})]}),null!=e.spotPos&&(p?(0,L.jsx)(s.Line,{x1:e.spotPos,x2:e.spotPos,y1:f.y-2,y2:f.y+f.h,stroke:m.SPOT_COLOR,strokeWidth:1.5,strokeDasharray:"4 3"}):(0,L.jsx)(s.Line,{x1:f.x,x2:f.x+f.w,y1:e.spotPos,y2:e.spotPos,stroke:m.SPOT_COLOR,strokeWidth:1.5,strokeDasharray:"4 3"})),h.map(t=>{const n='call'===t.side?_:A,i=t.side+t.index;return'both'===e.mode&&t.seg&&t.origin?(0,L.jsx)(C.OiBothBar,{side:t.side,seg:t.seg,scale:e.len,orientation:x,thickness:e.barThickness,origin:t.origin,label:"none"},i):(0,L.jsx)(s.Rect,{x:t.box.x,y:t.box.y,width:t.box.w,height:t.box.h,fill:n,opacity:t.fall?z:.9,rx:1.5},i)}),!p&&e.valueLabels.map((e,t)=>(0,L.jsx)(s.Text,{x:e.x,y:e.y,fill:e.peak?c.C.ink:c.C.muted,fontSize:y.SMALL,fontFamily:v,fontWeight:e.peak?'700':'400',textAnchor:e.anchor,children:e.text},'v'+t)),p&&e.peakLabels.map((e,t)=>(0,L.jsx)(s.Text,{x:e.x,y:e.y,fill:'call'===e.side?_:A,fontSize:y.SMALL,fontFamily:v,fontWeight:e.peak?'700':'400',textAnchor:"middle",children:e.text},'p'+t)),p&&(0,L.jsx)(s.Line,{x1:f.x,x2:f.x+f.w,y1:e.zero,y2:e.zero,stroke:c.C.muted,strokeWidth:1}),u.labels.map(e=>(0,L.jsx)(s.Text,{x:e.box.x+e.box.w/2,y:e.box.y+y.FONT-1,fill:e.atm?c.C.ink:c.C.muted,fontSize:y.FONT,fontFamily:v,fontWeight:e.atm?'700':'400',textAnchor:"middle",children:e.text},'s'+e.strike)),(0,L.jsx)(O.MaxPainMarker,{strike:l,scale:u,orientation:x,visible:o}),b&&(0,L.jsxs)(s.G,{children:[(0,L.jsx)(s.Rect,{x:b.x,y:b.y,width:b.
1172w,height:b.h,rx:10,fill:c.C.dark,stroke:m.SPOT_COLOR,strokeWidth:1}),(0,L.jsx)(s.Text,{x:b.x+b.w/2,y:b.y+14,fill:m.SPOT_COLOR,fontSize:y.SMALL,fontFamily:v,fontWeight:"600",textAnchor:"middle",children:E})]})]})}},1079,[11,13,278,375,400,840,821,198,1074,1071,1080,1082,1084,1083,1085,1086,1088,1089,1090,1091,1092,1093,6]); 1173__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"uxPreview",{enumerable:!0,get:function(){return n.uxPreview}}),Object.defineProperty(_e,"MINUS",{enumerable:!0,get:function(){return r}}),_e.lcr=l,_e.signedLcr=i,_e.strikeText=a,_e.spotText=function(t){const e=o(t);return null==e?'\u2014':e.toLocaleString('en-IN',{minimumFractionDigits:0,maximumFractionDigits:2})},_e.toStrikeRows=function(t){const e=new Map;for(const n of t||[]){const t=o(n?.strike);if(null==t||e.has(t))continue;const r=o(n.ce_oi),l=o(n.pe_oi),i=o(n.ce_oi_change_day),a=o(n.pe_oi_change_day);e.set(t,{strike:t,ce_oi:r,pe_oi:l,ce_chg:i,pe_chg:a,ce_base:null!=r&&null!=i?r-i:null,pe_base:null!=l&&null!=a?l-a:null,ce_buildup:n.ce_buildup_day??null,pe_buildup:n.pe_buildup_day??null})}return[...e.values()].sort((t,e)=>t.strike-e.strike)},_e.stampParts=u,_e.spotLabel=c,_e.resolveSpot=function(t,n){if(!t)return null;const r=t.as_of??null,l=(0,e.isIndexUnderlying)(t.underlying),i=o(t.spot);if(null!=i){const e=t.spot_at??r;return{value:i,at:e,fallback:!(!e||!r||e===r),label:c(i,e,r,l),isIndex:l}}const a=h(r),s=o(t.spot_last);if(null!=s&&t.spot_last_at&&(null==a||h(t.spot_last_at)<=a))return{value:s,at:t.spot_last_at,fallback:!0,label:c(s,t.spot_last_at,r,l),isIndex:l};if(!n?.length||null==a)return null;const f=u(r)?.day;let p=null,d='';for(const t of n){const e=o(t?.spot),n=h(t?.at);null==e||null==n||n>a||u(t.at)?.day!==f||(!p||n>d)&&(p=t,d=n)}return p?{value:p.spot,at:p.at,fallback:!0,label:c(p.spot,p.at,r,l),isIndex:l}:null},Object.defineProperty(_e,"ACROSS_RATIO",{enumerable:!0,get:function(){return f}}),_e.autoOrientation=p,_e.chooseOrientation=function(t,e,n,o){return o?'down':'across'===t||'down'===t?t:p(e,n)},Object.defineProperty(_e,"ORIENTATION_KEY",{enumerable:!0,get:function(){return d}}),_e.orientationKey=function(t){return`${d}.${null==t||''===t?'anon':t}`},_e.parseOrientationChoice=function(t){return'across'===t||'down'===t?t:'auto'},Object.defineProperty(_e,"WINDOW_DEFAULT",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"WINDOW_CHOICES",{enumerable:!0,get:function(){return m}}),_e.windowLabel=function(t){return'all'===t?'All':`\xb1${t}`},_e.atmIndex=x,_e.windowCentre=function(t,e,n){if(!t.length)return{index:null,basis:'none'};const o=x(t,e);if(null!=o)return{index:o,basis:'atm'};const r=x(t,n);return null!=r?{index:r,basis:'max_pain'}:{index:Math.floor((t.length-1)/2),basis:'middle'}},_e.windowRows=function(t,e,n){if('all'===n||null==e)return{rows:t,start:0};const o=Math.max(0,e-n),r=Math.min(t.length-1,e+n);return{rows:t.slice(o,r+1),start:o}},_e.valueExtent=g,_e.niceStep=_,_e.valueTicks=y,Object.defineProperty(_e,"MIN_FALL_PX",{enumerable:!0,get:function(){return M}}),_e.axisTicks=k,_e.textWidth=O,Object.defineProperty(_e,"FONT",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"SMALL",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"LABEL_GAP",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"MIN_BAR",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"MAX_BAR",{enumerable:!0,get:function(){return A}}),Object.defineProperty(_e,"MAX_BAR_ACROSS",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"MIN_ROW",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"MIN_BAND_ACROSS",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"SPOT_GAP",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"LABEL_EVERY_PX",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"DOWN_LABEL_H",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"DOWN_LABEL_GAP",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"ACROSS_PAD",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"DOWN_PAD",{enumerable:!0,get:function(){return C}}),_e.thinStep=D,_e.layoutChart=function(e){const{rows:n,mode:o,orientation:u}=e,s=n.length,c=Math.max(0,Math.floor(e.width)),h=Math.max(0,Math.floor(e.height)),f=e.extent&&e.extent.hi>e.extent.lo?e.extent:g(n,o),p='across'===u?{lo:f.lo<0?1.18*f.lo:f.lo,hi:f.hi*('both'===o?1.14:1.1)}:'both'===o?{lo:f.lo,hi:1.04*f.hi}:f,d=e.peaks?.call??null,b=e.peaks?.put??null,m=n.map(t=>a(t.strike)),x=Math.max(0,...m.map(t=>O(t,P))),_=(t,e)=>'change'===o?'call'===e?t.ce_chg:t.pe_chg:'call'===e?t.ce_oi:t.pe_oi,y=(e,n)=>'both'===o?(0,t.segments)(e,'prev_close')[n]:null,M=(t,e,n)=>{const o=y(t,e);return o?o.held+Math.max(o.added,o.unwound):n},W=(t,e,n)=>{if('change'===o)return i(n);const a=y(t,e);return a&&a.unwound>0?`${l(n)} (${r}
1173${l(a.unwound)})`:l(n)},G=[],X=[],Y=[];if('across'===u){const t=s?Math.max(L,(c-R.left-R.right)/s):0,r=s*t,a=Math.max(c,Math.ceil(r+R.left+R.right)),f={x:R.left,y:R.top,w:r,h:Math.max(40,h-R.top-R.bottom-(e.maxPainBand||0))},g=k(p,f.h),A=t=>f.y+f.h-(t-g.lo)/(g.hi-g.lo)*f.h,$=A(0),j=Math.max(E,Math.min(I,Math.floor((t-8)/2))),T=e=>f.x+(e+.5)*t,N=[];n.forEach((e,n)=>{['call','put'].forEach((r,a)=>{const u=_(e,r);if(null==u)return;const s=T(n)+(0===a?-j-1:1),c=M(e,r,u),h=Math.min(A(c),$),f=Math.abs(A(c)-$),p=y(e,r),m={x:s,y:h,w:j,h:Math.max(0!==c?1:0,f)},x='change'===o&&u<0;G.push({side:r,index:n,strike:e.strike,value:u,outline:!1,fall:x,box:m,...'both'===o?{seg:p,origin:{x:s+j/2,y:$}}:{}});const g=s+j/2;if(u>0&&('call'===r&&e.strike===d||'put'===r&&e.strike===b)&&N.push({side:r,text:'change'===o?i(u):l(u),x:g,y:m.y-4,anchor:'middle',peak:!0}),x){const e=i(u),o=O(e,w),l=T(n)-t/2+1,a=T(n)+t/2-1,s=Math.max(l,Math.min(a-o,g-o/2));o<=t-2&&!N.some(t=>t.y>$&&Math.abs(t.x-(s+o/2))<(o+O(t.text,w))/2+2)&&N.push({side:r,text:e,x:s+o/2,y:m.y+m.h+w+1,anchor:'middle'})}})});const C=t>=S?1:Math.max(2,D(s,t,x)),W=e.atm??0,U=t=>{const o=O(m[t],P);return{strike:n[t].strike,index:t,text:m[t],atm:t===e.atm,box:{x:T(t)-o/2,y:f.y+f.h+6,w:o,h:14}}},z=[];for(const t of[e.atm,n.findIndex(t=>t.strike===d),n.findIndex(t=>t.strike===b)])if(null!=t&&t>=0&&!z.includes(t)){const e=U(t);z.some(t=>H(U(t).box,e.box))||z.push(t)}n.forEach((t,e)=>{if(z.includes(e))return void Y.push(U(e));if(((e-W)%C+C)%C!==0)return;const n=U(e);z.some(t=>H(U(t).box,{...n.box,x:n.box.x-4,w:n.box.w+v}))||Y.push(n)}),Y.sort((t,e)=>t.index-e.index);const J=B('across',n,t,T,f,f.y+f.h+6+P,Y,a,h),K=F(J,e.spot);return{orientation:u,mode:o,scale:J,bars:G,zero:$,valueLabels:X,atm:e.atm,barThickness:j,len:t=>$-A(t),peakLabels:N,ticks:g.ticks.map(t=>({value:t,text:0===t?'0':l(t),pos:A(t)})),spotPos:K.pos,spotOutside:K.outside,headers:null,scrolls:a>c+1}}const U=e.spot;let z=-1;if(null!=U&&s>1)for(let t=0;t<s-1;t++)if(U>=n[t].strike&&U<=n[t+1].strike){z=t;break}const J=z>=0?j:0,K=Math.max(0,h-C.top-C.bottom-J),V=s?Math.max($,K/s):0,q=s*V+J,Q=Math.max(h,Math.ceil(q+C.top+C.bottom)),Z=Math.max(C.centre,Math.ceil(x+20)),tt=c/2,et=Math.max(0,tt-Z/2-C.side);let nt=0;n.forEach(t=>['call','put'].forEach(e=>{const n=_(t,e);null!=n&&(nt=Math.max(nt,O(W(t,e,n),w)))})),e.labelSample&&(nt=O(e.labelSample,w));const ot=Math.max(20,et-Math.max(C.valueRoom,Math.ceil(nt)+8)),rt={x:C.side,y:C.top,w:Math.max(0,c-2*C.side),h:q},lt=Math.max(Math.abs(p.lo),Math.abs(p.hi))||1,it=t=>Math.abs(t)/lt*ot,at=Math.max(E,Math.min(A,Math.floor(.55*V))),ut=t=>rt.y+(t+.5)*V+(z>=0&&t>z?J:0),st=z>=0?rt.y+(z+1)*V:0,ct=tt-Z/2,ht=tt+Z/2;n.forEach((t,e)=>{['call','put'].forEach(n=>{const r=_(t,n);if(null==r)return;const l=M(t,n,r),i=Math.max(0!==l?1:0,it(l)),a=ut(e)-at/2,u='call'===n?{x:ct-2-i,y:a,w:i,h:at}:{x:ht+2,y:a,w:i,h:at},s=y(t,n);G.push({side:n,index:e,strike:t.strike,value:r,outline:!1,fall:'change'===o&&r<0,box:u,...'both'===o?{seg:s,origin:{x:'call'===n?ct-2:ht+2,y:ut(e)}}:{}});const c=W(t,n,r);X.push('call'===n?{side:n,text:c,x:u.x-4,y:ut(e)+3.96,anchor:'end',peak:r>0&&t.strike===d}:{side:n,text:c,x:u.x+u.w+4,y:ut(e)+3.96,anchor:'start',peak:r>0&&t.strike===b})})});const ft=D(s,V,T,N),pt=e.atm??0;n.forEach((t,n)=>{if(((n-pt)%ft+ft)%ft!==0)return;const o=O(m[n],P);Y.push({strike:t.strike,index:n,text:m[n],atm:n===e.atm,box:{x:tt-o/2,y:ut(n)-6.5,w:o,h:T}})});const dt=B('down',n,V,ut,rt,tt,Y,c,Q,z>=0?{index:z,top:st,h:J}:null),bt=F(dt,e.spot),mt=z>=0&&null!=bt.pos?st+Math.max(0,Math.min(1,(e.spot-n[z].strike)/(n[z+1].strike-n[z].strike||1)))*J:bt.pos;return{orientation:u,mode:o,scale:dt,bars:G,zero:tt,ticks:[],valueLabels:X,atm:e.atm,barThickness:at,len:it,peakLabels:[],spotPos:mt,spotOutside:bt.outside,spotRow:z>=0?{y:st,h:J}:null,headers:{call:{x:rt.x,y:4,w:ct-rt.x,h:16},put:{x:ht,y:4,w:rt.x+rt.w-ht,h:16}},scrolls:Q>h+1}},Object.defineProperty(_e,"PILL_H",{enumerable:!0,get:function(){return W}}),_e.pillWidth=G,_e.placeSpotPill=function(t,e){if(null==t.spotPos)return null;const n=G(e),o=W,r=t.scale.width;if('across'===t.orientation)return n>r-4||t.scale.plot.y<26?null:{x:Math.max(2,Math.min(r-n-2,t.spotPos-n/2)),y:4,w:n,h:o};return t.spotRow?{x:Math.max(2,Math.min(r-n-2,t.zero-n/2)),y:t.spotRow.y+(t.spotRow.h-o)/2,w:n,h:o}:null},_e.overlaps=H,_e.labelsClear=function(t){for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++)if(H(t[e].box,t[n].box))return!1;return!0},Object.defineProperty(_e,"MODE_LABELS",{enumerable:!0,get:function(){return X}}),Object.defineProperty(_e,"MAX_PAIN_TOGGLE",{enumerable:!0,get:function(){return Y}}),_e.pcrFromTotals=U,Object.defineProperty(_e,"ORIENTATION_LABELS",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"SIDE_HEADERS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(_e,"NO_SPOT_TEXT",{enumerable:!0,get:function(){return K}}),Object.defineProperty(_e,"OUTSIDE_TEXT",{enumerable:!0,get:function(){return V}}),Object.defineProperty(_e,"CENTRE_TEXT",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"CHANGE_NOTE",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(_e,"OI_NOTE",{enumerable:!0,get:function(){return Z}}),_e.replayExtent=function(t,e,n,r){if(!t)return null;if('oi'===e)return null!=n&&n>0?{lo:0,hi:n}:null;if('both'===e){let e=n??0;for(const n of[...t.prev_close_call,...t.prev_close_put]){const t=o(n);null!=t&&t>e&&(e=t)}return e>0?{lo:0,hi:1.04*e}:null}if(null==r||!(r>0))return null;let l=0,i=0;const a=[[t.call_oi,t.prev_close_call],[t.put_oi,t.prev_close_put]];for(const[t,e]of a)for(const n of t)n.forEach((t,n)=>{const r=o(t),a=o(e[n]);if(null==r||null==a)return;const u=r-a;u<l&&(l=u),u>i&&(i=u)});return{lo:l,hi:i}},_e.replayLabelSample=function(t,e){if(!e)return null;const n=Math.max(Math.abs(e.lo),Math.abs(e.hi));return'change'===t?i(-n):'both'===t?`${l(n)} (${r}${l(n)})`:l(n)},_e.frameSpot=function(t,n){if(!t)return null;const r=(0,e.isIndexUnderlying)(n),l=o(t.spot);if(null!=l)return{value:l,at:t.at,fallback:!1,label:c(l,t.at,t.at,r),isIndex:r};const i=t.spotEarlier;return i&&null!=o(i.value)?{value:i.value,at:i.at,fallback:!0,label:c(i.value,i.at,t.at,r),isIndex:r}:null},_e.sameReading=tt,_e.maxPainAt=function(t,e){if(!t||!e)return null;const n=t.find(t=>tt(t.at,e));return n?o(n.max_pain_strike):null},_e.frameTotals=function(t){let e=0,n=0,o=!1,r=!1;for(const l of t)null!=l.ce_oi&&(e+=l.ce_oi,o=!0),null!=l.pe_oi&&(n+=l.pe_oi,r=!0);return{ce:o?e:null,pe:r?n:null}},Object.defineProperty(_e,"REPLAY_TOGGLE",{enumerable:!0,get:function(){return et}}),Object.defineProperty(_e,"REPLAY_OPEN",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(_e,"REPLAY_CLOSE",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(_e,"REPLAY_PAIN_NOTE",{enumerable:!0,get:function(){return rt}}
1173),_e.topStrike=lt,_e.topChange=function(t,e){let n=null;for(const o of t){const t='call'===e?o.ce_chg:o.pe_chg;null!=t&&t>0&&((!n||t>n.value)&&(n={strike:o.strike,value:t}))}return n},_e.highestInView=function(t,e,n){const o=lt(t,n),r=lt(e,n),l=new Set(t.map(t=>t.strike));return{top:o,outside:r&&!l.has(r.strike)?r:null}},_e.highestText=function(t,e){const n='call'===t?'Highest call OI':'Highest put OI',o=e.top?`${n} ${a(e.top.strike)} (${l(e.top.value)})`:`${n} \u2014`;return e.outside?`${o} (outside view: ${a(e.outside.strike)})`:o},_e.statTiles=function(t){const n=e=>{let n=0,o=0;for(const r of t.rows){const t=r[e];null!=t&&(n+=t,o++)}return o?n:null},o=e=>{const o='call'===e?t.totals.ce:t.totals.pe,r=n('call'===e?'ce_chg':'pe_chg');return{key:e,label:'call'===e?'Call OI':'Put OI',value:l(o),sub:null==r?'change \u2014':`${i(r)} ${t.changeLabel||'since prev close'}`}},r=U(t.totals.ce,t.totals.pe),a=t.spot&&u(t.spot.at)?.time||'';return[o('call'),o('put'),{key:'pcr',label:'PCR',value:null==r?'\u2014':r.toFixed(2),sub:'put OI \xf7 call OI'},{key:'spot',label:'Spot',value:t.spot?(0,e.level)(t.spot.value,!0===t.spot.isIndex,2,0):'\u2014',sub:t.spot?`${t.spot.fallback?'last spot \xb7 ':''}${a}`:'no spot this session'}]},_e.statCoverage=function(t){const e=[];for(const[n,o,r]of[['Call',"ce_oi","ce_chg"],['Put',"pe_oi","pe_chg"]]){let l=0,i=0;for(const e of t)null!=e[o]&&l++,null!=e[r]&&i++;i<l&&e.push(`${n} OI change over ${i} of ${l} strikes`)}return e},_e.currentIndex=function(t,e){if(!t||!e)return null;const n=t.findIndex(t=>tt(t.at,e));return n<0?null:n},Object.defineProperty(_e,"PLAY_TOGGLE",{enumerable:!0,get:function(){return it}}),Object.defineProperty(_e,"PLAY_HINT",{enumerable:!0,get:function(){return at}});var t=_r(_d[0]),e=_r(_d[1]),n=_r(_d[2]);const o=t=>'number'==typeof t&&Number.isFinite(t)?t:null,r='\u2212';function l(t){const e=o(t);if(null==e)return'\u2014';const n=Math.abs(e),l=e<0?r:'',i=t=>{const e=t>=100?t.toFixed(0):t.toFixed(1);return e.endsWith('.0')?e.slice(0,-2):e};return n>=1e7?`${l}${i(n/1e7)}Cr`:n>=1e5?`${l}${i(n/1e5)}L`:n>=1e3?`${l}${i(n/1e3)}k`:`${l}${Math.round(n)}`}function i(t){const e=o(t);return null==e?'\u2014':(e>0?'+':'')+l(e)}function a(t){const e=o(t);return null==e?'\u2014':Math.round(e).toLocaleString('en-IN')}function u(t){const e=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}):(\d{2}))?/.exec(String(t||'').trim());return e?{day:e[1],time:e[2]?`${e[2]}:${e[3]}`:''}:null}const s=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];function c(t,n,o,r=!0){const l=u(n),i=u(o);let a='';if(l){const[t,e,n]=l.day.split('-').map(Number),o=`${n} ${s[e-1]||''}`.trim();a=i&&i.day!==l.day?`${o}${l.time?' '+l.time:''}`:l.time||o}return`Spot ${(0,e.level)(t,r,2,0)}${a?' \xb7 '+a:''}`}function h(t){const e=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?/.exec(String(t||'').trim());return e?`${e[1]} ${e[2]||'00'}:${e[3]||'00'}:${e[4]||'00'}`:null}const f=1.2;function p(t,e){return t>0&&e>0?t/e>=f?'across':'down':'across'}const d='kanida.oiChart.orientation';const b=10,m=[5,10,15,'all'];function x(t,e){const n=o(e);if(null==n||!t.length)return null;let r=0,l=1/0;return t.forEach((t,e)=>{const o=Math.abs(t.strike-n);o<l-1e-9&&(r=e,l=o)}),r}function g(t,e){let n=0,o=0;for(const r of t){const t='change'===e?[r.ce_chg,r.pe_chg]:'both'===e?[r.ce_oi,r.pe_oi,r.ce_base,r.pe_base]:[r.ce_oi,r.pe_oi];for(const e of t)null!=e&&(e>o&&(o=e),e<n&&(n=e))}return{lo:n,hi:o}}function _(t,e){if(!(t>0))return 1;const n=t/Math.max(1,e),o=Math.pow(10,Math.floor(Math.log10(n)));for(const t of[1,2,2.5,5,10])if(t*o>=n-1e-9)return t*o;return 10*o}function y(t,e=4){const n=t.hi-t.lo;if(!(n>0))return{ticks:[0],lo:0,hi:1};let o=_(n,e-1);for(let n=0;n<12;n++){const n=Math.floor(t.lo/o+1e-9)*o,r=Math.ceil(t.hi/o-1e-9)*o,l=Math.round((r-n)/o)+1;if(l<=e){const t=[];for(let e=0;e<l;e++){const r=n+e*o;t.push(Math.abs(r)<o/1e6?0:r)}return{ticks:t,lo:n,hi:r}}o=_(1.0001*o,1)}return{ticks:[0],lo:Math.min(0,t.lo),hi:Math.max(t.hi,1)}}const M=20;function k(t,e,n=4){const o=Math.max(0,t.hi),r=Math.min(0,t.lo);if(!(o>0||r<0))return{ticks:[0],lo:0,hi:1};const l=o>0?y({lo:0,hi:o},n):{ticks:[0],lo:0,hi:0};let i=l.hi,a=r;if(!(i>0)){i=0;const t=y({lo:r,hi:0},n);return{ticks:t.ticks,lo:t.lo,hi:1e-4*Math.abs(t.lo)}}if(a<0&&e>40){const t=-M/(e-M)*i;a>t&&(a=t)}const u=l.ticks.length>1?l.ticks[1]-l.ticks[0]:i,s=[...l.ticks];for(let t=-u;t>=a-1e-9;t-=u)s.unshift(t);let c=s,h=1;for(;c.length>n&&h<64;)h*=2,c=s.filter(t=>
1173Math.abs(Math.round(t/u))%h===0);return{ticks:c,lo:a,hi:i}}function O(t,e){let n=0;for(const e of t)n+=/[.,:\xb7' ]/.test(e)?.34:/[\u2212+\u2014]/.test(e)?.66:.62;return n*e}const P=12,w=11,v=8,E=6,A=16,I=22,$=14,L=16,j=24,S=44,T=13,N=1,R={left:48,right:12,top:30,bottom:26},C={top:26,bottom:8,side:6,centre:66,valueRoom:44};function D(t,e,n,o=v){return t<=1||!(e>0)?1:Math.max(1,Math.ceil((n+o)/e))}function B(t,e,n,o,r,l,i,a,u,s=null){const c=e.map(t=>t.strike),h='across'===t?r.x:r.y;return{orientation:t,strikes:c,band:n,at:o,pos:t=>{if(!c.length||!Number.isFinite(t))return null;if(1===c.length)return Math.abs(t-c[0])<1e-9?o(0):null;if(t<c[0]||t>c[c.length-1])return null;for(let e=0;e<c.length-1;e++){const n=c[e],r=c[e+1];if(t>=n&&t<=r)return o(e)+(r===n?0:(t-n)/(r-n))*(o(e+1)-o(e))}return null},indexAt:t=>{if(!(c.length&&n>0))return null;let e=t;if(s)if(e>=s.top+s.h)e-=s.h;else if(e>=s.top)return e<s.top+s.h/2?s.index:s.index+1;return Math.max(0,Math.min(c.length-1,Math.floor((e-h)/n)))},plot:r,axis:l,labels:i,width:a,height:u}}function F(t,e){if(null==e||!t.strikes.length)return{pos:null,outside:null};const n=t.pos(e);return null!=n?{pos:n,outside:null}:{pos:null,outside:e<t.strikes[0]?'below':'above'}}const W=20;function G(t){return Math.ceil(O(t,w))+14}function H(t,e){return t.x<e.x+e.w&&e.x<t.x+t.w&&t.y<e.y+e.h&&e.y<t.y+t.h}const X={oi:'OI',change:'Change',both:'Both'},Y='Max pain';function U(t,e){const n=o(t),r=o(e);return null!=n&&null!=r&&n>0?r/n:null}const z={auto:'Auto',across:'Across',down:'Down'},J={call:'Calls',put:'Puts'},K='No spot at this reading or earlier in this session',V={below:'below the strikes shown',above:'above the strikes shown'},q={max_pain:'No spot: strikes centred on max pain',middle:'No spot: strikes centred on the middle strike'},Q='A fall in open interest is a lighter bar below zero, with a minus value.',Z='Each bar is the open interest standing at this reading; nothing is smoothed or projected.';function tt(t,e){const n=h(t),o=h(e);return null!=n&&n===o}const et='Replay',nt='Replay the session',ot='Back to this reading',rt='Max pain shown for the reading on screen';function lt(t,e){let n=null;for(const o of t){const t='call'===e?o.ce_oi:o.pe_oi;null!=t&&t>0&&((!n||t>n.value)&&(n={strike:o.strike,value:t}))}return n}const it='Play the day',at='Watch the open interest build, reading by reading, up to this reading.'},1080,[1081,984,881]); 1174__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MIN_SEGMENT_PX",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_UNWOUND_PX",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"UNWOUND_STROKE",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"BASELINES",{enumerable:!0,get:function(){return o}}),e.sideSegments=s,e.baselineOi=p,e.segments=function(n,t="prev_close"){return{call:s(n.ce_oi,p(n,'call',t)),put:s(n.pe_oi,p(n,'put',t))}},e.segmentLayout=function(n,l,o=t,c=Math.max(u,o)){if(!n)return null;const s=n=>{const t=l(n);return'number'==typeof t&&Number.isFinite(t)?Math.max(t,0):0},p=(n,t,u,l=o)=>n>0?Math.max(u-t,l):0,h=s(0),b=p(n.held,h,s(n.held)),f=p(n.added,s(n.held),s(n.held+n.added)),_=p(n.unwound,s(n.held),s(n.held+n.unwound),c);return{held:{start:0,length:b},added:{start:b,length:f},unwound:{start:b,length:_},end:b+Math.max(f,_)}},e.unwoundLabel=function(t){return t&&t.unwound>0?n.MINUS+(0,n.compact)(t.unwound):null},e.addedLabel=function(t){return t&&t.added>0?'+'+(0,n.compact)(t.added):null},e.baselineWords=h,e.bothBarLabel=function(t,u,l="prev_close"){const o='call'===t?'Call OI':'Put OI';if(!u)return`${o}: ${n.DASH} not available`;const c=`since ${h(l)}`,s=[`${o} ${(0,n.compact)(u.held+u.added)}`,`held ${(0,n.compact)(u.held)}`];u.added>0?s.push(`added ${(0,n.compact)(u.added)} ${c}`):u.unwound>0?s.push(`unwound ${(0,n.compact)(u.unwound)} ${c}`):s.push(`unchanged ${c}`);return s.join(', ')};var n=r(d[0]);const t=2,u=4,l=1,o=['prev_close'],c=n=>'number'==typeof n&&Number.isFinite(n)&&n>=0?n:null;function s(n,t){const u=c(n),l=c(t);return null==u||null==l?null:{held:Math.min(u,l),added:Math.max(u-l,0),unwound:Math.max(l-u,0)}}function p(n,t,u){if('prev_close'!==u)return null;const l='call'===t?n.ce_base:n.pe_base;if(null!=c(l))return l;const o='call'===t?n.ce_oi:n.pe_oi,s='call'===t?n.ce_chg:n.pe_chg,p=c(o),h='number'==typeof s&&Number.isFinite(s)?s:null;return null==p||null==h?null:c(p-h)}function h(n){return'prev_close'===n?'previous close':'baseline'}},1081,[984]); 1175__d(function(g,r,_i,a,m,_e,d){"use strict";
1175function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return E}}),_e.nextSpeed=C,_e.OiReplay=j;var i=r(d[0]),t=e(i);r(d[1]);var n=e(r(d[2])),s=e(r(d[3])),l=r(d[4]),o=r(d[5]),c=r(d[6]),u=r(d[7]);const y=44,b='Inter',p=11,h='Reading shown';function f({icon:e,label:i,onPress:t,disabled:s,hint:o}){return(0,u.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:i,accessibilityHint:o,accessibilityState:{disabled:!!s},disabled:s,onPress:t,style:({pressed:e})=>({width:y,height:y,borderRadius:12,borderWidth:1,borderColor:l.C.line,backgroundColor:l.C.paper,alignItems:'center',justifyContent:'center',opacity:s?.42:e?.72:1}),children:(0,u.jsx)(l.Icon,{name:e,size:18,color:s?l.C.muted:l.C.green})})}function x({session:e,value:n,onChange:c}){const b=e.readings.length,p=Math.max(0,b-1),[f,x]=(0,i.useState)(0),C=(0,o.replayValueText)(e,n);return(0,u.jsx)(s.default,{style:{minHeight:y,justifyContent:'center'},children:t.default.createElement('input',{type:'range',min:0,max:p,step:1,value:n,'aria-label':h,'aria-valuetext':C,onChange:e=>c((0,o.clampIndex)(Number(e.target.value),b)),style:{width:'100%',height:y,margin:0,accentColor:l.C.green,cursor:'pointer',background:'transparent'}})})}function C(e){const i=o.REPLAY_SPEEDS.indexOf(e);return o.REPLAY_SPEEDS[(i+1)%o.REPLAY_SPEEDS.length]}function j({session:e,value:i,onChange:t,playing:h,onPlay:j,speed:E,onSpeed:P,load:R,wide:L=!1}){const S=(0,c.useReducedMotion)(),_=e=>(0,u.jsx)(l.T,{accessibilityLiveRegion:"polite",style:{fontFamily:b,fontSize:12,lineHeight:18,color:l.C.muted},children:e});if(!e)return'loading'===R?.state?_(o.REPLAY_LOADING):R&&'ready'!==R.state?_(R.message):_(o.REPLAY_NOT_AVAILABLE);const A=e.readings.length;if(!A)return _(o.REPLAY_NO_READINGS);const v=(0,o.clampIndex)(i,A),w=A-1,O=v>=w,T=(0,o.replayFrame)(e,v),I=(0,o.replayTicks)(e,5),D=A>1&&!S,H=e=>t((0,o.clampIndex)(e,A)),k=(0,u.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Show the latest reading",accessibilityState:{disabled:O},disabled:O,onPress:()=>{j(!1),H(w)},style:({pressed:e})=>({minHeight:y,paddingHorizontal:14,borderRadius:11,borderWidth:1,borderColor:O?l.C.line:l.C.green,backgroundColor:l.C.paper,justifyContent:'center',opacity:O?.42:e?.72:1}),children:(0,u.jsx)(l.T,{style:{fontFamily:'InterMedium',fontSize:12,color:O?l.C.muted:l.C.green},children:"Latest"})}),z=(0,u.jsx)(s.default,{style:{flexDirection:'row',justifyContent:'space-between'},accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:I.map(e=>(0,u.jsx)(l.T,{style:{fontFamily:b,fontSize:p,lineHeight:15,color:l.C.muted},children:e.time},e.index))});return L?(0,u.jsxs)(s.default,{style:{gap:4,maxWidth:'100%'},children:[(0,u.jsxs)(s.default,{style:[l.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,u.jsx)(f,{icon:"skip-back",label:"Previous reading",disabled:v<=0,onPress:()=>H(v-1)}),(0,u.jsx)(f,{icon:h?'pause':'play',label:h?'Pause replay':'Play replay',disabled:!h&&!D,hint:S?o.REPLAY_REDUCED_MOTION:void 0,onPress:()=>j(!h)}),(0,u.jsx)(f,{icon:"skip-forward",label:"Next reading",disabled:O,onPress:()=>H(v+1)}),(0,u.jsxs)(s.default,{style:{flex:1,minWidth:160},children:[(0,u.jsx)(x,{session:e,value:v,onChange:H}),z]}),(0,u.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:`Replay speed ${E}\xd7. Change speed`,onPress:()=>P(C(E)),style:({pressed:e})=>({minWidth:y,height:y,paddingHorizontal:10,borderRadius:11,borderWidth:1,borderColor:l.C.green,backgroundColor:l.C.soft,alignItems:'center',justifyContent:'center',opacity:e?.72:1}),children:(0,u.jsx)(l.T,{style:{fontFamily:'InterSemi',fontSize:12,color:l.C.green},children:`${E}\xd7`})}),k]}),(0,u.jsxs)(l.T,{accessibilityLiveRegion:h?'none':'polite',numberOfLines:1,style:{fontFamily:b,fontSize:12,lineHeight:17,color:l.C.ink},children:[(0,o.replayReadout)(T,A),(0,u.jsxs)(l.T,{style:{fontFamily:b,fontSize:p,color:l.C.muted},children:[` \xb7 ${o.REPLAY_SCALE_NOTE}`,S?` \xb7 ${o.REPLAY_REDUCED_MOTION}`:'']})]})]}):(0,u.jsxs)(s.default,{style:{gap:8,maxWidth:'100%'},children:[(0,u.jsxs)(s.default,{style:[l.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,u.jsx)(f,{icon:"skip-back",label:"Previous reading",disabled:v<=0,onPress:()=>H(v-1)}),(0,u.jsx)(f,{icon:h?'pause':'play',label:h?'Pause replay':'Play replay',disabled:!h&&!D,hint:S?o.REPLAY_REDUCED_MOTION:void 0,onPress:()=>j(!h)}),(0,u.jsx)(f,{icon:"skip-forward",label:"Next reading",disabled:O,onPress:()=>H(v+1)}),(0,u.jsx)(l.T,{accessibilityLiveRegion:h?'none':'polite',numberOfLines:2,style:{flex:1,minWidth:150,fontFamily:b,fontSize:12,lineHeight:17,color:l.C.ink},children:(0,o.replayReadout)(T,A)})]}
1175),(0,u.jsx)(x,{session:e,value:v,onChange:H}),(0,u.jsx)(s.default,{style:{flexDirection:'row',justifyContent:'space-between'},accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:I.map(e=>(0,u.jsx)(l.T,{style:{fontFamily:b,fontSize:p,lineHeight:15,color:l.C.muted},children:e.time},e.index))}),(0,u.jsxs)(s.default,{style:[l.s.row,{gap:8,flexWrap:'wrap'}],children:[(0,u.jsx)(s.default,{accessibilityLabel:"Replay speed",style:[l.s.row,{gap:6}],children:o.REPLAY_SPEEDS.map(e=>(0,u.jsx)(l.Chip,{label:`${e}\xd7`,active:E===e,onPress:()=>P(e)},e))}),(0,u.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Show the latest reading",accessibilityState:{disabled:O},disabled:O,onPress:()=>{j(!1),H(w)},style:({pressed:e})=>({minHeight:y,paddingHorizontal:14,borderRadius:11,borderWidth:1,borderColor:O?l.C.line:l.C.green,backgroundColor:l.C.paper,justifyContent:'center',opacity:O?.42:e?.72:1}),children:(0,u.jsx)(l.T,{style:{fontFamily:'InterMedium',fontSize:12,color:O?l.C.muted:l.C.green},children:"Latest"})})]}),(0,u.jsxs)(l.T,{style:{fontFamily:b,fontSize:p,lineHeight:15,color:l.C.muted},children:[o.REPLAY_SCALE_NOTE,S?` \xb7 ${o.REPLAY_REDUCED_MOTION}`:'']})]})}var E=j},1082,[11,136,375,13,821,1083,1084,6]); 1176__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"OI_SESSION_PATH",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"REPLAY_SPEEDS",{enumerable:!0,get:function(){return r}}),Object.defineProperty(_e,"REPLAY_STEP_MS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"REPLAY_NOT_AVAILABLE",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"REPLAY_UNREADABLE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"REPLAY_NO_READINGS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"REPLAY_LOADING",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"REPLAY_SCALE_NOTE",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"REPLAY_REDUCED_MOTION",{enumerable:!0,get:function(){return c}}),_e.oiSessionPath=function(e){const n=[`underlying=${encodeURIComponent(e.underlying)}`];e.expiry&&n.push(`expiry=${encodeURIComponent(e.expiry)}`);e.session&&n.push(`session=${encodeURIComponent(e.session)}`);return`${t}?${n.join('&')}`},_e.parseOiSession=d,_e.sessionErrorResult=y,_e.sessionBodyResult=_,_e.fetchOiSession=async function(e,t){try{return _(await(0,n.api)(e,void 0,void 0,t))}catch(e){return y(e)}},_e.replayFrame=function(n,t){if(!n||!n.readings.length)return null;const r=b(t,n.readings.length),o=n.readings[r],i=n.call_oi[r]||[],s=n.put_oi[r]||[];let l=null;if(null==o.spot)for(let e=r-1;e>=0;e--){const t=n.readings[e].spot;if(null!=t){l={value:t,at:n.readings[e].at};break}}const u=n.strikes.map((e,t)=>{const r=f(i[t]),o=f(s[t]),l=f(n.prev_close_call[t]),u=f(n.prev_close_put[t]);return{strike:e,ce_oi:r,pe_oi:o,ce_chg:h(r,l),pe_chg:h(o,u),ce_base:l,pe_base:u}});return{index:r,at:o.at,time:(0,e.clock)(o.at),on_grid:o.on_grid,spot:o.spot,spotEarlier:l,rows:u}},_e.replayScaleMax=function(e){if(!e)return null;let n=null;for(const t of[e.call_oi,e.put_oi])for(const e of t)for(const t of e){const e=f(t);null!=e&&(null==n||e>n)&&(n=e)}return n},_e.replayChangeScaleMax=function(e){if(!e)return null;let n=null;const t=[[e.call_oi,e.prev_close_call],[e.put_oi,e.prev_close_put]];for(const[e,r]of t)for(const t of e)t.forEach((e,t)=>{const o=h(f(e),f(r[t]));null!=o&&(null==n||Math.abs(o)>n)&&(n=Math.abs(o))});return n},_e.clampIndex=b,_e.replayTicks=function(n,t=5){const r=n?.readings.length||0;if(!n||!r)return[];if(1===r)return[{index:0,time:(0,e.clock)(n.readings[0].at)}];const o=Math.max(2,Math.min(t,r)),i=[];for(let t=0;t<o;t++){const s=Math.round(t*(r-1)/(o-1));i.length&&i[i.length-1].index===s||i.push({index:s,time:(0,e.clock)(n.readings[s].at)})}return i},_e.replayReadout=function(e,n){return e?`Open interest as captured at ${e.time} \xb7 reading ${e.index+1} of ${n}`:l},_e.replayValueText=function(n,t){const r=n?.readings.length||0;if(!n||!r)return l;const o=b(t,r);return`${(0,e.clock)(n.readings[o].at)}, reading ${o+1} of ${r}`},_e.indexAtPosition=function(e,n,t){return t<=1||!(n>0)?0:b(Math.max(0,Math.min(n,e))/n*(t-1),t)};var e=_r(_d[0]),n=_r(_d[1]);const t='/api/derivatives/oi-by-strike/session',r=[1,2,4],o=1e3,i='Replay not available on this server',s='The session readings could not be read',l='No readings captured for this session yet',u='Loading the session readings',a='Scale fixed for replay',c='Auto-play is off because reduced motion is on. Use the slider or the step buttons.',f=e=>'number'==typeof e&&Number.isFinite(e)?e:null;const p=e=>f(e);function d(e){if(!e||'object'!=typeof e)return null;const n=e,{readings:t,strikes:r,call_oi:o,put_oi:i,prev_close_call:s,prev_close_put:l}=n;if(!(Array.isArray(t)&&Array.isArray(r)&&Array.isArray(o)&&Array.isArray(i)&&Array.isArray(s)&&Array.isArray(l)))return null;if(!r.every(e=>null!=f(e)))return null;for(let e=1;e<r.length;e++)if(r[e]<=r[e-1])return null;const u=r.length,a=t.length;if(o.length!==a||i.length!==a||s.length!==u||l.length!==u)return null;const c=[];for(const e of t){if(!e||'object'!=typeof e)return null;const{at:n,spot:t,on_grid:r}=e;if('string'!=typeof n||!n||'boolean'!=typeof r)return null;if(null!==t&&'number'!=typeof t)return null;c.push({at:n,spot:f(t),on_grid:r})}const d=e=>{const n=[];for(const t of e){if(!Array.isArray(t)||t.length!==u)return null;n.push(t.map(p))}return n},y=d(o),_=d(i);if(!y||!_)return null;const h={readings:c,strikes:r,call_oi:y,put_oi:_,prev_close_call:s.map(p),prev_close_put:l.map(p)};return'string'==typeof n.underlying&&(h.underlying=n.underlying),'string'==typeof n.expiry&&(h.expiry=n.expiry),'string'!=typeof n.session&&null!==n.session||(h.session=n.session),h}function y(e){const n=e?.status;return 404===n?{state:'unavailable',message:i}:{state:'error',message:s}}function _(e){const n=d(e);return n?{state:'ready',session:n}:{state:'error',message:s}}const h=(e,n)=>null==e||null==n?null:e-n;function b(e,n){return n<=0?0:Number.isFinite(e)?Math.max(0,Math.min(n-1,Math.round(e))):n-1}},1083,[984,197]); 1177__d(function(g,_r,_i,_a,m,_e,d){"use strict";
1177Object.defineProperty(_e,'__esModule',{value:!0}),_e.initReplay=i,_e.replayReducer=u,_e.nextDelay=a,_e.useReducedMotion=r,_e.useReplay=function(e){const t=e?.readings.length||0,c=r(),[o,l]=(0,n.useReducer)(u,t,i);(0,n.useEffect)(()=>{l({type:'session',count:t})},[t]),(0,n.useEffect)(()=>{c&&l({type:'reduce',on:!0})},[c]);const p=a(o,c);(0,n.useEffect)(()=>{if(null==p)return;const e=setTimeout(()=>l({type:'tick'}),p);return()=>clearTimeout(e)},[p,o.index]);const y=(0,n.useMemo)(()=>(0,s.replayFrame)(e,o.index),[e,o.index]),x=(0,n.useMemo)(()=>{const e=e=>l({type:'set',index:e});return{setIndex:e,setValue:e,setSpeed:e=>l({type:'speed',speed:e}),goLatest:()=>l({type:'latest'})}},[]),f=(0,n.useMemo)(()=>e=>l({type:'play',on:e,reduce:c}),[c]);return{value:o.index,index:o.index,playing:o.playing,speed:o.speed,frame:y,atLatest:0===t||o.index>=t-1,reduceMotion:c,setPlaying:f,...x}},_e.useOiSession=function(e){const[t,i]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(!e)return void i(null);const n=new AbortController;let t=!0;return i({state:'loading',message:s.REPLAY_LOADING}),(0,s.fetchOiSession)(e,n.signal).then(e=>{t&&i(e)}),()=>{t=!1,n.abort()}},[e]),t};var e,n=_r(d[0]),t=_r(d[1]);(e=t)&&e.__esModule;_r(d[2]);var s=_r(d[3]);function i(e){return{index:Math.max(0,e-1),count:Math.max(0,e),playing:!1,speed:1}}function u(e,n){const t=e.count-1;switch(n.type){case'session':{const t=Math.max(0,0|n.count);if(t===e.count)return e;const i=0===e.count||e.index>=e.count-1?Math.max(0,t-1):(0,s.clampIndex)(e.index,t);return{...e,count:t,index:i,playing:e.playing&&t>1&&i<t-1}}case'set':{const t=(0,s.clampIndex)(n.index,e.count);return t!==e.index||e.playing?{...e,index:t,playing:!1}:e}case'play':return!n.on||n.reduce||e.count<2?e.playing?{...e,playing:!1}:e:{...e,playing:!0,index:e.index>=t?0:e.index};case'tick':{if(!e.playing)return e;const n=Math.min(t,e.index+1);return{...e,index:n,playing:n<t}}case'speed':return s.REPLAY_SPEEDS.includes(n.speed)&&n.speed!==e.speed?{...e,speed:n.speed}:e;case'latest':return{...e,index:Math.max(0,t),playing:!1};case'reduce':return n.on&&e.playing?{...e,playing:!1}:e}return e}function a(e,n){return!e.playing||n||e.count<2||e.index>=e.count-1?null:s.REPLAY_STEP_MS/e.speed}function r(){const[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{{const e=globalThis.matchMedia?.('(prefers-reduced-motion: reduce)');if(!e)return;t(!!e.matches);const n=e=>t(!!e.matches);return e.addEventListener?.('change',n),()=>e.removeEventListener?.('change',n)}},[]),e}},1084,[11,265,136,1083]); 1178__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"OI_SIDE_COLOR",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"MAX_PAIN_COLOR",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"SPOT_COLOR",{enumerable:!0,get:function(){return O}});var t=r(d[0]);const n={call:t.C.red,put:t.C.green},u=t.C.amber,O=t.C.mint},1085,[821]); 1179__d(function(g,_r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTH_COLOR",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"HELD_OPACITY",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"HATCH_ID",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"UNWOUND_STROKE_V4",{enumerable:!0,get:function(){return y}}),_e.OiHatchDefs=f,Object.defineProperty(_e,"ADDED_OPACITY",{enumerable:!0,get:function(){return O}}),_e.partRect=p,_e.OiBothBar=function({side:e,seg:t,scale:i,orientation:l,thickness:c,origin:f={x:0,y:0},label:_="none"}){const j=(0,o.segmentLayout)(t,i);if(!(j&&c>0))return null;const w=h[e],b=t=>p(l,e,f,c,t),I=y,T='none'===_?null:(0,o.unwoundLabel)(t)??('change'===_?(0,o.addedLabel)(t):null),k=b(j.unwound),N=j.end+3,F='across'===l?{x:f.x,y:f.y-N,anchor:'middle'}:'call'===e?{x:f.x-N,y:f.y+r.OI_MIN_FONT/2-1,anchor:'end'}:{x:f.x+N,y:f.y+r.OI_MIN_FONT/2-1,anchor:'start'};return(0,s.jsxs)(n.G,{children:[j.held.length>0&&(0,s.jsx)(n.Rect,{...b(j.held),fill:w,fillOpacity:u}),j.added.length>0&&(0,s.jsx)(n.Rect,{...b(j.added),fill:w,fillOpacity:O}),j.unwound.length>0&&(0,s.jsx)(n.Rect,{x:k.x+.75,y:k.y+.75,width:Math.max(k.width-I,0),height:Math.max(k.height-I,0),fill:`url(#${x[e]})`,stroke:w,strokeWidth:I}),!!T&&(0,s.jsx)(n.Text,{x:F.x,y:F.y,textAnchor:F.anchor,fontFamily:r.OI_FONT,fontSize:r.OI_MIN_FONT,fill:w,children:T})]})},_e.OiBothLegend=function({baseline:e="prev_close",sides:c=['call','put'],compact:p=!1,since:_=!0}){const j=`since ${(0,o.baselineWords)(e)}`,w=p?[{key:'held',text:'Held'},{key:'added',text:'Added'},{key:'unwound',text:_?'Unwound (hatched)':'Unwound'}]:[{key:'held',text:`Held ${j}`},{key:'added',text:`Added ${j}`},{key:'unwound',text:`Unwound ${j} (hatched)`}],b=p?10:12;return(0,s.jsxs)(t.default,{accessibilityLabel:`Legend: ${w.map(e=>e.text).join('; ')}${p?`, ${j}`:''}`,style:{flexDirection:'row',flexWrap:'wrap',alignItems:'center',columnGap:p?8:14,rowGap:6},children:[w.map(e=>(0,s.jsxs)(t.default,{style:{flexDirection:'row',alignItems:'center',gap:p?4:6},children:[(0,s.jsxs)(i.default,{width:c.length*(b+3),height:10,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:[(0,s.jsx)(f,{}),c.map((t,i)=>{const l=i*(b+3),r=h[t];return'unwound'===e.key?(0,s.jsx)(n.Rect,{x:l+.75,y:.75,width:b-y,height:8.5,fill:`url(#${x[t]})`,stroke:r,strokeWidth:y},t):(0,s.jsx)(n.Rect,{x:l,y:0,width:b,height:10,fill:r,fillOpacity:'held'===e.key?u:O},t)})]}),(0,s.jsx)(l.T,{style:{fontFamily:r.OI_FONT,fontSize:r.OI_MIN_FONT,lineHeight:16,color:l.C.muted},children:e.text})]},e.key)),p&&_&&(0,s.jsx)(l.T,{style:{fontFamily:r.OI_FONT,fontSize:r.OI_MIN_FONT,lineHeight:16,color:l.C.muted},children:j})]})},_r(d[0]);var t=e(_r(d[1])),n=_r(d[2]),i=e(n),l=_r(d[3]),r=_r(d[4]),c=_r(d[5]),o=_r(d[6]),s=_r(d[7]);
1179const h=c.OI_SIDE_COLOR,u=.28,x={call:'oi-hatch-call',put:'oi-hatch-put'},y=1.5;function f(){return(0,s.jsx)(n.Defs,{children:['call','put'].map(e=>(0,s.jsx)(n.Pattern,{id:x[e],patternUnits:"userSpaceOnUse",width:5,height:5,patternTransform:"rotate(45)",children:(0,s.jsx)(n.Line,{x1:0,y1:0,x2:0,y2:5,stroke:h[e],strokeWidth:2})},e))})}const O=1;function p(e,t,n,i,l){const{start:r,length:c}=l,o=i/2;return'across'===e?{x:n.x-o,y:n.y-r-c,width:i,height:c}:'call'===t?{x:n.x-r-c,y:n.y-o,width:c,height:i}:{x:n.x+r,y:n.y-o,width:c,height:i}}},1086,[11,13,840,821,1087,1085,1081,6]); 1180__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"OI_FONT",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"OI_MIN_FONT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"OI_LABEL_FONT",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"OI_MIN_BAR",{enumerable:!0,get:function(){return c}});const t='Inter',n=11,u=12,c=6},1087,[]); 1181__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.MaxPainMarker=function({strike:x,scale:o,orientation:_,visible:y}){if(!y)return null;const k=(0,l.maxPainPlacement)(x,o,_);if(!k)return null;const u=(0,l.maxPainA11y)((0,n.strike)(x));return(0,c.jsxs)(t.G,{accessibilityLabel:u,'aria-label':u,children:[k.tick&&(0,c.jsx)(t.Line,{x1:k.tick.x1,y1:k.tick.y1,x2:k.tick.x2,y2:k.tick.y2,stroke:i.MAX_PAIN_COLOR,strokeWidth:1,strokeDasharray:"2,2"}),k.triangles.map((n,s)=>(0,c.jsx)(t.Polygon,{points:n,fill:i.MAX_PAIN_COLOR},s)),Number.isFinite(k.text.y)&&(0,c.jsx)(t.Text,{x:k.text.x,y:k.text.y,textAnchor:k.text.anchor,fill:i.MAX_PAIN_COLOR,fontFamily:s.OI_FONT,fontSize:s.OI_MIN_FONT,children:l.MAX_PAIN_LABEL})]})},r(d[0]);
1181var t=r(d[1]),i=r(d[2]),n=r(d[3]),s=r(d[4]),l=r(d[5]),c=r(d[6])},1088,[11,840,1085,984,1087,1089,6]); 1182__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PAIN_LABEL",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MAX_PAIN_MISSING",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"MAX_PAIN_OFF_AXIS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"MAX_PAIN_BAND",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"MAX_PAIN_TEXT_WIDTH",{enumerable:!0,get:function(){return x}}),e.maxPainStrike=function(n){return c(n?.max_pain_strike)},e.maxPainReason=function(n,t){return null==c(n)?a:t&&null!=t.pos(n)?null:o},e.maxPainPlacement=function(t,a,o){const u=c(t);if(null==u||!a)return null;const _=a.pos(u);if(null==_||!Number.isFinite(_))return null;const{plot:y,labels:f}=a;if('across'===o){const t=y.y+y.h,o=f.length?Math.max(...f.map(n=>n.box.y+n.box.h)):Math.max(t,a.axis),u=Math.max(o,t)+s,x=_,c=`${x},${u} ${x-l},${u+l} ${x+l},${u+l}`,b=24,M=h(x,b,a.width-b),$=f.length?Math.min(...f.map(n=>n.box.y)):u;return{triangles:[c],tick:!f.some(n=>x>=n.box.x-1&&x<=n.box.x+n.box.w+1)&&$-1>t+1?{x1:x,y1:t+1,x2:x,y2:$-1}:null,text:{x:M,y:u+l+n.OI_MIN_FONT,anchor:'middle'},at:_}}const M=f.length?Math.min(...f.map(n=>n.box.x)):a.axis-24,$=f.length?Math.max(...f.map(n=>n.box.x+n.box.w)):a.axis+24,p=_,N=M-s,P=$+s,I=[`${N-l},${p-l} ${N},${p} ${N-l},${p+l}`,`${P+l},${p-l} ${P},${p} ${P+l},${p+l}`],A=n.OI_MIN_FONT+2,O=y.y+A/2,w=y.y+y.h-A/2,F=[p,p+A+1,p-A-1].find(n=>n>=O&&n<=w&&!f.some(t=>b({x:a.axis-24,y:n-A/2,w:x,h:A},t.box))),X=null==F?{x:a.axis,y:NaN,anchor:'middle'}:{x:a.axis,y:F+n.OI_MIN_FONT/2-1,anchor:'middle'};return{triangles:I,tick:null,text:X,at:_}},e.maxPainA11y=function(n){return`${t} ${n}`};var n=r(d[0]);const t='Max pain',a='Max pain not sent for this reading',o='Max pain lies outside the strikes shown',u=20,x=48,l=5,s=2,c=n=>'number'==typeof n&&Number.isFinite(n)?n:null;const b=(n,t)=>n.x<t.x+t.w&&t.x<n.x+n.w&&n.y<t.y+t.h&&t.y<n.y+n.h,h=(n,t,a)=>a<t?(t+a)/2:Math.min(a,Math.max(t,n))},1089,[1087]); 1183__d(function(g,r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CARD_WORDS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"PINNED_HINT",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"MISSING_NOTE",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"ZERO_BASE_NOTE",{enumerable:!0,get:function(){return y}}),_e.atmText=O,_e.changePct=C,_e.signedCompact=I,_e.putMinusCall=x,_e.cardModel=w,_e.cardSummary=T,Object.defineProperty(_e,"CARD_WIDTH",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"CARD_HEIGHT",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"CARD_GAP",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"CARD_MARGIN",{enumerable:!0,get:function(){return S}}),_e.placeCard=k,_e.OiDetailCard=function({row:e,atmOffset:c,pinned:h,onClose:b,anchor:y,orientation:_,bounds:O,inline:C=!1}){const[I,x]=(0,t.useState)(null),[N,S]=(0,t.useState)({width:M,height:j}),F=O??I,H=w(e,c),P=C?{left:0,top:0,width:0,side:'below'}:F?k(y,N,F,_):null,R=T(e,c),A=h||C,D=n.default;return(0,f.jsxs)(D,{pointerEvents:"box-none",style:C?{width:'100%'}:l.default.absoluteFill,onLayout:e=>{const{width:t,height:n}=e.nativeEvent.layout;x(e=>e&&Math.abs(e.width-t)<1&&Math.abs(e.height-n)<1?e:{width:t,height:n})},children:[(0,f.jsx)(s.T,{style:$,"aria-live":"polite","aria-atomic":!0,accessibilityLiveRegion:"polite",children:R}),P&&(0,f.jsxs)(n.default,{role:"group","aria-label":`${p.group}, ${p.strike.toLowerCase()} ${H.strike}`,pointerEvents:h||C?'auto':'none',onLayout:e=>{const{height:t}=e.nativeEvent.layout;S(e=>Math.abs(e.height-t)<1?e:{width:M,height:t})},style:{...C?{position:'relative',width:'100%',borderTopWidth:2,borderTopColor:s.C.mint}:{position:'absolute',left:P.left,top:P.top,width:P.width},backgroundColor:s.C.dark,borderWidth:1,borderColor:h?s.C.muted:s.C.line,borderRadius:10,paddingHorizontal:10,paddingVertical:C?10:7,gap:5,shadowColor:s.C.bg,shadowOpacity:.6,shadowRadius:12,shadowOffset:{width:0,height:4},elevation:6},children:[(0,f.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:8,minHeight:A?44:void 0},children:[(0,f.jsxs)(n.default,{"aria-hidden":!0,importantForAccessibility:"no-hide-descendants",style:{flex:1,flexDirection:'row',alignItems:'baseline',flexWrap:'wrap',gap:8},children:[(0,f.jsxs)(s.T,{style:[v,{fontFamily:'InterSemi',fontSize:13,lineHeight:18,color:s.C.ink}],children:[p.strike," ",H.strike]}),H.atm&&(0,f.jsx)(s.T,{style:[v,{fontFamily:'InterMedium',fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.amber}],children:H.atm})]}),A&&(0,f.jsx)(o.default,{role:"button",accessibilityRole:"button",accessibilityLabel:p.close,onPress:b,hitSlop:4,style:({pressed:e})=>({minWidth:44,minHeight:44,marginRight:-10,alignItems:'center',justifyContent:'center',borderRadius:10,opacity:e?.6:1}),children:(0,f.jsx)(s.Icon,{name:"x",size:18,color:s.C.muted})})]}),(0,f.jsxs)(n.default,{"aria-hidden":!0,importantForAccessibility:"no-hide-descendants",style:{gap:4},children:[H.sides.map(e=>(0,f.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:6},children:[(0,f.jsx)(n.default,{style:{width:8,height:8,borderRadius:2,backgroundColor:e.color}}),(0,f.jsxs)(s.T,{style:{fontFamily:'InterSemi',fontSize:u.OI_MIN_FONT,lineHeight:16,color:e.color,minWidth:44},children:[e.label," ",p.oi]}),(0,f.jsx)(s.T,{style:[v,{fontFamily:'InterSemi',fontSize:u.OI_LABEL_FONT,lineHeight:16,color:s.C.ink}],children:e.oi}),(0,f.jsx)(n.default,{style:{flex:1}}),(0,f.jsx)(s.T,{style:[v,{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.ink}],children:e.chg}),(0,f.jsx)(s.T,{style:[v,{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.muted}],children:e.pct})]},e.key)),(0,f.jsx)(n.default,{style:{height:1,backgroundColor:s.C.line}}),(0,f.jsxs)(n.default,{style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap'},children:[(0,f.jsx)(s.T,{style:{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.muted},children:p.putMinusCall}),(0,f.jsx)(s.T,{style:[v,{fontFamily:'InterSemi',fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.ink}],children:H.diffOi}),(0,f.jsx)(n.default,{style:{flex:1}}),(0,f.jsxs)(s.T,{style:[v,{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:16,color:s.C.muted}],children:[p.putMinusCallChange," ",H.diffChg]})]}),H.notes.map(e=>(0,f.jsx)(s.T,{style:{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:15,color:s.C.muted},children:e},e)),h&&(0,f.jsx)(s.T,{style:{fontFamily:u.OI_FONT,fontSize:u.OI_MIN_FONT,lineHeight:15,color:s.C.muted},children:m})]})]})]})},_e.StrikeAnnouncer=function({row:e,atmOffset:t}){return(0,f.jsx)(s.T,{style:$,"aria-live":"polite","aria-atomic":!0,accessibilityLiveRegion:"polite",children:e?T(e,t):''})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]),f=r(d[8]);const p={strike:'Strike',atm:'ATM',call:'Call',put:'Put',oi:'OI',change:'Change',changePct:'Change %',putMinusCall:'Puts minus calls',putMinusCallChange:'change',putMinusCallSpoken:'Put OI minus call OI',putMinusCallChangeSpoken:'Put change minus call change',close:'Close strike details',group:'Strike details'}
1183,m='Tap this strike again, or press Esc, to close. Press and hold to move across strikes.',b='A dash means that number was not captured at this reading.',y='Change % is a dash where the baseline open interest was zero.',_=e=>'number'==typeof e&&Number.isFinite(e);function O(e){if(!_(e))return null;const t=Math.round(e);return 0===t?p.atm:`${p.atm}${t>0?'+':c.MINUS}${Math.abs(t)}`}function C(e,t){return _(e)&&_(t)&&0!==t?e/t*100:null}function I(e){return _(e)?(e>0?'+':'')+(0,c.compact)(e):c.DASH}function x(e,t){return _(e)&&_(t)?e-t:null}function w(e,t){const n=t=>{const n='call'===t?e.ce_oi:e.pe_oi,o='call'===t?e.ce_chg:e.pe_chg,l='call'===t?e.ce_base:e.pe_base;return{key:t,label:'call'===t?p.call:p.put,oi:(0,c.compact)(n),chg:I(o),pct:(0,c.signed)(C(o,l)),color:h.OI_SIDE_COLOR[t]}},o=[n('call'),n('put')],l=I(x(e.pe_oi,e.ce_oi)),s=I(x(e.pe_chg,e.ce_chg)),u=[[e.ce_chg,e.ce_base],[e.pe_chg,e.pe_base]].some(([e,t])=>_(e)&&0===t),f=[...[e.ce_oi,e.pe_oi,e.ce_chg,e.pe_chg].some(e=>!_(e))||[[e.ce_chg,e.ce_base],[e.pe_chg,e.pe_base]].some(([e,t])=>_(e)&&!_(t))?[b]:[],...u?[y]:[]];return{strike:(0,c.strike)(e.strike),atm:O(t),sides:o,diffOi:l,diffChg:s,notes:f}}function T(e,t){const n=w(e,t),o=e=>`${e.label} ${p.oi} ${e.oi}, ${p.change.toLowerCase()} ${e.chg} (${e.pct}).`;return`${p.strike} ${n.strike}${n.atm?`, ${n.atm}`:''}. ${o(n.sides[0])} ${o(n.sides[1])} ${p.putMinusCallSpoken} ${n.diffOi}. ${p.putMinusCallChangeSpoken} ${n.diffChg}.`}const M=208,j=128,N=10,S=8,F=(e,t,n)=>n<t?t:Math.max(t,Math.min(n,e));function k(e,t,n,o,l=N,s=S){const c=_(n.width)?Math.max(0,n.width):0,h=_(n.height)?Math.max(0,n.height):0,u=Math.max(0,Math.min(_(t.width)?t.width:M,c-2*s)),f=_(t.height)?t.height:j,p=_(e.x)?F(e.x,0,c):c/2,m=_(e.y)?F(e.y,0,h):h/2,b=e=>F(e,s,c-u-s),y=e=>F(e,s,h-f-s),O=()=>{const e=p+l,t=p-l-u,n=e+u<=c-s,o=t>=s;return!(p<=c/2)&&o||!n?o?{left:t,top:y(m-f/2),width:u,side:'left'}:null:{left:e,top:y(m-f/2),width:u,side:'right'}},C=()=>{const e=m+l,t=m-l-f,n=e+f<=h-s,o=t>=s;return!(m<=h/2)&&o||!n?o?{left:b(p-u/2),top:t,width:u,side:'above'}:null:{left:b(p-u/2),top:e,width:u,side:'below'}},I='across'===o?O()??C():C()??O();return I||{left:b(p<=c/2?p+l:p-l-u),top:y(m<=h/2?m+l:m-l-f),width:u,side:'across'===o?p<=c/2?'right':'left':m<=h/2?'below':'above'}}const $={position:'absolute',width:1,height:1,overflow:'hidden',opacity:0},v={fontVariant:['tabular-nums']}},1090,[11,13,375,26,821,984,1085,1087,6]); 1184__d(function(_g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CURSOR_IDLE",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"TAP_SLOP",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"LONG_PRESS_MS",{enumerable:!0,get:function(){return r}}),_e.pressDecision=i,_e.blocksScroll=u,_e.clampIndex=o,_e.startIndex=a,_e.keyAction=s,_e.cursorReducer=d,_e.atmOffsetOf=function(e,n){return c(e)&&c(n)?Math.round(e)-Math.round(n):null},_e.useStrikeCursor=function(t,l,p){const[f,v]=(0,e.useState)(n),y=t.length,x=(0,e.useRef)({count:y,start:null});x.current={count:y,start:a(y,p.startIndex)};const g=(0,e.useRef)(p);g.current=p;const h=(0,e.useCallback)(e=>v(n=>d(n,e,x.current)),[]),b=(0,e.useCallback)(()=>h({type:'close'}),[h]),I=o(f.activeIndex,y),R=null!=I?t[I]?.strike??null:null,w=(0,e.useRef)(null);(0,e.useEffect)(()=>{const e=w.current;if(null==e)return;const n=t.findIndex(n=>n.strike===e);h({type:'sync',index:n>=0?n:null})},[t,h]),(0,e.useEffect)(()=>{w.current!==R&&(w.current=R,g.current.onActive?.(R))},[R]);const E=(0,e.useRef)(null),M=(0,e.useRef)(f);M.current={...f,activeIndex:I};const A=(0,e.useRef)(l);A.current=l;const S=(e,n)=>({touch:e.touch,orientation:A.current,dx:n.x-e.px0,dy:n.y-e.py0,heldMs:Date.now()-e.t0,onPinned:e.onPinned}),P=(0,e.useRef)(null),T=(0,e.useCallback)(e=>{const n=E.current;if(n&&P.current&&'function'==typeof n.removeEventListener&&n.removeEventListener('touchmove',P.current),E.current=e,P.current=null,!e||'function'!=typeof e.addEventListener)return;e.style&&(e.style.touchAction='pan-y',e.style.userSelect='none',e.style.webkitUserSelect='none',e.style.webkitTouchCallout='none');const t=e=>{const n=O.current,t=e?.touches?.[0];n&&t&&e.cancelable&&u(S(n,{x:t.pageX,y:t.pageY}),n.decided)&&e.preventDefault()};P.current=t,e.addEventListener('touchmove',t,{passive:!1})},[]),k=(0,e.useRef)({w:0,h:0}),O=(0,e.useRef)(null),L=(0,e.useRef)('mouse'),D=(0,e.useRef)(0),C=(0,e.useRef)(null);(0,e.useEffect)(()=>()=>{D.current&&'undefined'!=typeof cancelAnimationFrame&&cancelAnimationFrame(D.current),O.current?.timer&&clearTimeout(O.current.timer)},[]);const _=(0,e.useMemo)(()=>{const e=(e,n)=>{const t=e?.nativeEvent||e;if(!t)return null;const r=t.touches?.[0]||t.changedTouches?.[0]||t;{const e=E.current;if(!e||'function'!=typeof e.getBoundingClientRect||!c(r.clientX)||!c(r.clientY))return null;const n=e.getBoundingClientRect(),t=n.width>0&&k.current.w>0?k.current.w/n.width:1,i=n.height>0&&k.current.h>0?k.current.h/n.height:1;return{x:(r.clientX-n.left)*t,y:(r.clientY-n.top)*i}}},n=e=>e?o(g.current.indexAt(e.x,e.y),x.current.count):null,t=e=>{const n=e?.nativeEvent||e||{},t=n.touches?.[0]||n.changedTouches?.[0]||n;return{x:c(t.pageX)?t.pageX:0,y:c(t.pageY)?t.pageY:0}},u=e=>{e?.timer&&clearTimeout(e.timer)},a={ref:T,onLayout:e=>{const n=e?.nativeEvent?.layout;n&&(k.current={w:n.width,h:n.height})},onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>'scrub'===O.current?.decided,onResponderGrant:c=>{u(O.current);const i='touch'===L.current,o=t(c),a={x0:0,y0:0,originX:0,originY:0,touch:i,px0:o.x,py0:o.y,t0:Date.now(),onPinned:!1,decided:'wait',timer:null},s=e(c);if(!s)return void(O.current=null);const d=n(s),l={...a,x0:s.x,y0:s.y,onPinned:M.current.pinned&&null!=d&&M.current.activeIndex===d};O.current=l,i&&(l.timer=setTimeout(()=>{O.current===l&&'wait'===l.decided&&(l.decided='scrub',h({type:'dragStart',index:n({x:l.x0,y:l.y0})}))},r))},onResponderMove:r=>{const c=O.current;if(!c||'release'===c.decided)return;const o=e(r);if(o){if('wait'===c.decided){const e=i(S(c,t(r)));if('wait'===e)return;return u(c),c.decided=e,void('scrub'===e&&h({type:'dragStart',index:n(o)}))}h({type:'dragMove',index:n(o)})}},onResponderRelease:()=>{const e=O.current;O.current=null,e&&(u(e),'scrub'===e.decided?h({type:'dragEnd'}):'wait'===e.decided&&h({type:'tap',index:n({x:e.x0,y:e.y0}),touch:e.touch}))},onResponderTerminationRequest:()=>'scrub'!==O.current?.decided,onResponderTerminate:()=>{const e=O.current;O.current=null,u(e),'scrub'===e?.decided&&h({type:'dragEnd'})},accessible:!0,accessibilityRole:'adjustable',accessibilityActions:[{name:'increment'},{name:'decrement'},{name:'escape'}],onAccessibilityAction:e=>{const n=e?.nativeEvent?.actionName;'increment'===n?h({type:'step',by:'next'}):'decrement'===n?h({type:'step',by:'prev'}):'escape'===n&&h({type:'close'})},onAccessibilityEscape:()=>h({type:'close'})};return Object.assign(a,{focusable:!0,'aria-orientation':'across'===l?'horizontal':'vertical',onKeyDown:e=>{const n=s(e?.nativeEvent?.key??e?.key,l);
1184n&&(e?.preventDefault?.(),h('close'===n?{type:'close'}:{type:'step',by:n}))},onPointerDown:e=>{L.current=(e?.nativeEvent||e)?.pointerType||'mouse'},onPointerMove:t=>{const r=t?.nativeEvent||t;L.current=r?.pointerType||'mouse','touch'===L.current||O.current||(C.current=e(t),D.current||'undefined'==typeof requestAnimationFrame||(D.current=requestAnimationFrame(()=>{D.current=0,h({type:'hover',index:n(C.current)})})))},onPointerLeave:e=>{'touch'!==((e?.nativeEvent||e)?.pointerType||'mouse')&&(D.current&&'undefined'!=typeof cancelAnimationFrame&&(cancelAnimationFrame(D.current),D.current=0),h({type:'leave'}))}}),a},[h,l,T]),j=null!=I&&t[I]?p.valueText?p.valueText(t[I],I):String(t[I].strike):void 0,F=(0,e.useMemo)(()=>({..._,accessibilityValue:y>0?{min:0,max:y-1,...null!=I?{now:I}:{},...j?{text:j}:{}}:void 0}),[_,y,I,j]);return{activeIndex:I,pinned:f.pinned&&null!=I,handlers:F,clear:b}};var e=_r(_d[0]);_r(_d[1]);const n=Object.freeze({activeIndex:null,pinned:!1,dragging:!1}),t=8,r=300,c=e=>'number'==typeof e&&Number.isFinite(e);function i(e){const n=c(e.dx)?e.dx:0,i=c(e.dy)?e.dy:0,u=c(e.heldMs)?e.heldMs:0,o=Math.hypot(n,i)>=t;return e.touch?o?u>=r||e.onPinned||'across'===e.orientation&&Math.abs(n)>Math.abs(i)?'scrub':'release':u>=r?'scrub':'wait':o?'scrub':'wait'}function u(e,n){return!(!e.touch||'release'===n)&&('scrub'===n||'scrub'===i(e))}function o(e,n){return!c(e)||!c(n)||n<1?null:Math.max(0,Math.min(Math.floor(n)-1,Math.round(e)))}function a(e,n){return o(c(n)?n:(e-1)/2,e)}function s(e,n){if('Escape'===e||'Esc'===e)return'close';if('Home'===e)return'first';if('End'===e)return'last';if('across'===n){if('ArrowLeft'===e)return'prev';if('ArrowRight'===e)return'next'}else{if('ArrowUp'===e)return'prev';if('ArrowDown'===e)return'next'}return null}function d(e,t,r){const{count:c}=r;if(c<1)return n;switch(t.type){case'hover':{if(e.pinned||e.dragging)return e;const n=o(t.index,c);return n===e.activeIndex?e:{activeIndex:n,pinned:!1,dragging:!1}}case'leave':return e.pinned||e.dragging||null==e.activeIndex?e:n;case'tap':{const r=o(t.index,c);return null==r?e:e.pinned&&e.activeIndex===r?t.touch?n:{activeIndex:r,pinned:!1,dragging:!1}:{activeIndex:r,pinned:!0,dragging:!1}}case'dragStart':return{activeIndex:o(t.index,c)??e.activeIndex,pinned:e.pinned,dragging:!0};case'dragMove':{if(!e.dragging)return e;const n=o(t.index,c);return null==n||n===e.activeIndex?e:{...e,activeIndex:n}}case'dragEnd':return e.dragging?null==e.activeIndex?n:{activeIndex:e.activeIndex,pinned:!0,dragging:!1}:e;case'step':{const n=o(e.activeIndex,c);let i;return i='first'===t.by?0:'last'===t.by?c-1:null==n?a(c,r.start):o(n+('next'===t.by?1:-1),c),{activeIndex:i,pinned:!0,dragging:!1}}case'close':return null!=e.activeIndex||e.pinned||e.dragging?n:e;case'sync':{if(null==e.activeIndex)return e;const n=null!=t.index?o(t.index,c):o(e.activeIndex,c);return n===e.activeIndex?e:{...e,activeIndex:n}}}return e}},1091,[11,136]); 1185__d(function(g,_r,_i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CHANGE_WINDOWS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"DEFAULT_CHANGE_WINDOW",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"CHANGE_WINDOW_NOT_LOADED",{enumerable:!0,get:function(){return l}}),e.stampMs=a,e.baselineIndex=m,e.changeRows=_,e.elapsedText=b,e.changeWindowFooter=v,e.changeView=function(n,t,l){const o=m(n,t,l),r=_(n,t,o),i=v(n,t,l);return o.ok?{ok:!0,rows:r,baseline:o,footer:i}:{ok:!1,rows:r,reason:o.reason,footer:i}},e.changeWindowScaleMax=function(n,t){if(!n)return null;let l=null;for(let o=0;o<n.readings.length;o++)for(const r of _(n,o,m(n,o,t)))for(const n of[r.ce_chg,r.pe_chg])null!=n&&(null==l||Math.abs(n)>l)&&(l=Math.abs(n));return l};const n=[{value:'prev_close',label:'Since prev close',a11y:'Change since the previous close',minutes:null},{value:'open',label:'Since open',a11y:'Change since the first reading of the session',minutes:null},{value:'15m',label:'Last 15m',a11y:'Change over the last 15 minutes',minutes:15},{value:'30m',label:'30m',a11y:'Change over the last 30 minutes',minutes:30},{value:'1h',label:'1h',a11y:'Change over the last hour',minutes:60}],t='prev_close',l='The session readings are not loaded, so only the change since the previous close can be shown',o='session not loaded',r='the reading time could not be read',i=n=>'number'==typeof n&&Number.isFinite(n)?n:null,u=n=>String(n).padStart(2,'0'),s=/(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})(?::(\d{2}))?/;function a(n){if('string'!=typeof n)return null;const t=s.exec(n);if(!t)return null;const[l,o,r,i,u,a]=t.slice(1).map(n=>null==n?0:Number(n));return o<1||o>12||r<1||r>31||i>23||u>59||a>59?null:Date.UTC(l,o-1,r,i,u,a)}const c=n=>{const t=new Date(n);return`${u(t.getUTCHours())}:${u(t.getUTCMinutes())}`},d=n=>
1185{const t=a(n);return null==t?null:c(t)},h=(n,t)=>t<=0?0:Number.isFinite(n)?Math.max(0,Math.min(t-1,Math.round(n))):t-1,f=t=>n.find(n=>n.value===t)||n[0];function m(n,t,l){const i=f(l);if('prev_close'===i.value)return{ok:!0,index:null,at:null,time:null};if(!n||!n.readings.length)return{ok:!1,reason:o};const u=h(t,n.readings.length);if('open'===i.value){const t=n.readings[0];return{ok:!0,index:0,at:t.at,time:d(t.at)}}const s=a(n.readings[u].at);if(null==s)return{ok:!1,reason:r};const m=s-6e4*i.minutes;for(let t=u;t>=0;t--){const l=a(n.readings[t].at);if(null!=l&&l<=m){return{ok:!0,index:t,at:n.readings[t].at,time:c(l)}}}return{ok:!1,reason:`no reading at ${c(m)}`}}const p=(n,t)=>null==n||null==t?null:n-t;function _(n,t,l){if(!n||!n.readings.length)return[];const o=h(t,n.readings.length);let r;r=null==l?null:'number'==typeof l?Number.isInteger(l)&&l>=0&&l<=o?l:void 0:l.ok?null==l.index?null:Number.isInteger(l.index)&&l.index>=0&&l.index<=o?l.index:void 0:void 0;const u=n.call_oi[o]||[],s=n.put_oi[o]||[],a=void 0===r?null:null===r?n.prev_close_call:n.call_oi[r]||[],c=void 0===r?null:null===r?n.prev_close_put:n.put_oi[r]||[];return n.strikes.map((n,t)=>{const l=i(u[t]),o=i(s[t]),r=a?i(a[t]):null,d=c?i(c[t]):null;return{strike:n,ce_oi:l,pe_oi:o,ce_chg:p(l,r),pe_chg:p(o,d),ce_base:r,pe_base:d}})}function b(n){const t=Math.max(0,Math.round(n));if(t<60)return`${t} min`;const l=Math.floor(t/60),o=t%60;return o?`${l} h ${o} min`:`${l} h`}function v(n,t,l){const o=m(n,t,l);if(!o.ok)return`No change shown: ${o.reason}`;if(null==o.index||!n)return'Change since previous close';const r=h(t,n.readings.length),i=a(n.readings[r].at),u=a(o.at),s=null!=i&&null!=u?` (${b((i-u)/6e4)})`:'';return`Change since ${o.time}${s}`}},1092,[]); 1186__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"COMPACT_LABELS",{enumerable:!0,get:function(){return b}}),_e.ChangeWindowPicker=function({value:e,onChange:f,disabled:h=!1,reason:y,compact:p=!1}){return p?(0,n.jsxs)(t.default,{style:{gap:4,width:'100%'},children:[(0,n.jsx)(t.default,{accessibilityRole:"radiogroup",accessibilityLabel:"Change measured from",'aria-disabled':h,style:{flexDirection:'row',flexWrap:'nowrap',borderWidth:1,borderColor:l.C.line,borderRadius:11,opacity:h?.42
1186:1},children:o.CHANGE_WINDOWS.map((t,p)=>{const C=t.value===e,v=p===o.CHANGE_WINDOWS.length-1;return(0,n.jsx)(i.default,{role:"radio","aria-checked":C,"aria-disabled":h,accessibilityState:{checked:C,disabled:h},accessibilityLabel:t.a11y,accessibilityHint:h?y:void 0,disabled:h,onPress:()=>{C||f(t.value)},style:({pressed:e})=>({flexGrow:'prev_close'===t.value?1.6:1,flexBasis:0,minHeight:s,minWidth:s,paddingHorizontal:4,alignItems:'center',justifyContent:'center',borderLeftWidth:p?1:0,borderColor:l.C.line,borderTopLeftRadius:p?0:10,borderBottomLeftRadius:p?0:10,borderTopRightRadius:v?10:0,borderBottomRightRadius:v?10:0,backgroundColor:C?l.C.soft:'transparent',opacity:e?.72:1}),children:(0,n.jsx)(l.T,{numberOfLines:1,style:{fontFamily:C?'InterMedium':c,fontSize:u,lineHeight:17,color:C?l.C.green:l.C.muted},children:b[t.value]})},t.value)})}),h&&!!y&&(0,n.jsx)(l.T,{accessibilityLiveRegion:"polite",style:{fontFamily:c,fontSize:u,lineHeight:17,color:l.C.muted},children:y})]}):(0,n.jsxs)(t.default,{style:{gap:4,maxWidth:'100%'},children:[(0,n.jsx)(t.default,{accessibilityRole:"radiogroup",accessibilityLabel:"Change measured from",'aria-disabled':h,style:{flexDirection:'row',flexWrap:'wrap',gap:6,opacity:h?.42
1186:1},children:o.CHANGE_WINDOWS.map(t=>{const o=t.value===e;return(0,n.jsx)(i.default,{role:"radio","aria-checked":o,"aria-disabled":h,accessibilityState:{checked:o,disabled:h},accessibilityLabel:t.a11y,accessibilityHint:h?y:void 0,disabled:h,onPress:()=>{o||f(t.value)},style:({pressed:e})=>({minHeight:s,minWidth:s,paddingHorizontal:12,borderRadius:11,borderWidth:1,borderColor:o?l.C.green:l.C.line,backgroundColor:o?l.C.soft:l.C.paper,alignItems:'center',justifyContent:'center',opacity:e?.72:1}),children:(0,n.jsx)(l.T,{style:{fontFamily:o?'InterMedium':c,fontSize:u,lineHeight:17,color:o?l.C.green:l.C.muted},children:t.label})},t.value)})}),h&&!!y&&(0,n.jsx)(l.T,{accessibilityLiveRegion:"polite",style:{fontFamily:c,fontSize:u,lineHeight:17,color:l.C.muted},children:y})]})},r(d[0]);var i=e(r(d[1])),t=e(r(d[2])),l=r(d[3]),o=r(d[4]),n=r(d[5]);const s=44,c='Inter',u=12,b={prev_close:'Prev close',open:'Open','15m':'15m','30m':'30m','1h':'1h'}},1093,[11,375,13,821,1092,6]); 1187__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TILE_H",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"TILE_READING_TEXT",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"SCREENER_FLOOR_TEXT",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"SCREENER_IDLE_SUB",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"SCREENER_CLICK_TEXT",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"GRID_HIGHLIGHT_TEXT",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"GRID_GAP_TEXT",{enumerable:!0,get:function(){return M}}),_e.gridColumns=$,_e.OiGridSection=function({symbol:e,badge:n,linked:i,expiry:o,seq:s,read:l,rules:h,target:x,onTarget:b,onCustomize:_,stacked:k,height:T,hidden:C,onHide:j,expanded:w,onExpand:v,highlight:O,onHighlight:S}){const E=e=>!(C?.[e]||w&&w!==e),[I,P]=(0,t.useState)([]),L=(0,t.useCallback)(e=>P(t=>t.length===e.length&&t.every((t,n)=>t.text===e[n].text)?t:e),[]),M=l,z=M.data,A=[{heading:'delta-OI by strike',lines:E('oi_grid')?[z?.delta_oi_text||'\u0394OI is open interest added or removed since the previous close. Every line starts at 0 at the first reading of the day.',z?.atm_text||'ATM is the listed strike nearest spot in the front expiry. ATM+n is n strikes above spot, ATM\u2212n is n strikes below.',z?.direction_text||'',y.GRID_LEGEND_TEXT,z?.price_text||'The dashed line on each tile is that contract\'s own last traded price at the same readings, on its own scale.',H,z?.flow_text||'Every opened contract has a buyer and a seller. These two lines read which side was paying up at each reading \u2014 they do not say what happens next.',z?.block_text||'',(0,y.gridBasis)(z),("A reading with no snapshot is drawn as a gap on both lines; nothing here is interpolated. "+(0,y.gridSourceText)(z?.points_source)).trim(),R]:[]},{heading:'Futures chart',lines:E('oi_grid_futures')?I:[]}],D=e?{label:'At-the-money strike',value:(0,y.strike)(z?.atm_strike),against:(0,y.headlineAgainst)(null!=z?.spot?'nearest the captured spot '+(0,y.spotLevel)(z.spot,z?.underlying||e):'',z?.expiry?(0,y.expiryText)(z.expiry,z?.days_to_expiry??null):''),reason:z?.not_enough_marks||y.GRID_NOT_ENOUGH_MARKS}:{label:'At-the-money strike',value:y.DASH,reason:'Click any row on the screener above, or choose a symbol in Customize, to point this block at one.'};return(0,f.jsx)(c.Block,{title:"\u0394OI by strike, through the session",subtitle:"One symbol across the block: its front futures contract, and the ten strikes at the money.",asOf:(0,y.asOfText)(z?.as_of),badge:n,linked:i,headline:D,info:(0,f.jsx)(c.InfoDisclosure,{title:"\u0394OI by strike, through the session",groups:A}),actions:(0,f.jsx)(u.LinkText,{label:(0,y.customizeLabel)((h||[]).length),a11y:'Customize this block: '+(h||[]).length+' filters in force. Open the filter builder',onPress:_}),stacked:k,height:T,chart:t=>E('oi_grid_futures')?(0,f.jsx)(p.FuturesChartPanel,{underlying:e,seq:s,onInfo:L,onExpand:v?()=>v('oi_grid_futures'):void 0,expanded:'oi_grid_futures'===w,onClose:j?()=>j('oi_grid_futures'):void 0,style:t},"oi_grid_futures"):null,content:t=>E('oi_grid')?(0,f.jsx)(N,{underlying:e,read:M,target:x,onTarget:b,highlight:O,onHighlight:S,onExpand:v?()=>v('oi_grid'):void 0,expanded:'oi_grid'===w,onClose:j?()=>j('oi_grid'):void 0,style:t},"oi_grid"):null})};var t=r(d[0]),n=e(r(d[1])),i=e(r(d[2])),o=e(r(d[3])),s=r(d[4]),l=e(s),h=r(d[5]),u=r(d[6]),c=r(d[7]),p=r(d[8]),y=r(d[9]),f=r(d[10]);const x=34,b=64,_=8,k=16,T=13,C=15,j=14,w=26,v=8,O=4,S=76,E=198,H='The two lines under each tile read that contract\'s premium and its \u0394OI together over that same hour: what is happening, and what that is a reading of. Both are worked out in the browser from the very points the tile drew, so a tile can never disagree with its own chart.',I='A contract is listed only when it clears all three floors above.',P='Over the floors',L='Clicking a row points the futures chart and the ten tiles at that contract.',R='Pointing at a tile lights the same strike wherever else it is on this tab \u2014 on the option chain and in the volatility-by-strike list. It highlights; it changes nothing.',M='A reading with no snapshot is drawn as a gap on both lines; nothing here is interpolated.',z='3 2',A=1,D=1.4;function $(e){return e<420?2:e<660?3:5}function G({slot:e,width:t,selected:i,lit:u,onPress:p,onHighlight:_}){const H=(0,y.gridDirection)(e.points),I=(0,y.directionChip)(H),P=(0,y.directionTone)(H),L=(0,y.gridFlow)(e.option_type,e.points),R=(0,y.gridSlotNote)(e),M=(0,c.typeColor)((0,y.optionTone)(e.option_type)),$=Math.max(0,t-x-22),G=(0,y.scaleDelta)(e.points,$,b),N=(0,y.scaleGridPrice)(e.points,$,b),F=(0,y.deltaAxis)(G),B=(0,y.axisTimes)(e.points,3),W=G?[...G.points].reverse().find(Boolean):null,X=[...e.points||[]].reverse().find(e=>'number'==typeof e?.price),U=S;return(0,f.jsxs)(o.default,{accessibilityRole:"button",accessibilityLabel:(0,y.gridSlotLabel)(e,H),accessibilityState:{selected:i},disabled:!e.present,onPress:p,onHoverIn:()=>_?.(null==e.strike?null:Number(e.strike)),onHoverOut:()=>_?.(null),onFocus:()=>_?.(null==e.strike?null:Number(e.strike)),onBlur:()=>_?.(null),style:e=>[{width:t,height:E,padding:v,borderRadius:10,gap:O,borderWidth:i||e.focused?2:1,borderColor:i||e.focused?h.C.green:u?h.C.mint:h.C.line,backgroundColor:i?h.C.soft:u||e.hovered||e.focused?h.C.dark:'transparent'}],children:[(0,f.jsx)(h.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:12,lineHeight:k,height:k,color:M},children:(0,y.gridSlotTitle)(e)}),(0,f.jsx)(h.T,{numberOfLines:1,style:{fontSize:9,lineHeight:T,height:T,color:h.C.muted},children:(0,y.gridSlotDetail)(e)}),(0,f.jsx)(n.default,{style:{height:U},children:R?(0,f.jsx)(n.default,{style:{flex:1,justifyContent:'center'},children:(0,f.jsx)(h.T,{style:{fontSize:9,lineHeight:13,color:h.C.muted},children:R})}):$>0&&(0,f.jsxs)(l.default,{width:t-18,height:U,children:[F.map(e=>(0,f.jsx)(s.Text,{x:0,y:Math.min(64,Math.max(8,e.y+3)),fill:h.C.muted,fontSize:8,children:(0,y.deltaUnits)(e.v)},`y${e.v}`)),!!G&&(0,f.jsx)(s.Line,{x1:x,x2:x+$,y1:G.zero,y2:G.zero,stroke:h.C.line,strokeWidth:1,strokeDasharray:"2 3"}),(0,f.jsx)(s.Path,{d:(0,y.linePath)(N),stroke:h.C.ink,strokeOpacity:.7,strokeWidth:A,strokeDasharray:z,fill:"none",transform:`translate(${x},0)`}),(0,f.jsx)(s.Path,{d:(0,y.linePath)(G),stroke:M,strokeWidth:D,fill:"none",transform:`translate(${x},0)`}),!!W&&(0,f.jsx)(s.Circle,{cx:x+W.x,cy:W.y,r:2.4,fill:M}),B.map(n=>{const i=e.points.length>1?$/(e.points.length-1):0;return(0,f.jsx)(s.Text,{x:Math.min(t-40,x+n.i*i-10),y:74,fill:h.C.muted,fontSize:8,children:n.label},`x${n.i}`)})]})}),(0,f.jsxs)(n.default,{style:[h.s.row,{gap:6,height:C}],children:[I?(0,f.jsx)(n.default,{style:{paddingHorizontal:5,paddingVertical:1,borderRadius:4,borderWidth:1,borderColor:'flat'===P?h.C.line:(0,c.buildupColor)(P)},children:(0,f.jsx)(h.T,{style:{fontSize:9,lineHeight:13,fontFamily:'InterSemi',color:'flat'===P?h.C.muted:(0,c.buildupColor)(P)},children:I})}):(0,f.jsx)(h.T,{style:{fontSize:9,lineHeight:13,color:h.C.muted},children:"no baseline"}),(0,f.jsx)(n.default,{style:{flex:1}}),(0,f.jsx)(h.T,{numberOfLines:1,style:{fontSize:9,lineHeight:13,color:h.C.muted,fontVariant:['tabular-nums']},children:(0,y.price)(X?.price)})]}),(0,f.jsx)(h.T,{numberOfLines:1,style:{fontSize:9,lineHeight:13,height:j,fontFamily:'InterMedium'},children:L.what_label}),(0,f.jsx)(n.default,{style:{height:w},children:(0,f.jsx)(h.T,{numberOfLines:2,style:{fontSize:9,lineHeight:13,color:h.C.muted},children:L.meaning})})]})}function N({underlying:e,read:o,target:s,onTarget:l,highlight:u,onHighlight:p,onExpand:x,expanded:b,onClose:k,style:T}){const[C,j]=(0,t.useState)(0),w=o.data,v=e?(0,c.stateOf)(o,w?.not_enough_marks||y.GRID_NOT_ENOUGH_MARKS):{phase:'empty',text:'Choose a symbol in Customize, or click a row in the screener, to see the strikes at the money.'},O=w?.rows||[],S=(0,t.useMemo)(()=>{const e=[{key:'calls',label:'Calls \u2014 at the money and above',slots:[]},{key:'puts',label:'Puts \u2014 at the money and below',slots:[]}];for(const t of O)('puts'===t.row?e[1]:e[0]).slots.push(t);return e},[O]),E=$(C||660),H=Math.max(120,Math.floor(((C||660)-_*(E-1))/E)),I=t=>{t.present&&l({underlying:w?.underlying||e,instrumentToken:t.instrument_token,label:t.tradingsymbol||(0,y.gridSlotTitle)(t),detail:`${(0,y.gridSlotTitle)(t)} \xb7 ${t.label}${null!=w?.days_to_expiry?` \xb7 ${(0,y.dteText)(w.days_to_expiry)}`:''}`})},P=w?.expiry?(0,y.expiryText)(w.expiry,null):'',L=e?`${e}${P&&P!==y.DASH?` \xb7 ${P}`:''}${null!=w?.atm_strike?` \xb7 ATM ${(0,y.strike)(w.atm_strike)}`:''}${null!=w?.spot?` \xb7 spot ${(0,y.spotLevel)(w.spot,e)}`:''}`:'',R=(0,y.gridBlockRead)(O);return(0,f.jsx)(c.WidgetFrame,{name:"Strikes at the money",subtitle:L,body:w,state:v,onRefresh:o.reload,onExpand:x,expanded:b,onClose:k,note:R||void 0,inBlock:!0,style:T,emptyDetail:w?.empty_detail||'Each line needs two readings before it is a line rather than a dot.',children:(0,f.jsx)(i.default,{style:{flex:1},contentContainerStyle:{padding:10,gap:10},children:(0,f.jsx)(n.default,{onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width);j(e=>Math.abs(e-t)<3?e:t)},style:{gap:10},children:S.map(e=>(0,f.jsxs)(n.default,{style:{gap:6},children:[(0,f.jsx)(h.T,{style:c.head,children:e.label}),(0,f.jsx)(n.default,{style:[h.s.row,{flexWrap:'wrap',alignItems:'flex-start',gap:_}],children:e.slots.map(e=>(0,f.jsx)(G,{slot:e,width:H,onPress:()=>I(e),onHighlight:p,lit:null!=u&&null!=e.strike&&Math.abs(Number(e.strike)-u)<.5,selected:null!=e.instrument_token&&s?.instrumentToken===e.instrument_token},e.slot))})]},e.key))})})})}},1094,[11,13,278,375,840,821,925,1074,1095,984,6]); 1188__d(function(g,r,_i,a,m,_e,d){"use strict";
1188function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.FuturesChartPanel=function({underlying:e,seq:F,onExpand:R,expanded:U,onClose:$,onInfo:A,style:H}){const[D,I]=(0,t.useState)({w:0,h:0}),[O,W]=(0,t.useState)(x.FUTURES_DEFAULT_INTERVAL),N=e?`/api/derivatives/futures-chart?underlying=${encodeURIComponent(e)}&interval=${O}`:null,B=(0,c.useDerivativeRead)(N,F),P=B.data,z=e?(0,h.stateOf)(B,x.FUTURES_NO_CANDLES):{phase:'empty',text:x.FUTURES_NO_SYMBOL},V=P?.candles||[],G=Math.max(0,D.w-p),X=Math.max(0,D.h-j),Y=(0,x.candleWindow)(V,G),q=Y.candles,J=(0,x.candleWindowText)(Y),K=(0,x.scaleCandles)(q,G,X),Q=(0,x.candleWindowShort)(Y)||(0,x.candleDrawnText)(K?.drawn,(0,x.futuresBars)(P)),Z=(0,x.candleAxis)(K,X),ee=(0,x.candleAxisTimes)(q,O,5,G),te=[...q].reverse().find(e=>'number'==typeof e?.close),ae=(0,x.futuresShortText)(P),le=(0,x.futuresFewText)(K?.drawn),ne=(0,x.futuresIntervalChoices)(P),se=(0,x.futuresIntervalNote)(ne),ie=(0,x.futuresChartSubtitle)(P),re=[(0,x.futuresNote)(P,O),J,x.FUTURES_GAP_TEXT,x.FUTURES_DISPLAY_TEXT].filter(Boolean).join(L);(0,t.useEffect)(()=>{A?.(re?re.split(L).map(e=>({text:e})):[])},[re,A]);const oe=(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(n.default,{style:[u.s.row,{gap:6,rowGap:16,flexWrap:'wrap'}],children:ne.map(e=>{const t=e.key===O;return(0,y.jsxs)(s.default,{accessibilityRole:"button",accessibilityState:{selected:t,disabled:!e.available},disabled:!e.available,accessibilityLabel:e.available?`Show ${e.label}`:`${e.label}, unavailable. ${e.reason}`,onPress:()=>W(e.key),hitSlop:b,style:l=>[{minHeight:28,paddingHorizontal:10,justifyContent:'center',borderRadius:8,borderWidth:1,borderColor:t?u.C.green:u.C.line,opacity:e.available?1:.5,backgroundColor:t?u.C.soft:l.hovered||l.focused?u.C.dark:'transparent'}],children:[(0,y.jsx)(f.HitArea,{slop:b}),(0,y.jsx)(u.T,{numberOfLines:1,style:{fontSize:11,lineHeight:15,fontFamily:'InterSemi',color:t?u.C.green:e.available?u.C.ink:u.C.muted},children:e.label})]},e.key)})})}),de=[ae,le].filter(Boolean).join(' '),ue=(0,y.jsxs)(n.default,{style:{gap:3},children:[(0,y.jsxs)(n.default,{style:[u.s.row,{gap:10}],children:[(0,y.jsxs)(u.T,{numberOfLines:1,style:[h.bodyText,{fontVariant:['tabular-nums']}],children:["Last close ",(0,x.spotLevel)(te?.close,e)]}),(0,y.jsx)(n.default,{style:{flex:1}}),!!Q&&(0,y.jsx)(u.T,{numberOfLines:1,style:[h.metaText,{fontVariant:['tabular-nums']}],children:Q})]}),!!se&&(0,y.jsxs)(n.default,{style:[u.s.row,{gap:5,alignItems:'flex-start'}],children:[(0,y.jsx)(n.default,{style:{paddingTop:2},children:(0,y.jsx)(u.Icon,{name:"info",size:10,color:u.C.muted})}),(0,y.jsx)(u.T,{style:[h.metaText,{flex:1}],children:se})]}),!!de&&(0,y.jsx)(u.T,{style:[h.metaText,{color:u.C.amber}],children:de})]});return(0,y.jsx)(h.WidgetFrame,{name:(0,x.futuresChartTitle)(P?.contract,e),subtitle:ie,body:P,state:z,onRefresh:B.reload,onExpand:R,expanded:U,onClose:$,toolbar:oe,note:ue,inBlock:!0,style:H,emptyDetail:"The panel draws only candles that were stored for this contract; it never fills a gap in the series.",children:(0,y.jsx)(n.default,{style:{flex:1,minHeight:0,padding:w,gap:6},children:(0,y.jsx)(n.default,{style:{flex:1,minHeight:T},onLayout:e=>{const{width:t,height:l}=e.nativeEvent.layout,n=Math.round(t),s=Math.round(l);I(e=>Math.abs(e.w-n)<3&&Math.abs(e.h-s)<3?e:{w:n,h:s})},children:G>0&&X>0&&(0,y.jsxs)(o.default,{width:D.w,height:D.h,accessibilityLabel:`${(0,x.futuresChartSpoken)({contract:P?.contract,candles:q},O,e)}${J?` ${J}`:''}`,children:[Z.map(e=>(0,y.jsx)(k,{y:e.y,label:(0,x.priceTick)(e.v),width:D.w,plotH:X},`y${e.v}`)),(K?.candles||[]).map((e,t)=>{if(!e)return null;const n='up'===e.direction?C:'down'===e.direction?v:S,s=Math.min(e.open,e.close),o=Math.max(_,Math.abs(e.close-e.open)),u=p+e.x;return(0,y.jsxs)(l.default.Fragment,{children:[(0,y.jsx)(i.Line,{x1:u,x2:u,y1:e.high,y2:e.low,stroke:n,strokeWidth:M}),(0,y.jsx)(i.Rect,{x:u-K.body/2,y:s,width:K.body,height:o,fill:n})]},`c${t}`)}),ee.map(e=>(0,y.jsx)(E,{label:e.label,x:p+(K?.step||0)*(e.i+.5),width:D.w,y:D.h-3},`x${e.i}`))]})})})})};var t=r(d[0]),l=e(t),n=e(r(d[1])),s=e(r(d[2])),i=r(d[3]),o=e(i),u=r(d[4]),c=r(d[5]),h=r(d[6]),x=r(d[7]),f=r(d[8]),y=r(d[9]);const b=(0,f.touchSlop)(28),p=46,j=14,w=10,T=120,C=u.C.green,v=u.C.red,S=u.C.muted,M=1,_=1,L='\0';function k({y:e,label:t,width:l,plotH:n}){return t===x.DASH?null:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i.Line,{x1:p,x2:l,y1:Math.min(n,Math.max(0,e)),y2:Math.min(n,Math.max(0,e)),stroke:u.C.line,strokeWidth:1,strokeDasharray:"2 4"}),(0,y.jsx)(F,{x:0,y:Math.min(n-1,Math.max(8,e+3)),label:t})]})}function E({label:e,x:t,width:l,y:n}){return e===x.DASH?null:(0,y.jsx)(F,{x:Math.min(l-32,Math.max(p,t-16)),y:n,label:e})}function F({x:e,y:t,label:l}){return(0,y.jsx)(i.Text,{x:e,y:t,fill:u.C.muted,fontSize:9,children:l})}},1095,[11,13,375,840,821,1071,1074,984,832,6]); 1189__d(function(g,r,i,a,m,e,d){"use strict";
1189Object.defineProperty(e,'__esModule',{value:!0}),e.oneSentence=u,e.shrink=h,e.blockSubtitle=v,e.PcrSection=function({symbol:_,expiry:u,seq:b,stacked:y,height:f,badge:I,linked:k,hidden:R,onHide:O,expanded:P,onExpand:C}){const A=t=>!(R?.[t]||P&&P!==t),E=_?`/api/derivatives/pcr-series?underlying=${encodeURIComponent(_)}${u?`&expiry=${encodeURIComponent(u)}`:''}`:null,S=(0,n.useDerivativeRead)(E,b),D=S.data,M=_?(0,o.stateOf)(S,p.PCR_NO_POINTS):{phase:'empty',text:p.NO_SYMBOL_TEXT},N=D?.points||[],L=(0,t.useMemo)(()=>(0,p.seriesTimes)(N),[N]),B=(0,t.useMemo)(()=>(0,p.seriesValues)(N,t=>t.pcr_oi),[N]),U=(0,t.useMemo)(()=>(0,p.seriesValues)(N,t=>t.pcr_volume),[N]),V=(0,p.directionWords)(D?.direction_words),w=(0,p.servedChip)(D?.direction,V,D?.direction_labels),j=(0,p.servedTone)(D?.direction,V),F=(0,p.servedChip)(D?.volume_direction,V,D?.direction_labels),G=(0,p.servedTone)(D?.volume_direction,V),X=(0,p.withheldText)(D),$=h(_,S.phase),H=[...N].reverse().find(t=>t&&!t.gap),W=[{key:'pcr_oi',label:p.PCR_OI_LABEL,color:s.C.mint,values:B,format:p.pcrText},{key:'pcr_volume',label:p.PCR_VOLUME_LABEL,color:s.C.amber,second:!0,values:U,format:p.pcrText}],q=t=>(0,p.figureAtText)(D?.[`latest_${t}_at`],D?.as_of),Y=(0,p.deltaRatio)(D?.latest_delta_pcr_oi),z=(0,p.deltaRatio)(D?.latest_delta_pcr_volume),J=(0,p.deltaReasonText)(D,'no_baseline'),K=[{label:p.PCR_OI_LABEL,value:(0,p.pcrText)(D?.latest_pcr_oi),chip:w,chipTone:j,at:q('pcr_oi')},{label:'Change since previous close (OI)',value:Y,at:q('delta_pcr_oi'),reason:J},{label:p.PCR_VOLUME_LABEL,value:(0,p.pcrText)(D?.latest_pcr_volume),chip:F,chipTone:G,at:q('pcr_volume')},{label:'Change since previous close (volume)',value:z,at:q('delta_pcr_volume'),reason:J},{label:'Previous close (OI)',value:(0,p.pcrText)(D?.previous_close_pcr_oi),at:(0,p.previousCloseAtText)(D?.previous_close_at),reason:J},{label:'Total call open interest',value:(0,p.compact)(D?.latest_total_ce_oi??H?.total_ce_oi),at:q('total_ce_oi')},{label:'Total put open interest',value:(0,p.compact)(D?.latest_total_pe_oi??H?.total_pe_oi),at:q('total_pe_oi')}],Q=_?{label:p.PCR_OI_LABEL,value:(0,p.pcrText)(D?.latest_pcr_oi),against:(0,p.headlineAgainst)((0,p.deltaSince)(Y,D,'no_baseline'),(0,p.pcrAgainst)(D?.latest_total_pe_oi??H?.total_pe_oi,D?.latest_total_ce_oi??H?.total_ce_oi)),chip:w,chipTone:j,reason:X||p.PCR_NO_POINTS}:T(p.PCR_OI_LABEL);return(0,c.jsx)(o.Block,{title:"PCR through the session",subtitle:"Put open interest against call open interest, and the same division over volume, at every reading.",asOf:(0,p.asOfText)(D?.as_of),badge:I,linked:k,headline:Q,info:(0,c.jsx)(o.InfoDisclosure,{title:"PCR through the session",groups:[{heading:'PCR through the session',lines:[D?.definition||p.PCR_DEFINITION,p.PCR_READING_TEXT,(0,p.directionRule)(D),D?.chain_floors_text||'']},{heading:'Change since the previous close',lines:[String(D?.delta_text||''),String(D?.delta_unit_text||''),(0,p.deltaReadingsText)(D),String(D?.previous_close_reason||'')]},x(D)||{heading:'',lines:[]}]}),stacked:y,height:f,idle:$,chart:t=>A('pcr_chart')?(0,c.jsx)(l.SessionPanel,{name:"PCR through the session",subtitle:v(_,D?.expiry,D?.days_to_expiry),body:D,state:M,times:L,series:W,shared:!0,axisFormat:t=>(0,p.pcrText)(t),chip:w,chipTone:j,caveat:X,note:(0,p.pcrLine)(D),onRefresh:S.reload,onExpand:C?()=>C('pcr_chart'):void 0,expanded:'pcr_chart'===P,onClose:O?()=>O('pcr_chart'):void 0,emptyDetail:"Each line needs two readings that carried a value before it is a line rather than a dot.",style:t},"pcr_chart"):null,content:t=>A('pcr_readings')?(0,c.jsx)(l.ReadingsPanel,{name:"Latest PCR reading",subtitle:v(_,D?.expiry,D?.days_to_expiry),body:D,state:M,rows:K,caveat:X,note:(0,p.readingsText)(D),onRefresh:S.reload,onExpand:C?()=>C('pcr_readings'):void 0,expanded:'pcr_readings'===P,onClose:O?()=>O('pcr_readings'):void 0,emptyDetail:"Nothing has been captured for this symbol at this reading.",style:t},"pcr_readings"):null})},e.MaxPainSection=function({symbol:_,expiry:u,seq:b,stacked:y,height:f,badge:I,linked:k,hidden:R,onHide:O,expanded:P,onExpand:C}){const A=t=>!(R?.[t]||P&&P!==t),E=_?`/api/derivatives/maxpain-series?underlying=${encodeURIComponent(_)}${u?`&expiry=${encodeURIComponent(u)}`:''}`:null,S=(0,n.useDerivativeRead)(E,b),D=S.data,M=_?(0,o.stateOf)(S,p.MAX_PAIN_NO_POINTS):{phase:'empty',text:p.NO_SYMBOL_TEXT},N=D?.points||[],L=(0,t.useMemo)(()=>(0,p.seriesTimes)(N),[N]),B=(0,t.useMemo)(()=>(0,p.seriesValues)(N,t=>t.max_pain_strike),[N]),U=(0,t.useMemo)(()=>(0,p.seriesValues)(N,t=>t.spot),[N]),V=(0,p.directionWords)(D?.direction_words),w=(0,p.servedChip)(D?.direction,V,D?.direction_labels),j=(0,p.servedTone)(D?.direction,V),F=(0,p.withheldText)(D),G=h(_,S.phase),X=[{key:'max_pain',label:'Max pain',color:s.C.mint,values:B,format:t=>(0,p.strike)(t)},{key:'spot',label:'Spot',color:s.C.amber,second:!0,values:U,format:t=>(0,p.spotLevel)(t,_)}],$=t=>(0,p.figureAtText)(D?.[`latest_${t}_at`],D?.as_of),H=D?.latest_max_pain_strike_at===D?.latest_spot_at,W=t=>(0,p.figureAtText)(D?.[`latest_${t}_at`],H?D?.as_of:null),q=(0,p.deltaStrikePoints)(D?.latest_delta_max_pain_strike),Y=(0,p.deltaReasonText)(D,'no_baseline'),z=[{label:'Max pain strike',value:(0,p.strike)(D?.latest_max_pain_strike),chip:w,chipTone:j,at:$('max_pain_strike')},{label:'Change since previous close',value:q,at:$('delta_max_pain_strike'),reason:Y},{label:'Previous close',value:(0,p.strike)(D?.previous_close_max_pain_strike),at:(0,p.previousCloseAtText)(D?.previous_close_at),reason:Y},{label:'Spot',value:(0,p.spotLevel)(D?.latest_spot,_),at:$('spot'),reason:'No spot was captured for this underlying at any reading of this session.'},{label:'Distance (strike \u2212 spot)',value:(0,p.maxPainDistanceText)(D?.latest_distance),at:$('distance'),reason:D?.latest_distance_reason||void 0},{label:'Open interest behind it',value:(0,p.compact)(D?.latest_total_oi),at:$('total_oi'),reason:'Not captured at any reading of this session.'}],J=_?{label:'Max pain strike',value:(0,p.strike)(D?.latest_max_pain_strike),against:(0,p.headlineAgainst)((0,p.deltaSince)(q,D,'n
1189o_baseline'),(0,p.maxPainAgainstSpot)(D?.latest_max_pain_strike,D?.latest_spot,D?.latest_distance,W('spot'),W('max_pain_strike'),_)),chip:w,chipTone:j,reason:F||p.MAX_PAIN_NO_POINTS}:T('Max pain strike');return(0,c.jsx)(o.Block,{title:"Max pain through the session",subtitle:"The max-pain strike and the captured spot on one scale, so the distance between them is the distance on screen.",asOf:(0,p.asOfText)(D?.as_of),badge:I,linked:k,headline:J,info:(0,c.jsx)(o.InfoDisclosure,{title:"Max pain through the session",groups:[{heading:'Max pain through the session',lines:[D?.definition||p.MAX_PAIN_DEFINITION,p.MAX_PAIN_GAP_TEXT,(0,p.maxPainDistanceRule)(D),p.MAX_PAIN_READING_TEXT,(0,p.directionRule)(D),D?.chain_floors_text||'']},{heading:'Change since the previous close',lines:[String(D?.delta_text||''),String(D?.delta_unit_text||''),(0,p.deltaReadingsText)(D),String(D?.previous_close_reason||'')]},x(D)||{heading:'',lines:[]}]}),stacked:y,height:f,idle:G,chart:t=>A('max_pain_chart')?(0,c.jsx)(l.SessionPanel,{name:"Max pain against spot",subtitle:v(_,D?.expiry,D?.days_to_expiry),body:D,state:M,times:L,series:X,shared:!0,axisFormat:t=>(0,p.priceTick)(t),chip:w,chipTone:j,caveat:F,note:(0,p.maxPainLine)(D),onRefresh:S.reload,onExpand:C?()=>C('max_pain_chart'):void 0,expanded:'max_pain_chart'===P,onClose:O?()=>O('max_pain_chart'):void 0,emptyDetail:"Each line needs two readings that carried a value before it is a line rather than a dot.",style:t},"max_pain_chart"):null,content:t=>A('max_pain_readings')?(0,c.jsx)(l.ReadingsPanel,{name:"Latest max pain",subtitle:v(_,D?.expiry,D?.days_to_expiry),body:D,state:M,rows:z,caveat:F,note:(0,p.maxPainDistanceRule)(D),onRefresh:S.reload,onExpand:C?()=>C('max_pain_readings'):void 0,expanded:'max_pain_readings'===P,onClose:O?()=>O('max_pain_readings'):void 0,emptyDetail:"Nothing has been captured for this symbol at this reading.",style:t},"max_pain_readings"):null})},e.IvSection=function({symbol:u,expiry:x,seq:b,stacked:y,height:f,badge:I,linked:k,target:R,onTarget:O,hidden:P,onHide:C,expanded:A,onExpand:E,highlight:S,onHighlight:D,gridRead:M}){const N=t=>!(P?.[t]||A&&A!==t),L=u?`/api/derivatives/iv-series?underlying=${encodeURIComponent(u)}${x?`&expiry=${encodeURIComponent(x)}`:''}`:null,B=(0,n.useDerivativeRead)(L,b),U=B.data,V=u?(0,o.stateOf)(B,p.IV_NO_POINTS):{phase:'empty',text:p.NO_SYMBOL_TEXT},w=U?.points||[],j=(0,t.useMemo)(()=>(0,p.seriesTimes)(w),[w]),F=(0,t.useMemo)(()=>(0,p.seriesValues)(w,t=>t.iv_pct??t.iv),[w]),G=(0,p.directionWords)(U?.direction_words),X=(0,p.servedChip)(U?.direction,G,U?.direction_labels),$=(0,p.servedTone)(U?.direction,G),H=h(u,B.phase),W=[U?.atm?.ce,U?.atm?.pe],q=(0,p.ivRateSensitivity)(W),Y=(0,p.ivRateIsAssumed)(U)?((0,p.ivRateSourceShort)(U)+' '+(0,p.ivRateSensitivityText)(q)).trim():'',z=(0,p.ivRejectionLines)(U),J=(0,p.ivLatestRefusal)(w,U?.reason_text),K=[{key:'iv',label:p.IV_ATM_LABEL,color:s.C.mint,values:F,format:p.ivText,tag:p.IV_COMPUTED_TAG}],Q=[{label:`${p.IV_ATM_LABEL} (computed)`,value:(0,p.ivText)(U?.latest_iv_pct??U?.latest_iv),at:(te=null!=U?.latest_iv_pct?'iv_pct':'iv',(0,p.figureAtText)(U?.[`latest_${te}_at`],U?.as_of)),tag:null==(U?.latest_iv_pct??U?.latest_iv)?void 0:p.IV_COMPUTED_TAG,chip:X,chipTone:$,reason:J||'The server returned no volatility and no reason for this reading.'},{label:'At-the-money strike',value:(0,p.strike)(U?.atm_strike)},{label:'Risk-free rate used',value:(0,p.ivRateText)(U)||p.DASH,reason:'The server did not name the rate these were solved at.'}],Z=(0,p.headlineAgainst)(null==U?.atm_strike?'':'at the '+(0,p.strike)(U?.atm_strike)+' strike',(0,p.ivRateText)(U)?'solved at '+(0,p.ivRateText)(U):''),ee=u?{label:p.IV_ATM_LABEL,value:(0,p.ivText)(U?.latest_iv_pct??U?.latest_iv),tag:p.IV_COMPUTED_TAG,against:Z,chip:X,chipTone:$,reason:J||p.IV_NO_POINTS}:T(p.IV_ATM_LABEL);var te;return(0,c.jsx)(o.Block,{title:"IV through the session",subtitle:"Implied volatility is COMPUTED by a model from captured prices \u2014 every other number on this tab is one the exchange reported.",asOf:(0,p.asOfText)(U?.as_of),badge:I,linked:k,headline:ee,actions:(0,c.jsx)(o.Tag,{label:p.IV_COMPUTED_TAG,a11y:"Every number in this block is computed by a pricing model, not reported by the exchange"}),info:(0,c.jsx)(o.InfoDisclosure,{title:"IV through the session",groups:[{heading:'Computed, not reported',lines:[(0,p.ivComputedText)(U),(0,p.ivMethodText)(U),U?.atm_rule||'',U?.atm?.basis_rule||'']},{heading:'What the rate rests on',lines:[(0,p.ivRateIsAssumed)(U)?{text:(0,p.ivRateSourceText)(U),tone:'amber'}:(0,p.ivRateSourceText)(U),(0,p.ivRateSensitivityText)(q)]},{heading:'Every other assumption',lines:Object.values(U?.assumptions||{}).filter(t=>t!==U?.assumptions?.rate)},{heading:'IV through the session',lines:[p.IV_DEFINITION,p.IV_READING_TEXT,(0,p.directionRule)(U)]},{heading:'The ten strikes at the money',lines:[_.IV_GRID_TEXT,_.IV_GRID_COMPUTED_TEXT,_.IV_GRID_GAP_TEXT,_.IV_GRID_HIGHLIGHT_TEXT]},{heading:'When there is no volatility',lines:z.length?z:['Every reading in this session was solved.']}]}),stacked:y,height:f,idle:H,chart:t=>N('iv_chart')?(0,c.jsx)(l.SessionPanel,{name:"ATM implied volatility",subtitle:v(u,U?.expiry,U?.days_to_expiry),body:U,state:V,times:j,series:K,axisFormat:t=>(0,p.ivText)(t),chip:X,chipTone:$,tag:p.IV_COMPUTED_TAG,tagA11y:"Computed by a pricing model, not reported by the exchange",caveat:Y,note:U?((0,p.readingsText)(U)+'. '+(0,p.ivMethodText)(U)).trim():void 0,onRefresh:B.reload,onExpand:E?()=>E('iv_chart'):void 0,expanded:'iv_chart'===A,onClose:C?()=>
1189C('iv_chart'):void 0,emptyDetail:"Each line needs two solved readings before it is a line rather than a dot.",style:t},"iv_chart"):null,content:t=>N('iv_strikes')?(0,c.jsx)(l.ReadingsPanel,{name:"Volatility by strike",subtitle:v(u,U?.expiry,U?.days_to_expiry),body:U,state:V,rows:Q,caveat:Y,note:z.length?'Refused readings \u2014 '+z.join(' '):void 0,onRefresh:B.reload,onExpand:E?()=>E('iv_strikes'):void 0,expanded:'iv_strikes'===A,onClose:C?()=>C('iv_strikes'):void 0,emptyDetail:"Nothing has been solved for this symbol at this reading.",style:t,children:(0,c.jsx)(_.IvStrikeGrid,{underlying:u,ladder:M,expiry:U?.expiry||x,seq:b,highlight:S,onHighlight:D,onPick:O?(t,s)=>O({underlying:U?.underlying||u,instrumentToken:t.instrument_token,label:t.tradingsymbol||(0,p.strike)(t.strike)+' '+String(t.option_type||'').toUpperCase(),detail:(0,p.strike)(t.strike)+' '+String(t.option_type||'').toUpperCase()+' \xb7 implied volatility '+(0,p.ivText)(s?.iv_pct??s?.iv)+' '+p.IV_COMPUTED_TAG}):void 0,selected:t=>!!t&&null!=t.instrument_token&&R?.instrumentToken===t.instrument_token})},"iv_strikes"):null})},e.FuturesBuildupSection=function({symbol:_,seq:u,stacked:v,height:b,badge:y,linked:f,hidden:I,onHide:k,expanded:R,onExpand:O}){const P=t=>!(I?.[t]||R&&R!==t),C=_?`/api/derivatives/futures-buildup?underlying=${encodeURIComponent(_)}`:null,A=(0,n.useDerivativeRead)(C,u),E=A.data,S=_?(0,o.stateOf)(A,p.FUTURES_BUILDUP_NO_POINTS):{phase:'empty',text:p.NO_SYMBOL_TEXT},D=E?.points||[],M=(0,t.useMemo)(()=>(0,p.seriesTimes)(D),[D]),N=(0,t.useMemo)(()=>(0,p.seriesValues)(D,t=>t.oi),[D]),L=(0,t.useMemo)(()=>(0,p.seriesValues)(D,t=>t.oi_vs_avg),[D]),B=(0,t.useMemo)(()=>(0,p.seriesValues)(D,t=>t.basis),[D]),U=(0,t.useMemo)(()=>(0,p.seriesValues)(D,t=>t.basis_pct),[D]),V=(0,p.directionWords)(E?.direction_words,'oi'),w=(0,p.directionWords)(E?.direction_words,'basis'),j=(0,p.servedChip)(E?.oi_direction,V,E?.direction_labels),F=(0,p.servedTone)(E?.oi_direction,V),G=(0,p.servedChip)(E?.basis_direction,w,E?.direction_labels),X=(0,p.servedTone)(E?.basis_direction,w),$=(0,p.withheldText)(E),H=h(_,A.phase),W=(0,p.futuresChartTitle)(E?.contract,_),q=(0,p.isIndexUnderlying)(E?.underlying||_),Y=[{key:'oi',label:'Open interest',color:s.C.mint,values:N,format:p.compact},{key:'share',label:'Against its 20-day average',color:s.C.amber,second:!0,values:L,format:t=>(0,p.ratio)(t)}],z=[{key:'basis',label:'Basis',color:s.C.mint,values:B,format:t=>(0,p.basisText)(t,q)},{key:'basis_pct',label:'Basis %',color:s.C.amber,second:!0,values:U,format:t=>(0,p.signed)(t,2)}],J=[...D].reverse().find(t=>t&&!t.gap),K=t=>(0,p.figureAtText)(E?.[`latest_${t}_at`],E?.as_of),Q=[{label:'Open interest',value:(0,p.compact)(E?.latest_oi??J?.oi),chip:j,chipTone:F,at:K('oi')},{label:'Against its own 20-day average',value:(0,p.oiVsAvgText)(E?.latest_oi_vs_avg),at:K('oi_vs_avg')},{label:'Basis (futures less spot)',value:(0,p.basisPair)(E?.latest_basis,E?.latest_basis_pct,q),chip:G,chipTone:X,at:K('basis'),reason:p.BASIS_NO_SPOT_ROW},{label:'Change since the previous close',value:(0,p.signed)(E?.latest_oi_change_pct_day??J?.oi_change_pct_day),at:K('oi_change_pct_day'),tone:null==(E?.latest_oi_change_pct_day??J?.oi_change_pct_day)?void 0:(0,o.tone)(E?.latest_oi_change_pct_day??J?.oi_change_pct_day)},{label:'Build-up on the day',value:(0,p.servedBuildup)(E?.latest_buildup_day),at:K('buildup_day')},{label:'Build-up over 15 minutes',value:(0,p.servedBuildup)(E?.latest_buildup_15m),at:K('buildup_15m')}],Z=(0,p.basisPair)(E?.latest_basis,E?.latest_basis_pct,q)===p.DASH?'Basis is the futures price less spot at the same reading. At the latest one, '+p.BASIS_NO_SPOT+'.':'Basis is the futures price less spot at the same reading: '+(0,p.basisPair)(E?.latest_basis,E?.latest_basis_pct,q)+' at the latest one.',ee=_?{label:'Futures open interest',value:(0,p.compact)(E?.latest_oi??J?.oi),against:(0,p.headlineAgainst)((0,p.oiVsAvgText)(E?.latest_oi_vs_avg),'basis '+(0,p.basisPair)(E?.latest_basis,E?.latest_basis_pct,q)),chip:j,chipTone:F,reason:$||p.FUTURES_BUILDUP_NO_POINTS}:T('Futures open interest');return(0,c.jsx)(o.Block,{title:"Futures build-up",subtitle:"The front futures contract of this symbol: open interest against its own average, and the basis against spot.",asOf:(0,p.asOfText)(E?.as_of),badge:y,linked:f,headline:ee,info:(0,c.jsx)(o.InfoDisclosure,{title:"Futures build-up",groups:[{heading:'Futures build-up',lines:[E?.definition||p.FUTURES_BUILDUP_DEFINITION,p.FUTURES_BUILDUP_READING_TEXT,(0,p.directionRule)(E),'Open interest and its share of the 20-day average are different units, so each line keeps its own scale.','Open interest and the basis are two readings of the same contract over the same session, so they share one panel and keep a scale each.']},x(E)||{heading:'',lines:[]}]}),stacked:v,height:b,idle:H,chart:t=>P('fut_oi')?(0,c.jsx)(l.SessionPairPanel,{name:"Futures open interest and basis",subtitle:W,body:E,state:S,times:M,top:{name:'Futures open interest',series:Y,axisFormat:p.compact,chip:j,chipTone:F,note:(0,p.futuresLine)(E,q)},bottom:{name:'Basis through the session',series:z,axisFormat:p.priceTick,chip:G,chipTone:X,note:Z},caveat:$,onRefresh:A.reload,onExpand:O?()=>O('fut_oi'):void 0,expanded:'fut_oi'===R,onClose:k?()=>
1189k('fut_oi'):void 0,emptyDetail:"Each line needs two readings that carried a value before it is a line rather than a dot.",style:t},"fut_oi"):null,content:t=>P('fut_readings')?(0,c.jsx)(l.ReadingsPanel,{name:"Latest futures reading",subtitle:W,body:E,state:S,rows:Q,caveat:$,note:(0,p.readingsText)(E),onRefresh:A.reload,onExpand:O?()=>O('fut_readings'):void 0,expanded:'fut_readings'===R,onClose:k?()=>k('fut_readings'):void 0,emptyDetail:"Nothing has been captured for this contract at this reading.",style:t},"fut_readings"):null})},Object.defineProperty(e,"DirectionChip",{enumerable:!0,get:function(){return o.DirectionChip}});var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]),l=r(d[4]),_=r(d[5]),p=r(d[6]),c=r(d[7]);function u(t){return'error'===t}function h(t,s){return!t||u(s)}function v(t,s,n){const o=s?(0,p.expiryText)(s,n??null):null==n?'':(0,p.dteText)(n);return t+(o&&o!==p.DASH?' \xb7 '+o:'')}function x(t){const s=(0,p.withheldLines)(t),n=(0,p.readingsText)(t);return s.length||n?{heading:'What is missing, and why',lines:[n?n+'.':'',String(t?.gaps_text||'').trim(),...s]}:null}const T=t=>({label:t,value:p.DASH,reason:p.NO_SYMBOL_TEXT})},1096,[11,821,1071,1074,1097,1098,984,6]); 1190__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.SessionPlot=w,_e.SessionPanel=function({name:e,subtitle:t,body:s,state:n,onRefresh:i,onExpand:o,expanded:c,onClose:y,times:f,series:j,shared:b,axisFormat:C,chip:T,chipTone:k,tag:v,tagA11y:M,caveat:W,note:D,emptyDetail:S,style:F}){return(0,u.jsx)(x.WidgetFrame,{name:e,subtitle:t,body:s,state:n,onRefresh:i,onExpand:o,expanded:c,onClose:y,inBlock:!0,style:F,emptyDetail:S,note:(0,u.jsxs)(l.default,{style:{gap:3},children:[!!D&&('string'==typeof D?(0,u.jsx)(h.T,{style:x.metaText,children:D}):D),!!W&&(0,u.jsx)(h.T,{style:[x.metaText,{color:h.C.amber}],children:W})]}),children:(0,u.jsx)(l.default,{style:{flex:1,minHeight:0,padding:p},children:(0,u.jsx)(w,{name:e,times:f,series:j,shared:b,axisFormat:C,chip:T,chipTone:k,tag:v,tagA11y:M})})})},_e.SessionPairPanel=function({name:e,subtitle:t,body:s,state:n,onRefresh:i,onExpand:o,expanded:c,onClose:y,times:f,top:j,bottom:b,caveat:C,emptyDetail:T,style:k}){return(0,u.jsx)(x.WidgetFrame,{name:e,subtitle:t,body:s,state:n,onRefresh:i,onExpand:o,expanded:c,onClose:y,inBlock:!0,style:k,emptyDetail:T,note:C?(0,u.jsx)(h.T,{style:[x.metaText,{color:h.C.amber}],children:C}):void 0,children:(0,u.jsxs)(l.default,{style:{flex:1,minHeight:0,padding:p,gap:8},children:[(0,u.jsx)(w,{...j,times:f,showCount:!1}),(0,u.jsx)(l.default,{style:{height:1,backgroundColor:h.C.line}}),(0,u.jsx)(w,{...b,times:f})]})})},_e.ReadingsPanel=function({name:e,subtitle:t,body:s,state:i,rows:o,onRefresh:y,onExpand:f,expanded:j,onClose:b,note:C,caveat:T,emptyDetail:w,children:k,style:v}){return(0,u.jsx)(x.WidgetFrame,{name:e,subtitle:t,body:s,state:i,onRefresh:y,onExpand:f,expanded:j,onClose:b,inBlock:!0,style:v,emptyDetail:w,note:(0,u.jsxs)(l.default,{style:{gap:3},children:[!!C&&('string'==typeof C?(0,u.jsx)(h.T,{style:x.metaText,children:C}):C),!!T&&(0,u.jsx)(h.T,{style:[x.metaText,{color:h.C.amber}],children:T})]}),children:(0,u.jsxs)(n.default,{style:{flex:1},contentContainerStyle:{padding:p,gap:8},children:[(0,u.jsx)(l.default,{style:[h.s.row,{flexWrap:'wrap',alignItems:'stretch',gap:8}],children:o.map(e=>{const t=e.value===c.DASH;return(0,u.jsxs)(l.default,{style:{flexGrow:1,flexBasis:'46%',minWidth:150,gap:3,paddingHorizontal:10,paddingVertical:8,borderRadius:10,borderWidth:1,borderColor:h.C.line,backgroundColor:h.C.dark},children:[(0,u.jsx)(h.T,{numberOfLines:2,style:x.head,children:e.label}),(0,u.jsxs)(l.default,{style:[h.s.row,{gap:6,flexWrap:'wrap'}],children:[(0,u.jsx)(h.T,{numberOfLines:1,style:[x.bodyText,{fontSize:16,lineHeight:22,color:e.tone||(t?h.C.muted:h.C.ink),fontFamily:'InterSemi',fontVariant:['tabular-nums']}],children:e.value}),!!e.tag&&!t&&(0,u.jsx)(x.Tag,{label:e.tag}),!!e.chip&&!t&&(0,u.jsx)(x.DirectionChip,{label:e.chip,tone:e.chipTone})]}),!!e.at&&!t&&(0,u.jsx)(h.T,{numberOfLines:1,style:[x.metaText,{color:h.C.amber}],children:e.at}),!!e.reason&&t&&(0,u.jsx)(h.T,{style:x.metaText,children:e.reason})]},e.label)})}),k]})})};var t=r(d[0]),s=e(t),l=e(r(d[1])),n=e(r(d[2])),i=r(d[3]),o=e(i),h=r(d[4]),x=r(d[5]),c=r(d[6]),u=r(d[7]);const y=46,f=14,p=10,j=110,b='3 2',C=1.6,T=1.2;function w({name:e,times:n,series:p,shared:w,axisFormat:k,chip:v,chipTone:M,tag:W,tagA11y:D,note:S,showCount:F=!0}){const[L,H]=(0,t.useState)({w:0,h:0}),R=Math.max(0,L.w-y),P=Math.max(0,L.h-f),E=n.length,{cursor:A,hover:O}=(0,x.useHoverIndex)((e,t)=>{if(!E)return null;const s=t>0&&L.w>0?L.w/t:1,l=E>1?Math.max(0,L.w-y)/(E-1):0;return l<=0?0:Math.max(0,Math.min(E-1,Math.round((e*s-y)/l)))}),_=p[0],z=p[1],B=w&&z?(0,c.scaleTogether)(_?.values,z?.values,R,P):null,V=B?[B.a,B.b]:p.map(e=>(0,c.scaleValues)(e.values,R,P)),I=B?{lo:B.lo,hi:B.hi,points:[]}:V[0],G=(0,c.valueAxisLabels)(I,P,k,3),q=(0,c.sessionAxisTimes)(n,4,R),J=e=>[...e.values||[]].reverse().find(e=>
1190null!=e),K=(0,c.sessionSpoken)(e+(W?', '+W.toLowerCase():''),_?.values,n),N=null!=A&&A>=0&&A<E,Q=E>1?R/(E-1):0;return(0,u.jsxs)(l.default,{style:{flex:1,minHeight:0,gap:6},children:[N?(0,u.jsx)(x.CrosshairReadout,{time:(0,c.clock)(n[A]),rows:p.map(e=>({label:e.label,color:e.color,tag:e.tag,value:e.format((e.values||[])[A])}))}):(0,u.jsxs)(l.default,{style:[h.s.row,{gap:10,flexWrap:'wrap',minHeight:24}],children:[(0,u.jsx)(x.DirectionChip,{label:v||'',tone:M,size:10}),!!W&&(0,u.jsx)(x.Tag,{label:W,a11y:D}),(0,u.jsx)(l.default,{style:{flex:1,minWidth:4}}),p.map(e=>(0,u.jsxs)(l.default,{style:[h.s.row,{gap:5}],children:[(0,u.jsx)(l.default,{style:{width:10,height:e.second?1:2,backgroundColor:e.color,opacity:e.second?.8:1}}),(0,u.jsxs)(h.T,{numberOfLines:1,style:[x.metaText,{fontVariant:['tabular-nums']}],children:[e.label," ",e.format(J(e)),e.tag?' '+e.tag:'']})]},e.key))]}),(0,u.jsx)(l.default,{style:{flex:1,minHeight:j},...O,onLayout:e=>{const{width:t,height:s}=e.nativeEvent.layout,l=Math.round(t),n=Math.round(s);H(e=>Math.abs(e.w-l)<3&&Math.abs(e.h-n)<3?e:{w:l,h:n})},children:R>0&&P>0&&(0,u.jsxs)(o.default,{width:L.w,height:L.h,accessibilityLabel:K,children:[G.map(e=>(0,u.jsxs)(s.default.Fragment,{children:[(0,u.jsx)(i.Line,{x1:y,x2:L.w,y1:Math.min(P,Math.max(0,e.y)),y2:Math.min(P,Math.max(0,e.y)),stroke:h.C.line,strokeWidth:1,strokeDasharray:"2 4"}),(0,u.jsx)(i.Text,{x:0,y:Math.min(P-1,Math.max(8,e.y+3)),fill:h.C.muted,fontSize:9,children:e.label})]},'y'+e.label)),p.map((e,t)=>{const l=V[t];if(!l)return null;const n=[...l.points].reverse().find(Boolean);return(0,u.jsxs)(s.default.Fragment,{children:[(0,u.jsx)(i.Path,{d:(0,c.linePath)(l),stroke:e.color,strokeWidth:e.second?T:C,strokeDasharray:e.second?b:void 0,fill:"none",transform:"translate(46,0)"}),!!n&&(0,u.jsx)(i.Circle,{cx:y+n.x,cy:n.y,r:2.6,fill:e.color})]},e.key)}),q.map(e=>(0,u.jsx)(i.Text,{x:Math.min(L.w-30,Math.max(y,y+e.i*Q-15)),y:L.h-3,fill:h.C.muted,fontSize:9,children:e.label},'x'+e.i)),N&&(0,u.jsxs)(s.default.Fragment,{children:[(0,u.jsx)(i.Line,{x1:y+A*Q,x2:y+A*Q,y1:0,y2:P,stroke:h.C.green,strokeWidth:1,strokeOpacity:.55,strokeDasharray:"3 3"}),V.map((e,t)=>{const s=e?.points?.[A];return s?(0,u.jsx)(i.Circle,{cx:y+s.x,cy:s.y,r:3.4,fill:p[t].color,stroke:h.C.bg,strokeWidth:1},p[t].key):null})]},"cursor")]})}),!!S&&('string'==typeof S?(0,u.jsx)(h.T,{style:x.metaText,children:S}):S),F&&(0,u.jsxs)(l.default,{style:[h.s.row,{gap:8}],children:[(0,u.jsx)(l.default,{style:{flex:1}}),(0,u.jsxs)(h.T,{style:[x.metaText,{fontVariant:['tabular-nums']}],children:[n.length," captured reading",1===n.length?'':'s']}),(0,u.jsx)(l.default,{style:{flex:1}})]})]})}},1097,[11,13,278,840,821,1074,984,6]); 1191__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"IV_GRID_ORDER",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"IV_GRID_SLOTS",{enumerable:!0,get:function(){return _}}),Object.defineProperty(_e,"IV_GRID_CALLS_LABEL",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"IV_GRID_PUTS_LABEL",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"IV_GRID_TEXT",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"IV_GRID_GAP_TEXT",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"IV_GRID_HIGHLIGHT_TEXT",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"IV_GRID_COMPUTED_TEXT",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"IV_GRID_NO_VALUE",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"IV_GRID_NO_LADDER",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"IV_CHART_H",{enumerable:!0,get:function(){return V}}),_e.scaleIv=z,_e.ivAxis=N,_e.ivSlotDetail=U,_e.ivSlotSpoken=F,_e.IvStrikeGrid=function({underlying:e,expiry:l,seq:o,ladder:s,onPick:h,selected:p,highlight:C,onHighlight:k}){const[I,j]=n.default.useState(0),T=s.data?.rows||[],S=(0,t.useMemo)(()=>{const t=new Map;for(const e of T)e?.slot&&t.set(e.slot,e);return y.map(n=>{const i=t.get(n);if(i)return i;const l=n.slice(0,2),o=Number(n.slice(2))||0;return{slot:n,option_type:l,atm_offset:o,label:`ATM${0===o?'':o>0?`+${o}`:`\u2212${Math.abs(o)}`} ${l}`,row:'CE'===l?'calls':'puts',present:!1,tradingsymbol:null,instrument_token:null,
1191strike:null,previous_close_oi:null,points:[],direction:'no baseline',direction_detail:{},marks:0,marks_with_delta:0,latest_delta_oi:null,peak_abs_delta_oi:null,marks_with_price:0,latest_price:null,flow:{price_direction:'no baseline',oi_direction:'no baseline',what_label:'',meaning:null,detail:{}},missing_text:e?P:''}})},[T,e]),E=[{key:'calls',label:x,slots:S.slice(0,_/2)},{key:'puts',label:v,slots:S.slice(_/2)}],$=(0,f.gridColumns)(I||660),M=Math.max(120,Math.floor(((I||660)-O*($-1))/$));return(0,b.jsx)(i.default,{onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width);j(e=>Math.abs(e-t)<3?e:t)},style:{gap:10},children:E.map(t=>(0,b.jsxs)(i.default,{style:{gap:6},children:[(0,b.jsx)(u.T,{style:c.head,children:t.label}),(0,b.jsx)(i.default,{style:[u.s.row,{flexWrap:'wrap',alignItems:'flex-start',gap:O}],children:t.slots.map(t=>(0,b.jsx)(W,{slot:t,underlying:e,expiry:l,seq:o,width:M,onPick:h,onHighlight:k,selected:p,lit:null!=C&&null!=t.strike&&Math.abs(Number(t.strike)-C)<.5},t.slot))})]},t.key))})};var t=r(d[0]),n=e(t),i=e(r(d[1])),l=e(r(d[2])),o=r(d[3]),s=e(o),u=r(d[4]),h=r(d[5]),c=r(d[6]),f=r(d[7]),p=r(d[8]),b=r(d[9]);const y=['CE+0','CE+1','CE+2','CE+3','CE+4','PE+0','PE-1','PE-2','PE-3','PE-4'],_=y.length,x='Calls \u2014 at the money and above',v='Puts \u2014 at the money and below',C='Each tile is one contract\'s implied volatility through the session, on the same ten strikes the \u0394OI grid draws and in the same order, so the two blocks can be read tile for tile.',k='A reading the model could not solve is a gap in that tile\'s line, with the server\'s reason under it; nothing here is interpolated, carried forward or drawn at zero.',I='Pointing at a tile lights the same strike wherever else it is on this tab \u2014 on the option chain, on the OI-by-strike bars and on the \u0394OI grid. It highlights; it changes nothing.',j='Every tile carries COMPUTED because every number on it is a model\'s output, not a figure the exchange reported.',T='No implied volatility has been solved for this contract at any reading of this session.',P='The at-the-money ladder has not been resolved for this symbol yet.',S=34,E=12,O=8,$=16,M=13,H=15,w=14,D=26,R=8,L=4,V=f.TILE_H-122,G=V-E,A=1.4;function z(e,t,n){const i=(e||[]).map(e=>{const t=e?.iv_pct??e?.iv;return'number'==typeof t&&Number.isFinite(t)?Math.abs(t)<=3?100*t:t:null}),l=i.filter(e=>null!=e);if(l.length<2||t<=0||n<=0)return null;const o=Math.min(...l),s=Math.max(...l),u=s-o||Math.abs(s)||1,h=i.length>1?t/(i.length-1):0;return{lo:o,hi:s,points:i.map((e,t)=>null==e?null:{x:t*h,y:n-(e-o)/u*n,i:t})}}function N(e,t){if(!e)return[];const n=e.hi-e.lo||1,i=[];for(const l of[e.hi,e.lo]){const o=t-(l-e.lo)/n*t;i.some(e=>Math.abs(e.y-o)<9)||i.push({v:l,y:o})}return i}function U(e,t){if(!e.present)return e.label;const n=t?.points||[];if(!n.length)return e.label;const i=n.filter(e=>e&&null!=(e.iv??e.iv_pct)).length;return`${e.label} \xb7 ${i} of ${n.length} reading${1===n.length?'':'s'} solved`}function F(e,t,n,i,l){const o=`${(0,p.strike)(e.strike)===p.DASH?e.label:`${(0,p.strike)(e.strike)} ${e.option_type}`}, ${e.label}`;if(!e.present)return`${o}. ${e.missing_text||'This strike is not listed in this expiry.'}`;if(null==n)return`${o}. No computed implied volatility. ${l}`;const s=i?i.replace(/^[^ ]+ /,'').toLowerCase():'no baseline';return`${o}. Computed implied volatility ${(0,p.ivText)(n)}, ${s}. `+`${U(e,t).split(' \xb7 ').slice(1).join(' \xb7 ')||''}`.trim()}function W({slot:e,underlying:n,expiry:y,seq:_,width:x,selected:v,lit:C,onPick:k,onHighlight:I}){const j=n&&e.present&&null!=e.strike?`/api/derivatives/iv-series?underlying=${encodeURIComponent(n)}`+(y?`&expiry=${encodeURIComponent(y)}`:'')+`&strike=${encodeURIComponent(String(e.strike))}&option_type=${encodeURIComponent(e.option_type)}`:null,P=(0,h.useDerivativeRead)(j,_),O=P.data,W=O?.strike||null,B=W?.points||[],X=(0,t.useMemo)(()=>B.map(e=>{const t=e?.iv_pct??e?.iv;return'number'==typeof t&&Number.isFinite(t)?t:null}),[B]),q=[...B].reverse().find(e=>e&&null!=(e.iv??e.iv_pct))||null,K=q?q.iv_pct??q.iv:null,Y=(0,t.useMemo)(()=>B.map(e=>e?.at??null),[B]),J=(0,p.servedDirection)(W?.direction,X,p.IV_KEYS,Y),Q=(0,p.sessionChip)(p.IV_CHIPS,J),Z=(0,p.sessionTone)(p.IV_CHIPS,J),ee=null!=K?'':(0,p.ivLatestRefusal)(B,O?.reason_text)||String(W?.missing_text||'')||String(e.missing_text||'')||('loading'===P.phase?'':T),te=e.present?B.length?X.filter(e=>null!=e).length<2?ee||'One solved reading is a dot, not a line.':'':'loading'===P.phase?'':T:e.missing_text||'This strike is not listed in this expiry.',ne=(0,c.typeColor)((0,p.optionTone)(e.option_type)),ie=Math.max(0,x-S-22),le=z(B,ie,G),re=N(le,G),oe=(0,p.axisTimes)(B,3),se=le?[...le.points].reverse().find(Boolean):null,ae=(0,p.strike)(e.strike)===p.DASH?e.label:`${(0,p.strike)(e.strike)}
1191 ${e.option_type}`,ue=!!v?.(W);return(0,b.jsxs)(l.default,{accessibilityRole:"button",accessibilityState:{selected:ue},accessibilityLabel:F(e,W,K,Q,ee),disabled:!e.present||!W||!k,onPress:()=>{W&&k&&k(W,q)},onHoverIn:()=>I?.(null==e.strike?null:Number(e.strike)),onHoverOut:()=>I?.(null),onFocus:()=>I?.(null==e.strike?null:Number(e.strike)),onBlur:()=>I?.(null),style:e=>[{width:x,height:f.TILE_H,padding:R,borderRadius:10,gap:L,borderWidth:ue||e.focused?2:1,borderColor:ue||e.focused?u.C.green:C?u.C.mint:u.C.line,backgroundColor:ue?u.C.soft:C||e.hovered||e.focused?u.C.dark:'transparent'}],children:[(0,b.jsxs)(i.default,{style:[u.s.row,{gap:5,height:$}],children:[(0,b.jsx)(u.T,{numberOfLines:1,style:{fontFamily:'InterSemi',fontSize:12,lineHeight:$,color:ne,flexShrink:1,minWidth:0},children:ae}),(0,b.jsx)(c.Tag,{label:p.IV_COMPUTED_TAG,a11y:"Computed by a pricing model, not reported by the exchange"})]}),(0,b.jsx)(u.T,{numberOfLines:1,style:{fontSize:9,lineHeight:M,height:M,color:u.C.muted},children:U(e,W)}),(0,b.jsx)(i.default,{style:{height:V},children:te?(0,b.jsx)(i.default,{style:{flex:1,justifyContent:'center'},children:(0,b.jsx)(u.T,{style:{fontSize:9,lineHeight:13,color:u.C.muted},children:te})}):ie>0&&(0,b.jsxs)(s.default,{width:x-18,height:V,children:[re.map(e=>(0,b.jsx)(o.Text,{x:0,y:Math.min(V-E,Math.max(8,e.y+3)),fill:u.C.muted,fontSize:8,children:(0,p.ivText)(e.v)},`y${e.v}`)),!!le&&(0,b.jsx)(o.Line,{x1:S,x2:S+ie,y1:G,y2:G,stroke:u.C.line,strokeWidth:1,strokeDasharray:"2 3"}),(0,b.jsx)(o.Path,{d:(0,p.linePath)(le),stroke:ne,strokeWidth:A,fill:"none",transform:`translate(${S},0)`}),!!se&&(0,b.jsx)(o.Circle,{cx:S+se.x,cy:se.y,r:2.4,fill:ne}),oe.map(e=>{const t=B.length>1?ie/(B.length-1):0;return(0,b.jsx)(o.Text,{x:Math.min(x-40,S+e.i*t-10),y:V-2,fill:u.C.muted,fontSize:8,children:e.label},`x${e.i}`)})]})}),(0,b.jsxs)(i.default,{style:[u.s.row,{gap:6,height:H}],children:[Q?(0,b.jsx)(i.default,{style:{paddingHorizontal:5,paddingVertical:1,borderRadius:4,borderWidth:1,borderColor:'flat'===Z?u.C.line:(0,c.buildupColor)(Z)},children:(0,b.jsx)(u.T,{style:{fontSize:9,lineHeight:13,fontFamily:'InterSemi',color:'flat'===Z?u.C.muted:(0,c.buildupColor)(Z)},children:Q})}):(0,b.jsx)(u.T,{style:{fontSize:9,lineHeight:13,color:u.C.muted},children:"no baseline"}),(0,b.jsx)(i.default,{style:{flex:1}}),(0,b.jsx)(u.T,{numberOfLines:1,style:{fontSize:9,lineHeight:13,color:null==K?u.C.muted:u.C.ink,fontVariant:['tabular-nums']},children:(0,p.ivText)(K)}),(0,b.jsx)(c.Tag,{label:p.IV_COMPUTED_TAG})]}),(0,b.jsx)(u.T,{numberOfLines:1,style:{fontSize:9,lineHeight:13,height:w,fontFamily:'InterMedium',color:null==K?u.C.muted:u.C.ink},children:null==K?'No volatility at the latest reading':'Solved at the latest reading'}),(0,b.jsx)(i.default,{style:{height:D},children:(0,b.jsx)(u.T,{numberOfLines:2,style:{fontSize:9,lineHeight:13,color:u.C.muted},children:ee})})]})}},1098,[11,13,375,840,821,1071,1074,1094,984,6]); 1192__d(function(g,_r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.IndexWidget=function({onSummary:e,seq:o,target:r,onTarget:x,onExpand:h,expanded:b,onClose:f,pinFirst:k,style:v}){const C=(0,n.useDerivativeRead)('/api/derivatives/indices',o),w=C.data,j=(0,s.stateOf)(C,'No index snapshot has been captured yet.'),[T,P]=(0,t.useState)(null),S=w?.rows||[],$=(0,t.useMemo)(()=>[{key:'symbol',label:'Symbol',width:96,value:_.symbol,render:e=>(0,u.jsx)(p.Cell,{text:e.underlying,bold:!0,size:12})},{key:'spot',label:'Spot',width:88,align:'right',value:_.spot,render:e=>(0,u.jsx)(p.Cell,{text:(0,c.level)(e.spot,!0)})},{key:'pcr_oi',label:'PCR (OI)',width:70,align:'right',value:_.pcr_oi,render:e=>(0,u.jsx)(p.Cell,{text:(0,c.pcrText)(e.pcr_oi),bold:!0})},{key:'pcr_vol',label:'PCR (vol)',width:74,align:'right',value:_.pcr_vol,render:e=>(0,u.jsx)(p.Cell,{text:(0,c.pcrText)(e.pcr_volume)})},{key:'max_pain',label:'Max pain',width:150,grow:!0,value:_.max_pain,render:e=>(0,u.jsx)(p.Cell,{text:(0,c.maxPainText)(e),color:i.C.muted})},{key:'expiry',label:'Exp. date',width:72,value:_.expiry,render:e=>(0,u.jsx)(p.Cell,{text:(0,c.shortDate)(e.expiry)||'\u2014',color:i.C.muted})},{key:'dte',label:'DTE',width:42,align:'right',value:_.dte,render:e=>(0,u.jsx)(p.Cell,{text:null==e.days_to_expiry?'\u2014':String(e.days_to_expiry)})},{key:'ce_oi',label:'CE OI',width:66,align:'right',value:_.ce_oi,render:e=>(0,u.jsx)(p.Cell,{text:(0,c.compact)(e.total_ce_oi),color:"#F17D87"})},{key:'pe_oi',label:'PE OI',width:66,align:'right',value:_.pe_oi,render:e=>(0,u.jsx)(p.Cell,{text:(0,c.compact)(e.total_pe_oi),color:i.C.green})},{key:'spark',label:'OI through the day',width:130,render:e=>(0,u.jsx)(y,{row:e})},{key:'time',label:'Time',width:52,value:_.time,render:e=>(0,u.jsx)(p.Cell,{text:(0,c.clock)(e.captured_at),color:i.C.muted})}],[]),I=(0,t.useMemo)(()=>(T?(0,c.sortRows)(S,_[T.key]||(()=>null),T.dir):S).map(e=>({kind:'row',key:e.underlying,row:e})),[S,T]),F=S.filter(e=>!e.captured).map(e=>e.underlying),M=S.length,N=w?.as_of||null;return l.default.useEffect(()=>{e?.({count:M,asOf:N})},[M,N,e]),(0,u.jsx)(s.WidgetFrame,{name:"Index dashboard",subtitle:"NIFTY \xb7 BANKNIFTY \xb7 FINNIFTY",body:w,state:j,onRefresh:C.reload,onExpand:h,expanded:b,onClose:f,style:v,inBlock:!0,note:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(i.T,{style:s.metaText,children:[(0,c.asOfText)(w?.as_of)," \xb7 ",(0,c.floorsText)(w?.floors,w?.floors_text)]}),(0,u.jsx)(i.T,{style:{fontSize:10,lineHeight:14,color:i.C.muted},children:"PCR is put open interest divided by call open interest at this reading, and the volume PCR the same for the day's volume (\xa73.5). Max pain is computed from the open interest standing right now (\xa73.6). Both describe the book as captured; neither is a forecast."}),!!F.length&&(0,u.jsxs)(i.T,{style:{fontSize:10,lineHeight:14,color:i.C.amber},children:["Not captured yet, so shown as dashes rather than zeros: ",F.join(', '),"."]})]}),children:(0,u.jsx)(p.Table,{label:"Index dashboard",columns:$,items:I,sort:T,pinFirst:k,rowHeight:42,onSort:e=>P(t=>(0,c.nextSort)(t,e)),onRowPress:e=>x({underlying:e.underlying,instrumentToken:null,label:e.underlying,detail
1192:`PCR ${(0,c.pcrText)(e.pcr_oi)} \xb7 max pain ${(0,c.maxPainText)(e)}`}),selected:e=>r?.underlying===e.underlying&&!r?.instrumentToken,rowLabel:e=>e.captured?`${e.underlying}. Spot ${(0,c.level)(e.spot,!0)}. Put-call ratio by open interest ${(0,c.pcrText)(e.pcr_oi)}, by volume ${(0,c.pcrText)(e.pcr_volume)}. Max pain ${(0,c.maxPainText)(e)}. Captured at ${(0,c.clock)(e.captured_at)}`:`${e.underlying}. Not captured yet \u2014 this index has no snapshot in the store, so no number is shown for it`})})};var t=_r(d[0]),l=e(t),o=_r(d[1]),r=e(o),i=_r(d[2]),n=_r(d[3]),s=_r(d[4]),p=_r(d[5]),c=_r(d[6]),u=_r(d[7]);const x=118,h=30,_={symbol:e=>e.underlying,spot:e=>e.spot,pcr_oi:e=>e.pcr_oi,pcr_vol:e=>e.pcr_volume,max_pain:e=>e.max_pain_strike,expiry:e=>e.expiry,dte:e=>e.days_to_expiry,ce_oi:e=>e.total_ce_oi,pe_oi:e=>e.total_pe_oi,time:e=>e.captured_at};function y({row:e}){const t=e.series||[],l=(0,c.scaleSeries)(t.map(e=>({t:e.captured_at,price:e.total_ce_oi,oi:null})),'price',x,h),n=(0,c.scaleSeries)(t.map(e=>({t:e.captured_at,price:e.total_pe_oi,oi:null})),'price',x,h);if(!l&&!n)return(0,u.jsx)(i.T,{numberOfLines:2,style:{fontSize:9,lineHeight:12,color:i.C.muted},children:"Needs two captured readings"});const s=Math.min(l?.lo??1/0,n?.lo??1/0),p=Math.max(l?.hi??-1/0,n?.hi??-1/0),_=p-s||1,y=e=>{const t=e.length>1?x/(e.length-1):0;return(0,c.linePath)({lo:s,hi:p,points:e.map((e,l)=>null==e?null:{x:l*t,y:h-(e-s)/_*h,i:l})})};return(0,u.jsxs)(r.default,{width:x,height:h,accessibilityLabel:`${e.underlying} option open interest from ${(0,c.clock)(t[0]?.captured_at)} to ${(0,c.clock)(t[t.length-1]?.captured_at)}`,children:[(0,u.jsx)(o.Line,{x1:0,x2:x,y1:29.5,y2:29.5,stroke:i.C.line,strokeWidth:1}),(0,u.jsx)(o.Path,{d:y(t.map(e=>e.total_ce_oi)),stroke:"#F17D87",strokeWidth:1.3,fill:"none"}),(0,u.jsx)(o.Path,{d:y(t.map(e=>e.total_pe_oi)),stroke:i.C.green,strokeWidth:1.3,fill:"none"})]})}},1099,[11,840,821,1071,1074,1078,984,6]); 1193__d(function(g,_r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.FuturesWidget=function({onSummary:e,underlying:_,watchlist:p,seq:h,target:x,onTarget:b,filterCount:v,onCustomize:f,onExpand:w,expanded:C,onClose:k,pinFirst:j,style:T}){const $=[_?`underlying=${encodeURIComponent(_)}`:'',p&&'all'!==p?`watchlist=${encodeURIComponent(p)}`:''].filter(Boolean).join('&'),S=(0,r.useDerivativeRead)("/api/derivatives/futures"+($?`?${$}`:''),h),O=S.data,I=(0,s.stateOf)(S,'No futures contract has been captured yet.'),[B,F]=(0,t.useState)(null),R=O?.rows||[],U=(0,t.useMemo)(()=>[{key:'time',label:'Time',width:50,value:y.time,render:e=>(0,c.jsx)(o.Cell,{text:(0,u.clock)(e.captured_at),color:n.C.muted})},{key:'symbol',label:'Symbol',width:100,value:y.symbol,filter:f,render:e=>(0,c.jsx)(o.Cell,{text:e.underlying||'\u2014',bold:!0,size:12})},{key:'summary',label:'Summary',width:130,grow:!0,value:y.summary,render:e=>(0,c.jsx)(o.Cell,{text:(0,u.contractSummary)(e),size:12})},{key:'expiry',label:'Exp. date',width:72,value:y.expiry,filter:f,render:e=>(0,c.jsx)(o.Cell,{text:(0,u.shortDate)(e.expiry)||'\u2014',color:n.C.muted})},{key:'dte',label:'DTE',width:42,align:'right',value:y.dte,filter:f,render:e=>(0,c.jsx)(o.Cell,{text:null==e.days_to_expiry?'\u2014':String(e.days_to_expiry)})},{key:'price',label:'Price',width:84,align:'right',value:y.price,render:e=>(0,c.jsx)(o.Cell,{text:(0,u.spotLevel)(e.last_price,e.underlying)})},{key:'chg',label:'Chg %',width:62,align:'right',value:y.chg,render:e=>(0,c.jsx)(o.Cell,{text:(0,u.signed)(e.price_change_day_pct),color:(0,s.tone)(e.price_change_day_pct)})},{key:'oi',label:'OI',width:62,align:'right',value:y.oi,render:e=>(0,c.jsx)(o.Cell,{text:(0,u.compact)(e.oi)})},{key:'oi_chg',label:'OI chg',width:74,align:'right',value:y.oi_chg,render:e=>(0,c.jsx)(o.Cell,{text:(0,u.signedUnits)(e.oi_change_day),color:(0,s.tone)(e.oi_change_day)})},{key:'oi_avg',label:'OI vs 20-day',width:112,align:'right',value:y.oi_avg,render:e=>(0,c.jsx)(o.Cell,{text:(0,u.oiShareText)(e.oi_vs_20d_avg),color:n.C.muted})},{key:'basis',label:'Basis',width:78,align:'right',value:y.basis,render:e=>
1193(0,c.jsx)(o.Cell,{text:(0,u.basisText)(e.basis,(0,u.isIndexUnderlying)(e.underlying)),color:(0,s.tone)(e.basis)})},{key:'buildup',label:'Build-up',width:104,value:y.buildup,render:e=>(0,c.jsx)(o.Cell,{text:(0,u.buildupLabel)(e.buildup_day),color:(0,s.buildupColor)((0,u.buildupTone)(e.buildup_day))})}],[f]),E=O?.total??R.length,L=O?.as_of||null;i.default.useEffect(()=>{e?.({count:E,asOf:L})},[E,L,e]);const z=(0,t.useMemo)(()=>(B?(0,u.sortRows)(R,y[B.key]||(()=>null),B.dir):R).map((e,t)=>({kind:'row',key:(0,u.rowKey)(e,t),row:e})),[R,B]);return(0,c.jsx)(s.WidgetFrame,{name:"Futures OI build-up",subtitle:`${O?.total??0} front contracts`,body:O,state:I,onRefresh:S.reload,filterCount:v,onCustomize:f,onExpand:w,expanded:C,onClose:k,style:T,inBlock:!0,showsSignals:['buildup_day','oi_change_day','oi_vs_20d_avg','basis','price_change_day_pct'],note:(0,c.jsxs)(l.default,{style:{gap:2},children:[(0,c.jsxs)(n.T,{style:s.metaText,children:[(0,u.asOfText)(O?.as_of)," \xb7 ",(0,u.floorsText)(O?.floors,O?.floors_text)]}),(0,c.jsx)(n.T,{style:s.metaText,children:"Build-up compares this contract's price change with its open-interest change over the same day-on-day window (\xa73.1). Basis is futures minus the captured spot."})]}),children:(0,c.jsx)(o.Table,{label:"Futures build-up",columns:U,items:z,sort:B,pinFirst:j,onSort:e=>F(t=>(0,u.nextSort)(t,e)),onRowPress:e=>b({underlying:e.underlying,instrumentToken:e.instrument_token,label:e.tradingsymbol||e.underlying,detail:`Futures \xb7 ${(0,u.dteText)(e.days_to_expiry)}`}),selected:e=>null!=e.instrument_token&&x?.instrumentToken===e.instrument_token,rowLabel:e=>`${e.underlying} futures. ${(0,u.buildupLabel)(e.buildup_day)} on the day. Price ${(0,u.spotLevel)(e.last_price,e.underlying)}, change ${(0,u.signed)(e.price_change_day_pct)}. Open interest ${(0,u.compact)(e.oi)}, change ${(0,u.signedUnits)(e.oi_change_day)}, ${(0,u.oiShareText)(e.oi_vs_20d_avg)}. Basis ${(0,u.basisText)(e.basis,(0,u.isIndexUnderlying)(e.underlying))}. ${(0,u.dteText)(e.days_to_expiry)}`})})};var t=_r(d[0]),i=e(t),l=e(_r(d[1])),n=_r(d[2]),r=_r(d[3]),s=_r(d[4]),o=_r(d[5]),u=_r(d[6]),c=_r(d[7]);const y={time:e=>e.captured_at,symbol:e=>e.underlying,summary:e=>e.tradingsymbol,expiry:e=>e.expiry,dte:e=>e.days_to_expiry,price:e=>e.last_price,chg:e=>e.price_change_day_pct,oi:e=>e.oi,oi_chg:e=>e.oi_change_day,oi_avg:e=>e.oi_vs_20d_avg,basis:e=>e.basis,buildup:e=>e.buildup_day}},1100,[11,13,821,1071,1074,1078,984,6]); 1194__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"EVENTS_EMPTY",{enumerable:!0,get:function(){return y}}),_e.WhatsHappening=function({read:e,at:C,seq:x,symbol:v,onTarget:j,table:w,showTable:S,onShowTable:H,style:T,onExpand:$,expanded:k}){const R="/api/derivatives/events"+(C?`?at=${encodeURIComponent(C)}`:''),z=(0,u.useDerivativeRead)(S?null:R,x),L=z.data,_=L?.rows||[],W=(0,c.stateOf)(z,y),P=e.data,E=L?.instruments??(P?.rows||[]).length,O=L?.measured??0,A=(0,t.useMemo)(()=>_,[_]);return(0,f.jsx)(c.WidgetFrame,{name:S?'All instruments':"What's happening",subtitle:S?`${E} instruments over the liquidity floors at this reading`:`${O} of ${E} instruments are reading a behaviour`,body:S?P:L,state:S?void 0:W,onRefresh:S?e.reload:z.reload,onExpand:$,expanded:k,inBlock:!0,emptyDetail:"Each instrument needs two readings of its at-the-money contracts before anything can be compared.",toolbar:(0,f.jsxs)(n.default,{style:[o.s.row,{gap:6,rowGap:20,flexWrap:'wrap'}],children:[(0,f.jsxs)(s.default,{accessibilityRole:"button",accessibilityState:{selected:!S},accessibilityLabel:"Show what is happening across every instrument at this reading",onPress:()=>H(!1),hitSlop:p,style:e=>[{minHeight:24,paddingHorizontal:9,justifyContent:'center',borderRadius:6,borderWidth:1,borderColor:S?o.C.line:o.C.green,backgroundColor:!S||e.hovered?o.C.soft:'transparent'}],children:[(0,f.jsx)(b.HitArea,{slop:p}),(0,f.jsx)(o.T,{style:{fontSize:10,lineHeight:14,color:S?o.C.muted:o.C.green},children:"What's happening"})]}),(0,f.jsxs)(s.default,{accessibilityRole:"button",accessibilityState:{selected:S},accessibilityLabel:"Show the full instrument table, with every column, filter and sort",onPress:()=>H(!0),hitSlop:p,style:e=>[{minHeight:24,paddingHorizontal:9,justifyContent:'center',borderRadius:6,borderWidth:1,borderColor:S?o.C.green:o.C.line,backgroundColor:S||e.hovered?o.C.soft:'transparent'}],children:[(0,f.jsx)(b.HitArea,{slop:p}),(0,f.jsx)(o.T,{style:{fontSize:10,lineHeight:14,color:S?o.C.green:o.C.muted},children:"All instruments"})]})]}),note:S?void 0:`Every instrument the capture covered at this reading, read under rule ${L?.rule_version||''}. A row says what its numbers did between two readings; it does not name who traded.`,style:T,children:S?(0,f.jsx)(n.default,{style:{flex:1,minHeight:0},children:w}):(0,f.jsxs)(l.default,{style:{flex:1},contentContainerStyle:{paddingVertical:4,paddingHorizontal:8,gap:2},children:[A.map(e=>{const t=e.underlying===v,l=[];
1194e.first_at&&l.push(`since ${(0,h.clock)(e.first_at)}`),null!=e.lead&&l.push(`${(0,h.strike)(e.lead)} ${e.side} largest`);const u=l.join(' \xb7 ')||(e.measured?'':'no comparable value at this reading');return(0,f.jsxs)(s.default,{accessibilityRole:"button",accessibilityState:{selected:t},accessibilityLabel:`${e.underlying}. ${e.headline}.${u?` ${u}.`:''} Point every block on this tab at this instrument`,onPress:()=>j({underlying:e.underlying,instrumentToken:null,label:e.underlying,detail:e.headline}),style:e=>[{gap:1,paddingVertical:7,paddingHorizontal:8,borderRadius:8,borderLeftWidth:2,borderLeftColor:t?o.C.green:'transparent',backgroundColor:t||e.hovered||e.focused?o.C.soft:'transparent'}],children:[(0,f.jsxs)(n.default,{style:[o.s.row,{gap:6}],children:[(0,f.jsx)(n.default,{style:{width:6,height:6,borderRadius:3,backgroundColor:e.live?o.C.green:o.C.line}}),(0,f.jsx)(o.T,{numberOfLines:1,style:{flex:1,fontSize:12,lineHeight:16,fontFamily:'InterSemi',color:t?o.C.green:o.C.ink},children:e.underlying})]}),(0,f.jsx)(o.T,{numberOfLines:2,style:{fontSize:11,lineHeight:15,color:e.live?o.C.ink:o.C.muted,paddingLeft:12},children:e.headline}),!!u&&(0,f.jsx)(o.T,{numberOfLines:1,style:{...c.metaText,paddingLeft:12,fontVariant:['tabular-nums']},children:u})]},e.underlying)}),!!A.length&&(0,f.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Show the full instrument table \u2014 all ${E} instruments, with every column`,onPress:()=>H(!0),style:e=>[o.s.row,{gap:6,marginTop:4,minHeight:44,paddingVertical:7,paddingHorizontal:8,borderRadius:8,borderTopWidth:1,borderColor:o.C.line,backgroundColor:e.hovered||e.focused?o.C.soft:'transparent'}],children:[(0,f.jsx)(o.Icon,{name:"list",size:12,color:o.C.muted}),(0,f.jsx)(o.T,{style:{flex:1,fontSize:11,lineHeight:15,color:o.C.muted},children:"Open the full table \u2014 every column, filter and sort"})]})]})})};var t=r(d[0]),n=e(r(d[1])),s=e(r(d[2])),l=e(r(d[3])),o=r(d[4]),u=r(d[5]),c=r(d[6]),h=r(d[7]),b=r(d[8]),f=r(d[9]);const p=(0,b.touchSlop)(24),y='No instrument could be read at this reading.'},1101,[11,13,375,278,821,1071,1074,984,832,6]); 1195__d(function(g,_r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SIGNAL_EMPTY",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"SIGNAL_NO_SYMBOL",{enumerable:!0,get:function(){return b}}),_e.SignalPanel=function({symbol:e,read:m,pcr:y,maxPain:_,iv:C,standing:j,onExpand:S,expanded:k,style:T}){const H=m.data,v=e?(0,u.stateOf)(m,x):{phase:'empty',text:b},$=(0,s.useReducedMotion)(),[z,I]=(0,t.useState)(''),[W,V]=(0,t.useState)(!1),L=(0,t.useCallback)(e=>I(t=>t===e?'':e),[]),M=(0,t.useMemo)(()=>(H?.marks||[]).map(e=>String(e)),[H]),P=M.length?M[M.length-1]:'',D=String(H?.expiry||''),F=(0,c.useDerivativeRead)(e&&P?`/api/derivatives/snapshots?underlying=${encodeURIComponent(e)}&upto=${encodeURIComponent(P)}`:null),R=(0,t.useMemo)(()=>(F.data?.snapshots||[]).filter(e=>'ok'===e.status&&e.state&&(!D||!e.expiry||e.expiry===D)).map(e=>e.state),[F.data,D]),E=(0,t.useMemo)(()=>(0,h.states)({grid:H,pcr:y,maxPain:_,iv:C},{intervalOnly:!0}),[H,y,_,C]),B=(0,t.useMemo)(()=>R.filter(e=>String(e.timestamp)<P),[R,P]),N=(0,t.useMemo)(()=>R.find(e=>String(e.timestamp)===P)||(E[0]?(0,h.chainStep)(B.length?B[B.length-1]:null,E[0]):void 0),[R,P,E,B]),G=(0,t.useMemo)(()=>(0,h.periods)(B.slice().reverse()),[B]),U=(0,t.useMemo)(()=>E.length?null:(0,h.standing)(j),[E.length,j]),Y=U&&'empty'===v.phase?{phase:'ready',text:''}:v,K=W?G:G.slice(0,6),q=G.slice(K.length).reduce((e,t)=>e+t.count,0);return(0,f.jsx)(u.WidgetFrame,{name:"Signal by reading",subtitle:"The market's current state, and how it got there",body:H,state:Y,onRefresh:m.reload,onExpand:S,expanded:k,inBlock:!0,emptyDetail:"A state needs two readings of these contracts before anything can be compared.",toolbar:(0,f.jsxs)(n.default,{style:[o.s.row,{gap:6,flexWrap:'wrap'}],children:[!!N&&(0,f.jsxs)(n.default,{style:[o.s.row,{gap:5}],children:[(0,f.jsx)(n.default,{style:{width:5,height:5,borderRadius:3,backgroundColor:o.C.green}}),(0,f.jsxs)(o.T,{style:{fontSize:10,lineHeight:14,color:o.C.muted,fontVariant:['tabular-nums']},children:[(0,p.clock)(N.timestamp)," IST"]})]}),(0,f.jsx)(n.default,{style:{flex:1,minWidth:4}}),(0,f.jsx)(u.InfoDisclosure,{label:"How to read this",title:"How to read this",groups:h.SIGNAL_GUIDE})]}),note:void 0,footer:null,style:T,children:(0,f.jsxs)(r.default,{style:{flex:1},contentContainerStyle:{paddingBottom:8},children:[!!U&&(0,f.jsx)(A,{s:U}),!!N&&(0,f.jsx)(w,{row:N}),!!G.length&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(n.default,{style:[o.s.row,{gap:7,paddingHorizontal:10,paddingTop:8,paddingBottom:4}],children:[(0,f.jsx)(o.T,{style:u.head,children:"Earlier today"}),(0,f.jsx)(o.T,{style:{fontSize:9.5,lineHeight:13,color:o.C.muted},children:`${G.length} state${1===G.length?'':'s'} before this reading`})]}),K.map(e=>(0,f.jsx)(O,{period:e,open:z,onToggle:L,reduce:$},String(e.to))),q>0&&(0,f.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:`Show all readings, ${q} more earlier in the session`,onPress:()=>V(!0),style:e=>[{minHeight:44,justifyContent:'center',paddingHorizontal:10,paddingVertical:7,alignItems:'flex-start'},e.hovered?{backgroundColor:'#08161D'}:null],children:(0,f.jsx)(o.T,{style:{fontSize:10.5,lineHeight:14,color:o.C.green},children:`Show all readings (${q} earlier)`})})]}),!!N&&!G.length&&(0,f.jsx)(o.T,{style:{fontSize:10.5,lineHeight:15,color:o.C.muted,paddingHorizontal:10,paddingTop:8},children:"This is the first reading of the session, so there is nothing yet to compare it against."})]})})};var t=_r(d[0]),n=e(_r(d[1])),l=e(_r(d[2])),r=e(_r(d[3]));_r(d[4]);var o=_r(d[5]),s=_r(d[6]),c=_r(d[7]),u=_r(d[8]),p=_r(d[9]),h=_r(d[10]),f=_r(d[11]);const m=o.s,x='No reading of these ten contracts has been captured yet.',b='Pick an instrument on the left to read how its last fifteen minutes went.',y={up:o.C.green,down:o.C.red,warn:o.C.amber,flat:o.C.muted},_=e=>null==e?o.C.muted:e>0?o.C.green:e<0?o.C.red:o.C.muted,C=e=>null==e?'':e>0?'\u2191 ':e<0?'\u2193 ':'\u2192 ',j=(e,t)=>null==e?p.DASH:`${C(e)}${t(Math.abs(e))}`;function S(e){const t='puts'===e.row||!e.row&&Math.abs(e.put_oi_change||0)>Math.abs(e.call_oi_change||0),n=t?e.put_oi_change:e.call_oi_change,l=null==e.max_pain_current?p.DASH:e.max_pain_change?`${(0,h.strikeOf)(e.max_pain_previous)} \u2192 ${(0,h.strikeOf)(e.max_pain_current)}`:`\u2192 ${(0,h.strikeOf)(e.max_pain_current)}`;return[{label:'Price',value:j(e.price_change,e=>`\u20b9${e.toFixed(2)}`),colour:_(e.price_change),sub:e.price_contract||''},{label:'\u0394 Open interest',value:j(n,e=>(0,p.compact)(e)),colour:_(n),sub:t?'Puts':'Calls'},{label:'\u0394 IV',value:j(e.iv_change,e=>e.toFixed(1)),colour:_(e.iv_change),sub:''},{label:'\u0394 PCR',value:j(e.pcr_change,e=>e.toFixed(2)),colour:_(e.pcr_change),sub:''},{label:'Max pain',value:l,colour:e.max_pain_change?o.C.amber:o.C.muted,sub:''}]}function k({box:e}){return(0,f.jsxs)(n.default,{accessibilityRole:"text",accessibilityLabel:`${e.label} ${e.value}. ${e.sub}`,style:{width:96,flexGrow:1,gap:1,paddingHorizontal:7,paddingVertical:5,borderRadius:7,borderWidth:1,borderColor:o.C.line,backgroundColor:o.C.dark},children:[(0,f.jsx)(o.T,{numberOfLines:1,style:{fontSize:8,lineHeight:11,letterSpacing:.5,textTransform:'uppercase',color:o.C.muted},children:e.label}),(0,f.jsx)(o.T,{numberOfLines:1,style:{fontSize:12.5,lineHeight:16,fontFamily:'InterSemi',color:e.colour,fontVariant:['tabular-nums']},children:e.value}),(0,f.jsx)(o.T,{numberOfLines:2,style:{fontSize:8.5,lineHeight:11,color:o.C.muted},children:e.sub})]})}function T({state:e,big:t}){const l=y[h.STATE_TONE[e]]||o.C.muted;return(0,f.jsx)(n.default,{style:{paddingHorizontal:t?9:6,paddingVertical:t?3:1.5,borderRadius:6,borderWidth:1,borderColor:l,backgroundColor:'flat'===h.STATE_TONE[e]?'transparent':
1195o.C.dark},children:(0,f.jsx)(o.T,{style:{fontSize:t?10.5:9,lineHeight:t?14:12,letterSpacing:.8,textTransform:'uppercase',fontFamily:'InterSemi',color:l},children:h.STATE_LABEL[e]})})}function H({label:e}){const t=/not confirming|unavailable|weak|narrowing/i.test(e);return(0,f.jsx)(n.default,{style:{paddingHorizontal:6,paddingVertical:1.5,borderRadius:5,borderWidth:1,borderColor:t?o.C.amber:o.C.line,backgroundColor:o.C.dark},children:(0,f.jsx)(o.T,{style:{fontSize:9,lineHeight:12,color:t?o.C.amber:o.C.muted},children:e})})}function v({row:e}){return e.key_strikes.length?(0,f.jsxs)(n.default,{style:{gap:3},children:[(0,f.jsx)(o.T,{style:u.head,children:"Key strikes"}),(0,f.jsx)(n.default,{style:[o.s.row,{gap:5,flexWrap:'wrap'}],children:e.key_strikes.map(e=>(0,f.jsxs)(n.default,{accessibilityRole:"text",accessibilityLabel:`${(0,h.strikeOf)(e.strike)} ${e.side}, ${e.note}`,style:[o.s.row,{gap:5,paddingHorizontal:7,paddingVertical:2.5,borderRadius:6,borderWidth:1,borderColor:e.lead?o.C.green:o.C.line,backgroundColor:o.C.dark}],children:[(0,f.jsxs)(o.T,{style:{fontSize:10.5,lineHeight:14,fontFamily:'InterSemi',color:e.lead?o.C.green:o.C.ink,fontVariant:['tabular-nums']},children:[(0,h.strikeOf)(e.strike)," ",e.side]}),(0,f.jsx)(o.T,{style:{fontSize:9,lineHeight:12,color:o.C.muted},children:e.note})]},`${e.strike}-${e.side}`))})]}):null}function w({row:e}){const[r,s]=(0,t.useState)(!1),c=e.previous_timestamp?`${(0,p.clock)(e.previous_timestamp)} \u2192 ${(0,p.clock)(e.timestamp)}`:(0,p.clock)(e.timestamp),u=(0,h.persistenceText)(e),m='balanced'===e.state;return(0,f.jsxs)(n.default,{style:{gap:8,paddingHorizontal:10,paddingVertical:9,borderBottomWidth:1,borderColor:o.C.line,backgroundColor:o.C.dark},children:[(0,f.jsxs)(n.default,{style:[o.s.row,{gap:7,flexWrap:'wrap'}],children:[(0,f.jsx)(T,{state:e.state,big:!0}),(0,f.jsx)(o.T,{style:{fontSize:10.5,lineHeight:14,color:o.C.muted,fontVariant:['tabular-nums']},children:c}),(0,f.jsx)(n.default,{style:{flex:1,minWidth:2}}),!!u&&(0,f.jsx)(o.T,{style:{fontSize:10,lineHeight:14,color:o.C.muted},children:u})]}),(0,f.jsxs)(n.default,{style:{gap:4},children:[(0,f.jsx)(o.T,{style:{fontSize:16,lineHeight:21,fontFamily:'InterSemi',color:o.C.ink,letterSpacing:-.2},children:e.plain_language_read}),!!e.plain_language_evidence&&(0,f.jsx)(o.T,{style:{fontSize:11,lineHeight:16,color:o.C.muted},children:e.plain_language_evidence})]}),!!e.tags.length&&(0,f.jsx)(n.default,{style:[o.s.row,{gap:5,flexWrap:'wrap'}],children:e.tags.map(e=>(0,f.jsx)(H,{label:e},e))}),(0,f.jsx)(v,{row:e}),m&&null==e.price_change&&null==e.call_oi_change?null:(0,f.jsx)(l.default,{accessibilityRole:"button",accessibilityState:{expanded:r},accessibilityLabel:`${S(e).map(e=>`${e.label} ${e.value}`).join(', ')}. ${r?'Hide':'Show'} the levels behind these changes`,onPress:()=>s(e=>!e),style:[o.s.row,{gap:5,flexWrap:'wrap',alignItems:'stretch'}],children:S(e).map(e=>(0,f.jsx)(k,{box:e},e.label))}),r&&(0,f.jsx)($,{row:e})]})}function $({row:e}){const t=[['Premium',null==e.price_level?p.DASH:`\u20b9${e.price_level.toFixed(2)}${e.price_contract?` (${e.price_contract})`:''}`],['Call open interest',null==e.call_oi_level?p.DASH:(0,p.compact)(e.call_oi_level)],['Put open interest',null==e.put_oi_level?p.DASH:(0,p.compact)(e.put_oi_level)],['ATM IV',null==e.iv_level?p.DASH:`${e.iv_level.toFixed(1)}%`],['Call / put IV change',`${null==e.call_iv_change?p.DASH:(0,h.signedNum)(e.call_iv_change)} / ${null==e.put_iv_change?p.DASH:(0,h.signedNum)(e.put_iv_change)} pts`],['PCR',null==e.pcr_current?p.DASH:`${null==e.pcr_previous?'':`${e.pcr_previous.toFixed(2)} \u2192 `}${e.pcr_current.toFixed(2)}`],['Max pain',null==e.max_pain_current?p.DASH:(0,h.strikeOf)(e.max_pain_current)]];return(0,f.jsx)(n.default,{style:{gap:2},children:t.map(([e,t])=>(0,f.jsxs)(n.default,{style:[o.s.row,{gap:8}],children:[(0,f.jsx)(o.T,{style:{width:118,fontSize:10,lineHeight:14,color:o.C.muted},children:e}),(0,f.jsx)(o.T,{style:{flex:1,fontSize:10,lineHeight:14,color:o.C.ink,fontVariant:['tabular-nums']},children:t})]},e))})}function z({row:e}){return(0,f.jsxs)(n.default,{style:{gap:8,paddingHorizontal:10,paddingBottom:9,paddingTop:4,backgroundColor:o.C.dark},children:[!!e.plain_language_evidence&&(0,f.jsx)(o.T,{style:{fontSize:10.5,lineHeight:15,color:o.C.muted},children:e.plain_language_evidence}),'opening'!==e.state&&(0,f.jsx)(n.default,{style:[o.s.row,{gap:5,flexWrap:'wrap',alignItems:'stretch'}],children:S(e).map(e=>(0,f.jsx)(k,{box:e},e.label))}),(0,f.jsx)($,{row:e})]})}function O({period:e,open:t,onToggle:r,reduce:s}){const c=String(e.to||''),u=t===c,m=e.count>1?`${(0,p.clock)(e.from)} \u2192 ${(0,p.clock)(e.to)}`:(0,p.clock)(e.to),x=y[h.STATE_TONE[e.state]]||o.C.muted,b=`${m}. ${h.STATE_LABEL[e.state]}${e.count>1?`, ${e.count} readings${null!=e.minutes?` over ${e.minutes} minutes`:''}`:''}. ${e.read}.`;return(0,f.jsxs)(n.default,{style:{borderBottomWidth:1,borderColor:'#0F1B22'},children:[(0,f.jsxs)(l.default,{accessibilityRole:"button",accessibilityState:{expanded:u},accessibilityLabel:`${b} ${u?'Close':'Open'} the readings behind this period`,onPress:()=>r(c),style:e=>[{minHeight:44,justifyContent:'center',paddingHorizontal:10,paddingVertical:6,gap:2,borderLeftWidth:2,borderLeftColor:u?x:'transparent',backgroundColor:u?o.C.dark:'transparent',...s?{}:{transitionProperty:'background-color',transitionDuration:'160ms'}},e.hovered&&!u?{backgroundColor:'#08161D'}:null],children:[(0,f.jsxs)(n.default,{style:[o.s.row,{gap:7,flexWrap:'wrap'}],children:[(0,f.jsx)(o.T,{style:{width:92,fontSize:10,lineHeight:14,color:o.C.muted,fontVariant:['tabular-nums']},children:m}),(0,f.jsx)(T,{state:e.state}),e.count>1&&(0,f.jsx)(o.T,{style:{fontSize:9,lineHeight:12,color:o.C.muted},children:`${e.count} readings${null!=e.minutes?` \xb7 ${e.minutes} min`:''}`}),(0,f.jsx)(n.default,{style:{flex:1,minWidth:2}}),(0,f.jsx)(o.Icon,{name:u?'chevron-down':'chevron-right',size:11,color:o.C.muted})]}),(0,f.jsx)(o.T,{numberOfLines:u?3:2,style:{fontSize:10.5,lineHeight:14,color:o.C.ink,paddingLeft:99},children:e.read})]}),u&&(0,f.jsxs)(n.default,{children:[e.count>1&&(0,f.jsx)(o.T,{style:{fontSize:9.5,lineHeight:13,color:o.C.muted,paddingHorizontal:10,paddingTop:5},children:"Every reading this period covers, newest first."}),e.readings.slice().reverse().map(e=>(0,f.jsxs)(n.default,{style:{borderTopWidth:1,borderColor:'#0F1B22'},children:[(0,f.jsxs)(n.default,{style:[o.s.row,{gap:7,paddingHorizontal:10,paddingTop:6}],children:[(0,f.jsx)(o.T,{style:{width:92,fontSize:10,lineHeight:14,color:o.C.muted,fontVariant:['tabular-nums']},children:(0,p.clock)(e.timestamp)}),(0,f.jsx)(o.T,{style:{flex:1,fontSize:10.5,lineHeight:14,color:o.C.ink},children:e.plain_language_read})]}),(0,f.jsx)(z,{row:e})]},String(e.timestamp)))]})]})}function A({s:e}){const t=[['Spot',(0,p.level)(e.spot,e.is_index,2,0)],['At the money',(0,h.strikeOf)(e.atm)],['Put/call OI',null==e.pcr?p.DASH:e.pcr.toFixed(2)],['Max pain',(0,h.strikeOf)(e.max_pain)]];return(0,f.jsxs)(n.default,{style:{gap:9,paddingHorizontal:10,paddingVertical:10,backgroundColor:o.C.dark},children:[(0,f.jsxs)(n.default,{style:[m.row,{gap:7,flexWrap:'wrap'}],children:[(0,f.jsx)(T,{state:"opening",big:!0}),(0,f.jsx)(o.T,{style:{fontSize:10.5,lineHeight:14,color:o.C.muted,fontVariant:['tabular-nums']},children:(0,p.clock)(e.at)})]}),!!e.opening&&(0,f.jsx)(o.T,{style:{fontSize:16,lineHeight:21,fontFamily:'InterSemi',color:o.C.ink,letterSpacing:-.2},children:e.opening}),(0,f.jsx)(n.default,{style:[m.row,{gap:5,flexWrap:'wrap',alignItems:'stretch'}],children:t.map(([e,t])=>(0,f.jsxs)(n.default,{style:{width:96,flexGrow:1,gap:1,paddingHorizontal:7,paddingVertical:5,borderRadius:7,borderWidth:1,borderColor:o.C.line,backgroundColor:o.C.bg},children:[(0,f.jsx)(o.T,{style:{fontSize:8,lineHeight:11,letterSpacing:.5,textTransform:'uppercase',color:o.C.muted},children:e}),(0,f.jsx)(o.T,{style:{fontSize:12.5,lineHeight:16,fontFamily:'InterSemi',color:o.C.ink,fontVariant:['tabular-nums']},children:t})]},e))})]})}},1102,[11,13,375,278,136,821,948,1071,1074,984,1103,6]); 1196__d(function(g,_r,_i,_a,_m,_e,d){"use strict";
1196Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STATE_LABEL",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"STATE_TONE",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"signedPct",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"signedLots",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"signedMoney",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"signedNum",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"strikeOf",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"priceText",{enumerable:!0,get:function(){return e.price}}),_e.persistenceText=function(t){return t.persistence_evidence_available&&t.persistence_since?`Since ${(0,e.clock)(t.persistence_since)}`:''},Object.defineProperty(_e,"ENGINE_VERSION",{enumerable:!0,get:function(){return $}}),_e.states=function(i,o={}){const c=i.grid,u=(0,t.observe)(c);if(!u.length)return[];const h=r(i.pcr?.points),p=r(i.maxPain?.points),b=r(i.iv?.points),y=Array.from(new Set((c?.rows||[]).map(e=>a(e.strike)).filter(e=>null!=e))).sort((e,t)=>e-t),E=a(c?.atm_strike),M=e=>{if(null==E||!e.length)return'';const t=Math.min(...e),n=Math.max(...e);return t===n&&t===E?'at ATM':t>=E&&n>E?'above ATM':n<=E&&t<E?'below ATM':'around ATM'},N=(t,n)=>{const i=t.slice().sort((e,t)=>e-t);return i.length?1===i.length?`${(0,e.strike)(i[0])} ${n}`:`${(0,e.strike)(i[0])}\u2013${(0,e.strike)(i[i.length-1])} ${n}`:''};return u.map((t,i)=>{const r=s(t.at),c=s(t.previous_at),E=i>0?u[i-1]:null,O=t.calls_interval,I=t.puts_interval,P=t.ladder||[],S=_(P,'calls'),A=_(P,'puts'),C=!t.previous_at,T=t.calls.weight,D=t.puts.weight,R=0===T&&0===D?null:D>T?'puts':'calls',L='puts'===R?t.puts:'calls'===R?t.calls:null,j=('puts'===R?t.calls:t.puts,e=>f.indexOf(e)>=0),B=T>0&&D>0&&Math.max(T,D)<=1.25*Math.min(T,D)&&j(t.calls.behaviour)!==j(t.puts.behaviour),U=k(L||('quiet'!==t.calls.state?t.calls:t.puts),B&&!!L&&'not_observed'!==L.state&&'no_baseline'!==L.state),G=C?null:v(O,I,P,y),H=(o.intervalOnly||'no_baseline'===U)&&!C,F=!!(O&&O.total||I&&I.total),V=C?'opening':H?G?G.state:F?'balanced':'not_observed':U,q=!H&&!C&&!!L&&L.scans>=2&&!!L.first_at,W=H?G?G.row:null:R,X=H?G?G.side:null:L?L.side:null,Y=H?G?G.behaviour:'none':L?L.behaviour:'none',z=H?G?G.strikes.slice():[]:L?L.strikes.slice():[],Q=H?G?G.lead:null:L?L.lead:null,J=z.length>1&&y.indexOf(z[z.length-1])-y.indexOf(z[0])===z.length-1,K=E&&E.previous_at?v(E.calls_interval,E.puts_interval,E.ladder||[],y):null,Z=E?'puts'===W?E.puts:E.calls:null,ee=!!Z&&'no_baseline'!==Z.state&&'not_observed'!==Z.state,te=H?K&&K.row===W?K.strikes.length:null:ee?Z.strikes.length:null,ne=z.length,ie=null==te||!ne&&!te?'none':ne>te?'wider':ne<te?'narrower':'same',ae='puts'===W?A||S:S||A,se=ae?a(ae.price_change):null,re=ae?a(ae.price_level):null,le=null!=re&&null!=se?re-se:null,oe=le&&0!==le&&null!=se?l(se/Math.abs(le)*100,0):null,ce=O&&O.total?a(O.total.change):null,ue=I&&I.total?a(I.total.change):null,de=e=>P.filter(t=>t.row===e).reduce((e,t)=>{const n=a(t.oi_level);return null==n?e:(e||0)+n},null),he=b.get(r),ge=b.get(c),pe=he?a(he.iv_pct):null,be=ge?a(ge.iv_pct):null,me=null!=pe&&null!=be?l(pe-be,1):null,ve=he?a(he.ce_iv_pct):null,fe=he?a(he.pe_iv_pct):null,ke=ge?a(ge.ce_iv_pct):null,we=ge?a(ge.pe_iv_pct):null,$e=h.get(r),ye=h.get(c),xe=$e?a($e.pcr_oi):null,Ee=ye?a(ye.pcr_oi):null,Me=p.get(r),Ne=p.get(c),Oe=Me?a(Me.max_pain_strike):null,Ie=Ne?a(Ne.max_pain_strike):null,Pe=e=>P.filter(t=>t.row===e&&('added'===t.status||'reduced'===t.status)&&Math.abs(a(t.oi_added)||0)>0),Se=(e,t,n)=>null==t?'not_measured':Pe(e).length?n&&j(n)?'reducing':t>0?'building':t<0?'reducing':'quiet':'quiet',Ae=C?'opening':Se('calls',ce,O?.behaviour),Ce=C?'opening':Se('puts',ue,I?.behaviour),Te=e=>{const t=Pe(e),n=t.reduce((e,t)=>e+(a(t.price_change)||0),0),i=t.reduce((e,t)=>e+Math.abs(a(t.price_level)||0),0);return t.length?i>0&&Math.abs(n)<.01*i?'with prices little changed':n<0?'while prices declined':n>0?'while prices rose':'with prices unchanged':''},De=(t,n,i)=>{const s=Pe(t);if(null==n||!s.length||0===n)return'';const r='puts'===t?'PE':'CE',l='puts'===t?'Put':'Call',o=s.slice().sort((e,t)=>
1196Math.abs(a(t.oi_added)||0)-Math.abs(a(e.oi_added)||0))[0];return`${l} OI ${n>0?'rose':'fell'} ${(0,e.compact)(Math.abs(n))} across ${N(s.map(e=>e.strike),r)} `+`${Te(t)}`.trim()+(i&&o?`; ${(0,e.strike)(o.strike)} ${r} leads`:'')},Re=[],Le=[],je='puts'===W?ue:ce,Be='puts'===W?ce:ue,Ue='puts'===W?'calls':'puts',Ge=['appeared','building','held','strengthened','broadened','concentrated','shifted','slowed','reversing','mixed'].indexOf(V)>=0;if(W&&Ge){const e=De(W,je,!0);e&&Re.push({text:e+'.'});if(null!=Be&&null!=je&&Math.abs(Be)>=.25*Math.abs(je)){const e=De(Ue,Be,!1);e&&Re.push({text:e+'.'})}else null!=je&&Re.push({text:('puts'===Ue?'Put':'Call')+" activity changed only marginally."});null!=me&&Math.abs(me)<.2&&Le.push({text:'IV was unchanged.'}),'narrower'===ie&&Le.push({text:`Activity narrowed to ${ne} strike${1===ne?'':'s'} from ${te}.`})}const He=null!=je&&(null==Be||Math.abs(je)>1.25*Math.abs(Be)),Fe=!!W&&/declined|rose/.test(Te(W)),Ve='mixed'!==V&&W&&He&&Fe?m(W,Y):null,qe='puts'===Ue?Ce:Ae,We=[];Ge&&('wider'===ie?We.push('Broader activity'):'narrower'===ie&&We.push('Narrowing'),null!=je&&null!=Be&&Math.abs(je)>1.5*Math.abs(Be)?We.push(('puts'===W?'Puts':'Calls')+" stronger"):null!=je&&null!=Be&&Math.abs(Be)>Math.abs(je)&&We.push(('puts'===Ue?'Puts':'Calls')+" larger"),null!=me&&Math.abs(me)<.2&&We.push('IV not confirming'));const Xe=W&&Ge?Pe(W).sort((e,t)=>Math.abs(a(t.oi_added)||0)-Math.abs(a(e.oi_added)||0)).slice(0,4).map((e,t)=>({strike:e.strike,side:e.side,lead:0===t,note:0===t?'Highest activity':e.joined?'New activity':'reduced'===e.status?'Reducing':'Building'})):[],Ye=e=>P.filter(t=>t.row===e&&null!=a(t.oi_level)&&a(t.oi_level)>0).sort((e,t)=>a(t.oi_level)-a(e.oi_level)).slice(0,3).map(e=>e.strike),ze=C?Ye('calls'):[],Qe=C?Ye('puts'):[],Je='puts'===W?'Put':'Call',Ke=Ve||`${Je} activity`,Ze=M(z),et=Z&&ee?Z.lead:null,tt=L&&L.joined||[],nt=Z&&ee?Z.strikes:[],it=tt.length&&nt.length?Math.min(...tt)>Math.max(...nt)?'higher':Math.max(...tt)<Math.min(...nt)?'lower':'more':'more';let at='';switch(V){case'opening':{const e=[];ze.length&&e.push(`Calls concentrated around ${N(ze,'CE')}`),Qe.length&&e.push(`${ze.length?'puts':'Puts'} around ${N(Qe,'PE')}`),at=e.join('; ')||'Opening read';break}case'building':at=`${Ke} building ${Ze}`;break;case'appeared':at=`${Ke} appears ${Ze}`;break;case'held':at=`${Ke} holding ${Ze}`;break;case'strengthened':at=`${Ke} strengthens ${Ze}`;break;case'broadened':at=`${Ke} broadens into ${it} strikes`;break;case'concentrated':at=`${Ke} narrows to ${N(z,X||'')}`;break;case'shifted':at=null!=et&&null!=Q?`Leading ${Je.toLowerCase()} activity shifts from ${(0,e.strike)(et)} to ${(0,e.strike)(Q)} ${X||''}`:`Leading ${Je.toLowerCase()} activity shifts strike`;break;case'slowed':at=`${Ke} losing momentum ${Ze}`;break;case'fading':at=`Earlier ${(Ve||`${Je} activity`).toLowerCase()} is fading`;break;case'reversing':at=`${Je} positions being reduced ${Ze}`;break;case'mixed':at=`Call positions ${'reducing'===Ae?'reducing':'building'} while put positions `+('reducing'===Ce?'reduce':'build');break;case'balanced':at='No material change in market structure';break;case'not_observed':at='No comparable values captured at this reading';break;default:at=''}at=at.replace(/\s+/g,' ').trim();const st=Re.map(e=>e.text.replace(/\.$/,'')).join('. ')+(Re.length?'.':''),rt=n[V],lt=q&&!!L;return{timestamp:t.at,previous_timestamp:t.previous_at,current_timestamp:t.at,interval_minutes:x(t.previous_at,t.at),state:V,state_change:rt,market_state:V,call_state:Ae,put_state:Ce,side:X,row:W,location:Ze,strike_range:C?ze:z,strike_cluster:C?ze:z,leading_strike:Q,persistence_since:lt?L.first_at:null,persistence_minutes:lt?L.elapsed_minutes:null,consecutive_readings:lt?L.scans:0,persistence_known:lt,persistence_evidence_available:lt,persistence_status:lt?'established':'none',breadth_previous:te,breadth_current:ne,breadth_direction:ie,breadth:w(ne,J),price_change:l(se),price_change_pct:oe,price_level:l(re),price_contract:ae?`${(0,e.strike)(ae.strike)} ${ae.side}`:'',call_oi_change:ce,put_oi_change:ue,call_oi_level:de('calls'),put_oi_level:de('puts'),call_iv_change:null!=ve&&null!=ke?l(ve-ke,1):null,put_iv_change:null!=fe&&null!=we?l(fe-we,1):null,iv_change:me,iv_level:pe,iv_reason:String(he?.reason_text||''),pcr_previous:l(Ee),pcr_current:l(xe),pcr_change:null!=xe&&null!=Ee?l(xe-Ee):null,max_pain_previous:Ie,max_pain_current:Oe,max_pain_change:null!=Oe&&null!=Ie?Oe-Ie:null,supporting_evidence:Re,conflicting_evidence:Le,opposing_side_state:qe,regime:Ve,tags:We.slice(0,3),key_strikes:Xe,plain_language_read:at,plain_language_detail:st,plain_language_headline:at,plain_language_evidence:st,behaviour:Y,weight:Math.abs(je||0),engine_version:$,rules_version:e.SIGNAL_RULE_VERSION,covered:t.covered}}).reverse()},_e.chainStep=E,_e.chainSession=function(e){const t=[];for(const n of e)t.push(E(t.length?t[t.length-1]:null,n));return t},_e.periods=function(e){const t=e.slice().reverse(),i=[];for(const e of t){const t=i[i.length-1];t&&t.state===e.state&&t.readings[0].row===e.row?(t.readings.push(e),t.to=e.timestamp,t.count+=1,t.read=e.plain_language_read,t.detail=e.plain_language_detail):i.push({from:e.previous_timestamp||e.timestamp,to:e.timestamp,minutes:null,readings:[e],state:e.state,label:n[e.state],read:e.plain_language_read,detail:e.plain_language_detail,count:1,latest:!1})}for(const e of i)e.minutes=x(e.from,e.to);const a=i.reverse();a.length&&(a[0].latest=!0);return a},Object.defineProperty(_e,"SIGNAL_GUIDE",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"STANDING_CAVEAT",{enumerable:!0,get:function(){return N}}),_e.standing=O,_e.openingSnapshot=function(t,i){const a=O(t);if(!a||!a.opening)return null;const s=null;return{timestamp:i,previous_timestamp:s,current_timestamp:i,interval_minutes:s,state:'opening',state_change:n.opening,market_state:'opening',call_state:'opening',put_state:'opening',side:a.open_calls.length?'CE':'PE',row:a.open_calls.length?'calls':'puts',location:'',strike_range:a.open_calls.slice(),strike_cluster:a.open_calls.slice(),leading_str
1196ike:s,persistence_since:s,persistence_minutes:s,consecutive_readings:0,persistence_known:!1,persistence_evidence_available:!1,persistence_status:'none',breadth_previous:s,breadth_current:0,breadth_direction:'none',breadth:'none',price_change:s,price_change_pct:s,price_level:s,price_contract:'',call_oi_change:s,put_oi_change:s,call_oi_level:a.total_ce_oi,put_oi_level:a.total_pe_oi,call_iv_change:s,put_iv_change:s,iv_change:s,iv_level:s,iv_reason:'',pcr_previous:s,pcr_current:a.pcr,pcr_change:s,max_pain_previous:s,max_pain_current:a.max_pain,max_pain_change:s,supporting_evidence:[],conflicting_evidence:[],opposing_side_state:'opening',regime:s,tags:[],key_strikes:[],plain_language_read:a.opening,plain_language_detail:'',plain_language_headline:a.opening,plain_language_evidence:'',behaviour:'none',weight:0,engine_version:$,rules_version:e.SIGNAL_RULE_VERSION,covered:!0}};var e=_r(d[0]),t=_r(d[1]);const n={opening:'Opening read',appeared:'Appeared',building:'Building',held:'Held',strengthened:'Strengthened',broadened:'Broadened',concentrated:'Concentrated',shifted:'Shifted',slowed:'Slowed',fading:'Fading',reversing:'Reversing',balanced:'Balanced',mixed:'Mixed',not_observed:'Not observed',no_baseline:'No baseline yet'},i={opening:'flat',appeared:'up',building:'up',held:'up',strengthened:'up',broadened:'up',concentrated:'warn',shifted:'warn',slowed:'warn',fading:'warn',reversing:'down',balanced:'flat',mixed:'flat',not_observed:'warn',no_baseline:'flat'},a=e=>{if(null==e||''===e)return null;const t='number'==typeof e?e:Number(e);return Number.isFinite(t)?t:null},s=e=>String(e||'').slice(0,16),r=e=>{const t=new Map;for(const n of e||[])n&&n.at&&t.set(s(n.at),n);return t},l=(e,t=2)=>null==e?null:Math.round(e*10**t)/10**t,o=t=>null==t?e.DASH:`${t>0?'+':t<0?e.MINUS:''}${Math.abs(t).toFixed(0)}%`,c=t=>null==t?e.DASH:`${t>0?'+':t<0?e.MINUS:''}${(0,e.compact)(Math.abs(t))}`,u=t=>null==t?e.DASH:`${t>0?'+':t<0?e.MINUS:''}${e.RUPEE}${Math.abs(t).toLocaleString('en-IN',{minimumFractionDigits:2,maximumFractionDigits:2})}`,h=(t,n=1)=>null==t?e.DASH:`${t>0?'+':t<0?e.MINUS:''}${Math.abs(t).toFixed(n)}`,p=t=>null==t?e.DASH:(0,e.strike)(t);function _(e,t){let n=null;for(const i of e)i.row===t&&'not_captured'!==i.status&&(!n||Math.abs(a(i.oi_added)||0)>Math.abs(a(n.oi_added)||0))&&(n=i);return n&&Math.abs(a(n.oi_added)||0)>0?n:null}const b={buying:'Long build-up',writing:'Writing',short_covering:'Short covering',buyers_exiting:'Buyers exiting'},m=(e,t)=>
1196{const n=b[t];return n&&e?`${'puts'===e?'Put':'Call'} ${n.toLowerCase()}`:null};function v(e,n,i,s){const r=((e,n)=>{const i=e&&t.DIRECTIONAL.indexOf(e.behaviour)>=0?e.weight:0,a=n&&t.DIRECTIONAL.indexOf(n.behaviour)>=0?n.weight:0;return i<=0&&a<=0?null:a>i?n:e})(e,n);if(!r)return null;const l=e&&t.DIRECTIONAL.indexOf(e.behaviour)>=0?e.weight:0,o=n&&t.DIRECTIONAL.indexOf(n.behaviour)>=0?n.weight:0,c=l>0&&o>0&&Math.max(l,o)<=1.25*Math.min(l,o)&&f.indexOf(e.behaviour)>=0!=f.indexOf(n.behaviour)>=0,u=r.row,h=r.side,p=i.filter(e=>e.row===u&&('added'===e.status||'reduced'===e.status)&&Math.abs(a(e.oi_added)||0)>0);if(!p.length)return null;const _=p.map(e=>e.strike).sort((e,t)=>e-t),b=p.reduce((e,t)=>Math.abs(a(t.oi_added)||0)>Math.abs(a(e.oi_added)||0)?t:e,p[0]).strike,m=c?'mixed':f.indexOf(r.behaviour)>=0?'reversing':'building';return{row:u,side:h,behaviour:r.behaviour,state:m,strikes:_,lead:b,both:c}}const f=['short_covering','buyers_exiting'];function k(e,t){if(!e)return'no_baseline';if('no_baseline'===e.state)return'no_baseline';if('not_observed'===e.state)return'not_observed';if(t)return'mixed';switch(e.state){case'appeared':return'appeared';case'continued':return e.scans<=2?'building':'held';case'strengthened':return'strengthened';case'broadened':return'broadened';case'narrowed':return'concentrated';case'shifted':return'shifted';case'slowed':return'slowed';case'faded':return'fading';case'unwound':return'reversing';default:return'balanced'}}const w=(e,t)=>e<=0?'none':1===e?'isolated':t?'clustered':'dispersed';const $='pane/3.3 2026-09-21';const y=['building','appeared','held','strengthened','broadened','concentrated','shifted','slowed','reversing'],x=(e,t)=>{const n=e=>{const t=String(e||'').match(/(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})/);return t?Date.UTC(+t[1],+t[2]-1,+t[3],+t[4],+t[5])/6e4:null},i=n(e),a=n(t);return null==i||null==a?null:a-i};function E(i,a){const s={...a,persistence_since:null,persistence_minutes:null,consecutive_readings:0,persistence_known:!1,persistence_evidence_available:!1,persistence_status:'none'};if(!i||'opening'===a.state||'not_observed'===a.state||'mixed'===a.state)return s;const r=e=>y.indexOf(e.state)>=0,l=e=>'reversing'===e.state||f.indexOf(e.behaviour)>=0,o=e=>'puts'===e.row?'Put':'Call',c=e=>e.regime||`${o(e)} activity`,u=(e,t)=>{s.state=e,s.state_change=n[e],s.market_state=e,s.plain_language_read=t.replace(/\s+/g,' ').trim(),s.plain_language_headline=s.plain_language_read};if('balanced'===a.state)return r(i)&&!l(i)&&u('fading',`Earlier ${c(i).toLowerCase()} is fading`),s;if(!r(a))return s;const h=!i.regime||!a.regime||i.regime===a.regime,p=r(i)&&i.row===a.row&&l(i)===l(a)&&h;if(i.row===a.row&&r(i)){const e=i.strike_range||[];s.key_strikes=(a.key_strikes||[]).map(t=>({...t,note:t.lead?'Highest activity':e.indexOf(t.strike)<0?'New activity':'New activity'===t.note?l(a)?'Reducing':'Building':t.note}))}const _=a.side||'';if(!p)return l(a)?u('reversing',`${o(a)} positions being reduced ${a.location}`):'opening'!==i.state&&u('appeared',`${c(a)} appears ${a.location}`),s;const b=i.persistence_since||i.timestamp;if(s.persistence_since=b,s.persistence_minutes=x(b,a.timestamp),s.consecutive_readings=(i.consecutive_readings||1)+1,s.persistence_known=!0,s.persistence_evidence_available=!0,s.persistence_status='established',l(a))return u('reversing',`${o(a)} positions still being reduced ${a.location}`),s.breadth_previous=(i.strike_range||[]).length,s.breadth_current=(a.strike_range||[]).length,s;const m=i.strike_range||[],v=a.strike_range||[],k=v.filter(e=>m.indexOf(e)<0),w=m.filter(e=>v.indexOf(e)<0);s.breadth_previous=m.length,s.breadth_current=v.length,s.breadth_direction=v.length>m.length?'wider':v.length<m.length?'narrower':'same',s.tags=s.tags.filter(e=>'Broader activity'!==e&&'Narrowing'!==e),'wider'===s.breadth_direction&&(s.tags=['Broader activity',...s.tags].slice(0,3)),'narrower'===s.breadth_direction&&(s.tags=['Narrowing',...s.tags].slice(0,3));const $=c(a);if(k.length&&!w.length){u('broadened',`${$} broadens into ${Math.min(...k)>Math.max(...m)?'higher':Math.max(...k)<Math.min(...m)?'lower':'more'} strikes`)}else w.length&&!k.length?u('concentrated',`${$} narrows to ${(t=>{const n=t.slice().sort((e,t)=>
1196e-t);return n.length?1===n.length?`${(0,e.strike)(n[0])} ${_}`:`${(0,e.strike)(n[0])}\u2013${(0,e.strike)(n[n.length-1])} ${_}`:''})(v)}`):null!=i.leading_strike&&null!=a.leading_strike&&i.leading_strike!==a.leading_strike?u('shifted',`Leading ${o(a).toLowerCase()} activity shifts from ${(0,e.strike)(i.leading_strike)} to ${(0,e.strike)(a.leading_strike)} ${_}`):i.weight>0&&a.weight>i.weight*t.PACE_UP?u('strengthened',`${$} strengthens ${a.location}`):i.weight>0&&a.weight<i.weight*t.PACE_DOWN?u('slowed',`${$} losing momentum ${a.location}`):u('held',`${$} holding ${a.location}`);return s}const M=[{heading:'What this pane is',lines:["The latest reading, and the states the session moved through before it. Every change is measured against the reading fifteen minutes before it (the session's first reading, until fifteen minutes have passed), and both ends of that interval are named.",'It describes what the option book DID. It is not a recommendation and it names no buyer or seller.']},{heading:'The state words',lines:["OPENING READ \u2014 the first reading of the session: where call and put open interest are concentrated near the money. There is no earlier reading, so nothing is said about change.","BUILDING \u2014 positions are being added on the side the reading is about. APPEARED \u2014 the behaviour was not there at the reading before. HELD \u2014 the same behaviour, continuing (the headline says holding).","STRENGTHENED \xb7 SLOWED \u2014 the same behaviour, moving faster or slower than the interval before (the headline says losing momentum).",'BROADENED \xb7 CONCENTRATED \u2014 more strikes joined, or the set narrowed.','SHIFTED \u2014 the strike carrying the largest change moved.','FADING \u2014 it stopped registering. REVERSING \u2014 positions are being closed rather than opened.',"BALANCED \u2014 no material change in market structure. MIXED \u2014 one side opening positions while the other closes them, at a comparable scale. Both sides adding positions is not MIXED: the headline names the larger side and the evidence names both.","NOT OBSERVED \u2014 the reading was taken but carried no comparable value. That is an absence of measurement, not a quiet market."]},{heading:'Persistence',lines:["\"Since 10:30\" appears once the same behaviour has held across more than one comparable reading. Until then there is no persistence to report, and none is shown.",'It is time between two stamps, never a score: readings at 09:30, 09:45 and 10:00 are THIRTY minutes.',"Early in the session each state is read from the latest fifteen minutes; persistence joins it once the behaviour has repeated."]},{heading:'The colours',lines:['GREEN \u2014 increasing, building, expanding.','RED \u2014 decreasing, weakening, contracting.','GREY \u2014 unchanged or stable.','AMBER \u2014 slowing, or evidence that conflicts or is missing.',{text:"No colour here is a view on direction. Rising call open interest is shown as an increase because it IS one \u2014 it is not painted as good news.",tone:'amber'}]},{heading:'The five metrics',lines:["PRICE is the premium of the single contract that moved most this interval \u2014 a real, tradeable instrument. Five strikes added together are not one, so their sum is never shown as a price.",'\u0394 OPEN INTEREST is the change across the five at-the-money contracts of the side carrying the reading.',"\u0394 IV is at-the-money volatility in POINTS. It is solved from premium and spot rather than reported by the exchange; where it could not be solved the box says so instead of showing a zero.",'\u0394 PCR is put open interest against call open interest, across the whole book.',"MAX PAIN is the listed strike at which the total intrinsic payout owed to option holders at expiry would be smallest, from the open interest at this reading. A flat bottom is a range of strikes, not a point. Context, not a target (nor a pin or a forecast), and the weakest of the five."]},{heading:'Evidence and conflict',lines:["A behaviour \u2014 writing, long build-up, covering \u2014 is an INTERPRETATION of open interest and premium read together. It is never shown without what contradicts it or fails to confirm it.",{text:"Open interest and premium cannot identify who initiated a trade: every contract opened has a buyer and a seller. The underlying\u2019s own move affects every premium, so a falling premium is not by itself evidence of anything.",tone
1196:'amber'}]},{heading:'Quiet periods',lines:["Consecutive readings in the same state are shown as ONE period with the number of readings it covers. Nothing is deleted \u2014 open the period, or use \"Show all readings\", to see each one.",'A quiet session is allowed to look quiet. The pane will not invent activity to fill itself.']}],N="These are levels at one reading. Open interest says where positions sit, not who opened them or why.";function O(t,n=3){const i=Array.isArray(t?.rows)?t.rows:[];if(!i.length)return null;const s=a(t?.spot),r=i.map(e=>a(e.strike)).filter(e=>null!=e),o=null!=s&&r.length?r.reduce((e,t)=>Math.abs(t-s)<Math.abs(e-s)?t:e,r[0]):null,c=a(t?.total_ce_oi),u=a(t?.total_pe_oi),h=(e,t)=>i.map(t=>({strike:a(t.strike),oi:a(t[e])})).filter(e=>null!=e.strike&&null!=e.oi&&e.oi>0).sort((e,t)=>t.oi-e.oi).slice(0,n).map(e=>({...e,share:t?l(e.oi/t*100,0):null,distance:null==s?null:l(e.strike-s,2)})),p=h('ce_oi',c),_=h('pe_oi',u);if(!p.length&&!_.length)return null;const b=e=>i.map(t=>({strike:a(t.strike),change:a(t[e])})).filter(e=>null!=e.strike&&null!=e.change&&e.change>0).sort((e,t)=>t.change-e.change).slice(0,1),m=b('ce_oi_change_day'),v=b('pe_oi_change_day'),f=c&&null!=u?l(u/c,2):null,k=a(t?.max_pain_strike),w=null!=k&&null!=s?l(k-s,2):null,$=e=>`${Math.abs(e).toLocaleString('en-IN',{maximumFractionDigits:2})} points`,y=(0,e.isIndexUnderlying)(t?.underlying),x=p[0],E=_[0],M=x&&E?`Call open interest is heaviest at ${(0,e.strike)(x.strike)} CE, put open interest at ${(0,e.strike)(E.strike)} PE`:x?`Call open interest is heaviest at ${(0,e.strike)(x.strike)} CE`:`Put open interest is heaviest at ${(0,e.strike)(E.strike)} PE`,O=[];if(null!=s&&x&&E){const t=x.strike>=s&&E.strike<=s;O.push(t?`Spot ${(0,e.level)(s,y,2,0)} sits between them: ${$(x.strike-s)} below the heaviest call strike and ${$(s-E.strike)} above the heaviest put strike.`:`Spot is ${(0,e.level)(s,y,2,0)}; the heaviest call strike is `+(x.strike>=s?`${$(x.strike-s)} above`:`${$(s-x.strike)} below`)+" it and the heaviest put strike "+(E.strike<=s?`${$(s-E.strike)} below`:`${$(E.strike-s)} above`)+" it.")}const I=[];if(null!=f&&I.push(`the put/call open-interest ratio is ${f.toFixed(2)} for this expiry`),null!=k&&I.push(`max pain is ${(0,e.strike)(k)}${null==w?'':0===w?', at spot':`, ${$(w)} ${w>0?'above':'below'} spot`}`),I.length&&O.push(I.join('; ').replace(/^./,e=>e.toUpperCase())+'.'),m.length||v.length){const t=[];m.length&&t.push(`call open interest was added most at ${(0,e.strike)(m[0].strike)} CE (+${(0,e.compact)(m[0].change)})`),v.length&&t.push(`put open interest at ${(0,e.strike)(v[0].strike)} PE (+${(0,e.compact)(v[0].change)})`),O.push(`Since the previous session's close, ${t.join(' and ')}.`)}const P=r.slice().sort((e,t)=>e-t),S=null==o?-1:P.indexOf(o),A=e=>{if(S<0)return[];const t='ce_oi'===e?P.slice(S,S+5):P.slice(Math.max(0,S-4),S+1);return i.filter(n=>t.indexOf(a(n.strike))>=0&&null!=a(n[e])&&a(n[e])>0).sort((t,n)=>a(n[e])-a(t[e])).slice(0,3).map(e=>a(e.strike)).sort((e,t)=>e-t)},C=A('ce_oi'),T=A('pe_oi'),D=(t,n)=>t.length?1===t.length?`${(0,e.strike)(t[0])} ${n}`:`${(0,e.strike)(t[0])}\u2013${(0,e.strike)(t[t.length-1])} ${n}`:'';return{opening:[C.length?`Calls concentrated around ${D(C,'CE')}`:'',T.length?`${C.length?'puts':'Puts'} around ${D(T,'PE')}`:''].filter(Boolean).join('; '),open_calls:C,open_puts:T,at:t?.as_of||null,expiry:t?.expiry||null,days_to_expiry:a(t?.days_to_expiry),spot:s,atm:o,is_index:y,calls:p,puts:_,total_ce_oi:c,total_pe_oi:u,pcr:f,max_pain:k,max_pain_distance:w,day_calls:m,day_puts:v,headline:M,lines:O,caveat:N}}},1103,[984,1104]); 1197__d(function(g,_r,_i,_a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DIRECTIONAL",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PACE_UP",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"PACE_DOWN",{enumerable:!0,get:function(){return s}}),e.behaviourOf=l,e.observe=function(o,c,h=t.SIGNAL_WINDOW_MINUTES,p=t.SIGNAL_WINDOW_MAX_MINUTES){const f=(o?.rows||[]).filter(t=>t&&t.present);if(!f.length)return[];const b=f.filter(t=>'puts'!==t.row),k=f.filter(t=>'puts'===t.row),v=Math.max(0,...f.map(t=>(t.points||[]).length));if(!v)return[];const _=Array.from({length:v},(t,n)=>f.map(t=>t.points?.[n]?.at).find(Boolean)||null),m=(0,t.readingMinutes)(c),$=null==m?v-1:_.reduce((n,i,r)=>{const s=(0,t.readingMinutes)(i);return null!=s&&s<=m?r:n},-1);if($<0)return[];const w={calls:{peak:0,pricePeak:0,ranked:0},puts:{peak:0,pricePeak:0,ranked:0}},S={calls:{peak:0,pricePeak:0,ranked:0},puts:{peak:0,pricePeak:0,ranked:0}},I={calls:null,puts:null},M={calls:null,puts:null},x=[];for(let y=0;y<=$;y++){const O=_[y],N=(0,t.signalBaselineIndex)(_,y,h,p),T=null==N?null:_[N],P=null==N?null:((0,t.readingMinutes)(O)??0)-((0,t.readingMinutes)(T)??0),E=[],C=(o,c,h,p)=>{const f={...p};let b=null,k=null;if(null!=N){const n=(0,t.signalSide)(o,y,N,c,f.peak,f.pricePeak,f.ranked);b=n?n.change:null,k=n?n.price_change:null}const v=null==b?f.peak:Math.max(f.peak,Math.abs(b)),_=null==k?f.pricePeak:Math.max(f.pricePeak,Math.abs(k)),m=f.ranked+(null==b?0:1),$=(0,t.signalSide)(o,y,N,c,v,_,m);p.peak=v,p.pricePeak=_,p.ranked=m;let w=0;const S=o.map(i=>{const r=null==N?null:(0,t.signalSide)([i],y,N,c,v,_,m);r&&(w+=1);const s=r?l(c,r.price_direction,r.oi_direction):'none';return{strike:a(i.strike),label:i.label||'',side:c,row:h,oi_change:r?r.change:null,price_change:r?r.price_change:null,oi_direction:r?r.oi_direction:t.NO_DIRECTION,price_direction:r?r.price_direction:t.NO_DIRECTION,what_label:r?r.what_label:'',meaning:r?r.meaning:'',behaviour:s,directional:n.indexOf(s)>=0}});E.push(...S);const x=u(S),T=S.filter(t=>t.directional&&t.behaviour===x.behaviour&&null!=t.strike),P=T.reduce((t,n)=>!t||Math.abs(a(n.oi_change)||0)>Math.abs(a(t.oi_change)||0)?n:t,null),C=T.reduce((t,n)=>t+Math.abs(a(n.oi_change)||0),0),j=M[h],A=j?x.strikes.filter(t=>
1197j.strikes.indexOf(t)<0):[],D=j?j.strikes.filter(t=>x.strikes.indexOf(t)<0):[],L=w>0;let R,F=I[h];if(null==N)R='no_baseline';else if(L)if('none'===x.behaviour)R=F?'faded':'quiet',F=null;else if(F&&F.behaviour===x.behaviour){const t=A.length>0&&0===D.length,n=D.length>0&&0===A.length,i=P&&null!=F.lead&&null!=P.strike&&P.strike!==F.lead;R=t?'broadened':n?'narrowed':i?'shifted':F.weight>0&&C>F.weight*r?'strengthened':F.weight>0&&C<F.weight*s?'slowed':'continued',F={behaviour:F.behaviour,first:F.first,last:O,scans:F.scans+1,strikes:x.strikes,lead:P?P.strike:F.lead,weight:C,leadStable:F.leadStable&&(!P||null==P.strike||P.strike===F.lead)}}else R=F&&i.indexOf(x.behaviour)>=0&&n.indexOf(F.behaviour)>=0&&i.indexOf(F.behaviour)<0?'unwound':'appeared',F={behaviour:x.behaviour,first:O,last:O,scans:1,strikes:x.strikes,lead:P?P.strike:null,weight:C,leadStable:!0};else R='not_observed';I[h]=F;const U=F?F.first:null,q=(0,t.readingMinutes)(U),W=(0,t.readingMinutes)(F?F.last:O),B=F&&null!=q&&null!=W?W-q:null,G={side:c,row:h,behaviour:x.behaviour,strikes:x.strikes,lead:P?P.strike:null,lead_oi_change:P?P.oi_change:null,lead_price_change:P?P.price_change:null,joined:A,left:D,weight:C,total:$,state:R,lead_stable:!!F&&F.leadStable,first_at:U,last_confirmed_at:F?F.last:null,elapsed_minutes:B,scans:F?F.scans:0,measured:w,slots:o.length};return M[h]=G,G},j=C(b,'CE','calls',w.calls),A=C(k,'PE','puts',w.puts),D=(0,t.intervalIndex)(_,y),L=(n,i,r)=>{if(null==D)return null;const s=(0,t.signalSide)(n,y,D,i,r.peak,r.pricePeak,r.ranked),a=s?s.change:null,l=s?s.price_change:null;return r.peak=null==a?r.peak:Math.max(r.peak,Math.abs(a)),r.pricePeak=null==l?r.pricePeak:Math.max(r.pricePeak,Math.abs(l)),r.ranked+=null==a?0:1,(0,t.signalSide)(n,y,D,i,r.peak,r.pricePeak,r.ranked)},R=L(b,'CE',S.calls),F=L(k,'PE',S.puts),U=(t,n,i)=>t?{side:n,row:i,behaviour:l(n,t.price_direction,t.oi_direction),strikes:[],lead:null,lead_oi_change:t.change,lead_price_change:t.price_change,joined:[],left:[],weight:Math.abs(a(t.change)||0),lead_stable:!1,total:t,state:'continued',first_at:null,last_confirmed_at:null,elapsed_minutes:null,scans:0,measured:t.contracts,slots:q(i)}:null;function q(t){return'puts'===t?k.length:b.length}const W=(n,i,r,s,l)=>{const o=a(n.strike),u=null==D?null:(0,t.signalSide)([n],y,D,i,s.peak,s.pricePeak,s.ranked),c=n.points?.[y],h=null==(c&&null!=c.delta_oi?a(c.delta_oi):null)?'not_captured':null==u?'no_change':'building'===u.oi_direction?'added':'unwinding'===u.oi_direction?'reduced':'no_change';return{strike:null==o?0:o,side:i,row:r,oi_added:u?u.change:null,price_change:u?u.price_change:null,oi_level:c&&null!=c.oi?a(c.oi):null,price_level:c&&null!=c.price?a(c.price):null,status:h,joined:null!=o&&l.joined.indexOf(o)>=0,since:null!=o&&l.strikes.indexOf(o)>=0?l.first_at:null}},B=[...b.map(t=>W(t,'CE','calls',S.calls,j)),...k.map(t=>W(t,'PE','puts',S.puts,A))].filter(t=>t.strike>0);x.push({at:O,from:T,window_minutes:P,previous_at:null==D?null:_[D],covered:j.measured>0||A.measured>0,calls:j,puts:A,calls_interval:U(R,'CE','calls'),puts_interval:U(F,'PE','puts'),strikes:E,ladder:B,rule_version:t.SIGNAL_RULE_VERSION})}return x},e.whereText=c,e.minutesText=f,Object.defineProperty(e,"CAVEAT",{enumerable:!0,get:function(){return m}}),e.narrate=function(n,r={}){if(!n)return null;const s={headline:'',window:'',observed:'',qualified:'',session:'',otherSide:'',context:'',cross:[],evidence:[],caveat:m,cited:[],ladder:n.ladder||[],limited:!0},a=n.calls.weight>=n.puts.weight?n.calls:n.puts,l=a===n.calls?n.puts:n.calls,u=h[a.row],p=r.ladder&&r.ladder.length?r.ladder:o(n.strikes.filter(t=>t.row===a.row).map(t=>t.strike)),M=$(n);if('no_baseline'===a.state)return{...s,window:M,headline:_.no_baseline('',0,!1),observed:`This session does not yet hold a reading ${t.SIGNAL_WINDOW_MINUTES} minutes before ${(0,t.clock)(n.at)} IST, so no change can be measured at ${r.underlying||'this instrument'}.`,evidence:[w(n)],context:`Reading ${(0,t.clock)(n.at)} IST \xb7 no comparison available`};if('not_observed'===a.state)return{...s,window:M,headline:_.not_observed('',0,!1),observed:`The ${(0,t.clock)(n.at)} IST reading was taken, but none of the ten contracts carried a value that could be compared, so nothing is claimed for this interval.`,session:a.first_at?`Last confirmed ${(0,t.clock)(a.first_at)}\u2013${(0,t.clock)(a.last_confirmed_at||a.first_at)} IST. An interval nobody observed is not counted as time the earlier activity continued.`:'',evidence:[S(n),w(n)],context:`Reading ${(0,t.clock)(n.at)} IST \xb7 not observed`};
1197if('none'===a.behaviour&&'none'===l.behaviour){const i='faded'===a.state;return{...s,limited:!1,window:M,headline:i?_.faded(u,0,!1):_.quiet('',0,!1),observed:i?`No strike moved open interest and premium together between ${(0,t.clock)(n.previous_at)} and ${(0,t.clock)(n.at)} IST. The outstanding open interest from earlier is still standing; that is a total, not evidence that the same positions are still held.`:`No strike changed materially between ${(0,t.clock)(n.previous_at)} and ${(0,t.clock)(n.at)} IST. The outstanding open interest is unchanged, which is a total rather than a statement about whose positions remain.`,cross:r.cross||[],evidence:[S(n),w(n)],context:`${M} \xb7 little fresh change`}}const x='broadened'===a.state?a.joined.length:'narrowed'===a.state?a.strikes.length:0,y=i.indexOf(a.behaviour)>=0,O=(_[a.state]||_.continued)(u,x,y),N=c(a.strikes,a.side,p),T='buying'===a.behaviour||'short_covering'===a.behaviour,P=i.indexOf(a.behaviour)>=0?'fell':'rose',E=[`Open interest ${P} and premium ${T?'rose':'fell'} ${N}, measured against the ${(0,t.clock)(n.previous_at||n.from)} IST reading.`];'broadened'===a.state&&a.joined.length?E.push(`${a.joined.map(n=>(0,t.strike)(n)).join(' and ')} ${a.side} `+(1===a.joined.length?'is new':'are new')+" this interval."):'narrowed'===a.state&&a.left.length?E.push(`${a.left.map(n=>(0,t.strike)(n)).join(' and ')} ${a.side} stopped changing this interval.`):'shifted'===a.state&&E.push(`${(0,t.strike)(a.lead)} ${a.side} now carries the largest change.`);const C=E.join(' '),j=I(a.behaviour,a.row,r.spot||null),A=f(a.elapsed_minutes),D=`${u} positions began changing at ${(0,t.clock)(a.first_at)} IST`,L=null==a.lead?'':a.lead_stable?` ${(0,t.strike)(a.lead)} ${a.side} has carried the largest change at every reading since.`:` ${(0,t.strike)(a.lead)} ${a.side} carries the largest change at this reading; the leading strike has changed during the episode.`,R=`${D}${A?`, ${A} ago`:''}.${L}`,F='none'===l.behaviour?`${h[l.row]} strikes did not change materially this interval.`:`${h[l.row]} strikes separately show open interest `+(i.indexOf(l.behaviour)>=0?'falling':'rising')+" "+`${c(l.strikes,l.side,o(n.strikes.filter(t=>t.row===l.row).map(t=>t.strike)))}.`,U=[`First seen ${(0,t.clock)(a.first_at)} IST`];A?U.push(`${A} so far`):U.push('first reading of this episode');null!=a.lead&&U.push(`${(0,t.strike)(a.lead)} ${a.side} largest`);const q=[w(n),...a.strikes.map(i=>{const r=n.strikes.find(t=>t.strike===i&&t.row===a.row);return r?`${(0,t.strike)(i)} ${a.side}: open interest ${k(r.oi_change)}, premium ${b(r.price_change)} over the episode window. The \u0394OI tile labels this \u201c${r.what_label}\u201d.`:''}).filter(Boolean),r.spot&&null!=r.spot.change?`Spot moved ${r.spot.change>0?'+':t.MINUS}${v(r.spot.change)} over the same interval.`:'The underlying\u2019s own move over this interval was not captured.',S(n),`Strike behaviour is read from the ten at-the-money contracts the \u0394OI tiles draw, under rule ${n.rule_version}.`];return{headline:O,window:M,observed:C,qualified:j,session:R,otherSide:F,context:U.join(' \xb7 '),cross:r.cross||[],evidence:q,caveat:m,cited:a.strikes.slice(),ladder:n.ladder||[],limited:!1}},e.phrases=function(t){return t?[t.observed,t.qualified,t.otherSide,t.session].filter(Boolean).flatMap(t=>String(t).split(/(?<=\.)\s+/).map(t=>t.trim()).filter(Boolean)):[]},e.spotMove=function(t,n){const{now:i,prev:r}=M(t,n),s=i?a(i.spot):null,l=r?a(r.spot):null;return null==i?null:{at:String(i.at||''),from:r?String(r.at||''):null,spot:s,change:null==s||null==l?null:Math.round(100*(s-l))/100}},e.crossMarket=function(t){const n=[];if(t.puts){const r=t.puts;n.push({label:'Puts',text:'none'===r.behaviour?'Little change at the put strikes this interval.':`Open interest ${i.indexOf(r.behaviour)>=0?'fell':'rose'} at ${r.strikes.length} put strike${1===r.strikes.length?'':'s'} this interval.`})}const r=M(t.pcr,t.upto);if(r.now&&r.prev){const t=a(r.now.pcr_oi),i=a(r.prev.pcr_oi),s=a(r.now.total_ce_oi),l=a(r.prev.total_ce_oi),o=a(r.
1197now.total_pe_oi),u=a(r.prev.total_pe_oi);if(null!=t&&null!=i){const r=t>i?'rose':t<i?'fell':'was unchanged';let a='';if(null!=s&&null!=l&&null!=o&&null!=u){const t=s-l,n=o-u;a=Math.abs(t)>Math.abs(n)?` \u2014 driven by call open interest ${t>=0?'rising':'falling'}, not the put side.`:` \u2014 driven by put open interest ${n>=0?'rising':'falling'}.`}n.push({label:'PCR',text:`${t.toFixed(2)}, ${r} from ${i.toFixed(2)}${a}`})}}const s=M(t.futures,t.upto);if(s.now){const t=a(s.now.oi),i=s.prev?a(s.prev.oi):null,r=a(s.now.basis),l=s.prev?a(s.prev.basis):null,o=[];null!=t&&null!=i&&o.push("open interest "+(t>i?'rose':t<i?'fell':'was flat')),null!=r&&null!=l&&o.push("basis "+(Math.abs(r)>Math.abs(l)?'widened':Math.abs(r)<Math.abs(l)?'narrowed':'held')),o.length&&n.push({label:'Futures',text:`Front contract ${o.join(' and ')} this interval.`})}return n};var t=_r(d[0]);const n=['buying','writing','short_covering','buyers_exiting'],i=['short_covering','buyers_exiting'],r=1.25,s=.75,a=t=>{if(null==t||''===t)return null;const n='number'==typeof t?t:Number(t);return Number.isFinite(n)?n:null};function l(n,i,r){const s=String(i||''),a=String(r||'');return s!==t.NO_DIRECTION&&a!==t.NO_DIRECTION&&s&&a?'building'===a?'up'===s?'buying':'down'===s?'writing':'positions_added':'unwinding'===a?'up'===s?'short_covering':'down'===s?'buyers_exiting':'positions_closing':'flat'===s?'quiet':'price_only':'none'}const o=t=>Array.from(new Set(t.filter(t=>null!=t))).sort((t,n)=>t-n);function u(t){const n=new Map;for(const i of t){if(!i.directional)continue;const t=n.get(i.behaviour)||{n:0,weight:0,strikes:[]};t.n+=1,t.weight+=Math.abs(a(i.oi_change)||0),t.strikes.push(i.strike),n.set(i.behaviour,t)}if(!n.size)return{behaviour:'none',strikes:[]};const i=[...n.entries()].sort((t,n)=>n[1].n-t[1].n||n[1].weight-t[1].weight);return i.length>1&&i[0][1].n===i[1][1].n&&i[0][1].weight===i[1][1].weight?{behaviour:'none',strikes:[]}:{behaviour:i[0][0],strikes:o(i[0][1].strikes)}}function c(n,i,r=[]){const s=o(n);if(!s.length)return'';if(1===s.length)return`at ${(0,t.strike)(s[0])} ${i}`;const a=o(r.length?r:s),l=a.indexOf(s[0]),u=a.indexOf(s[s.length-1]);if(l>=0&&u>=0&&u-l===s.length-1)return`across ${(0,t.strike)(s[0])}\u2013${(0,t.strike)(s[s.length-1])} ${i}`;return`at ${s.slice(0,-1).map(n=>(0,t.strike)(n)).join(', ')} and ${(0,t.strike)(s[s.length-1])} ${i}`}const h={calls:'Call',puts:'Put'},p={buying:'long build-up',writing:'writing',short_covering:'short covering',buyers_exiting:'buyers closing out',positions_added:'positions added',positions_closing:'positions closed',price_only:'a premium move',quiet:'little change',none:'no clear behaviour'};function f(t){if(null==t||t<=0)return'';if(t<60)return`${t} minutes`;const n=Math.floor(t/60),i=t%60;return`${n} hour${1===n?'':'s'}${i?` ${i} minutes`:''}`}const b=n=>{const i=a(n);return null==i?t.DASH:`${i>0?'+':i<0?t.MINUS:''}${t.RUPEE}${Math.abs(i).toLocaleString('en-IN',{minimumFractionDigits:2,maximumFractionDigits:2})}`},k=n=>{const i=a(n);return null==i?t.DASH:`${i>0?'+':i<0?t.MINUS:''}${(0,t.compact)(Math.abs(i))}`},v=n=>{const i=a(n);return null==i?t.DASH:`${Math.abs(i).toLocaleString('en-IN',{maximumFractionDigits:0})} points`},_={appeared:(t,n,i)=>`${t} positions begin ${i?'reducing':'building'}`,continued:(t,n,i)=>`${t} positions keep ${i?'reducing':'building'} at the same strikes`,strengthened:(t,n,i)=>`${t} position ${i?'reduction':'building'} picks up`,slowed:(t,n,i)=>`${t} position ${i?'reduction':'building'} slows`,broadened:(t,n,i)=>`${t} positions ${i?'reduce':'build'} at ${1===n?'another strike':`${n} more strikes`}`,narrowed:(t,n,i)=>`${t} position ${i?'reduction':'building'} narrows to ${1===n?'one strike':`${n} strikes`}`,shifted:t=>`The largest ${t.toLowerCase()} change moves to another strike`,unwound:t=>`Earlier ${t.toLowerCase()} positions are being reduced`,faded:t=>`No further ${t.toLowerCase()} position change this interval`,quiet:()=>'No material change at this reading',not_observed:()=>'This reading carried no comparable value',no_baseline:()=>'Not enough readings yet to compare'},m="Position and premium changes are observations. Naming a behaviour such as writing or long build-up is an interpretation of them, not a measurement: every contract opened has a buyer and a seller, the underlying\u2019s own move affects every premium, and nothing here is a forecast or a trade instruction.";function $(n){return n.previous_at?`${(0,t.clock)(n.previous_at)} \u2192 ${(0,t.clock)(n.at)} IST`:`${(0,t.clock)(n.at)} IST`}function w(n){return(n.previous_at?`Interval ${(0,t.clock)(n.previous_at)} \u2192 ${(0,t.clock)(n.at)} IST.`:`Reading ${(0,t.clock)(n.at)} IST has no reading before it.`)+(n.from?` Episode measured against ${(0,t.clock)(n.from)} IST, ${n.window_minutes} minutes back (rule ${n.rule_version}).`:'')}function S(t){return`Measured at this reading \u2014 calls ${t.calls.measured} of ${t.calls.slots} contracts, puts ${t.puts.measured} of ${t.puts.slots}.`}function I(t,i,r){if(n.indexOf(t)<0)return'';const s=p[t];if(!r||null==r.change)return`Consistent with ${'puts'===i?'put':'call'} ${s}, though the underlying\u2019s own move over this interval was not captured, so the premium change cannot be separated from it.`;const a=r.change>0?'rose':r.change<0?'fell':'was unchanged';return 0===r.change?`Consistent with ${'puts'===i?'put':'call'} ${s}; spot was unchanged over the interval, so the premium move is not explained by the underlying.`:`Consistent with ${'puts'===i?'put':'call'} ${s}, though spot also ${a} ${v(r.change)} over the same interval, which may explain some of the premium change.`}const M=(n,i)=>{const r=(n||[]).filter(t=>t&&t.at),s=(0,t.readingMinutes)(i),a=null==s?r:r.filter(n=>{const i=(0,t.readingMinutes)(String(n.at));return null!=i&&i<=s});return{now:a[a.length-1]||null,prev:a[a.length-2]||null}}},1104,[984]); 1198__d(function(g,r,_i,a,m,_e,d){"use strict";
1198function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SIGNAL_W",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"SIGNAL_EMPTY",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"SIGNAL_NO_SYMBOL",{enumerable:!0,get:function(){return f}}),_e.SignalTable=function({symbol:e,read:h,style:_,onExpand:T,expanded:p}){const S=h.data,j=e?(0,s.stateOf)(h,S?.not_enough_marks||u):{phase:'empty',text:f},w=(0,t.useMemo)(()=>(0,o.signalRows)(S?.rows),[S]),C=[{heading:'What this table is',lines:[{text:o.SIGNAL_CAVEAT_TEXT,tone:'amber'},o.SIGNAL_RULE_TEXT]},{heading:'Which contracts',lines:[o.SIGNAL_AGGREGATE_TEXT,o.SIGNAL_BASKET_TEXT]},{heading:'How strong is strong',lines:[o.SIGNAL_STRENGTH_TEXT]},{heading:'The vocabulary',lines:[S?.flow_text||'',o.GRID_LEGEND_TEXT]}];return(0,c.jsx)(s.WidgetFrame,{name:"Signal by reading",subtitle:e?`${e} \xb7 the same ten at-the-money contracts the \u0394OI tiles draw`:'',body:S,state:j,onRefresh:h.reload,onExpand:T,expanded:p,inBlock:!0,toolbar:(0,c.jsx)(i.default,{style:[l.s.row,{justifyContent:'flex-end'}],children:(0,c.jsx)(s.InfoDisclosure,{title:"Signal by reading",groups:C})}),emptyDetail:"Each row needs two readings of these contracts before either side has anything to compare against.",style:_,children:(0,c.jsxs)(i.default,{style:{flex:1,minHeight:0},children:[(0,c.jsxs)(i.default,{style:[l.s.row,{gap:6,paddingHorizontal:10,paddingVertical:4,borderBottomWidth:1,borderColor:l.C.line}],children:[(0,c.jsx)(l.T,{style:[s.head,{width:y.time}],children:"Time"}),(0,c.jsx)(l.T,{style:[s.head,{width:y.side}],children:"Call activity"}),(0,c.jsx)(l.T,{style:[s.head,{width:y.side}],children:"Put activity"}),(0,c.jsx)(l.T,{style:[s.head,{width:y.read,flex:1}],children:"Open interest"}),(0,c.jsx)(l.T,{style:[s.head,{width:y.premium}],children:"Premiums"})]}),(0,c.jsx)(n.default,{style:{flex:1},contentContainerStyle:{paddingBottom:6},children:w.map((e,t)=>(0,c.jsxs)(i.default,{accessibilityRole:"text",accessibilityLabel:`${(0,o.clock)(e.at)}. ${e.reason?e.reason:`Compared with the ${(0,o.clock)(e.from)} reading, ${e.window_minutes} minutes back. Calls ${e.calls?.text||o.SIGNAL_NO_BASELINE}, ${e.calls?.what_label||''}. Puts ${e.puts?.text||o.SIGNAL_NO_BASELINE}, ${e.puts?.what_label||''}. ${e.interpretation}. ${e.label}.`}`,style:[l.s.row,{gap:6,paddingHorizontal:10,paddingVertical:5,borderBottomWidth:1,borderColor:'#0F1B22',alignItems:'flex-start'}],children:[(0,c.jsx)(l.T,{style:{width:y.time,fontSize:10,lineHeight:14,color:l.C.muted,fontVariant:['tabular-nums']},children:(0,o.clock)(e.at)}),!e.reason||e.calls||e.puts?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(b,{side:e.calls}),(0,c.jsx)(b,{side:e.puts}),(0,c.jsx)(l.T,{numberOfLines:2,style:{width:y.read,flex:1,fontSize:9,lineHeight:13,color:l.C.muted},children:e.interpretation||o.DASH}),(0,c.jsx)(i.default,{style:{width:y.premium},children:(0,c.jsx)(l.T,{numberOfLines:2,style:{fontSize:10,lineHeight:14,fontFamily:'InterMedium',color:x[e.signal]||l.C.muted},children:e.label})})]}):(0,c.jsx)(l.T,{style:{flex:1,fontSize:9,lineHeight:13,color:l.C.muted},children:e.reason})]},`${t}-${e.at||''}`))}),(0,c.jsx)(i.default,{style:{paddingHorizontal:10,paddingVertical:4,borderTopWidth:1,borderColor:l.C.line},children:(0,c.jsxs)(l.T,{style:s.metaText,children:[w.length," reading",1===w.length?'':'s'," of these ten contracts, each read",' ',"against the reading ",o.SIGNAL_WINDOW_MINUTES," minutes before it. Rule ",o.SIGNAL_RULE_VERSION,".",' ',(0,o.asOfText)(S?.as_of),"."]})})]})})};var t=r(d[0]),i=e(r(d[1])),n=e(r(d[2])),l=r(d[3]),s=r(d[4]),o=r(d[5]),c=r(d[6]);const h=556,u='No reading of these ten contracts has been captured yet.',f='Click a row on the screener to read the ten at-the-money contracts of that instrument.',x={strong_bullish:l.C.ink,bullish:l.C.ink,neutral:l.C.ink,flat:l.C.muted,bearish:l.C.ink,strong_bearish:l.C.ink},y={time:48,side:100,read:140,premium:110};function b({side:e}){if(!e)return(0,c.jsx)(i.default,{style:{width:y.side},children:(0,c.jsx)(l.T,{style:{fontSize:9,lineHeight:13,color:l.C.muted},children:o.SIGNAL_NO_BASELINE})});const t='building'===e.oi_direction?l.C.green:'unwinding'===e.oi_direction?l.C.red:l.C.muted;return(0,c.jsxs)(i.default,{style:{width:y.side,gap:1},children:[(0,c.jsx)(l.T,{numberOfLines:1,style:{fontSize:10,lineHeight:14,fontFamily:'InterSemi',color:t},children:e.text}),(0,c.jsx)(l.T,{numberOfLines:2,style:{fontSize:9,lineHeight:12,color:l.C.muted},children:e.what_label})]})}},1105,[11,13,278,821,1074,984,6]); 1199__d(function(_g,_r,_i,_a,m,e,_d){"use strict";
1199Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"WEIGHT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"MIN_W",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"ROW",{enumerable:!0,get:function(){return o}}),e.partition=s,e.capacity=l,e.layout=function(n,r){const i=r.gap??12;if(r.phone)return n.map(t=>({items:[{id:t.id,size:t.size,weight:1,min:0}],height:t.tall||'L'===t.size||'F'===t.size?o.phoneTall:o.phone}));const u=l(r.width,i,r.columns),c=[];let f=[];for(const t of n)'F'===t.size?(c.push(...s(f,r.width,i,u)),f=[],c.push([t])):f.push(t);c.push(...s(f,r.width,i,u));const h=c.length,p=h?Math.floor((r.viewport-i*(h-1))/h):0,M=h>0&&p>=o.min;return c.map(n=>{const r=n.some(t=>t.tall);return{height:M?Math.min(o.max,Math.max(p,o.min)):r?o.tall:o.standard,items:n.map(r=>({id:r.id,size:r.size,weight:1===n.length?1:a(r.size),min:1===n.length?0:t(r)}))}})},e.snapPair=function(t,r){const o=t/Math.max(1,t+r);let a=['M','M'],s=1/0;for(const t of i)for(const r of i){const i=n[t]/(n[t]+n[r]),l=Math.abs(i-o)+(t===r&&'M'!==t?.001:0);l<s&&(s=l,a=[t,r])}return a};const t=t=>Math.max(r[t.size],t.min||0),n={S:1,M:2,L:3},r={S:250,M:300,L:400,F:400},o={min:320,standard:440,tall:520,max:760,phone:420,phoneTall:560},i=['S','M','L'];function a(t){return'F'===t?1:n[t]}function s(n,r,o,i){const s=n.length;if(!s)return[];const l=(a,s)=>{const l=s-a;if(l>i)return!1;let u=0;for(let r=a;r<s;r++)u+=t(n[r]);return u+o*(l-1)<=r||1===l},u=n.map(t=>a(t.size)),c=[0];for(const t of u)c.push(c[c.length-1]+t);const f=c[s];for(let t=1;t<=s;t++){const r=f/t,o=Number.POSITIVE_INFINITY,i=Array.from({length:t+1},()=>Array(s+1).fill(o)),a=Array.from({length:t+1},()=>Array(s+1).fill(-1));i[0][0]=0;for(let n=1;n<=t;n++)for(let t=n;t<=s;t++)for(let s=n-1;s<t;s++){if(i[n-1][s]===o||!l(s,t))continue;const u=c[t]-c[s]-r,f=i[n-1][s]+u*u-1e-6*(t-s);f<i[n][t]&&(i[n][t]=f,a[n][t]=s)}if(i[t][s]===o)continue;const u=[];let h=s;for(let r=t;r>=1;r--){const t=a[r][h];u.unshift(n.slice(t,h)),h=t}return u}return n.map(t=>[t])}function l(t,n,o){const i=Math.max(1,Math.floor((t+n)/(r.S+n)));return o&&'auto'!==o?Math.max(1,Math.min(o,i)):Math.min(i,4)}},1106,[]); 1200__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,o,c){void 0===c&&(c=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,c,u)}:function(t,n,o,c){void 0===c&&(c=o),t[c]=n[o]}),n=this&&this.__exportStar||function(n,o){for(var c in n)"default"===c||Object.prototype.hasOwnProperty.call(o,c)||t(o,n,c)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(d[0]),e)},1107,[1108]); 1201__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Head=void 0;const n=r(d[0]),c=r(d[1]),l=r(d[2]);function t({children:l}){return(0,n.jsx)(c.Helmet,{children:l})}e.Head=({children:c})=>(0,l.useIsFocused)()?(0,n.jsx)(t,{children:c}):null,e.Head.Provider=c.HelmetProvider},1108,[6,1109,794]); 1202__d(function(g,r,_i,a,m,e,d){"use strict";var t,n=Object.create,s=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,p=(t,n,l,p)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of o(n))c.call(t,u)||u===l||s(t,u,{get:()=>n[u],enumerable:!(p=i(n,u))||p.enumerable});return t},u=(t,i,o)=>(o=null!=t?n(l(t)):{},p(!i&&t&&t.__esModule?o:s(o,"default",{value:t,enumerable:!0}),t)),h={};((t,n)=>{for(var i in n)s(t,i,{get:n[i],enumerable:!0})})(h,{Helmet:()=>ge,HelmetData:()=>ie,HelmetProvider:()=>ae}),m.exports=(t=h,p(s({},"__esModule",{value:!0}),t));var y=u(r(d[0])),f=u(r(d[1])),b=u(r(d[2])),T=u(r(d[0])),A=u(r(d[0])),O=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(O||{}),C={rel:["amphtml","canonical","alternate"]},w={type:["application/ld+json"]}
1202,x={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},$=Object.values(O),v={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},k=Object.entries(v).reduce((t,[n,s])=>(t[s]=n,t),{}),j="data-rh",S="defaultTitle",M="defer",E="encodeSpecialCharacters",P="onChangeClientState",H="titleTemplate",D="prioritizeSeoTags",L=(t,n)=>{for(let s=t.length-1;s>=0;s-=1){const i=t[s];if(Object.prototype.hasOwnProperty.call(i,n))return i[n]}return null},I=t=>{let n=L(t,"title");const s=L(t,H);if(Array.isArray(n)&&(n=n.join("")),s&&n)return s.replace(/%s/g,()=>n);const i=L(t,S);return n||i||void 0},U=t=>L(t,P)||(()=>{}),N=(t,n)=>n.filter(n=>void 0!==n[t]).map(n=>n[t]).reduce((t,n)=>({...t,...n}),{}),q=(t,n)=>n.filter(t=>void 0!==t.base).map(t=>t.base).reverse().reduce((n,s)=>{if(!n.length){const i=Object.keys(s);for(let o=0;o<i.length;o+=1){const l=i[o].toLowerCase();if(-1!==t.indexOf(l)&&s[l])return n.concat(s)}}return n},[]),_=(t,n,s)=>{const i={};return s.filter(n=>{return!!Array.isArray(n[t])||(void 0!==n[t]&&(s=`Helmet: ${t} should be of type "Array". Instead found type "${typeof n[t]}"`,console&&"function"==typeof console.warn&&console.warn(s)),!1);var s}).map(n=>n[t]).reverse().reduce((t,s)=>{const o={};s.filter(t=>{let s;const l=Object.keys(t);for(let i=0;i<l.length;i+=1){const o=l[i],c=o.toLowerCase();-1===n.indexOf(c)||"rel"===s&&"canonical"===t[s].toLowerCase()||"rel"===c&&"stylesheet"===t[c].toLowerCase()||(s=c),-1===n.indexOf(o)||"innerHTML"!==o&&"cssText"!==o&&"itemprop"!==o||(s=o)}if(!s||!t[s])return!1;const c=t[s].toLowerCase();return i[s]||(i[s]={}),o[s]||(o[s]={}),!i[s][c]&&(o[s][c]=!0,!0)}).reverse().forEach(n=>t.push(n));const l=Object.keys(o);for(let t=0;t<l.length;t+=1){const n=l[t],s={...i[n],...o[n]};i[n]=s}return t},[]).reverse()},R=(t,n)=>{if(Array.isArray(t)&&t.length)for(let s=0;s<t.length;s+=1){if(t[s][n])return!0}return!1},z=t=>Array.isArray(t)?t.join(""):t,B=(t,n)=>{const s=Object.keys(t);for(let i=0;i<s.length;i+=1)if(n[s[i]]&&n[s[i]].includes(t[s[i]]))return!0;return!1},F=(t,n)=>Array.isArray(t)?t.reduce((t,s)=>(B(s,n)?t.priority.push(s):t.default.push(s),t),{priority:[],default:[]}):{default:t,priority:[]},Y=(t,n)=>({...t,[n]:void 0}),K=["noscript","script","style"],G=(t,n=!0)=>!1===n?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),W=t=>Object.keys(t).reduce((n,s)=>{const i=void 0!==t[s]?`${s}="${G(t[s])}"`:`${s}`;return n?`${n} ${i}`:i},""),J=(t,n,s,i)=>{const o=W(s),l=z(n);return o?`<${t} ${j}="true" ${o}>${G(l,i)}</${t}>`:`<${t} ${j}="true">${G(l,i)}</${t}>`},Q=(t,n,s=!0)=>n.reduce((n,i)=>{const o=i,l=Object.keys(o).filter(t=>!("innerHTML"===t||"cssText"===t)).reduce((t,n)=>{const i=void 0===o[n]?n:`${n}="${G(o[n],s)}"`;return t?`${t} ${i}`:i},""),c=o.innerHTML||o.cssText||"",p=-1===K.indexOf(t);return`${n}<${t} ${j}="true" ${l}${p?"/>":`>${c}</${t}>`}`},""),V=(t,n={})=>Object.keys(t).reduce((n,s)=>(n[v[s]||s]=t[s],n),n),X=(t,n,s)=>{const i=V(s,{key:n,[j]:!0});return[A.default.createElement("title",i,n)]},Z=(t,n)=>n.map((n,s)=>{const i={key:s,[j]:!0};return Object.keys(n).forEach(t=>{const s=v[t]||t;if("innerHTML"===s||"cssText"===s){const t=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:t}}else i[s]=n[t]}),A.default.createElement(t,i)}),ee=(t,n,s=!0)=>{switch(t){case"title":return{toComponent:()=>X(0,n.title,n.titleAttributes),toString:()=>J(t,n.title,n.titleAttributes,s)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>V(n),toString:()=>W(n)};default:return{toComponent:()=>Z(t,n),toString:()=>Q(t,n,s)}}},te=({metaTags:t,linkTags:n,scriptTags:s,encode:i})=>{const o=F(t,x),l=F(n,C),c=F(s,w);return{priorityMethods:{toComponent:()=>[...Z("meta",o.priority),...Z("link",l.priority),...Z("script",c.priority)],toString:()=>`${ee("meta",o.priority,i)} ${ee("link",l.priority,i)} ${ee("script",c.priority,i)}`},metaTags:o.default,linkTags:l.default,scriptTags:c.default}},re=t=>{const{baseTag:n,bodyAttributes:s,encode:i=!0,htmlAttributes:o,noscriptTags:l,styleTags:c,title:p="",titleAttributes:u,prioritizeSeoTags:h}=t;let{linkTags:y,metaTags:f,scriptTags:b}=t,T={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:T,linkTags:y,metaTags:f,scriptTags:b}=te(t)),{priority:T,base:ee("base",n,i),bodyAttributes:ee("bodyAttributes",s,i),htmlAttributes:ee("htmlAttributes",o,i),link:ee("link",y,i),meta:ee("meta",f,i),noscript:ee("noscript",l,i),script:ee("script",b,i),style:ee("style",c,i),title:ee("title",{title:p,titleAttributes:u},i)}},ne=[],se=!("undefined"==typeof window||!window.document||!window.document.createElement),ie=class{instances=[];canUseDOM=se;value={setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?ne:this.instances,add:t=>{(this.canUseDOM?ne:this.instances).push(t)},remove:t=>{const n=(this.canUseDOM?ne:this.instances).indexOf(t);(this.canUseDOM?ne:this.instances).splice(n,1)}}};constructor(t,n){this.context=t,this.canUseDOM=n||!1,n||(t.helmet=re({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},oe=T.default.createContext({}),ae=class t extends T.Component{static canUseDOM=se;constructor(n){super(n),this.helmetData=new ie(this.props.context||{},t.canUseDOM)}render(){return T.default.createElement(oe.Provider,{value:this.helmetData.value},this.props.children)}},le=r(d[0]),ce=u(r(d[3])),pe=(t,n)=>{const s=document.head||document.querySelector("head"),i=s.querySelectorAll(`${t}[${j}]`),o=[].slice.call(i),l=[];let c;
1202return n&&n.length&&n.forEach(n=>{const s=document.createElement(t);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))if("innerHTML"===t)s.innerHTML=n.innerHTML;else if("cssText"===t)s.styleSheet?s.styleSheet.cssText=n.cssText:s.appendChild(document.createTextNode(n.cssText));else{const i=t,o=void 0===n[i]?"":n[i];s.setAttribute(t,o)}s.setAttribute(j,"true"),o.some((t,n)=>(c=n,s.isEqualNode(t)))?o.splice(c,1):l.push(s)}),o.forEach(t=>t.parentNode?.removeChild(t)),l.forEach(t=>s.appendChild(t)),{oldTags:o,newTags:l}},ue=(t,n)=>{const s=document.getElementsByTagName(t)[0];if(!s)return;const i=s.getAttribute(j),o=i?i.split(","):[],l=[...o],c=Object.keys(n);for(const t of c){const i=n[t]||"";s.getAttribute(t)!==i&&s.setAttribute(t,i),-1===o.indexOf(t)&&o.push(t);const c=l.indexOf(t);-1!==c&&l.splice(c,1)}for(let t=l.length-1;t>=0;t-=1)s.removeAttribute(l[t]);o.length===l.length?s.removeAttribute(j):s.getAttribute(j)!==c.join(",")&&s.setAttribute(j,c.join(","))},de=(t,n)=>{void 0!==t&&document.title!==t&&(document.title=z(t)),ue("title",n)},he=(t,n)=>{const{baseTag:s,bodyAttributes:i,htmlAttributes:o,linkTags:l,metaTags:c,noscriptTags:p,onChangeClientState:u,scriptTags:h,styleTags:y,title:f,titleAttributes:b}=t;ue("body",i),ue("html",o),de(f,b);const T={baseTag:pe("base",s),linkTags:pe("link",l),metaTags:pe("meta",c),noscriptTags:pe("noscript",p),scriptTags:pe("script",h),styleTags:pe("style",y)},A={},O={};Object.keys(T).forEach(t=>{const{newTags:n,oldTags:s}=T[t];n.length&&(A[t]=n),s.length&&(O[t]=T[t].oldTags)}),n&&n(),u(t,A,O)},me=null,ye=t=>{me&&cancelAnimationFrame(me),t.defer?me=requestAnimationFrame(()=>{he(t,()=>{me=null})}):(he(t),me=null)},fe=class extends le.Component{rendered=!1;shouldComponentUpdate(t){return!(0,ce.default)(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let s=null;const i=(o=t.get().map(t=>{const n={...t.props};return delete n.context,n}),{baseTag:q(["href"],o),bodyAttributes:N("bodyAttributes",o),defer:L(o,M),encode:L(o,E),htmlAttributes:N("htmlAttributes",o),linkTags:_("link",["rel","href"],o),metaTags:_("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:_("noscript",["innerHTML"],o),onChangeClientState:U(o),scriptTags:_("script",["src","innerHTML"],o),styleTags:_("style",["cssText"],o),title:I(o),titleAttributes:N("titleAttributes",o),prioritizeSeoTags:R(o,D)});var o;ae.canUseDOM?ye(i):re&&(s=re(i)),n(s)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},ge=class extends y.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(t){return!(0,f.default)(Y(this.props,"helmetData"),Y(t,"helmetData"))}mapNestedChildrenToProps(t,n){if(!n)return null;switch(t.type){case"script":case"noscript":return{innerHTML:n};case"style":return{cssText:n};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,n,s,i){return{...n,[t.type]:[...n[t.type]||[],{...s,...this.mapNestedChildrenToProps(t,i)}]}}mapObjectTypeChildren(t,n,s,i){switch(t.type){case"title":return{...n,[t.type]:i,titleAttributes:{...s}};case"body":return{...n,bodyAttributes:{...s}};case"html":return{...n,htmlAttributes:{...s}};default:return{...n,[t.type]:{...s}}}}mapArrayTypeChildrenToProps(t,n){let s={...n};return Object.keys(t).forEach(n=>{s={...s,[n]:t[n]}}),s}warnOnInvalidChildren(t,n){return(0,b.default)($.some(n=>t.type===n),"function"==typeof t.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${$.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),(0,b.default)(!n||"string"==typeof n||Array.isArray(n)&&!n.some(t=>"string"!=typeof t),`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(t,n){let s={};
1202return y.default.Children.forEach(t,t=>{if(!t||!t.props)return;const{children:i,...o}=t.props,l=Object.keys(o).reduce((t,n)=>(t[k[n]||n]=o[n],t),{});let{type:c}=t;switch("symbol"==typeof c?c=c.toString():this.warnOnInvalidChildren(t,i),c){case"Symbol(react.fragment)":n=this.mapChildrenToProps(i,n);break;case"link":case"meta":case"noscript":case"script":case"style":s=this.flattenArrayTypeChildren(t,s,l,i);break;default:n=this.mapObjectTypeChildren(t,n,l,i)}}),this.mapArrayTypeChildrenToProps(s,n)}render(){const{children:t,...n}=this.props;let s={...n},{helmetData:i}=n;if(t&&(s=this.mapChildrenToProps(t,s)),i&&!(i instanceof ie)){i=new ie(i.context,!0),delete s.helmetData}return i?y.default.createElement(fe,{...s,context:i.value}):y.default.createElement(oe.Consumer,null,t=>y.default.createElement(fe,{...s,context:t}))}}},1109,[11,1110,151,1111]); 1203__d(function(g,r,_i,_a,m,e,d){var t='undefined'!=typeof Element,n='function'==typeof Map,f='function'==typeof Set,o='function'==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(u,a){if(u===a)return!0;if(u&&a&&'object'==typeof u&&'object'==typeof a){if(u.constructor!==a.constructor)return!1;var c,s,l,p;if(Array.isArray(u)){if((c=u.length)!=a.length)return!1;for(s=c;0!==s--;)if(!i(u[s],a[s]))return!1;return!0}if(n&&u instanceof Map&&a instanceof Map){if(u.size!==a.size)return!1;for(p=u.entries();!(s=p.next()).done;)if(!a.has(s.value[0]))return!1;for(p=u.entries();!(s=p.next()).done;)if(!i(s.value[1],a.get(s.value[0])))return!1;return!0}if(f&&u instanceof Set&&a instanceof Set){if(u.size!==a.size)return!1;for(p=u.entries();!(s=p.next()).done;)if(!a.has(s.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(u)&&ArrayBuffer.isView(a)){if((c=u.length)!=a.length)return!1;for(s=c;0!==s--;)if(u[s]!==a[s])return!1;return!0}if(u.constructor===RegExp)return u.source===a.source&&u.flags===a.flags;if(u.valueOf!==Object.prototype.valueOf&&'function'==typeof u.valueOf&&'function'==typeof a.valueOf)return u.valueOf()===a.valueOf();if(u.toString!==Object.prototype.toString&&'function'==typeof u.toString&&'function'==typeof a.toString)return u.toString()===a.toString();if((c=(l=Object.keys(u)).length)!==Object.keys(a).length)return!1;for(s=c;0!==s--;)if(!Object.prototype.hasOwnProperty.call(a,l[s]))return!1;if(t&&u instanceof Element)return!1;for(s=c;0!==s--;)if(('_owner'!==l[s]&&'__v'!==l[s]&&'__o'!==l[s]||!u.$$typeof)&&!i(u[l[s]],a[l[s]]))return!1;return!0}return u!=u&&a!=a}m.exports=function(t,n){try{return i(t,n)}catch(t){if((t.message||'').match(/stack|recursion/i))return console.warn('react-fast-compare cannot handle circular refs'),!1;throw t}}},1110,[]); 1204__d(function(g,r,i,a,m,e,d){m.exports=function(t,n,o,f){var c=o?o.call(f,t,n):void 0;if(void 0!==c)return!!c;if(t===n)return!0;if("object"!=typeof t||!t||"object"!=typeof n||!n)return!1;var u=Object.keys(t),v=Object.keys(n);if(u.length!==v.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(n),b=0;b<u.length;b++){var p=u[b];if(!l(p))return!1;var y=t[p],j=n[p];if(!1===(c=o?o.call(f,y,j,p):void 0)||void 0===c&&y!==j)return!1}return!0}},1111,[]); 1205__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1112,[]); 1206__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(o){if(o&&o.__esModule)return o;var i={};if(null!=o)for(var c=e(o),u=0;u<c.length;u++)"default"!==c[u]&&t(i,o,c[u]);return n(i,o),i});
1206Object.defineProperty(_e,"__esModule",{value:!0}),_e.renderRootComponent=function(e){try{setTimeout(()=>{f._internal_preventAutoHideAsync?.()}),u.startTransition(()=>{(0,c.registerRootComponent)(e)})}catch(e){f.hideAsync();const t=b(e);(0,c.registerRootComponent)(()=>(0,i.jsx)(s.View,{})),console.error(t),console.error("A runtime error has occurred while rendering the root component."),setTimeout(()=>{throw t})}};const i=r(d[0]),c=r(d[1]),u=o(r(d[2])),s=r(d[3]),f=o(r(d[4]));function l(e){if('[object Object]'!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function p(e){return e&&'object'==typeof e&&'string'==typeof e.name&&'string'==typeof e.message}function b(e){return p(e)?e:l(e)?new Error(JSON.stringify(e)):new Error(String(e))}},1113,[6,208,11,263,540]); 1207__r(210); 1208__r(2); 1209__r(0);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.