react-busser
Version:
An evented object for scalable and precise communication across ReactJS Components
43 lines • 60.9 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-to-print"),require("@preact/signals-react"),require("react-router-dom"),require("lodash.debounce"),require("lodash.isempty")):"function"==typeof define&&define.amd?define(["exports","react","react-to-print","@preact/signals-react","react-router-dom","lodash.debounce","lodash.isempty"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["react-busser"]={},e.react,e["react-to-print"],e["@preact/signals-react"],e["react-router-dom"],e.lodash.debounce,e.lodash.isempty)}(this,(function(e,t,n,r,o,i,u){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(t),s=a(i),l=a(u);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}function g(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e,t){return S(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,u,a=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(s)throw o}}return a}}(e,t)||T(e,t)||P()}function b(e){return function(e){if(Array.isArray(e))return C(e)}(e)||E(e)||T(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e){if(Array.isArray(e))return e}function E(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function T(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function P(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A(e){var n=t.useRef();return null!==n.current||void 0!==n.current?n.current:n.current=r.signal(e)}!function(){var e="text/plain";(function(){(console.warn||console.log).apply(console,arguments)}).bind("[clipboard-polyfill]");var t,n,r,o="undefined"==typeof window?void 0:window,i="undefined"==typeof globalThis?void 0:globalThis,u=null!=(r=null==(t=o)?void 0:t.Promise)?r:null==(n=i)?void 0:n.Promise;var a,c,s,l,f,d="undefined"==typeof navigator?void 0:navigator,v=null==d?void 0:d.clipboard,p=null==(a=null==v?void 0:v.read)?void 0:a.bind(v),h=null==(c=null==v?void 0:v.readText)?void 0:c.bind(v),m=null==(s=null==v?void 0:v.write)?void 0:s.bind(v),g=null==(l=null==v?void 0:v.writeText)?void 0:l.bind(v),y=null==(f=o)?void 0:f.ClipboardItem,w=function(){if(!u)throw new Error("No `Promise` implementation available for `clipboard-polyfill`. Consider using: https://github.com/lgarron/clipboard-polyfill#flat-file-version-with-promise-included");return u}(),b=o;function S(){return"undefined"==typeof ClipboardEvent&&void 0!==(null==b?void 0:b.clipboardData)&&void 0!==(null==b?void 0:b.clipboardData.setData)}function E(t,n,r){for(var o in t.success=!0,n){var i=n[o],u=r.clipboardData;u.setData(o,i),o===e&&u.getData(o)!==i&&(t.success=!1)}r.preventDefault()}function T(e){var t={success:!1},n=E.bind(this,t,e);document.addEventListener("copy",n);try{document.execCommand("copy")}finally{document.removeEventListener("copy",n)}return t.success}function C(e,t){P(e);var n=T(t);return A(),n}function P(e){var t=document.getSelection();if(t){var n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}}function A(){var e=document.getSelection();e&&e.removeAllRanges()}function x(t){var n,r=e in t;if(S()){if(!r)throw new Error("No `text/plain` value was specified.");if(n=t[e],b.clipboardData&&b.clipboardData.setData("Text",n))return!0;throw new Error("Copying failed, possibly because the user rejected it.")}return!!T(t)||(navigator.userAgent.indexOf("Edge")>-1||(!!C(document.body,t)||(!!function(e){var t=document.createElement("div");t.setAttribute("style","-webkit-user-select: text !important"),t.textContent="temporary element",document.body.appendChild(t);var n=C(t,e);return document.body.removeChild(t),n}(t)||!!function(e){var t=document.createElement("div");t.setAttribute("style","-webkit-user-select: text !important");var n=t;t.attachShadow&&(n=t.attachShadow({mode:"open"}));var r=document.createElement("span");r.innerText=e,n.appendChild(r),document.body.appendChild(t),P(r);var o=document.execCommand("copy");return A(),document.body.removeChild(t),o}(t[e]))))}function $(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(t(o))}return w.all(n).then((function(t){for(var n={},r=0;r<e.length;r++)n[e[r]]=t[r];return n}))}var k=w.resolve(),_=function(){return w.resolve(!0)},O=w.resolve(!1);function L(e){return new w((function(t,n){try{t(e())}catch(e){n(e)}}))}function R(t){return L((function(){return w.resolve(function(t){if(!x(function(t){var n={};return n[e]=t,n}(t)))throw new Error("writeText() failed")}(t))}))}function j(){return L((function(){if(h)return h();if(S()){var e=function(){if(!b.clipboardData)throw new Error("Cannot read IE clipboard Data ");var e=b.clipboardData.getData("Text");if(""===e)throw new Error("Empty clipboard or could not read plain text from clipboard");return e}();return w.resolve(e)}throw new Error("Read is not supported in your browser.")}))}function I(e,t){for(var n=0;n<e.length;n++){if(-1!==e[n].types.indexOf(t))return!0}return!1}var N=function(e,t){var n,r=Object.keys(e),o={};for(var i in e){var u=e[i];o[i]="string"==typeof u?D(i,u):u}return{types:r,presentationStyle:null!=(n=null==t?void 0:t.presentationStyle)?n:"unspecified",getType:function(e){return w.resolve(o[e])}}};function D(e,t){return new Blob([t],{type:e})}function B(e){return $(e.types,(function(t){return e.getType(t)})).then((function(t){return new w((function(n,r){var o={};e.presentationStyle&&(o.presentationStyle=e.presentationStyle),y?n(new y(t,o)):r("window.ClipboardItem is not defined")}))}))}function F(t){var n={};return n[e]=D(t,e),new N(n)}function q(e,t){return e.getType(t).then((function(e){return t=e,new w((function(e,n){var r=new FileReader;r.addEventListener("load",(function(){var t=r.result;"string"==typeof t?e(t):n("could not convert blob to string")})),r.readAsText(t)}));var t}))}navigator.clipboard||(navigator.clipboard={}),navigator.clipboard.read=function(){return L((function(){return p?p():j().then((function(e){return[F(e)]}))}))},navigator.clipboard.readText=j,navigator.clipboard.write=function(t){return L((function(){if(m&&y){var n=m;return w.all(t.map(B)).then((function(r){return n(r).then(_).catch((function(n){if(!I(t,e)&&!I(t,"text/html"))throw n;return O}))}))}return O})).then((function(n){return n?k:(I(t,e),function(e){return $(e.types,(function(t){return q(e,t)}))}(t[0]).then((function(e){if(!x(e))throw new Error("write() failed")})))}))},navigator.clipboard.writeText=function(e){return g?g(e).catch((function(){return R(e)})):R(e)},window.ClipboardItem=N}();var x=function(e){var t=(r.useSignal?r.useSignal:A)("function"==typeof e?e():e);return[t,function(e){t.value="function"!=typeof e?e:e(t.peek())}]},$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=t.useCallback(e,n);t.useEffect((function(){return r.effect(o)}),[])},k=r.useComputed;function _(e,t){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!n)return new Promise((function(e,n){window.addEventListener("beforeprint",(function e(){t.onBeforePrint(),window.removeEventListener("beforeprint",e)})),window.addEventListener("afterprint",(function e(){t.onAfterPrint(),window.removeEventListener("afterprint",e)})),setTimeout((function(){try{e(window.print())}catch(e){var r=e instanceof Error?e:new Error("Cannot print page");"function"==typeof t.onPrintError&&t.onPrintError("print",r),n(r)}}),50)}));Promise.resolve(e(null,"function"==typeof t.content?void 0:function(){return n.current}))}}
/**!
* `useUICommands` ReactJS hook
*/
var O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h(this,e);var n={},r=this;r.awayTimeout="number"!=typeof t.awayTimeout?3e3:t.awayTimeout,r.onAway=t.onAway,r.onStopped=t.onStopped,r.onAwayBack=t.onAwayBack,r.onScreenVisible=t.onVisible,r.onScreenHidden=t.onHidden,this.isUserAway=!1,this.isStopped=!0,this.lastActive=(new Date).getTime(),this.awayTimestamp=0,this.listener=void 0,this.awayTimer=null,this._isVisible=!0,this.setup=function(){n.$$onload=window.onload,n.$$onclick=window.onclick,n.$$onpointermove=window.onpointermove,n.$$onmousedown=window.onmousedown,n.$$ontouchstart=window.ontouchstart,n.$$onkeydown=window.onkeydown,n.$$onscroll=window.onscroll,n.$$onmouseover=window.onmouseover,n.$$onmousewheel=window.onmousewheel,n.$$onfocus=window.onfocus,n.$$_reSize=null,window.onload=function(){n.$$onload&&n.$$onload(),r.onActive()},window.onclick=function(){n.$$onclick&&n.$$onclick(),r.onActive()},n.$$_reSize=function(){r.onActive()},window.addEventListener("resize",n.$$_reSize,!1),window.onpointermove=function(){n.$$onpointermove&&n.$$onpointermove(),r.onActive()},window.onmousedown=function(){n.$$onmousedown&&n.$$onmousedown(),r.onActive()},window.ontouchstart=function(){n.$$ontouchstart&&n.$$ontouchstart(),r.onActive()},window.onkeydown=function(){n.$$onkeydown&&n.$$onkeydown(),r.onActive()},window.onscroll=function(){n.$$onscroll&&n.$$onscroll(),r.onActive()},window.onmousewheel=function(){n.$$onmousewheel&&n.$$onmousewheel(),r.onActive()},window.onfocus=function(){n.$$onfocus&&n.$$onfocus(),r.onActive()},window.onmouseover=function(){n.$$onmouseover&&n.$$onmouseover(),r.onActive()}},this.teardown=function(){window.onfocus=n.$$onfocus,window.onload=n.$$onload,window.onclick=n.$$onclick,window.onpointermove=n.$$onpointermove,window.onmousedown=n.$$onmousedown,window.ontouchstart=n.$$ontouchstart||null,window.onkeydown=n.$$onkeydown,window.onscroll=n.$$onscroll,window.onmousewheel=n.$$onmousewheel,window.onmouseover=n.$$onmouseover,window.removeEventListener("resize",n.$$_reSize,!1),n.$$_reSize=null,n={},this.lastActive=(new Date).getTime(),this._isVisible=!0}}return g(e,[{key:"onActive",value:function(){return this.awayTimestamp=(new Date).getTime()+this.awayTimeout,this.isUserAway&&("function"==typeof this.onAwayBack&&this.onAwayBack(),this.start()),this.isUserAway=!1,!0}},{key:"start",value:function(){var e=this;return void 0===this.listener&&(this.listener=function(){e.handleVisibilityChange()},"function"==typeof document.addEventListener&&(window.addEventListener("focus",this.listener,!1),void 0!==document.hidden?document.addEventListener("visibilitychange",this.listener,!1):document.addEventListener("webkitvisibilitychange",this.listener,!1))),this.awayTimestamp=(new Date).getTime()+this.awayTimeout,null!==this.awayTimer&&clearTimeout(this.awayTimer),"function"==typeof this.setup&&this.isStopped&&this.setup(),this.awayTimer=setTimeout((function(){return e.checkAway()}),this.awayTimeout+100),this.isStopped=!1,this}},{key:"stop",value:function(){return null!==this.awayTimer&&clearTimeout(this.awayTimer),void 0!==this.listener&&("function"==typeof document.removeEventListener&&(window.removeEventListener("focus",this.listener,!1),document.removeEventListener("visibilitychange",this.listener,!1),document.removeEventListener("webkitvisibilitychange",this.listener,!1)),this.listener=void 0),this.isStopped=!0,"function"==typeof this.onStopped&&(this.onStopped(),"function"==typeof this.teardown&&this.teardown()),this}},{key:"setAwayTimeout",value:function(e){return this.awayTimeout=parseInt(e,10),this}},{key:"checkAway",value:function(){var e=this,t=(new Date).getTime();if(t<this.awayTimestamp)return this.isUserAway=!1,void(this.awayTimer=setTimeout((function(){return e.checkAway()}),this.awayTimestamp-t+100));null!==this.awayTimer&&clearTimeout(this.awayTimer),this.isUserAway=!0,this.lastActive=(new Date).getTime(),"function"==typeof this.onAway&&this.onAway()}},{key:"handleVisibilityChange",value:function(){if("function"==typeof this.onScreenHidden&&"hidden"===document.visibilityState){if(!this._isVisible)return;return null!==this.awayTimer&&clearTimeout(this.awayTimer),this._isVisible=!1,this.isUserAway=!0,this.lastActive=(new Date).getTime(),this.onScreenHidden(),void("function"==typeof this.onAway&&this.onAway())}if(!document.hasFocus()&&"function"==typeof this.onScreenVisible&&("hidden"in document&&!1===document.hidden||"visible"===document.visibilityState)){if(this._isVisible)return;this._isVisible=!0,this.onActive(),this.onScreenVisible()}}}]),e}(),L=c.default.createContext(null);
/**!
* `useBus()` ReactJS hook
*/
var R=function(e){var n=e.subscribes,r=void 0===n?[]:n,o=e.fires,i=void 0===o?[]:o,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"<no bus name>",a=t.useContext(L),c=t.useRef({eventsFired:{},eventsFiredCount:0,eventsSubscribed:{},eventsSubscribedCount:r.length,eventsFiredPath:[]});if(null==a)throw new Error('[react-busser]: "useBus()" must be used with the <EventBusProvider>');var s=t.useRef({on:function(e,t){a[e]||(a[e]=[]),"function"==typeof t&&(-1===r.indexOf(e)&&(c.current.eventsSubscribedCount=r.push(e)),void 0===c.current.eventsSubscribed[e]&&(c.current.eventsSubscribed[e]={}),c.current.eventsSubscribed[e].timestamp=Date.now(),c.current.eventsSubscribed[e].name=u,a[e].push(t))},off:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=0;t<r.length;t++){var n=r[t],o=a[n];if(o){var i=o.indexOf(e);-1!==i?o.splice(i,1):delete a[n]}}},emit:function(e){var t=[];if(e in a&&i.indexOf(e)>-1){for(var n=a[e],r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];for(var l=0;l<n.length;l++){var f=n[l];"function"==typeof f&&(c.current.eventsFiredCount++,void 0===c.current.eventsFired[e]&&(c.current.eventsFiredPath.push({eventName:o}),c.current.eventsFired[e]={}),c.current.eventsFired[e].timestamp=Date.now(),c.current.eventsFired[e].data=o,c.current.eventsFired[e].name=u,t.push(f.apply(null,o)))}}return t}}).current;return[Object.freeze(s),c.current]},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return null},n=t.useRef(e||function(){return null});return n.current=e,t.useCallback((function(){return n.current.apply(n,arguments)}),[])},I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},r=[e],o=w(R({subscribes:r,fires:r},arguments.length>2&&void 0!==arguments[2]?arguments[2]:"<no name>"),1)[0],i=j(n);return t.useCallback((function(){var t=i.apply(void 0,arguments);o.emit.apply(o,Array.isArray(t)?[e].concat(b(t)):[e,t])}),[o,e,i])},N=function(e,n){var r=j(arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e});return t.useCallback((function(){var t=r.apply(void 0,arguments);e.emit.apply(e,Array.isArray(t)?[n].concat(b(t)):[n,t])}),[e,n,r])},D=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"<no name>",o=Array.isArray(e)||"string"!=typeof e,i=t.useRef(o?e:[e]).current,u=w(R({subscribes:i,fires:i},r),2),a=u[0],c=u[1],s=t.useMemo((function(){return o?i.map((function(e){return function(e){return n.bind(null,e)}(e)})):[n]}),[o,i,n]);return t.useEffect((function(){return i.forEach((function(e,t){a.on(e,s[t])})),function(){var e=-1;i.forEach((function(){++e,a.off(s[e])}))}}),[a,i,s]),[a,c]},B=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500,r=!0;return function(){if(r){var o=e.call.apply(e,[null].concat(b(t)));return r=!1,setTimeout((function(){r=!0}),n),o}return function(){}}},F=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.includes(".")?e.split(".").reduce((function(e,t){return"object"===p(e)?e[t]:e}),t):t[e]},q=function(){var e,t,n,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",u=[];e:for(e=0;e<o.length;++e){for(t=0;t<u.length;++t)if(n=u[t],n=""!==i&&"string"!=typeof n?F(i,n):n,r=o[e],n===(r=""!==i&&"string"!=typeof r?F(i,r):r))continue e;u.push(o[e])}return u};
/**!
* `useUpon()` ReactJS hook
*/function U(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r={};for(var o in n||(n=[]),e)if(e.hasOwnProperty(o)&&"__proto__"!==o&&-1==n.indexOf(e[o]))if(t.hasOwnProperty(o))if(e[o]===Object(e[o])){var i=U(e[o],t[o]);Object.keys(i).length>0&&(r[o]=i)}else e[o]!==t[o]&&(void 0===e[o]&&(r[o]="undefined"),null===e[o]?r[o]=null:"function"==typeof e[o]?r[o]="function":"object"===p(e[o])?r[o]="object":r[o]=e[o]);else r[o]=e[o];return r}var M,V=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return!l.default(U(e,t,n))},H=c.default.createContext(null),z=function(e){var t=e.storageType,n=void 0===t?"local":t;return{setToStorage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r="session"===n?sessionStorage:localStorage;if(r&&"function"==typeof r.setItem)try{if(null!==t&&"string"==typeof e)return r.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0}catch(e){if("QuotaExceededError"===e.name)return!1}return!1},hasKeyInStorage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="session"===n?sessionStorage:localStorage;return Object.keys(t).filter((function(t){return t.toLowerCase()===e.toLowerCase()})).length>0},hasKeyPrefixInStorage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="session"===n?sessionStorage:localStorage;return Object.keys(t).filter((function(t){return t.toLowerCase().startsWith(e.toLowerCase())})).length>0},clearFromStorage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="session"===n?sessionStorage:localStorage;if(t&&"function"==typeof t.removeItem){try{t.removeItem(e)}catch(e){return!1}return!0}return!1},getFromStorage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="session"===n?sessionStorage:localStorage,o=null;try{r&&"function"==typeof r.getItem&&null===(o=r.getItem(e))&&void 0!==t&&r.setItem(e,"string"==typeof t?t:JSON.stringify(t))}catch(u){"SecurityError"===u.name&&(o=null)}var i=null;try{i=o?JSON.parse(o):t}catch(e){var u;i=t,"SyntaxError"===e.name&&null!==o&&(i=o)}return i}}},J=new Set,K=(M=J,function(e,t,n){return{getState:function(t){return""!==t&&t?t&&"string"==typeof t?e.current[t]:{}:JSON.parse(JSON.stringify(e.current))},dispatch:function(r){var o,i,u=this.getState("");if("function"==typeof r){var a=r(u);o=a.slice,i=a.value}else o=r.slice,i=r.value;void 0===o?e.current=i:e.current[o]=i,"none"!==t.persistOn&&n(t.persistKey,e.current);var c,s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=T(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,i=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw i}}}}(M);try{for(s.s();!(c=s.n()).done;){var l=w(c.value,2),f=l[0],d=l[1],v=p(d?u[d]:u),h=p(d?e.current[d]:e.current),m=!1;m="object"===v||"object"===h?V(e.current,u):d?u[d]!==e.current[d]:u!==e.current,d&&!m||f(d?e.current[d]:e.current)}}catch(e){s.e(e)}finally{s.f()}},subscribe:function(e,t){var n=[e,t];return M.add(n),function(){M.delete(n)}}}});var G={sortBy:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e},n="string"==typeof e||"number"==typeof e?function(n){return"object"!==p(n)?n:t?t(n[e]):n[e]}:function(e){return t?t(e):e},r="ASC"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ASC")?1:-1;return function(e,t){var o=n(e),i=n(t);return r*((o>i)-(i>o))}}},W={specific:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""];return""===e?t:t.filter((function(t){return n.reduce((function(n,r){var o="object"!==p(t)?t:F(r,t),i="string"==typeof o?o.toLowerCase():String(o).toLowerCase(),u=e.toLowerCase();return""===e||i.indexOf(u)>-1||n}),!1)}))},fuzzy:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""];if(""===e)return t;var r=e.split(""),o=Array.prototype.concat.apply([],r.map((function(e){return t.filter((function(t){return n.reduce((function(n,r){var o=e.toLowerCase(),i="object"!==p(t)?t:F(r,t),u=!0;return-1===("string"==typeof i?i.toLowerCase():String(i).toLowerCase()).indexOf(o)&&(u=!1),u||n}),!1)}))})));return q(n.flatMap((function(e){return q(o,e)})))},complete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""];return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).filter((function(n){return t.reduce((function(t,r){for(var o="object"!==p(n)?n:F(r,n),i="string"==typeof o?o.toLowerCase():String(o).toLowerCase(),u=e.toLowerCase(),a=!0,c=-1,s=0,l=u[s]||null;null!==l;){if(-1===(c=i.indexOf(l,c+1))){a=!1;break}l=u[s+=1]||null}return a||t}),!1)}))}},Q=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];h(this,e),this.length=0,Array.isArray(t)&&this.push.apply(this,t)}return g(e,[{key:"isEmpty",value:function(){return 0===this.length}},{key:"size",value:function(){return this.length}},{key:"peek",value:function(){return this[this.size()-1]}},{key:"peer",value:function(){return this[0]}},{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.prototype.push.apply(this,t)}},{key:"pop",value:function(){return Array.prototype.pop.call(this)}},{key:"replaceTop",value:function(){this.pop(),this.push.apply(this,arguments)}},{key:"toJSON",value:function(){return"[ "+Array.prototype.slice.call(this,0).join(", ")+" ]"}},{key:"toObject",value:function(){try{return JSON.parse(this.toJSON())}catch(e){return e instanceof Error&&"SyntaxError"===e.name?Array.prototype.slice.call(this,0,this.size()):[]}}}]),e}(),Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1?arguments[1]:void 0,r=n.when,o=void 0!==r&&r,i=n.message,u=void 0===i?"":i,a=n.extraWatchProperty,c=void 0===a?"":a;t.useEffect((function(){function t(n){return n.preventDefault(),e.call(null,n.target),window.removeEventListener("beforeunload",t),""!==u?(n.returnValue=u,u):void(n.returnValue=void 0)}return o&&window.addEventListener("beforeunload",t),function(){o&&window.removeEventListener("beforeunload",t)}}),[o,u,c])};
/**!
* `useSearchParamStateValueUpdate()` ReactJS hook
*/
var X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"filter",t=o.useHistory(),n=t.location.search;return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).overwriteHistory,i=void 0!==o&&o,u=Object.assign({},function(e){if("string"!=typeof e||""===e)return{};var t=e.startsWith("?")?e:"?"+e;return t.slice(t.indexOf("?")).slice(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=w(t,2),r=n[0],o=n[1];return e[r]=decodeURIComponent(o),e}),{})}(n),y({},e,r)),a=new URLSearchParams(u);i?t.replace("".concat(window.location.pathname,"?").concat(a.toString())):t.push("".concat(window.location.pathname,"?").concat(a.toString()))}},Z="ASC";
/**!
* `useSearchParamStateValue()` ReactJS hook
*/
/**!
* `useSharedState()` ReactJS hook
*/
var ee=c.default.createContext(null);
/**!
* `useSharedSignalsState()` ReactJS hook
*/var te=function(){var e=w(R({subscribes:[],fires:["request:started","request:ended","request:aborted","request:cleanup"]},arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Http.Client.Transport.Context"),2),t=e[0];return{stats:e[1],signalRequestStarted:function(e){t.emit("request:started",e)},signalRequestEnded:function(e){t.emit("request:ended",e)},signalRequestAborted:function(e){t.emit("request:aborted",e)},signalCleanup:function(e){t.emit("request:cleanup",e)}}};e.BUSSER_EVENTS={HTTP_REQUEST_STARTED:"request:started",HTTP_REQUEST_ENDED:"request:ended",HTTP_REQUEST_ABORTED:"request:aborted",HTTP_REQUEST_CLEANUP:"request:cleanup"},e.EventBusProvider=function(e){var n=e.children;if(!({}.hasOwnProperty.call(c.default,"useMemo")&&{}.hasOwnProperty.call(c.default,"useCallback")))return new Error("EventBusProvider[Error]: You are using a ReactJS version that ddoesn't support memo hooks");var r=t.useMemo((function(){return{}}),[]);return c.default.createElement(L.Provider,{value:r},n)},e.HttpClientProvider=function(e){var t=e.children,n=e.httpClient;return c.default.createElement(ee.Provider,{value:n},t)},e.SORT_ORDER={ASCENDING:"ASC",DESCENDING:"DESC"},e.SharedGlobalStateProvider=function(e){var n=e.children,r=e.initialGlobalState,o=void 0===r?{}:r,i=e.persistence,u=void 0===i?{persistOn:"none",persistKey:"___$key___"}:i;if(!({}.hasOwnProperty.call(c.default,"useMemo")&&{}.hasOwnProperty.call(c.default,"useCallback")))return new Error("SharedGlobalStateProvider[Error]: You are using a ReactJS version that doesn't support memo hooks");var a=z({storageType:"local"===u.persistOn?u.persistOn:"session"}),s=a.setToStorage,l=a.getFromStorage,f=a.hasKeyInStorage,d=t.useRef(l(u.persistKey,o||{})),v=t.useMemo((function(){return K(d,u,s)}),[d,u.persistKey,u.persistOn]);return"none"===u.persistOn||f(u.persistKey)||s(u.persistKey,d.current),c.default.createElement(H.Provider,{value:v},n)},e.useAppEffect=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{signals:$,container:t.useEffect}[n?"signals":"container"](e)},e.useAppState=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{signals:x,container:t.useState}[n?"signals":"container"](e)},e.useBeforePageUnload=Y,e.useBrowserScreenActivityStatusMonitor=function(e){var n=e.onPageNotActive,r=void 0===n?function(){}:n,o=e.onPageNowActive,i=void 0===o?function(){}:o,u=e.onStopped,a=void 0===u?function(){}:u,c=e.onPageHidden,s=void 0===c?function(){}:c,l=e.onPageVisible,f=void 0===l?function(){}:l,d=e.ACTIVITY_TIMEOUT_DURATION,v=void 0===d?3e3:d,p=w(t.useState((function(){return new O({awayTimeout:v,onAway:r,onAwayBack:i,onVisible:f,onStopped:a,onHidden:s})})),1)[0];return t.useEffect((function(){return p.isStopped&&p.start(),function(){p.isStopped||p.stop()}}),[]),{updatePageActivityTimeoutInMilliseconds:function(e){p.setAwayTimeout(String(e))}}},e.useBrowserStorage=z,e.useBrowserStorageEffectUpdates=function(e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"enforceEffect",o=z({storageType:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local"}),i=o.setToStorage,u=o.getFromStorage,a=o.clearFromStorage,c=w(t.useState((function(){return"bypassEffect"===r?n:u(e,n)})),2),s=c[0],l=c[1];Y((function(){var t=window.closed;window.setTimeout((function(){(t||!window||window.closed)&&a(e)}),0)}),{when:!!e,message:"",extraWatchProperty:e}),t.useEffect((function(){"enforceEffect"===r&&i(e,s)}),[JSON.stringify(s),e,r]);return[s,function(t){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).append,o=void 0!==n&&n;l((function(n){var i="";if(i="string"!=typeof s?JSON.stringify(t):t,JSON.stringify(n)===i)return n;if(o){var a="bypassEffect"===r?n:u(e);if(a&&t&&"object"===p(t)&&"object"===p(a)){var c=Array.isArray(t)&&Array.isArray(a)?a.concat(t):Object.assign(a,t);return JSON.stringify(a)===JSON.stringify(c)?n:c}}return t}))}]},e.useBrowserStorageEvent=function(e){var n=function(t){e(t)};t.useEffect((function(){return window.addEventListener("storage",n),function(){window.removeEventListener("storage",n)}}),[])},e.useBrowserStorageWithEncryption=function(e){var n=e.storageType,r=void 0===n?"local":n,o=t.useContext(H);if(null===o)throw new Error("useBrowserStorageWithEncryption[Error]: Load shared state provider before using hook");var i=o.getState("$__encryption-helpers");i||(console.error("`useBrowserStorageWithEncryption()` is missing `encryptionHelpers` from shared state"),i={});var u=i,a=u.encrypt,c=void 0===a?function(e){return String(e)}:a,s=u.decrypt,l=void 0===s?function(e){return e}:s,f=z({storageType:r}),d=f.setToStorage,v=f.clearFromStorage,p=f.hasKeyInStorage,h=f.hasKeyPrefixInStorage,m=f.getFromStorage;return{setToStorage:function(e){var t=c(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null);return"string"==typeof t&&d(e,t)},hasKeyInStorage:function(){return p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")},hasKeyPrefixInStorage:function(){return h(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")},clearFromStorage:function(){return v(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")},getFromStorage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l(m(e,t));return n||t}}},e.useBus=R,e.useComponentMounted=function(){var e=t.useRef(!1);return t.useEffect((function(){return e.current=!0,function(){e.current=!1}}),[]),e.current},e.useComposite=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"<no name>";if(!(r instanceof Object))throw new Error('[react-busser]: "useComposite()" invalid `initial` argument');var i=w(t.useState(d({},r)),2),u=i[0],a=i[1],c=w(t.useState(null),2),s=c[0],l=c[1],f=t.useCallback("string"!=typeof e?function(e,t){a((function(r){try{return d({},n(r,t,e))}catch(e){return setTimeout((function(){return l(e)}),0),r}}))}:function(e){a((function(t){try{return d({},n(t,e))}catch(e){return setTimeout((function(){return l(e)}),0),t}}))},[n]),v=w(D(e,f,o),2),p=v[0];return[u,function(e,t){return N(p,e,t)},s,v[1]]},e.useControlKeysPress=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=function(t){n.includes(t.key)&&"function"==typeof e&&e(t.key,t.target)};t.useEffect((function(){return window.document.addEventListener("keyup",r),function(){window.document.removeEventListener("keyup",r)}}),[])},e.useCount=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=r.start,i=void 0===o?0:o,u=r.min,a=void 0===u?Number.MIN_SAFE_INTEGER:u,c=r.max,s=void 0===c?Number.MAX_SAFE_INTEGER:c,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"<no name>";if("number"!=typeof i||"number"!=typeof a||"number"!=typeof s)throw new Error('[react-busser]: "useCount()" incorrect count bounds data type');if(i<a||i>s)throw new Error('[react-busser]: "useCount()" incorrect count bounds range');var f=t.useRef({min:a,max:s}),d=w(t.useState(i),2),v=d[0],p=d[1],h=w(t.useState(null),2),m=h[0],g=h[1],y=t.useCallback((function(e,t){p((function(r){var o=r+1,i=r-1,u=f.current;try{return i<u.min&&o>u.max?r:n(r,t,e)}catch(e){return setTimeout((function(){return g(e)}),0),r}}))}),[n]),b=w(D(e,y,l),2),S=b[0];return[v,function(e,t){return N(S,e,t)},m,b[1]]},e.useFetchBinder=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e},n=w(t.useState(null),2),r=n[0],o=n[1],i=w(t.useState(null),2),u=i[0],a=i[1];return"function"!=typeof e?{fetchData:r,fetchError:u,boundFetcher:function(e){return"function"!=typeof e?Promise.reject(new Error("unbounded")):Promise.reject(null)}}:{fetchData:r,fetchError:u,boundFetcher:e((function(e){return"function"!=typeof e?Promise.reject(null):e.then((function(e){o(e)})).catch((function(e){a(e)}))}))}},e.useHttpSignals=te,e.useIsDOMElementVisibleOnScreen=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{root:null,threshold:0},n=t.useRef(null),r=w(t.useState(!1),2),o=r[0],i=r[1];return t.useEffect((function(){var t=n.current,r=function(e){return i((function(){return e.isIntersecting}))},o=new window.IntersectionObserver((function(e){return e.forEach(r)}),e);return t&&o.observe(t),function(){return t&&o.unobserve(t)}}),[e]),[o,n]},e.useIsFirstRender=function(){var e=t.useRef(!0);return e.current?(e.current=!1,!0):e.current},e.useList=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"<no name>";if(!Array.isArray(r))throw new Error('[react-busser]: "useList()" invalid `initial` argument');var i=w(t.useState(r),2),u=i[0],a=i[1],c=w(t.useState(null),2),s=c[0],l=c[1],f=t.useCallback("string"!=typeof e?function(e,t){a((function(r){var o;try{o=n(r,t,e)}catch(e){setTimeout((function(){return l(e)}),0),o=r}return o}))}:function(e){a((function(t){var r;try{r=n(t,e)}catch(e){setTimeout((function(){return l(e)}),0),r=t}return r}))},[n]),d=w(D(e,f,o),2),v=d[0];return[u,function(e,t){return N(v,e,t)},s,d[1]]},e.useOn=D,e.useOutsideClick=
/**!
* `useOutsideClick()` ReactJS hook
*/
function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=t.useRef(null),r=function(t){n.current&&(n.current.contains(t.target)||"function"==typeof e&&e(n.current,t.target))};return t.useEffect((function(){return window.document.addEventListener("click",r),function(){window.document.removeEventListener("click",r)}}),[]),[n]},e.usePreviousProps=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=t.useRef(void 0);return t.useEffect((function(){n.current!==e&&(n.current=e)}),[e]),n.current},e.usePreviousRoutePathname=function(){return(0,z({storageType:"session"}).getFromStorage)("$__former_url",null)},e.usePromised=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return Promise.resolve(!1)},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"<no name>",o=w(t.useState(null),2),i=o[0],u=o[1],a=t.useCallback("string"==typeof e?function(e){try{var t=n(e);return t instanceof Promise?t:Promise.reject(!1)}catch(e){u(e)}}:function(e,t){try{var r=n(e,t);return r instanceof Promise?r:Promise.reject(!1)}catch(e){u(e)}}),c=w(D(e,a,r),2),s=c[0];return[void 0,function(e,t){return N(s,e,t)},i,c[1]]},e.useProperty=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"<no name>";if("string"!=typeof r)throw new Error('[react-busser]: "useProperty()" invalid `initial` argument');var i=w(t.useState(r),2),u=i[0],a=i[1],c=w(t.useState(null),2),s=c[0],l=c[1],f=t.useCallback("string"!=typeof e?function(e,t){a((function(r){var o;try{o=n(r,t,e)}catch(e){setTimeout((function(){return l(e)}),0),o=r}return o}))}:function(e){a((function(t){var r;try{r=n(t,e)}catch(e){setTimeout((function(){return l(e)}),0),r=t}return r}))},[n]),d=w(D(e,f,o),2),v=d[0];return[u,function(e,t){return N(v,e,t)},s,d[1]]},e.useRoutingBlocked=function(e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return[!1,"Are you sure ?"]},o=I(e,(function(e){return e}),arguments.length>2&&void 0!==arguments[2]?arguments[2]:"<no name>"),i=j(r||function(){return[!1,"Are you sure ?"]});t.useEffect((function(){if(!n||"function"!=typeof n.block||"string"!=typeof e)return function(){return null};var t=n.block((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var u=w(i.apply(void 0,n),2),a=u[0],c=u[1];if(a){if(!window.confirm(c))return o([].concat(n,[!1])),!1;t(),o([].concat(n,[!0]))}}));return function(){return t()}}),[n,o,e,i])},e.useRoutingChanged=function(e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=I(e,(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{location:t[0],action:t[1]}}),arguments.length>2&&void 0!==arguments[2]?arguments[2]:"<no name>"),i=j(r||function(){});t.useEffect((function(){if(!n||"function"!=typeof n.listen||"string"!=typeof e)return function(){return null};var t=n.listen((function(){i(),o.apply(void 0,arguments)}));return function(){return t()}}),[n,o,e,i])},e.useRoutingMonitor=function(e){var n=e.unsavedChangesRouteKeysMap,r=void 0===n?{"/":"$___root_unsaved_items__"}:n,i=e.appPathnamePrefix,u=void 0===i?"/":i,a=e.getUserConfirmation,c=e.promptMessage,s=void 0===c?"You have unsaved items on this web page. Would you like to discard them ?":c,l=e.shouldBlockRoutingTo,f=void 0===l?function(){return!1}:l,d=e.onNavigation,v=void 0===d?function(){}:d,p=o.useLocation(),h=o.useHistory(),m=z({storageType:"session"}),g=m.setToStorage,y=m.getFromStorage,w=m.clearFromStorage,b=t.useRef([p]),C=function(e,t){var n=y("$__former_url",p.pathname),o=r[n.replace(u,"/")]||"";if("saved"!==y(o,"saved"))return a(s,function(e,t,n){return function(r){return r?(g(e,"saved"),window.dispatchEvent(new Event("beforediscardunsaveditems")),!f(t.pathname)&&void n()):(g(e,"pending"),!1)}}(o,e,t))},A=function(e,t){var n=y("$__nav_stack",["".concat(document.location.origin).concat(p.pathname)]),r=function(e,t,n){var r=new Q(e.current?e.current.slice(0):[]),o=t.toLowerCase();switch(o){case"pop":case"push":case"replace":return"replace"!==o?"pop"===o?(g("$__former_url",r.peek().pathname),r.pop()):(g("$__former_url",r.peek().pathname),r.push(n)):(g("$__former_url",r.peek().pathname),r.replaceTop(n)),r.toObject();default:return r.toObject()}}(b.current,t,e);g("$__nav_stack",r.map((function(e){return"".concat(document.location.origin).concat(e.pathname)}))),b.current=r;return v(h,{currentPathname:e.pathname,previousPathname:(n[n.length-1]||"").replace(document.location.origin,""),navigationDirection:{0:"refreshnavigation","-1":"backwardnavigation",1:"forwardnavigation","-9":"freshnavigation"}["PUSH"===t?"1":"POP"===t?"-1":"0"]})};return t.useEffect((function(){var e=h.block((function(t){return C(t,e)})),t=h.listen((function(e,t){return A(e,t)}));return function(){if("function"==typeof e){for(var n in r)r.hasOwnProperty(n)&&g(n,"saved");e()}t()}}),[h]),t.useEffect((function(){function e(t){t.preventDefault(),window.setTimeout((function(){window&&!window.closed||(w("$__former_url"),w("$__nav_stack"))}),0),window.removeEventListener("beforeunload",e),t.returnValue=void 0}return window.addEventListener("beforeunload",e),function(){window.removeEventListener("beforeunload",e)}}),[]),{get navigationList(){return b.current},getBreadCrumbsList:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",n=null,r=b.current.slice(0).reverse(),o=[],i=t.match(/(?:^\/)?[^/]+/g),a=S(e=i)||E(e)||T(e)||P(),c=a[0],s=a.slice(1).length+1,l=t.startsWith(u)?c:"".concat(u.startsWith("/")?u:"/"+u).concat(u.endsWith("/")?c.replace(/^\//,""):c.replace(/^([^/])/,"/$1")),f=0;f<r.length;f++){var d=r[f],v=d.pathname.split("/").length-1;if(!d.pathname.includes(l)){"/"===d.pathname&&(n=d);break}o.map((function(e){return e.pathname})).includes(d.pathname)||v<=s&&o.push(d)}return null!==n&&o.push(n),o.reverse()}}},e.useSearchParamStateValue=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"filter",n=o.useLocation().search,r=X(t);return[y({},t,null!==(e=new URLSearchParams(n).get(t))&&void 0!==e?e:""),r]},e.useSearchParamStateValueUpdate=X,e.useSearchParamsState=
/**!
* @SOURCE_COPY: https://blog.logrocket.com/use-state-url-persist-state-usesearchparams/
*
* `useSearchParamsState()` ReactJS hook
*/
function(e,n,r){var i=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=o.useLocation(),n=o.useHistory();return[new URLSearchParams(t?t.search:n.location.search),function(r){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=new URLSearchParams(r),u=new URL("".concat(t.pathname).concat(i.toString().replace(/^([^?]+)/,"?$1")),window.location.origin);if(o)window.location.assign(u.href);else{if(r instanceof URLSearchParams)return void n.replace(u.href.replace(window.location.origin,""));e?n.replace(u.href.replace(window.location.origin,"")):n.push(u.href.replace(window.location.origin,""))}}]}("boolean"==typeof n&&n),u=w(i,2),a=u[0],c=u[1],s=a.get("string"==typeof e?e:""),l=null!=s?s:r||null;t.useEffect((function(){r&&!s&&(a.set(e,r),c(new URLSearchParams(a.toString())))}),[r]);var f=function(t){return"function"==typeof Object.fromEntries?Object.assign({},Object.fromEntries(a.entries()),y({},e,encodeURIComponent(t))):Object.assign({},b(a.entries()).reduce((function(e,t){var n=w(t,2),r=n[0],o=n[1];return d(d({},e),{},y({},r,o))}),{}),y({},e,encodeURIComponent(t)))};return[l,function(t){var n={};"string"==typeof t?n=f(t):"function"==typeof t&&(n=f(t(a.get(e)))),c(n)},function(){var t=f(void 0);delete t[e],c(t)}]}
/**!
* `useIsDOMElementVisibleOnScreen()` ReactJS hook
*/,e.useSharedSignalsState=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t.useContext(H);if(null===n)throw new Error("useSharedSignalsState[Error]: Load provider before using hook");var r=w(x(n.getState(e||"")),2),o=r[0],i=r[1];return $((function(){var t=n.subscribe(i,e||"");return function(){return t()}}),[]),[o,n.dispatch.bind(n)]},e.useSharedState=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t.useContext(H);if(null===n)throw new Error("useSharedState[Error]: Load provider before using hook");var r=w(t.useState(n.getState(e||"")),2),o=r[0],i=r[1];return t.useEffect((function(){var t=n.subscribe(i,e||"");return function(){t()}}),[]),[o,n.dispatch.bind(n)]},e.useSignalsBeforePageUnload=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0,n=t.when,r=void 0!==n&&n,o=t.message,i=void 0===o?"":o;$((function(){var t=function(t){return t.preventDefault(),e.call(null,t.target),t.returnValue=i,i};return r&&window.addEventListener("beforeunload",t),function(){return window.removeEventListener("beforeunload",t)}}),[r,i])},e.useSignalsComposite=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"<no name>";if(!(r instanceof Object))throw new Error('[react-busser]: "useSignalsComposite()" invalid `initial` argument');var i=w(x(d({},r)),2),u=i[0],a=i[1],c=w(x(null),2),s=c[0],l=c[1],f=t.useCallback("string"!=typeof e?function(e,t){a((function(r){try{return d({},n(r,t,e))}catch(e){return setTimeout((function(){return l(e)}),0),r}}))}:function(e){a((function(t){try{return d({},n(t,e))}catch(e){return setTimeout((function(){return l(e)}),0),t}}))},[n]),v=w(D(e,f,o),2),p=v[0];return[u,function(e,t){return N(p,e,t)},s,v[1]]},e.useSignalsComputed=k,e.useSignalsCount=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=r.start,i=void 0===o?0:o,u=r.min,a=void 0===u?Number.MIN_SAFE_INTEGER:u,c=r.max,s=void 0===c?Number.MAX_SAFE_INTEGER:c,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"<no name>";if("number"!=typeof i||"number"!=typeof a||"number"!=typeof s)throw new Error('[react-busser]: "useSignalsCount()" incorrect count bounds data type');if(i<a||i>s)throw new Error('[react-busser]: "useSignalsCount()" incorrect count bounds range');var f=t.useRef({min:a,max:s}),d=w(x(i),2),v=d[0],p=d[1],h=w(x(null),2),m=h[0],g=h[1],y=t.useCallback((function(e,t){p((function(r){var o=r+1,i=r-1,u=f.current;try{return i<u.min&&o>u.max?r:n(r,t,e)}catch(e){return setTimeout((function(){return g(e)}),0),r}}))}),[n]),b=w(D(e,y,l),2),S=b[0];return[v,function(e,t){return N(S,e,t)},m,b[1]]},e.useSignalsEffect=$,e.useSignalsIsDOMElementVisibleOnScreen=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{root:null,threshold:0},n=t.useRef(null),r=w(x(!1),2),o=r[0],i=r[1];return $((function(){var t=n.current,r=function(e){return i((function(){return e.isIntersecting}))},o=new window.IntersectionObserver((function(e){return e.forEach(r)}),e);return t&&o.observe(t),function(){return t&&o.unobserve(t)}}),[e]),[o,n]},e.useSignalsList=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"<no name>";if(!Array.isArray(r))throw new Error('[react-busser]: "useSignalsList()" invalid `initial` argument');var i=w(x(r),2),u=i[0],a=i[1],c=w(x(null),2),s=c[0],l=c[1],f=t.useCallback("string"!=typeof e?function(e,t){a((function(r){var o;try{o=n(r,t,e)}catch(e){setTimeout((function(){return l(e)}),0),o=r}return o}))}:function(e){a((function(t){var r;try{r=n(t,e)}catch(e){setTimeout((function(){return l(e)}),0),r=t}return r}))},[n]),d=w(D(e,f,o),2),v=d[0];return[u,function(e,t){return N(v,e,t)},s,d[1]]},e.useSignalsPageFocused=function(){var e=w(x((function(){return"undefined"!=typeof window&&document.hasFocus()})),2),t=e[0],n=e[1],r=function(){n(document.hasFocus())};return $((function(){return window.addEventListener("blur",r),window.addEventListener("focus",r),function(){window.removeEventListener("blur",r),window.removeEventListener("focus",r)}}),[]),t},e.useSignalsProperty=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"<no name>";if("string"!=typeof r)throw new Error('[react-busser]: "useProperty()" invalid `initial` argument');var i=w(x(r),2),u=i[0],a=i[1],c=w(x(null),2),s=c[0],l=c[1],f=t.useCallback("string"!=typeof e?function(e,t){a((function(r){var o;try{o=n(r,t,e)}catch(e){setTimeout((function(){return l(e)}),0),o=r}return o}))}:function(e){a((function(t){var r;try{r=n(t,e)}catch(e){setTimeout((function(){return l(e)}),0),r=t}return r}))},[n]),d=w(D(e,f,o),2),v=d[0];return[u,function(e,t){return N(v,e,t)},s,d[1]]},e.useSignalsState=x,e.useTextFilteredList=
/**!
* `useTextFilteredList()` ReactJS hook
*/
function(e,n){var r,o=e.text,i=void 0===o?"":o,u=e.page,a=void 0===u?1:u,c=e.list,l=n.filterTaskName,f=void 0===l?"specific":l,v=n.fetchRemoteFilteredList,p=void 0===v?function(){return Promise.resolve([])}:v,h=n.filterUpdateCallback,m=void 0===h?function(e){return function(){}}:h,g=n.onListChanged,y=void 0===g?function(e){}:g,b=t.useRef(W),S=t.useContext(H),E=t.useMemo((function(){return b.current}),[]);S&&(r=S.getState("$___text-filter-algos"));var T=(E=Object.assign(E,r||{}))?E[f]:function(){return[]},C=w(t.useState((function(){return{text:i,isLoading:!1,list:c,page:a}})),2),P=C[0],A=C[1],x=t.useRef(s.default((function(e,t){return"function"==typeof p?p(e,t):Promise.resolve([])}),50)).current,$=t.useCallback((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""];if(t&&"change"===t.type&&"value"in t.target&&!t.defaultPrevented){var r=t.target.value;if(""===r)return void A((function(e){return d(d({},e),{},{text