diff --git a/flutter/beagle/assets/js/beagle.js b/flutter/beagle/assets/js/beagle.js index ab271e0146..f435895a7a 100644 --- a/flutter/beagle/assets/js/beagle.js +++ b/flutter/beagle/assets/js/beagle.js @@ -1 +1 @@ -(()=>{var e={8266:function(e,t,r){"use strict";var n=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.action,r=e.executeAction,n=t.message,o=t.onPressOk;window.alert("string"==typeof n?n:JSON.stringify(n)),o&&r(o)}},6958:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.action,r=e.executeAction,n=t.condition,o=t.onTrue,a=t.onFalse;n&&o&&r(o),!n&&a&&r(a)}},8384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.action,r=e.executeAction,n=t.message,o=t.onPressOk,a=t.onPressCancel;window.confirm(n)?o&&r(o):a&&r(a)}},3368:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9632),o=r(7677),a=r(2334);t.default={forEach:n.forEach,iterator:n.iterator,replaceEach:n.replaceEach,addChild:o.addChild,clone:o.clone,insertIntoTree:o.insertIntoTree,replaceInTree:o.replaceInTree,findByAttribute:a.findByAttribute,findById:a.findById,findByType:a.findByType,findParentByChildId:a.findParentByChildId,indexOf:a.indexOf}},9632:function(e,t){"use strict";var r=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]1?c.default(e.routes,-2):u.default(g().routes);if(!t)throw new l.default("Only one route! Can't get previous!");return t}function w(t){var n,o=(n=r.length?y().controllerId:void 0)?e&&e[n]?e[n]:(f.default.warn("No navigation controller with id "+n+" has been found. Using the default navigation controller."),h):h;return Promise.all(v.map((function(e){return e(t,o)})))}function m(e,t,i){return n(this,void 0,void 0,(function(){var c,s=this;return o(this,(function(f){switch(f.label){case 0:if(c={pushStack:function(){return n(s,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!t||"string"==typeof t)throw new l.default("Invalid route for pushStack. Expected: Route object. Received: "+t+".");return[4,w(t)];case 1:return e.sent(),r.push({routes:[t],controllerId:i}),[2]}}))}))},popStack:function(){return n(s,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(b())throw new l.default("It was not possible to pop a stack because Beagle Navigator has not than one recorded stack.");return[4,w(u.default(g().routes))];case 1:return e.sent(),r.pop(),[2]}}))}))},pushView:function(){return n(s,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!t||"string"==typeof t)throw new l.default("Invalid route for pushView. Expected: Route object. Received: "+t+".");return[4,w(t)];case 1:return e.sent(),0===r.length&&r.push({routes:[]}),y().routes.push(t),[2]}}))}))},popView:function(){return n(s,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:if(b()&&(!r[0]||r[0].routes.length<2))throw new l.default("It was not possible to pop a view because Beagle Navigator has not more than one recorded route");return[4,w(_())];case 1:return t.sent(),(e=y()).routes.pop(),e.routes.length<=0&&r.pop(),[2]}}))}))},popToView:function(){return n(s,void 0,void 0,(function(){var e,r;return o(this,(function(n){switch(n.label){case 0:if(!t||"string"!=typeof t)throw new l.default("Invalid route for popToView. Expected: string. Received: "+t+".");if(e=y(),-1===(r=d.default(e.routes,(function(e){return function(e,t){return"url"in e&&e.url===t||"screen"in e&&(e.screen.identifier===t||e.screen.id===t)}(e,t)}))))throw new l.default("The route does not exist in the current stack");return[4,w(e.routes[r])];case 1:return n.sent(),e.routes.splice(r+1),[2]}}))}))},resetStack:function(){return n(s,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!t||"string"==typeof t)throw new l.default("Invalid route for pushView. Expected: Route object. Received: "+t+".");return[4,w(t)];case 1:return e.sent(),r.pop(),r.push({routes:[t],controllerId:i}),[2]}}))}))},resetApplication:function(){return n(s,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!t||"string"==typeof t)throw new l.default("Invalid route for resetApplication. Expected: Route object. Received: "+t+".");return[4,w(t)];case 1:return e.sent(),r=[{routes:[t],controllerId:i}],[2]}}))}))}},p)throw new l.default("Can't perform navigation on a navigator that has already been destroyed.");if(a)throw new l.default("Another navigation is already in progress. Can't navigate to "+t+".");a=!0,f.label=1;case 1:return f.trys.push([1,,3,4]),[4,c[e]()];case 2:return f.sent(),[3,4];case 3:return a=!1,[7];case 4:return[2]}}))}))}return{pushStack:function(e,t){return m("pushStack",e,t)},popStack:function(){return m("popStack")},pushView:function(e){return m("pushView",e)},popView:function(){return m("popView")},popToView:function(e){return m("popToView",e)},resetStack:function(e,t){return m("resetStack",e,t)},resetApplication:function(e,t){return m("resetApplication",e,t)},subscribe:function(e){return v.push(e),function(){var t=v.indexOf(e);-1!==t&&v.splice(t,1)}},get:function(){return i.default(r)},navigate:m,isEmpty:function(){return 0===r.reduce((function(e,t){return e+t.routes.length}),0)},destroy:function(){p=!0},getCurrentRoute:function(){var e=y();return u.default(e.routes)}}}}},5252:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={check:function(e,t,r){}}},0:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){return e.call(this,"cache for "+t+" has not been found.")||this}return o(t,e),t}(a(r(110)).default);t.default=i},110:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){return e.call(this,"Beagle: "+t)||this}return n(t,e),t.prototype.getSerializableError=function(){return{message:this.message}},t}(Error);t.default=o,t.isBeagleError=function(e){return!(!e.message.startsWith("Beagle")||!e.getSerializableError)}},7930:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){return e.call(this,"cache for "+t+" has expired.")||this}return o(t,e),t}(a(r(110)).default);t.default=i},2443:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){return e.call(this,"navigation error: "+t)||this}return o(t,e),t}(a(r(110)).default);t.default=i},3869:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function u(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]{"use strict";function r(e,t,r){r.beagleMetadata=r.beagleMetadata||{},r.beagleMetadata.lifecycles=r.beagleMetadata.lifecycles||{},r.beagleMetadata.lifecycles[e]=t}Object.defineProperty(t,"__esModule",{value:!0}),t.BeforeStart=function(e){return function(t){r("beforeStart",e,t)}},t.BeforeViewSnapshot=function(e){return function(t){r("beforeViewSnapshot",e,t)}},t.AfterViewSnapshot=function(e){return function(t){r("afterViewSnapshot",e,t)}},t.BeforeRender=function(e){return function(t){r("beforeRender",e,t)}},t.BeagleChildren=function(e){return function(t){var r=t;r.beagleMetadata=r.beagleMetadata||{},r.beagleMetadata.children=e}}},648:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={extract:function(e){var t=Object.keys(e),r={children:{},lifecycles:{afterViewSnapshot:{},beforeRender:{},beforeStart:{},beforeViewSnapshot:{}}};return t.forEach((function(t){var n=e[t].beagleMetadata;n&&(n.children&&(r.children[t.toLowerCase()]=n.children),n.lifecycles&&Object.keys(n.lifecycles).forEach((function(e){var o=n.lifecycles[e];o&&(r.lifecycles[e][t.toLowerCase()]=o)})))})),r}}},4592:function(e,t,r){"use strict";var n=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={condition:function(e,t,r){return e?t:r},not:function(e){return!e},and:function(){for(var e=[],t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={sum:function(){for(var e=[],t=0;tt},gte:function(e,t){return e>=t},lt:function(e,t){return e0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=400)throw new l.default(i,o);return _={},d?(function(e,t,r,n){var o=e.headers.get("beagle-hash")||"",a=e.headers.get("cache-control")||"",i=a&&a.match(/max-age=(\d+)/),c={beagleHash:o,requestTime:t,ttl:i&&i[1]||""};u.updateMetadata(c,r,n)}(o,h,i,c),[4,y(o,i,c,f)]):[3,7];case 6:return _=a.sent(),[3,9];case 7:return[4,o.json()];case 8:_=a.sent(),f&&e.setItem(t.namespace+"/"+i+"/"+c,JSON.stringify(_)),a.label=9;case 9:return[2,_]}}))}))}function _(e){var t=e.map((function(e){if(c.isBeagleError(e)){var t=e.getSerializableError();return t instanceof Promise?t:Promise.resolve(t)}return Promise.resolve({message:e.message})}));return Promise.all(t)}return void 0===h&&(h="beagle-with-fallback-to-cache"),{load:function(e){var t=e.url,r=e.fallbackUIElement,n=e.method,u=void 0===n?"get":n,c=e.headers,s=e.strategy,l=void 0===s?h:s,f=e.loadingComponent,p=void 0===f?"custom:loading":f,y=e.errorComponent,w=void 0===y?"custom:error":y,m=e.shouldShowLoading,x=void 0===m||m,j=e.shouldShowError,O=void 0===j||j,P=e.onChangeTree,S=e.retry;return o(this,void 0,void 0,(function(){function e(e,r){return void 0===e&&(e=!1),void 0===r&&(r=!0),o(this,void 0,void 0,(function(){var n;return a(this,(function(o){switch(o.label){case 0:return x&&!e&&P({_beagleComponent_:p}),[4,g(t,u,c,"network-only"!==l,r)];case 1:return n=o.sent(),P(n),[2]}}))}))}function n(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(r){switch(r.label){case 0:return e=P,[4,v(t,u)];case 1:return e.apply(void 0,[r.sent()]),[2]}}))}))}function s(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(r){switch(r.label){case 0:return e=P,[4,b(t,u)];case 1:return e.apply(void 0,[r.sent()]),[2]}}))}))}function f(t,r){return o(this,void 0,void 0,(function(){var o,i,u,c,l;return a(this,(function(a){switch(a.label){case 0:o=[],i=!1,u=!1,c=0,a.label=1;case 1:if(!(c0)return!1;if(void 0===r)return!0;if("string"==typeof r)return t=r,u.startsWith(r);var i=u.match(new RegExp("^("+r.source+")"));return!!i&&(t=i[0],!0)}));if(!r)return{value:null};u=u.substring(t.length),i=r.next,void 0!==r.pop&&a.pop(),void 0!==r.push&&a.push(r.push)};i!==r;){var s=c();if("object"==typeof s)return s.value}return e.substr(0,e.length-u.length)}}}}},6419:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(998));t.getPath=function(e){return function e(t,r){if(t.parentNode){if("BODY"===t.nodeName)return"BODY/"+r;var n=Array.from(t.parentNode.childNodes),a=o.default(n,t),i=n[a];return r=i.nodeName+(a>0?"["+a+"]":"")+"/"+r,i.parentNode&&e(i.parentNode,r)}}(e,"")},t.getElementByBeagleId=function(e){if(document&&document.querySelector)return document.querySelector('[data-beagle-id="'+e+'"]')},t.getElementPosition=function(e){if(e)return{x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().top}}},2413:function(e,t){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={removePrefix:function(e,t){return e.replace(new RegExp("^"+t),"")},addPrefix:function(e,t){return e&&e[0]===t?e:""+t+e},removeSuffix:function(e,t){return e.replace(new RegExp(t+"$"),"")},capitalizeFirstLetter:function(e){return e.length?""+e.charAt(0).toUpperCase()+e.slice(1):e}}},5905:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={createQueryString:function(e){return e&&Object.keys(e).length?"?"+Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&"):""}}},8552:(e,t,r)=>{var n=r(852)(r(5639),"DataView");e.exports=n},1989:(e,t,r)=>{var n=r(1789),o=r(401),a=r(7667),i=r(1327),u=r(1866);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(7040),o=r(4125),a=r(2117),i=r(7518),u=r(4705);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(852)(r(5639),"Map");e.exports=n},3369:(e,t,r)=>{var n=r(4785),o=r(1285),a=r(6e3),i=r(9916),u=r(5265);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(852)(r(5639),"Promise");e.exports=n},8525:(e,t,r)=>{var n=r(852)(r(5639),"Set");e.exports=n},8668:(e,t,r)=>{var n=r(3369),o=r(619),a=r(2385);function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t{var n=r(8407),o=r(7465),a=r(3779),i=r(7599),u=r(4758),c=r(4309);function s(e){var t=this.__data__=new n(e);this.size=t.size}s.prototype.clear=o,s.prototype.delete=a,s.prototype.get=i,s.prototype.has=u,s.prototype.set=c,e.exports=s},2705:(e,t,r)=>{var n=r(5639).Symbol;e.exports=n},1149:(e,t,r)=>{var n=r(5639).Uint8Array;e.exports=n},577:(e,t,r)=>{var n=r(852)(r(5639),"WeakMap");e.exports=n},7412:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,a=[];++r{var n=r(2545),o=r(5694),a=r(1469),i=r(4144),u=r(5776),c=r(6719),s=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=a(e),l=!r&&o(e),f=!r&&!l&&i(e),d=!r&&!l&&!f&&c(e),p=r||l||f||d,h=p?n(e.length,String):[],v=h.length;for(var b in e)!t&&!s.call(e,b)||p&&("length"==b||f&&("offset"==b||"parent"==b)||d&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||u(b,v))||h.push(b);return h}},9932:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r{e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r{e.exports=function(e){return e.split("")}},4865:(e,t,r)=>{var n=r(9465),o=r(7813),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var i=e[t];a.call(e,t)&&o(i,r)&&(void 0!==r||t in e)||n(e,t,r)}},8470:(e,t,r)=>{var n=r(7813);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},4037:(e,t,r)=>{var n=r(8363),o=r(3674);e.exports=function(e,t){return e&&n(t,o(t),e)}},3886:(e,t,r)=>{var n=r(8363),o=r(1704);e.exports=function(e,t){return e&&n(t,o(t),e)}},9465:(e,t,r)=>{var n=r(8777);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},5990:(e,t,r)=>{var n=r(6384),o=r(7412),a=r(4865),i=r(4037),u=r(3886),c=r(4626),s=r(278),l=r(8805),f=r(1911),d=r(8234),p=r(6904),h=r(4160),v=r(3824),b=r(9148),y=r(8517),g=r(1469),_=r(4144),w=r(6688),m=r(3218),x=r(2928),j=r(3674),O=r(1704),P="[object Arguments]",S="[object Function]",M="[object Object]",k={};k[P]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[M]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[S]=k["[object WeakMap]"]=!1,e.exports=function e(t,r,A,C,E,I){var T,B=1&r,R=2&r,F=4&r;if(A&&(T=E?A(t,C,E,I):A(t)),void 0!==T)return T;if(!m(t))return t;var D=g(t);if(D){if(T=v(t),!B)return s(t,T)}else{var V=h(t),N=V==S||"[object GeneratorFunction]"==V;if(_(t))return c(t,B);if(V==M||V==P||N&&!E){if(T=R||N?{}:y(t),!B)return R?f(t,u(T,t)):l(t,i(T,t))}else{if(!k[V])return E?t:{};T=b(t,V,B)}}I||(I=new n);var L=I.get(t);if(L)return L;I.set(t,T),x(t)?t.forEach((function(n){T.add(e(n,r,A,n,t,I))})):w(t)&&t.forEach((function(n,o){T.set(o,e(n,r,A,o,t,I))}));var z=D?void 0:(F?R?p:d:R?O:j)(t);return o(z||t,(function(n,o){z&&(n=t[o=n]),a(T,o,e(n,r,A,o,t,I))})),T}},3118:(e,t,r)=>{var n=r(3218),o=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},1848:e=>{e.exports=function(e,t,r,n){for(var o=e.length,a=r+(n?1:-1);n?a--:++a{var n=r(2488),o=r(7285);e.exports=function e(t,r,a,i,u){var c=-1,s=t.length;for(a||(a=o),u||(u=[]);++c0&&a(l)?r>1?e(l,r-1,a,i,u):n(u,l):i||(u[u.length]=l)}return u}},8483:(e,t,r)=>{var n=r(5063)();e.exports=n},7816:(e,t,r)=>{var n=r(8483),o=r(3674);e.exports=function(e,t){return e&&n(e,t,o)}},7786:(e,t,r)=>{var n=r(1811),o=r(327);e.exports=function(e,t){for(var r=0,a=(t=n(t,e)).length;null!=e&&r{var n=r(2488),o=r(1469);e.exports=function(e,t,r){var a=t(e);return o(e)?a:n(a,r(e))}},4239:(e,t,r)=>{var n=r(2705),o=r(9607),a=r(2333),i=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},8565:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,r){return null!=e&&t.call(e,r)}},13:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},9454:(e,t,r)=>{var n=r(4239),o=r(7005);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},939:(e,t,r)=>{var n=r(2492),o=r(7005);e.exports=function e(t,r,a,i,u){return t===r||(null==t||null==r||!o(t)&&!o(r)?t!=t&&r!=r:n(t,r,a,i,e,u))}},2492:(e,t,r)=>{var n=r(6384),o=r(7114),a=r(8351),i=r(6096),u=r(4160),c=r(1469),s=r(4144),l=r(6719),f="[object Arguments]",d="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,v,b,y){var g=c(e),_=c(t),w=g?d:u(e),m=_?d:u(t),x=(w=w==f?p:w)==p,j=(m=m==f?p:m)==p,O=w==m;if(O&&s(e)){if(!s(t))return!1;g=!0,x=!1}if(O&&!x)return y||(y=new n),g||l(e)?o(e,t,r,v,b,y):a(e,t,w,r,v,b,y);if(!(1&r)){var P=x&&h.call(e,"__wrapped__"),S=j&&h.call(t,"__wrapped__");if(P||S){var M=P?e.value():e,k=S?t.value():t;return y||(y=new n),b(M,k,r,v,y)}}return!!O&&(y||(y=new n),i(e,t,r,v,b,y))}},5588:(e,t,r)=>{var n=r(4160),o=r(7005);e.exports=function(e){return o(e)&&"[object Map]"==n(e)}},2958:(e,t,r)=>{var n=r(6384),o=r(939);e.exports=function(e,t,r,a){var i=r.length,u=i,c=!a;if(null==e)return!u;for(e=Object(e);i--;){var s=r[i];if(c&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i{var n=r(3560),o=r(5346),a=r(3218),i=r(346),u=/^\[object .+?Constructor\]$/,c=Function.prototype,s=Object.prototype,l=c.toString,f=s.hasOwnProperty,d=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(n(e)?d:u).test(i(e))}},9221:(e,t,r)=>{var n=r(4160),o=r(7005);e.exports=function(e){return o(e)&&"[object Set]"==n(e)}},8749:(e,t,r)=>{var n=r(4239),o=r(1780),a=r(7005),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[n(e)]}},7206:(e,t,r)=>{var n=r(1573),o=r(6432),a=r(6557),i=r(1469),u=r(9601);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):n(e):u(e)}},280:(e,t,r)=>{var n=r(5726),o=r(6916),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))a.call(e,r)&&"constructor"!=r&&t.push(r);return t}},313:(e,t,r)=>{var n=r(3218),o=r(5726),a=r(3498),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return a(e);var t=o(e),r=[];for(var u in e)("constructor"!=u||!t&&i.call(e,u))&&r.push(u);return r}},1573:(e,t,r)=>{var n=r(2958),o=r(1499),a=r(2634);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}},6432:(e,t,r)=>{var n=r(939),o=r(7361),a=r(9095),i=r(5403),u=r(9162),c=r(2634),s=r(327);e.exports=function(e,t){return i(e)&&u(t)?c(s(e),t):function(r){var i=o(r,e);return void 0===i&&i===t?a(r,e):n(t,i,3)}}},873:(e,t,r)=>{var n=r(5776);e.exports=function(e,t){var r=e.length;if(r)return n(t+=t<0?r:0,r)?e[t]:void 0}},371:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},9152:(e,t,r)=>{var n=r(7786);e.exports=function(e){return function(t){return n(t,e)}}},5742:(e,t,r)=>{var n=r(7406),o=r(5776),a=Array.prototype.splice;e.exports=function(e,t){for(var r=e?t.length:0,i=r-1;r--;){var u=t[r];if(r==i||u!==c){var c=u;o(u)?a.call(e,u,1):n(e,u)}}return e}},2491:(e,t,r)=>{var n=r(4865),o=r(1811),a=r(5776),i=r(3218),u=r(327);e.exports=function(e,t,r,c){if(!i(e))return e;for(var s=-1,l=(t=o(t,e)).length,f=l-1,d=e;null!=d&&++s{e.exports=function(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++n{e.exports=function(e,t){for(var r=-1,n=Array(e);++r{var n=r(2705),o=r(9932),a=r(1469),i=r(3448),u=n?n.prototype:void 0,c=u?u.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return o(t,e)+"";if(i(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},7406:(e,t,r)=>{var n=r(1811),o=r(928),a=r(292),i=r(327);e.exports=function(e,t){return t=n(t,e),null==(e=a(e,t))||delete e[i(o(t))]}},4757:e=>{e.exports=function(e,t){return e.has(t)}},1811:(e,t,r)=>{var n=r(1469),o=r(5403),a=r(5514),i=r(9833);e.exports=function(e,t){return n(e)?e:o(e,t)?[e]:a(i(e))}},180:(e,t,r)=>{var n=r(4259);e.exports=function(e,t,r){var o=e.length;return r=void 0===r?o:r,!t&&r>=o?e:n(e,t,r)}},4318:(e,t,r)=>{var n=r(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},4626:(e,t,r)=>{e=r.nmd(e);var n=r(5639),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o?n.Buffer:void 0,u=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=u?u(r):new e.constructor(r);return e.copy(n),n}},7157:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},3147:e=>{var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},419:(e,t,r)=>{var n=r(2705),o=n?n.prototype:void 0,a=o?o.valueOf:void 0;e.exports=function(e){return a?Object(a.call(e)):{}}},7133:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},278:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r{var n=r(4865),o=r(9465);e.exports=function(e,t,r,a){var i=!r;r||(r={});for(var u=-1,c=t.length;++u{var n=r(8363),o=r(9551);e.exports=function(e,t){return n(e,o(e),t)}},1911:(e,t,r)=>{var n=r(8363),o=r(1442);e.exports=function(e,t){return n(e,o(e),t)}},4429:(e,t,r)=>{var n=r(5639)["__core-js_shared__"];e.exports=n},5063:e=>{e.exports=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),u=i.length;u--;){var c=i[e?u:++o];if(!1===r(a[c],c,a))break}return t}}},8882:(e,t,r)=>{var n=r(180),o=r(2689),a=r(3140),i=r(9833);e.exports=function(e){return function(t){t=i(t);var r=o(t)?a(t):void 0,u=r?r[0]:t.charAt(0),c=r?n(r,1).join(""):t.slice(1);return u[e]()+c}}},7740:(e,t,r)=>{var n=r(7206),o=r(8612),a=r(3674);e.exports=function(e){return function(t,r,i){var u=Object(t);if(!o(t)){var c=n(r,3);t=a(t),r=function(e){return c(u[e],e,u)}}var s=e(t,r,i);return s>-1?u[c?t[s]:s]:void 0}}},8777:(e,t,r)=>{var n=r(852),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},7114:(e,t,r)=>{var n=r(8668),o=r(2908),a=r(4757);e.exports=function(e,t,r,i,u,c){var s=1&r,l=e.length,f=t.length;if(l!=f&&!(s&&f>l))return!1;var d=c.get(e),p=c.get(t);if(d&&p)return d==t&&p==e;var h=-1,v=!0,b=2&r?new n:void 0;for(c.set(e,t),c.set(t,e);++h{var n=r(2705),o=r(1149),a=r(7813),i=r(7114),u=r(8776),c=r(1814),s=n?n.prototype:void 0,l=s?s.valueOf:void 0;e.exports=function(e,t,r,n,s,f,d){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!f(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=u;case"[object Set]":var h=1&n;if(p||(p=c),e.size!=t.size&&!h)return!1;var v=d.get(e);if(v)return v==t;n|=2,d.set(e,t);var b=i(p(e),p(t),n,s,f,d);return d.delete(e),b;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},6096:(e,t,r)=>{var n=r(8234),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,a,i,u){var c=1&r,s=n(e),l=s.length;if(l!=n(t).length&&!c)return!1;for(var f=l;f--;){var d=s[f];if(!(c?d in t:o.call(t,d)))return!1}var p=u.get(e),h=u.get(t);if(p&&h)return p==t&&h==e;var v=!0;u.set(e,t),u.set(t,e);for(var b=c;++f{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},8234:(e,t,r)=>{var n=r(8866),o=r(9551),a=r(3674);e.exports=function(e){return n(e,a,o)}},6904:(e,t,r)=>{var n=r(8866),o=r(1442),a=r(1704);e.exports=function(e){return n(e,a,o)}},5050:(e,t,r)=>{var n=r(7019);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},1499:(e,t,r)=>{var n=r(9162),o=r(3674);e.exports=function(e){for(var t=o(e),r=t.length;r--;){var a=t[r],i=e[a];t[r]=[a,i,n(i)]}return t}},852:(e,t,r)=>{var n=r(8458),o=r(7801);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},5924:(e,t,r)=>{var n=r(5569)(Object.getPrototypeOf,Object);e.exports=n},9607:(e,t,r)=>{var n=r(2705),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,u=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,u),r=e[u];try{e[u]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(t?e[u]=r:delete e[u]),o}},9551:(e,t,r)=>{var n=r(4963),o=r(479),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,u=i?function(e){return null==e?[]:(e=Object(e),n(i(e),(function(t){return a.call(e,t)})))}:o;e.exports=u},1442:(e,t,r)=>{var n=r(2488),o=r(5924),a=r(9551),i=r(479),u=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,a(e)),e=o(e);return t}:i;e.exports=u},4160:(e,t,r)=>{var n=r(8552),o=r(7071),a=r(3818),i=r(8525),u=r(577),c=r(4239),s=r(346),l="[object Map]",f="[object Promise]",d="[object Set]",p="[object WeakMap]",h="[object DataView]",v=s(n),b=s(o),y=s(a),g=s(i),_=s(u),w=c;(n&&w(new n(new ArrayBuffer(1)))!=h||o&&w(new o)!=l||a&&w(a.resolve())!=f||i&&w(new i)!=d||u&&w(new u)!=p)&&(w=function(e){var t=c(e),r="[object Object]"==t?e.constructor:void 0,n=r?s(r):"";if(n)switch(n){case v:return h;case b:return l;case y:return f;case g:return d;case _:return p}return t}),e.exports=w},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},222:(e,t,r)=>{var n=r(1811),o=r(5694),a=r(1469),i=r(5776),u=r(1780),c=r(327);e.exports=function(e,t,r){for(var s=-1,l=(t=n(t,e)).length,f=!1;++s{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},1789:(e,t,r)=>{var n=r(4536);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,r)=>{var n=r(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},1327:(e,t,r)=>{var n=r(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},1866:(e,t,r)=>{var n=r(4536);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},3824:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},9148:(e,t,r)=>{var n=r(4318),o=r(7157),a=r(3147),i=r(419),u=r(7133);e.exports=function(e,t,r){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return u(e,r);case"[object Map]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return a(e);case"[object Set]":return new c;case"[object Symbol]":return i(e)}}},8517:(e,t,r)=>{var n=r(3118),o=r(5924),a=r(5726);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:n(o(e))}},7285:(e,t,r)=>{var n=r(2705),o=r(5694),a=r(1469),i=n?n.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||o(e)||!!(i&&e&&e[i])}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e{var n=r(1469),o=r(3448),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!o(e))||i.test(e)||!a.test(e)||null!=t&&e in Object(t)}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,r)=>{var n,o=r(4429),a=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!a&&a in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},9162:(e,t,r)=>{var n=r(3218);e.exports=function(e){return e==e&&!n(e)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,r)=>{var n=r(8470),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},2117:(e,t,r)=>{var n=r(8470);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7518:(e,t,r)=>{var n=r(8470);e.exports=function(e){return n(this.__data__,e)>-1}},4705:(e,t,r)=>{var n=r(8470);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},4785:(e,t,r)=>{var n=r(1989),o=r(8407),a=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},1285:(e,t,r)=>{var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:(e,t,r)=>{var n=r(5050);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},8776:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},2634:e=>{e.exports=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},4523:(e,t,r)=>{var n=r(8306);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},4536:(e,t,r)=>{var n=r(852)(Object,"create");e.exports=n},6916:(e,t,r)=>{var n=r(5569)(Object.keys,Object);e.exports=n},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:(e,t,r)=>{e=r.nmd(e);var n=r(1957),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,u=function(){try{return a&&a.require&&a.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=u},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},292:(e,t,r)=>{var n=r(7786),o=r(4259);e.exports=function(e,t){return t.length<2?e:n(e,o(t,0,-1))}},5639:(e,t,r)=>{var n=r(1957),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},619:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:e=>{e.exports=function(e){return this.__data__.has(e)}},1814:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},7465:(e,t,r)=>{var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,r)=>{var n=r(8407),o=r(7071),a=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},3140:(e,t,r)=>{var n=r(4286),o=r(2689),a=r(676);e.exports=function(e){return o(e)?a(e):n(e)}},5514:(e,t,r)=>{var n=r(4523),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,r,n,o){t.push(n?o.replace(a,"$1"):r||e)})),t}));e.exports=i},327:(e,t,r)=>{var n=r(3448);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},676:e=>{var t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",n="[^\\ud800-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",i="(?:"+t+"|"+r+")?",u="[\\ufe0e\\ufe0f]?",c=u+i+"(?:\\u200d(?:"+[n,o,a].join("|")+")"+u+i+")*",s="(?:"+[n+t+"?",t,o,a,"[\\ud800-\\udfff]"].join("|")+")",l=RegExp(r+"(?="+r+")|"+s+c,"g");e.exports=function(e){return e.match(l)||[]}},8403:(e,t,r)=>{var n=r(9833),o=r(1700);e.exports=function(e){return o(n(e).toLowerCase())}},361:(e,t,r)=>{var n=r(5990);e.exports=function(e){return n(e,5)}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},3311:(e,t,r)=>{var n=r(7740)(r(998));e.exports=n},998:(e,t,r)=>{var n=r(1848),o=r(7206),a=r(554),i=Math.max;e.exports=function(e,t,r){var u=null==e?0:e.length;if(!u)return-1;var c=null==r?0:a(r);return c<0&&(c=i(u+c,0)),n(e,o(t,3),c)}},988:(e,t,r)=>{var n=r(7740)(r(7436));e.exports=n},7436:(e,t,r)=>{var n=r(1848),o=r(7206),a=r(554),i=Math.max,u=Math.min;e.exports=function(e,t,r){var c=null==e?0:e.length;if(!c)return-1;var s=c-1;return void 0!==r&&(s=a(r),s=r<0?i(c+s,0):u(s,c-1)),n(e,o(t,3),s,!0)}},5564:(e,t,r)=>{var n=r(1078);e.exports=function(e){return null!=e&&e.length?n(e,1):[]}},7361:(e,t,r)=>{var n=r(7786);e.exports=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}},8721:(e,t,r)=>{var n=r(8565),o=r(222);e.exports=function(e,t){return null!=e&&o(e,t,n)}},9095:(e,t,r)=>{var n=r(13),o=r(222);e.exports=function(e,t){return null!=e&&o(e,t,n)}},6557:e=>{e.exports=function(e){return e}},5694:(e,t,r)=>{var n=r(9454),o=r(7005),a=Object.prototype,i=a.hasOwnProperty,u=a.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!u.call(e,"callee")};e.exports=c},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,r)=>{var n=r(3560),o=r(1780);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},4144:(e,t,r)=>{e=r.nmd(e);var n=r(5639),o=r(5062),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,u=i&&i.exports===a?n.Buffer:void 0,c=(u?u.isBuffer:void 0)||o;e.exports=c},1609:(e,t,r)=>{var n=r(280),o=r(4160),a=r(5694),i=r(1469),u=r(8612),c=r(4144),s=r(5726),l=r(6719),f=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(u(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||c(e)||l(e)||a(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(s(e))return!n(e).length;for(var r in e)if(f.call(e,r))return!1;return!0}},8446:(e,t,r)=>{var n=r(939);e.exports=function(e,t){return n(e,t)}},3560:(e,t,r)=>{var n=r(4239),o=r(3218);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},6688:(e,t,r)=>{var n=r(5588),o=r(1717),a=r(1167),i=a&&a.isMap,u=i?o(i):n;e.exports=u},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},2928:(e,t,r)=>{var n=r(9221),o=r(1717),a=r(1167),i=a&&a.isSet,u=i?o(i):n;e.exports=u},3448:(e,t,r)=>{var n=r(4239),o=r(7005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},6719:(e,t,r)=>{var n=r(8749),o=r(1717),a=r(1167),i=a&&a.isTypedArray,u=i?o(i):n;e.exports=u},3674:(e,t,r)=>{var n=r(4636),o=r(280),a=r(8612);e.exports=function(e){return a(e)?n(e):o(e)}},1704:(e,t,r)=>{var n=r(4636),o=r(313),a=r(8612);e.exports=function(e){return a(e)?n(e,!0):o(e)}},928:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},7523:(e,t,r)=>{var n=r(9465),o=r(7816),a=r(7206);e.exports=function(e,t){var r={};return t=a(t,3),o(e,(function(e,o,a){n(r,t(e,o,a),e)})),r}},8306:(e,t,r)=>{var n=r(3369);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(o.Cache||n),r}o.Cache=n,e.exports=o},8491:(e,t,r)=>{var n=r(873),o=r(554);e.exports=function(e,t){return e&&e.length?n(e,o(t)):void 0}},9601:(e,t,r)=>{var n=r(371),o=r(9152),a=r(5403),i=r(327);e.exports=function(e){return a(e)?n(i(e)):o(e)}},2729:(e,t,r)=>{var n=r(7206),o=r(5742);e.exports=function(e,t){var r=[];if(!e||!e.length)return r;var a=-1,i=[],u=e.length;for(t=n(t,3);++a{var n=r(2491);e.exports=function(e,t,r){return null==e?e:n(e,t,r)}},479:e=>{e.exports=function(){return[]}},5062:e=>{e.exports=function(){return!1}},8601:(e,t,r)=>{var n=r(4841);e.exports=function(e){return e?Infinity===(e=n(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:(e,t,r)=>{var n=r(8601);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},4841:(e,t,r)=>{var n=r(3218),o=r(3448),a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var r=u.test(e);return r||c.test(e)?s(e.slice(2),r?2:8):i.test(e)?NaN:+e}},9833:(e,t,r)=>{var n=r(531);e.exports=function(e){return null==e?"":n(e)}},9233:(e,t,r)=>{var n=r(7406);e.exports=function(e,t){return null==e||n(e,t)}},1700:(e,t,r)=>{var n=r(8882)("toUpperCase");e.exports=n},1034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCustomActionMap=void 0;const n=r(8441);function o(e,t,r=!0,a=""){if(!r&&function(e){return e&&(e._beagleAction_||Array.isArray(e)&&e[0]&&e[0]._beagleAction_)}(t)){const r=r=>e(t,a,r);return n.registerFunctionForSingleExecution(r)}return Array.isArray(t)?t.map((t=>o(e,t,!1,a))):t&&"object"==typeof t?Object.keys(t).reduce(((r,n)=>Object.assign(Object.assign({},r),{[n]:o(e,t[n],!1,n)})),{}):t}const a=({action:e,beagleView:t,element:r,executeAction:n})=>{const a=t.id,i=o(n,e);sendMessage("action",JSON.stringify({action:i,viewId:a,element:r}))};t.createCustomActionMap=function(e){return e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:a})),{})}},8441:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callFunction=t.unregisterFunctionById=t.registerPersistentFunction=t.registerFunctionForSingleExecution=t.countFunctions=void 0;const r={},n={};let o=0;function a(e){delete r[e],delete n[e]}t.countFunctions=function(){return Object.keys(r).length},t.registerFunctionForSingleExecution=function(e){const t="__beagleFn:"+o++;return r[t]=e,n[t]=!0,t},t.registerPersistentFunction=function(e){const t="__beagleFn:"+o++;return r[t]=e,t},t.unregisterFunctionById=a,t.callFunction=function(e,t){if(!r[e])throw new Error(`Can't call function with id ${e}. It doesn't exist.`);r[e](t),n[e]&&a(e)}},9075:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.respondHttpRequest=t.httpClient=void 0;const n=r(7866),o=r(9731),a=r(2744);t.httpClient={fetch:(e,t)=>{console.log(`js: fetching ${e}`);const r=n.createStaticPromise(),o={id:a.registerPromise(r),method:null==t?void 0:t.method,url:e.toString(),headers:null==t?void 0:t.headers,body:null==t?void 0:t.body};return sendMessage("httpClient.request",JSON.stringify(o)),r.promise}},t.respondHttpRequest=function(e,t){const r=function({status:e,body:t,headers:r}){const n=function(e={}){const t={append:(t,r)=>e[t]=r,delete:t=>delete e[t],entries:()=>{throw new Error("not implemented yet!")},forEach:r=>Object.keys(e).forEach((n=>r(e[n],n,t))),get:t=>e[t],has:t=>!!e[t],keys:()=>{throw new Error("not implemented yet!")},set:(t,r)=>e[t]=r,values:()=>{throw new Error("not implemented yet!")}};return t}(r);return{arrayBuffer:()=>{throw new Error("not implemented yet!")},blob:()=>{throw new Error("not implemented yet!")},clone:()=>{throw new Error("not implemented yet!")},formData:()=>{throw new Error("not implemented yet!")},json:()=>Promise.resolve(t?function(e){try{return JSON.parse(e)}catch(t){throw o.logger.error(`Unable to parse json response:\n${e}\n`),t}}(t):void 0),text:()=>Promise.resolve(t||""),body:null,bodyUsed:!1,headers:n,ok:e>=200&&e<400,redirected:e>=300&&e<400,status:e,statusText:"",trailer:Promise.resolve(n),type:"default",url:""}}(t);return console.log(`js: received response with status ${r.status}`),a.resolvePromise(e,r),a.unregisterPromise(e),"ok"}},3607:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o{let e;return{start:t=>{var{actionKeys:r}=t,n=i(t,["actionKeys"]);e=u.default(Object.assign({components:{},disableCssTransformation:!0,fetchData:d.httpClient.fetch,customStorage:l.storage,customActions:c.createCustomActionMap(r)},n)),u.logger.setCustomLogFunction(((e,...t)=>{console.log(t.join(" "))}))},createBeagleView:()=>s.createBeagleView(e),httpClient:{respond:d.respondHttpRequest},call:(e,t)=>{console.log(`js: called function with id ${e} and argument map: ${JSON.stringify(t)}`),f.callFunction(e,t)},callViewFunction:(e,t,r)=>{const n=s.getView(e);n&&n.executeFunction(t,r)},getViewById:s.getView,getService:()=>e,promise:{resolve:p.resolvePromise,reject:p.rejectPromise}}})()},2744:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rejectPromise=t.resolvePromise=t.unregisterPromise=t.registerPromise=void 0;const r={};let n=0;t.registerPromise=function(e){const t=""+n++;return r[t]=e,t},t.unregisterPromise=function(e){delete r[e]},t.resolvePromise=function(e,t){if(!r[e])throw new Error(`Can't resolve promise with id ${e}. It doesn't exist.`);r[e].resolve(t),delete r[e]},t.rejectPromise=function(e,t){if(!r[e])throw new Error(`Can't reject promise with id ${e}. It doesn't exist.`);r[e].reject(t),delete r[e]}},849:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storage=void 0;const n=r(7866),o=r(2744);t.storage={clear:()=>{const e=n.createStaticPromise(),t=o.registerPromise(e);return sendMessage("storage.clear",JSON.stringify({promiseId:t})),e.promise},getItem:e=>{const t=n.createStaticPromise(),r=o.registerPromise(t);return sendMessage("storage.get",JSON.stringify({key:e,promiseId:r})),t.promise},removeItem:e=>{const t=n.createStaticPromise(),r=o.registerPromise(t);return sendMessage("storage.remove",JSON.stringify({key:e,promiseId:r})),t.promise},setItem:(e,t)=>{const r=n.createStaticPromise(),a=o.registerPromise(r);return sendMessage("storage.set",JSON.stringify({key:e,value:t,promiseId:a})),r.promise}}},7866:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createStaticPromise=void 0,t.createStaticPromise=function(){const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}},6085:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getView=t.createBeagleView=void 0;const o=n(r(7361)),a={};let i=0;function u(e,t="__beagleFn:"){if("function"==typeof e)return t;if(e instanceof Array)return e.map(((e,r)=>u(e,`${t}[${r}]`)));if(e&&"object"==typeof e){const r={};return Object.keys(e).forEach((n=>{r[n]=u(e[n],`${t}.${n}`)})),r}return e}t.createBeagleView=function(e){const t=e.createView();t.id=""+i++;let r=null;return t.subscribe((e=>{r=e,sendMessage("beagleView.update",JSON.stringify({id:t.id,tree:u(e)}))})),t.getNavigator().subscribe((e=>sendMessage("beagleNavigator",JSON.stringify({viewId:t.id,route:e})))),t.executeFunction=(e,n)=>{if(!r)return;const a=e.replace(/__beagleFn:\.?/,""),i=o.default(r,a);"function"==typeof i?i(n):console.log(`No function with path "${a}" for view with id "${t.id}" was found.`)},a[t.id]=t,t.id},t.getView=function(e){return a[e]||console.log(`No view with id ${e} has been found.`),a[e]}}},t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(3607)})(); +(()=>{var e={8266:function(e,t,r){"use strict";var n=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.action,r=e.executeAction,n=t.message,o=t.onPressOk;window.alert("string"==typeof n?n:JSON.stringify(n)),o&&r(o)}},6958:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.action,r=e.executeAction,n=t.condition,o=t.onTrue,a=t.onFalse;n&&o&&r(o),!n&&a&&r(a)}},8384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.action,r=e.executeAction,n=t.message,o=t.onPressOk,a=t.onPressCancel;window.confirm(n)?o&&r(o):a&&r(a)}},3368:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9632),o=r(7677),a=r(2334);t.default={forEach:n.forEach,iterator:n.iterator,replaceEach:n.replaceEach,addChild:o.addChild,clone:o.clone,insertIntoTree:o.insertIntoTree,replaceInTree:o.replaceInTree,findByAttribute:a.findByAttribute,findById:a.findById,findByType:a.findByType,findParentByChildId:a.findParentByChildId,indexOf:a.indexOf}},9632:function(e,t){"use strict";var r=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]1?c.default(e.routes,-2):u.default(g().routes);if(!t)throw new l.default("Only one route! Can't get previous!");return t}function w(t){var n,o=(n=r.length?y().controllerId:void 0)?e&&e[n]?e[n]:(f.default.warn("No navigation controller with id "+n+" has been found. Using the default navigation controller."),h):h;return Promise.all(v.map((function(e){return e(t,o)})))}function m(e,t,i){return n(this,void 0,void 0,(function(){var c,s=this;return o(this,(function(f){switch(f.label){case 0:if(c={pushStack:function(){return n(s,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!t||"string"==typeof t)throw new l.default("Invalid route for pushStack. Expected: Route object. Received: "+t+".");return[4,w(t)];case 1:return e.sent(),r.push({routes:[t],controllerId:i}),[2]}}))}))},popStack:function(){return n(s,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(b())throw new l.default("It was not possible to pop a stack because Beagle Navigator has not than one recorded stack.");return[4,w(u.default(g().routes))];case 1:return e.sent(),r.pop(),[2]}}))}))},pushView:function(){return n(s,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!t||"string"==typeof t)throw new l.default("Invalid route for pushView. Expected: Route object. Received: "+t+".");return[4,w(t)];case 1:return e.sent(),0===r.length&&r.push({routes:[]}),y().routes.push(t),[2]}}))}))},popView:function(){return n(s,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:if(b()&&(!r[0]||r[0].routes.length<2))throw new l.default("It was not possible to pop a view because Beagle Navigator has not more than one recorded route");return[4,w(_())];case 1:return t.sent(),(e=y()).routes.pop(),e.routes.length<=0&&r.pop(),[2]}}))}))},popToView:function(){return n(s,void 0,void 0,(function(){var e,r;return o(this,(function(n){switch(n.label){case 0:if(!t||"string"!=typeof t)throw new l.default("Invalid route for popToView. Expected: string. Received: "+t+".");if(e=y(),-1===(r=d.default(e.routes,(function(e){return function(e,t){return"url"in e&&e.url===t||"screen"in e&&(e.screen.identifier===t||e.screen.id===t)}(e,t)}))))throw new l.default("The route does not exist in the current stack");return[4,w(e.routes[r])];case 1:return n.sent(),e.routes.splice(r+1),[2]}}))}))},resetStack:function(){return n(s,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!t||"string"==typeof t)throw new l.default("Invalid route for pushView. Expected: Route object. Received: "+t+".");return[4,w(t)];case 1:return e.sent(),r.pop(),r.push({routes:[t],controllerId:i}),[2]}}))}))},resetApplication:function(){return n(s,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!t||"string"==typeof t)throw new l.default("Invalid route for resetApplication. Expected: Route object. Received: "+t+".");return[4,w(t)];case 1:return e.sent(),r=[{routes:[t],controllerId:i}],[2]}}))}))}},p)throw new l.default("Can't perform navigation on a navigator that has already been destroyed.");if(a)throw new l.default("Another navigation is already in progress. Can't navigate to "+t+".");a=!0,f.label=1;case 1:return f.trys.push([1,,3,4]),[4,c[e]()];case 2:return f.sent(),[3,4];case 3:return a=!1,[7];case 4:return[2]}}))}))}return{pushStack:function(e,t){return m("pushStack",e,t)},popStack:function(){return m("popStack")},pushView:function(e){return m("pushView",e)},popView:function(){return m("popView")},popToView:function(e){return m("popToView",e)},resetStack:function(e,t){return m("resetStack",e,t)},resetApplication:function(e,t){return m("resetApplication",e,t)},subscribe:function(e){return v.push(e),function(){var t=v.indexOf(e);-1!==t&&v.splice(t,1)}},get:function(){return i.default(r)},navigate:m,isEmpty:function(){return 0===r.reduce((function(e,t){return e+t.routes.length}),0)},destroy:function(){p=!0},getCurrentRoute:function(){var e=y();return u.default(e.routes)}}}}},5252:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={check:function(e,t,r){}}},0:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){return e.call(this,"cache for "+t+" has not been found.")||this}return o(t,e),t}(a(r(110)).default);t.default=i},110:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){return e.call(this,"Beagle: "+t)||this}return n(t,e),t.prototype.getSerializableError=function(){return{message:this.message}},t}(Error);t.default=o,t.isBeagleError=function(e){return!(!e.message.startsWith("Beagle")||!e.getSerializableError)}},7930:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){return e.call(this,"cache for "+t+" has expired.")||this}return o(t,e),t}(a(r(110)).default);t.default=i},2443:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){return e.call(this,"navigation error: "+t)||this}return o(t,e),t}(a(r(110)).default);t.default=i},3869:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function u(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]{"use strict";function r(e,t,r){r.beagleMetadata=r.beagleMetadata||{},r.beagleMetadata.lifecycles=r.beagleMetadata.lifecycles||{},r.beagleMetadata.lifecycles[e]=t}Object.defineProperty(t,"__esModule",{value:!0}),t.BeforeStart=function(e){return function(t){r("beforeStart",e,t)}},t.BeforeViewSnapshot=function(e){return function(t){r("beforeViewSnapshot",e,t)}},t.AfterViewSnapshot=function(e){return function(t){r("afterViewSnapshot",e,t)}},t.BeforeRender=function(e){return function(t){r("beforeRender",e,t)}},t.BeagleChildren=function(e){return function(t){var r=t;r.beagleMetadata=r.beagleMetadata||{},r.beagleMetadata.children=e}}},648:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={extract:function(e){var t=Object.keys(e),r={children:{},lifecycles:{afterViewSnapshot:{},beforeRender:{},beforeStart:{},beforeViewSnapshot:{}}};return t.forEach((function(t){var n=e[t].beagleMetadata;n&&(n.children&&(r.children[t.toLowerCase()]=n.children),n.lifecycles&&Object.keys(n.lifecycles).forEach((function(e){var o=n.lifecycles[e];o&&(r.lifecycles[e][t.toLowerCase()]=o)})))})),r}}},4592:function(e,t,r){"use strict";var n=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={condition:function(e,t,r){return e?t:r},not:function(e){return!e},and:function(){for(var e=[],t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={sum:function(){for(var e=[],t=0;tt},gte:function(e,t){return e>=t},lt:function(e,t){return e0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=400)throw new l.default(i,o);return _={},d?(function(e,t,r,n){var o=e.headers.get("beagle-hash")||"",a=e.headers.get("cache-control")||"",i=a&&a.match(/max-age=(\d+)/),c={beagleHash:o,requestTime:t,ttl:i&&i[1]||""};u.updateMetadata(c,r,n)}(o,h,i,c),[4,y(o,i,c,f)]):[3,7];case 6:return _=a.sent(),[3,9];case 7:return[4,o.json()];case 8:_=a.sent(),f&&e.setItem(t.namespace+"/"+i+"/"+c,JSON.stringify(_)),a.label=9;case 9:return[2,_]}}))}))}function _(e){var t=e.map((function(e){if(c.isBeagleError(e)){var t=e.getSerializableError();return t instanceof Promise?t:Promise.resolve(t)}return Promise.resolve({message:e.message})}));return Promise.all(t)}return void 0===h&&(h="beagle-with-fallback-to-cache"),{load:function(e){var t=e.url,r=e.fallbackUIElement,n=e.method,u=void 0===n?"get":n,c=e.headers,s=e.strategy,l=void 0===s?h:s,f=e.loadingComponent,p=void 0===f?"custom:loading":f,y=e.errorComponent,w=void 0===y?"custom:error":y,m=e.shouldShowLoading,x=void 0===m||m,j=e.shouldShowError,O=void 0===j||j,P=e.onChangeTree,S=e.retry;return o(this,void 0,void 0,(function(){function e(e,r){return void 0===e&&(e=!1),void 0===r&&(r=!0),o(this,void 0,void 0,(function(){var n;return a(this,(function(o){switch(o.label){case 0:return x&&!e&&P({_beagleComponent_:p}),[4,g(t,u,c,"network-only"!==l,r)];case 1:return n=o.sent(),P(n),[2]}}))}))}function n(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(r){switch(r.label){case 0:return e=P,[4,v(t,u)];case 1:return e.apply(void 0,[r.sent()]),[2]}}))}))}function s(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(r){switch(r.label){case 0:return e=P,[4,b(t,u)];case 1:return e.apply(void 0,[r.sent()]),[2]}}))}))}function f(t,r){return o(this,void 0,void 0,(function(){var o,i,u,c,l;return a(this,(function(a){switch(a.label){case 0:o=[],i=!1,u=!1,c=0,a.label=1;case 1:if(!(c0)return!1;if(void 0===r)return!0;if("string"==typeof r)return t=r,u.startsWith(r);var i=u.match(new RegExp("^("+r.source+")"));return!!i&&(t=i[0],!0)}));if(!r)return{value:null};u=u.substring(t.length),i=r.next,void 0!==r.pop&&a.pop(),void 0!==r.push&&a.push(r.push)};i!==r;){var s=c();if("object"==typeof s)return s.value}return e.substr(0,e.length-u.length)}}}}},6419:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(998));t.getPath=function(e){return function e(t,r){if(t.parentNode){if("BODY"===t.nodeName)return"BODY/"+r;var n=Array.from(t.parentNode.childNodes),a=o.default(n,t),i=n[a];return r=i.nodeName+(a>0?"["+a+"]":"")+"/"+r,i.parentNode&&e(i.parentNode,r)}}(e,"")},t.getElementByBeagleId=function(e){if(document&&document.querySelector)return document.querySelector('[data-beagle-id="'+e+'"]')},t.getElementPosition=function(e){if(e)return{x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().top}}},2413:function(e,t){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={removePrefix:function(e,t){return e.replace(new RegExp("^"+t),"")},addPrefix:function(e,t){return e&&e[0]===t?e:""+t+e},removeSuffix:function(e,t){return e.replace(new RegExp(t+"$"),"")},capitalizeFirstLetter:function(e){return e.length?""+e.charAt(0).toUpperCase()+e.slice(1):e}}},5905:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={createQueryString:function(e){return e&&Object.keys(e).length?"?"+Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&"):""}}},8552:(e,t,r)=>{var n=r(852)(r(5639),"DataView");e.exports=n},1989:(e,t,r)=>{var n=r(1789),o=r(401),a=r(7667),i=r(1327),u=r(1866);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(7040),o=r(4125),a=r(2117),i=r(7518),u=r(4705);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(852)(r(5639),"Map");e.exports=n},3369:(e,t,r)=>{var n=r(4785),o=r(1285),a=r(6e3),i=r(9916),u=r(5265);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(852)(r(5639),"Promise");e.exports=n},8525:(e,t,r)=>{var n=r(852)(r(5639),"Set");e.exports=n},8668:(e,t,r)=>{var n=r(3369),o=r(619),a=r(2385);function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t{var n=r(8407),o=r(7465),a=r(3779),i=r(7599),u=r(4758),c=r(4309);function s(e){var t=this.__data__=new n(e);this.size=t.size}s.prototype.clear=o,s.prototype.delete=a,s.prototype.get=i,s.prototype.has=u,s.prototype.set=c,e.exports=s},2705:(e,t,r)=>{var n=r(5639).Symbol;e.exports=n},1149:(e,t,r)=>{var n=r(5639).Uint8Array;e.exports=n},577:(e,t,r)=>{var n=r(852)(r(5639),"WeakMap");e.exports=n},7412:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,a=[];++r{var n=r(2545),o=r(5694),a=r(1469),i=r(4144),u=r(5776),c=r(6719),s=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=a(e),l=!r&&o(e),f=!r&&!l&&i(e),d=!r&&!l&&!f&&c(e),p=r||l||f||d,h=p?n(e.length,String):[],v=h.length;for(var b in e)!t&&!s.call(e,b)||p&&("length"==b||f&&("offset"==b||"parent"==b)||d&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||u(b,v))||h.push(b);return h}},9932:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r{e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r{e.exports=function(e){return e.split("")}},4865:(e,t,r)=>{var n=r(9465),o=r(7813),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var i=e[t];a.call(e,t)&&o(i,r)&&(void 0!==r||t in e)||n(e,t,r)}},8470:(e,t,r)=>{var n=r(7813);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},4037:(e,t,r)=>{var n=r(8363),o=r(3674);e.exports=function(e,t){return e&&n(t,o(t),e)}},3886:(e,t,r)=>{var n=r(8363),o=r(1704);e.exports=function(e,t){return e&&n(t,o(t),e)}},9465:(e,t,r)=>{var n=r(8777);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},5990:(e,t,r)=>{var n=r(6384),o=r(7412),a=r(4865),i=r(4037),u=r(3886),c=r(4626),s=r(278),l=r(8805),f=r(1911),d=r(8234),p=r(6904),h=r(4160),v=r(3824),b=r(9148),y=r(8517),g=r(1469),_=r(4144),w=r(6688),m=r(3218),x=r(2928),j=r(3674),O=r(1704),P="[object Arguments]",S="[object Function]",M="[object Object]",k={};k[P]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[M]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[S]=k["[object WeakMap]"]=!1,e.exports=function e(t,r,A,C,E,I){var T,B=1&r,R=2&r,D=4&r;if(A&&(T=E?A(t,C,E,I):A(t)),void 0!==T)return T;if(!m(t))return t;var F=g(t);if(F){if(T=v(t),!B)return s(t,T)}else{var V=h(t),N=V==S||"[object GeneratorFunction]"==V;if(_(t))return c(t,B);if(V==M||V==P||N&&!E){if(T=R||N?{}:y(t),!B)return R?f(t,u(T,t)):l(t,i(T,t))}else{if(!k[V])return E?t:{};T=b(t,V,B)}}I||(I=new n);var L=I.get(t);if(L)return L;I.set(t,T),x(t)?t.forEach((function(n){T.add(e(n,r,A,n,t,I))})):w(t)&&t.forEach((function(n,o){T.set(o,e(n,r,A,o,t,I))}));var z=F?void 0:(D?R?p:d:R?O:j)(t);return o(z||t,(function(n,o){z&&(n=t[o=n]),a(T,o,e(n,r,A,o,t,I))})),T}},3118:(e,t,r)=>{var n=r(3218),o=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},1848:e=>{e.exports=function(e,t,r,n){for(var o=e.length,a=r+(n?1:-1);n?a--:++a{var n=r(2488),o=r(7285);e.exports=function e(t,r,a,i,u){var c=-1,s=t.length;for(a||(a=o),u||(u=[]);++c0&&a(l)?r>1?e(l,r-1,a,i,u):n(u,l):i||(u[u.length]=l)}return u}},8483:(e,t,r)=>{var n=r(5063)();e.exports=n},7816:(e,t,r)=>{var n=r(8483),o=r(3674);e.exports=function(e,t){return e&&n(e,t,o)}},7786:(e,t,r)=>{var n=r(1811),o=r(327);e.exports=function(e,t){for(var r=0,a=(t=n(t,e)).length;null!=e&&r{var n=r(2488),o=r(1469);e.exports=function(e,t,r){var a=t(e);return o(e)?a:n(a,r(e))}},4239:(e,t,r)=>{var n=r(2705),o=r(9607),a=r(2333),i=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},8565:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,r){return null!=e&&t.call(e,r)}},13:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},9454:(e,t,r)=>{var n=r(4239),o=r(7005);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},939:(e,t,r)=>{var n=r(2492),o=r(7005);e.exports=function e(t,r,a,i,u){return t===r||(null==t||null==r||!o(t)&&!o(r)?t!=t&&r!=r:n(t,r,a,i,e,u))}},2492:(e,t,r)=>{var n=r(6384),o=r(7114),a=r(8351),i=r(6096),u=r(4160),c=r(1469),s=r(4144),l=r(6719),f="[object Arguments]",d="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,v,b,y){var g=c(e),_=c(t),w=g?d:u(e),m=_?d:u(t),x=(w=w==f?p:w)==p,j=(m=m==f?p:m)==p,O=w==m;if(O&&s(e)){if(!s(t))return!1;g=!0,x=!1}if(O&&!x)return y||(y=new n),g||l(e)?o(e,t,r,v,b,y):a(e,t,w,r,v,b,y);if(!(1&r)){var P=x&&h.call(e,"__wrapped__"),S=j&&h.call(t,"__wrapped__");if(P||S){var M=P?e.value():e,k=S?t.value():t;return y||(y=new n),b(M,k,r,v,y)}}return!!O&&(y||(y=new n),i(e,t,r,v,b,y))}},5588:(e,t,r)=>{var n=r(4160),o=r(7005);e.exports=function(e){return o(e)&&"[object Map]"==n(e)}},2958:(e,t,r)=>{var n=r(6384),o=r(939);e.exports=function(e,t,r,a){var i=r.length,u=i,c=!a;if(null==e)return!u;for(e=Object(e);i--;){var s=r[i];if(c&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i{var n=r(3560),o=r(5346),a=r(3218),i=r(346),u=/^\[object .+?Constructor\]$/,c=Function.prototype,s=Object.prototype,l=c.toString,f=s.hasOwnProperty,d=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(n(e)?d:u).test(i(e))}},9221:(e,t,r)=>{var n=r(4160),o=r(7005);e.exports=function(e){return o(e)&&"[object Set]"==n(e)}},8749:(e,t,r)=>{var n=r(4239),o=r(1780),a=r(7005),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[n(e)]}},7206:(e,t,r)=>{var n=r(1573),o=r(6432),a=r(6557),i=r(1469),u=r(9601);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):n(e):u(e)}},280:(e,t,r)=>{var n=r(5726),o=r(6916),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))a.call(e,r)&&"constructor"!=r&&t.push(r);return t}},313:(e,t,r)=>{var n=r(3218),o=r(5726),a=r(3498),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return a(e);var t=o(e),r=[];for(var u in e)("constructor"!=u||!t&&i.call(e,u))&&r.push(u);return r}},1573:(e,t,r)=>{var n=r(2958),o=r(1499),a=r(2634);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}},6432:(e,t,r)=>{var n=r(939),o=r(7361),a=r(9095),i=r(5403),u=r(9162),c=r(2634),s=r(327);e.exports=function(e,t){return i(e)&&u(t)?c(s(e),t):function(r){var i=o(r,e);return void 0===i&&i===t?a(r,e):n(t,i,3)}}},873:(e,t,r)=>{var n=r(5776);e.exports=function(e,t){var r=e.length;if(r)return n(t+=t<0?r:0,r)?e[t]:void 0}},371:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},9152:(e,t,r)=>{var n=r(7786);e.exports=function(e){return function(t){return n(t,e)}}},5742:(e,t,r)=>{var n=r(7406),o=r(5776),a=Array.prototype.splice;e.exports=function(e,t){for(var r=e?t.length:0,i=r-1;r--;){var u=t[r];if(r==i||u!==c){var c=u;o(u)?a.call(e,u,1):n(e,u)}}return e}},2491:(e,t,r)=>{var n=r(4865),o=r(1811),a=r(5776),i=r(3218),u=r(327);e.exports=function(e,t,r,c){if(!i(e))return e;for(var s=-1,l=(t=o(t,e)).length,f=l-1,d=e;null!=d&&++s{e.exports=function(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++n{e.exports=function(e,t){for(var r=-1,n=Array(e);++r{var n=r(2705),o=r(9932),a=r(1469),i=r(3448),u=n?n.prototype:void 0,c=u?u.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return o(t,e)+"";if(i(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},7561:(e,t,r)=>{var n=r(7990),o=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},7406:(e,t,r)=>{var n=r(1811),o=r(928),a=r(292),i=r(327);e.exports=function(e,t){return t=n(t,e),null==(e=a(e,t))||delete e[i(o(t))]}},4757:e=>{e.exports=function(e,t){return e.has(t)}},1811:(e,t,r)=>{var n=r(1469),o=r(5403),a=r(5514),i=r(9833);e.exports=function(e,t){return n(e)?e:o(e,t)?[e]:a(i(e))}},180:(e,t,r)=>{var n=r(4259);e.exports=function(e,t,r){var o=e.length;return r=void 0===r?o:r,!t&&r>=o?e:n(e,t,r)}},4318:(e,t,r)=>{var n=r(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},4626:(e,t,r)=>{e=r.nmd(e);var n=r(5639),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o?n.Buffer:void 0,u=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=u?u(r):new e.constructor(r);return e.copy(n),n}},7157:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},3147:e=>{var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},419:(e,t,r)=>{var n=r(2705),o=n?n.prototype:void 0,a=o?o.valueOf:void 0;e.exports=function(e){return a?Object(a.call(e)):{}}},7133:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},278:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r{var n=r(4865),o=r(9465);e.exports=function(e,t,r,a){var i=!r;r||(r={});for(var u=-1,c=t.length;++u{var n=r(8363),o=r(9551);e.exports=function(e,t){return n(e,o(e),t)}},1911:(e,t,r)=>{var n=r(8363),o=r(1442);e.exports=function(e,t){return n(e,o(e),t)}},4429:(e,t,r)=>{var n=r(5639)["__core-js_shared__"];e.exports=n},5063:e=>{e.exports=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),u=i.length;u--;){var c=i[e?u:++o];if(!1===r(a[c],c,a))break}return t}}},8882:(e,t,r)=>{var n=r(180),o=r(2689),a=r(3140),i=r(9833);e.exports=function(e){return function(t){t=i(t);var r=o(t)?a(t):void 0,u=r?r[0]:t.charAt(0),c=r?n(r,1).join(""):t.slice(1);return u[e]()+c}}},7740:(e,t,r)=>{var n=r(7206),o=r(8612),a=r(3674);e.exports=function(e){return function(t,r,i){var u=Object(t);if(!o(t)){var c=n(r,3);t=a(t),r=function(e){return c(u[e],e,u)}}var s=e(t,r,i);return s>-1?u[c?t[s]:s]:void 0}}},8777:(e,t,r)=>{var n=r(852),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},7114:(e,t,r)=>{var n=r(8668),o=r(2908),a=r(4757);e.exports=function(e,t,r,i,u,c){var s=1&r,l=e.length,f=t.length;if(l!=f&&!(s&&f>l))return!1;var d=c.get(e),p=c.get(t);if(d&&p)return d==t&&p==e;var h=-1,v=!0,b=2&r?new n:void 0;for(c.set(e,t),c.set(t,e);++h{var n=r(2705),o=r(1149),a=r(7813),i=r(7114),u=r(8776),c=r(1814),s=n?n.prototype:void 0,l=s?s.valueOf:void 0;e.exports=function(e,t,r,n,s,f,d){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!f(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=u;case"[object Set]":var h=1&n;if(p||(p=c),e.size!=t.size&&!h)return!1;var v=d.get(e);if(v)return v==t;n|=2,d.set(e,t);var b=i(p(e),p(t),n,s,f,d);return d.delete(e),b;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},6096:(e,t,r)=>{var n=r(8234),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,a,i,u){var c=1&r,s=n(e),l=s.length;if(l!=n(t).length&&!c)return!1;for(var f=l;f--;){var d=s[f];if(!(c?d in t:o.call(t,d)))return!1}var p=u.get(e),h=u.get(t);if(p&&h)return p==t&&h==e;var v=!0;u.set(e,t),u.set(t,e);for(var b=c;++f{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},8234:(e,t,r)=>{var n=r(8866),o=r(9551),a=r(3674);e.exports=function(e){return n(e,a,o)}},6904:(e,t,r)=>{var n=r(8866),o=r(1442),a=r(1704);e.exports=function(e){return n(e,a,o)}},5050:(e,t,r)=>{var n=r(7019);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},1499:(e,t,r)=>{var n=r(9162),o=r(3674);e.exports=function(e){for(var t=o(e),r=t.length;r--;){var a=t[r],i=e[a];t[r]=[a,i,n(i)]}return t}},852:(e,t,r)=>{var n=r(8458),o=r(7801);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},5924:(e,t,r)=>{var n=r(5569)(Object.getPrototypeOf,Object);e.exports=n},9607:(e,t,r)=>{var n=r(2705),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,u=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,u),r=e[u];try{e[u]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(t?e[u]=r:delete e[u]),o}},9551:(e,t,r)=>{var n=r(4963),o=r(479),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,u=i?function(e){return null==e?[]:(e=Object(e),n(i(e),(function(t){return a.call(e,t)})))}:o;e.exports=u},1442:(e,t,r)=>{var n=r(2488),o=r(5924),a=r(9551),i=r(479),u=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,a(e)),e=o(e);return t}:i;e.exports=u},4160:(e,t,r)=>{var n=r(8552),o=r(7071),a=r(3818),i=r(8525),u=r(577),c=r(4239),s=r(346),l="[object Map]",f="[object Promise]",d="[object Set]",p="[object WeakMap]",h="[object DataView]",v=s(n),b=s(o),y=s(a),g=s(i),_=s(u),w=c;(n&&w(new n(new ArrayBuffer(1)))!=h||o&&w(new o)!=l||a&&w(a.resolve())!=f||i&&w(new i)!=d||u&&w(new u)!=p)&&(w=function(e){var t=c(e),r="[object Object]"==t?e.constructor:void 0,n=r?s(r):"";if(n)switch(n){case v:return h;case b:return l;case y:return f;case g:return d;case _:return p}return t}),e.exports=w},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},222:(e,t,r)=>{var n=r(1811),o=r(5694),a=r(1469),i=r(5776),u=r(1780),c=r(327);e.exports=function(e,t,r){for(var s=-1,l=(t=n(t,e)).length,f=!1;++s{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},1789:(e,t,r)=>{var n=r(4536);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,r)=>{var n=r(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},1327:(e,t,r)=>{var n=r(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},1866:(e,t,r)=>{var n=r(4536);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},3824:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},9148:(e,t,r)=>{var n=r(4318),o=r(7157),a=r(3147),i=r(419),u=r(7133);e.exports=function(e,t,r){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return u(e,r);case"[object Map]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return a(e);case"[object Set]":return new c;case"[object Symbol]":return i(e)}}},8517:(e,t,r)=>{var n=r(3118),o=r(5924),a=r(5726);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:n(o(e))}},7285:(e,t,r)=>{var n=r(2705),o=r(5694),a=r(1469),i=n?n.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||o(e)||!!(i&&e&&e[i])}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e{var n=r(1469),o=r(3448),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!o(e))||i.test(e)||!a.test(e)||null!=t&&e in Object(t)}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,r)=>{var n,o=r(4429),a=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!a&&a in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},9162:(e,t,r)=>{var n=r(3218);e.exports=function(e){return e==e&&!n(e)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,r)=>{var n=r(8470),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},2117:(e,t,r)=>{var n=r(8470);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7518:(e,t,r)=>{var n=r(8470);e.exports=function(e){return n(this.__data__,e)>-1}},4705:(e,t,r)=>{var n=r(8470);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},4785:(e,t,r)=>{var n=r(1989),o=r(8407),a=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},1285:(e,t,r)=>{var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:(e,t,r)=>{var n=r(5050);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},8776:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},2634:e=>{e.exports=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},4523:(e,t,r)=>{var n=r(8306);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},4536:(e,t,r)=>{var n=r(852)(Object,"create");e.exports=n},6916:(e,t,r)=>{var n=r(5569)(Object.keys,Object);e.exports=n},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:(e,t,r)=>{e=r.nmd(e);var n=r(1957),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,u=function(){try{return a&&a.require&&a.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=u},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},292:(e,t,r)=>{var n=r(7786),o=r(4259);e.exports=function(e,t){return t.length<2?e:n(e,o(t,0,-1))}},5639:(e,t,r)=>{var n=r(1957),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},619:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:e=>{e.exports=function(e){return this.__data__.has(e)}},1814:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},7465:(e,t,r)=>{var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,r)=>{var n=r(8407),o=r(7071),a=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},3140:(e,t,r)=>{var n=r(4286),o=r(2689),a=r(676);e.exports=function(e){return o(e)?a(e):n(e)}},5514:(e,t,r)=>{var n=r(4523),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,r,n,o){t.push(n?o.replace(a,"$1"):r||e)})),t}));e.exports=i},327:(e,t,r)=>{var n=r(3448);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},676:e=>{var t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",n="[^\\ud800-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",i="(?:"+t+"|"+r+")?",u="[\\ufe0e\\ufe0f]?",c=u+i+"(?:\\u200d(?:"+[n,o,a].join("|")+")"+u+i+")*",s="(?:"+[n+t+"?",t,o,a,"[\\ud800-\\udfff]"].join("|")+")",l=RegExp(r+"(?="+r+")|"+s+c,"g");e.exports=function(e){return e.match(l)||[]}},8403:(e,t,r)=>{var n=r(9833),o=r(1700);e.exports=function(e){return o(n(e).toLowerCase())}},361:(e,t,r)=>{var n=r(5990);e.exports=function(e){return n(e,5)}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},3311:(e,t,r)=>{var n=r(7740)(r(998));e.exports=n},998:(e,t,r)=>{var n=r(1848),o=r(7206),a=r(554),i=Math.max;e.exports=function(e,t,r){var u=null==e?0:e.length;if(!u)return-1;var c=null==r?0:a(r);return c<0&&(c=i(u+c,0)),n(e,o(t,3),c)}},988:(e,t,r)=>{var n=r(7740)(r(7436));e.exports=n},7436:(e,t,r)=>{var n=r(1848),o=r(7206),a=r(554),i=Math.max,u=Math.min;e.exports=function(e,t,r){var c=null==e?0:e.length;if(!c)return-1;var s=c-1;return void 0!==r&&(s=a(r),s=r<0?i(c+s,0):u(s,c-1)),n(e,o(t,3),s,!0)}},5564:(e,t,r)=>{var n=r(1078);e.exports=function(e){return null!=e&&e.length?n(e,1):[]}},7361:(e,t,r)=>{var n=r(7786);e.exports=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}},8721:(e,t,r)=>{var n=r(8565),o=r(222);e.exports=function(e,t){return null!=e&&o(e,t,n)}},9095:(e,t,r)=>{var n=r(13),o=r(222);e.exports=function(e,t){return null!=e&&o(e,t,n)}},6557:e=>{e.exports=function(e){return e}},5694:(e,t,r)=>{var n=r(9454),o=r(7005),a=Object.prototype,i=a.hasOwnProperty,u=a.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!u.call(e,"callee")};e.exports=c},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,r)=>{var n=r(3560),o=r(1780);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},4144:(e,t,r)=>{e=r.nmd(e);var n=r(5639),o=r(5062),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,u=i&&i.exports===a?n.Buffer:void 0,c=(u?u.isBuffer:void 0)||o;e.exports=c},1609:(e,t,r)=>{var n=r(280),o=r(4160),a=r(5694),i=r(1469),u=r(8612),c=r(4144),s=r(5726),l=r(6719),f=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(u(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||c(e)||l(e)||a(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(s(e))return!n(e).length;for(var r in e)if(f.call(e,r))return!1;return!0}},8446:(e,t,r)=>{var n=r(939);e.exports=function(e,t){return n(e,t)}},3560:(e,t,r)=>{var n=r(4239),o=r(3218);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},6688:(e,t,r)=>{var n=r(5588),o=r(1717),a=r(1167),i=a&&a.isMap,u=i?o(i):n;e.exports=u},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},2928:(e,t,r)=>{var n=r(9221),o=r(1717),a=r(1167),i=a&&a.isSet,u=i?o(i):n;e.exports=u},3448:(e,t,r)=>{var n=r(4239),o=r(7005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},6719:(e,t,r)=>{var n=r(8749),o=r(1717),a=r(1167),i=a&&a.isTypedArray,u=i?o(i):n;e.exports=u},3674:(e,t,r)=>{var n=r(4636),o=r(280),a=r(8612);e.exports=function(e){return a(e)?n(e):o(e)}},1704:(e,t,r)=>{var n=r(4636),o=r(313),a=r(8612);e.exports=function(e){return a(e)?n(e,!0):o(e)}},928:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},7523:(e,t,r)=>{var n=r(9465),o=r(7816),a=r(7206);e.exports=function(e,t){var r={};return t=a(t,3),o(e,(function(e,o,a){n(r,t(e,o,a),e)})),r}},8306:(e,t,r)=>{var n=r(3369);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(o.Cache||n),r}o.Cache=n,e.exports=o},8491:(e,t,r)=>{var n=r(873),o=r(554);e.exports=function(e,t){return e&&e.length?n(e,o(t)):void 0}},9601:(e,t,r)=>{var n=r(371),o=r(9152),a=r(5403),i=r(327);e.exports=function(e){return a(e)?n(i(e)):o(e)}},2729:(e,t,r)=>{var n=r(7206),o=r(5742);e.exports=function(e,t){var r=[];if(!e||!e.length)return r;var a=-1,i=[],u=e.length;for(t=n(t,3);++a{var n=r(2491);e.exports=function(e,t,r){return null==e?e:n(e,t,r)}},479:e=>{e.exports=function(){return[]}},5062:e=>{e.exports=function(){return!1}},8601:(e,t,r)=>{var n=r(4841);e.exports=function(e){return e?Infinity===(e=n(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:(e,t,r)=>{var n=r(8601);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},4841:(e,t,r)=>{var n=r(7561),o=r(3218),a=r(3448),i=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=u.test(e);return r||c.test(e)?s(e.slice(2),r?2:8):i.test(e)?NaN:+e}},9833:(e,t,r)=>{var n=r(531);e.exports=function(e){return null==e?"":n(e)}},9233:(e,t,r)=>{var n=r(7406);e.exports=function(e,t){return null==e||n(e,t)}},1700:(e,t,r)=>{var n=r(8882)("toUpperCase");e.exports=n},1034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCustomActionMap=void 0;const n=r(8441);function o(e,t,r=!0,a=""){if(!r&&function(e){return e&&(e._beagleAction_||Array.isArray(e)&&e[0]&&e[0]._beagleAction_)}(t)){const r=r=>e(t,a,r);return n.registerFunctionForSingleExecution(r)}return Array.isArray(t)?t.map((t=>o(e,t,!1,a))):t&&"object"==typeof t?Object.keys(t).reduce(((r,n)=>Object.assign(Object.assign({},r),{[n]:o(e,t[n],!1,n)})),{}):t}const a=({action:e,beagleView:t,element:r,executeAction:n})=>{const a=t.id,i=o(n,e);sendMessage("action",JSON.stringify({action:i,viewId:a,element:r}))};t.createCustomActionMap=function(e){return e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:a})),{})}},8441:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callFunction=t.unregisterFunctionById=t.registerPersistentFunction=t.registerFunctionForSingleExecution=t.countFunctions=void 0;const r={},n={};let o=0;function a(e){delete r[e],delete n[e]}t.countFunctions=function(){return Object.keys(r).length},t.registerFunctionForSingleExecution=function(e){const t="__beagleFn:"+o++;return r[t]=e,n[t]=!0,t},t.registerPersistentFunction=function(e){const t="__beagleFn:"+o++;return r[t]=e,t},t.unregisterFunctionById=a,t.callFunction=function(e,t){if(!r[e])throw new Error(`Can't call function with id ${e}. It doesn't exist.`);r[e](t),n[e]&&a(e)}},9075:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.respondHttpRequest=t.httpClient=void 0;const n=r(7866),o=r(9731),a=r(2744);t.httpClient={fetch:(e,t)=>{console.log(`js: fetching ${e}`);const r=n.createStaticPromise(),o={id:a.registerPromise(r),method:null==t?void 0:t.method,url:e.toString(),headers:null==t?void 0:t.headers,body:null==t?void 0:t.body};return sendMessage("httpClient.request",JSON.stringify(o)),r.promise}},t.respondHttpRequest=function(e,t){const r=function({status:e,body:t,headers:r}){const n=function(e={}){const t={append:(t,r)=>e[t]=r,delete:t=>delete e[t],entries:()=>{throw new Error("not implemented yet!")},forEach:r=>Object.keys(e).forEach((n=>r(e[n],n,t))),get:t=>e[t],has:t=>!!e[t],keys:()=>{throw new Error("not implemented yet!")},set:(t,r)=>e[t]=r,values:()=>{throw new Error("not implemented yet!")}};return t}(r);return{arrayBuffer:()=>{throw new Error("not implemented yet!")},blob:()=>{throw new Error("not implemented yet!")},clone:()=>{throw new Error("not implemented yet!")},formData:()=>{throw new Error("not implemented yet!")},json:()=>Promise.resolve(t?function(e){try{return JSON.parse(e)}catch(t){throw o.logger.error(`Unable to parse json response:\n${e}\n`),t}}(t):void 0),text:()=>Promise.resolve(t||""),body:null,bodyUsed:!1,headers:n,ok:e>=200&&e<400,redirected:e>=300&&e<400,status:e,statusText:"",trailer:Promise.resolve(n),type:"default",url:""}}(t);return console.log(`js: received response with status ${r.status}`),a.resolvePromise(e,r),a.unregisterPromise(e),"ok"}},3607:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o{let e;return{start:t=>{var{actionKeys:r}=t,n=i(t,["actionKeys"]);e=u.default(Object.assign({components:{},disableCssTransformation:!0,fetchData:d.httpClient.fetch,customStorage:l.storage,customActions:c.createCustomActionMap(r)},n)),u.logger.setCustomLogFunction(((e,...t)=>{console.log(t.join(" "))}))},createBeagleView:(t,r)=>s.createBeagleView(e,t,r),httpClient:{respond:d.respondHttpRequest},call:(e,t)=>{console.log(`js: called function with id ${e} and argument map: ${JSON.stringify(t)}`),f.callFunction(e,t)},callViewFunction:(e,t,r)=>{const n=s.getView(e);n&&n.executeFunction(t,r)},getViewById:s.getView,getService:()=>e,promise:{resolve:p.resolvePromise,reject:p.rejectPromise}}})()},2744:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rejectPromise=t.resolvePromise=t.unregisterPromise=t.registerPromise=void 0;const r={};let n=0;t.registerPromise=function(e){const t=""+n++;return r[t]=e,t},t.unregisterPromise=function(e){delete r[e]},t.resolvePromise=function(e,t){if(!r[e])throw new Error(`Can't resolve promise with id ${e}. It doesn't exist.`);r[e].resolve(t),delete r[e]},t.rejectPromise=function(e,t){if(!r[e])throw new Error(`Can't reject promise with id ${e}. It doesn't exist.`);r[e].reject(t),delete r[e]}},849:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storage=void 0;const n=r(7866),o=r(2744);t.storage={clear:()=>{const e=n.createStaticPromise(),t=o.registerPromise(e);return sendMessage("storage.clear",JSON.stringify({promiseId:t})),e.promise},getItem:e=>{const t=n.createStaticPromise(),r=o.registerPromise(t);return sendMessage("storage.get",JSON.stringify({key:e,promiseId:r})),t.promise},removeItem:e=>{const t=n.createStaticPromise(),r=o.registerPromise(t);return sendMessage("storage.remove",JSON.stringify({key:e,promiseId:r})),t.promise},setItem:(e,t)=>{const r=n.createStaticPromise(),a=o.registerPromise(r);return sendMessage("storage.set",JSON.stringify({key:e,value:t,promiseId:a})),r.promise}}},7866:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createStaticPromise=void 0,t.createStaticPromise=function(){const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}},6085:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getView=t.createBeagleView=void 0;const o=n(r(7361)),a={};let i=0;function u(e,t="__beagleFn:"){if("function"==typeof e)return t;if(e instanceof Array)return e.map(((e,r)=>u(e,`${t}[${r}]`)));if(e&&"object"==typeof e){const r={};return Object.keys(e).forEach((n=>{r[n]=u(e[n],`${t}.${n}`)})),r}return e}t.createBeagleView=function(e,t,r){const n=e.createView(t,r);n.id=""+i++;let c=null;return n.subscribe((e=>{c=e,sendMessage("beagleView.update",JSON.stringify({id:n.id,tree:u(e)}))})),n.getNavigator().subscribe((e=>sendMessage("beagleNavigator",JSON.stringify({viewId:n.id,route:e})))),n.executeFunction=(e,t)=>{if(!c)return;const r=e.replace(/__beagleFn:\.?/,""),a=o.default(c,r);"function"==typeof a?a(t):console.log(`No function with path "${r}" for view with id "${n.id}" was found.`)},a[n.id]=n,n.id},t.getView=function(e){return a[e]||console.log(`No view with id ${e} has been found.`),a[e]}}},t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(3607)})(); \ No newline at end of file diff --git a/flutter/beagle/lib/beagle.dart b/flutter/beagle/lib/beagle.dart index 82b1cdf9cb..b01bab7f06 100644 --- a/flutter/beagle/lib/beagle.dart +++ b/flutter/beagle/lib/beagle.dart @@ -22,3 +22,5 @@ export 'package:beagle/model/beagle_ui_element.dart'; export 'package:beagle/beagle_widget.dart'; export 'package:beagle/model/beagle_config.dart'; export 'package:beagle/model/beagle_environment.dart'; +export 'package:beagle/networking/beagle_request.dart'; +export 'package:beagle/networking/beagle_screen_request.dart'; diff --git a/flutter/beagle/lib/beagle_sdk.dart b/flutter/beagle/lib/beagle_sdk.dart index b4f26abe7e..e45d30494b 100644 --- a/flutter/beagle/lib/beagle_sdk.dart +++ b/flutter/beagle/lib/beagle_sdk.dart @@ -28,7 +28,7 @@ import 'package:beagle/interface/navigation_controller.dart'; import 'package:beagle/interface/storage.dart'; import 'package:beagle/logger/beagle_logger.dart'; import 'package:beagle/model/beagle_config.dart'; -import 'package:beagle/model/network_strategy.dart'; +import 'package:beagle/networking/beagle_network_strategy.dart'; import 'package:beagle/service_locator.dart'; import 'package:beagle/setup/beagle_design_system.dart'; @@ -50,7 +50,7 @@ class BeagleSdk { Storage storage, bool useBeagleHeaders, Map actions, - NetworkStrategy strategy, + BeagleNetworkStrategy strategy, Map navigationControllers, DesignSystem designSystem, BeagleImageDownloader imageDownloader, @@ -72,7 +72,7 @@ class BeagleSdk { useBeagleHeaders: useBeagleHeaders ?? true, actions: actions == null ? defaultActions : {...defaultActions, ...actions}, - strategy: strategy ?? NetworkStrategy.beagleWithFallbackToCache, + strategy: strategy ?? BeagleNetworkStrategy.beagleWithFallbackToCache, navigationControllers: navigationControllers, ); } diff --git a/flutter/beagle/lib/beagle_widget.dart b/flutter/beagle/lib/beagle_widget.dart index 70b7249935..62f529c990 100644 --- a/flutter/beagle/lib/beagle_widget.dart +++ b/flutter/beagle/lib/beagle_widget.dart @@ -22,6 +22,7 @@ import 'package:beagle/components/beagle_undefined_widget.dart'; import 'package:beagle/interface/beagle_view.dart'; import 'package:beagle/model/beagle_ui_element.dart'; import 'package:beagle/model/route.dart'; +import 'package:beagle/networking/beagle_screen_request.dart'; import 'package:flutter/widgets.dart'; typedef OnCreateViewListener = void Function(BeagleView view); @@ -31,17 +32,17 @@ typedef OnCreateViewListener = void Function(BeagleView view); class BeagleWidget extends StatefulWidget { const BeagleWidget({ Key key, - this.url, this.onCreateView, this.screenJson, + this.screenRequest, }) : super(key: key); - /// Server URL will be used to make a request. - final String url; - /// that represents a local screen to be shown. final String screenJson; + /// provides the url, method, headers and body to the request. + final BeagleScreenRequest screenRequest; + /// get a current BeagleView. final OnCreateViewListener onCreateView; @@ -62,17 +63,17 @@ class _BeagleWidget extends State { Future _startBeagleView() async { await BeagleSdk.getService().start(); - - _view = BeagleSdk.getService().createView() - ..subscribe((tree) { + _view = BeagleSdk.getService().createView( + networkOptions: widget.screenRequest, + )..subscribe((tree) { final widgetLoaded = _buildViewFromTree(tree); setState(() { widgetState = widgetLoaded; }); }); - if (widget.url != null) { - await _view.getNavigator().pushView(RemoteView(widget.url)); + if (widget.screenRequest != null) { + await _view.getNavigator().pushView(RemoteView(widget.screenRequest.url)); } else { await _view .getNavigator() @@ -95,6 +96,6 @@ class _BeagleWidget extends State { @override Widget build(BuildContext context) { - return widgetState ?? const SizedBox.shrink(); + return widgetState ?? const SizedBox.shrink(); } } diff --git a/flutter/beagle/lib/bridge_impl/beagle_js_engine.dart b/flutter/beagle/lib/bridge_impl/beagle_js_engine.dart index 0e00ca6a90..670d854188 100644 --- a/flutter/beagle/lib/bridge_impl/beagle_js_engine.dart +++ b/flutter/beagle/lib/bridge_impl/beagle_js_engine.dart @@ -27,8 +27,9 @@ import 'package:beagle/interface/storage.dart'; import 'package:beagle/interface/types.dart'; import 'package:beagle/model/beagle_action.dart'; import 'package:beagle/model/beagle_ui_element.dart'; -import 'package:beagle/model/request.dart'; import 'package:beagle/model/response.dart'; +import 'package:beagle/networking/beagle_network_options.dart'; +import 'package:beagle/networking/beagle_request.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_js/flutter_js.dart'; @@ -36,7 +37,7 @@ import 'package:flutter_js/flutter_js.dart'; typedef ActionListener = void Function( {BeagleAction action, BeagleView view, BeagleUIElement element}); -typedef HttpListener = void Function(String requestId, Request request); +typedef HttpListener = void Function(String requestId, BeagleRequest request); /// Provides an interface to run javascript code and listen to Beagle's core /// events. @@ -273,12 +274,18 @@ class BeagleJSEngine { } } - // todo: increment this to pass more configurations /// Creates a new BeagleView and returns the created view id. - String createBeagleView() { - final result = _jsRuntime.evaluate('global.beagle.createBeagleView()'); - final id = result.stringResult; - debugPrint('created beagle view with id $id'); + String createBeagleView({ + BeagleNetworkOptions networkOptions, + String initialControllerId, + }) { + final params = [BeagleNetworkOptions.toJsonEncode(networkOptions)]; + if (initialControllerId != null) { + params.add(initialControllerId); + } + final script = 'global.beagle.createBeagleView(${params.join(', ')})'; + final id = _jsRuntime.evaluate(script).stringResult; + return id; } diff --git a/flutter/beagle/lib/bridge_impl/beagle_js_request_message.dart b/flutter/beagle/lib/bridge_impl/beagle_js_request_message.dart index f69d121461..4ecf2ee532 100644 --- a/flutter/beagle/lib/bridge_impl/beagle_js_request_message.dart +++ b/flutter/beagle/lib/bridge_impl/beagle_js_request_message.dart @@ -14,9 +14,9 @@ * limitations under the License. */ -import 'package:beagle/bridge_impl/beagle_supported_http_methods.dart'; -import 'package:beagle/model/request.dart'; -import 'package:flutter_js/extensions/xhr.dart'; +import 'package:beagle/networking/beagle_http_method.dart'; +import 'package:beagle/networking/beagle_request.dart'; +import 'package:beagle/utils/enum.dart'; /// Encapsulates a Beagle javascript HTTP request message. class BeagleJSRequestMessage { @@ -30,15 +30,15 @@ class BeagleJSRequestMessage { String _requestId; String _url; - HttpMethod _method; + BeagleHttpMethod _method; Map _headers; String _body; - HttpMethod _getHttpMethod(Map json) { + BeagleHttpMethod _getHttpMethod(Map json) { final String httpMethodStr = json.containsKey('method') ? json['method'].toLowerCase() : 'get'; - return BeagleSupportedHttpMethods().getHttpMethod(httpMethodStr); + return EnumUtils.fromString(BeagleHttpMethod.values, httpMethodStr); } Map _getHeaders(Map json) { @@ -50,7 +50,7 @@ class BeagleJSRequestMessage { String get requestId => _requestId; - Request toRequest() { - return Request(_url, method: _method, headers: _headers, body: _body); + BeagleRequest toRequest() { + return BeagleRequest(_url, method: _method, headers: _headers, body: _body); } } diff --git a/flutter/beagle/lib/bridge_impl/beagle_service_js.dart b/flutter/beagle/lib/bridge_impl/beagle_service_js.dart index 8fa951f214..5da2457936 100644 --- a/flutter/beagle/lib/bridge_impl/beagle_service_js.dart +++ b/flutter/beagle/lib/bridge_impl/beagle_service_js.dart @@ -27,9 +27,10 @@ import 'package:beagle/interface/global_context.dart'; import 'package:beagle/interface/http_client.dart'; import 'package:beagle/interface/navigation_controller.dart'; import 'package:beagle/interface/storage.dart'; -import 'package:beagle/model/network_options.dart'; -import 'package:beagle/model/network_strategy.dart'; -import 'package:beagle/model/request.dart'; +import 'package:beagle/networking/beagle_network_options.dart'; +import 'package:beagle/networking/beagle_network_strategy.dart'; +import 'package:beagle/networking/beagle_request.dart'; +import 'package:beagle/utils/network_strategy.dart'; class BeagleServiceJS implements BeagleService { BeagleServiceJS( @@ -60,7 +61,7 @@ class BeagleServiceJS implements BeagleService { @override Map actions; @override - NetworkStrategy strategy; + BeagleNetworkStrategy strategy; @override Map navigationControllers; @override @@ -88,18 +89,6 @@ class BeagleServiceJS implements BeagleService { return result; } - // transforms the enum NetworkStrategy into the string expected by beagle web (js) - String getJsStrategyName() { - /* When calling toString in an enum, it returns EnumName.EnumValue, we just need the part after - the ".", which will give us the strategy name in camelCase. */ - final strategyNameInCamelCase = strategy.toString().split('.')[1]; - /* beagle web needs the strategy name in kebab-case, we use a regex to replace the uppercase - letters with a hyphen and the lower case equivalent. */ - final strategyNameInKebabCase = strategyNameInCamelCase.replaceAllMapped( - RegExp('[A-Z]'), (match) => '-${match[0].toLowerCase()}'); - return strategyNameInKebabCase; - } - @override Future start() async { await _beagleJSEngine.start(storage: storage); @@ -114,7 +103,7 @@ class BeagleServiceJS implements BeagleService { 'baseUrl': baseUrl, 'actionKeys': actions.keys.toList(), 'useBeagleHeaders': useBeagleHeaders, - 'strategy': getJsStrategyName(), + 'strategy': NetworkStrategyUtils.getJsStrategyName(strategy), }; final navigationControllers = getNavigationControllersAsMap(); if (navigationControllers != null) { @@ -125,7 +114,7 @@ class BeagleServiceJS implements BeagleService { } void _registerHttpListener() { - _beagleJSEngine.onHttpRequest((String id, Request request) async { + _beagleJSEngine.onHttpRequest((String id, BeagleRequest request) async { final response = await httpClient.sendRequest(request); _beagleJSEngine.respondHttpRequest(id, response); }); @@ -143,7 +132,11 @@ class BeagleServiceJS implements BeagleService { @override BeagleView createView( - {NetworkOptions networkOptions, String initialControllerId}) { - return BeagleViewJS(_beagleJSEngine); + {BeagleNetworkOptions networkOptions, String initialControllerId}) { + return BeagleViewJS( + _beagleJSEngine, + networkOptions: networkOptions, + initialControllerId: initialControllerId, + ); } } diff --git a/flutter/beagle/lib/bridge_impl/beagle_supported_http_methods.dart b/flutter/beagle/lib/bridge_impl/beagle_supported_http_methods.dart deleted file mode 100644 index f89227afd4..0000000000 --- a/flutter/beagle/lib/bridge_impl/beagle_supported_http_methods.dart +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import 'package:flutter_js/extensions/xhr.dart'; - -/// A map of Beagle supported HTTP methods. -class BeagleSupportedHttpMethods { - final httpMethodMap = { - 'get': HttpMethod.get, - 'post': HttpMethod.post, - 'put': HttpMethod.put, - 'patch': HttpMethod.patch, - 'delete': HttpMethod.delete, - }; - - /// Returns the corresponding [HttpMethod]. - /// Throws [Exception] if the method passed by parameter isn't supported by - /// Beagle. - HttpMethod getHttpMethod(String httpMethod) { - if (httpMethodMap.containsKey(httpMethod)) { - return httpMethodMap[httpMethod]; - } - - throw Exception('Unsupported http method $httpMethod'); - } -} diff --git a/flutter/beagle/lib/bridge_impl/beagle_view_js.dart b/flutter/beagle/lib/bridge_impl/beagle_view_js.dart index 11ca4066f5..115aae93a9 100644 --- a/flutter/beagle/lib/bridge_impl/beagle_view_js.dart +++ b/flutter/beagle/lib/bridge_impl/beagle_view_js.dart @@ -22,17 +22,18 @@ import 'package:beagle/interface/beagle_navigator.dart'; import 'package:beagle/interface/beagle_view.dart'; import 'package:beagle/interface/renderer.dart'; import 'package:beagle/model/beagle_ui_element.dart'; -import 'package:beagle/model/network_options.dart'; +import 'package:beagle/networking/beagle_network_options.dart'; class BeagleViewJS implements BeagleView { BeagleViewJS( this._beagleJSEngine, { - // ignore: avoid_unused_constructor_parameters - NetworkOptions networkOptions, - // ignore: avoid_unused_constructor_parameters + BeagleNetworkOptions networkOptions, String initialControllerId, }) { - _id = _beagleJSEngine.createBeagleView(); + _id = _beagleJSEngine.createBeagleView( + networkOptions: networkOptions, + initialControllerId: initialControllerId, + ); BeagleViewJS.views[_id] = this; _navigator = BeagleNavigatorJS(_beagleJSEngine, _id); _renderer = RendererJS(_beagleJSEngine, _id); diff --git a/flutter/beagle/lib/default/default_http_client.dart b/flutter/beagle/lib/default/default_http_client.dart index 7f3b291005..e5f39812f3 100644 --- a/flutter/beagle/lib/default/default_http_client.dart +++ b/flutter/beagle/lib/default/default_http_client.dart @@ -17,24 +17,24 @@ import 'dart:async'; import 'package:beagle/interface/http_client.dart'; -import 'package:beagle/model/request.dart'; import 'package:beagle/model/response.dart'; -import 'package:flutter_js/extensions/xhr.dart'; +import 'package:beagle/networking/beagle_http_method.dart'; +import 'package:beagle/networking/beagle_request.dart'; import 'package:http/http.dart' as http; class DefaultHttpClient implements HttpClient { const DefaultHttpClient(); @override - Future sendRequest(Request req) async { + Future sendRequest(BeagleRequest req) async { final handlers = { - HttpMethod.get: () => http.get(req.url, headers: req.headers), - HttpMethod.post: () => + BeagleHttpMethod.get: () => http.get(req.url, headers: req.headers), + BeagleHttpMethod.post: () => http.post(req.url, headers: req.headers, body: req.body), - HttpMethod.put: () => + BeagleHttpMethod.put: () => http.put(req.url, headers: req.headers, body: req.body), - HttpMethod.patch: () => + BeagleHttpMethod.patch: () => http.patch(req.url, headers: req.headers, body: req.body), - HttpMethod.delete: () => http.delete(req.url, headers: req.headers), + BeagleHttpMethod.delete: () => http.delete(req.url, headers: req.headers), }; final response = await handlers[req.method](); return Response(response.statusCode, response.body, response.headers, diff --git a/flutter/beagle/lib/default/default_image_downloader.dart b/flutter/beagle/lib/default/default_image_downloader.dart index 5ae80e60c6..2fc375e8da 100644 --- a/flutter/beagle/lib/default/default_image_downloader.dart +++ b/flutter/beagle/lib/default/default_image_downloader.dart @@ -19,18 +19,19 @@ import 'dart:typed_data'; import 'package:beagle/interface/beagle_image_downloader.dart'; import 'package:beagle/interface/http_client.dart'; -import 'package:beagle/model/request.dart'; +import 'package:beagle/networking/beagle_request.dart'; import 'package:flutter/foundation.dart'; class DefaultBeagleImageDownloader implements BeagleImageDownloader { - DefaultBeagleImageDownloader({@required this.httpClient}) - : assert(httpClient != null); + DefaultBeagleImageDownloader({ + @required this.httpClient, + }) : assert(httpClient != null); final HttpClient httpClient; @override Future downloadImage(String url) async { - final request = Request(url); + final request = BeagleRequest(url); final response = await httpClient.sendRequest(request); if (response.status != HttpStatus.ok) { diff --git a/flutter/beagle/lib/interface/beagle_service.dart b/flutter/beagle/lib/interface/beagle_service.dart index 142bfbd7b8..9271313da2 100644 --- a/flutter/beagle/lib/interface/beagle_service.dart +++ b/flutter/beagle/lib/interface/beagle_service.dart @@ -23,8 +23,8 @@ import 'package:beagle/interface/http_client.dart'; import 'package:beagle/interface/navigation_controller.dart'; import 'package:beagle/interface/storage.dart'; import 'package:beagle/model/beagle_action.dart'; -import 'package:beagle/model/network_options.dart'; -import 'package:beagle/model/network_strategy.dart'; +import 'package:beagle/networking/beagle_network_options.dart'; +import 'package:beagle/networking/beagle_network_strategy.dart'; import 'package:flutter/widgets.dart'; typedef ComponentBuilder = Widget Function( @@ -63,7 +63,7 @@ abstract class BeagleService { /// The default cache strategy for fetching views from the backend. By default uses /// `beagle-with-fallback-to-cache`. - NetworkStrategy strategy; + BeagleNetworkStrategy strategy; /// Options for the visual feedback when navigating from a view to another. To set the default /// options, use `default: true` in the navigation controller. @@ -93,6 +93,8 @@ abstract class BeagleService { /// network options are used (beagle headers, get and beagle-with-fallback-to-cache). The /// [initialControllerId] is the id of the navigation controller for the first navigation stack. /// If not specified, the default navigation controller is used. - BeagleView createView( - {NetworkOptions networkOptions, String initialControllerId}); + BeagleView createView({ + BeagleNetworkOptions networkOptions, + String initialControllerId, + }); } diff --git a/flutter/beagle/lib/interface/http_client.dart b/flutter/beagle/lib/interface/http_client.dart index 4e94691131..6e29cc2c6e 100644 --- a/flutter/beagle/lib/interface/http_client.dart +++ b/flutter/beagle/lib/interface/http_client.dart @@ -15,10 +15,10 @@ * limitations under the License. */ -import 'package:beagle/model/request.dart'; import 'package:beagle/model/response.dart'; +import 'package:beagle/networking/beagle_request.dart'; // ignore: one_member_abstracts abstract class HttpClient { - Future sendRequest(Request req); + Future sendRequest(BeagleRequest req); } diff --git a/flutter/beagle/lib/model/network_options.dart b/flutter/beagle/lib/model/network_options.dart deleted file mode 100644 index fe8f8e365b..0000000000 --- a/flutter/beagle/lib/model/network_options.dart +++ /dev/null @@ -1,27 +0,0 @@ -/* - * - * Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import 'package:beagle/model/network_strategy.dart'; -import 'package:flutter_js/extensions/xhr.dart'; - -class NetworkOptions { - NetworkOptions({this.method, this.headers, this.strategy}); - - HttpMethod method; - Map headers; - NetworkStrategy strategy; -} diff --git a/flutter/beagle/lib/model/request.dart b/flutter/beagle/lib/model/request.dart deleted file mode 100644 index 3e4efb5fab..0000000000 --- a/flutter/beagle/lib/model/request.dart +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import 'package:flutter_js/extensions/xhr.dart'; - -class Request { - Request(this.url, - {HttpMethod method, Map headers, String body}) { - this.method = method ?? HttpMethod.get; - this.headers = headers ?? {}; - this.body = body ?? ''; - } - - String url; - HttpMethod method; - Map headers; - String body; -} diff --git a/flutter/beagle/lib/networking/beagle_http_method.dart b/flutter/beagle/lib/networking/beagle_http_method.dart new file mode 100644 index 0000000000..6bcf5f425a --- /dev/null +++ b/flutter/beagle/lib/networking/beagle_http_method.dart @@ -0,0 +1,41 @@ +/* + * Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/// Http method to indicate the desired action +/// to be performed for a given resource. +enum BeagleHttpMethod { + /// The PUT method replaces all current representations + /// of the target resource with the request payload. + put, + + /// The GET method requests a representation of the specified resource. + /// Requests using GET should only retrieve data. + get, + + /// The POST method is used to submit an entity to the specified resource, + /// often causing a change in state or side effects on the server. + post, + + /// The DELETE method deletes the specified resource. + delete, + + /// The PATCH method is used to apply partial modifications to a resource. + patch, + + /// The HEAD method asks for a response identical to that of a GET request, + /// but without the response body. + head +} diff --git a/flutter/beagle/lib/networking/beagle_network_options.dart b/flutter/beagle/lib/networking/beagle_network_options.dart new file mode 100644 index 0000000000..da86bbb5bd --- /dev/null +++ b/flutter/beagle/lib/networking/beagle_network_options.dart @@ -0,0 +1,52 @@ +/* + * + * Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'dart:convert'; + +import 'package:beagle/networking/beagle_http_method.dart'; +import 'package:beagle/networking/beagle_network_strategy.dart'; +import 'package:beagle/utils/enum.dart'; +import 'package:beagle/utils/network_strategy.dart'; + +class BeagleNetworkOptions { + BeagleNetworkOptions({this.method, this.headers, this.strategy}); + + BeagleHttpMethod method; + Map headers; + BeagleNetworkStrategy strategy; + + static String toJsonEncode(BeagleNetworkOptions networkOptions) { + final params = {}; + + if (networkOptions == null) { + return jsonEncode(params); + } + + if (networkOptions.method != null) { + params['method'] = EnumUtils.name(networkOptions.method); + } + if (networkOptions.headers != null) { + params['headers'] = networkOptions.headers; + } + if (networkOptions.strategy != null) { + params['strategy'] = + NetworkStrategyUtils.getJsStrategyName(networkOptions.strategy); + } + + return jsonEncode(params); + } +} diff --git a/flutter/beagle/lib/model/network_strategy.dart b/flutter/beagle/lib/networking/beagle_network_strategy.dart similarity index 92% rename from flutter/beagle/lib/model/network_strategy.dart rename to flutter/beagle/lib/networking/beagle_network_strategy.dart index 35543b2600..3284249450 100644 --- a/flutter/beagle/lib/model/network_strategy.dart +++ b/flutter/beagle/lib/networking/beagle_network_strategy.dart @@ -15,7 +15,8 @@ * limitations under the License. */ -enum NetworkStrategy { +//TODO: NEEDS ADD DOCUMENTATION +enum BeagleNetworkStrategy { beagleCacheOnly, beagleWithFallbackToCache, networkWithFallbackToCache, diff --git a/flutter/beagle/lib/networking/beagle_request.dart b/flutter/beagle/lib/networking/beagle_request.dart new file mode 100644 index 0000000000..e134d6f72f --- /dev/null +++ b/flutter/beagle/lib/networking/beagle_request.dart @@ -0,0 +1,39 @@ +/* + * Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:beagle/networking/beagle_http_method.dart'; + +/// BeagleRequest is used to do requests. +class BeagleRequest { + BeagleRequest(this.url, + {BeagleHttpMethod method, Map headers, String body}) { + this.method = method ?? BeagleHttpMethod.get; + this.headers = headers ?? {}; + this.body = body ?? ''; + } + + /// Server URL + String url; + + /// HTTP method + BeagleHttpMethod method; + + /// Header items for the request. + Map headers; + + /// Content that will be deliver with the request. + String body; +} diff --git a/flutter/beagle/lib/networking/beagle_screen_request.dart b/flutter/beagle/lib/networking/beagle_screen_request.dart new file mode 100644 index 0000000000..da99528b76 --- /dev/null +++ b/flutter/beagle/lib/networking/beagle_screen_request.dart @@ -0,0 +1,46 @@ +/* + * Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:beagle/networking/beagle_http_method.dart'; +import 'package:beagle/networking/beagle_network_options.dart'; +import 'package:beagle/networking/beagle_network_strategy.dart'; + +/// BeagleRequest is used to do requests. +class BeagleScreenRequest implements BeagleNetworkOptions { + BeagleScreenRequest( + this.url, { + this.method, + this.headers, + this.strategy, + this.body, + }); + + /// Server URL + String url; + + //TODO: NEEDS IMPLEMENTS + /// Content that will be deliver with the request. + String body; + + @override + Map headers; + + @override + BeagleHttpMethod method; + + @override + BeagleNetworkStrategy strategy; +} diff --git a/flutter/beagle/lib/utils/enum.dart b/flutter/beagle/lib/utils/enum.dart index bdcb73039b..ae4e8de50e 100644 --- a/flutter/beagle/lib/utils/enum.dart +++ b/flutter/beagle/lib/utils/enum.dart @@ -19,7 +19,12 @@ class EnumUtils { static T fromString(List values, String str) { return values.firstWhere( (item) => - item.toString().split('.')[1].toUpperCase() == str.toUpperCase(), + name(item).toUpperCase() == str.toUpperCase(), orElse: () => null); } + + // ignore: inference_failure_on_untyped_parameter + static String name(value) { + return value.toString().split('.').last; + } } diff --git a/flutter/beagle/lib/utils/network_strategy.dart b/flutter/beagle/lib/utils/network_strategy.dart new file mode 100644 index 0000000000..7857cf2367 --- /dev/null +++ b/flutter/beagle/lib/utils/network_strategy.dart @@ -0,0 +1,34 @@ +/* + * Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:beagle/networking/beagle_network_strategy.dart'; +import 'package:beagle/utils/enum.dart'; + +class NetworkStrategyUtils { + // transforms the enum NetworkStrategy into the string expected by beagle web (js) + static String getJsStrategyName(BeagleNetworkStrategy strategy) { + if (strategy == null) { + return null; + } + + final strategyNameInCamelCase = EnumUtils.name(strategy); + /* beagle web needs the strategy name in kebab-case, we use a regex to replace the uppercase + letters with a hyphen and the lower case equivalent. */ + final strategyNameInKebabCase = strategyNameInCamelCase.replaceAllMapped( + RegExp('[A-Z]'), (match) => '-${match[0].toLowerCase()}'); + return strategyNameInKebabCase; + } +} diff --git a/flutter/beagle/test/bridge_impl/beagle_js_engine_test.dart b/flutter/beagle/test/bridge_impl/beagle_js_engine_test.dart index 8f37edfe17..835449880e 100644 --- a/flutter/beagle/test/bridge_impl/beagle_js_engine_test.dart +++ b/flutter/beagle/test/bridge_impl/beagle_js_engine_test.dart @@ -21,7 +21,7 @@ import 'package:beagle/bridge_impl/beagle_js_engine.dart'; import 'package:beagle/bridge_impl/js_runtime_wrapper.dart'; import 'package:beagle/interface/storage.dart'; import 'package:beagle/model/response.dart'; -import 'package:flutter_js/extensions/xhr.dart'; +import 'package:beagle/networking/beagle_http_method.dart'; import 'package:flutter_js/flutter_js.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; @@ -237,7 +237,7 @@ void main() { beagleJSEngine.onHttpRequest((requestId, request) { httpListenerCalled = true; expect(requestId, '1'); - expect(request.method, HttpMethod.get); + expect(request.method, BeagleHttpMethod.get); }); verify(jsRuntimeMock.onMessage('httpClient.request', captureAny)) diff --git a/flutter/beagle_components/lib/beagle_lazy_component.dart b/flutter/beagle_components/lib/beagle_lazy_component.dart index d41f063b98..742705617c 100644 --- a/flutter/beagle_components/lib/beagle_lazy_component.dart +++ b/flutter/beagle_components/lib/beagle_lazy_component.dart @@ -19,7 +19,6 @@ import 'dart:convert'; import 'package:beagle/beagle.dart'; import 'package:beagle/interface/beagle_view.dart'; -import 'package:beagle/model/request.dart'; import 'package:beagle/model/tree_update_mode.dart'; import 'package:beagle_components/after_layout.dart'; import 'package:flutter/material.dart'; @@ -72,7 +71,7 @@ class _BeagleLazyComponent extends State try { final result = await BeagleSdk.getService() .httpClient - .sendRequest(Request(_buildUrl())); + .sendRequest(BeagleRequest(_buildUrl())); if (result.status >= 200 && result.status < 400) { final jsonMap = jsonDecode(result.body); final component = BeagleUIElement(jsonMap); diff --git a/flutter/javascript-bridge/src/index.ts b/flutter/javascript-bridge/src/index.ts index 7b8299d8b0..91ac12eb16 100644 --- a/flutter/javascript-bridge/src/index.ts +++ b/flutter/javascript-bridge/src/index.ts @@ -2,6 +2,7 @@ import createBeagleService, { BeagleService, logger, NavigationController, + NetworkOptions, Strategy, } from '@zup-it/beagle-web' import { createCustomActionMap } from './action' @@ -38,7 +39,7 @@ window.beagle = (() => { console.log(messages.join(' ')) }) }, - createBeagleView: () => createBeagleView(service), + createBeagleView: (networkOptions?: NetworkOptions, initialControllerId?: string) => createBeagleView(service, networkOptions, initialControllerId), httpClient: { respond: respondHttpRequest }, call: (id: string, argumentsMap?: Record) => { console.log(`js: called function with id ${id} and argument map: ${JSON.stringify(argumentsMap)}`) diff --git a/flutter/javascript-bridge/src/view.ts b/flutter/javascript-bridge/src/view.ts index 32fb3ddc1f..6e7fcbf58c 100644 --- a/flutter/javascript-bridge/src/view.ts +++ b/flutter/javascript-bridge/src/view.ts @@ -1,4 +1,4 @@ -import { BeagleService, BeagleView, BeagleUIElement } from '@zup-it/beagle-web' +import { BeagleService, BeagleView, BeagleUIElement, NetworkOptions } from '@zup-it/beagle-web' import get from 'lodash/get' export interface JsBridgeBeagleView extends BeagleView { @@ -31,8 +31,8 @@ function serializeFunctions(value: any, path = '__beagleFn:'): any { return value } -export function createBeagleView(service: BeagleService) { - const view = service.createView() as JsBridgeBeagleView +export function createBeagleView(service: BeagleService, networkOptions?: NetworkOptions, initialControllerId?: string) { + const view = service.createView(networkOptions, initialControllerId) as JsBridgeBeagleView view.id = `${nextViewId++}` let currentTree: BeagleUIElement | null = null diff --git a/flutter/sample/lib/beagle_sample_screen.dart b/flutter/sample/lib/beagle_sample_screen.dart index 8047bddec8..16c31a4973 100644 --- a/flutter/sample/lib/beagle_sample_screen.dart +++ b/flutter/sample/lib/beagle_sample_screen.dart @@ -47,7 +47,7 @@ class _BeagleSampleScreenState extends State { title: Text(widget.title), ), body: BeagleWidget( - url: widget.route, + screenRequest: BeagleScreenRequest(widget.route) ), ), ); diff --git a/flutter/sample/lib/main.dart b/flutter/sample/lib/main.dart index 873d94380f..0d905f7fe0 100644 --- a/flutter/sample/lib/main.dart +++ b/flutter/sample/lib/main.dart @@ -104,21 +104,7 @@ class BeagleSampleApp extends StatelessWidget { ], ), body: BeagleWidget( - // screenJson: ''' - // { - // "_beagleComponent_": "beagle:button", - // "text": "Beagle Button", - // "disabled": false, - // "onPress": [ - // { - // "_beagleAction_": "beagle:alert", - // "title": "Button", - // "message":"Button got pressed!" - // } - // ] - // } - // ''', - url: 'beagle_lazy', + screenRequest: BeagleScreenRequest('beagle_lazy'), onCreateView: (view) => { view.addErrorListener((errors) { //TODO