@ambuj.bhaskar/react-component-library 0.18.16-alpha → 0.18.17-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +5 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -649,4 +649,4 @@ object-assign
|
|
|
649
649
|
(c) Sindre Sorhus
|
|
650
650
|
@license MIT
|
|
651
651
|
*/var h8,ob;function Fhe(){if(ob)return h8;ob=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function o(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},s=0;s<10;s++)i["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(i).map(function(d){return i[d]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return h8=o()?Object.assign:function(a,i){for(var s,l=r(a),u,d=1;d<arguments.length;d++){s=Object(arguments[d]);for(var f in s)t.call(s,f)&&(l[f]=s[f]);if(e){u=e(s);for(var g=0;g<u.length;g++)n.call(s,u[g])&&(l[u[g]]=s[u[g]])}}return l},h8}var m8,ab;function gf(){if(ab)return m8;ab=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return m8=e,m8}var p8,ib;function XM(){return ib||(ib=1,p8=Function.call.bind(Object.prototype.hasOwnProperty)),p8}var v8,sb;function khe(){if(sb)return v8;sb=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=gf(),n={},r=XM();e=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(a,i,s,l,u){if(process.env.NODE_ENV!=="production"){for(var d in a)if(r(a,d)){var f;try{if(typeof a[d]!="function"){var g=Error((l||"React class")+": "+s+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw g.name="Invariant Violation",g}f=a[d](i,d,l,s,null,t)}catch(m){f=m}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+s+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var C=u?u():"";e("Failed "+s+" type: "+f.message+(C??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},v8=o,v8}var b8,lb;function jhe(){if(lb)return b8;lb=1;var e=ZM(),t=Fhe(),n=gf(),r=XM(),o=khe(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return b8=function(s,l){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(z){var F=z&&(u&&z[u]||z[d]);if(typeof F=="function")return F}var g="<<anonymous>>",C={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:b(),arrayOf:x,element:E(),elementType:w(),instanceOf:S,node:O(),objectOf:M,oneOf:_,oneOfType:R,shape:I,exact:P};function m(z,F){return z===F?z!==0||1/z===1/F:z!==z&&F!==F}function v(z,F){this.message=z,this.data=F&&typeof F=="object"?F:{},this.stack=""}v.prototype=Error.prototype;function h(z){if(process.env.NODE_ENV!=="production")var F={},K=0;function $(Y,te,ne,ee,Ae,ue,ae){if(ee=ee||g,ue=ue||ne,ae!==n){if(l){var re=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw re.name="Invariant Violation",re}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ie=ee+":"+ne;!F[ie]&&K<3&&(a("You are manually calling a React.PropTypes validation function for the `"+ue+"` prop on `"+ee+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),F[ie]=!0,K++)}}return te[ne]==null?Y?te[ne]===null?new v("The "+Ae+" `"+ue+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new v("The "+Ae+" `"+ue+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:z(te,ne,ee,Ae,ue)}var U=$.bind(null,!1);return U.isRequired=$.bind(null,!0),U}function y(z){function F(K,$,U,Y,te,ne){var ee=K[$],Ae=L(ee);if(Ae!==z){var ue=k(ee);return new v("Invalid "+Y+" `"+te+"` of type "+("`"+ue+"` supplied to `"+U+"`, expected ")+("`"+z+"`."),{expectedType:z})}return null}return h(F)}function b(){return h(i)}function x(z){function F(K,$,U,Y,te){if(typeof z!="function")return new v("Property `"+te+"` of component `"+U+"` has invalid PropType notation inside arrayOf.");var ne=K[$];if(!Array.isArray(ne)){var ee=L(ne);return new v("Invalid "+Y+" `"+te+"` of type "+("`"+ee+"` supplied to `"+U+"`, expected an array."))}for(var Ae=0;Ae<ne.length;Ae++){var ue=z(ne,Ae,U,Y,te+"["+Ae+"]",n);if(ue instanceof Error)return ue}return null}return h(F)}function E(){function z(F,K,$,U,Y){var te=F[K];if(!s(te)){var ne=L(te);return new v("Invalid "+U+" `"+Y+"` of type "+("`"+ne+"` supplied to `"+$+"`, expected a single ReactElement."))}return null}return h(z)}function w(){function z(F,K,$,U,Y){var te=F[K];if(!e.isValidElementType(te)){var ne=L(te);return new v("Invalid "+U+" `"+Y+"` of type "+("`"+ne+"` supplied to `"+$+"`, expected a single ReactElement type."))}return null}return h(z)}function S(z){function F(K,$,U,Y,te){if(!(K[$]instanceof z)){var ne=z.name||g,ee=Q(K[$]);return new v("Invalid "+Y+" `"+te+"` of type "+("`"+ee+"` supplied to `"+U+"`, expected ")+("instance of `"+ne+"`."))}return null}return h(F)}function _(z){if(!Array.isArray(z))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),i;function F(K,$,U,Y,te){for(var ne=K[$],ee=0;ee<z.length;ee++)if(m(ne,z[ee]))return null;var Ae=JSON.stringify(z,function(ae,re){var ie=k(re);return ie==="symbol"?String(re):re});return new v("Invalid "+Y+" `"+te+"` of value `"+String(ne)+"` "+("supplied to `"+U+"`, expected one of "+Ae+"."))}return h(F)}function M(z){function F(K,$,U,Y,te){if(typeof z!="function")return new v("Property `"+te+"` of component `"+U+"` has invalid PropType notation inside objectOf.");var ne=K[$],ee=L(ne);if(ee!=="object")return new v("Invalid "+Y+" `"+te+"` of type "+("`"+ee+"` supplied to `"+U+"`, expected an object."));for(var Ae in ne)if(r(ne,Ae)){var ue=z(ne,Ae,U,Y,te+"."+Ae,n);if(ue instanceof Error)return ue}return null}return h(F)}function R(z){if(!Array.isArray(z))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var F=0;F<z.length;F++){var K=z[F];if(typeof K!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+j(K)+" at index "+F+"."),i}function $(U,Y,te,ne,ee){for(var Ae=[],ue=0;ue<z.length;ue++){var ae=z[ue],re=ae(U,Y,te,ne,ee,n);if(re==null)return null;re.data&&r(re.data,"expectedType")&&Ae.push(re.data.expectedType)}var ie=Ae.length>0?", expected one of type ["+Ae.join(", ")+"]":"";return new v("Invalid "+ne+" `"+ee+"` supplied to "+("`"+te+"`"+ie+"."))}return h($)}function O(){function z(F,K,$,U,Y){return T(F[K])?null:new v("Invalid "+U+" `"+Y+"` supplied to "+("`"+$+"`, expected a ReactNode."))}return h(z)}function B(z,F,K,$,U){return new v((z||"React class")+": "+F+" type `"+K+"."+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+U+"`.")}function I(z){function F(K,$,U,Y,te){var ne=K[$],ee=L(ne);if(ee!=="object")return new v("Invalid "+Y+" `"+te+"` of type `"+ee+"` "+("supplied to `"+U+"`, expected `object`."));for(var Ae in z){var ue=z[Ae];if(typeof ue!="function")return B(U,Y,te,Ae,k(ue));var ae=ue(ne,Ae,U,Y,te+"."+Ae,n);if(ae)return ae}return null}return h(F)}function P(z){function F(K,$,U,Y,te){var ne=K[$],ee=L(ne);if(ee!=="object")return new v("Invalid "+Y+" `"+te+"` of type `"+ee+"` "+("supplied to `"+U+"`, expected `object`."));var Ae=t({},K[$],z);for(var ue in Ae){var ae=z[ue];if(r(z,ue)&&typeof ae!="function")return B(U,Y,te,ue,k(ae));if(!ae)return new v("Invalid "+Y+" `"+te+"` key `"+ue+"` supplied to `"+U+"`.\nBad object: "+JSON.stringify(K[$],null," ")+`
|
|
652
|
-
Valid keys: `+JSON.stringify(Object.keys(z),null," "));var re=ae(ne,ue,U,Y,te+"."+ue,n);if(re)return re}return null}return h(F)}function T(z){switch(typeof z){case"number":case"string":case"undefined":return!0;case"boolean":return!z;case"object":if(Array.isArray(z))return z.every(T);if(z===null||s(z))return!0;var F=f(z);if(F){var K=F.call(z),$;if(F!==z.entries){for(;!($=K.next()).done;)if(!T($.value))return!1}else for(;!($=K.next()).done;){var U=$.value;if(U&&!T(U[1]))return!1}}else return!1;return!0;default:return!1}}function N(z,F){return z==="symbol"?!0:F?F["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&F instanceof Symbol:!1}function L(z){var F=typeof z;return Array.isArray(z)?"array":z instanceof RegExp?"object":N(F,z)?"symbol":F}function k(z){if(typeof z>"u"||z===null)return""+z;var F=L(z);if(F==="object"){if(z instanceof Date)return"date";if(z instanceof RegExp)return"regexp"}return F}function j(z){var F=k(z);switch(F){case"array":case"object":return"an "+F;case"boolean":case"date":case"regexp":return"a "+F;default:return F}}function Q(z){return!z.constructor||!z.constructor.name?g:z.constructor.name}return C.checkPropTypes=o,C.resetWarningCache=o.resetWarningCache,C.PropTypes=C,C},b8}var x8,cb;function Vhe(){if(cb)return x8;cb=1;var e=gf();function t(){}function n(){}return n.resetWarningCache=t,x8=function(){function r(i,s,l,u,d,f){if(f!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}r.isRequired=r;function o(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},x8}var ub;function zhe(){if(ub)return r2.exports;if(ub=1,process.env.NODE_ENV!=="production"){var e=ZM(),t=!0;r2.exports=jhe()(e.isElement,t)}else r2.exports=Vhe()();return r2.exports}var xi=zhe();const y8=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function E8(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),n)}function n5(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent("on".concat(t),n)}function JM(e,t){const n=t.slice(0,t.length-1);for(let r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function e_(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let n=t.lastIndexOf("");for(;n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function Uhe(e,t){const n=e.length>=t.length?e:t,r=e.length>=t.length?t:e;let o=!0;for(let a=0;a<n.length;a++)r.indexOf(n[a])===-1&&(o=!1);return o}const ns={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":y8?173:189,"=":y8?61:187,";":y8?59:186,"'":222,"[":219,"]":221,"\\":220},Co={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},C5={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},W1={16:!1,18:!1,17:!1,91:!1},A1={};for(let e=1;e<20;e++)ns["f".concat(e)]=111+e;let i1=[],O5=null,t_="all";const n9=new Map,Rs=e=>ns[e.toLowerCase()]||Co[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),Khe=e=>Object.keys(ns).find(t=>ns[t]===e),Qhe=e=>Object.keys(Co).find(t=>Co[t]===e);function n_(e){t_=e||"all"}function rs(){return t_||"all"}function $he(){return i1.slice(0)}function Whe(){return i1.map(e=>Khe(e)||Qhe(e)||String.fromCharCode(e))}function Ghe(){const e=[];return Object.keys(A1).forEach(t=>{A1[t].forEach(n=>{let{key:r,scope:o,mods:a,shortcut:i}=n;e.push({scope:o,shortcut:i,mods:a,keys:r.split("+").map(s=>Rs(s))})})}),e}function Yhe(e){const t=e.target||e.srcElement,{tagName:n}=t;let r=!0;const o=n==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(o||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function qhe(e){return typeof e=="string"&&(e=Rs(e)),i1.indexOf(e)!==-1}function Zhe(e,t){let n,r;e||(e=rs());for(const o in A1)if(Object.prototype.hasOwnProperty.call(A1,o))for(n=A1[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1).forEach(i=>{let{element:s}=i;return Cf(s)}):r++;rs()===e&&n_(t||"all")}function Xhe(e){let t=e.keyCode||e.which||e.charCode;const n=i1.indexOf(t);if(n>=0&&i1.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&i1.splice(0,i1.length),(t===93||t===224)&&(t=91),t in W1){W1[t]=!1;for(const r in Co)Co[r]===t&&(Wr[r]=!1)}}function r_(e){if(typeof e>"u")Object.keys(A1).forEach(o=>{Array.isArray(A1[o])&&A1[o].forEach(a=>a2(a)),delete A1[o]}),Cf(null);else if(Array.isArray(e))e.forEach(o=>{o.key&&a2(o)});else if(typeof e=="object")e.key&&a2(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let[o,a]=n;typeof o=="function"&&(a=o,o=""),a2({key:e,scope:o,method:a,splitKey:"+"})}}const a2=e=>{let{key:t,scope:n,method:r,splitKey:o="+"}=e;e_(t).forEach(i=>{const s=i.split(o),l=s.length,u=s[l-1],d=u==="*"?"*":Rs(u);if(!A1[d])return;n||(n=rs());const f=l>1?JM(Co,s):[],g=[];A1[d]=A1[d].filter(C=>{const v=(r?C.method===r:!0)&&C.scope===n&&Uhe(C.mods,f);return v&&g.push(C.element),!v}),g.forEach(C=>Cf(C))})};function db(e,t,n,r){if(t.element!==r)return;let o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(const a in W1)Object.prototype.hasOwnProperty.call(W1,a)&&(!W1[a]&&t.mods.indexOf(+a)>-1||W1[a]&&t.mods.indexOf(+a)===-1)&&(o=!1);(t.mods.length===0&&!W1[16]&&!W1[18]&&!W1[17]&&!W1[91]||o||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(i1),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function fb(e,t){const n=A1["*"];let r=e.keyCode||e.which||e.charCode;if(!Wr.filter.call(this,e))return;if((r===93||r===224)&&(r=91),i1.indexOf(r)===-1&&r!==229&&i1.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{const l=C5[s];e[s]&&i1.indexOf(l)===-1?i1.push(l):!e[s]&&i1.indexOf(l)>-1?i1.splice(i1.indexOf(l),1):s==="metaKey"&&e[s]&&(i1=i1.filter(u=>u in C5||u===r))}),r in W1){W1[r]=!0;for(const s in Co)if(Object.prototype.hasOwnProperty.call(Co,s)){const l=C5[Co[s]];Wr[s]=e[l]}if(!n)return}for(const s in W1)Object.prototype.hasOwnProperty.call(W1,s)&&(W1[s]=e[C5[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(i1.indexOf(17)===-1&&i1.push(17),i1.indexOf(18)===-1&&i1.push(18),W1[17]=!0,W1[18]=!0);const o=rs();if(n)for(let s=0;s<n.length;s++)n[s].scope===o&&(e.type==="keydown"&&n[s].keydown||e.type==="keyup"&&n[s].keyup)&&db(e,n[s],o,t);if(!(r in A1))return;const a=A1[r],i=a.length;for(let s=0;s<i;s++)if((e.type==="keydown"&&a[s].keydown||e.type==="keyup"&&a[s].keyup)&&a[s].key){const l=a[s],{splitKey:u}=l,d=l.key.split(u),f=[];for(let g=0;g<d.length;g++)f.push(Rs(d[g]));f.sort().join("")===i1.sort().join("")&&db(e,l,o,t)}}function Wr(e,t,n){i1=[];const r=e_(e);let o=[],a="all",i=document,s=0,l=!1,u=!0,d="+",f=!1,g=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(a=t.scope),t.element&&(i=t.element),t.keyup&&(l=t.keyup),t.keydown!==void 0&&(u=t.keydown),t.capture!==void 0&&(f=t.capture),typeof t.splitKey=="string"&&(d=t.splitKey),t.single===!0&&(g=!0)),typeof t=="string"&&(a=t),g&&r_(e,a);s<r.length;s++)e=r[s].split(d),o=[],e.length>1&&(o=JM(Co,e)),e=e[e.length-1],e=e==="*"?"*":Rs(e),e in A1||(A1[e]=[]),A1[e].push({keyup:l,keydown:u,scope:a,mods:o,shortcut:r[s],method:n,key:r[s],splitKey:d,element:i});if(typeof i<"u"&&window){if(!n9.has(i)){const C=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return fb(v,i)},m=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;fb(v,i),Xhe(v)};n9.set(i,{keydownListener:C,keyupListenr:m,capture:f}),E8(i,"keydown",C,f),E8(i,"keyup",m,f)}if(!O5){const C=()=>{i1=[]};O5={listener:C,capture:f},E8(window,"focus",C,f)}}}function Jhe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(A1).forEach(n=>{A1[n].filter(o=>o.scope===t&&o.shortcut===e).forEach(o=>{o&&o.method&&o.method()})})}function Cf(e){const t=Object.values(A1).flat();if(t.findIndex(r=>{let{element:o}=r;return o===e})<0){const{keydownListener:r,keyupListenr:o,capture:a}=n9.get(e)||{};r&&o&&(n5(e,"keyup",o,a),n5(e,"keydown",r,a),n9.delete(e))}if((t.length<=0||n9.size<=0)&&(Object.keys(n9).forEach(o=>{const{keydownListener:a,keyupListenr:i,capture:s}=n9.get(o)||{};a&&i&&(n5(o,"keyup",i,s),n5(o,"keydown",a,s),n9.delete(o))}),n9.clear(),Object.keys(A1).forEach(o=>delete A1[o]),O5)){const{listener:o,capture:a}=O5;n5(window,"focus",o,a),O5=null}}const w8={getPressedKeyString:Whe,setScope:n_,getScope:rs,deleteScope:Zhe,getPressedKeyCodes:$he,getAllKeyCodes:Ghe,isPressed:qhe,filter:Yhe,trigger:Jhe,unbind:r_,keyMap:ns,modifier:Co,modifierMap:C5};for(const e in w8)Object.prototype.hasOwnProperty.call(w8,e)&&(Wr[e]=w8[e]);if(typeof window<"u"){const e=window.hotkeys;Wr.noConflict=t=>(t&&window.hotkeys===Wr&&(window.hotkeys=e),Wr),window.hotkeys=Wr}class Un extends D.Component{constructor(t){super(t),this.isKeyDown=!1,this.handle=void 0,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.handleKeyUpEvent=this.handleKeyUpEvent.bind(this),this.handle={}}componentDidMount(){var{filter:t,splitKey:n}=this.props;t&&(Wr.filter=t),Wr.unbind(this.props.keyName),Wr(this.props.keyName,{splitKey:n},this.onKeyDown),document&&document.body.addEventListener("keyup",this.handleKeyUpEvent)}componentWillUnmount(){Wr.unbind(this.props.keyName),this.isKeyDown=!0,this.handle={},document&&document.body.removeEventListener("keyup",this.handleKeyUpEvent)}onKeyUp(t,n){var{onKeyUp:r,disabled:o}=this.props;!o&&r&&r(n.shortcut,t,n)}onKeyDown(t,n){var{onKeyDown:r,allowRepeat:o,disabled:a}=this.props;this.isKeyDown&&!o||(this.isKeyDown=!0,this.handle=n,!a&&r&&r(n.shortcut,t,n))}handleKeyUpEvent(t){this.isKeyDown&&(this.isKeyDown=!1,!(this.props.keyName&&this.props.keyName.indexOf(this.handle.shortcut)<0)&&(this.onKeyUp(t,this.handle),this.handle={}))}render(){return this.props.children||null}}Un.defaultProps={filter(e){var t=e.target||e.srcElement,n=t.tagName;return!(t.isContentEditable||n==="INPUT"||n==="SELECT"||n==="TEXTAREA")}};Un.propTypes={keyName:xi.string,filter:xi.func,onKeyDown:xi.func,onKeyUp:xi.func,disabled:xi.bool,splitKey:xi.string};const o_=["shift","alt","meta","mod","ctrl","control"],eme={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function V9(e){return(eme[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function a_(e){return o_.includes(e)}function S8(e,t=","){return e.toLowerCase().split(t)}function H8(e,t="+",n=">",r=!1,o){let a=[],i=!1;e.includes(n)?(i=!0,a=e.toLocaleLowerCase().split(n).map(u=>V9(u))):a=e.toLocaleLowerCase().split(t).map(u=>V9(u));const s={alt:a.includes("alt"),ctrl:a.includes("ctrl")||a.includes("control"),shift:a.includes("shift"),meta:a.includes("meta"),mod:a.includes("mod"),useKey:r},l=a.filter(u=>!o_.includes(u));return{...s,keys:l,description:o,isSequence:i}}typeof document<"u"&&(document.addEventListener("keydown",e=>{e.code!==void 0&&i_([V9(e.code)])}),document.addEventListener("keyup",e=>{e.code!==void 0&&s_([V9(e.code)])})),typeof window<"u"&&(window.addEventListener("blur",()=>{s9.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{s9.clear()},0)}));const s9=new Set;function hf(e){return Array.isArray(e)}function tme(e,t=","){return(hf(e)?e:e.split(t)).every(n=>s9.has(n.trim().toLowerCase()))}function i_(e){const t=Array.isArray(e)?e:[e];s9.has("meta")&&s9.forEach(n=>!a_(n)&&s9.delete(n.toLowerCase())),t.forEach(n=>s9.add(n.toLowerCase()))}function s_(e){const t=Array.isArray(e)?e:[e];e==="meta"?s9.clear():t.forEach(n=>s9.delete(n.toLowerCase()))}function nme(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function rme(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function ome(e){return l_(e,["input","textarea","select"])}function l_(e,t=!1){const{target:n,composed:r}=e;let o;return ame(n)&&r?o=e.composedPath()[0]&&e.composedPath()[0].tagName:o=n&&n.tagName,hf(t)?!!(o&&t&&t.some(a=>a.toLowerCase()===o.toLowerCase())):!!(o&&t&&t)}function ame(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function ime(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}const sme=(e,t,n=!1)=>{const{alt:r,meta:o,mod:a,shift:i,ctrl:s,keys:l,useKey:u}=t,{code:d,key:f,ctrlKey:g,metaKey:C,shiftKey:m,altKey:v}=e,h=V9(d);if(u&&(l==null?void 0:l.length)===1&&l.includes(f))return!0;if(!(l!=null&&l.includes(h))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(h))return!1;if(!n){if(r!==v&&h!=="alt"||i!==m&&h!=="shift")return!1;if(a){if(!C&&!g)return!1}else if(o!==C&&h!=="meta"&&h!=="os"||s!==g&&h!=="ctrl"&&h!=="control")return!1}return l&&l.length===1&&l.includes(h)?!0:l?tme(l):!l},lme=D.createContext(void 0),cme=()=>D.useContext(lme);function c_(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce((n,r)=>n&&c_(e[r],t[r]),!0):e===t}const ume=D.createContext({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),dme=()=>D.useContext(ume);function fme(e){const t=D.useRef(void 0);return c_(t.current,e)||(t.current=e),t.current}const Ab=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},Ame=typeof window<"u"?D.useLayoutEffect:D.useEffect;function gb(e,t,n,r){const o=D.useRef(null),a=D.useRef(!1),i=n instanceof Array?r instanceof Array?void 0:r:n,s=hf(e)?e.join(i==null?void 0:i.delimiter):e,l=n instanceof Array?n:r instanceof Array?r:void 0,u=D.useCallback(t,l??[]),d=D.useRef(u);l?d.current=u:d.current=t;const f=fme(i),{activeScopes:g}=dme(),C=cme();return Ame(()=>{if((f==null?void 0:f.enabled)===!1||!ime(g,f==null?void 0:f.scopes))return;let m=[],v;const h=(E,w=!1)=>{var S;if(!(ome(E)&&!l_(E,f==null?void 0:f.enableOnFormTags))){if(o.current!==null){const _=o.current.getRootNode();if((_ instanceof Document||_ instanceof ShadowRoot)&&_.activeElement!==o.current&&!o.current.contains(_.activeElement)){Ab(E);return}}(S=E.target)!=null&&S.isContentEditable&&!(f!=null&&f.enableOnContentEditable)||S8(s,f==null?void 0:f.delimiter).forEach(_=>{var M,R,O,B;if(_.includes((f==null?void 0:f.splitKey)??"+")&&_.includes((f==null?void 0:f.sequenceSplitKey)??">")){console.warn(`Hotkey ${_} contains both ${(f==null?void 0:f.splitKey)??"+"} and ${(f==null?void 0:f.sequenceSplitKey)??">"} which is not supported.`);return}const I=H8(_,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description);if(I.isSequence){v=setTimeout(()=>{m=[]},(f==null?void 0:f.sequenceTimeoutMs)??1e3);const P=I.useKey?E.key:V9(E.code);if(a_(P.toLowerCase()))return;m.push(P);const T=(M=I.keys)==null?void 0:M[m.length-1];if(P!==T){m=[],v&&clearTimeout(v);return}m.length===((R=I.keys)==null?void 0:R.length)&&(d.current(E,I),v&&clearTimeout(v),m=[])}else if(sme(E,I,f==null?void 0:f.ignoreModifiers)||(O=I.keys)!=null&&O.includes("*")){if((B=f==null?void 0:f.ignoreEventWhen)!=null&&B.call(f,E)||w&&a.current)return;if(nme(E,I,f==null?void 0:f.preventDefault),!rme(E,I,f==null?void 0:f.enabled)){Ab(E);return}d.current(E,I),w||(a.current=!0)}})}},y=E=>{E.code!==void 0&&(i_(V9(E.code)),((f==null?void 0:f.keydown)===void 0&&(f==null?void 0:f.keyup)!==!0||f!=null&&f.keydown)&&h(E))},b=E=>{E.code!==void 0&&(s_(V9(E.code)),a.current=!1,f!=null&&f.keyup&&h(E,!0))},x=o.current||(i==null?void 0:i.document)||document;return x.addEventListener("keyup",b,i==null?void 0:i.eventListenerOptions),x.addEventListener("keydown",y,i==null?void 0:i.eventListenerOptions),C&&S8(s,f==null?void 0:f.delimiter).forEach(E=>C.addHotkey(H8(E,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description))),()=>{x.removeEventListener("keyup",b,i==null?void 0:i.eventListenerOptions),x.removeEventListener("keydown",y,i==null?void 0:i.eventListenerOptions),C&&S8(s,f==null?void 0:f.delimiter).forEach(E=>C.removeHotkey(H8(E,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description))),m=[],v&&clearTimeout(v)}},[s,f,g]),o}const u_=(e,t="",n="")=>J.jsx(FM,{className:t,children:J.jsx(Af,{children:e.map(r=>J.jsx(TM,{children:r},r))},`row_${n}`)},n),gme=({toggleSelectAnnotation:e=()=>{console.log("Not available")},handleLeftKeyDown:t=()=>{console.log("Not available")},handleRightKeyDown:n=()=>{console.log("Not available")},handleUpKeyDown:r=()=>{console.log("Not available")},handleDownKeyDown:o=()=>{console.log("Not available")},handleZoomInClick:a=()=>{console.log("Not available")},handleZoomOutClick:i=()=>{console.log("Not available")},handleCompleteAnnotation:s=()=>{console.log("Not available")},undoAnnotationPoint:l=()=>{console.log("Not available")},reLoadAndReDrawAnnotations:u=()=>{console.log("Not available")},togglePagination:d=()=>{console.log("Not available")},toggleFullscreen:f=()=>{console.log("Not available")},switchToAutoAnnotations:g=()=>{console.log("Not available")},openShortCutRequestDetails:C=()=>{console.log("Not available")},handleRecentAnnotatedVerifiedImages:m=()=>{console.log("Not available")},handleSendToSamFunctionPrompt:v=()=>{console.log("Not available")},samAPIactive:h,request:y,switchToEditMode:b=()=>{console.log("Not available")},switchToCreateMode:x=()=>{console.log("Not available")},goToNextImage:E=()=>{console.log("Not available")},goToPreviousImage:w=()=>{console.log("Not available")},loggedUser:S,handleGoToPendingAnnotations:_=()=>{console.log("Not available")},handleCopyByCtrlC:M=()=>{console.log("Not available")},handlePasteAnnotationsByControlV:R=()=>{console.log("Not available")},openShortCutKeyModal:O,setOpenShortCutKeyModal:B=()=>{console.log("Not available")},setIsAltViaToolPressHandle:I=()=>{console.log("Not available")},isCarousel:P=!1,selectedTool:T="",setCrossHairHandle:N=()=>{console.log("Not available")},controlMinusHotkey:L=()=>{console.log("Not available")},controlPlusHotkey:k=()=>{console.log("Not available")}})=>{const j=b7.isSAMAllowed(y==null?void 0:y.awi_annotation_type,y==null?void 0:y.awi_request_for)&&!h,Q=["awi_annotator","awi_verifier","awi_developer"].includes(S.userObj.awi_level),z=()=>{const $=[{action:"next image",key:"next_image",displayKey:"d",title:"Move to the next image",isClose:!0},{action:"previous image",key:"prev_image",displayKey:"a",title:"Move to the previous image",isClose:!0}],U=[{action:"Go to pending annotation",key:"pending_annotations",displayKey:"p",title:"Go to pending annotation",isClose:!0}],Y=[{action:"Switch to edit",key:"edit_mode",displayKey:"e",title:"Switch to edit mode",isClose:!0},{action:"Switch to create",key:"create_mode",displayKey:"q",title:"Switch to create mode",isClose:!0},{action:"Switch to pan mode",key:"pan_mode",displayKey:"m",title:"Switch to pan mode",isClose:!0},{action:"Show cross hair",key:"cross_hair",displayKey:"w",title:"Show cross hair",isClose:!0},{action:"Copy selected annotation",key:"copy",displayKey:"Ctrl + C",title:"Copy selected annotation",isClose:!1},{action:"Paste all annotations",key:"paste",displayKey:"Ctrl + V",title:"Paste all copied annotations",isClose:!1},{action:"Forward Toggle Annotations",key:"select_forward",displayKey:"T",title:"Forward Toggle annotations visibility, Long press to get next",isClose:!1},{action:"Backward Toggle Annotations",key:"select_backward",displayKey:"U",title:"Backward Toggle annotations visibility, Long press to get previous",isClose:!1},{action:"Go to last updated annotations",key:"select_last_update",displayKey:"L",title:"Go to last updated annotations",isClose:!0},{action:"Undo Annotation point / Last State",key:"undo",displayKey:"Ctrl + Z",title:"Undo last annotation action",isClose:!0},{action:"Complete Annotation / Generate Point Annotations",key:"complete",displayKey:"Enter",title:"Finalize or generate point annotations",isClose:!0},{action:"Switch to Auto Annotations",key:"auto_annotations",displayKey:"S",title:"Enable automatic annotation mode",isClose:!0},{action:"AI prompt popup",key:"send_to_sam",displayKey:"X (if AI is enabled)",title:"AI prompt popup",isClose:!0},{action:"Get request information",key:"open_shortcut_details",displayKey:"V",title:"View request-related information",isClose:!0},{action:"Refetch Annotations",key:"reload",displayKey:"R",title:"Reload annotations",isClose:!0},{action:"Toggle Image Pagination",key:"toggle_pagination",displayKey:"H",title:"Show or hide image pagination",isClose:!1},{action:"Zoom In",key:"zoom_in",displayKey:"I",title:"Zoom into the image, long press for more zoom in",isClose:!1},{action:"Zoom Out",key:"zoom_out",displayKey:"O",title:"Zoom out of the image, long press for more zoom out",isClose:!1},{action:"Moving Zoomed images",key:"",displayKey:"Alt + Mouse Move",title:"Move the zoomed-in image",isClose:!1},{action:"View Recently Annotated Images",key:"recent_verified",displayKey:"Alt + R",title:"Show recently annotated images",isClose:!0},{action:"Delete Annotation",key:"",displayKey:"Ctrl + Delete",title:"Delete the selected annotation",isClose:!1},{action:"Move image to left",key:"move_left",displayKey:"←",title:"Move image to left",isClose:!1},{action:"Move image to right",key:"move_right",displayKey:"→",title:"Move image to right",isClose:!1},{action:"Move image to top",key:"move_up",displayKey:"↑",title:"Move image to top",isClose:!1},{action:"Move image to bottom",key:"move_down",displayKey:"↓",title:"Move image to bottom",isClose:!1},{action:"Enter/Exit Fullscreen",key:"fullscreen",displayKey:"F",title:"Enter/Exit Fullscreen",isClose:!1}];return S.userObj.awi_level==="awi_verifier"?[...$,...Y,...U]:S.userObj.awi_level==="awi_supervisor"?$:[...$,...Y]},F=$=>{switch($){case"select_forward":return e("forward");case"select_backward":return e("backward");case"select_last_update":return e("last_update");case"move_left":return t();case"move_right":return n();case"move_up":return r();case"move_down":return o();case"zoom_in":return a();case"zoom_out":return i();case"complete":return s();case"undo":return l();case"reload":return u();case"toggle_pagination":return d(U=>!U);case"fullscreen":return f();case"auto_annotations":return g();case"open_shortcut_details":return C();case"recent_verified":return m();case"send_to_sam":if(j)return T!="SAM"&&g(),v();R5.error("SAM is not allowed");return;case"edit_mode":if(b)return b();break;case"create_mode":if(x)return x();break;case"next_image":if(E)return E();break;case"prev_image":if(w)return w();break;case"pending_annotations":if(_)return _();break;case"copy":if(M)return M();break;case"paste":if(R)return R();break;case"pan_mode":I();break;case"cross_hair":N&&typeof N=="function"&&N();break;default:console.warn(`Unhandled hotkey action: ${$}`)}},K=($,U)=>{F($),U&&B(!1)};return gb("ctrl+=",$=>{$.preventDefault(),k()}),gb("ctrl+-, ctrl+subtract, ctrl+minus",$=>{$.preventDefault(),L()}),J.jsxs(J.Fragment,{children:[J.jsx(Un,{allowRepeat:!0,keyName:"t",onKeyDown:()=>F("select_forward")}),J.jsx(Un,{allowRepeat:!0,keyName:"u",onKeyDown:()=>F("select_backward")}),J.jsx(Un,{allowRepeat:!1,keyName:"l",onKeyDown:()=>F("select_last_update")}),J.jsx(Un,{allowRepeat:!0,keyName:"left",onKeyDown:()=>F("move_left")}),J.jsx(Un,{allowRepeat:!0,keyName:"right",onKeyDown:()=>F("move_right")}),J.jsx(Un,{allowRepeat:!0,keyName:"up",onKeyDown:()=>F("move_up")}),J.jsx(Un,{allowRepeat:!0,keyName:"down",onKeyDown:()=>F("move_down")}),J.jsx(Un,{allowRepeat:!0,keyName:"i",onKeyDown:()=>F("zoom_in")}),J.jsx(Un,{allowRepeat:!0,keyName:"o",onKeyDown:()=>F("zoom_out")}),J.jsx(Un,{keyName:"enter",onKeyDown:()=>F("complete")}),J.jsx(Un,{keyName:"ctrl+z",onKeyDown:()=>F("undo")}),J.jsx(Un,{keyName:"r",onKeyDown:()=>F("reload")}),J.jsx(Un,{keyName:"h",onKeyDown:()=>F("toggle_pagination")}),J.jsx(Un,{keyName:"f",onKeyDown:()=>F("fullscreen")}),J.jsx(Un,{keyName:"s",onKeyDown:()=>F("auto_annotations")}),J.jsx(Un,{keyName:"v",onKeyDown:()=>F("open_shortcut_details")}),J.jsx(Un,{keyName:"alt+r",onKeyDown:()=>F("recent_verified")}),j&&J.jsx(Un,{keyName:"x",onKeyDown:()=>F("send_to_sam")}),Q&&J.jsxs(J.Fragment,{children:[J.jsx(Un,{keyName:"e",onKeyDown:()=>F("edit_mode")}),J.jsx(Un,{keyName:"q",onKeyDown:()=>F("create_mode")})]}),J.jsx(Un,{keyName:"d",onKeyDown:()=>F("next_image")}),J.jsx(Un,{keyName:"a",onKeyDown:()=>F("prev_image")}),S.userObj.awi_level==="awi_verifier"&&J.jsx(Un,{keyName:"p",onKeyDown:()=>F("pending_annotations")}),J.jsx(Un,{keyName:"ctrl+c",onKeyDown:()=>F("copy")}),J.jsx(Un,{keyName:"ctrl+v",onKeyDown:()=>F("paste")}),J.jsx(Un,{keyName:"m",onKeyDown:()=>F("pan_mode")}),J.jsx(Un,{keyName:"w",onKeyDown:()=>F("cross_hair")}),O&&!P&&J.jsx(J.Fragment,{children:J.jsxs(cf,{popupPosition:"right",isBackdrop:!0,backdropAction:()=>B(!1),className:"noPadding",children:[J.jsx(uf,{title:"Shortcut keys",onClose:()=>B(!1)}),J.jsx(df,{children:J.jsxs(kM,{children:[J.jsx(u_,{list:["S.NO.","Command","Key Binding","Action"]},"short_cut_keys"),J.jsx(PM,{children:(z()||[]).map(($,U)=>{var Y;return J.jsxs(Af,{title:$.title,children:[J.jsx(g5,{children:U+1}),J.jsx(g5,{children:$.action}),J.jsx(g5,{children:J.jsxs("div",{className:"shortcutKey",children:[" ",$.displayKey," "]})}),J.jsx(g5,{children:((Y=$==null?void 0:$.key)==null?void 0:Y.length)>0&&J.jsx("button",{className:"modalButton modalButton__purpleColor",onClick:()=>K($.key,$.isClose),children:"Press"})})]})})})]})}),J.jsx(ff,{})]})})]})},Cme=()=>{const e=D.useRef(!1),t=D.useRef(!1);return D.useEffect(()=>{const o=l=>{l.key==="Control"&&(e.current=!0,R5.success("Control pressed, Handling control press events")),l.key==="Alt"&&(t.current=!0,R5.success("Alt pressed, Handling alt press events")),l.key==="Command"&&(e.current=!0,R5.success("Command pressed, Handling command press events"))},a=l=>{l.key==="Control"&&(e.current=!1),l.key==="Alt"&&(t.current=!1),l.key==="Command"&&(e.current=!1)},i=()=>{document.hidden&&(e.current=!1,t.current=!1)},s=()=>{e.current=!1,t.current=!1};return window.addEventListener("keydown",o),window.addEventListener("keyup",a),document.addEventListener("visibilitychange",i),window.addEventListener("blur",s),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",a),document.removeEventListener("visibilitychange",i),window.removeEventListener("blur",s)}},[]),{isCtrlPressedFunc:()=>e.current,isAltPressedFunc:()=>t.current}};function hme(e=1,t=1){const[n,r]=D.useState(e),[o,a]=D.useState(t),i=D.useCallback(u=>{u>=1&&u<=o?r(u):console.error(`Invalid page number: ${u}`)},[o]),s=D.useCallback(()=>{i(n+1)},[n,i]),l=D.useCallback(()=>{i(n-1)},[n,i]);return{currentPage:n,setPage:i,nextPage:s,prevPage:l,totalPages:o,setTotalPages:a}}const d_=(e,t="",n)=>{!n||!e||Io.forEach(e,(r,o)=>{const a=`--${t}${o}`;Io.isObject(r)&&!Io.isArray(r)?d_(r,`${t}${o}-`,n):typeof r=="string"&&n.style.setProperty(a,r)})},f_=(e,t="",n)=>{!n||!e||Io.forEach(e,(r,o)=>{const a=`--${t}${o}`;Io.isObject(r)&&!Io.isArray(r)?f_(r,`${t}${o}-`,n):n.style.removeProperty(a)})},mme=(e,t="")=>{const n={},r=(o,a)=>{Io.forEach(o,(i,s)=>{const l=`--${t}${a}${s}`;Io.isObject(i)&&!Io.isArray(i)?r(i,`${a}${s}-`):typeof i=="string"&&(n[`${a}${s}`.toUpperCase().replace(/-/g,"_")]=`var(${l})`)})};return r(e,""),n},A_=D.createContext({}),pme="awi-color-",vme="awi-size-",bme="awi-weight-",M8=(e,t,n)=>(D.useEffect(()=>{if(Io.isEqual(n.current,e))return;const r=document.documentElement;return d_(e,t,r),()=>f_(e,t,r)},[e,n,t]),e?mme(e,t):{}),xme=({theme:e=pb,log:t=!0,children:n})=>{const r=D.useRef(null),o=D.useRef(null),a=D.useRef(null),i=M8(e.colors,pme,r),s=M8(e.sizes,vme,o),l=M8(e.weights,bme,a);return t&&(console.group("Theme Variables"),console.table(i),console.table(s),console.table(l),console.groupEnd()),J.jsxs(A_.Provider,{value:{...i,...s,...l},children:[J.jsx(qM,{}),n]})},yme=()=>{const e=D.useContext(A_);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},Eme=()=>({success:(e,t)=>t2("success",e,t),error:(e,t)=>t2("error",e,t),info:(e,t)=>t2("info",e,t),warning:(e,t)=>t2("warning",e,t)});exports.AWI_ALL_GLOBALS=I9;exports.AWI_IMAGE_VALIDITY_HELPER=zF;exports.AwiAnnotationHotkeys=gme;exports.AwiEmptyState=bAe;exports.AwiGenerateHeader=u_;exports.AwiHelperMethods=b7;exports.AwiInput=VM;exports.AwiLoadMoreButton=xAe;exports.AwiMessageScreen=h4;exports.AwiModal=cf;exports.AwiModalBody=df;exports.AwiModalFooter=ff;exports.AwiModalHeader=uf;exports.AwiModalRow=A5;exports.AwiPagination=jM;exports.AwiSafeLocalStorage=yi;exports.AwiSamModal=TCe;exports.AwiScrollableTableCellList=yAe;exports.AwiSlider=zM;exports.AwiTableBody=PM;exports.AwiTableCell=g5;exports.AwiTableHeader=TM;exports.AwiTableHeaders=FM;exports.AwiTableInfinite=kM;exports.AwiTableRow=Af;exports.AwiToastMessage=R5;exports.AwiUseKeyChecker=Cme;exports.Backdrop=NM;exports.Badge=$F;exports.Button=Yr;exports.ButtonGroup=cU;exports.Chart=eG;exports.CompactEventCard=Mx;exports.ContactInput=qde;exports.DEFAULT_THEME=pb;exports.DateRangePicker=tfe;exports.DetectionCarousel=IM;exports.EventPreview=nfe;exports.Icon=k9;exports.Input=F5;exports.MathAnnotationHelper=IF;exports.Modal=ofe;exports.Multiselect=afe;exports.Pagination=ife;exports.Select=OM;exports.Sidebar=sfe;exports.Spinner=y7;exports.Switch=lfe;exports.Table=cfe;exports.ThemeProvider=xme;exports.Toast=DM;exports.ToastProvider=qM;exports.usePagination=hme;exports.useTheme=yme;exports.useToast=Eme;
|
|
652
|
+
Valid keys: `+JSON.stringify(Object.keys(z),null," "));var re=ae(ne,ue,U,Y,te+"."+ue,n);if(re)return re}return null}return h(F)}function T(z){switch(typeof z){case"number":case"string":case"undefined":return!0;case"boolean":return!z;case"object":if(Array.isArray(z))return z.every(T);if(z===null||s(z))return!0;var F=f(z);if(F){var K=F.call(z),$;if(F!==z.entries){for(;!($=K.next()).done;)if(!T($.value))return!1}else for(;!($=K.next()).done;){var U=$.value;if(U&&!T(U[1]))return!1}}else return!1;return!0;default:return!1}}function N(z,F){return z==="symbol"?!0:F?F["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&F instanceof Symbol:!1}function L(z){var F=typeof z;return Array.isArray(z)?"array":z instanceof RegExp?"object":N(F,z)?"symbol":F}function k(z){if(typeof z>"u"||z===null)return""+z;var F=L(z);if(F==="object"){if(z instanceof Date)return"date";if(z instanceof RegExp)return"regexp"}return F}function j(z){var F=k(z);switch(F){case"array":case"object":return"an "+F;case"boolean":case"date":case"regexp":return"a "+F;default:return F}}function Q(z){return!z.constructor||!z.constructor.name?g:z.constructor.name}return C.checkPropTypes=o,C.resetWarningCache=o.resetWarningCache,C.PropTypes=C,C},b8}var x8,cb;function Vhe(){if(cb)return x8;cb=1;var e=gf();function t(){}function n(){}return n.resetWarningCache=t,x8=function(){function r(i,s,l,u,d,f){if(f!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}r.isRequired=r;function o(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},x8}var ub;function zhe(){if(ub)return r2.exports;if(ub=1,process.env.NODE_ENV!=="production"){var e=ZM(),t=!0;r2.exports=jhe()(e.isElement,t)}else r2.exports=Vhe()();return r2.exports}var xi=zhe();const y8=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function E8(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),n)}function n5(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent("on".concat(t),n)}function JM(e,t){const n=t.slice(0,t.length-1);for(let r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function e_(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let n=t.lastIndexOf("");for(;n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function Uhe(e,t){const n=e.length>=t.length?e:t,r=e.length>=t.length?t:e;let o=!0;for(let a=0;a<n.length;a++)r.indexOf(n[a])===-1&&(o=!1);return o}const ns={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":y8?173:189,"=":y8?61:187,";":y8?59:186,"'":222,"[":219,"]":221,"\\":220},Co={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},C5={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},W1={16:!1,18:!1,17:!1,91:!1},A1={};for(let e=1;e<20;e++)ns["f".concat(e)]=111+e;let i1=[],O5=null,t_="all";const n9=new Map,Rs=e=>ns[e.toLowerCase()]||Co[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),Khe=e=>Object.keys(ns).find(t=>ns[t]===e),Qhe=e=>Object.keys(Co).find(t=>Co[t]===e);function n_(e){t_=e||"all"}function rs(){return t_||"all"}function $he(){return i1.slice(0)}function Whe(){return i1.map(e=>Khe(e)||Qhe(e)||String.fromCharCode(e))}function Ghe(){const e=[];return Object.keys(A1).forEach(t=>{A1[t].forEach(n=>{let{key:r,scope:o,mods:a,shortcut:i}=n;e.push({scope:o,shortcut:i,mods:a,keys:r.split("+").map(s=>Rs(s))})})}),e}function Yhe(e){const t=e.target||e.srcElement,{tagName:n}=t;let r=!0;const o=n==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(o||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function qhe(e){return typeof e=="string"&&(e=Rs(e)),i1.indexOf(e)!==-1}function Zhe(e,t){let n,r;e||(e=rs());for(const o in A1)if(Object.prototype.hasOwnProperty.call(A1,o))for(n=A1[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1).forEach(i=>{let{element:s}=i;return Cf(s)}):r++;rs()===e&&n_(t||"all")}function Xhe(e){let t=e.keyCode||e.which||e.charCode;const n=i1.indexOf(t);if(n>=0&&i1.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&i1.splice(0,i1.length),(t===93||t===224)&&(t=91),t in W1){W1[t]=!1;for(const r in Co)Co[r]===t&&(Wr[r]=!1)}}function r_(e){if(typeof e>"u")Object.keys(A1).forEach(o=>{Array.isArray(A1[o])&&A1[o].forEach(a=>a2(a)),delete A1[o]}),Cf(null);else if(Array.isArray(e))e.forEach(o=>{o.key&&a2(o)});else if(typeof e=="object")e.key&&a2(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let[o,a]=n;typeof o=="function"&&(a=o,o=""),a2({key:e,scope:o,method:a,splitKey:"+"})}}const a2=e=>{let{key:t,scope:n,method:r,splitKey:o="+"}=e;e_(t).forEach(i=>{const s=i.split(o),l=s.length,u=s[l-1],d=u==="*"?"*":Rs(u);if(!A1[d])return;n||(n=rs());const f=l>1?JM(Co,s):[],g=[];A1[d]=A1[d].filter(C=>{const v=(r?C.method===r:!0)&&C.scope===n&&Uhe(C.mods,f);return v&&g.push(C.element),!v}),g.forEach(C=>Cf(C))})};function db(e,t,n,r){if(t.element!==r)return;let o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(const a in W1)Object.prototype.hasOwnProperty.call(W1,a)&&(!W1[a]&&t.mods.indexOf(+a)>-1||W1[a]&&t.mods.indexOf(+a)===-1)&&(o=!1);(t.mods.length===0&&!W1[16]&&!W1[18]&&!W1[17]&&!W1[91]||o||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(i1),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function fb(e,t){const n=A1["*"];let r=e.keyCode||e.which||e.charCode;if(!Wr.filter.call(this,e))return;if((r===93||r===224)&&(r=91),i1.indexOf(r)===-1&&r!==229&&i1.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{const l=C5[s];e[s]&&i1.indexOf(l)===-1?i1.push(l):!e[s]&&i1.indexOf(l)>-1?i1.splice(i1.indexOf(l),1):s==="metaKey"&&e[s]&&(i1=i1.filter(u=>u in C5||u===r))}),r in W1){W1[r]=!0;for(const s in Co)if(Object.prototype.hasOwnProperty.call(Co,s)){const l=C5[Co[s]];Wr[s]=e[l]}if(!n)return}for(const s in W1)Object.prototype.hasOwnProperty.call(W1,s)&&(W1[s]=e[C5[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(i1.indexOf(17)===-1&&i1.push(17),i1.indexOf(18)===-1&&i1.push(18),W1[17]=!0,W1[18]=!0);const o=rs();if(n)for(let s=0;s<n.length;s++)n[s].scope===o&&(e.type==="keydown"&&n[s].keydown||e.type==="keyup"&&n[s].keyup)&&db(e,n[s],o,t);if(!(r in A1))return;const a=A1[r],i=a.length;for(let s=0;s<i;s++)if((e.type==="keydown"&&a[s].keydown||e.type==="keyup"&&a[s].keyup)&&a[s].key){const l=a[s],{splitKey:u}=l,d=l.key.split(u),f=[];for(let g=0;g<d.length;g++)f.push(Rs(d[g]));f.sort().join("")===i1.sort().join("")&&db(e,l,o,t)}}function Wr(e,t,n){i1=[];const r=e_(e);let o=[],a="all",i=document,s=0,l=!1,u=!0,d="+",f=!1,g=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(a=t.scope),t.element&&(i=t.element),t.keyup&&(l=t.keyup),t.keydown!==void 0&&(u=t.keydown),t.capture!==void 0&&(f=t.capture),typeof t.splitKey=="string"&&(d=t.splitKey),t.single===!0&&(g=!0)),typeof t=="string"&&(a=t),g&&r_(e,a);s<r.length;s++)e=r[s].split(d),o=[],e.length>1&&(o=JM(Co,e)),e=e[e.length-1],e=e==="*"?"*":Rs(e),e in A1||(A1[e]=[]),A1[e].push({keyup:l,keydown:u,scope:a,mods:o,shortcut:r[s],method:n,key:r[s],splitKey:d,element:i});if(typeof i<"u"&&window){if(!n9.has(i)){const C=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return fb(v,i)},m=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;fb(v,i),Xhe(v)};n9.set(i,{keydownListener:C,keyupListenr:m,capture:f}),E8(i,"keydown",C,f),E8(i,"keyup",m,f)}if(!O5){const C=()=>{i1=[]};O5={listener:C,capture:f},E8(window,"focus",C,f)}}}function Jhe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(A1).forEach(n=>{A1[n].filter(o=>o.scope===t&&o.shortcut===e).forEach(o=>{o&&o.method&&o.method()})})}function Cf(e){const t=Object.values(A1).flat();if(t.findIndex(r=>{let{element:o}=r;return o===e})<0){const{keydownListener:r,keyupListenr:o,capture:a}=n9.get(e)||{};r&&o&&(n5(e,"keyup",o,a),n5(e,"keydown",r,a),n9.delete(e))}if((t.length<=0||n9.size<=0)&&(Object.keys(n9).forEach(o=>{const{keydownListener:a,keyupListenr:i,capture:s}=n9.get(o)||{};a&&i&&(n5(o,"keyup",i,s),n5(o,"keydown",a,s),n9.delete(o))}),n9.clear(),Object.keys(A1).forEach(o=>delete A1[o]),O5)){const{listener:o,capture:a}=O5;n5(window,"focus",o,a),O5=null}}const w8={getPressedKeyString:Whe,setScope:n_,getScope:rs,deleteScope:Zhe,getPressedKeyCodes:$he,getAllKeyCodes:Ghe,isPressed:qhe,filter:Yhe,trigger:Jhe,unbind:r_,keyMap:ns,modifier:Co,modifierMap:C5};for(const e in w8)Object.prototype.hasOwnProperty.call(w8,e)&&(Wr[e]=w8[e]);if(typeof window<"u"){const e=window.hotkeys;Wr.noConflict=t=>(t&&window.hotkeys===Wr&&(window.hotkeys=e),Wr),window.hotkeys=Wr}class Un extends D.Component{constructor(t){super(t),this.isKeyDown=!1,this.handle=void 0,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.handleKeyUpEvent=this.handleKeyUpEvent.bind(this),this.handle={}}componentDidMount(){var{filter:t,splitKey:n}=this.props;t&&(Wr.filter=t),Wr.unbind(this.props.keyName),Wr(this.props.keyName,{splitKey:n},this.onKeyDown),document&&document.body.addEventListener("keyup",this.handleKeyUpEvent)}componentWillUnmount(){Wr.unbind(this.props.keyName),this.isKeyDown=!0,this.handle={},document&&document.body.removeEventListener("keyup",this.handleKeyUpEvent)}onKeyUp(t,n){var{onKeyUp:r,disabled:o}=this.props;!o&&r&&r(n.shortcut,t,n)}onKeyDown(t,n){var{onKeyDown:r,allowRepeat:o,disabled:a}=this.props;this.isKeyDown&&!o||(this.isKeyDown=!0,this.handle=n,!a&&r&&r(n.shortcut,t,n))}handleKeyUpEvent(t){this.isKeyDown&&(this.isKeyDown=!1,!(this.props.keyName&&this.props.keyName.indexOf(this.handle.shortcut)<0)&&(this.onKeyUp(t,this.handle),this.handle={}))}render(){return this.props.children||null}}Un.defaultProps={filter(e){var t=e.target||e.srcElement,n=t.tagName;return!(t.isContentEditable||n==="INPUT"||n==="SELECT"||n==="TEXTAREA")}};Un.propTypes={keyName:xi.string,filter:xi.func,onKeyDown:xi.func,onKeyUp:xi.func,disabled:xi.bool,splitKey:xi.string};const o_=["shift","alt","meta","mod","ctrl","control"],eme={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function V9(e){return(eme[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function a_(e){return o_.includes(e)}function S8(e,t=","){return e.toLowerCase().split(t)}function H8(e,t="+",n=">",r=!1,o){let a=[],i=!1;e.includes(n)?(i=!0,a=e.toLocaleLowerCase().split(n).map(u=>V9(u))):a=e.toLocaleLowerCase().split(t).map(u=>V9(u));const s={alt:a.includes("alt"),ctrl:a.includes("ctrl")||a.includes("control"),shift:a.includes("shift"),meta:a.includes("meta"),mod:a.includes("mod"),useKey:r},l=a.filter(u=>!o_.includes(u));return{...s,keys:l,description:o,isSequence:i}}typeof document<"u"&&(document.addEventListener("keydown",e=>{e.code!==void 0&&i_([V9(e.code)])}),document.addEventListener("keyup",e=>{e.code!==void 0&&s_([V9(e.code)])})),typeof window<"u"&&(window.addEventListener("blur",()=>{s9.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{s9.clear()},0)}));const s9=new Set;function hf(e){return Array.isArray(e)}function tme(e,t=","){return(hf(e)?e:e.split(t)).every(n=>s9.has(n.trim().toLowerCase()))}function i_(e){const t=Array.isArray(e)?e:[e];s9.has("meta")&&s9.forEach(n=>!a_(n)&&s9.delete(n.toLowerCase())),t.forEach(n=>s9.add(n.toLowerCase()))}function s_(e){const t=Array.isArray(e)?e:[e];e==="meta"?s9.clear():t.forEach(n=>s9.delete(n.toLowerCase()))}function nme(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function rme(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function ome(e){return l_(e,["input","textarea","select"])}function l_(e,t=!1){const{target:n,composed:r}=e;let o;return ame(n)&&r?o=e.composedPath()[0]&&e.composedPath()[0].tagName:o=n&&n.tagName,hf(t)?!!(o&&t&&t.some(a=>a.toLowerCase()===o.toLowerCase())):!!(o&&t&&t)}function ame(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function ime(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}const sme=(e,t,n=!1)=>{const{alt:r,meta:o,mod:a,shift:i,ctrl:s,keys:l,useKey:u}=t,{code:d,key:f,ctrlKey:g,metaKey:C,shiftKey:m,altKey:v}=e,h=V9(d);if(u&&(l==null?void 0:l.length)===1&&l.includes(f))return!0;if(!(l!=null&&l.includes(h))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(h))return!1;if(!n){if(r!==v&&h!=="alt"||i!==m&&h!=="shift")return!1;if(a){if(!C&&!g)return!1}else if(o!==C&&h!=="meta"&&h!=="os"||s!==g&&h!=="ctrl"&&h!=="control")return!1}return l&&l.length===1&&l.includes(h)?!0:l?tme(l):!l},lme=D.createContext(void 0),cme=()=>D.useContext(lme);function c_(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce((n,r)=>n&&c_(e[r],t[r]),!0):e===t}const ume=D.createContext({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),dme=()=>D.useContext(ume);function fme(e){const t=D.useRef(void 0);return c_(t.current,e)||(t.current=e),t.current}const Ab=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},Ame=typeof window<"u"?D.useLayoutEffect:D.useEffect;function gb(e,t,n,r){const o=D.useRef(null),a=D.useRef(!1),i=n instanceof Array?r instanceof Array?void 0:r:n,s=hf(e)?e.join(i==null?void 0:i.delimiter):e,l=n instanceof Array?n:r instanceof Array?r:void 0,u=D.useCallback(t,l??[]),d=D.useRef(u);l?d.current=u:d.current=t;const f=fme(i),{activeScopes:g}=dme(),C=cme();return Ame(()=>{if((f==null?void 0:f.enabled)===!1||!ime(g,f==null?void 0:f.scopes))return;let m=[],v;const h=(E,w=!1)=>{var S;if(!(ome(E)&&!l_(E,f==null?void 0:f.enableOnFormTags))){if(o.current!==null){const _=o.current.getRootNode();if((_ instanceof Document||_ instanceof ShadowRoot)&&_.activeElement!==o.current&&!o.current.contains(_.activeElement)){Ab(E);return}}(S=E.target)!=null&&S.isContentEditable&&!(f!=null&&f.enableOnContentEditable)||S8(s,f==null?void 0:f.delimiter).forEach(_=>{var M,R,O,B;if(_.includes((f==null?void 0:f.splitKey)??"+")&&_.includes((f==null?void 0:f.sequenceSplitKey)??">")){console.warn(`Hotkey ${_} contains both ${(f==null?void 0:f.splitKey)??"+"} and ${(f==null?void 0:f.sequenceSplitKey)??">"} which is not supported.`);return}const I=H8(_,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description);if(I.isSequence){v=setTimeout(()=>{m=[]},(f==null?void 0:f.sequenceTimeoutMs)??1e3);const P=I.useKey?E.key:V9(E.code);if(a_(P.toLowerCase()))return;m.push(P);const T=(M=I.keys)==null?void 0:M[m.length-1];if(P!==T){m=[],v&&clearTimeout(v);return}m.length===((R=I.keys)==null?void 0:R.length)&&(d.current(E,I),v&&clearTimeout(v),m=[])}else if(sme(E,I,f==null?void 0:f.ignoreModifiers)||(O=I.keys)!=null&&O.includes("*")){if((B=f==null?void 0:f.ignoreEventWhen)!=null&&B.call(f,E)||w&&a.current)return;if(nme(E,I,f==null?void 0:f.preventDefault),!rme(E,I,f==null?void 0:f.enabled)){Ab(E);return}d.current(E,I),w||(a.current=!0)}})}},y=E=>{E.code!==void 0&&(i_(V9(E.code)),((f==null?void 0:f.keydown)===void 0&&(f==null?void 0:f.keyup)!==!0||f!=null&&f.keydown)&&h(E))},b=E=>{E.code!==void 0&&(s_(V9(E.code)),a.current=!1,f!=null&&f.keyup&&h(E,!0))},x=o.current||(i==null?void 0:i.document)||document;return x.addEventListener("keyup",b,i==null?void 0:i.eventListenerOptions),x.addEventListener("keydown",y,i==null?void 0:i.eventListenerOptions),C&&S8(s,f==null?void 0:f.delimiter).forEach(E=>C.addHotkey(H8(E,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description))),()=>{x.removeEventListener("keyup",b,i==null?void 0:i.eventListenerOptions),x.removeEventListener("keydown",y,i==null?void 0:i.eventListenerOptions),C&&S8(s,f==null?void 0:f.delimiter).forEach(E=>C.removeHotkey(H8(E,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description))),m=[],v&&clearTimeout(v)}},[s,f,g]),o}const u_=({list:e,headerClass:t="",type:n=""})=>(console.log("AWIHEADER List,",e),J.jsx(FM,{className:t,children:J.jsx(Af,{children:e.map(r=>J.jsx(TM,{children:r},r))},`row_${n}`)},n)),gme=({toggleSelectAnnotation:e=()=>{console.log("Not available")},handleLeftKeyDown:t=()=>{console.log("Not available")},handleRightKeyDown:n=()=>{console.log("Not available")},handleUpKeyDown:r=()=>{console.log("Not available")},handleDownKeyDown:o=()=>{console.log("Not available")},handleZoomInClick:a=()=>{console.log("Not available")},handleZoomOutClick:i=()=>{console.log("Not available")},handleCompleteAnnotation:s=()=>{console.log("Not available")},undoAnnotationPoint:l=()=>{console.log("Not available")},reLoadAndReDrawAnnotations:u=()=>{console.log("Not available")},togglePagination:d=()=>{console.log("Not available")},toggleFullscreen:f=()=>{console.log("Not available")},switchToAutoAnnotations:g=()=>{console.log("Not available")},openShortCutRequestDetails:C=()=>{console.log("Not available")},handleRecentAnnotatedVerifiedImages:m=()=>{console.log("Not available")},handleSendToSamFunctionPrompt:v=()=>{console.log("Not available")},samAPIactive:h,request:y,switchToEditMode:b=()=>{console.log("Not available")},switchToCreateMode:x=()=>{console.log("Not available")},goToNextImage:E=()=>{console.log("Not available")},goToPreviousImage:w=()=>{console.log("Not available")},loggedUser:S,handleGoToPendingAnnotations:_=()=>{console.log("Not available")},handleCopyByCtrlC:M=()=>{console.log("Not available")},handlePasteAnnotationsByControlV:R=()=>{console.log("Not available")},openShortCutKeyModal:O,setOpenShortCutKeyModal:B=()=>{console.log("Not available")},setIsAltViaToolPressHandle:I=()=>{console.log("Not available")},isCarousel:P=!1,selectedTool:T="",setCrossHairHandle:N=()=>{console.log("Not available")},controlMinusHotkey:L=()=>{console.log("Not available")},controlPlusHotkey:k=()=>{console.log("Not available")}})=>{const j=b7.isSAMAllowed(y==null?void 0:y.awi_annotation_type,y==null?void 0:y.awi_request_for)&&!h,Q=["awi_annotator","awi_verifier","awi_developer"].includes(S.userObj.awi_level),z=()=>{const $=[{action:"next image",key:"next_image",displayKey:"d",title:"Move to the next image",isClose:!0},{action:"previous image",key:"prev_image",displayKey:"a",title:"Move to the previous image",isClose:!0}],U=[{action:"Go to pending annotation",key:"pending_annotations",displayKey:"p",title:"Go to pending annotation",isClose:!0}],Y=[{action:"Switch to edit",key:"edit_mode",displayKey:"e",title:"Switch to edit mode",isClose:!0},{action:"Switch to create",key:"create_mode",displayKey:"q",title:"Switch to create mode",isClose:!0},{action:"Switch to pan mode",key:"pan_mode",displayKey:"m",title:"Switch to pan mode",isClose:!0},{action:"Show cross hair",key:"cross_hair",displayKey:"w",title:"Show cross hair",isClose:!0},{action:"Copy selected annotation",key:"copy",displayKey:"Ctrl + C",title:"Copy selected annotation",isClose:!1},{action:"Paste all annotations",key:"paste",displayKey:"Ctrl + V",title:"Paste all copied annotations",isClose:!1},{action:"Forward Toggle Annotations",key:"select_forward",displayKey:"T",title:"Forward Toggle annotations visibility, Long press to get next",isClose:!1},{action:"Backward Toggle Annotations",key:"select_backward",displayKey:"U",title:"Backward Toggle annotations visibility, Long press to get previous",isClose:!1},{action:"Go to last updated annotations",key:"select_last_update",displayKey:"L",title:"Go to last updated annotations",isClose:!0},{action:"Undo Annotation point / Last State",key:"undo",displayKey:"Ctrl + Z",title:"Undo last annotation action",isClose:!0},{action:"Complete Annotation / Generate Point Annotations",key:"complete",displayKey:"Enter",title:"Finalize or generate point annotations",isClose:!0},{action:"Switch to Auto Annotations",key:"auto_annotations",displayKey:"S",title:"Enable automatic annotation mode",isClose:!0},{action:"AI prompt popup",key:"send_to_sam",displayKey:"X (if AI is enabled)",title:"AI prompt popup",isClose:!0},{action:"Get request information",key:"open_shortcut_details",displayKey:"V",title:"View request-related information",isClose:!0},{action:"Refetch Annotations",key:"reload",displayKey:"R",title:"Reload annotations",isClose:!0},{action:"Toggle Image Pagination",key:"toggle_pagination",displayKey:"H",title:"Show or hide image pagination",isClose:!1},{action:"Zoom In",key:"zoom_in",displayKey:"I",title:"Zoom into the image, long press for more zoom in",isClose:!1},{action:"Zoom Out",key:"zoom_out",displayKey:"O",title:"Zoom out of the image, long press for more zoom out",isClose:!1},{action:"Moving Zoomed images",key:"",displayKey:"Alt + Mouse Move",title:"Move the zoomed-in image",isClose:!1},{action:"View Recently Annotated Images",key:"recent_verified",displayKey:"Alt + R",title:"Show recently annotated images",isClose:!0},{action:"Delete Annotation",key:"",displayKey:"Ctrl + Delete",title:"Delete the selected annotation",isClose:!1},{action:"Move image to left",key:"move_left",displayKey:"←",title:"Move image to left",isClose:!1},{action:"Move image to right",key:"move_right",displayKey:"→",title:"Move image to right",isClose:!1},{action:"Move image to top",key:"move_up",displayKey:"↑",title:"Move image to top",isClose:!1},{action:"Move image to bottom",key:"move_down",displayKey:"↓",title:"Move image to bottom",isClose:!1},{action:"Enter/Exit Fullscreen",key:"fullscreen",displayKey:"F",title:"Enter/Exit Fullscreen",isClose:!1}];return S.userObj.awi_level==="awi_verifier"?[...$,...Y,...U]:S.userObj.awi_level==="awi_supervisor"?$:[...$,...Y]},F=$=>{switch($){case"select_forward":return e("forward");case"select_backward":return e("backward");case"select_last_update":return e("last_update");case"move_left":return t();case"move_right":return n();case"move_up":return r();case"move_down":return o();case"zoom_in":return a();case"zoom_out":return i();case"complete":return s();case"undo":return l();case"reload":return u();case"toggle_pagination":return d(U=>!U);case"fullscreen":return f();case"auto_annotations":return g();case"open_shortcut_details":return C();case"recent_verified":return m();case"send_to_sam":if(j)return T!="SAM"&&g(),v();R5.error("SAM is not allowed");return;case"edit_mode":if(b)return b();break;case"create_mode":if(x)return x();break;case"next_image":if(E)return E();break;case"prev_image":if(w)return w();break;case"pending_annotations":if(_)return _();break;case"copy":if(M)return M();break;case"paste":if(R)return R();break;case"pan_mode":I();break;case"cross_hair":N&&typeof N=="function"&&N();break;default:console.warn(`Unhandled hotkey action: ${$}`)}},K=($,U)=>{F($),U&&B(!1)};return gb("ctrl+=",$=>{$.preventDefault(),k()}),gb("ctrl+-, ctrl+subtract, ctrl+minus",$=>{$.preventDefault(),L()}),J.jsxs(J.Fragment,{children:[J.jsx(Un,{allowRepeat:!0,keyName:"t",onKeyDown:()=>F("select_forward")}),J.jsx(Un,{allowRepeat:!0,keyName:"u",onKeyDown:()=>F("select_backward")}),J.jsx(Un,{allowRepeat:!1,keyName:"l",onKeyDown:()=>F("select_last_update")}),J.jsx(Un,{allowRepeat:!0,keyName:"left",onKeyDown:()=>F("move_left")}),J.jsx(Un,{allowRepeat:!0,keyName:"right",onKeyDown:()=>F("move_right")}),J.jsx(Un,{allowRepeat:!0,keyName:"up",onKeyDown:()=>F("move_up")}),J.jsx(Un,{allowRepeat:!0,keyName:"down",onKeyDown:()=>F("move_down")}),J.jsx(Un,{allowRepeat:!0,keyName:"i",onKeyDown:()=>F("zoom_in")}),J.jsx(Un,{allowRepeat:!0,keyName:"o",onKeyDown:()=>F("zoom_out")}),J.jsx(Un,{keyName:"enter",onKeyDown:()=>F("complete")}),J.jsx(Un,{keyName:"ctrl+z",onKeyDown:()=>F("undo")}),J.jsx(Un,{keyName:"r",onKeyDown:()=>F("reload")}),J.jsx(Un,{keyName:"h",onKeyDown:()=>F("toggle_pagination")}),J.jsx(Un,{keyName:"f",onKeyDown:()=>F("fullscreen")}),J.jsx(Un,{keyName:"s",onKeyDown:()=>F("auto_annotations")}),J.jsx(Un,{keyName:"v",onKeyDown:()=>F("open_shortcut_details")}),J.jsx(Un,{keyName:"alt+r",onKeyDown:()=>F("recent_verified")}),j&&J.jsx(Un,{keyName:"x",onKeyDown:()=>F("send_to_sam")}),Q&&J.jsxs(J.Fragment,{children:[J.jsx(Un,{keyName:"e",onKeyDown:()=>F("edit_mode")}),J.jsx(Un,{keyName:"q",onKeyDown:()=>F("create_mode")})]}),J.jsx(Un,{keyName:"d",onKeyDown:()=>F("next_image")}),J.jsx(Un,{keyName:"a",onKeyDown:()=>F("prev_image")}),S.userObj.awi_level==="awi_verifier"&&J.jsx(Un,{keyName:"p",onKeyDown:()=>F("pending_annotations")}),J.jsx(Un,{keyName:"ctrl+c",onKeyDown:()=>F("copy")}),J.jsx(Un,{keyName:"ctrl+v",onKeyDown:()=>F("paste")}),J.jsx(Un,{keyName:"m",onKeyDown:()=>F("pan_mode")}),J.jsx(Un,{keyName:"w",onKeyDown:()=>F("cross_hair")}),O&&!P&&J.jsx(J.Fragment,{children:J.jsxs(cf,{popupPosition:"right",isBackdrop:!0,backdropAction:()=>B(!1),className:"noPadding",children:[J.jsx(uf,{title:"Shortcut keys",onClose:()=>B(!1)}),J.jsx(df,{children:J.jsxs(kM,{children:[J.jsx(u_,{list:["S.NO.","Command","Key Binding","Action"]},"short_cut_keys"),J.jsx(PM,{children:(z()||[]).map(($,U)=>{var Y;return J.jsxs(Af,{title:$.title,children:[J.jsx(g5,{children:U+1}),J.jsx(g5,{children:$.action}),J.jsx(g5,{children:J.jsxs("div",{className:"shortcutKey",children:[" ",$.displayKey," "]})}),J.jsx(g5,{children:((Y=$==null?void 0:$.key)==null?void 0:Y.length)>0&&J.jsx("button",{className:"modalButton modalButton__purpleColor",onClick:()=>K($.key,$.isClose),children:"Press"})})]})})})]})}),J.jsx(ff,{})]})})]})},Cme=()=>{const e=D.useRef(!1),t=D.useRef(!1);return D.useEffect(()=>{const o=l=>{l.key==="Control"&&(e.current=!0,R5.success("Control pressed, Handling control press events")),l.key==="Alt"&&(t.current=!0,R5.success("Alt pressed, Handling alt press events")),l.key==="Command"&&(e.current=!0,R5.success("Command pressed, Handling command press events"))},a=l=>{l.key==="Control"&&(e.current=!1),l.key==="Alt"&&(t.current=!1),l.key==="Command"&&(e.current=!1)},i=()=>{document.hidden&&(e.current=!1,t.current=!1)},s=()=>{e.current=!1,t.current=!1};return window.addEventListener("keydown",o),window.addEventListener("keyup",a),document.addEventListener("visibilitychange",i),window.addEventListener("blur",s),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",a),document.removeEventListener("visibilitychange",i),window.removeEventListener("blur",s)}},[]),{isCtrlPressedFunc:()=>e.current,isAltPressedFunc:()=>t.current}};function hme(e=1,t=1){const[n,r]=D.useState(e),[o,a]=D.useState(t),i=D.useCallback(u=>{u>=1&&u<=o?r(u):console.error(`Invalid page number: ${u}`)},[o]),s=D.useCallback(()=>{i(n+1)},[n,i]),l=D.useCallback(()=>{i(n-1)},[n,i]);return{currentPage:n,setPage:i,nextPage:s,prevPage:l,totalPages:o,setTotalPages:a}}const d_=(e,t="",n)=>{!n||!e||Io.forEach(e,(r,o)=>{const a=`--${t}${o}`;Io.isObject(r)&&!Io.isArray(r)?d_(r,`${t}${o}-`,n):typeof r=="string"&&n.style.setProperty(a,r)})},f_=(e,t="",n)=>{!n||!e||Io.forEach(e,(r,o)=>{const a=`--${t}${o}`;Io.isObject(r)&&!Io.isArray(r)?f_(r,`${t}${o}-`,n):n.style.removeProperty(a)})},mme=(e,t="")=>{const n={},r=(o,a)=>{Io.forEach(o,(i,s)=>{const l=`--${t}${a}${s}`;Io.isObject(i)&&!Io.isArray(i)?r(i,`${a}${s}-`):typeof i=="string"&&(n[`${a}${s}`.toUpperCase().replace(/-/g,"_")]=`var(${l})`)})};return r(e,""),n},A_=D.createContext({}),pme="awi-color-",vme="awi-size-",bme="awi-weight-",M8=(e,t,n)=>(D.useEffect(()=>{if(Io.isEqual(n.current,e))return;const r=document.documentElement;return d_(e,t,r),()=>f_(e,t,r)},[e,n,t]),e?mme(e,t):{}),xme=({theme:e=pb,log:t=!0,children:n})=>{const r=D.useRef(null),o=D.useRef(null),a=D.useRef(null),i=M8(e.colors,pme,r),s=M8(e.sizes,vme,o),l=M8(e.weights,bme,a);return t&&(console.group("Theme Variables"),console.table(i),console.table(s),console.table(l),console.groupEnd()),J.jsxs(A_.Provider,{value:{...i,...s,...l},children:[J.jsx(qM,{}),n]})},yme=()=>{const e=D.useContext(A_);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},Eme=()=>({success:(e,t)=>t2("success",e,t),error:(e,t)=>t2("error",e,t),info:(e,t)=>t2("info",e,t),warning:(e,t)=>t2("warning",e,t)});exports.AWI_ALL_GLOBALS=I9;exports.AWI_IMAGE_VALIDITY_HELPER=zF;exports.AwiAnnotationHotkeys=gme;exports.AwiEmptyState=bAe;exports.AwiGenerateHeader=u_;exports.AwiHelperMethods=b7;exports.AwiInput=VM;exports.AwiLoadMoreButton=xAe;exports.AwiMessageScreen=h4;exports.AwiModal=cf;exports.AwiModalBody=df;exports.AwiModalFooter=ff;exports.AwiModalHeader=uf;exports.AwiModalRow=A5;exports.AwiPagination=jM;exports.AwiSafeLocalStorage=yi;exports.AwiSamModal=TCe;exports.AwiScrollableTableCellList=yAe;exports.AwiSlider=zM;exports.AwiTableBody=PM;exports.AwiTableCell=g5;exports.AwiTableHeader=TM;exports.AwiTableHeaders=FM;exports.AwiTableInfinite=kM;exports.AwiTableRow=Af;exports.AwiToastMessage=R5;exports.AwiUseKeyChecker=Cme;exports.Backdrop=NM;exports.Badge=$F;exports.Button=Yr;exports.ButtonGroup=cU;exports.Chart=eG;exports.CompactEventCard=Mx;exports.ContactInput=qde;exports.DEFAULT_THEME=pb;exports.DateRangePicker=tfe;exports.DetectionCarousel=IM;exports.EventPreview=nfe;exports.Icon=k9;exports.Input=F5;exports.MathAnnotationHelper=IF;exports.Modal=ofe;exports.Multiselect=afe;exports.Pagination=ife;exports.Select=OM;exports.Sidebar=sfe;exports.Spinner=y7;exports.Switch=lfe;exports.Table=cfe;exports.ThemeProvider=xme;exports.Toast=DM;exports.ToastProvider=qM;exports.usePagination=hme;exports.useTheme=yme;exports.useToast=Eme;
|
package/dist/index.d.ts
CHANGED
|
@@ -124,7 +124,13 @@ export declare type AwiEmptyStateProps = {
|
|
|
124
124
|
title?: string;
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
export declare const AwiGenerateHeader:
|
|
127
|
+
export declare const AwiGenerateHeader: default_2.FC<AwiGenerateHeaderProps>;
|
|
128
|
+
|
|
129
|
+
declare type AwiGenerateHeaderProps = {
|
|
130
|
+
list: string[];
|
|
131
|
+
headerClass?: string;
|
|
132
|
+
type?: string;
|
|
133
|
+
};
|
|
128
134
|
|
|
129
135
|
export declare const AwiHelperMethods: {
|
|
130
136
|
getStatusDisplayText: (status: string, user: any) => any;
|
package/dist/index.js
CHANGED
|
@@ -65060,7 +65060,11 @@ function mb(e, t, n, r) {
|
|
|
65060
65060
|
};
|
|
65061
65061
|
}, [s, f, g]), o;
|
|
65062
65062
|
}
|
|
65063
|
-
const ume = (
|
|
65063
|
+
const ume = ({
|
|
65064
|
+
list: e,
|
|
65065
|
+
headerClass: t = "",
|
|
65066
|
+
type: n = ""
|
|
65067
|
+
}) => (console.log("AWIHEADER List,", e), /* @__PURE__ */ X.jsx(iAe, { className: t, children: /* @__PURE__ */ X.jsx(V_, { children: e.map((r) => /* @__PURE__ */ X.jsx(aAe, { children: r }, r)) }, `row_${n}`) }, n)), kme = ({
|
|
65064
65068
|
toggleSelectAnnotation: e = () => {
|
|
65065
65069
|
console.log("Not available");
|
|
65066
65070
|
},
|
package/dist/index.umd.js
CHANGED
|
@@ -650,4 +650,4 @@ object-assign
|
|
|
650
650
|
(c) Sindre Sorhus
|
|
651
651
|
@license MIT
|
|
652
652
|
*/var q7,NE;function Sae(){if(NE)return q7;NE=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(a).map(function(d){return a[d]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return q7=o()?Object.assign:function(i,a){for(var s,l=r(i),u,d=1;d<arguments.length;d++){s=Object(arguments[d]);for(var f in s)t.call(s,f)&&(l[f]=s[f]);if(e){u=e(s);for(var A=0;A<u.length;A++)n.call(s,u[A])&&(l[u[A]]=s[u[A]])}}return l},q7}var Y7,PE;function Z7(){if(PE)return Y7;PE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Y7=e,Y7}var X7,kE;function TE(){return kE||(kE=1,X7=Function.call.bind(Object.prototype.hasOwnProperty)),X7}var J7,FE;function Hae(){if(FE)return J7;FE=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Z7(),n={},r=TE();e=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function o(i,a,s,l,u){if(process.env.NODE_ENV!=="production"){for(var d in i)if(r(i,d)){var f;try{if(typeof i[d]!="function"){var A=Error((l||"React class")+": "+s+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw A.name="Invariant Violation",A}f=i[d](a,d,l,s,null,t)}catch(m){f=m}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+s+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var C=u?u():"";e("Failed "+s+" type: "+f.message+(C??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},J7=o,J7}var ed,jE;function Mae(){if(jE)return ed;jE=1;var e=RE(),t=Sae(),n=Z7(),r=TE(),o=Hae(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function a(){return null}return ed=function(s,l){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(V){var T=V&&(u&&V[u]||V[d]);if(typeof T=="function")return T}var A="<<anonymous>>",C={array:_("array"),bigint:_("bigint"),bool:_("boolean"),func:_("function"),number:_("number"),object:_("object"),string:_("string"),symbol:_("symbol"),any:b(),arrayOf:x,element:y(),elementType:w(),instanceOf:E,node:B(),objectOf:H,oneOf:M,oneOfType:O,shape:L,exact:P};function m(V,T){return V===T?V!==0||1/V===1/T:V!==V&&T!==T}function v(V,T){this.message=V,this.data=T&&typeof T=="object"?T:{},this.stack=""}v.prototype=Error.prototype;function h(V){if(process.env.NODE_ENV!=="production")var T={},K=0;function $(q,te,ne,ee,ge,ue,ie){if(ee=ee||A,ue=ue||ne,ie!==n){if(l){var re=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw re.name="Invariant Violation",re}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ae=ee+":"+ne;!T[ae]&&K<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ue+"` prop on `"+ee+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),T[ae]=!0,K++)}}return te[ne]==null?q?te[ne]===null?new v("The "+ge+" `"+ue+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new v("The "+ge+" `"+ue+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:V(te,ne,ee,ge,ue)}var U=$.bind(null,!1);return U.isRequired=$.bind(null,!0),U}function _(V){function T(K,$,U,q,te,ne){var ee=K[$],ge=R(ee);if(ge!==V){var ue=F(ee);return new v("Invalid "+q+" `"+te+"` of type "+("`"+ue+"` supplied to `"+U+"`, expected ")+("`"+V+"`."),{expectedType:V})}return null}return h(T)}function b(){return h(a)}function x(V){function T(K,$,U,q,te){if(typeof V!="function")return new v("Property `"+te+"` of component `"+U+"` has invalid PropType notation inside arrayOf.");var ne=K[$];if(!Array.isArray(ne)){var ee=R(ne);return new v("Invalid "+q+" `"+te+"` of type "+("`"+ee+"` supplied to `"+U+"`, expected an array."))}for(var ge=0;ge<ne.length;ge++){var ue=V(ne,ge,U,q,te+"["+ge+"]",n);if(ue instanceof Error)return ue}return null}return h(T)}function y(){function V(T,K,$,U,q){var te=T[K];if(!s(te)){var ne=R(te);return new v("Invalid "+U+" `"+q+"` of type "+("`"+ne+"` supplied to `"+$+"`, expected a single ReactElement."))}return null}return h(V)}function w(){function V(T,K,$,U,q){var te=T[K];if(!e.isValidElementType(te)){var ne=R(te);return new v("Invalid "+U+" `"+q+"` of type "+("`"+ne+"` supplied to `"+$+"`, expected a single ReactElement type."))}return null}return h(V)}function E(V){function T(K,$,U,q,te){if(!(K[$]instanceof V)){var ne=V.name||A,ee=Q(K[$]);return new v("Invalid "+q+" `"+te+"` of type "+("`"+ee+"` supplied to `"+U+"`, expected ")+("instance of `"+ne+"`."))}return null}return h(T)}function M(V){if(!Array.isArray(V))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function T(K,$,U,q,te){for(var ne=K[$],ee=0;ee<V.length;ee++)if(m(ne,V[ee]))return null;var ge=JSON.stringify(V,function(ie,re){var ae=F(re);return ae==="symbol"?String(re):re});return new v("Invalid "+q+" `"+te+"` of value `"+String(ne)+"` "+("supplied to `"+U+"`, expected one of "+ge+"."))}return h(T)}function H(V){function T(K,$,U,q,te){if(typeof V!="function")return new v("Property `"+te+"` of component `"+U+"` has invalid PropType notation inside objectOf.");var ne=K[$],ee=R(ne);if(ee!=="object")return new v("Invalid "+q+" `"+te+"` of type "+("`"+ee+"` supplied to `"+U+"`, expected an object."));for(var ge in ne)if(r(ne,ge)){var ue=V(ne,ge,U,q,te+"."+ge,n);if(ue instanceof Error)return ue}return null}return h(T)}function O(V){if(!Array.isArray(V))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var T=0;T<V.length;T++){var K=V[T];if(typeof K!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+j(K)+" at index "+T+"."),a}function $(U,q,te,ne,ee){for(var ge=[],ue=0;ue<V.length;ue++){var ie=V[ue],re=ie(U,q,te,ne,ee,n);if(re==null)return null;re.data&&r(re.data,"expectedType")&&ge.push(re.data.expectedType)}var ae=ge.length>0?", expected one of type ["+ge.join(", ")+"]":"";return new v("Invalid "+ne+" `"+ee+"` supplied to "+("`"+te+"`"+ae+"."))}return h($)}function B(){function V(T,K,$,U,q){return k(T[K])?null:new v("Invalid "+U+" `"+q+"` supplied to "+("`"+$+"`, expected a ReactNode."))}return h(V)}function I(V,T,K,$,U){return new v((V||"React class")+": "+T+" type `"+K+"."+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+U+"`.")}function L(V){function T(K,$,U,q,te){var ne=K[$],ee=R(ne);if(ee!=="object")return new v("Invalid "+q+" `"+te+"` of type `"+ee+"` "+("supplied to `"+U+"`, expected `object`."));for(var ge in V){var ue=V[ge];if(typeof ue!="function")return I(U,q,te,ge,F(ue));var ie=ue(ne,ge,U,q,te+"."+ge,n);if(ie)return ie}return null}return h(T)}function P(V){function T(K,$,U,q,te){var ne=K[$],ee=R(ne);if(ee!=="object")return new v("Invalid "+q+" `"+te+"` of type `"+ee+"` "+("supplied to `"+U+"`, expected `object`."));var ge=t({},K[$],V);for(var ue in ge){var ie=V[ue];if(r(V,ue)&&typeof ie!="function")return I(U,q,te,ue,F(ie));if(!ie)return new v("Invalid "+q+" `"+te+"` key `"+ue+"` supplied to `"+U+"`.\nBad object: "+JSON.stringify(K[$],null," ")+`
|
|
653
|
-
Valid keys: `+JSON.stringify(Object.keys(V),null," "));var re=ie(ne,ue,U,q,te+"."+ue,n);if(re)return re}return null}return h(T)}function k(V){switch(typeof V){case"number":case"string":case"undefined":return!0;case"boolean":return!V;case"object":if(Array.isArray(V))return V.every(k);if(V===null||s(V))return!0;var T=f(V);if(T){var K=T.call(V),$;if(T!==V.entries){for(;!($=K.next()).done;)if(!k($.value))return!1}else for(;!($=K.next()).done;){var U=$.value;if(U&&!k(U[1]))return!1}}else return!1;return!0;default:return!1}}function N(V,T){return V==="symbol"?!0:T?T["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&T instanceof Symbol:!1}function R(V){var T=typeof V;return Array.isArray(V)?"array":V instanceof RegExp?"object":N(T,V)?"symbol":T}function F(V){if(typeof V>"u"||V===null)return""+V;var T=R(V);if(T==="object"){if(V instanceof Date)return"date";if(V instanceof RegExp)return"regexp"}return T}function j(V){var T=F(V);switch(T){case"array":case"object":return"an "+T;case"boolean":case"date":case"regexp":return"a "+T;default:return T}}function Q(V){return!V.constructor||!V.constructor.name?A:V.constructor.name}return C.checkPropTypes=o,C.resetWarningCache=o.resetWarningCache,C.PropTypes=C,C},ed}var td,zE;function Oae(){if(zE)return td;zE=1;var e=Z7();function t(){}function n(){}return n.resetWarningCache=t,td=function(){function r(a,s,l,u,d,f){if(f!==e){var A=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw A.name="Invariant Violation",A}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},td}var VE;function Bae(){if(VE)return u6.exports;if(VE=1,process.env.NODE_ENV!=="production"){var e=RE(),t=!0;u6.exports=Mae()(e.isElement,t)}else u6.exports=Oae()();return u6.exports}var n0=Bae();const nd=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function rd(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),n)}function as(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent("on".concat(t),n)}function UE(e,t){const n=t.slice(0,t.length-1);for(let r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function KE(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let n=t.lastIndexOf("");for(;n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function Iae(e,t){const n=e.length>=t.length?e:t,r=e.length>=t.length?t:e;let o=!0;for(let i=0;i<n.length;i++)r.indexOf(n[i])===-1&&(o=!1);return o}const ss={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":nd?173:189,"=":nd?61:187,";":nd?59:186,"'":222,"[":219,"]":221,"\\":220},Co={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},ls={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Yr={16:!1,18:!1,17:!1,91:!1},dr={};for(let e=1;e<20;e++)ss["f".concat(e)]=111+e;let sr=[],cs=null,QE="all";const si=new Map,us=e=>ss[e.toLowerCase()]||Co[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),Dae=e=>Object.keys(ss).find(t=>ss[t]===e),Lae=e=>Object.keys(Co).find(t=>Co[t]===e);function $E(e){QE=e||"all"}function ds(){return QE||"all"}function Rae(){return sr.slice(0)}function Nae(){return sr.map(e=>Dae(e)||Lae(e)||String.fromCharCode(e))}function Pae(){const e=[];return Object.keys(dr).forEach(t=>{dr[t].forEach(n=>{let{key:r,scope:o,mods:i,shortcut:a}=n;e.push({scope:o,shortcut:a,mods:i,keys:r.split("+").map(s=>us(s))})})}),e}function kae(e){const t=e.target||e.srcElement,{tagName:n}=t;let r=!0;const o=n==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(o||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function Tae(e){return typeof e=="string"&&(e=us(e)),sr.indexOf(e)!==-1}function Fae(e,t){let n,r;e||(e=ds());for(const o in dr)if(Object.prototype.hasOwnProperty.call(dr,o))for(n=dr[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1).forEach(a=>{let{element:s}=a;return od(s)}):r++;ds()===e&&$E(t||"all")}function jae(e){let t=e.keyCode||e.which||e.charCode;const n=sr.indexOf(t);if(n>=0&&sr.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&sr.splice(0,sr.length),(t===93||t===224)&&(t=91),t in Yr){Yr[t]=!1;for(const r in Co)Co[r]===t&&(W1[r]=!1)}}function WE(e){if(typeof e>"u")Object.keys(dr).forEach(o=>{Array.isArray(dr[o])&&dr[o].forEach(i=>f6(i)),delete dr[o]}),od(null);else if(Array.isArray(e))e.forEach(o=>{o.key&&f6(o)});else if(typeof e=="object")e.key&&f6(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let[o,i]=n;typeof o=="function"&&(i=o,o=""),f6({key:e,scope:o,method:i,splitKey:"+"})}}const f6=e=>{let{key:t,scope:n,method:r,splitKey:o="+"}=e;KE(t).forEach(a=>{const s=a.split(o),l=s.length,u=s[l-1],d=u==="*"?"*":us(u);if(!dr[d])return;n||(n=ds());const f=l>1?UE(Co,s):[],A=[];dr[d]=dr[d].filter(C=>{const v=(r?C.method===r:!0)&&C.scope===n&&Iae(C.mods,f);return v&&A.push(C.element),!v}),A.forEach(C=>od(C))})};function GE(e,t,n,r){if(t.element!==r)return;let o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(const i in Yr)Object.prototype.hasOwnProperty.call(Yr,i)&&(!Yr[i]&&t.mods.indexOf(+i)>-1||Yr[i]&&t.mods.indexOf(+i)===-1)&&(o=!1);(t.mods.length===0&&!Yr[16]&&!Yr[18]&&!Yr[17]&&!Yr[91]||o||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(sr),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function qE(e,t){const n=dr["*"];let r=e.keyCode||e.which||e.charCode;if(!W1.filter.call(this,e))return;if((r===93||r===224)&&(r=91),sr.indexOf(r)===-1&&r!==229&&sr.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{const l=ls[s];e[s]&&sr.indexOf(l)===-1?sr.push(l):!e[s]&&sr.indexOf(l)>-1?sr.splice(sr.indexOf(l),1):s==="metaKey"&&e[s]&&(sr=sr.filter(u=>u in ls||u===r))}),r in Yr){Yr[r]=!0;for(const s in Co)if(Object.prototype.hasOwnProperty.call(Co,s)){const l=ls[Co[s]];W1[s]=e[l]}if(!n)return}for(const s in Yr)Object.prototype.hasOwnProperty.call(Yr,s)&&(Yr[s]=e[ls[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(sr.indexOf(17)===-1&&sr.push(17),sr.indexOf(18)===-1&&sr.push(18),Yr[17]=!0,Yr[18]=!0);const o=ds();if(n)for(let s=0;s<n.length;s++)n[s].scope===o&&(e.type==="keydown"&&n[s].keydown||e.type==="keyup"&&n[s].keyup)&&GE(e,n[s],o,t);if(!(r in dr))return;const i=dr[r],a=i.length;for(let s=0;s<a;s++)if((e.type==="keydown"&&i[s].keydown||e.type==="keyup"&&i[s].keyup)&&i[s].key){const l=i[s],{splitKey:u}=l,d=l.key.split(u),f=[];for(let A=0;A<d.length;A++)f.push(us(d[A]));f.sort().join("")===sr.sort().join("")&&GE(e,l,o,t)}}function W1(e,t,n){sr=[];const r=KE(e);let o=[],i="all",a=document,s=0,l=!1,u=!0,d="+",f=!1,A=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(i=t.scope),t.element&&(a=t.element),t.keyup&&(l=t.keyup),t.keydown!==void 0&&(u=t.keydown),t.capture!==void 0&&(f=t.capture),typeof t.splitKey=="string"&&(d=t.splitKey),t.single===!0&&(A=!0)),typeof t=="string"&&(i=t),A&&WE(e,i);s<r.length;s++)e=r[s].split(d),o=[],e.length>1&&(o=UE(Co,e)),e=e[e.length-1],e=e==="*"?"*":us(e),e in dr||(dr[e]=[]),dr[e].push({keyup:l,keydown:u,scope:i,mods:o,shortcut:r[s],method:n,key:r[s],splitKey:d,element:a});if(typeof a<"u"&&window){if(!si.has(a)){const C=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return qE(v,a)},m=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;qE(v,a),jae(v)};si.set(a,{keydownListener:C,keyupListenr:m,capture:f}),rd(a,"keydown",C,f),rd(a,"keyup",m,f)}if(!cs){const C=()=>{sr=[]};cs={listener:C,capture:f},rd(window,"focus",C,f)}}}function zae(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(dr).forEach(n=>{dr[n].filter(o=>o.scope===t&&o.shortcut===e).forEach(o=>{o&&o.method&&o.method()})})}function od(e){const t=Object.values(dr).flat();if(t.findIndex(r=>{let{element:o}=r;return o===e})<0){const{keydownListener:r,keyupListenr:o,capture:i}=si.get(e)||{};r&&o&&(as(e,"keyup",o,i),as(e,"keydown",r,i),si.delete(e))}if((t.length<=0||si.size<=0)&&(Object.keys(si).forEach(o=>{const{keydownListener:i,keyupListenr:a,capture:s}=si.get(o)||{};i&&a&&(as(o,"keyup",a,s),as(o,"keydown",i,s),si.delete(o))}),si.clear(),Object.keys(dr).forEach(o=>delete dr[o]),cs)){const{listener:o,capture:i}=cs;as(window,"focus",o,i),cs=null}}const id={getPressedKeyString:Nae,setScope:$E,getScope:ds,deleteScope:Fae,getPressedKeyCodes:Rae,getAllKeyCodes:Pae,isPressed:Tae,filter:kae,trigger:zae,unbind:WE,keyMap:ss,modifier:Co,modifierMap:ls};for(const e in id)Object.prototype.hasOwnProperty.call(id,e)&&(W1[e]=id[e]);if(typeof window<"u"){const e=window.hotkeys;W1.noConflict=t=>(t&&window.hotkeys===W1&&(window.hotkeys=e),W1),window.hotkeys=W1}class Un extends D.Component{constructor(t){super(t),this.isKeyDown=!1,this.handle=void 0,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.handleKeyUpEvent=this.handleKeyUpEvent.bind(this),this.handle={}}componentDidMount(){var{filter:t,splitKey:n}=this.props;t&&(W1.filter=t),W1.unbind(this.props.keyName),W1(this.props.keyName,{splitKey:n},this.onKeyDown),document&&document.body.addEventListener("keyup",this.handleKeyUpEvent)}componentWillUnmount(){W1.unbind(this.props.keyName),this.isKeyDown=!0,this.handle={},document&&document.body.removeEventListener("keyup",this.handleKeyUpEvent)}onKeyUp(t,n){var{onKeyUp:r,disabled:o}=this.props;!o&&r&&r(n.shortcut,t,n)}onKeyDown(t,n){var{onKeyDown:r,allowRepeat:o,disabled:i}=this.props;this.isKeyDown&&!o||(this.isKeyDown=!0,this.handle=n,!i&&r&&r(n.shortcut,t,n))}handleKeyUpEvent(t){this.isKeyDown&&(this.isKeyDown=!1,!(this.props.keyName&&this.props.keyName.indexOf(this.handle.shortcut)<0)&&(this.onKeyUp(t,this.handle),this.handle={}))}render(){return this.props.children||null}}Un.defaultProps={filter(e){var t=e.target||e.srcElement,n=t.tagName;return!(t.isContentEditable||n==="INPUT"||n==="SELECT"||n==="TEXTAREA")}},Un.propTypes={keyName:n0.string,filter:n0.func,onKeyDown:n0.func,onKeyUp:n0.func,disabled:n0.bool,splitKey:n0.string};const YE=["shift","alt","meta","mod","ctrl","control"],Vae={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function $i(e){return(Vae[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function ZE(e){return YE.includes(e)}function ad(e,t=","){return e.toLowerCase().split(t)}function sd(e,t="+",n=">",r=!1,o){let i=[],a=!1;e.includes(n)?(a=!0,i=e.toLocaleLowerCase().split(n).map(u=>$i(u))):i=e.toLocaleLowerCase().split(t).map(u=>$i(u));const s={alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod"),useKey:r},l=i.filter(u=>!YE.includes(u));return{...s,keys:l,description:o,isSequence:a}}typeof document<"u"&&(document.addEventListener("keydown",e=>{e.code!==void 0&&XE([$i(e.code)])}),document.addEventListener("keyup",e=>{e.code!==void 0&&JE([$i(e.code)])})),typeof window<"u"&&(window.addEventListener("blur",()=>{li.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{li.clear()},0)}));const li=new Set;function ld(e){return Array.isArray(e)}function Uae(e,t=","){return(ld(e)?e:e.split(t)).every(n=>li.has(n.trim().toLowerCase()))}function XE(e){const t=Array.isArray(e)?e:[e];li.has("meta")&&li.forEach(n=>!ZE(n)&&li.delete(n.toLowerCase())),t.forEach(n=>li.add(n.toLowerCase()))}function JE(e){const t=Array.isArray(e)?e:[e];e==="meta"?li.clear():t.forEach(n=>li.delete(n.toLowerCase()))}function Kae(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function Qae(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function $ae(e){return eS(e,["input","textarea","select"])}function eS(e,t=!1){const{target:n,composed:r}=e;let o;return Wae(n)&&r?o=e.composedPath()[0]&&e.composedPath()[0].tagName:o=n&&n.tagName,ld(t)?!!(o&&t&&t.some(i=>i.toLowerCase()===o.toLowerCase())):!!(o&&t&&t)}function Wae(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function Gae(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}const qae=(e,t,n=!1)=>{const{alt:r,meta:o,mod:i,shift:a,ctrl:s,keys:l,useKey:u}=t,{code:d,key:f,ctrlKey:A,metaKey:C,shiftKey:m,altKey:v}=e,h=$i(d);if(u&&(l==null?void 0:l.length)===1&&l.includes(f))return!0;if(!(l!=null&&l.includes(h))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(h))return!1;if(!n){if(r!==v&&h!=="alt"||a!==m&&h!=="shift")return!1;if(i){if(!C&&!A)return!1}else if(o!==C&&h!=="meta"&&h!=="os"||s!==A&&h!=="ctrl"&&h!=="control")return!1}return l&&l.length===1&&l.includes(h)?!0:l?Uae(l):!l},Yae=D.createContext(void 0),Zae=()=>D.useContext(Yae);function tS(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce((n,r)=>n&&tS(e[r],t[r]),!0):e===t}const Xae=D.createContext({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),Jae=()=>D.useContext(Xae);function e9e(e){const t=D.useRef(void 0);return tS(t.current,e)||(t.current=e),t.current}const nS=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},t9e=typeof window<"u"?D.useLayoutEffect:D.useEffect;function rS(e,t,n,r){const o=D.useRef(null),i=D.useRef(!1),a=n instanceof Array?r instanceof Array?void 0:r:n,s=ld(e)?e.join(a==null?void 0:a.delimiter):e,l=n instanceof Array?n:r instanceof Array?r:void 0,u=D.useCallback(t,l??[]),d=D.useRef(u);l?d.current=u:d.current=t;const f=e9e(a),{activeScopes:A}=Jae(),C=Zae();return t9e(()=>{if((f==null?void 0:f.enabled)===!1||!Gae(A,f==null?void 0:f.scopes))return;let m=[],v;const h=(y,w=!1)=>{var E;if(!($ae(y)&&!eS(y,f==null?void 0:f.enableOnFormTags))){if(o.current!==null){const M=o.current.getRootNode();if((M instanceof Document||M instanceof ShadowRoot)&&M.activeElement!==o.current&&!o.current.contains(M.activeElement)){nS(y);return}}(E=y.target)!=null&&E.isContentEditable&&!(f!=null&&f.enableOnContentEditable)||ad(s,f==null?void 0:f.delimiter).forEach(M=>{var H,O,B,I;if(M.includes((f==null?void 0:f.splitKey)??"+")&&M.includes((f==null?void 0:f.sequenceSplitKey)??">")){console.warn(`Hotkey ${M} contains both ${(f==null?void 0:f.splitKey)??"+"} and ${(f==null?void 0:f.sequenceSplitKey)??">"} which is not supported.`);return}const L=sd(M,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description);if(L.isSequence){v=setTimeout(()=>{m=[]},(f==null?void 0:f.sequenceTimeoutMs)??1e3);const P=L.useKey?y.key:$i(y.code);if(ZE(P.toLowerCase()))return;m.push(P);const k=(H=L.keys)==null?void 0:H[m.length-1];if(P!==k){m=[],v&&clearTimeout(v);return}m.length===((O=L.keys)==null?void 0:O.length)&&(d.current(y,L),v&&clearTimeout(v),m=[])}else if(qae(y,L,f==null?void 0:f.ignoreModifiers)||(B=L.keys)!=null&&B.includes("*")){if((I=f==null?void 0:f.ignoreEventWhen)!=null&&I.call(f,y)||w&&i.current)return;if(Kae(y,L,f==null?void 0:f.preventDefault),!Qae(y,L,f==null?void 0:f.enabled)){nS(y);return}d.current(y,L),w||(i.current=!0)}})}},_=y=>{y.code!==void 0&&(XE($i(y.code)),((f==null?void 0:f.keydown)===void 0&&(f==null?void 0:f.keyup)!==!0||f!=null&&f.keydown)&&h(y))},b=y=>{y.code!==void 0&&(JE($i(y.code)),i.current=!1,f!=null&&f.keyup&&h(y,!0))},x=o.current||(a==null?void 0:a.document)||document;return x.addEventListener("keyup",b,a==null?void 0:a.eventListenerOptions),x.addEventListener("keydown",_,a==null?void 0:a.eventListenerOptions),C&&ad(s,f==null?void 0:f.delimiter).forEach(y=>C.addHotkey(sd(y,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description))),()=>{x.removeEventListener("keyup",b,a==null?void 0:a.eventListenerOptions),x.removeEventListener("keydown",_,a==null?void 0:a.eventListenerOptions),C&&ad(s,f==null?void 0:f.delimiter).forEach(y=>C.removeHotkey(sd(y,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description))),m=[],v&&clearTimeout(v)}},[s,f,A]),o}const oS=(e,t="",n="")=>X.jsx(mE,{className:t,children:X.jsx($7,{children:e.map(r=>X.jsx(hE,{children:r},r))},`row_${n}`)},n),n9e=({toggleSelectAnnotation:e=()=>{console.log("Not available")},handleLeftKeyDown:t=()=>{console.log("Not available")},handleRightKeyDown:n=()=>{console.log("Not available")},handleUpKeyDown:r=()=>{console.log("Not available")},handleDownKeyDown:o=()=>{console.log("Not available")},handleZoomInClick:i=()=>{console.log("Not available")},handleZoomOutClick:a=()=>{console.log("Not available")},handleCompleteAnnotation:s=()=>{console.log("Not available")},undoAnnotationPoint:l=()=>{console.log("Not available")},reLoadAndReDrawAnnotations:u=()=>{console.log("Not available")},togglePagination:d=()=>{console.log("Not available")},toggleFullscreen:f=()=>{console.log("Not available")},switchToAutoAnnotations:A=()=>{console.log("Not available")},openShortCutRequestDetails:C=()=>{console.log("Not available")},handleRecentAnnotatedVerifiedImages:m=()=>{console.log("Not available")},handleSendToSamFunctionPrompt:v=()=>{console.log("Not available")},samAPIactive:h,request:_,switchToEditMode:b=()=>{console.log("Not available")},switchToCreateMode:x=()=>{console.log("Not available")},goToNextImage:y=()=>{console.log("Not available")},goToPreviousImage:w=()=>{console.log("Not available")},loggedUser:E,handleGoToPendingAnnotations:M=()=>{console.log("Not available")},handleCopyByCtrlC:H=()=>{console.log("Not available")},handlePasteAnnotationsByControlV:O=()=>{console.log("Not available")},openShortCutKeyModal:B,setOpenShortCutKeyModal:I=()=>{console.log("Not available")},setIsAltViaToolPressHandle:L=()=>{console.log("Not available")},isCarousel:P=!1,selectedTool:k="",setCrossHairHandle:N=()=>{console.log("Not available")},controlMinusHotkey:R=()=>{console.log("Not available")},controlPlusHotkey:F=()=>{console.log("Not available")}})=>{const j=n3.isSAMAllowed(_==null?void 0:_.awi_annotation_type,_==null?void 0:_.awi_request_for)&&!h,Q=["awi_annotator","awi_verifier","awi_developer"].includes(E.userObj.awi_level),V=()=>{const $=[{action:"next image",key:"next_image",displayKey:"d",title:"Move to the next image",isClose:!0},{action:"previous image",key:"prev_image",displayKey:"a",title:"Move to the previous image",isClose:!0}],U=[{action:"Go to pending annotation",key:"pending_annotations",displayKey:"p",title:"Go to pending annotation",isClose:!0}],q=[{action:"Switch to edit",key:"edit_mode",displayKey:"e",title:"Switch to edit mode",isClose:!0},{action:"Switch to create",key:"create_mode",displayKey:"q",title:"Switch to create mode",isClose:!0},{action:"Switch to pan mode",key:"pan_mode",displayKey:"m",title:"Switch to pan mode",isClose:!0},{action:"Show cross hair",key:"cross_hair",displayKey:"w",title:"Show cross hair",isClose:!0},{action:"Copy selected annotation",key:"copy",displayKey:"Ctrl + C",title:"Copy selected annotation",isClose:!1},{action:"Paste all annotations",key:"paste",displayKey:"Ctrl + V",title:"Paste all copied annotations",isClose:!1},{action:"Forward Toggle Annotations",key:"select_forward",displayKey:"T",title:"Forward Toggle annotations visibility, Long press to get next",isClose:!1},{action:"Backward Toggle Annotations",key:"select_backward",displayKey:"U",title:"Backward Toggle annotations visibility, Long press to get previous",isClose:!1},{action:"Go to last updated annotations",key:"select_last_update",displayKey:"L",title:"Go to last updated annotations",isClose:!0},{action:"Undo Annotation point / Last State",key:"undo",displayKey:"Ctrl + Z",title:"Undo last annotation action",isClose:!0},{action:"Complete Annotation / Generate Point Annotations",key:"complete",displayKey:"Enter",title:"Finalize or generate point annotations",isClose:!0},{action:"Switch to Auto Annotations",key:"auto_annotations",displayKey:"S",title:"Enable automatic annotation mode",isClose:!0},{action:"AI prompt popup",key:"send_to_sam",displayKey:"X (if AI is enabled)",title:"AI prompt popup",isClose:!0},{action:"Get request information",key:"open_shortcut_details",displayKey:"V",title:"View request-related information",isClose:!0},{action:"Refetch Annotations",key:"reload",displayKey:"R",title:"Reload annotations",isClose:!0},{action:"Toggle Image Pagination",key:"toggle_pagination",displayKey:"H",title:"Show or hide image pagination",isClose:!1},{action:"Zoom In",key:"zoom_in",displayKey:"I",title:"Zoom into the image, long press for more zoom in",isClose:!1},{action:"Zoom Out",key:"zoom_out",displayKey:"O",title:"Zoom out of the image, long press for more zoom out",isClose:!1},{action:"Moving Zoomed images",key:"",displayKey:"Alt + Mouse Move",title:"Move the zoomed-in image",isClose:!1},{action:"View Recently Annotated Images",key:"recent_verified",displayKey:"Alt + R",title:"Show recently annotated images",isClose:!0},{action:"Delete Annotation",key:"",displayKey:"Ctrl + Delete",title:"Delete the selected annotation",isClose:!1},{action:"Move image to left",key:"move_left",displayKey:"←",title:"Move image to left",isClose:!1},{action:"Move image to right",key:"move_right",displayKey:"→",title:"Move image to right",isClose:!1},{action:"Move image to top",key:"move_up",displayKey:"↑",title:"Move image to top",isClose:!1},{action:"Move image to bottom",key:"move_down",displayKey:"↓",title:"Move image to bottom",isClose:!1},{action:"Enter/Exit Fullscreen",key:"fullscreen",displayKey:"F",title:"Enter/Exit Fullscreen",isClose:!1}];return E.userObj.awi_level==="awi_verifier"?[...$,...q,...U]:E.userObj.awi_level==="awi_supervisor"?$:[...$,...q]},T=$=>{switch($){case"select_forward":return e("forward");case"select_backward":return e("backward");case"select_last_update":return e("last_update");case"move_left":return t();case"move_right":return n();case"move_up":return r();case"move_down":return o();case"zoom_in":return i();case"zoom_out":return a();case"complete":return s();case"undo":return l();case"reload":return u();case"toggle_pagination":return d(U=>!U);case"fullscreen":return f();case"auto_annotations":return A();case"open_shortcut_details":return C();case"recent_verified":return m();case"send_to_sam":if(j)return k!="SAM"&&A(),v();is.error("SAM is not allowed");return;case"edit_mode":if(b)return b();break;case"create_mode":if(x)return x();break;case"next_image":if(y)return y();break;case"prev_image":if(w)return w();break;case"pending_annotations":if(M)return M();break;case"copy":if(H)return H();break;case"paste":if(O)return O();break;case"pan_mode":L();break;case"cross_hair":N&&typeof N=="function"&&N();break;default:console.warn(`Unhandled hotkey action: ${$}`)}},K=($,U)=>{T($),U&&I(!1)};return rS("ctrl+=",$=>{$.preventDefault(),F()}),rS("ctrl+-, ctrl+subtract, ctrl+minus",$=>{$.preventDefault(),R()}),X.jsxs(X.Fragment,{children:[X.jsx(Un,{allowRepeat:!0,keyName:"t",onKeyDown:()=>T("select_forward")}),X.jsx(Un,{allowRepeat:!0,keyName:"u",onKeyDown:()=>T("select_backward")}),X.jsx(Un,{allowRepeat:!1,keyName:"l",onKeyDown:()=>T("select_last_update")}),X.jsx(Un,{allowRepeat:!0,keyName:"left",onKeyDown:()=>T("move_left")}),X.jsx(Un,{allowRepeat:!0,keyName:"right",onKeyDown:()=>T("move_right")}),X.jsx(Un,{allowRepeat:!0,keyName:"up",onKeyDown:()=>T("move_up")}),X.jsx(Un,{allowRepeat:!0,keyName:"down",onKeyDown:()=>T("move_down")}),X.jsx(Un,{allowRepeat:!0,keyName:"i",onKeyDown:()=>T("zoom_in")}),X.jsx(Un,{allowRepeat:!0,keyName:"o",onKeyDown:()=>T("zoom_out")}),X.jsx(Un,{keyName:"enter",onKeyDown:()=>T("complete")}),X.jsx(Un,{keyName:"ctrl+z",onKeyDown:()=>T("undo")}),X.jsx(Un,{keyName:"r",onKeyDown:()=>T("reload")}),X.jsx(Un,{keyName:"h",onKeyDown:()=>T("toggle_pagination")}),X.jsx(Un,{keyName:"f",onKeyDown:()=>T("fullscreen")}),X.jsx(Un,{keyName:"s",onKeyDown:()=>T("auto_annotations")}),X.jsx(Un,{keyName:"v",onKeyDown:()=>T("open_shortcut_details")}),X.jsx(Un,{keyName:"alt+r",onKeyDown:()=>T("recent_verified")}),j&&X.jsx(Un,{keyName:"x",onKeyDown:()=>T("send_to_sam")}),Q&&X.jsxs(X.Fragment,{children:[X.jsx(Un,{keyName:"e",onKeyDown:()=>T("edit_mode")}),X.jsx(Un,{keyName:"q",onKeyDown:()=>T("create_mode")})]}),X.jsx(Un,{keyName:"d",onKeyDown:()=>T("next_image")}),X.jsx(Un,{keyName:"a",onKeyDown:()=>T("prev_image")}),E.userObj.awi_level==="awi_verifier"&&X.jsx(Un,{keyName:"p",onKeyDown:()=>T("pending_annotations")}),X.jsx(Un,{keyName:"ctrl+c",onKeyDown:()=>T("copy")}),X.jsx(Un,{keyName:"ctrl+v",onKeyDown:()=>T("paste")}),X.jsx(Un,{keyName:"m",onKeyDown:()=>T("pan_mode")}),X.jsx(Un,{keyName:"w",onKeyDown:()=>T("cross_hair")}),B&&!P&&X.jsx(X.Fragment,{children:X.jsxs(V7,{popupPosition:"right",isBackdrop:!0,backdropAction:()=>I(!1),className:"noPadding",children:[X.jsx(U7,{title:"Shortcut keys",onClose:()=>I(!1)}),X.jsx(K7,{children:X.jsxs(pE,{children:[X.jsx(oS,{list:["S.NO.","Command","Key Binding","Action"]},"short_cut_keys"),X.jsx(CE,{children:(V()||[]).map(($,U)=>{var q;return X.jsxs($7,{title:$.title,children:[X.jsx(es,{children:U+1}),X.jsx(es,{children:$.action}),X.jsx(es,{children:X.jsxs("div",{className:"shortcutKey",children:[" ",$.displayKey," "]})}),X.jsx(es,{children:((q=$==null?void 0:$.key)==null?void 0:q.length)>0&&X.jsx("button",{className:"modalButton modalButton__purpleColor",onClick:()=>K($.key,$.isClose),children:"Press"})})]})})})]})}),X.jsx(Q7,{})]})})]})},r9e=()=>{const e=D.useRef(!1),t=D.useRef(!1);return D.useEffect(()=>{const o=l=>{l.key==="Control"&&(e.current=!0,is.success("Control pressed, Handling control press events")),l.key==="Alt"&&(t.current=!0,is.success("Alt pressed, Handling alt press events")),l.key==="Command"&&(e.current=!0,is.success("Command pressed, Handling command press events"))},i=l=>{l.key==="Control"&&(e.current=!1),l.key==="Alt"&&(t.current=!1),l.key==="Command"&&(e.current=!1)},a=()=>{document.hidden&&(e.current=!1,t.current=!1)},s=()=>{e.current=!1,t.current=!1};return window.addEventListener("keydown",o),window.addEventListener("keyup",i),document.addEventListener("visibilitychange",a),window.addEventListener("blur",s),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",i),document.removeEventListener("visibilitychange",a),window.removeEventListener("blur",s)}},[]),{isCtrlPressedFunc:()=>e.current,isAltPressedFunc:()=>t.current}};function o9e(e=1,t=1){const[n,r]=D.useState(e),[o,i]=D.useState(t),a=D.useCallback(u=>{u>=1&&u<=o?r(u):console.error(`Invalid page number: ${u}`)},[o]),s=D.useCallback(()=>{a(n+1)},[n,a]),l=D.useCallback(()=>{a(n-1)},[n,a]);return{currentPage:n,setPage:a,nextPage:s,prevPage:l,totalPages:o,setTotalPages:i}}const iS=(e,t="",n)=>{!n||!e||Ho.forEach(e,(r,o)=>{const i=`--${t}${o}`;Ho.isObject(r)&&!Ho.isArray(r)?iS(r,`${t}${o}-`,n):typeof r=="string"&&n.style.setProperty(i,r)})},aS=(e,t="",n)=>{!n||!e||Ho.forEach(e,(r,o)=>{const i=`--${t}${o}`;Ho.isObject(r)&&!Ho.isArray(r)?aS(r,`${t}${o}-`,n):n.style.removeProperty(i)})},i9e=(e,t="")=>{const n={},r=(o,i)=>{Ho.forEach(o,(a,s)=>{const l=`--${t}${i}${s}`;Ho.isObject(a)&&!Ho.isArray(a)?r(a,`${i}${s}-`):typeof a=="string"&&(n[`${i}${s}`.toUpperCase().replace(/-/g,"_")]=`var(${l})`)})};return r(e,""),n},sS=D.createContext({}),a9e="awi-color-",s9e="awi-size-",l9e="awi-weight-",cd=(e,t,n)=>(D.useEffect(()=>{if(Ho.isEqual(n.current,e))return;const r=document.documentElement;return iS(e,t,r),()=>aS(e,t,r)},[e,n,t]),e?i9e(e,t):{}),c9e=({theme:e=xf,log:t=!0,children:n})=>{const r=D.useRef(null),o=D.useRef(null),i=D.useRef(null),a=cd(e.colors,a9e,r),s=cd(e.sizes,s9e,o),l=cd(e.weights,l9e,i);return t&&(console.group("Theme Variables"),console.table(a),console.table(s),console.table(l),console.groupEnd()),X.jsxs(sS.Provider,{value:{...a,...s,...l},children:[X.jsx(BE,{}),n]})},u9e=()=>{const e=D.useContext(sS);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},d9e=()=>({success:(e,t)=>r6("success",e,t),error:(e,t)=>r6("error",e,t),info:(e,t)=>r6("info",e,t),warning:(e,t)=>r6("warning",e,t)});Ht.AWI_ALL_GLOBALS=xi,Ht.AWI_IMAGE_VALIDITY_HELPER=PI,Ht.AwiAnnotationHotkeys=n9e,Ht.AwiEmptyState=wie,Ht.AwiGenerateHeader=oS,Ht.AwiHelperMethods=n3,Ht.AwiInput=bE,Ht.AwiLoadMoreButton=Eie,Ht.AwiMessageScreen=o6,Ht.AwiModal=V7,Ht.AwiModalBody=K7,Ht.AwiModalFooter=Q7,Ht.AwiModalHeader=U7,Ht.AwiModalRow=J5,Ht.AwiPagination=vE,Ht.AwiSafeLocalStorage=qa,Ht.AwiSamModal=Hie,Ht.AwiScrollableTableCellList=Sie,Ht.AwiSlider=xE,Ht.AwiTableBody=CE,Ht.AwiTableCell=es,Ht.AwiTableHeader=hE,Ht.AwiTableHeaders=mE,Ht.AwiTableInfinite=pE,Ht.AwiTableRow=$7,Ht.AwiToastMessage=is,Ht.AwiUseKeyChecker=r9e,Ht.Backdrop=AE,Ht.Badge=jI,Ht.Button=k1,Ht.ButtonGroup=rP,Ht.Chart=Gj,Ht.CompactEventCard=WC,Ht.ContactInput=cie,Ht.DEFAULT_THEME=xf,Ht.DateRangePicker=Aie,Ht.DetectionCarousel=cE,Ht.EventPreview=Cie,Ht.Icon=_i,Ht.Input=K0,Ht.MathAnnotationHelper=NI,Ht.Modal=mie,Ht.Multiselect=pie,Ht.Pagination=vie,Ht.Select=aE,Ht.Sidebar=bie,Ht.Spinner=l3,Ht.Switch=xie,Ht.Table=_ie,Ht.ThemeProvider=c9e,Ht.Toast=fE,Ht.ToastProvider=BE,Ht.usePagination=o9e,Ht.useTheme=u9e,Ht.useToast=d9e,Object.defineProperty(Ht,Symbol.toStringTag,{value:"Module"})});
|
|
653
|
+
Valid keys: `+JSON.stringify(Object.keys(V),null," "));var re=ie(ne,ue,U,q,te+"."+ue,n);if(re)return re}return null}return h(T)}function k(V){switch(typeof V){case"number":case"string":case"undefined":return!0;case"boolean":return!V;case"object":if(Array.isArray(V))return V.every(k);if(V===null||s(V))return!0;var T=f(V);if(T){var K=T.call(V),$;if(T!==V.entries){for(;!($=K.next()).done;)if(!k($.value))return!1}else for(;!($=K.next()).done;){var U=$.value;if(U&&!k(U[1]))return!1}}else return!1;return!0;default:return!1}}function N(V,T){return V==="symbol"?!0:T?T["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&T instanceof Symbol:!1}function R(V){var T=typeof V;return Array.isArray(V)?"array":V instanceof RegExp?"object":N(T,V)?"symbol":T}function F(V){if(typeof V>"u"||V===null)return""+V;var T=R(V);if(T==="object"){if(V instanceof Date)return"date";if(V instanceof RegExp)return"regexp"}return T}function j(V){var T=F(V);switch(T){case"array":case"object":return"an "+T;case"boolean":case"date":case"regexp":return"a "+T;default:return T}}function Q(V){return!V.constructor||!V.constructor.name?A:V.constructor.name}return C.checkPropTypes=o,C.resetWarningCache=o.resetWarningCache,C.PropTypes=C,C},ed}var td,zE;function Oae(){if(zE)return td;zE=1;var e=Z7();function t(){}function n(){}return n.resetWarningCache=t,td=function(){function r(a,s,l,u,d,f){if(f!==e){var A=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw A.name="Invariant Violation",A}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},td}var VE;function Bae(){if(VE)return u6.exports;if(VE=1,process.env.NODE_ENV!=="production"){var e=RE(),t=!0;u6.exports=Mae()(e.isElement,t)}else u6.exports=Oae()();return u6.exports}var n0=Bae();const nd=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function rd(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),n)}function as(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent("on".concat(t),n)}function UE(e,t){const n=t.slice(0,t.length-1);for(let r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function KE(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let n=t.lastIndexOf("");for(;n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function Iae(e,t){const n=e.length>=t.length?e:t,r=e.length>=t.length?t:e;let o=!0;for(let i=0;i<n.length;i++)r.indexOf(n[i])===-1&&(o=!1);return o}const ss={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":nd?173:189,"=":nd?61:187,";":nd?59:186,"'":222,"[":219,"]":221,"\\":220},Co={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},ls={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Yr={16:!1,18:!1,17:!1,91:!1},dr={};for(let e=1;e<20;e++)ss["f".concat(e)]=111+e;let sr=[],cs=null,QE="all";const si=new Map,us=e=>ss[e.toLowerCase()]||Co[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),Dae=e=>Object.keys(ss).find(t=>ss[t]===e),Lae=e=>Object.keys(Co).find(t=>Co[t]===e);function $E(e){QE=e||"all"}function ds(){return QE||"all"}function Rae(){return sr.slice(0)}function Nae(){return sr.map(e=>Dae(e)||Lae(e)||String.fromCharCode(e))}function Pae(){const e=[];return Object.keys(dr).forEach(t=>{dr[t].forEach(n=>{let{key:r,scope:o,mods:i,shortcut:a}=n;e.push({scope:o,shortcut:a,mods:i,keys:r.split("+").map(s=>us(s))})})}),e}function kae(e){const t=e.target||e.srcElement,{tagName:n}=t;let r=!0;const o=n==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(o||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function Tae(e){return typeof e=="string"&&(e=us(e)),sr.indexOf(e)!==-1}function Fae(e,t){let n,r;e||(e=ds());for(const o in dr)if(Object.prototype.hasOwnProperty.call(dr,o))for(n=dr[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1).forEach(a=>{let{element:s}=a;return od(s)}):r++;ds()===e&&$E(t||"all")}function jae(e){let t=e.keyCode||e.which||e.charCode;const n=sr.indexOf(t);if(n>=0&&sr.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&sr.splice(0,sr.length),(t===93||t===224)&&(t=91),t in Yr){Yr[t]=!1;for(const r in Co)Co[r]===t&&(W1[r]=!1)}}function WE(e){if(typeof e>"u")Object.keys(dr).forEach(o=>{Array.isArray(dr[o])&&dr[o].forEach(i=>f6(i)),delete dr[o]}),od(null);else if(Array.isArray(e))e.forEach(o=>{o.key&&f6(o)});else if(typeof e=="object")e.key&&f6(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let[o,i]=n;typeof o=="function"&&(i=o,o=""),f6({key:e,scope:o,method:i,splitKey:"+"})}}const f6=e=>{let{key:t,scope:n,method:r,splitKey:o="+"}=e;KE(t).forEach(a=>{const s=a.split(o),l=s.length,u=s[l-1],d=u==="*"?"*":us(u);if(!dr[d])return;n||(n=ds());const f=l>1?UE(Co,s):[],A=[];dr[d]=dr[d].filter(C=>{const v=(r?C.method===r:!0)&&C.scope===n&&Iae(C.mods,f);return v&&A.push(C.element),!v}),A.forEach(C=>od(C))})};function GE(e,t,n,r){if(t.element!==r)return;let o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(const i in Yr)Object.prototype.hasOwnProperty.call(Yr,i)&&(!Yr[i]&&t.mods.indexOf(+i)>-1||Yr[i]&&t.mods.indexOf(+i)===-1)&&(o=!1);(t.mods.length===0&&!Yr[16]&&!Yr[18]&&!Yr[17]&&!Yr[91]||o||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(sr),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function qE(e,t){const n=dr["*"];let r=e.keyCode||e.which||e.charCode;if(!W1.filter.call(this,e))return;if((r===93||r===224)&&(r=91),sr.indexOf(r)===-1&&r!==229&&sr.push(r),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{const l=ls[s];e[s]&&sr.indexOf(l)===-1?sr.push(l):!e[s]&&sr.indexOf(l)>-1?sr.splice(sr.indexOf(l),1):s==="metaKey"&&e[s]&&(sr=sr.filter(u=>u in ls||u===r))}),r in Yr){Yr[r]=!0;for(const s in Co)if(Object.prototype.hasOwnProperty.call(Co,s)){const l=ls[Co[s]];W1[s]=e[l]}if(!n)return}for(const s in Yr)Object.prototype.hasOwnProperty.call(Yr,s)&&(Yr[s]=e[ls[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(sr.indexOf(17)===-1&&sr.push(17),sr.indexOf(18)===-1&&sr.push(18),Yr[17]=!0,Yr[18]=!0);const o=ds();if(n)for(let s=0;s<n.length;s++)n[s].scope===o&&(e.type==="keydown"&&n[s].keydown||e.type==="keyup"&&n[s].keyup)&&GE(e,n[s],o,t);if(!(r in dr))return;const i=dr[r],a=i.length;for(let s=0;s<a;s++)if((e.type==="keydown"&&i[s].keydown||e.type==="keyup"&&i[s].keyup)&&i[s].key){const l=i[s],{splitKey:u}=l,d=l.key.split(u),f=[];for(let A=0;A<d.length;A++)f.push(us(d[A]));f.sort().join("")===sr.sort().join("")&&GE(e,l,o,t)}}function W1(e,t,n){sr=[];const r=KE(e);let o=[],i="all",a=document,s=0,l=!1,u=!0,d="+",f=!1,A=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(i=t.scope),t.element&&(a=t.element),t.keyup&&(l=t.keyup),t.keydown!==void 0&&(u=t.keydown),t.capture!==void 0&&(f=t.capture),typeof t.splitKey=="string"&&(d=t.splitKey),t.single===!0&&(A=!0)),typeof t=="string"&&(i=t),A&&WE(e,i);s<r.length;s++)e=r[s].split(d),o=[],e.length>1&&(o=UE(Co,e)),e=e[e.length-1],e=e==="*"?"*":us(e),e in dr||(dr[e]=[]),dr[e].push({keyup:l,keydown:u,scope:i,mods:o,shortcut:r[s],method:n,key:r[s],splitKey:d,element:a});if(typeof a<"u"&&window){if(!si.has(a)){const C=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return qE(v,a)},m=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;qE(v,a),jae(v)};si.set(a,{keydownListener:C,keyupListenr:m,capture:f}),rd(a,"keydown",C,f),rd(a,"keyup",m,f)}if(!cs){const C=()=>{sr=[]};cs={listener:C,capture:f},rd(window,"focus",C,f)}}}function zae(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(dr).forEach(n=>{dr[n].filter(o=>o.scope===t&&o.shortcut===e).forEach(o=>{o&&o.method&&o.method()})})}function od(e){const t=Object.values(dr).flat();if(t.findIndex(r=>{let{element:o}=r;return o===e})<0){const{keydownListener:r,keyupListenr:o,capture:i}=si.get(e)||{};r&&o&&(as(e,"keyup",o,i),as(e,"keydown",r,i),si.delete(e))}if((t.length<=0||si.size<=0)&&(Object.keys(si).forEach(o=>{const{keydownListener:i,keyupListenr:a,capture:s}=si.get(o)||{};i&&a&&(as(o,"keyup",a,s),as(o,"keydown",i,s),si.delete(o))}),si.clear(),Object.keys(dr).forEach(o=>delete dr[o]),cs)){const{listener:o,capture:i}=cs;as(window,"focus",o,i),cs=null}}const id={getPressedKeyString:Nae,setScope:$E,getScope:ds,deleteScope:Fae,getPressedKeyCodes:Rae,getAllKeyCodes:Pae,isPressed:Tae,filter:kae,trigger:zae,unbind:WE,keyMap:ss,modifier:Co,modifierMap:ls};for(const e in id)Object.prototype.hasOwnProperty.call(id,e)&&(W1[e]=id[e]);if(typeof window<"u"){const e=window.hotkeys;W1.noConflict=t=>(t&&window.hotkeys===W1&&(window.hotkeys=e),W1),window.hotkeys=W1}class Un extends D.Component{constructor(t){super(t),this.isKeyDown=!1,this.handle=void 0,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.handleKeyUpEvent=this.handleKeyUpEvent.bind(this),this.handle={}}componentDidMount(){var{filter:t,splitKey:n}=this.props;t&&(W1.filter=t),W1.unbind(this.props.keyName),W1(this.props.keyName,{splitKey:n},this.onKeyDown),document&&document.body.addEventListener("keyup",this.handleKeyUpEvent)}componentWillUnmount(){W1.unbind(this.props.keyName),this.isKeyDown=!0,this.handle={},document&&document.body.removeEventListener("keyup",this.handleKeyUpEvent)}onKeyUp(t,n){var{onKeyUp:r,disabled:o}=this.props;!o&&r&&r(n.shortcut,t,n)}onKeyDown(t,n){var{onKeyDown:r,allowRepeat:o,disabled:i}=this.props;this.isKeyDown&&!o||(this.isKeyDown=!0,this.handle=n,!i&&r&&r(n.shortcut,t,n))}handleKeyUpEvent(t){this.isKeyDown&&(this.isKeyDown=!1,!(this.props.keyName&&this.props.keyName.indexOf(this.handle.shortcut)<0)&&(this.onKeyUp(t,this.handle),this.handle={}))}render(){return this.props.children||null}}Un.defaultProps={filter(e){var t=e.target||e.srcElement,n=t.tagName;return!(t.isContentEditable||n==="INPUT"||n==="SELECT"||n==="TEXTAREA")}},Un.propTypes={keyName:n0.string,filter:n0.func,onKeyDown:n0.func,onKeyUp:n0.func,disabled:n0.bool,splitKey:n0.string};const YE=["shift","alt","meta","mod","ctrl","control"],Vae={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function $i(e){return(Vae[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function ZE(e){return YE.includes(e)}function ad(e,t=","){return e.toLowerCase().split(t)}function sd(e,t="+",n=">",r=!1,o){let i=[],a=!1;e.includes(n)?(a=!0,i=e.toLocaleLowerCase().split(n).map(u=>$i(u))):i=e.toLocaleLowerCase().split(t).map(u=>$i(u));const s={alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod"),useKey:r},l=i.filter(u=>!YE.includes(u));return{...s,keys:l,description:o,isSequence:a}}typeof document<"u"&&(document.addEventListener("keydown",e=>{e.code!==void 0&&XE([$i(e.code)])}),document.addEventListener("keyup",e=>{e.code!==void 0&&JE([$i(e.code)])})),typeof window<"u"&&(window.addEventListener("blur",()=>{li.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{li.clear()},0)}));const li=new Set;function ld(e){return Array.isArray(e)}function Uae(e,t=","){return(ld(e)?e:e.split(t)).every(n=>li.has(n.trim().toLowerCase()))}function XE(e){const t=Array.isArray(e)?e:[e];li.has("meta")&&li.forEach(n=>!ZE(n)&&li.delete(n.toLowerCase())),t.forEach(n=>li.add(n.toLowerCase()))}function JE(e){const t=Array.isArray(e)?e:[e];e==="meta"?li.clear():t.forEach(n=>li.delete(n.toLowerCase()))}function Kae(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function Qae(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function $ae(e){return eS(e,["input","textarea","select"])}function eS(e,t=!1){const{target:n,composed:r}=e;let o;return Wae(n)&&r?o=e.composedPath()[0]&&e.composedPath()[0].tagName:o=n&&n.tagName,ld(t)?!!(o&&t&&t.some(i=>i.toLowerCase()===o.toLowerCase())):!!(o&&t&&t)}function Wae(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function Gae(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}const qae=(e,t,n=!1)=>{const{alt:r,meta:o,mod:i,shift:a,ctrl:s,keys:l,useKey:u}=t,{code:d,key:f,ctrlKey:A,metaKey:C,shiftKey:m,altKey:v}=e,h=$i(d);if(u&&(l==null?void 0:l.length)===1&&l.includes(f))return!0;if(!(l!=null&&l.includes(h))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(h))return!1;if(!n){if(r!==v&&h!=="alt"||a!==m&&h!=="shift")return!1;if(i){if(!C&&!A)return!1}else if(o!==C&&h!=="meta"&&h!=="os"||s!==A&&h!=="ctrl"&&h!=="control")return!1}return l&&l.length===1&&l.includes(h)?!0:l?Uae(l):!l},Yae=D.createContext(void 0),Zae=()=>D.useContext(Yae);function tS(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce((n,r)=>n&&tS(e[r],t[r]),!0):e===t}const Xae=D.createContext({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),Jae=()=>D.useContext(Xae);function e9e(e){const t=D.useRef(void 0);return tS(t.current,e)||(t.current=e),t.current}const nS=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},t9e=typeof window<"u"?D.useLayoutEffect:D.useEffect;function rS(e,t,n,r){const o=D.useRef(null),i=D.useRef(!1),a=n instanceof Array?r instanceof Array?void 0:r:n,s=ld(e)?e.join(a==null?void 0:a.delimiter):e,l=n instanceof Array?n:r instanceof Array?r:void 0,u=D.useCallback(t,l??[]),d=D.useRef(u);l?d.current=u:d.current=t;const f=e9e(a),{activeScopes:A}=Jae(),C=Zae();return t9e(()=>{if((f==null?void 0:f.enabled)===!1||!Gae(A,f==null?void 0:f.scopes))return;let m=[],v;const h=(y,w=!1)=>{var E;if(!($ae(y)&&!eS(y,f==null?void 0:f.enableOnFormTags))){if(o.current!==null){const M=o.current.getRootNode();if((M instanceof Document||M instanceof ShadowRoot)&&M.activeElement!==o.current&&!o.current.contains(M.activeElement)){nS(y);return}}(E=y.target)!=null&&E.isContentEditable&&!(f!=null&&f.enableOnContentEditable)||ad(s,f==null?void 0:f.delimiter).forEach(M=>{var H,O,B,I;if(M.includes((f==null?void 0:f.splitKey)??"+")&&M.includes((f==null?void 0:f.sequenceSplitKey)??">")){console.warn(`Hotkey ${M} contains both ${(f==null?void 0:f.splitKey)??"+"} and ${(f==null?void 0:f.sequenceSplitKey)??">"} which is not supported.`);return}const L=sd(M,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description);if(L.isSequence){v=setTimeout(()=>{m=[]},(f==null?void 0:f.sequenceTimeoutMs)??1e3);const P=L.useKey?y.key:$i(y.code);if(ZE(P.toLowerCase()))return;m.push(P);const k=(H=L.keys)==null?void 0:H[m.length-1];if(P!==k){m=[],v&&clearTimeout(v);return}m.length===((O=L.keys)==null?void 0:O.length)&&(d.current(y,L),v&&clearTimeout(v),m=[])}else if(qae(y,L,f==null?void 0:f.ignoreModifiers)||(B=L.keys)!=null&&B.includes("*")){if((I=f==null?void 0:f.ignoreEventWhen)!=null&&I.call(f,y)||w&&i.current)return;if(Kae(y,L,f==null?void 0:f.preventDefault),!Qae(y,L,f==null?void 0:f.enabled)){nS(y);return}d.current(y,L),w||(i.current=!0)}})}},_=y=>{y.code!==void 0&&(XE($i(y.code)),((f==null?void 0:f.keydown)===void 0&&(f==null?void 0:f.keyup)!==!0||f!=null&&f.keydown)&&h(y))},b=y=>{y.code!==void 0&&(JE($i(y.code)),i.current=!1,f!=null&&f.keyup&&h(y,!0))},x=o.current||(a==null?void 0:a.document)||document;return x.addEventListener("keyup",b,a==null?void 0:a.eventListenerOptions),x.addEventListener("keydown",_,a==null?void 0:a.eventListenerOptions),C&&ad(s,f==null?void 0:f.delimiter).forEach(y=>C.addHotkey(sd(y,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description))),()=>{x.removeEventListener("keyup",b,a==null?void 0:a.eventListenerOptions),x.removeEventListener("keydown",_,a==null?void 0:a.eventListenerOptions),C&&ad(s,f==null?void 0:f.delimiter).forEach(y=>C.removeHotkey(sd(y,f==null?void 0:f.splitKey,f==null?void 0:f.sequenceSplitKey,f==null?void 0:f.useKey,f==null?void 0:f.description))),m=[],v&&clearTimeout(v)}},[s,f,A]),o}const oS=({list:e,headerClass:t="",type:n=""})=>(console.log("AWIHEADER List,",e),X.jsx(mE,{className:t,children:X.jsx($7,{children:e.map(r=>X.jsx(hE,{children:r},r))},`row_${n}`)},n)),n9e=({toggleSelectAnnotation:e=()=>{console.log("Not available")},handleLeftKeyDown:t=()=>{console.log("Not available")},handleRightKeyDown:n=()=>{console.log("Not available")},handleUpKeyDown:r=()=>{console.log("Not available")},handleDownKeyDown:o=()=>{console.log("Not available")},handleZoomInClick:i=()=>{console.log("Not available")},handleZoomOutClick:a=()=>{console.log("Not available")},handleCompleteAnnotation:s=()=>{console.log("Not available")},undoAnnotationPoint:l=()=>{console.log("Not available")},reLoadAndReDrawAnnotations:u=()=>{console.log("Not available")},togglePagination:d=()=>{console.log("Not available")},toggleFullscreen:f=()=>{console.log("Not available")},switchToAutoAnnotations:A=()=>{console.log("Not available")},openShortCutRequestDetails:C=()=>{console.log("Not available")},handleRecentAnnotatedVerifiedImages:m=()=>{console.log("Not available")},handleSendToSamFunctionPrompt:v=()=>{console.log("Not available")},samAPIactive:h,request:_,switchToEditMode:b=()=>{console.log("Not available")},switchToCreateMode:x=()=>{console.log("Not available")},goToNextImage:y=()=>{console.log("Not available")},goToPreviousImage:w=()=>{console.log("Not available")},loggedUser:E,handleGoToPendingAnnotations:M=()=>{console.log("Not available")},handleCopyByCtrlC:H=()=>{console.log("Not available")},handlePasteAnnotationsByControlV:O=()=>{console.log("Not available")},openShortCutKeyModal:B,setOpenShortCutKeyModal:I=()=>{console.log("Not available")},setIsAltViaToolPressHandle:L=()=>{console.log("Not available")},isCarousel:P=!1,selectedTool:k="",setCrossHairHandle:N=()=>{console.log("Not available")},controlMinusHotkey:R=()=>{console.log("Not available")},controlPlusHotkey:F=()=>{console.log("Not available")}})=>{const j=n3.isSAMAllowed(_==null?void 0:_.awi_annotation_type,_==null?void 0:_.awi_request_for)&&!h,Q=["awi_annotator","awi_verifier","awi_developer"].includes(E.userObj.awi_level),V=()=>{const $=[{action:"next image",key:"next_image",displayKey:"d",title:"Move to the next image",isClose:!0},{action:"previous image",key:"prev_image",displayKey:"a",title:"Move to the previous image",isClose:!0}],U=[{action:"Go to pending annotation",key:"pending_annotations",displayKey:"p",title:"Go to pending annotation",isClose:!0}],q=[{action:"Switch to edit",key:"edit_mode",displayKey:"e",title:"Switch to edit mode",isClose:!0},{action:"Switch to create",key:"create_mode",displayKey:"q",title:"Switch to create mode",isClose:!0},{action:"Switch to pan mode",key:"pan_mode",displayKey:"m",title:"Switch to pan mode",isClose:!0},{action:"Show cross hair",key:"cross_hair",displayKey:"w",title:"Show cross hair",isClose:!0},{action:"Copy selected annotation",key:"copy",displayKey:"Ctrl + C",title:"Copy selected annotation",isClose:!1},{action:"Paste all annotations",key:"paste",displayKey:"Ctrl + V",title:"Paste all copied annotations",isClose:!1},{action:"Forward Toggle Annotations",key:"select_forward",displayKey:"T",title:"Forward Toggle annotations visibility, Long press to get next",isClose:!1},{action:"Backward Toggle Annotations",key:"select_backward",displayKey:"U",title:"Backward Toggle annotations visibility, Long press to get previous",isClose:!1},{action:"Go to last updated annotations",key:"select_last_update",displayKey:"L",title:"Go to last updated annotations",isClose:!0},{action:"Undo Annotation point / Last State",key:"undo",displayKey:"Ctrl + Z",title:"Undo last annotation action",isClose:!0},{action:"Complete Annotation / Generate Point Annotations",key:"complete",displayKey:"Enter",title:"Finalize or generate point annotations",isClose:!0},{action:"Switch to Auto Annotations",key:"auto_annotations",displayKey:"S",title:"Enable automatic annotation mode",isClose:!0},{action:"AI prompt popup",key:"send_to_sam",displayKey:"X (if AI is enabled)",title:"AI prompt popup",isClose:!0},{action:"Get request information",key:"open_shortcut_details",displayKey:"V",title:"View request-related information",isClose:!0},{action:"Refetch Annotations",key:"reload",displayKey:"R",title:"Reload annotations",isClose:!0},{action:"Toggle Image Pagination",key:"toggle_pagination",displayKey:"H",title:"Show or hide image pagination",isClose:!1},{action:"Zoom In",key:"zoom_in",displayKey:"I",title:"Zoom into the image, long press for more zoom in",isClose:!1},{action:"Zoom Out",key:"zoom_out",displayKey:"O",title:"Zoom out of the image, long press for more zoom out",isClose:!1},{action:"Moving Zoomed images",key:"",displayKey:"Alt + Mouse Move",title:"Move the zoomed-in image",isClose:!1},{action:"View Recently Annotated Images",key:"recent_verified",displayKey:"Alt + R",title:"Show recently annotated images",isClose:!0},{action:"Delete Annotation",key:"",displayKey:"Ctrl + Delete",title:"Delete the selected annotation",isClose:!1},{action:"Move image to left",key:"move_left",displayKey:"←",title:"Move image to left",isClose:!1},{action:"Move image to right",key:"move_right",displayKey:"→",title:"Move image to right",isClose:!1},{action:"Move image to top",key:"move_up",displayKey:"↑",title:"Move image to top",isClose:!1},{action:"Move image to bottom",key:"move_down",displayKey:"↓",title:"Move image to bottom",isClose:!1},{action:"Enter/Exit Fullscreen",key:"fullscreen",displayKey:"F",title:"Enter/Exit Fullscreen",isClose:!1}];return E.userObj.awi_level==="awi_verifier"?[...$,...q,...U]:E.userObj.awi_level==="awi_supervisor"?$:[...$,...q]},T=$=>{switch($){case"select_forward":return e("forward");case"select_backward":return e("backward");case"select_last_update":return e("last_update");case"move_left":return t();case"move_right":return n();case"move_up":return r();case"move_down":return o();case"zoom_in":return i();case"zoom_out":return a();case"complete":return s();case"undo":return l();case"reload":return u();case"toggle_pagination":return d(U=>!U);case"fullscreen":return f();case"auto_annotations":return A();case"open_shortcut_details":return C();case"recent_verified":return m();case"send_to_sam":if(j)return k!="SAM"&&A(),v();is.error("SAM is not allowed");return;case"edit_mode":if(b)return b();break;case"create_mode":if(x)return x();break;case"next_image":if(y)return y();break;case"prev_image":if(w)return w();break;case"pending_annotations":if(M)return M();break;case"copy":if(H)return H();break;case"paste":if(O)return O();break;case"pan_mode":L();break;case"cross_hair":N&&typeof N=="function"&&N();break;default:console.warn(`Unhandled hotkey action: ${$}`)}},K=($,U)=>{T($),U&&I(!1)};return rS("ctrl+=",$=>{$.preventDefault(),F()}),rS("ctrl+-, ctrl+subtract, ctrl+minus",$=>{$.preventDefault(),R()}),X.jsxs(X.Fragment,{children:[X.jsx(Un,{allowRepeat:!0,keyName:"t",onKeyDown:()=>T("select_forward")}),X.jsx(Un,{allowRepeat:!0,keyName:"u",onKeyDown:()=>T("select_backward")}),X.jsx(Un,{allowRepeat:!1,keyName:"l",onKeyDown:()=>T("select_last_update")}),X.jsx(Un,{allowRepeat:!0,keyName:"left",onKeyDown:()=>T("move_left")}),X.jsx(Un,{allowRepeat:!0,keyName:"right",onKeyDown:()=>T("move_right")}),X.jsx(Un,{allowRepeat:!0,keyName:"up",onKeyDown:()=>T("move_up")}),X.jsx(Un,{allowRepeat:!0,keyName:"down",onKeyDown:()=>T("move_down")}),X.jsx(Un,{allowRepeat:!0,keyName:"i",onKeyDown:()=>T("zoom_in")}),X.jsx(Un,{allowRepeat:!0,keyName:"o",onKeyDown:()=>T("zoom_out")}),X.jsx(Un,{keyName:"enter",onKeyDown:()=>T("complete")}),X.jsx(Un,{keyName:"ctrl+z",onKeyDown:()=>T("undo")}),X.jsx(Un,{keyName:"r",onKeyDown:()=>T("reload")}),X.jsx(Un,{keyName:"h",onKeyDown:()=>T("toggle_pagination")}),X.jsx(Un,{keyName:"f",onKeyDown:()=>T("fullscreen")}),X.jsx(Un,{keyName:"s",onKeyDown:()=>T("auto_annotations")}),X.jsx(Un,{keyName:"v",onKeyDown:()=>T("open_shortcut_details")}),X.jsx(Un,{keyName:"alt+r",onKeyDown:()=>T("recent_verified")}),j&&X.jsx(Un,{keyName:"x",onKeyDown:()=>T("send_to_sam")}),Q&&X.jsxs(X.Fragment,{children:[X.jsx(Un,{keyName:"e",onKeyDown:()=>T("edit_mode")}),X.jsx(Un,{keyName:"q",onKeyDown:()=>T("create_mode")})]}),X.jsx(Un,{keyName:"d",onKeyDown:()=>T("next_image")}),X.jsx(Un,{keyName:"a",onKeyDown:()=>T("prev_image")}),E.userObj.awi_level==="awi_verifier"&&X.jsx(Un,{keyName:"p",onKeyDown:()=>T("pending_annotations")}),X.jsx(Un,{keyName:"ctrl+c",onKeyDown:()=>T("copy")}),X.jsx(Un,{keyName:"ctrl+v",onKeyDown:()=>T("paste")}),X.jsx(Un,{keyName:"m",onKeyDown:()=>T("pan_mode")}),X.jsx(Un,{keyName:"w",onKeyDown:()=>T("cross_hair")}),B&&!P&&X.jsx(X.Fragment,{children:X.jsxs(V7,{popupPosition:"right",isBackdrop:!0,backdropAction:()=>I(!1),className:"noPadding",children:[X.jsx(U7,{title:"Shortcut keys",onClose:()=>I(!1)}),X.jsx(K7,{children:X.jsxs(pE,{children:[X.jsx(oS,{list:["S.NO.","Command","Key Binding","Action"]},"short_cut_keys"),X.jsx(CE,{children:(V()||[]).map(($,U)=>{var q;return X.jsxs($7,{title:$.title,children:[X.jsx(es,{children:U+1}),X.jsx(es,{children:$.action}),X.jsx(es,{children:X.jsxs("div",{className:"shortcutKey",children:[" ",$.displayKey," "]})}),X.jsx(es,{children:((q=$==null?void 0:$.key)==null?void 0:q.length)>0&&X.jsx("button",{className:"modalButton modalButton__purpleColor",onClick:()=>K($.key,$.isClose),children:"Press"})})]})})})]})}),X.jsx(Q7,{})]})})]})},r9e=()=>{const e=D.useRef(!1),t=D.useRef(!1);return D.useEffect(()=>{const o=l=>{l.key==="Control"&&(e.current=!0,is.success("Control pressed, Handling control press events")),l.key==="Alt"&&(t.current=!0,is.success("Alt pressed, Handling alt press events")),l.key==="Command"&&(e.current=!0,is.success("Command pressed, Handling command press events"))},i=l=>{l.key==="Control"&&(e.current=!1),l.key==="Alt"&&(t.current=!1),l.key==="Command"&&(e.current=!1)},a=()=>{document.hidden&&(e.current=!1,t.current=!1)},s=()=>{e.current=!1,t.current=!1};return window.addEventListener("keydown",o),window.addEventListener("keyup",i),document.addEventListener("visibilitychange",a),window.addEventListener("blur",s),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",i),document.removeEventListener("visibilitychange",a),window.removeEventListener("blur",s)}},[]),{isCtrlPressedFunc:()=>e.current,isAltPressedFunc:()=>t.current}};function o9e(e=1,t=1){const[n,r]=D.useState(e),[o,i]=D.useState(t),a=D.useCallback(u=>{u>=1&&u<=o?r(u):console.error(`Invalid page number: ${u}`)},[o]),s=D.useCallback(()=>{a(n+1)},[n,a]),l=D.useCallback(()=>{a(n-1)},[n,a]);return{currentPage:n,setPage:a,nextPage:s,prevPage:l,totalPages:o,setTotalPages:i}}const iS=(e,t="",n)=>{!n||!e||Ho.forEach(e,(r,o)=>{const i=`--${t}${o}`;Ho.isObject(r)&&!Ho.isArray(r)?iS(r,`${t}${o}-`,n):typeof r=="string"&&n.style.setProperty(i,r)})},aS=(e,t="",n)=>{!n||!e||Ho.forEach(e,(r,o)=>{const i=`--${t}${o}`;Ho.isObject(r)&&!Ho.isArray(r)?aS(r,`${t}${o}-`,n):n.style.removeProperty(i)})},i9e=(e,t="")=>{const n={},r=(o,i)=>{Ho.forEach(o,(a,s)=>{const l=`--${t}${i}${s}`;Ho.isObject(a)&&!Ho.isArray(a)?r(a,`${i}${s}-`):typeof a=="string"&&(n[`${i}${s}`.toUpperCase().replace(/-/g,"_")]=`var(${l})`)})};return r(e,""),n},sS=D.createContext({}),a9e="awi-color-",s9e="awi-size-",l9e="awi-weight-",cd=(e,t,n)=>(D.useEffect(()=>{if(Ho.isEqual(n.current,e))return;const r=document.documentElement;return iS(e,t,r),()=>aS(e,t,r)},[e,n,t]),e?i9e(e,t):{}),c9e=({theme:e=xf,log:t=!0,children:n})=>{const r=D.useRef(null),o=D.useRef(null),i=D.useRef(null),a=cd(e.colors,a9e,r),s=cd(e.sizes,s9e,o),l=cd(e.weights,l9e,i);return t&&(console.group("Theme Variables"),console.table(a),console.table(s),console.table(l),console.groupEnd()),X.jsxs(sS.Provider,{value:{...a,...s,...l},children:[X.jsx(BE,{}),n]})},u9e=()=>{const e=D.useContext(sS);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},d9e=()=>({success:(e,t)=>r6("success",e,t),error:(e,t)=>r6("error",e,t),info:(e,t)=>r6("info",e,t),warning:(e,t)=>r6("warning",e,t)});Ht.AWI_ALL_GLOBALS=xi,Ht.AWI_IMAGE_VALIDITY_HELPER=PI,Ht.AwiAnnotationHotkeys=n9e,Ht.AwiEmptyState=wie,Ht.AwiGenerateHeader=oS,Ht.AwiHelperMethods=n3,Ht.AwiInput=bE,Ht.AwiLoadMoreButton=Eie,Ht.AwiMessageScreen=o6,Ht.AwiModal=V7,Ht.AwiModalBody=K7,Ht.AwiModalFooter=Q7,Ht.AwiModalHeader=U7,Ht.AwiModalRow=J5,Ht.AwiPagination=vE,Ht.AwiSafeLocalStorage=qa,Ht.AwiSamModal=Hie,Ht.AwiScrollableTableCellList=Sie,Ht.AwiSlider=xE,Ht.AwiTableBody=CE,Ht.AwiTableCell=es,Ht.AwiTableHeader=hE,Ht.AwiTableHeaders=mE,Ht.AwiTableInfinite=pE,Ht.AwiTableRow=$7,Ht.AwiToastMessage=is,Ht.AwiUseKeyChecker=r9e,Ht.Backdrop=AE,Ht.Badge=jI,Ht.Button=k1,Ht.ButtonGroup=rP,Ht.Chart=Gj,Ht.CompactEventCard=WC,Ht.ContactInput=cie,Ht.DEFAULT_THEME=xf,Ht.DateRangePicker=Aie,Ht.DetectionCarousel=cE,Ht.EventPreview=Cie,Ht.Icon=_i,Ht.Input=K0,Ht.MathAnnotationHelper=NI,Ht.Modal=mie,Ht.Multiselect=pie,Ht.Pagination=vie,Ht.Select=aE,Ht.Sidebar=bie,Ht.Spinner=l3,Ht.Switch=xie,Ht.Table=_ie,Ht.ThemeProvider=c9e,Ht.Toast=fE,Ht.ToastProvider=BE,Ht.usePagination=o9e,Ht.useTheme=u9e,Ht.useToast=d9e,Object.defineProperty(Ht,Symbol.toStringTag,{value:"Module"})});
|