Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

patronum

Package Overview
Dependencies
Maintainers
5
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

patronum - npm Package Compare versions

Comparing version 1.14.2 to 1.15.0

2

package.json
{
"name": "patronum",
"version": "1.14.2",
"version": "1.15.0",
"description": "☄️ Effector utility library delivering modularity and convenience",

@@ -5,0 +5,0 @@ "type": "module",

@@ -1,2 +0,2 @@

import{combine as e,createEvent as r,is as n,withRegion as t,createStore as o,sample as a,guard as i,merge as c,split as u,createEffect as s,attach as d,createNode as f,step as l,clearNode as m,forward as v,restore as p}from"effector";function g(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];return e({and:[n,e=>{for(var r of e)if(!r)return!1;return!0}],or:{sid:"-rbm5ks"}})}function y(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function h(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var t=n.call(e,r||"default");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function b(e){var{events:u,reset:s,target:d=r({name:"target",sid:"3pez5"},{name:"target",sid:"3pez5"})}=e;return n.unit(d)||w("target should be a unit"),s&&!n.unit(s)&&w("reset should be a unit"),t(d,(()=>{var e=Object.keys(u),r=Array.isArray(u)?[...e].fill(""):{},n=o(e.length,{and:{serialize:"ignore"},name:"$counter",sid:"-dszn9a"}),t=o(r,{and:{serialize:"ignore"},name:"$results",sid:"boz3x7"});n.reset(a({and:[{source:d}],or:{sid:"-8yzcn6"}})),t.reset(d),s&&(n.reset(a({and:[{source:s}],or:{sid:"-72suil"}})),t.reset(s));var f=function(e){var r=o(!1,{and:{serialize:"ignore"},name:"$isDone",sid:"ucs7nc"}).on(u[e],(()=>!0)).reset(d);s&&r.reset(s),n.on(r,(e=>e-1)),t.on(u[e],((r,n)=>{var t=Array.isArray(r)?[...r]:function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?y(Object(n),!0).forEach((function(r){h(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}({},r);return t[e]=n,t}))};for(var l of e)f(l);i({and:[{source:a({and:[{source:t,clock:c(Object.values(u),{name:"clock",sid:"-5k316x"})}],or:{name:"source",sid:"uf92v9"}}),filter:n.map((e=>0===e)),target:d}],or:{sid:"ciekm0"}})})),d}function w(e){throw new Error(e)}function j(e){var{if:t,then:o,else:a,source:c=r({name:"source",sid:"epke23"},{name:"source",sid:"epke23"})}=e,s=n.unit(t)||"function"==typeof t?t:e=>e===t;return o&&a?u({and:[{source:c,match:{then:s,else:k(s)},cases:{then:o,else:a}}],or:{sid:"9tug3k"}}):o?i({and:[{source:c,filter:s,target:o}],or:{sid:"abznoh"}}):a&&i({and:[{source:c,filter:k(s),target:a}],or:{sid:"-eb29qp"}}),c}function k(e){return n.unit(e)?e.map((e=>!e)):r=>!e(r)}function O(e){var{source:t,timeout:u,target:f}=e;if(!n.unit(t))throw new TypeError("source must be unit from effector");if(n.domain(t,{sid:"jnxv16"}))throw new TypeError("source cannot be domain");var l=function(e){if(n.store(e,{sid:"-15ujnd"}))return e;if("number"==typeof e){if(e<0||!Number.isFinite(e))throw new Error('timeout must be positive number or zero. Received: "'.concat(e,'"'));return o(e,{and:{name:"$timeout"},sid:"-x71bft"})}throw new TypeError('timeout parameter in interval method should be number or Store. "'.concat(typeof e,'" was passed'))}(u),m=r({name:"saveTimeoutId",sid:"f7vear"}),v=o(null,{and:{serialize:"ignore"},name:"$timeoutId",sid:"-50jqki"}).on(m,((e,r)=>r)),p=r({name:"saveReject",sid:"-5595t"}),g=o(null,{and:{serialize:"ignore"},name:"$rejecter",sid:"u7x1h9"}).on(p,((e,r)=>r)),y=null!=f?f:r({name:"tick",sid:"-6fizi7"}),h=s((e=>{var{timeout:r,timeoutId:n,rejectPromise:t}=e;return n&&clearTimeout(n),t&&t(),new Promise(((e,n)=>{p(n),m(setTimeout(e,r))}))}),{name:"timerBaseFx",sid:"-ww7mc3"}),b=d({and:{source:{timeoutId:v,rejectPromise:g},mapParams:(e,r)=>{var{timeoutId:n,rejectPromise:t}=r;return{timeout:e,timeoutId:n,rejectPromise:t}},effect:h},or:{name:"timerFx",sid:"-4ab544"}});g.reset(b.done),v.reset(b.done);var w=o([],{and:{serialize:"ignore"},name:"$payload",sid:"-5sqiq6"}).on(t,((e,r)=>[r])),j=o(!0,{and:{serialize:"ignore"},name:"$canTick",sid:"-ytfpys"}),k=r({name:"triggerTick",sid:"aamdmm"});j.on(k,(()=>!1)).on([y,l,b],(()=>!0));var O=c([t,l],{name:"requestTick",sid:"-8mwak3"});return i({and:[{clock:O,filter:j,target:k}],or:{sid:"-2h4urv"}}),a({and:[{source:l,clock:k,target:b}],or:{sid:"-22aer4"}}),a({and:[{source:w,clock:b.done,fn:e=>{var[r]=e;return r},target:y}],or:{sid:"-1nfyqd"}}),y}function E(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function P(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?E(Object(n),!0).forEach((function(r){T(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function T(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var t=n.call(e,r||"default");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var S={trace:!1,handler:e=>{if(!K(e.node)||"finally"!==e.node.meta.named){var{scope:r,scopeName:n,name:t,kind:o,value:a,loc:i,trace:c,node:u,logType:s}=e,d=r?" (scope: ".concat(n,")"):"",f=null!=t?t:i?"".concat(i.file,":").concat(i.line,":").concat(i.column):"",l="initial"===s?" [getState]":"";console.info("[".concat(o,"]").concat(d," ").concat(f).concat(l),a),c&&c.length>0&&!K(u)&&(console.groupCollapsed("[".concat(o,"]").concat(d," ").concat(f," trace")),c.forEach((e=>{var{name:r,kind:n,value:t,loc:o}=e,a=null!=r?r:o?"".concat(o.file,":").concat(o.line,":").concat(o.column):"";console.info("<- [".concat(n,"] ").concat(a),t)})),console.groupEnd())}}};function z(){var{config:e,units:r}=D(...arguments);r.forEach((r=>{n.store(r,{sid:"-foynff"})||n.event(r,{sid:"apy28p"})||n.effect(r,{sid:"apy3od"})?$(r,e):n.domain(r,{sid:"-rsqe9t"})&&A(r,e)}))}function A(e,r){e.onCreateStore((e=>$(e,r))),e.onCreateEvent((e=>$(e,r))),e.onCreateEffect((e=>$(e,r))),e.onCreateDomain((e=>A(e,r)))}function $(e,r){n.store(e,{sid:"w7ds2s"})?(!function(e,r){if(!r.handler)throw Error("patronum/debug must have the handler");var n={logType:"initial",scope:null,scopeName:null,node:U(e),kind:V(e),value:e.getState(),name:J(e),loc:Q(e),trace:[],stackMeta:{}};r.handler(n),_.forEach((n=>q(e,r,n))),C((n=>q(e,r,n)))}(e,r),x(e,r)):n.event(e,{sid:"fretyd"})?x(e,r):n.effect(e,{sid:"gpi2qr"})&&(x(e,r),x(e.finally,r),x(e.done,r),x(e.fail,r))}function x(e,r){var n=f({parent:[e],meta:{op:"watch"},family:{owners:e},regional:!0,node:[l.run({fn(n,t,o){var a,i=null!==(a=null==o?void 0:o.scope)&&void 0!==a?a:null,c={logType:"update",scope:i,scopeName:B(i),node:U(e),kind:V(e),value:n,name:J(e),loc:Q(e),stackMeta:W(o.parent),trace:r.trace?N(o):[]};if(!r.handler)throw Error("patronum/debug must have the handler");r.handler(c)}})]});return()=>m(n)}function N(e){for(var r=[],n=null==e?void 0:e.parent;n;){var{node:t,value:o}=n,a={node:t,value:o,name:J(t),loc:Q(t),kind:V(t),stackMeta:W(n)};r.push(a),n=n.parent}return r}function q(e,r,n){if(!r.handler)throw Error("patronum/debug must have the handler");var t=U(e),o={logType:"initial",scope:n,scopeName:B(n),node:t,kind:V(e),value:n.getState(e),name:J(e),loc:Q(e),trace:[],stackMeta:{}};r.handler(o)}function D(){for(var e=S,r=arguments.length,t=new Array(r),o=0;o<r;o++)t[o]=arguments[o];var[a,...i]=t,c=[];if(I(a))e=P(P({},S),a);else if(n.unit(a))c.push(a);else for(var[u,s]of Object.entries(a))H.set(G(s).id,u),c.push(s);for(var d of i)if(n.unit(d))c.push(d);else for(var[f,l]of Object.entries(d))H.set(G(l).id,f),c.push(l);return{config:e,units:c}}function I(e){return!n.unit(e)&&!Object.values(e).every(n.unit)}var F=new Set,C=e=>(F.add(e),()=>{F.delete(e)});var M=0;var R=new Map,_={save(e,r){_.get(e)||R.set(e,r)},get(e){var r;return e&&null!==(r=R.get(e))&&void 0!==r?r:null},delete(e){R.delete(e)},forEach(e){R.forEach(((r,n)=>e(n,r)))},clear(){R.clear()}};function B(e){if(!e)return null;var r=_.get(e);return r?r.name:e._debugId||(e._debugId="unknown_".concat(M+=1))}function K(e){var r=U(e),{sid:n,named:t}=r.meta;return Boolean(!n&&("finally"===t||"done"===t||"doneData"===t||"fail"===t||"failData"===t||"inFlight"===t||"pending"===t))}function V(e){if(n.store(e,{sid:"4o7s04"}))return"store";if(n.effect(e,{sid:"4pv5s7"})||K(e))return"effect";if(n.event(e,{sid:"4rijka"}))return"event";if(n.domain(e,{sid:"54plsy"}))return"domain";if(n.unit(e))return"unit";var r=U(e);return r.meta.op?r.meta.op:"unknown"}z.registerScope=function(e,r){return _.save(e,{name:r.name}),F.forEach((r=>r(e))),()=>{_.delete(e)}},z.unregisterAllScopes=function(){_.clear()};var G=e=>e.graphite||e,H=new Map;function J(e){var r,t,o=H.get(G(e).id);if(o)return o;if(K(e)){var a=U(e),i=a.family.owners.find((e=>"effect"===e.meta.op));if(i){var c=L(i),u=c?"".concat(c,"/"):"";return"".concat(u).concat(J(i),".").concat(a.meta.named)}return a.meta.named}if(function(e){var r=U(e),{op:n}=r.meta;return"on"===n}(e)){var s=U(e),d=J(s.next[0]),f=J(s.family.owners[0]);return"".concat(d,".on(").concat(f,")")}if(n.unit(e)){var l;if(null!=e&&null!==(l=e.compositeName)&&void 0!==l&&l.fullName)return e.compositeName.fullName;var m=L(e),v=m?"".concat(m,"/"):"";if(null!=e&&e.shortName)return"".concat(v).concat(e.shortName);if(null!=e&&e.name)return"".concat(v).concat(e.name)}return null!==(r=U(e))&&void 0!==r&&null!==(t=r.meta)&&void 0!==t&&t.name?U(e).meta.name:null}function L(e){var r=U(e).family.owners.find((e=>"domain"===e.meta.op));return r?J(r):null}function Q(e){var r=function(e){var{meta:r}=e;return"config"in r?r.config.loc:r.loc}(U(e));if(r)return r}function U(e){return"graphite"in e?e.graphite:e}function W(e){return e&&e.meta||{}}function X(t){var{source:o,timeout:i,target:c=r({name:"target",sid:"-z2vw3w"},{name:"target",sid:"-z2vw3w"})}=t;if(!n.unit(o))throw new TypeError("source must be a unit from effector");if(!n.unit(c))throw new TypeError("target must be a unit from effector");var u=function(e){if(n.store(e,{sid:"-va560a"})||"function"==typeof e||"number"==typeof e)return e;throw new TypeError("'timeout' argument must be a function, Store, or a number. Passed \"".concat(typeof e,'"'))}(i),d=s((e=>{var{payload:r,milliseconds:n}=e;return new Promise((e=>{setTimeout(e,n,r)}))}),{name:"timerFx",sid:"-584o7j"});return a({and:[{source:e({and:[{milliseconds:u}],or:{name:"source",sid:"9rbdjo"}}),clock:o,fn:(e,r)=>{var{milliseconds:n}=e;return{payload:r,milliseconds:"function"==typeof n?n(r):n}},target:d}],or:{sid:"-wmj29s"}}),v({and:{from:d.doneData,to:c},or:{sid:"-vsadmx"}}),c}function Y(r,t,o){if(n.store(r,{sid:"ozzvoc"}))return e({and:[r,t,o,(e,r,n)=>e?r:n],or:{sid:"-5vau2h"}});var a=r;return Y(a.filter,a.then,a.other)}function Z(e){return e.map((e=>null===e))}function ee(r,n){return e({and:[r,n,(e,r)=>e===r],or:{sid:"-pqjlti"}})}function re(r,t){var o,a=[],i=()=>!1;Array.isArray(r)?(a=r,i=t):Array.isArray(r.stores)&&(a=r.stores,i=r.predicate),o="function"==typeof i?i:n.store(i,{sid:"sid3ut"})?i.map((e=>r=>e===r)):e=>e===i;var c=e({and:[a],or:{name:"$values",sid:"h09uhg"}});return e({and:[o,c,(e,r)=>r.every(e)],or:{sid:"hfkdw9"}})}function ne(r){for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];return e({and:[t,e=>r.reduce(((n,t,o)=>n.concat(oe(r,o)?t:"".concat(t).concat(te(e[o])))),"")],or:{sid:"-yrbthp"}})}function te(e){return Array.isArray(e)?e.map((e=>String(e))).join(", "):String(e)}function oe(e,r){return r===e.length-1}function ae(r){var{effects:n,domain:t}=r;if(t){var o=t.createStore(0,{name:"$inFlight",sid:"-y7vg7t"});return t.onCreateEffect((e=>{o.on(e,(e=>e+1)).on(e.finally,(e=>e-1))})),o}return e({and:[n.map((e=>e.inFlight)),e=>e.reduce(((e,r)=>e+r),0)],or:{sid:"ubqxa7"}})}function ie(e){var{timeout:t,start:c,stop:u,leading:s=!1,trailing:f=!1}=e,l=r({name:"tick",sid:"u782pl"}),m=o(!1,{name:"$isRunning",sid:"-xegewf"}),v=function(e){if(n.store(e,{sid:"7icamc"}))return e;if("number"==typeof e)return o(e,{and:{name:"$timeout"},sid:"knc3em"});throw new TypeError('timeout parameter in interval method should be number or Store. "'.concat(typeof e,'" was passed'))}(t),p=m.map((e=>!e)),g=r({name:"saveTimeout",sid:"ab3q7d"}),y=o(null,{name:"$timeoutId",sid:"-aj5rja"}).on(g,((e,r)=>{var{timeoutId:n}=r;return n})),h=o((()=>{}),{name:"$rejecter",sid:"opb0ih"}).on(g,((e,r)=>{var{reject:n}=r;return n})),b=d({and:{source:{timeout:v,running:m},effect:e=>{var{timeout:r,running:n}=e;return n?new Promise(((e,n)=>{var t=setTimeout(e,r);g({timeoutId:t,reject:n})})):Promise.reject()}},or:{name:"timeoutFx",sid:"9hil7b"}}),w=d({and:{source:{timeoutId:y,rejecter:h},effect:e=>{var{timeoutId:r,rejecter:n}=e;n(),r&&clearTimeout(r)}},or:{name:"cleanupFx",sid:"-v02m7d"}});if(i({and:[{clock:c,source:v,filter:p,target:b}],or:{sid:"-vop0ii"}}),s){var j=i({and:[{clock:c,filter:p}],or:{name:"onReady",sid:"-cmw7lh"}});a({and:[{clock:j,target:l}],or:{sid:"-v876ny"}})}return a({and:[{clock:c,fn:()=>!0,target:m}],or:{sid:"-v6jsxl"}}),i({and:[{clock:b.done,source:v,filter:m,target:b}],or:{sid:"-urpcwu"}}),i({and:[{clock:b.done,filter:m,target:l.prepend((()=>{}))}],or:{sid:"-ucb4aq"}}),u&&(f&&a({and:[{clock:u,target:l}],or:{sid:"6lcn0o"}}),m.on(u,(()=>!1)),a({and:[{clock:u,target:w}],or:{sid:"71ao6f"}})),{tick:l,isRunning:m}}function ce(e){return e.map((e=>!e))}function ue(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];return e({and:[n,e=>{for(var r of e)if(r)return!0;return!1}],or:{sid:"-44722k"}})}var se={some:e=>e.some(Boolean),every:e=>e.every(Boolean)};function de(r){var{effects:t,domain:o,of:a="some"}=r;if(!n.domain(o,{sid:"97b92c"})&&!t)throw new TypeError("domain or effects should be passed");if("some"!==a&&"every"!==a)throw new TypeError('strategy parameter "of" can be "every" or "some". Passed: "'.concat(a,'"'));var i=null!=t?t:[],c=se[a];return o&&(i=[],o.onCreateEffect((e=>i.push(e)))),e({and:[i.map((e=>e.pending)),c],or:{sid:"a37bj0"}})}function fe(e){var{clock:r,target:n}=e,t=Array.isArray(n)?n:[n],o=Array.isArray(r)?r:[r];t.forEach((e=>{e.reset(o)}))}function le(e){var{source:r,shape:n}=e,t={};for(var o in n)o in n&&function(){var e=n[o];t[o]=r.map((r=>{var n=e(r);return void 0===n?null:n}))}();return t}function me(e){var{source:r,clock:n,fn:t=(e=>e)}=e,i=t(r.defaultState),c=a(n?{and:[{source:r,clock:n,fn:t}],or:{name:"onSnapshot",sid:"-auitd0"}}:{and:[{source:r,fn:t}],or:{name:"onSnapshot",sid:"-auiql4"}}),u=o(i,{name:"$snapshot",sid:"-7zyoaf"});return u.on(c,((e,r)=>r)),u}function ve(r,t){var o,a=[],i=()=>!1;Array.isArray(r)?(a=r,i=t):Array.isArray(r.stores)&&(a=r.stores,i=r.predicate),o="function"==typeof i?i:n.store(i,{sid:"zbwu0l"})?i.map((e=>r=>e===r)):e=>e===i;var c=e({and:[a],or:{name:"$values",sid:"-lv5do0"}});return e({and:[o,c,(e,r)=>r.some(e)],or:{sid:"-efc5w7"}})}function pe(e){var{source:r,cases:t}=e,o={},a=n.store(r,{name:"current",sid:"-htjkz7"})?r.updates:r;for(var i in t)i in t&&function(){var e=t[i];o[i]=a.filterMap(e),a=a.filter({fn:r=>!e(r)})}();return o.__=a,o}var ge={}.hasOwnProperty;function ye(e){var{targets:n,source:t=r({name:"source",sid:"-fkbi3c"},{name:"source",sid:"-fkbi3c"})}=e,o=function(e){if(c=n,u=e,ge.call(c,u)){var r=n[e],o=i({and:[{source:t,greedy:!0,filter:r=>"object"==typeof r&&null!==r&&e in r}],or:{name:"hasTargetKey",sid:"-cov4g4"}});a({and:[{greedy:!0,clock:o,fn:r=>r[e],target:r}],or:{sid:"lpn34j"}})}var c,u};for(var c in n)o(c);return t}function he(e){var{effect:r,defaultValue:n="initial"}=e,t=o(n,{name:"$status",sid:"abrgim"});return t.on(r,(()=>"pending")).on(r.done,(()=>"done")).on(r.fail,(()=>"fail")),t}function be(e){var{source:t,timeout:c,target:u=r({name:"target",sid:"r328r6"},{name:"target",sid:"r328r6"})}=e;if(!n.unit(t))throw new TypeError("source must be unit from effector");var d=function(e){if(n.store(e,{sid:"-h0ap6r"}))return e;if("number"==typeof e){if(e<0||!Number.isFinite(e))throw new Error('timeout must be positive number or zero. Received: "'.concat(e,'"'));return o(e,{and:{name:"$timeout"},sid:"-h97n10"})}throw new TypeError('timeout parameter should be number or Store. "'.concat(typeof e,'" was passed'))}(c),f=s((e=>new Promise((r=>setTimeout(r,e)))),{name:"timerFx",sid:"-pyjx8k"}),l=o(null,{and:{serialize:"ignore"},name:"$payload",sid:"hinjft"}).on(t,((e,r)=>r)),m=r({name:"triggerTick",sid:"-sf8sou"}),v=o(!0,{and:{serialize:"ignore"},name:"$canTick",sid:"-m0cqc"}).on(m,(()=>!1)).on(u,(()=>!0));return i({and:[{clock:t,filter:v,target:m}],or:{sid:"-hzhj9b"}}),a({and:[{source:d,clock:m,target:f}],or:{sid:"-hkn38k"}}),a({and:[{source:l,clock:f.done,target:u}],or:{sid:"-hhcboe"}}),u}var we=()=>Date.now();function je(e){var{clock:r,getNow:n,initial:t}=e,o=null!=n?n:we,a=s(o,{name:"readNowFx",sid:"459ysb"}),i=p(a,null!=t?t:o(),{name:"$time",sid:"-ys9vce"});return v({and:{from:r,to:a},or:{sid:"rdje9v"}}),i}export{g as and,b as combineEvents,j as condition,O as debounce,z as debug,X as delay,Y as either,Z as empty,ee as equals,re as every,ne as format,ae as inFlight,ie as interval,ce as not,ue as or,de as pending,fe as reset,le as reshape,me as snapshot,ve as some,pe as splitMap,ye as spread,he as status,be as throttle,je as time};
import{combine as e,createEvent as r,is as n,withRegion as t,createStore as o,sample as a,guard as i,merge as c,split as u,createEffect as s,attach as d,createNode as f,step as l,clearNode as m,forward as v,restore as p}from"effector";function g(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];return e({and:[n,e=>{for(var r of e)if(!r)return!1;return!0}],or:{sid:"-rbm5ks"}})}function y(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function h(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var t=n.call(e,r||"default");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function b(e){var{events:u,reset:s,target:d=r({name:"target",sid:"3pez5"},{name:"target",sid:"3pez5"})}=e;return n.unit(d)||w("target should be a unit"),s&&!n.unit(s)&&w("reset should be a unit"),t(d,(()=>{var e=Object.keys(u),r=Array.isArray(u)?[...e].fill(""):{},n=o(e.length,{and:{serialize:"ignore"},name:"$counter",sid:"-dszn9a"}),t=o(r,{and:{serialize:"ignore"},name:"$results",sid:"boz3x7"});n.reset(a({and:[{source:d}],or:{sid:"-8yzcn6"}})),t.reset(d),s&&(n.reset(a({and:[{source:s}],or:{sid:"-72suil"}})),t.reset(s));var f=function(e){var r=o(!1,{and:{serialize:"ignore"},name:"$isDone",sid:"ucs7nc"}).on(u[e],(()=>!0)).reset(d);s&&r.reset(s),n.on(r,(e=>e-1)),t.on(u[e],((r,n)=>{var t=Array.isArray(r)?[...r]:function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?y(Object(n),!0).forEach((function(r){h(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}({},r);return t[e]=n,t}))};for(var l of e)f(l);i({and:[{source:a({and:[{source:t,clock:c(Object.values(u),{name:"clock",sid:"-5k316x"})}],or:{name:"source",sid:"uf92v9"}}),filter:n.map((e=>0===e)),target:d}],or:{sid:"ciekm0"}})})),d}function w(e){throw new Error(e)}function j(e){var{if:t,then:o,else:a,source:c=r({name:"source",sid:"epke23"},{name:"source",sid:"epke23"})}=e,s=n.unit(t)||"function"==typeof t?t:e=>e===t;return o&&a?u({and:[{source:c,match:{then:s,else:k(s)},cases:{then:o,else:a}}],or:{sid:"9tug3k"}}):o?i({and:[{source:c,filter:s,target:o}],or:{sid:"abznoh"}}):a&&i({and:[{source:c,filter:k(s),target:a}],or:{sid:"-eb29qp"}}),c}function k(e){return n.unit(e)?e.map((e=>!e)):r=>!e(r)}function O(e){var{source:t,timeout:u,target:f}=e;if(!n.unit(t))throw new TypeError("source must be unit from effector");if(n.domain(t,{sid:"jnxv16"}))throw new TypeError("source cannot be domain");var l=function(e){if(n.store(e,{sid:"-15ujnd"}))return e;if("number"==typeof e){if(e<0||!Number.isFinite(e))throw new Error('timeout must be positive number or zero. Received: "'.concat(e,'"'));return o(e,{and:{name:"$timeout"},sid:"-x71bft"})}throw new TypeError('timeout parameter in interval method should be number or Store. "'.concat(typeof e,'" was passed'))}(u),m=r({name:"saveTimeoutId",sid:"f7vear"}),v=o(null,{and:{serialize:"ignore"},name:"$timeoutId",sid:"-50jqki"}).on(m,((e,r)=>r)),p=r({name:"saveReject",sid:"-5595t"}),g=o(null,{and:{serialize:"ignore"},name:"$rejecter",sid:"u7x1h9"}).on(p,((e,r)=>r)),y=null!=f?f:r({name:"tick",sid:"-6fizi7"}),h=s((e=>{var{timeout:r,timeoutId:n,rejectPromise:t}=e;return n&&clearTimeout(n),t&&t(),new Promise(((e,n)=>{p(n),m(setTimeout(e,r))}))}),{name:"timerBaseFx",sid:"-ww7mc3"}),b=d({and:{source:{timeoutId:v,rejectPromise:g},mapParams:(e,r)=>{var{timeoutId:n,rejectPromise:t}=r;return{timeout:e,timeoutId:n,rejectPromise:t}},effect:h},or:{name:"timerFx",sid:"-4ab544"}});g.reset(b.done),v.reset(b.done);var w=o([],{and:{serialize:"ignore"},name:"$payload",sid:"-5sqiq6"}).on(t,((e,r)=>[r])),j=o(!0,{and:{serialize:"ignore"},name:"$canTick",sid:"-ytfpys"}),k=r({name:"triggerTick",sid:"aamdmm"});j.on(k,(()=>!1)).on([y,l,b],(()=>!0));var O=c([t,l],{name:"requestTick",sid:"-8mwak3"});return i({and:[{clock:O,filter:j,target:k}],or:{sid:"-2h4urv"}}),a({and:[{source:l,clock:k,target:b}],or:{sid:"-22aer4"}}),a({and:[{source:w,clock:b.done,fn:e=>{var[r]=e;return r},target:y}],or:{sid:"-1nfyqd"}}),y}function E(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function P(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?E(Object(n),!0).forEach((function(r){T(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function T(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var t=n.call(e,r||"default");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var S={trace:!1,handler:e=>{if(!K(e.node)||"finally"!==e.node.meta.named){var{scope:r,scopeName:n,name:t,kind:o,value:a,loc:i,trace:c,node:u,logType:s}=e,d=r?" (scope: ".concat(n,")"):"",f=null!=t?t:i?"".concat(i.file,":").concat(i.line,":").concat(i.column):"",l="initial"===s?" [getState]":"";console.info("[".concat(o,"]").concat(d," ").concat(f).concat(l),a),c&&c.length>0&&!K(u)&&(console.groupCollapsed("[".concat(o,"]").concat(d," ").concat(f," trace")),c.forEach((e=>{var{name:r,kind:n,value:t,loc:o}=e,a=null!=r?r:o?"".concat(o.file,":").concat(o.line,":").concat(o.column):"";console.info("<- [".concat(n,"] ").concat(a),t)})),console.groupEnd())}}};function z(){var{config:e,units:r}=D(...arguments);r.forEach((r=>{n.store(r,{sid:"-foynff"})||n.event(r,{sid:"apy28p"})||n.effect(r,{sid:"apy3od"})?$(r,e):n.domain(r,{sid:"-rsqe9t"})&&A(r,e)}))}function A(e,r){e.onCreateStore((e=>$(e,r))),e.onCreateEvent((e=>$(e,r))),e.onCreateEffect((e=>$(e,r))),e.onCreateDomain((e=>A(e,r)))}function $(e,r){n.store(e,{sid:"w7ds2s"})?(!function(e,r){if(!r.handler)throw Error("patronum/debug must have the handler");var n={logType:"initial",scope:null,scopeName:null,node:U(e),kind:V(e),value:e.getState(),name:J(e),loc:Q(e),trace:[],stackMeta:{}};r.handler(n),_.forEach((n=>q(e,r,n))),C((n=>q(e,r,n)))}(e,r),x(e,r)):n.event(e,{sid:"fretyd"})?x(e,r):n.effect(e,{sid:"gpi2qr"})&&(x(e,r),x(e.finally,r),x(e.done,r),x(e.fail,r))}function x(e,r){var n=f({parent:[e],meta:{op:"watch"},family:{owners:e},regional:!0,node:[l.run({fn(n,t,o){var a,i=null!==(a=null==o?void 0:o.scope)&&void 0!==a?a:null,c={logType:"update",scope:i,scopeName:B(i),node:U(e),kind:V(e),value:n,name:J(e),loc:Q(e),stackMeta:W(o.parent),trace:r.trace?N(o):[]};if(!r.handler)throw Error("patronum/debug must have the handler");r.handler(c)}})]});return()=>m(n)}function N(e){for(var r=[],n=null==e?void 0:e.parent;n;){var{node:t,value:o}=n,a={node:t,value:o,name:J(t),loc:Q(t),kind:V(t),stackMeta:W(n)};r.push(a),n=n.parent}return r}function q(e,r,n){if(!r.handler)throw Error("patronum/debug must have the handler");var t=U(e),o={logType:"initial",scope:n,scopeName:B(n),node:t,kind:V(e),value:n.getState(e),name:J(e),loc:Q(e),trace:[],stackMeta:{}};r.handler(o)}function D(){for(var e=S,r=arguments.length,t=new Array(r),o=0;o<r;o++)t[o]=arguments[o];var[a,...i]=t,c=[];if(I(a))e=P(P({},S),a);else if(n.unit(a))c.push(a);else for(var[u,s]of Object.entries(a))H.set(G(s).id,u),c.push(s);for(var d of i)if(n.unit(d))c.push(d);else for(var[f,l]of Object.entries(d))H.set(G(l).id,f),c.push(l);return{config:e,units:c}}function I(e){return!n.unit(e)&&!Object.values(e).every(n.unit)}var F=new Set,C=e=>(F.add(e),()=>{F.delete(e)});var M=0;var R=new Map,_={save(e,r){_.get(e)||R.set(e,r)},get(e){var r;return e&&null!==(r=R.get(e))&&void 0!==r?r:null},delete(e){R.delete(e)},forEach(e){R.forEach(((r,n)=>e(n,r)))},clear(){R.clear()}};function B(e){if(!e)return null;var r=_.get(e);return r?r.name:e._debugId||(e._debugId="unknown_".concat(M+=1))}function K(e){var r=U(e),{sid:n,named:t}=r.meta;return Boolean(!n&&("finally"===t||"done"===t||"doneData"===t||"fail"===t||"failData"===t||"inFlight"===t||"pending"===t))}function V(e){if(n.store(e,{sid:"4o7s04"}))return"store";if(n.effect(e,{sid:"4pv5s7"})||K(e))return"effect";if(n.event(e,{sid:"4rijka"}))return"event";if(n.domain(e,{sid:"54plsy"}))return"domain";if(n.unit(e))return"unit";var r=U(e);return r.meta.op?r.meta.op:"unknown"}z.registerScope=function(e,r){return _.save(e,{name:r.name}),F.forEach((r=>r(e))),()=>{_.delete(e)}},z.unregisterAllScopes=function(){_.clear()};var G=e=>e.graphite||e,H=new Map;function J(e){var r,t,o=H.get(G(e).id);if(o)return o;if(K(e)){var a=U(e),i=a.family.owners.find((e=>"effect"===e.meta.op));if(i){var c=L(i),u=c?"".concat(c,"/"):"";return"".concat(u).concat(J(i),".").concat(a.meta.named)}return a.meta.named}if(function(e){var r=U(e),{op:n}=r.meta;return"on"===n}(e)){var s=U(e),d=J(s.next[0]),f=J(s.family.owners[0]);return"".concat(d,".on(").concat(f,")")}if(n.unit(e)){var l;if(null!=e&&null!==(l=e.compositeName)&&void 0!==l&&l.fullName)return e.compositeName.fullName;var m=L(e),v=m?"".concat(m,"/"):"";if(null!=e&&e.shortName)return"".concat(v).concat(e.shortName);if(null!=e&&e.name)return"".concat(v).concat(e.name)}return null!==(r=U(e))&&void 0!==r&&null!==(t=r.meta)&&void 0!==t&&t.name?U(e).meta.name:null}function L(e){var r=U(e).family.owners.find((e=>"domain"===e.meta.op));return r?J(r):null}function Q(e){var r=function(e){var{meta:r}=e;return"config"in r?r.config.loc:r.loc}(U(e));if(r)return r}function U(e){return"graphite"in e?e.graphite:e}function W(e){return e&&e.meta||{}}function X(t){var{source:o,timeout:i,target:c=r({name:"target",sid:"-z2vw3w"},{name:"target",sid:"-z2vw3w"})}=t;if(!n.unit(o))throw new TypeError("source must be a unit from effector");if(!n.unit(c))throw new TypeError("target must be a unit from effector");var u=function(e){if(n.store(e,{sid:"-va560a"})||"function"==typeof e||"number"==typeof e)return e;throw new TypeError("'timeout' argument must be a function, Store, or a number. Passed \"".concat(typeof e,'"'))}(i),d=s((e=>{var{payload:r,milliseconds:n}=e;return new Promise((e=>{setTimeout(e,n,r)}))}),{name:"timerFx",sid:"-584o7j"});return a({and:[{source:e({and:[{milliseconds:u}],or:{name:"source",sid:"9rbdjo"}}),clock:o,fn:(e,r)=>{var{milliseconds:n}=e;return{payload:r,milliseconds:"function"==typeof n?n(r):n}},target:d}],or:{sid:"-wmj29s"}}),v({and:{from:d.doneData,to:c},or:{sid:"-vsadmx"}}),c}function Y(r,t,o){if(n.store(r,{sid:"ozzvoc"}))return e({and:[r,t,o,(e,r,n)=>e?r:n],or:{sid:"-5vau2h"}});var a=r;return Y(a.filter,a.then,a.other)}function Z(e){return e.map((e=>null===e))}function ee(r,n){return e({and:[r,n,(e,r)=>e===r],or:{sid:"-pqjlti"}})}function re(r,t){var o,a=[],i=()=>!1;Array.isArray(r)?(a=r,i=t):Array.isArray(r.stores)&&(a=r.stores,i=r.predicate),o="function"==typeof i?i:n.store(i,{sid:"sid3ut"})?i.map((e=>r=>e===r)):e=>e===i;var c=e({and:[a],or:{name:"$values",sid:"h09uhg"}});return e({and:[o,c,(e,r)=>r.every(e)],or:{sid:"hfkdw9"}})}function ne(r){for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];return e({and:[t,e=>r.reduce(((n,t,o)=>n.concat(oe(r,o)?t:"".concat(t).concat(te(e[o])))),"")],or:{sid:"-yrbthp"}})}function te(e){return Array.isArray(e)?e.map((e=>String(e))).join(", "):String(e)}function oe(e,r){return r===e.length-1}function ae(r){var{effects:n,domain:t}=r;if(t){var o=t.createStore(0,{name:"$inFlight",sid:"-y7vg7t"});return t.onCreateEffect((e=>{o.on(e,(e=>e+1)).on(e.finally,(e=>e-1))})),o}return e({and:[n.map((e=>e.inFlight)),e=>e.reduce(((e,r)=>e+r),0)],or:{sid:"ubqxa7"}})}function ie(e){var{timeout:t,start:c,stop:u,leading:s=!1,trailing:f=!1}=e,l=r({name:"tick",sid:"u782pl"}),m=o(!1,{name:"$isRunning",sid:"-xegewf"}),v=function(e){if(n.store(e,{sid:"7icamc"}))return e;if("number"==typeof e)return o(e,{and:{name:"$timeout"},sid:"knc3em"});throw new TypeError('timeout parameter in interval method should be number or Store. "'.concat(typeof e,'" was passed'))}(t),p=m.map((e=>!e)),g=r({name:"saveTimeout",sid:"ab3q7d"}),y=o(null,{name:"$timeoutId",sid:"-aj5rja"}).on(g,((e,r)=>{var{timeoutId:n}=r;return n})),h=o((()=>{}),{name:"$rejecter",sid:"opb0ih"}).on(g,((e,r)=>{var{reject:n}=r;return n})),b=d({and:{source:{timeout:v,running:m},effect:e=>{var{timeout:r,running:n}=e;return n?new Promise(((e,n)=>{var t=setTimeout(e,r);g({timeoutId:t,reject:n})})):Promise.reject()}},or:{name:"timeoutFx",sid:"9hil7b"}}),w=d({and:{source:{timeoutId:y,rejecter:h},effect:e=>{var{timeoutId:r,rejecter:n}=e;n(),r&&clearTimeout(r)}},or:{name:"cleanupFx",sid:"-v02m7d"}});if(i({and:[{clock:c,source:v,filter:p,target:b}],or:{sid:"-vop0ii"}}),s){var j=i({and:[{clock:c,filter:p}],or:{name:"onReady",sid:"-cmw7lh"}});a({and:[{clock:j,target:l}],or:{sid:"-v876ny"}})}return a({and:[{clock:c,fn:()=>!0,target:m}],or:{sid:"-v6jsxl"}}),i({and:[{clock:b.done,source:v,filter:m,target:b}],or:{sid:"-urpcwu"}}),i({and:[{clock:b.done,filter:m,target:l.prepend((()=>{}))}],or:{sid:"-ucb4aq"}}),u&&(f&&a({and:[{clock:u,target:l}],or:{sid:"6lcn0o"}}),m.on(u,(()=>!1)),a({and:[{clock:u,target:w}],or:{sid:"71ao6f"}})),{tick:l,isRunning:m}}function ce(e){return e.map((e=>!e))}function ue(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];return e({and:[n,e=>{for(var r of e)if(r)return!0;return!1}],or:{sid:"-44722k"}})}var se={some:e=>e.some(Boolean),every:e=>e.every(Boolean)};function de(r){var{effects:t,domain:o,of:a="some"}=r;if(!n.domain(o,{sid:"97b92c"})&&!t)throw new TypeError("domain or effects should be passed");if("some"!==a&&"every"!==a)throw new TypeError('strategy parameter "of" can be "every" or "some". Passed: "'.concat(a,'"'));var i=null!=t?t:[],c=se[a];return o&&(i=[],o.onCreateEffect((e=>i.push(e)))),e({and:[i.map((e=>e.pending)),c],or:{sid:"a37bj0"}})}function fe(e){var{clock:n,target:t}=e,o=Array.isArray(t)?t:[t],a=Array.isArray(n)?n:[null!=n?n:r({name:"clocks",sid:"bqmea5"})];return o.forEach((e=>{e.reset(a)})),void 0===n?a[0]:void 0}function le(e){var{source:r,shape:n}=e,t={};for(var o in n)o in n&&function(){var e=n[o];t[o]=r.map((r=>{var n=e(r);return void 0===n?null:n}))}();return t}function me(e){var{source:r,clock:n,fn:t=(e=>e)}=e,i=t(r.defaultState),c=a(n?{and:[{source:r,clock:n,fn:t}],or:{name:"onSnapshot",sid:"-auitd0"}}:{and:[{source:r,fn:t}],or:{name:"onSnapshot",sid:"-auiql4"}}),u=o(i,{name:"$snapshot",sid:"-7zyoaf"});return u.on(c,((e,r)=>r)),u}function ve(r,t){var o,a=[],i=()=>!1;Array.isArray(r)?(a=r,i=t):Array.isArray(r.stores)&&(a=r.stores,i=r.predicate),o="function"==typeof i?i:n.store(i,{sid:"zbwu0l"})?i.map((e=>r=>e===r)):e=>e===i;var c=e({and:[a],or:{name:"$values",sid:"-lv5do0"}});return e({and:[o,c,(e,r)=>r.some(e)],or:{sid:"-efc5w7"}})}function pe(e){var{source:r,cases:t}=e,o={},a=n.store(r,{name:"current",sid:"-htjkz7"})?r.updates:r;for(var i in t)i in t&&function(){var e=t[i];o[i]=a.filterMap(e),a=a.filter({fn:r=>!e(r)})}();return o.__=a,o}var ge={}.hasOwnProperty;function ye(e){var{targets:n,source:t=r({name:"source",sid:"-fkbi3c"},{name:"source",sid:"-fkbi3c"})}=e,o=function(e){if(c=n,u=e,ge.call(c,u)){var r=n[e],o=i({and:[{source:t,greedy:!0,filter:r=>"object"==typeof r&&null!==r&&e in r}],or:{name:"hasTargetKey",sid:"-cov4g4"}});a({and:[{greedy:!0,clock:o,fn:r=>r[e],target:r}],or:{sid:"lpn34j"}})}var c,u};for(var c in n)o(c);return t}function he(e){var{effect:r,defaultValue:n="initial"}=e,t=o(n,{name:"$status",sid:"abrgim"});return t.on(r,(()=>"pending")).on(r.done,(()=>"done")).on(r.fail,(()=>"fail")),t}function be(e){var{source:t,timeout:c,target:u=r({name:"target",sid:"r328r6"},{name:"target",sid:"r328r6"})}=e;if(!n.unit(t))throw new TypeError("source must be unit from effector");var d=function(e){if(n.store(e,{sid:"-h0ap6r"}))return e;if("number"==typeof e){if(e<0||!Number.isFinite(e))throw new Error('timeout must be positive number or zero. Received: "'.concat(e,'"'));return o(e,{and:{name:"$timeout"},sid:"-h97n10"})}throw new TypeError('timeout parameter should be number or Store. "'.concat(typeof e,'" was passed'))}(c),f=s((e=>new Promise((r=>setTimeout(r,e)))),{name:"timerFx",sid:"-pyjx8k"}),l=o(null,{and:{serialize:"ignore"},name:"$payload",sid:"hinjft"}).on(t,((e,r)=>r)),m=r({name:"triggerTick",sid:"-sf8sou"}),v=o(!0,{and:{serialize:"ignore"},name:"$canTick",sid:"-m0cqc"}).on(m,(()=>!1)).on(u,(()=>!0));return i({and:[{clock:t,filter:v,target:m}],or:{sid:"-hzhj9b"}}),a({and:[{source:d,clock:m,target:f}],or:{sid:"-hkn38k"}}),a({and:[{source:l,clock:f.done,target:u}],or:{sid:"-hhcboe"}}),u}var we=()=>Date.now();function je(e){var{clock:r,getNow:n,initial:t}=e,o=null!=n?n:we,a=s(o,{name:"readNowFx",sid:"459ysb"}),i=p(a,null!=t?t:o(),{name:"$time",sid:"-ys9vce"});return v({and:{from:r,to:a},or:{sid:"rdje9v"}}),i}export{g as and,b as combineEvents,j as condition,O as debounce,z as debug,X as delay,Y as either,Z as empty,ee as equals,re as every,ne as format,ae as inFlight,ie as interval,ce as not,ue as or,de as pending,fe as reset,le as reshape,me as snapshot,ve as some,pe as splitMap,ye as spread,he as status,be as throttle,je as time};
//# sourceMappingURL=patronum.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("effector")):"function"==typeof define&&define.amd?define(["exports","effector"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).patronum={},e.effector)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t);function o(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var a=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.and=function(...e){return(0,r.default.combine)({and:[e,e=>{for(const t of e)if(!t)return!1;return!0}],or:{sid:"-rbm5ks"}})}})),i=o((function(e,t){function n(e){throw new Error(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.combineEvents=function({events:e,reset:t,target:o=(0,r.default.createEvent)({name:"target",sid:"3pez5"})}){r.default.is.unit(o)||n("target should be a unit");t&&!r.default.is.unit(t)&&n("reset should be a unit");return(0,r.default.withRegion)(o,(()=>{const n=Object.keys(e),a=Array.isArray(e)?[...n].fill(""):{},i=(0,r.default.createStore)(n.length,{and:{serialize:"ignore"},name:"$counter",sid:"-dszn9a"}),u=(0,r.default.createStore)(a,{and:{serialize:"ignore"},name:"$results",sid:"boz3x7"});i.reset((0,r.default.sample)({and:[{source:o}],or:{sid:"-8yzcn6"}})),u.reset(o),t&&(i.reset((0,r.default.sample)({and:[{source:t}],or:{sid:"-72suil"}})),u.reset(t));for(const a of n){const n=(0,r.default.createStore)(!1,{and:{serialize:"ignore"},name:"$isDone",sid:"ucs7nc"}).on(e[a],(()=>!0)).reset(o);t&&n.reset(t),i.on(n,(e=>e-1)),u.on(e[a],((e,t)=>{const n=Array.isArray(e)?[...e]:{...e};return n[a]=t,n}))}(0,r.default.guard)({and:[{source:(0,r.default.sample)({and:[{source:u,clock:(0,r.default.merge)(Object.values(e),{name:"clock",sid:"-5k316x"})}],or:{name:"source",sid:"uf92v9"}}),filter:i.map((e=>0===e)),target:o}],or:{sid:"ciekm0"}})})),o}})),u=o((function(e,t){function n(e){return r.default.is.unit(e)?e.map((e=>!e)):t=>!e(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.condition=function({if:e,then:t,else:o,source:a=(0,r.default.createEvent)({name:"source",sid:"epke23"})}){const i=r.default.is.unit(e)||(u=e,"function"==typeof u)?e:t=>t===e;var u;t&&o?(0,r.default.split)({and:[{source:a,match:{then:i,else:n(i)},cases:{then:t,else:o}}],or:{sid:"9tug3k"}}):t?(0,r.default.guard)({and:[{source:a,filter:i,target:t}],or:{sid:"abznoh"}}):o&&(0,r.default.guard)({and:[{source:a,filter:n(i),target:o}],or:{sid:"-eb29qp"}});return a}})),s=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=function({source:e,timeout:t,target:n}){if(!r.default.is.unit(e))throw new TypeError("source must be unit from effector");if(r.default.is.domain(e,{sid:"jnxv16"}))throw new TypeError("source cannot be domain");const o=function(e){if(r.default.is.store(e,{sid:"-15ujnd"}))return e;if("number"==typeof e){if(e<0||!Number.isFinite(e))throw new Error(`timeout must be positive number or zero. Received: "${e}"`);return(0,r.default.createStore)(e,{and:{name:"$timeout"},sid:"-x71bft"})}throw new TypeError(`timeout parameter in interval method should be number or Store. "${typeof e}" was passed`)}(t),a=(0,r.default.createEvent)({name:"saveTimeoutId",sid:"f7vear"}),i=(0,r.default.createStore)(null,{and:{serialize:"ignore"},name:"$timeoutId",sid:"-50jqki"}).on(a,((e,t)=>t)),u=(0,r.default.createEvent)({name:"saveReject",sid:"-5595t"}),s=(0,r.default.createStore)(null,{and:{serialize:"ignore"},name:"$rejecter",sid:"u7x1h9"}).on(u,((e,t)=>t)),d=null!=n?n:(0,r.default.createEvent)({name:"tick",sid:"-6fizi7"}),c=(0,r.default.createEffect)((({timeout:e,timeoutId:t,rejectPromise:n})=>(t&&clearTimeout(t),n&&n(),new Promise(((t,n)=>{u(n),a(setTimeout(t,e))})))),{name:"timerBaseFx",sid:"-ww7mc3"}),f=(0,r.default.attach)({and:{source:{timeoutId:i,rejectPromise:s},mapParams:(e,{timeoutId:t,rejectPromise:n})=>({timeout:e,timeoutId:t,rejectPromise:n}),effect:c},or:{name:"timerFx",sid:"-4ab544"}});s.reset(f.done),i.reset(f.done);const l=(0,r.default.createStore)([],{and:{serialize:"ignore"},name:"$payload",sid:"-5sqiq6"}).on(e,((e,t)=>[t])),m=(0,r.default.createStore)(!0,{and:{serialize:"ignore"},name:"$canTick",sid:"-ytfpys"}),p=(0,r.default.createEvent)({name:"triggerTick",sid:"aamdmm"});m.on(p,(()=>!1)).on([d,o,f],(()=>!0));const y=(0,r.default.merge)([e,o],{name:"requestTick",sid:"-8mwak3"});return(0,r.default.guard)({and:[{clock:y,filter:m,target:p}],or:{sid:"-2h4urv"}}),(0,r.default.sample)({and:[{source:o,clock:p,target:f}],or:{sid:"-22aer4"}}),(0,r.default.sample)({and:[{source:l,clock:f.done,fn:([e])=>e,target:d}],or:{sid:"-1nfyqd"}}),d}})),d=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.debug=o;const n={trace:!1,handler:e=>{if(g(e.node)&&"finally"===e.node.meta.named)return;const{scope:t,scopeName:n,name:r,kind:o,value:a,loc:i,trace:u,node:s,logType:d}=e,c=t?` (scope: ${n})`:"",f=null!=r?r:i?`${i.file}:${i.line}:${i.column}`:"",l="initial"===d?" [getState]":"";console.info(`[${o}]${c} ${f}${l}`,a),u&&u.length>0&&!g(s)&&(console.groupCollapsed(`[${o}]${c} ${f} trace`),u.forEach((e=>{const{name:t,kind:n,value:r,loc:o}=e,a=null!=t?t:o?`${o.file}:${o.line}:${o.column}`:"";console.info(`<- [${n}] ${a}`,r)})),console.groupEnd())}};function o(...e){const{config:t,units:o}=function(...e){let t=n;const[o,...a]=e,i=[];if(function(e){if(!r.default.is.unit(e))return!Object.values(e).every(r.default.is.unit);return!1}(o))t={...n,...o};else if(r.default.is.unit(o))i.push(o);else for(const[e,t]of Object.entries(o))b.set(v(t).id,e),i.push(t);for(const e of a)if(r.default.is.unit(e))i.push(e);else for(const[t,n]of Object.entries(e))b.set(v(n).id,t),i.push(n);return{config:t,units:i}}(...e);o.forEach((e=>{r.default.is.store(e,{sid:"-foynff"})||r.default.is.event(e,{sid:"apy28p"})||r.default.is.effect(e,{sid:"apy3od"})?i(e,t):r.default.is.domain(e,{sid:"-rsqe9t"})&&a(e,t)}))}function a(e,t){e.onCreateStore((e=>i(e,t))),e.onCreateEvent((e=>i(e,t))),e.onCreateEffect((e=>i(e,t))),e.onCreateDomain((e=>a(e,t)))}function i(e,t){r.default.is.store(e,{sid:"w7ds2s"})?(!function(e,t){if(!t.handler)throw Error("patronum/debug must have the handler");const n={logType:"initial",scope:null,scopeName:null,node:$(e),kind:h(e),value:e.getState(),name:w(e),loc:k(e),trace:[],stackMeta:{}};t.handler(n),p.forEach((n=>d(e,t,n))),f((n=>d(e,t,n)))}(e,t),u(e,t)):r.default.is.event(e,{sid:"fretyd"})?u(e,t):r.default.is.effect(e,{sid:"gpi2qr"})&&(u(e,t),u(e.finally,t),u(e.done,t),u(e.fail,t))}function u(e,t){const n=(0,r.default.createNode)({parent:[e],meta:{op:"watch"},family:{owners:e},regional:!0,node:[r.default.step.run({fn(n,r,o){var a;const i=null!==(a=o?.scope)&&void 0!==a?a:null,u={logType:"update",scope:i,scopeName:y(i),node:$(e),kind:h(e),value:n,name:w(e),loc:k(e),stackMeta:_(o.parent),trace:t.trace?s(o):[]};if(!t.handler)throw Error("patronum/debug must have the handler");t.handler(u)}})]});return()=>(0,r.default.clearNode)(n)}function s(e){const t=[];let n=e?.parent;for(;n;){const{node:e,value:r}=n,o={node:e,value:r,name:w(e),loc:k(e),kind:h(e),stackMeta:_(n)};t.push(o),n=n.parent}return t}function d(e,t,n){if(!t.handler)throw Error("patronum/debug must have the handler");const r=$(e),o={logType:"initial",scope:n,scopeName:y(n),node:r,kind:h(e),value:n.getState(e),name:w(e),loc:k(e),trace:[],stackMeta:{}};t.handler(o)}const c=new Set,f=e=>(c.add(e),()=>{c.delete(e)});let l=0;const m=new Map,p={save(e,t){p.get(e)||m.set(e,t)},get(e){var t;return e&&null!==(t=m.get(e))&&void 0!==t?t:null},delete(e){m.delete(e)},forEach(e){m.forEach(((t,n)=>e(n,t)))},clear(){m.clear()}};function y(e){if(!e)return null;const t=p.get(e);if(!t){return e._debugId||(e._debugId=(l+=1,`unknown_${l}`))}return t.name}function g(e){const t=$(e),{sid:n,named:r}=t.meta;return Boolean(!n&&("finally"===r||"done"===r||"doneData"===r||"fail"===r||"failData"===r||"inFlight"===r||"pending"===r))}function h(e){if(r.default.is.store(e,{sid:"4o7s04"}))return"store";if(r.default.is.effect(e,{sid:"4pv5s7"})||g(e))return"effect";if(r.default.is.event(e,{sid:"4rijka"}))return"event";if(r.default.is.domain(e,{sid:"54plsy"}))return"domain";if(r.default.is.unit(e))return"unit";const t=$(e);return t.meta.op?t.meta.op:"unknown"}o.registerScope=function(e,t){return p.save(e,{name:t.name}),c.forEach((t=>t(e))),()=>{p.delete(e)}},o.unregisterAllScopes=function(){p.clear()};const v=e=>e.graphite||e,b=new Map;function w(e){const t=b.get(v(e).id);if(t)return t;if(g(e)){const t=$(e),n=t.family.owners.find((e=>"effect"===e.meta.op));if(n){const e=j(n);return`${e?`${e}/`:""}${w(n)}.${t.meta.named}`}return t.meta.named}if(function(e){const t=$(e),{op:n}=t.meta;return"on"===n}(e)){const t=$(e);return`${w(t.next[0])}.on(${w(t.family.owners[0])})`}if(r.default.is.unit(e)){if(e?.compositeName?.fullName)return e.compositeName.fullName;const t=j(e),n=t?`${t}/`:"";if(e?.shortName)return`${n}${e.shortName}`;if(e?.name)return`${n}${e.name}`}return $(e)?.meta?.name?$(e).meta.name:null}function j(e){const t=$(e).family.owners.find((e=>"domain"===e.meta.op));return t?w(t):null}function k(e){const t=function({meta:e}){return"config"in e?e.config.loc:e.loc}($(e));if(t)return t}function $(e){return"graphite"in e?e.graphite:e}function _(e){if(!e)return{};return e.meta||{}}})),c=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.delay=function({source:e,timeout:t,target:n=(0,r.default.createEvent)({name:"target",sid:"-z2vw3w"})}){if(!r.default.is.unit(e))throw new TypeError("source must be a unit from effector");if(!r.default.is.unit(n))throw new TypeError("target must be a unit from effector");const o=function(e){if(r.default.is.store(e,{sid:"-va560a"})||"function"==typeof e||"number"==typeof e)return e;throw new TypeError(`'timeout' argument must be a function, Store, or a number. Passed "${typeof e}"`)}(t),a=(0,r.default.createEffect)((({payload:e,milliseconds:t})=>new Promise((n=>{setTimeout(n,t,e)}))),{name:"timerFx",sid:"-584o7j"});return(0,r.default.sample)({and:[{source:(0,r.default.combine)({and:[{milliseconds:o}],or:{name:"source",sid:"9rbdjo"}}),clock:e,fn:({milliseconds:e},t)=>({payload:t,milliseconds:"function"==typeof e?e(t):e}),target:a}],or:{sid:"-wmj29s"}}),(0,r.default.forward)({and:{from:a.doneData,to:n},or:{sid:"-vsadmx"}}),n}})),f=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.either=function e(t,n,o){if(r.default.is.store(t,{sid:"ozzvoc"}))return(0,r.default.combine)({and:[t,n,o,(e,t,n)=>e?t:n],or:{sid:"-5vau2h"}});const a=t;return e(a.filter,a.then,a.other)}})),l=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.empty=function(e){return e.map((e=>null===e))}})),m=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.equals=function(e,t){return(0,r.default.combine)({and:[e,t,(e,t)=>e===t],or:{sid:"-pqjlti"}})}})),p=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.every=function(e,t){let n,o=[],a=()=>!1;Array.isArray(e)?(o=e,a=t):Array.isArray(e.stores)&&(o=e.stores,a=e.predicate);i=a,n="function"==typeof i?a:r.default.is.store(a,{sid:"sid3ut"})?a.map((e=>t=>e===t)):e=>e===a;var i;const u=(0,r.default.combine)({and:[o],or:{name:"$values",sid:"h09uhg"}}),s=n;return(0,r.default.combine)({and:[s,u,(e,t)=>t.every(e)],or:{sid:"hfkdw9"}})}})),y=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.format=function(e,...t){return(0,r.default.combine)({and:[t,t=>e.reduce(((n,r,o)=>n.concat(function(e,t){return t===e.length-1}(e,o)?r:`${r}${function(e){if(Array.isArray(e))return e.map((e=>String(e))).join(", ");return String(e)}(t[o])}`)),"")],or:{sid:"-yrbthp"}})}})),g=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.inFlight=function({effects:e,domain:t}){if(t){const e=t.createStore(0,{name:"$inFlight",sid:"-y7vg7t"});return t.onCreateEffect((t=>{e.on(t,(e=>e+1)).on(t.finally,(e=>e-1))})),e}return(0,r.default.combine)({and:[e.map((e=>e.inFlight)),e=>e.reduce(((e,t)=>e+t),0)],or:{sid:"ubqxa7"}})}})),h=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.interval=function({timeout:e,start:t,stop:n,leading:o=!1,trailing:a=!1}){const i=(0,r.default.createEvent)({name:"tick",sid:"u782pl"}),u=(0,r.default.createStore)(!1,{name:"$isRunning",sid:"-xegewf"}),s=function(e){if(r.default.is.store(e,{sid:"7icamc"}))return e;if("number"==typeof e)return(0,r.default.createStore)(e,{and:{name:"$timeout"},sid:"knc3em"});throw new TypeError(`timeout parameter in interval method should be number or Store. "${typeof e}" was passed`)}(e),d=u.map((e=>!e)),c=(0,r.default.createEvent)({name:"saveTimeout",sid:"ab3q7d"}),f=(0,r.default.createStore)(null,{name:"$timeoutId",sid:"-aj5rja"}).on(c,((e,{timeoutId:t})=>t)),l=(0,r.default.createStore)((()=>{}),{name:"$rejecter",sid:"opb0ih"}).on(c,((e,{reject:t})=>t)),m=(0,r.default.attach)({and:{source:{timeout:s,running:u},effect:({timeout:e,running:t})=>t?new Promise(((t,n)=>{const r=setTimeout(t,e);c({timeoutId:r,reject:n})})):Promise.reject()},or:{name:"timeoutFx",sid:"9hil7b"}}),p=(0,r.default.attach)({and:{source:{timeoutId:f,rejecter:l},effect:({timeoutId:e,rejecter:t})=>{t(),e&&clearTimeout(e)}},or:{name:"cleanupFx",sid:"-v02m7d"}});if((0,r.default.guard)({and:[{clock:t,source:s,filter:d,target:m}],or:{sid:"-vop0ii"}}),o){const e=(0,r.default.guard)({and:[{clock:t,filter:d}],or:{name:"onReady",sid:"-cmw7lh"}});(0,r.default.sample)({and:[{clock:e,target:i}],or:{sid:"-v876ny"}})}(0,r.default.sample)({and:[{clock:t,fn:()=>!0,target:u}],or:{sid:"-v6jsxl"}}),(0,r.default.guard)({and:[{clock:m.done,source:s,filter:u,target:m}],or:{sid:"-urpcwu"}}),(0,r.default.guard)({and:[{clock:m.done,filter:u,target:i.prepend((()=>{}))}],or:{sid:"-ucb4aq"}}),n&&(a&&(0,r.default.sample)({and:[{clock:n,target:i}],or:{sid:"6lcn0o"}}),u.on(n,(()=>!1)),(0,r.default.sample)({and:[{clock:n,target:p}],or:{sid:"71ao6f"}}));return{tick:i,isRunning:u}}})),v=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.not=function(e){return e.map((e=>!e))}})),b=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=function(...e){return(0,r.default.combine)({and:[e,e=>{for(const t of e)if(t)return!0;return!1}],or:{sid:"-44722k"}})}})),w=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.pending=function({effects:e,domain:t,of:o="some"}){if(!r.default.is.domain(t,{sid:"97b92c"})&&!e)throw new TypeError("domain or effects should be passed");if("some"!==o&&"every"!==o)throw new TypeError(`strategy parameter "of" can be "every" or "some". Passed: "${o}"`);let a=null!=e?e:[];const i=n[o];t&&(a=[],t.onCreateEffect((e=>a.push(e))));return(0,r.default.combine)({and:[a.map((e=>e.pending)),i],or:{sid:"a37bj0"}})};const n={some:e=>e.some(Boolean),every:e=>e.every(Boolean)}})),j=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.reset=function({clock:e,target:t}){const n=Array.isArray(t)?t:[t],r=Array.isArray(e)?e:[e];n.forEach((e=>{e.reset(r)}))}})),k=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.reshape=function({source:e,shape:t}){const n={};for(const r in t)if(r in t){const o=t[r];n[r]=e.map((e=>{const t=o(e);return void 0===t?null:t}))}return n}})),$=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.snapshot=function({source:e,clock:t,fn:n=(e=>e)}){const o=n(e.defaultState),a=t?(0,r.default.sample)({and:[{source:e,clock:t,fn:n}],or:{name:"onSnapshot",sid:"-auitd0"}}):(0,r.default.sample)({and:[{source:e,fn:n}],or:{name:"onSnapshot",sid:"-auiql4"}}),i=(0,r.default.createStore)(o,{name:"$snapshot",sid:"-7zyoaf"});return i.on(a,((e,t)=>t)),i}})),_=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.some=function(e,t){let n,o=[],a=()=>!1;Array.isArray(e)?(o=e,a=t):Array.isArray(e.stores)&&(o=e.stores,a=e.predicate);i=a,n="function"==typeof i?a:r.default.is.store(a,{sid:"zbwu0l"})?a.map((e=>t=>e===t)):e=>e===a;var i;const u=(0,r.default.combine)({and:[o],or:{name:"$values",sid:"-lv5do0"}}),s=n;return(0,r.default.combine)({and:[s,u,(e,t)=>t.some(e)],or:{sid:"-efc5w7"}})}})),E=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.splitMap=function({source:e,cases:t}){const n={};let o=r.default.is.store(e,{name:"current",sid:"-htjkz7"})?e.updates:e;for(const e in t)if(e in t){const r=t[e];n[e]=o.filterMap(r),o=o.filter({fn:e=>!r(e)})}return n.__=o,n}})),P=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.spread=function({targets:e,source:t=(0,r.default.createEvent)({name:"source",sid:"-fkbi3c"})}){for(const i in e)if(o=e,a=i,n.call(o,a)){const n=e[i],o=(0,r.default.guard)({and:[{source:t,greedy:!0,filter:e=>"object"==typeof e&&null!==e&&i in e}],or:{name:"hasTargetKey",sid:"-cov4g4"}});(0,r.default.sample)({and:[{greedy:!0,clock:o,fn:e=>e[i],target:n}],or:{sid:"lpn34j"}})}var o,a;return t};const n={}.hasOwnProperty})),M=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.status=function({effect:e,defaultValue:t="initial"}){const n=(0,r.default.createStore)(t,{name:"$status",sid:"abrgim"});return n.on(e,(()=>"pending")).on(e.done,(()=>"done")).on(e.fail,(()=>"fail")),n}})),S=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=function({source:e,timeout:t,target:n=(0,r.default.createEvent)({name:"target",sid:"r328r6"})}){if(!r.default.is.unit(e))throw new TypeError("source must be unit from effector");const o=function(e){if(r.default.is.store(e,{sid:"-h0ap6r"}))return e;if("number"==typeof e){if(e<0||!Number.isFinite(e))throw new Error(`timeout must be positive number or zero. Received: "${e}"`);return(0,r.default.createStore)(e,{and:{name:"$timeout"},sid:"-h97n10"})}throw new TypeError(`timeout parameter should be number or Store. "${typeof e}" was passed`)}(t),a=(0,r.default.createEffect)((e=>new Promise((t=>setTimeout(t,e)))),{name:"timerFx",sid:"-pyjx8k"}),i=(0,r.default.createStore)(null,{and:{serialize:"ignore"},name:"$payload",sid:"hinjft"}).on(e,((e,t)=>t)),u=(0,r.default.createEvent)({name:"triggerTick",sid:"-sf8sou"}),s=(0,r.default.createStore)(!0,{and:{serialize:"ignore"},name:"$canTick",sid:"-m0cqc"}).on(u,(()=>!1)).on(n,(()=>!0));return(0,r.default.guard)({and:[{clock:e,filter:s,target:u}],or:{sid:"-hzhj9b"}}),(0,r.default.sample)({and:[{source:o,clock:u,target:a}],or:{sid:"-hkn38k"}}),(0,r.default.sample)({and:[{source:i,clock:a.done,target:n}],or:{sid:"-hhcboe"}}),n}})),O=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.time=function({clock:e,getNow:t,initial:o}){const a=null!=t?t:n,i=(0,r.default.createEffect)(a,{name:"readNowFx",sid:"459ysb"}),u=(0,r.default.restore)(i,null!=o?o:a(),{name:"$time",sid:"-ys9vce"});return(0,r.default.forward)({and:{from:e,to:i},or:{sid:"rdje9v"}}),u};const n=()=>Date.now()})),T=a.and,x=i.combineEvents,z=u.condition,q=s.debounce,A=d.debug,F=c.delay,N=f.either,I=l.empty,C=m.equals,D=p.every,R=y.format,B=g.inFlight,K=h.interval,V=v.not,G=b.or,H=w.pending,J=j.reset,L=k.reshape,Q=$.snapshot,U=_.some,W=E.splitMap,X=P.spread,Y=M.status,Z=S.throttle,ee=O.time,te={and:T,combineEvents:x,condition:z,debounce:q,debug:A,delay:F,either:N,empty:I,equals:C,every:D,format:R,inFlight:B,interval:K,not:V,or:G,pending:H,reset:J,reshape:L,snapshot:Q,some:U,splitMap:W,spread:X,status:Y,throttle:Z,time:ee};e.and=T,e.combineEvents=x,e.condition=z,e.debounce=q,e.debug=A,e.default=te,e.delay=F,e.either=N,e.empty=I,e.equals=C,e.every=D,e.format=R,e.inFlight=B,e.interval=K,e.not=V,e.or=G,e.pending=H,e.reset=J,e.reshape=L,e.snapshot=Q,e.some=U,e.splitMap=W,e.spread=X,e.status=Y,e.throttle=Z,e.time=ee,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("effector")):"function"==typeof define&&define.amd?define(["exports","effector"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).patronum={},e.effector)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t);function o(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var a=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.and=function(...e){return(0,r.default.combine)({and:[e,e=>{for(const t of e)if(!t)return!1;return!0}],or:{sid:"-rbm5ks"}})}})),i=o((function(e,t){function n(e){throw new Error(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.combineEvents=function({events:e,reset:t,target:o=(0,r.default.createEvent)({name:"target",sid:"3pez5"})}){r.default.is.unit(o)||n("target should be a unit");t&&!r.default.is.unit(t)&&n("reset should be a unit");return(0,r.default.withRegion)(o,(()=>{const n=Object.keys(e),a=Array.isArray(e)?[...n].fill(""):{},i=(0,r.default.createStore)(n.length,{and:{serialize:"ignore"},name:"$counter",sid:"-dszn9a"}),u=(0,r.default.createStore)(a,{and:{serialize:"ignore"},name:"$results",sid:"boz3x7"});i.reset((0,r.default.sample)({and:[{source:o}],or:{sid:"-8yzcn6"}})),u.reset(o),t&&(i.reset((0,r.default.sample)({and:[{source:t}],or:{sid:"-72suil"}})),u.reset(t));for(const a of n){const n=(0,r.default.createStore)(!1,{and:{serialize:"ignore"},name:"$isDone",sid:"ucs7nc"}).on(e[a],(()=>!0)).reset(o);t&&n.reset(t),i.on(n,(e=>e-1)),u.on(e[a],((e,t)=>{const n=Array.isArray(e)?[...e]:{...e};return n[a]=t,n}))}(0,r.default.guard)({and:[{source:(0,r.default.sample)({and:[{source:u,clock:(0,r.default.merge)(Object.values(e),{name:"clock",sid:"-5k316x"})}],or:{name:"source",sid:"uf92v9"}}),filter:i.map((e=>0===e)),target:o}],or:{sid:"ciekm0"}})})),o}})),u=o((function(e,t){function n(e){return r.default.is.unit(e)?e.map((e=>!e)):t=>!e(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.condition=function({if:e,then:t,else:o,source:a=(0,r.default.createEvent)({name:"source",sid:"epke23"})}){const i=r.default.is.unit(e)||(u=e,"function"==typeof u)?e:t=>t===e;var u;t&&o?(0,r.default.split)({and:[{source:a,match:{then:i,else:n(i)},cases:{then:t,else:o}}],or:{sid:"9tug3k"}}):t?(0,r.default.guard)({and:[{source:a,filter:i,target:t}],or:{sid:"abznoh"}}):o&&(0,r.default.guard)({and:[{source:a,filter:n(i),target:o}],or:{sid:"-eb29qp"}});return a}})),s=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=function({source:e,timeout:t,target:n}){if(!r.default.is.unit(e))throw new TypeError("source must be unit from effector");if(r.default.is.domain(e,{sid:"jnxv16"}))throw new TypeError("source cannot be domain");const o=function(e){if(r.default.is.store(e,{sid:"-15ujnd"}))return e;if("number"==typeof e){if(e<0||!Number.isFinite(e))throw new Error(`timeout must be positive number or zero. Received: "${e}"`);return(0,r.default.createStore)(e,{and:{name:"$timeout"},sid:"-x71bft"})}throw new TypeError(`timeout parameter in interval method should be number or Store. "${typeof e}" was passed`)}(t),a=(0,r.default.createEvent)({name:"saveTimeoutId",sid:"f7vear"}),i=(0,r.default.createStore)(null,{and:{serialize:"ignore"},name:"$timeoutId",sid:"-50jqki"}).on(a,((e,t)=>t)),u=(0,r.default.createEvent)({name:"saveReject",sid:"-5595t"}),s=(0,r.default.createStore)(null,{and:{serialize:"ignore"},name:"$rejecter",sid:"u7x1h9"}).on(u,((e,t)=>t)),d=null!=n?n:(0,r.default.createEvent)({name:"tick",sid:"-6fizi7"}),c=(0,r.default.createEffect)((({timeout:e,timeoutId:t,rejectPromise:n})=>(t&&clearTimeout(t),n&&n(),new Promise(((t,n)=>{u(n),a(setTimeout(t,e))})))),{name:"timerBaseFx",sid:"-ww7mc3"}),f=(0,r.default.attach)({and:{source:{timeoutId:i,rejectPromise:s},mapParams:(e,{timeoutId:t,rejectPromise:n})=>({timeout:e,timeoutId:t,rejectPromise:n}),effect:c},or:{name:"timerFx",sid:"-4ab544"}});s.reset(f.done),i.reset(f.done);const l=(0,r.default.createStore)([],{and:{serialize:"ignore"},name:"$payload",sid:"-5sqiq6"}).on(e,((e,t)=>[t])),m=(0,r.default.createStore)(!0,{and:{serialize:"ignore"},name:"$canTick",sid:"-ytfpys"}),p=(0,r.default.createEvent)({name:"triggerTick",sid:"aamdmm"});m.on(p,(()=>!1)).on([d,o,f],(()=>!0));const y=(0,r.default.merge)([e,o],{name:"requestTick",sid:"-8mwak3"});return(0,r.default.guard)({and:[{clock:y,filter:m,target:p}],or:{sid:"-2h4urv"}}),(0,r.default.sample)({and:[{source:o,clock:p,target:f}],or:{sid:"-22aer4"}}),(0,r.default.sample)({and:[{source:l,clock:f.done,fn:([e])=>e,target:d}],or:{sid:"-1nfyqd"}}),d}})),d=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.debug=o;const n={trace:!1,handler:e=>{if(g(e.node)&&"finally"===e.node.meta.named)return;const{scope:t,scopeName:n,name:r,kind:o,value:a,loc:i,trace:u,node:s,logType:d}=e,c=t?` (scope: ${n})`:"",f=null!=r?r:i?`${i.file}:${i.line}:${i.column}`:"",l="initial"===d?" [getState]":"";console.info(`[${o}]${c} ${f}${l}`,a),u&&u.length>0&&!g(s)&&(console.groupCollapsed(`[${o}]${c} ${f} trace`),u.forEach((e=>{const{name:t,kind:n,value:r,loc:o}=e,a=null!=t?t:o?`${o.file}:${o.line}:${o.column}`:"";console.info(`<- [${n}] ${a}`,r)})),console.groupEnd())}};function o(...e){const{config:t,units:o}=function(...e){let t=n;const[o,...a]=e,i=[];if(function(e){if(!r.default.is.unit(e))return!Object.values(e).every(r.default.is.unit);return!1}(o))t={...n,...o};else if(r.default.is.unit(o))i.push(o);else for(const[e,t]of Object.entries(o))b.set(v(t).id,e),i.push(t);for(const e of a)if(r.default.is.unit(e))i.push(e);else for(const[t,n]of Object.entries(e))b.set(v(n).id,t),i.push(n);return{config:t,units:i}}(...e);o.forEach((e=>{r.default.is.store(e,{sid:"-foynff"})||r.default.is.event(e,{sid:"apy28p"})||r.default.is.effect(e,{sid:"apy3od"})?i(e,t):r.default.is.domain(e,{sid:"-rsqe9t"})&&a(e,t)}))}function a(e,t){e.onCreateStore((e=>i(e,t))),e.onCreateEvent((e=>i(e,t))),e.onCreateEffect((e=>i(e,t))),e.onCreateDomain((e=>a(e,t)))}function i(e,t){r.default.is.store(e,{sid:"w7ds2s"})?(!function(e,t){if(!t.handler)throw Error("patronum/debug must have the handler");const n={logType:"initial",scope:null,scopeName:null,node:$(e),kind:h(e),value:e.getState(),name:w(e),loc:k(e),trace:[],stackMeta:{}};t.handler(n),p.forEach((n=>d(e,t,n))),f((n=>d(e,t,n)))}(e,t),u(e,t)):r.default.is.event(e,{sid:"fretyd"})?u(e,t):r.default.is.effect(e,{sid:"gpi2qr"})&&(u(e,t),u(e.finally,t),u(e.done,t),u(e.fail,t))}function u(e,t){const n=(0,r.default.createNode)({parent:[e],meta:{op:"watch"},family:{owners:e},regional:!0,node:[r.default.step.run({fn(n,r,o){var a;const i=null!==(a=o?.scope)&&void 0!==a?a:null,u={logType:"update",scope:i,scopeName:y(i),node:$(e),kind:h(e),value:n,name:w(e),loc:k(e),stackMeta:_(o.parent),trace:t.trace?s(o):[]};if(!t.handler)throw Error("patronum/debug must have the handler");t.handler(u)}})]});return()=>(0,r.default.clearNode)(n)}function s(e){const t=[];let n=e?.parent;for(;n;){const{node:e,value:r}=n,o={node:e,value:r,name:w(e),loc:k(e),kind:h(e),stackMeta:_(n)};t.push(o),n=n.parent}return t}function d(e,t,n){if(!t.handler)throw Error("patronum/debug must have the handler");const r=$(e),o={logType:"initial",scope:n,scopeName:y(n),node:r,kind:h(e),value:n.getState(e),name:w(e),loc:k(e),trace:[],stackMeta:{}};t.handler(o)}const c=new Set,f=e=>(c.add(e),()=>{c.delete(e)});let l=0;const m=new Map,p={save(e,t){p.get(e)||m.set(e,t)},get(e){var t;return e&&null!==(t=m.get(e))&&void 0!==t?t:null},delete(e){m.delete(e)},forEach(e){m.forEach(((t,n)=>e(n,t)))},clear(){m.clear()}};function y(e){if(!e)return null;const t=p.get(e);if(!t){return e._debugId||(e._debugId=(l+=1,`unknown_${l}`))}return t.name}function g(e){const t=$(e),{sid:n,named:r}=t.meta;return Boolean(!n&&("finally"===r||"done"===r||"doneData"===r||"fail"===r||"failData"===r||"inFlight"===r||"pending"===r))}function h(e){if(r.default.is.store(e,{sid:"4o7s04"}))return"store";if(r.default.is.effect(e,{sid:"4pv5s7"})||g(e))return"effect";if(r.default.is.event(e,{sid:"4rijka"}))return"event";if(r.default.is.domain(e,{sid:"54plsy"}))return"domain";if(r.default.is.unit(e))return"unit";const t=$(e);return t.meta.op?t.meta.op:"unknown"}o.registerScope=function(e,t){return p.save(e,{name:t.name}),c.forEach((t=>t(e))),()=>{p.delete(e)}},o.unregisterAllScopes=function(){p.clear()};const v=e=>e.graphite||e,b=new Map;function w(e){const t=b.get(v(e).id);if(t)return t;if(g(e)){const t=$(e),n=t.family.owners.find((e=>"effect"===e.meta.op));if(n){const e=j(n);return`${e?`${e}/`:""}${w(n)}.${t.meta.named}`}return t.meta.named}if(function(e){const t=$(e),{op:n}=t.meta;return"on"===n}(e)){const t=$(e);return`${w(t.next[0])}.on(${w(t.family.owners[0])})`}if(r.default.is.unit(e)){if(e?.compositeName?.fullName)return e.compositeName.fullName;const t=j(e),n=t?`${t}/`:"";if(e?.shortName)return`${n}${e.shortName}`;if(e?.name)return`${n}${e.name}`}return $(e)?.meta?.name?$(e).meta.name:null}function j(e){const t=$(e).family.owners.find((e=>"domain"===e.meta.op));return t?w(t):null}function k(e){const t=function({meta:e}){return"config"in e?e.config.loc:e.loc}($(e));if(t)return t}function $(e){return"graphite"in e?e.graphite:e}function _(e){if(!e)return{};return e.meta||{}}})),c=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.delay=function({source:e,timeout:t,target:n=(0,r.default.createEvent)({name:"target",sid:"-z2vw3w"})}){if(!r.default.is.unit(e))throw new TypeError("source must be a unit from effector");if(!r.default.is.unit(n))throw new TypeError("target must be a unit from effector");const o=function(e){if(r.default.is.store(e,{sid:"-va560a"})||"function"==typeof e||"number"==typeof e)return e;throw new TypeError(`'timeout' argument must be a function, Store, or a number. Passed "${typeof e}"`)}(t),a=(0,r.default.createEffect)((({payload:e,milliseconds:t})=>new Promise((n=>{setTimeout(n,t,e)}))),{name:"timerFx",sid:"-584o7j"});return(0,r.default.sample)({and:[{source:(0,r.default.combine)({and:[{milliseconds:o}],or:{name:"source",sid:"9rbdjo"}}),clock:e,fn:({milliseconds:e},t)=>({payload:t,milliseconds:"function"==typeof e?e(t):e}),target:a}],or:{sid:"-wmj29s"}}),(0,r.default.forward)({and:{from:a.doneData,to:n},or:{sid:"-vsadmx"}}),n}})),f=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.either=function e(t,n,o){if(r.default.is.store(t,{sid:"ozzvoc"}))return(0,r.default.combine)({and:[t,n,o,(e,t,n)=>e?t:n],or:{sid:"-5vau2h"}});const a=t;return e(a.filter,a.then,a.other)}})),l=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.empty=function(e){return e.map((e=>null===e))}})),m=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.equals=function(e,t){return(0,r.default.combine)({and:[e,t,(e,t)=>e===t],or:{sid:"-pqjlti"}})}})),p=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.every=function(e,t){let n,o=[],a=()=>!1;Array.isArray(e)?(o=e,a=t):Array.isArray(e.stores)&&(o=e.stores,a=e.predicate);i=a,n="function"==typeof i?a:r.default.is.store(a,{sid:"sid3ut"})?a.map((e=>t=>e===t)):e=>e===a;var i;const u=(0,r.default.combine)({and:[o],or:{name:"$values",sid:"h09uhg"}}),s=n;return(0,r.default.combine)({and:[s,u,(e,t)=>t.every(e)],or:{sid:"hfkdw9"}})}})),y=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.format=function(e,...t){return(0,r.default.combine)({and:[t,t=>e.reduce(((n,r,o)=>n.concat(function(e,t){return t===e.length-1}(e,o)?r:`${r}${function(e){if(Array.isArray(e))return e.map((e=>String(e))).join(", ");return String(e)}(t[o])}`)),"")],or:{sid:"-yrbthp"}})}})),g=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.inFlight=function({effects:e,domain:t}){if(t){const e=t.createStore(0,{name:"$inFlight",sid:"-y7vg7t"});return t.onCreateEffect((t=>{e.on(t,(e=>e+1)).on(t.finally,(e=>e-1))})),e}return(0,r.default.combine)({and:[e.map((e=>e.inFlight)),e=>e.reduce(((e,t)=>e+t),0)],or:{sid:"ubqxa7"}})}})),h=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.interval=function({timeout:e,start:t,stop:n,leading:o=!1,trailing:a=!1}){const i=(0,r.default.createEvent)({name:"tick",sid:"u782pl"}),u=(0,r.default.createStore)(!1,{name:"$isRunning",sid:"-xegewf"}),s=function(e){if(r.default.is.store(e,{sid:"7icamc"}))return e;if("number"==typeof e)return(0,r.default.createStore)(e,{and:{name:"$timeout"},sid:"knc3em"});throw new TypeError(`timeout parameter in interval method should be number or Store. "${typeof e}" was passed`)}(e),d=u.map((e=>!e)),c=(0,r.default.createEvent)({name:"saveTimeout",sid:"ab3q7d"}),f=(0,r.default.createStore)(null,{name:"$timeoutId",sid:"-aj5rja"}).on(c,((e,{timeoutId:t})=>t)),l=(0,r.default.createStore)((()=>{}),{name:"$rejecter",sid:"opb0ih"}).on(c,((e,{reject:t})=>t)),m=(0,r.default.attach)({and:{source:{timeout:s,running:u},effect:({timeout:e,running:t})=>t?new Promise(((t,n)=>{const r=setTimeout(t,e);c({timeoutId:r,reject:n})})):Promise.reject()},or:{name:"timeoutFx",sid:"9hil7b"}}),p=(0,r.default.attach)({and:{source:{timeoutId:f,rejecter:l},effect:({timeoutId:e,rejecter:t})=>{t(),e&&clearTimeout(e)}},or:{name:"cleanupFx",sid:"-v02m7d"}});if((0,r.default.guard)({and:[{clock:t,source:s,filter:d,target:m}],or:{sid:"-vop0ii"}}),o){const e=(0,r.default.guard)({and:[{clock:t,filter:d}],or:{name:"onReady",sid:"-cmw7lh"}});(0,r.default.sample)({and:[{clock:e,target:i}],or:{sid:"-v876ny"}})}(0,r.default.sample)({and:[{clock:t,fn:()=>!0,target:u}],or:{sid:"-v6jsxl"}}),(0,r.default.guard)({and:[{clock:m.done,source:s,filter:u,target:m}],or:{sid:"-urpcwu"}}),(0,r.default.guard)({and:[{clock:m.done,filter:u,target:i.prepend((()=>{}))}],or:{sid:"-ucb4aq"}}),n&&(a&&(0,r.default.sample)({and:[{clock:n,target:i}],or:{sid:"6lcn0o"}}),u.on(n,(()=>!1)),(0,r.default.sample)({and:[{clock:n,target:p}],or:{sid:"71ao6f"}}));return{tick:i,isRunning:u}}})),v=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.not=function(e){return e.map((e=>!e))}})),b=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=function(...e){return(0,r.default.combine)({and:[e,e=>{for(const t of e)if(t)return!0;return!1}],or:{sid:"-44722k"}})}})),w=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.pending=function({effects:e,domain:t,of:o="some"}){if(!r.default.is.domain(t,{sid:"97b92c"})&&!e)throw new TypeError("domain or effects should be passed");if("some"!==o&&"every"!==o)throw new TypeError(`strategy parameter "of" can be "every" or "some". Passed: "${o}"`);let a=null!=e?e:[];const i=n[o];t&&(a=[],t.onCreateEffect((e=>a.push(e))));return(0,r.default.combine)({and:[a.map((e=>e.pending)),i],or:{sid:"a37bj0"}})};const n={some:e=>e.some(Boolean),every:e=>e.every(Boolean)}})),j=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.reset=function({clock:e,target:t}){const n=Array.isArray(t)?t:[t],o=Array.isArray(e)?e:[null!=e?e:(0,r.default.createEvent)({name:"clocks",sid:"bqmea5"})];return n.forEach((e=>{e.reset(o)})),void 0===e?o[0]:void 0}})),k=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.reshape=function({source:e,shape:t}){const n={};for(const r in t)if(r in t){const o=t[r];n[r]=e.map((e=>{const t=o(e);return void 0===t?null:t}))}return n}})),$=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.snapshot=function({source:e,clock:t,fn:n=(e=>e)}){const o=n(e.defaultState),a=t?(0,r.default.sample)({and:[{source:e,clock:t,fn:n}],or:{name:"onSnapshot",sid:"-auitd0"}}):(0,r.default.sample)({and:[{source:e,fn:n}],or:{name:"onSnapshot",sid:"-auiql4"}}),i=(0,r.default.createStore)(o,{name:"$snapshot",sid:"-7zyoaf"});return i.on(a,((e,t)=>t)),i}})),_=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.some=function(e,t){let n,o=[],a=()=>!1;Array.isArray(e)?(o=e,a=t):Array.isArray(e.stores)&&(o=e.stores,a=e.predicate);i=a,n="function"==typeof i?a:r.default.is.store(a,{sid:"zbwu0l"})?a.map((e=>t=>e===t)):e=>e===a;var i;const u=(0,r.default.combine)({and:[o],or:{name:"$values",sid:"-lv5do0"}}),s=n;return(0,r.default.combine)({and:[s,u,(e,t)=>t.some(e)],or:{sid:"-efc5w7"}})}})),E=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.splitMap=function({source:e,cases:t}){const n={};let o=r.default.is.store(e,{name:"current",sid:"-htjkz7"})?e.updates:e;for(const e in t)if(e in t){const r=t[e];n[e]=o.filterMap(r),o=o.filter({fn:e=>!r(e)})}return n.__=o,n}})),P=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.spread=function({targets:e,source:t=(0,r.default.createEvent)({name:"source",sid:"-fkbi3c"})}){for(const i in e)if(o=e,a=i,n.call(o,a)){const n=e[i],o=(0,r.default.guard)({and:[{source:t,greedy:!0,filter:e=>"object"==typeof e&&null!==e&&i in e}],or:{name:"hasTargetKey",sid:"-cov4g4"}});(0,r.default.sample)({and:[{greedy:!0,clock:o,fn:e=>e[i],target:n}],or:{sid:"lpn34j"}})}var o,a;return t};const n={}.hasOwnProperty})),M=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.status=function({effect:e,defaultValue:t="initial"}){const n=(0,r.default.createStore)(t,{name:"$status",sid:"abrgim"});return n.on(e,(()=>"pending")).on(e.done,(()=>"done")).on(e.fail,(()=>"fail")),n}})),S=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=function({source:e,timeout:t,target:n=(0,r.default.createEvent)({name:"target",sid:"r328r6"})}){if(!r.default.is.unit(e))throw new TypeError("source must be unit from effector");const o=function(e){if(r.default.is.store(e,{sid:"-h0ap6r"}))return e;if("number"==typeof e){if(e<0||!Number.isFinite(e))throw new Error(`timeout must be positive number or zero. Received: "${e}"`);return(0,r.default.createStore)(e,{and:{name:"$timeout"},sid:"-h97n10"})}throw new TypeError(`timeout parameter should be number or Store. "${typeof e}" was passed`)}(t),a=(0,r.default.createEffect)((e=>new Promise((t=>setTimeout(t,e)))),{name:"timerFx",sid:"-pyjx8k"}),i=(0,r.default.createStore)(null,{and:{serialize:"ignore"},name:"$payload",sid:"hinjft"}).on(e,((e,t)=>t)),u=(0,r.default.createEvent)({name:"triggerTick",sid:"-sf8sou"}),s=(0,r.default.createStore)(!0,{and:{serialize:"ignore"},name:"$canTick",sid:"-m0cqc"}).on(u,(()=>!1)).on(n,(()=>!0));return(0,r.default.guard)({and:[{clock:e,filter:s,target:u}],or:{sid:"-hzhj9b"}}),(0,r.default.sample)({and:[{source:o,clock:u,target:a}],or:{sid:"-hkn38k"}}),(0,r.default.sample)({and:[{source:i,clock:a.done,target:n}],or:{sid:"-hhcboe"}}),n}})),O=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.time=function({clock:e,getNow:t,initial:o}){const a=null!=t?t:n,i=(0,r.default.createEffect)(a,{name:"readNowFx",sid:"459ysb"}),u=(0,r.default.restore)(i,null!=o?o:a(),{name:"$time",sid:"-ys9vce"});return(0,r.default.forward)({and:{from:e,to:i},or:{sid:"rdje9v"}}),u};const n=()=>Date.now()})),T=a.and,x=i.combineEvents,z=u.condition,q=s.debounce,A=d.debug,F=c.delay,N=f.either,I=l.empty,C=m.equals,D=p.every,R=y.format,B=g.inFlight,K=h.interval,V=v.not,G=b.or,H=w.pending,J=j.reset,L=k.reshape,Q=$.snapshot,U=_.some,W=E.splitMap,X=P.spread,Y=M.status,Z=S.throttle,ee=O.time,te={and:T,combineEvents:x,condition:z,debounce:q,debug:A,delay:F,either:N,empty:I,equals:C,every:D,format:R,inFlight:B,interval:K,not:V,or:G,pending:H,reset:J,reshape:L,snapshot:Q,some:U,splitMap:W,spread:X,status:Y,throttle:Z,time:ee};e.and=T,e.combineEvents=x,e.condition=z,e.debounce=q,e.debug=A,e.default=te,e.delay=F,e.either=N,e.empty=I,e.equals=C,e.every=D,e.format=R,e.inFlight=B,e.interval=K,e.not=V,e.or=G,e.pending=H,e.reset=J,e.reshape=L,e.snapshot=Q,e.some=U,e.splitMap=W,e.spread=X,e.status=Y,e.throttle=Z,e.time=ee,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=patronum.umd.js.map

@@ -1,5 +0,8 @@

import { Unit, Store } from 'effector';
export declare function reset({ clock, target, }: {
clock: Unit<any> | Array<Unit<any>>;
import type { Event, Unit, Store } from 'effector';
declare type Params = {
clock?: Unit<any> | Array<Unit<any>>;
target: Store<any> | Array<Store<any>>;
}): void;
};
export declare function reset(config: Required<Params>): void;
export declare function reset(config: Pick<Params, 'target'>): Event<void>;
export {};

@@ -0,1 +1,2 @@

import { createEvent } from 'effector';
export function reset(_ref) {

@@ -7,6 +8,10 @@ var {

var targets = Array.isArray(target) ? target : [target];
var clocks = Array.isArray(clock) ? clock : [clock];
var clocks = Array.isArray(clock) ? clock : [clock !== null && clock !== void 0 ? clock : createEvent({
name: "clocks",
sid: "bqmea5"
})];
targets.forEach(target => {
target.reset(clocks);
});
return clock === undefined ? clocks[0] : undefined;
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc