var __spreadArray=this&&this.__spreadArray||function(r,e){for(var n=0,a=e.length,t=r.length;n<a;n++,t++)r[t]=e[n];return r};var createProviderConsumer=function(r,e){var n=new Map;var a=r;var t=function(r,e){if(Array.isArray(r)){__spreadArray([],r).forEach((function(r){e[r]=a[r]}))}else{e[r]=Object.assign({},a)}};var c=function(r,e){if(!n.has(r)){n.set(r,e);t(e,r)}return function(){if(n.has(r)){n.delete(r)}}};var i=function(r,e){var c=r.state;a=c;n.forEach(t);return e};var o=function(r,n){return e(c,n[0])};var s=function(r,e){var a=r.prototype;var t=a.connectedCallback;var i=a.disconnectedCallback;a.connectedCallback=function(){c(this,e);if(t){return t.call(this)}};a.disconnectedCallback=function(){n.delete(this);if(i){i.call(this)}}};return{Provider:i,Consumer:o,injectProps:s}};export{createProviderConsumer as c};