UNPKG

90.4 kBJavaScriptView Raw
1!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("app-bridge",[],e):"object"==typeof exports?exports["app-bridge"]=e():t["app-bridge"]=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=21)}([function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NonSnakeCaseGroup=e.findMatchInEnum=e.forEachInEnum=e.getMergedProps=e.updateActionFromPayload=e.ActionSetWithChildren=e.ActionSet=e.isValidOptionalString=e.isValidOptionalNumber=e.getEventNameSpace=e.getVersion=e.actionWrapper=void 0;var u=n(2),c=n(6),p=n(3),d=n(11),f=s(n(24)),h=n(1),l=s(n(25)),y=n(26);function A(){return y.version}function P(t,n,r){if(n.startsWith(""+d.PREFIX+d.SEPARATOR))return n;var o=function(t){if(e.NonSnakeCaseGroup.includes(t))return t.toUpperCase();return(n=t,n.replace(/([A-Z])/g,(function(t,e,n){return(0!==n?"_":"")+t[0].toLowerCase()}))).toUpperCase();var n}(t);if(r){var i=r.subgroups,a=r.type;i&&i.length>0&&(o+=o.length>0?d.SEPARATOR:"",i.forEach((function(t,e){o+=""+t.toUpperCase()+(e<i.length-1?d.SEPARATOR:"")}))),a!==t&&a&&(o+=""+(o.length>0?d.SEPARATOR:"")+a.toUpperCase())}return o&&(o+=""+(o.length>0?d.SEPARATOR:"")+n.toUpperCase()),""+d.PREFIX+d.SEPARATOR+o}e.actionWrapper=function(t){return i(i({},t),{version:A(),clientInterface:{name:y.name,version:A()}})},e.getVersion=A,e.getEventNameSpace=P,e.isValidOptionalNumber=function(t){return null==t||"number"==typeof t},e.isValidOptionalString=function(t){return null==t||"string"==typeof t};var E=function(){function t(t,e,n,r){var o=this;this.app=t,this.type=e,this.group=n,this.subgroups=[],this.subscriptions=[],t||p.throwError(p.Action.INVALID_ACTION,"Missing required `app`"),this.id=r||l.default(),this.defaultGroup=n;var i=this.set;this.set=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return o.app.hooks?(t=o.app.hooks).run.apply(t,a([u.LifecycleHook.UpdateAction,i,o],e)):i.apply(o,e)}}return t.prototype.set=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},Object.defineProperty(t.prototype,"component",{get:function(){return{id:this.id,subgroups:this.subgroups,type:this.type}},enumerable:!1,configurable:!0}),t.prototype.updateSubscription=function(t,e,n){var r,o=t.eventType,i=t.callback,a=t.component;return(r=this.subscriptions.findIndex((function(e){return e===t})))>=0?this.subscriptions[r].unsubscribe():r=void 0,this.group=e,this.subgroups=n,Object.assign(a,{subgroups:this.subgroups}),this.subscribe(o,i,a,r)},t.prototype.error=function(t){var e=this,n=[];return b(p.Action,(function(r){n.push(e.subscriptions.length),e.subscribe(r,t)})),function(){n.map((function(t){return e.subscriptions[t]})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))}},t.prototype.subscribe=function(t,e,n,r){var o,a=this,s=n||this.component,u=t.toUpperCase(),c="number"==typeof r?e:e.bind(this);o=p.isErrorEventName(t)?P(h.Group.Error,t,i(i({},s),{type:""})):P(this.group,t,s);var d=this.app.subscribe(o,c,n?n.id:this.id),f={eventType:u,unsubscribe:d,callback:c,component:s,updateSubscribe:function(t,e){return a.updateSubscription.call(a,f,t,e)}};return"number"==typeof r&&r>=0&&r<this.subscriptions.length?this.subscriptions[r]=f:this.subscriptions.push(f),d},t.prototype.unsubscribe=function(t){return void 0===t&&(t=!1),v(this.subscriptions,this.defaultGroup,t),this},t}();e.ActionSet=E;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=[],e}return o(e,t),e.prototype.unsubscribe=function(t,n){return void 0===t&&(t=!0),void 0===n&&(n=!1),v(this.subscriptions,this.defaultGroup,n),this.children.forEach((function(n){e.prototype.isPrototypeOf(n)?n.unsubscribe(t,!t):n.unsubscribe(!t)})),this},e.prototype.getChild=function(t){var e=this.children.findIndex((function(e){return e.id===t}));return e>=0?this.children[e]:void 0},e.prototype.getChildIndex=function(t){return this.children.findIndex((function(e){return e.id===t}))},e.prototype.getChildSubscriptions=function(t,e){return this.subscriptions.filter((function(n){return n.component.id===t&&(!e||e===n.eventType)}))},e.prototype.addChild=function(t,n,r){var o=this,i=t.subscriptions;return this.getChild(t.id)||this.children.push(t),!i||n===t.group&&r===t.subgroups||(i.forEach((function(t){(0,t.updateSubscribe)(n,r)})),Object.assign(t,{group:n,subgroups:r}),e.prototype.isPrototypeOf(t)&&t.children.forEach((function(t){return o.addChild(t,n,r)}))),this},e.prototype.removeChild=function(t){var e=this;return c.removeFromCollection(this.children,this.getChild(t),(function(){e.subscriptions.filter((function(e){return e.component.id===t})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))})),this},e.prototype.subscribeToChild=function(t,e,n){var r=this,o=n.bind(this);if(e instanceof Array)return e.forEach((function(e){return r.subscribeToChild(t,e,n)})),this;if("string"!=typeof e)return this;var i=e.toUpperCase(),a=this.getChildSubscriptions(t.id,i);if(a.length>0)a.forEach((function(e){return e.updateSubscribe(r.group,t.subgroups)}));else{var s={id:t.id,subgroups:t.subgroups,type:t.type};this.subscribe(i,o,s)}return this},e.prototype.getUpdatedChildActions=function(t,e){if(0!==t.length){for(var n=t.filter((function(t,e,n){return e===n.indexOf(t)})),r=n.map((function(t){return t.id})),o=e.filter((function(t){return r.indexOf(t.id)<0}));o.length>0;){if(!(i=o.pop()))break;this.removeChild(i.id)}return n}for(;e.length>0;){var i;if(!(i=e.pop()))break;this.removeChild(i.id)}},e}(E);function v(t,e,n){void 0===n&&(n=!1),t.forEach((function(t){n?(0,t.updateSubscribe)(e,[]):(0,t.unsubscribe)()})),n||(t.length=0)}function _(t,e){var n=f.default(t,e);return n||Object.assign(t,e)}function b(t,e){Object.keys(t).forEach((function(n){e(t[n])}))}e.ActionSetWithChildren=O,e.updateActionFromPayload=function(t,e){return t.id===e.id&&(Object.assign(t,_(t,e)),!0)},e.getMergedProps=_,e.forEachInEnum=b,e.findMatchInEnum=function(t,e){var n=Object.keys(t).find((function(n){return e===t[n]}));return n?t[n]:void 0},e.NonSnakeCaseGroup=[h.Group.AuthCode,h.Group.Button,h.Group.ButtonGroup,h.Group.Cart,h.Group.Error,h.Group.Features,h.Group.Fullscreen,h.Group.Link,h.Group.Loading,h.Group.Menu,h.Group.Modal,h.Group.Navigation,h.Group.Pos,h.Group.Print,h.Group.ResourcePicker,h.Group.Scanner,h.Group.SessionToken,h.Group.Share,h.Group.TitleBar,h.Group.Toast]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ComponentType=e.Group=void 0,function(t){t.AuthCode="AuthCode",t.Button="Button",t.ButtonGroup="ButtonGroup",t.Cart="Cart",t.Client="Client",t.ContextualSaveBar="ContextualSaveBar",t.Error="Error",t.Features="Features",t.FeedbackModal="FeedbackModal",t.Fullscreen="Fullscreen",t.LeaveConfirmation="LeaveConfirmation",t.Link="Link",t.Loading="Loading",t.Menu="Menu",t.Modal="Modal",t.Navigation="Navigation",t.Performance="Performance",t.Pos="Pos",t.Print="Print",t.ResourcePicker="Resource_Picker",t.Scanner="Scanner",t.SessionToken="SessionToken",t.Share="Share",t.TitleBar="TitleBar",t.Toast="Toast",t.MarketingExternalActivityTopBar="MarketingExternalActivityTopBar"}(e.Group||(e.Group={})),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup"}(e.ComponentType||(e.ComponentType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LifecycleHook=e.MessageType=e.PermissionType=void 0,function(t){t.Dispatch="Dispatch",t.Subscribe="Subscribe"}(e.PermissionType||(e.PermissionType={})),function(t){t.GetState="getState",t.Dispatch="dispatch",t.Subscribe="subscribe",t.Unsubscribe="unsubscribe"}(e.MessageType||(e.MessageType={})),function(t){t.UpdateAction="UpdateAction",t.DispatchAction="DispatchAction"}(e.LifecycleHook||(e.LifecycleHook={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=e.fromAction=e.AppBridgeError=e.invalidOriginAction=e.isErrorEventName=e.permissionAction=e.networkAction=e.persistenceAction=e.unsupportedOperationAction=e.unexpectedAction=e.invalidAction=e.invalidActionType=e.invalidPayload=e.Message=e.AppActionType=e.Action=void 0;var r,o=n(0),i=n(1);function a(t,e,n){var r=e.payload;return o.actionWrapper({type:t,group:i.Group.Error,payload:{action:e,message:n,type:t,id:r&&r.id?r.id:void 0}})}!function(t){t.INVALID_ACTION="APP::ERROR::INVALID_ACTION",t.INVALID_ACTION_TYPE="APP::ERROR::INVALID_ACTION_TYPE",t.INVALID_PAYLOAD="APP::ERROR::INVALID_PAYLOAD",t.INVALID_OPTIONS="APP::ERROR::INVALID_OPTIONS",t.UNEXPECTED_ACTION="APP::ERROR::UNEXPECTED_ACTION",t.PERSISTENCE="APP::ERROR::PERSISTENCE",t.UNSUPPORTED_OPERATION="APP::ERROR::UNSUPPORTED_OPERATION",t.NETWORK="APP::ERROR::NETWORK",t.PERMISSION="APP::ERROR::PERMISSION",t.FAILED_AUTHENTICATION="APP::ERROR::FAILED_AUTHENTICATION",t.INVALID_ORIGIN="APP::ERROR::INVALID_ORIGIN"}(r=e.Action||(e.Action={})),function(t){t.INVALID_CONFIG="APP::ERROR::INVALID_CONFIG",t.MISSING_CONFIG="APP::APP_ERROR::MISSING_CONFIG",t.MISSING_APP_BRIDGE_MIDDLEWARE="APP::APP_ERROR::MISSING_APP_BRIDGE_MIDDLEWARE",t.WINDOW_UNDEFINED="APP::APP_ERROR::WINDOW_UNDEFINED",t.MISSING_LOCAL_ORIGIN="APP::APP_ERROR::MISSING_LOCAL_ORIGIN",t.MISSING_HOST_PROVIDER="APP::APP_ERROR::MISSING_HOST_PROVIDER",t.MISSING_ROUTER_CONTEXT="APP::APP_ERROR::MISSING_ROUTER_CONTEXT",t.MISSING_HISTORY_BLOCK="APP::APP_ERROR::MISSING_HISTORY_BLOCK"}(e.AppActionType||(e.AppActionType={})),function(t){t.MISSING_PAYLOAD="Missing payload",t.INVALID_PAYLOAD_ID="Id in payload is missing or invalid"}(e.Message||(e.Message={})),e.invalidPayload=function(t,e){return a(r.INVALID_PAYLOAD,t,e||"The action's payload is missing required properties or has invalid properties")},e.invalidActionType=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action type is invalid or unsupported",type:r.INVALID_ACTION_TYPE},type:r.INVALID_ACTION_TYPE})},e.invalidAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action's has missing/invalid values for `group`, `type` or `version`",type:r.INVALID_ACTION},type:r.INVALID_ACTION})},e.unexpectedAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"Action cannot be called at this time",type:r.UNEXPECTED_ACTION},type:r.UNEXPECTED_ACTION})},e.unsupportedOperationAction=function(t,e){return a(r.UNSUPPORTED_OPERATION,t,e||"The action type is unsupported")},e.persistenceAction=function(t,e){return a(r.PERSISTENCE,t,e||"Action cannot be persisted on server")},e.networkAction=function(t,e){return a(r.NETWORK,t,e||"Network error")},e.permissionAction=function(t,e){return a(r.PERMISSION,t,e||"Action is not permitted")},e.isErrorEventName=function(t){return"string"==typeof o.findMatchInEnum(r,t)},e.invalidOriginAction=function(t){return o.actionWrapper({group:i.Group.Error,payload:{message:t,type:r.INVALID_ORIGIN},type:r.INVALID_ORIGIN})};var s=function(t){this.name="AppBridgeError",this.message=t,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(this.message).stack};function u(t,e,n){var r=new s(t?e+": "+t:e);return r.action=n,r.type=e,r}e.AppBridgeError=s,s.prototype=Object.create(Error.prototype),e.fromAction=u,e.throwError=function(){var t,e,n=arguments[0];throw"string"==typeof arguments[1]?t=arguments[1]:(e=arguments[1],t=arguments[2]||""),u(t,n,e)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Button=e.isValidButtonProps=e.update=e.clickButton=e.Style=e.Icon=e.Action=void 0;var a,s=n(0),u=n(1);function c(t,e,n){var r=e.id,o=s.getEventNameSpace(t,a.CLICK,e),i={id:r,payload:n};return s.actionWrapper({type:o,group:t,payload:i})}function p(t,e,n){var r=e.id,o=n.label,u=s.getEventNameSpace(t,a.UPDATE,e),c=i(i({},n),{id:r,label:o});return s.actionWrapper({type:u,group:t,payload:c})}!function(t){t.CLICK="CLICK",t.UPDATE="UPDATE"}(a=e.Action||(e.Action={})),function(t){t.Print="print"}(e.Icon||(e.Icon={})),function(t){t.Danger="danger"}(e.Style||(e.Style={})),e.clickButton=c,e.update=p,e.isValidButtonProps=function(t){return"string"==typeof t.id&&"string"==typeof t.label};var d=function(t){function e(e,n){var r=t.call(this,e,u.ComponentType.Button,u.Group.Button)||this;return r.disabled=!1,r.loading=!1,r.set(n,!1),r}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{disabled:this.disabled,icon:this.icon,label:this.label,style:this.style,loading:this.loading}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=s.getMergedProps(this.options,t),r=n.label,o=n.disabled,i=n.icon,u=n.style,c=n.loading;return this.label=r,this.disabled=Boolean(o),this.icon=i,this.style=u,this.loading=Boolean(c),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case a.CLICK:this.app.dispatch(c(this.group,this.component,e));break;case a.UPDATE:var n=p(this.group,this.component,this.payload);this.app.dispatch(n)}return this},e}(s.ActionSet);e.Button=d,e.create=function(t,e){return new d(t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSingleButton=void 0;var r=n(4);e.getSingleButton=function(t,e,n,o){return t.addChild(e,t.group,n),t.subscribeToChild(e,r.Action.UPDATE,o),e.payload}},function(t,e,n){"use strict";function r(t,e,n){var r=t.findIndex((function(t){return t===e}));return r>=0&&(t.splice(r,1),n&&n(e),!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.removeFromCollection=e.addAndRemoveFromCollection=void 0,e.addAndRemoveFromCollection=function(t,e,n){return t.push(e),function(){return r(t,e,n)}},e.removeFromCollection=r},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ButtonGroup=e.isGroupedButtonPayload=e.isGroupedButton=e.update=e.Action=void 0;var a,s=n(5),u=n(0),c=n(1);function p(t,e,n){return function(t,e,n,r,o){var a=e.id,s=r.label,c=u.getEventNameSpace(t,n,e),p=i(i({},r),{id:a,label:s,payload:o});return u.actionWrapper({type:c,group:t,payload:p})}(t,e,a.UPDATE,n)}!function(t){t.UPDATE="UPDATE"}(a=e.Action||(e.Action={})),e.update=p,e.isGroupedButton=function(t){var e=t;return e.buttons&&e.buttons.length>0&&void 0!==e.label},e.isGroupedButtonPayload=function(t){var e=t;return Array.isArray(e.buttons)&&"string"==typeof e.id&&"string"==typeof e.label};var d=function(t){function e(e,n){var r=t.call(this,e,c.ComponentType.ButtonGroup,c.Group.ButtonGroup)||this;return r.disabled=!1,r.buttonsOptions=[],r.buttons=[],r.set(n,!1),r}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{buttons:this.buttonsOptions,disabled:this.disabled,label:this.label}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=u.getMergedProps(this.options,t),r=n.label,o=n.disabled,i=n.buttons;return this.label=r,this.disabled=Boolean(o),this.buttons=this.getButtons(i),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:var e=p(this.group,this.component,this.payload);this.app.dispatch(e)}return this},e.prototype.updateButtons=function(t){if(this.buttons&&0!==this.buttons.length){for(var e,n=0,r=this.buttons;n<r.length;n++){var o=r[n];if(e=u.updateActionFromPayload(o,t))break}e&&this.dispatch(a.UPDATE)}},e.prototype.getSingleButton=function(t){return s.getSingleButton(this,t,this.subgroups,this.updateButtons)},e.prototype.getButtons=function(t){var e=this,n=[];return t?(t.forEach((function(t){var r=s.getSingleButton(e,t,e.subgroups,e.updateButtons);n.push(r)})),this.buttonsOptions=t,n):[]},e}(u.ActionSetWithChildren);e.ButtonGroup=d,e.create=function(t,e){return new d(t,e)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Toast=e.clear=e.show=e.Action=void 0;var a,s=n(0),u=n(1);function c(t){return s.actionWrapper({group:u.Group.Toast,payload:t,type:a.SHOW})}function p(t){return s.actionWrapper({payload:t,group:u.Group.Toast,type:a.CLEAR})}!function(t){t.SHOW="APP::TOAST::SHOW",t.CLEAR="APP::TOAST::CLEAR"}(a=e.Action||(e.Action={})),e.show=c,e.clear=p;var d=function(t){function e(e,n){var r=t.call(this,e,u.Group.Toast,u.Group.Toast)||this;return r.message="",r.duration=5e3,r.set(n),r}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{duration:this.duration,isError:this.isError,message:this.message}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){var e=s.getMergedProps(this.options,t),n=e.message,r=e.duration,o=e.isError;return this.message=n,this.duration=r,this.isError=o,this},e.prototype.dispatch=function(t){switch(t){case a.SHOW:var e=c(this.payload);this.app.dispatch(e);break;case a.CLEAR:this.app.dispatch(p({id:this.id}))}return this},e}(s.ActionSet);e.Toast=d,e.create=function(t,e){return new d(t,e)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.AppLink=e.update=e.Action=void 0;var a,s=n(0),u=n(1),c=n(14);function p(t,e,n){var r=e.id,o=n.label,u=n.destination,c=i(i({},n),{id:r,label:o,destination:u});return s.actionWrapper({group:t,type:s.getEventNameSpace(t,a.UPDATE,e),payload:c})}!function(t){t.UPDATE="UPDATE"}(a=e.Action||(e.Action={})),e.update=p;var d=function(t){function e(e,n){var r=t.call(this,e,u.Group.Link,u.Group.Link)||this;return r.label="",r.destination="",r.set(n,!1),r}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{label:this.label,destination:this.destination,redirectType:c.Action.APP}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){var t=this.options,e=t.label,n=t.destination,r=t.redirectType,o=n;return{id:this.id,label:e,destination:{path:o},redirectType:r}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=s.getMergedProps(this.options,t),r=n.label,o=n.destination;return this.label=r,this.destination=o,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:var e=p(this.group,this.component,this.payload);this.app.dispatch(e)}return this},e}(s.ActionSet);e.AppLink=d,e.create=function(t,e){return new d(t,e)}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0});var i=n(17);o(n(2),e),o(n(17),e),e.default=i.createClientApp},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SEPARATOR=e.PREFIX=void 0,e.PREFIX="APP",e.SEPARATOR="::"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initialize=e.ActionType=e.Action=void 0;var r,o=n(1),i=n(0);!function(t){t.INITIALIZE="APP::CLIENT::INITIALIZE"}(r=e.Action||(e.Action={})),function(t){t.INITIALIZE="APP::CLIENT::INITIALIZE"}(e.ActionType||(e.ActionType={})),e.initialize=function(){return i.actionWrapper({group:o.Group.Client,type:r.INITIALIZE})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=void 0,function(t){t.UPDATE="APP::FEATURES::UPDATE",t.REQUEST="APP::FEATURES::REQUEST",t.REQUEST_UPDATE="APP::FEATURES::REQUEST::UPDATE"}(e.Action||(e.Action={}))},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Redirect=e.isRemotePayload=e.isAdminSectionPayload=e.isAdminPathPayload=e.isAppPayload=e.toDestination=e.toApp=e.toRemote=e.toAdminSection=e.toAdminPath=e.isProductVariantCreateResourcePayload=e.isProductVariantResourcePayload=e.isCreateResourcePayload=e.isResourcePayload=e.ResourceType=e.Action=void 0;var a,s=n(0),u=n(1);function c(t){return!0===t.create}function p(t){var e=t;return void 0!==e.id&&void 0!==e.variant}function d(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.ADMIN_PATH})}function f(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.ADMIN_SECTION})}function h(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.REMOTE})}function l(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.APP})}function y(t,e,n){switch(t){case a.APP:var r=A(e)?e:{path:e};return l(i({id:n},r));case a.ADMIN_PATH:var o=P(e)?e:{path:e};return d(i({id:n},o));case a.ADMIN_SECTION:var s=E(e)?e:{section:e};return f(i({id:n},s));case a.REMOTE:var u=O(e)?e:{url:e};return h(i({id:n},u))}}function A(t){return"object"==typeof t&&t.hasOwnProperty("path")}function P(t){return"object"==typeof t&&t.hasOwnProperty("path")}function E(t){return"object"==typeof t&&"object"==typeof t.section&&t.section.hasOwnProperty("name")}function O(t){return"object"==typeof t&&t.hasOwnProperty("url")}!function(t){t.ADMIN_SECTION="APP::NAVIGATION::REDIRECT::ADMIN::SECTION",t.ADMIN_PATH="APP::NAVIGATION::REDIRECT::ADMIN::PATH",t.REMOTE="APP::NAVIGATION::REDIRECT::REMOTE",t.APP="APP::NAVIGATION::REDIRECT::APP"}(a=e.Action||(e.Action={})),function(t){t.Product="products",t.Collection="collections",t.Order="orders",t.Customer="customers",t.Discount="discounts"}(e.ResourceType||(e.ResourceType={})),e.isResourcePayload=function(t){return"string"==typeof t.id},e.isCreateResourcePayload=c,e.isProductVariantResourcePayload=p,e.isProductVariantCreateResourcePayload=function(t){return!!p(t)&&c(t.variant)},e.toAdminPath=d,e.toAdminSection=f,e.toRemote=h,e.toApp=l,e.toDestination=y,e.isAppPayload=A,e.isAdminPathPayload=P,e.isAdminSectionPayload=E,e.isRemotePayload=O;var v=function(t){function e(e){return t.call(this,e,"Redirect",u.Group.Navigation)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t,e){var n=y(t,e,this.payload.id);return this.app.dispatch(n),this},e}(s.ActionSet);e.Redirect=v,e.create=function(t){return new v(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.app=e.Action=void 0;var r,o=n(0),i=n(1);!function(t){t.APP="APP::PRINT::APP"}(r=e.Action||(e.Action={})),e.app=function(){return o.actionWrapper({group:i.Group.Print,type:r.APP})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAppMessage=e.isPermitted=e.getPermissionKey=e.isFromApp=e.isAppBridgeAction=void 0;var r=n(2),o=n(11),i=n(0);function a(t){return t.replace(new RegExp("^"+o.PREFIX+o.SEPARATOR+"\\w+"+o.SEPARATOR),"")}e.isAppBridgeAction=function(t){return t instanceof Object&&t.hasOwnProperty("type")&&t.type.toString().startsWith(o.PREFIX)},e.isFromApp=function(t){return"object"==typeof t&&"object"==typeof t.source&&"string"==typeof t.source.apiKey},e.getPermissionKey=a,e.isPermitted=function(t,e,n){var r=e.group,o=e.type;if(!r||!t.hasOwnProperty(r))return!1;var i=t[r];if(!i)return!1;var s=a(o);return!!i[s]&&!0===i[s][n]},e.isAppMessage=function(t){if("object"!=typeof t||!t.data||"object"!=typeof t.data)return!1;var e=t.data;return e.hasOwnProperty("type")&&void 0!==i.findMatchInEnum(r.MessageType,e.type)}},function(t,e,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createApp=e.createAppWrapper=e.createClientApp=e.WINDOW_UNDEFINED_MESSAGE=void 0;var i=n(0),a=n(15),s=n(3),u=n(18),c=n(52),p=n(19),d=n(12),f=n(53),h=n(20),l=n(2),y=o(n(54));function A(t,n,r){if(void 0===r&&(r=[]),!t)throw s.fromAction(e.WINDOW_UNDEFINED_MESSAGE,s.AppActionType.WINDOW_UNDEFINED);var o=h.getLocation(),i=n||o&&o.origin;if(!i)throw s.fromAction("local origin cannot be blank",s.AppActionType.MISSING_LOCAL_ORIGIN);var a=u.fromWindow(t,i);return e.createClientApp(a,r)}function P(t){var e=h.getWindow();return e?A(e.top)(t):c.serverAppBridge}e.WINDOW_UNDEFINED_MESSAGE="window is not defined. Running an app outside a browser is not supported",e.createClientApp=function(t,e){void 0===e&&(e=[]);var n=[],o=u.createTransportListener();return t.subscribe((function(t){var e=t.data,r=e.type,a=e.payload;switch(r){case"getState":n.splice(0).forEach((function(t){return t(a)}));break;case"dispatch":if(o.handleMessage(a),o.handleActionDispatch(a))return;var u=i.findMatchInEnum(s.Action,a.type);u&&s.throwError(u,a)}})),function(u){if(!u.host)throw s.fromAction("host must be provided",s.AppActionType.INVALID_CONFIG);if(!u.apiKey)throw s.fromAction("apiKey must be provided",s.AppActionType.INVALID_CONFIG);var c;try{c=function(t){var e;return r(r({},t),{host:atob(null===(e=t.host)||void 0===e?void 0:e.replace(/_/g,"/").replace(/-/g,"+"))})}(u)}catch(t){throw s.fromAction("not a valid host, please use the value provided by Shopify",s.AppActionType.INVALID_CONFIG)}var A=function(t,e){return function(n,r){t.dispatch({payload:r,source:e,type:n})}}(t,c),P=o.createSubscribeHandler(A);function E(t){return A(l.MessageType.Dispatch,t),t}A(l.MessageType.Unsubscribe),function(t,e){var n=e.apiKey,r=e.host,o=e.forceRedirect,i=void 0===o?!p.isDevelopmentClient:o,a=h.getLocation();if(!p.isFrameless&&a&&n&&r&&i&&h.shouldRedirect(t)){var s="https://"+r+"/apps/"+n+a.pathname+(a.search||"");h.redirect(s)}}(t.hostFrame,c);for(var O=new y.default,v={localOrigin:t.localOrigin,hooks:O,dispatch:function(t){return v.hooks?v.hooks.run(l.LifecycleHook.DispatchAction,E,v,t):E(t)},featuresAvailable:function(t){return v.getState("features").then((function(e){return t&&Object.keys(e).forEach((function(n){t.includes(n)||delete e[n]})),e}))},getState:function(t){return new Promise((function(t){n.push(t),A(l.MessageType.GetState)})).then((function(e){return t?t.split(".").reduce((function(t,n){if("object"==typeof e&&!Array.isArray(e))return t=e[n],e=t,t}),void 0):e}))},subscribe:P,error:function(t,e){var n=[];return i.forEachInEnum(s.Action,(function(r){n.push(P(r,t,e))})),function(){n.forEach((function(t){return t()}))}}},_=0,b=e;_<b.length;_++){(0,b[_])(O,v)}return function(t){t.subscribe(a.Action.APP,f.handleAppPrint),t.dispatch(d.initialize())}(v),v}},e.createAppWrapper=A,e.createApp=P,e.default=P},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createTransportListener=e.fromWindow=e.fromFrame=e.Context=void 0;var r=n(3),o=n(16),i=n(2),a=n(6),s=n(19);!function(t){t.Modal="Modal",t.Main="Main"}(e.Context||(e.Context={})),e.fromFrame=function(t,e,n){var i=[];if(void 0===t||!t.ownerDocument||!t.ownerDocument.defaultView)throw r.fromAction("App frame is undefined",r.AppActionType.WINDOW_UNDEFINED);var s=t.ownerDocument.defaultView;return s.addEventListener("message",(function(n){if(o.isAppMessage(n))if(n.origin===e)for(var a=0,s=i;a<s.length;a++){(0,s[a])(n)}else{var u=t.contentWindow;if(u){var c="Message origin '"+n.origin+"' does not match app origin '"+e+"'.",p={type:"dispatch",payload:r.invalidOriginAction(c)};u.postMessage(p,n.origin)}}})),{context:n,localOrigin:e,frameWindow:t.contentWindow,hostFrame:s,dispatch:function(n){var r=t.contentWindow;r&&r.postMessage(n,e)},subscribe:function(t){return a.addAndRemoveFromCollection(i,t)}}},e.fromWindow=function(t,e){var n=[];return void 0!==typeof window&&window.addEventListener("message",(function(e){if((window!==t||s.isFrameless)&&e.source===t&&(o.isAppBridgeAction(e.data.payload)||o.isAppMessage(e)))for(var r=0,i=n;r<i.length;r++){(0,i[r])(e)}})),{localOrigin:e,hostFrame:t,dispatch:function(e){var n;if(null===(n=e.source)||void 0===n?void 0:n.host)if(s.isFrameless&&window&&window.SmartWebView)window.SmartWebView.handleMessage("frameless://fromClient",JSON.stringify(e));else{var r=new URL("https://"+e.source.host).origin;t.postMessage(e,r)}},subscribe:function(t){return a.addAndRemoveFromCollection(n,t)}}},e.createTransportListener=function(){var t=[],e={};return{createSubscribeHandler:function(n){return function(){if(arguments.length<2)return a.addAndRemoveFromCollection(t,{callback:arguments[0]});var r=Array.from(arguments),o=r[0],s=r[1],u=r[2],c={callback:s,id:u},p={type:o,id:u};return Object.prototype.hasOwnProperty.call(e,o)||(e[o]=[]),n&&n(i.MessageType.Subscribe,p),a.addAndRemoveFromCollection(e[o],c,(function(){n&&n(i.MessageType.Unsubscribe,p)}))}},handleMessage:function(e){t.forEach((function(t){return t.callback(e)}))},handleActionDispatch:function(t){var n=t.type,r=t.payload,o=!1;if(Object.prototype.hasOwnProperty.call(e,n))for(var i=0,a=e[n];i<a.length;i++){var s=a[i],u=s.id,c=s.callback;!(r&&r.id===u)&&u||(c(r),o=!0)}return o}}}},function(t,e,n){"use strict";(function(t){var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.isFrameless=e.isDevelopmentClient=e.isProduction=e.isDevelopment=e.isClient=e.isServer=void 0,e.isServer="undefined"==typeof window,e.isClient=!e.isServer,e.isDevelopment=void 0!==t&&t.env&&!1,e.isProduction=!e.isDevelopment,e.isDevelopmentClient=e.isDevelopment&&e.isClient,e.isFrameless=e.isClient&&(null===(r=null===(n=window.navigator)||void 0===n?void 0:n.userAgent)||void 0===r?void 0:r.indexOf(" Frameless "))>0}).call(this,n(51))},function(t,e,n){"use strict";function r(){return o()?window.location:void 0}function o(){return"undefined"!=typeof window}Object.defineProperty(e,"__esModule",{value:!0}),e.getWindow=e.getLocation=e.redirect=e.shouldRedirect=void 0,e.shouldRedirect=function(t){return t===window},e.redirect=function(t){var e=r();e&&e.assign(t)},e.getLocation=r,e.getWindow=function(){return o()?window:void 0}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},a=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.actions=void 0;var s=i(n(22));e.actions=s,a(n(50),e);var u=n(10);Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u.createApp}})},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},a=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.Performance=e.Pos=e.AppLink=e.ChannelMenu=e.NavigationMenu=e.Share=e.ContextualSaveBar=e.MarketingExternalActivityTopBar=e.TitleBar=e.SessionToken=e.ResourcePicker=e.Redirect=e.Print=e.Modal=e.Loading=e.LeaveConfirmation=e.History=e.Toast=e.Fullscreen=e.FeedbackModal=e.Features=e.Flash=e.Error=e.Client=e.Cart=e.Scanner=e.ButtonGroup=e.Button=e.AuthCode=void 0;var s=i(n(23));e.AuthCode=s;var u=i(n(4));e.Button=u;var c=i(n(7));e.ButtonGroup=c;var p=i(n(27));e.Cart=p;var d=i(n(12));e.Client=d;var f=i(n(3));e.Error=f;var h=i(n(28));e.Flash=h;var l=i(n(30));e.Features=l;var y=i(n(32));e.FeedbackModal=y;var A=i(n(33));e.Fullscreen=A;var P=i(n(34));e.LeaveConfirmation=P;var E=i(n(35));e.Loading=E;var O=i(n(36));e.Modal=O;var v=i(n(37));e.History=v;var _=i(n(14));e.Redirect=_;var b=i(n(15));e.Print=b;var T=i(n(38));e.ResourcePicker=T;var g=i(n(39));e.Scanner=g;var S=i(n(40));e.SessionToken=S;var m=i(n(41));e.TitleBar=m;var I=i(n(8));e.Toast=I;var C=i(n(43));e.ContextualSaveBar=C;var R=i(n(44));e.Share=R;var N=i(n(45));e.NavigationMenu=N;var D=i(n(46));e.ChannelMenu=D;var M=i(n(9));e.AppLink=M;var U=i(n(47));e.Pos=U;var L=i(n(48));e.MarketingExternalActivityTopBar=L;var w=i(n(49));e.Performance=w;var j=n(16);Object.defineProperty(e,"isAppBridgeAction",{enumerable:!0,get:function(){return j.isAppBridgeAction}}),a(n(1),e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.respond=e.request=e.Action=void 0;var r,o=n(0),i=n(1);!function(t){t.REQUEST="APP::AUTH_CODE::REQUEST",t.RESPOND="APP::AUTH_CODE::RESPOND"}(r=e.Action||(e.Action={})),e.request=function(t){return o.actionWrapper({group:i.Group.AuthCode,type:r.REQUEST,payload:{id:t}})},e.respond=function(t){return o.actionWrapper({payload:t,group:i.Group.AuthCode,type:r.RESPOND})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,n){if(null==n)return n;if(void 0===e||!Object.getPrototypeOf(e).isPrototypeOf(n)||"Object"!==n.constructor.name&&"Array"!==n.constructor.name)return n;var r={};return Object.keys(n).forEach((function(o){e.hasOwnProperty(o)?"object"!=typeof e[o]||Array.isArray(e[o])?r[o]=n[o]:r[o]=t(e[o],n[o]):r[o]=n[o]})),Object.keys(e).forEach((function(t){n.hasOwnProperty(t)||(r[t]=e[t])})),Object.setPrototypeOf(r,Object.getPrototypeOf(e)),r}},function(t,e,n){"use strict";function r(t){return Array.from(t).map((function(t){return("00"+t.toString(16)).slice(-2)})).join("")}function o(t){if("function"==typeof Uint8Array&&"object"==typeof window&&window.crypto){var e=new Uint8Array(t),n=window.crypto.getRandomValues(e);if(n)return n}return Array.from(new Array(t),(function(){return 255*Math.random()|0}))}function i(){var t=o(1),e=o(2);return t[0]&=191,e[0]&=79,[r(o(4)),"-",r(o(2)),"-",r(e),"-",r(t),r(o(1)),"-",r(o(6))].join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=void 0,e.generateUuid=i,e.default=i},function(t){t.exports=JSON.parse('{"name":"@shopify/app-bridge","version":"2.0.0","types":"index.d.ts","main":"index.js","unpkg":"umd/index.js","jsdelivr":"umd/index.js","files":["/actions/","/client/","/umd/","/util/","/validate/","/development.d.ts","/development.js","/index.d.ts","/index.js","/MessageTransport.d.ts","/MessageTransport.js","/production.d.ts","/production.js"],"private":false,"publishConfig":{"access":"public","@shopify:registry":"https://registry.npmjs.org"},"repository":"git@github.com:Shopify/app-bridge.git","homepage":"https://shopify.dev/tools/app-bridge","author":"Shopify Inc.","license":"MIT","scripts":{"build":"yarn build:tsc && yarn build:npm && yarn build:umd","build:tsc":"NODE_ENV=production tsc","build:umd":"NODE_ENV=production webpack -p","build:npm":"shx cp -r ./npm/index.js ./index.js","check":"tsc","clean":"cat package.json | node -pe \\"JSON.parse(require(\'fs\').readFileSync(\'/dev/stdin\').toString()).files.map(f => \'./\'+f).join(\' \')\\" | xargs rm -rf","pack":"yarn pack","size":"size-limit"},"sideEffects":false,"size-limit":[{"limit":"17 KB","path":"production.js"}],"devDependencies":{"@types/node":"^10.12.5","shx":"^0.3.3"}}')},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Cart=e.setLineItemProperties=e.removeLineItemDiscount=e.setLineItemDiscount=e.removeLineItem=e.updateLineItem=e.addLineItem=e.removeProperties=e.setProperties=e.setDiscount=e.updateCustomerAddress=e.addCustomerAddress=e.setCustomer=e.update=e.fetch=e.Action=void 0;var a,s=n(0),u=n(1);function c(t,e){return void 0===e&&(e={}),s.actionWrapper({group:u.Group.Cart,type:t,payload:e})}!function(t){t.FETCH="APP::CART::FETCH",t.UPDATE="APP::CART::UPDATE",t.SET_CUSTOMER="APP::CART::SET_CUSTOMER",t.REMOVE_CUSTOMER="APP::CART::REMOVE_CUSTOMER",t.ADD_CUSTOMER_ADDRESS="APP::CART::ADD_CUSTOMER_ADDRESS",t.UPDATE_CUSTOMER_ADDRESS="APP::CART::UPDATE_CUSTOMER_ADDRESS",t.SET_DISCOUNT="APP::CART::SET_DISCOUNT",t.REMOVE_DISCOUNT="APP::CART::REMOVE_DISCOUNT",t.SET_PROPERTIES="APP::CART::SET_PROPERTIES",t.REMOVE_PROPERTIES="APP::CART::REMOVE_PROPERTIES",t.CLEAR="APP::CART::CLEAR",t.ADD_LINE_ITEM="APP::CART::ADD_LINE_ITEM",t.UPDATE_LINE_ITEM="APP::CART::UPDATE_LINE_ITEM",t.REMOVE_LINE_ITEM="APP::CART::REMOVE_LINE_ITEM",t.SET_LINE_ITEM_DISCOUNT="APP::CART::SET_LINE_ITEM_DISCOUNT",t.REMOVE_LINE_ITEM_DISCOUNT="APP::CART::REMOVE_LINE_ITEM_DISCOUNT",t.SET_LINE_ITEM_PROPERTIES="APP::CART::SET_LINE_ITEM_PROPERTIES",t.REMOVE_LINE_ITEM_PROPERTIES="APP::CART::REMOVE_LINE_ITEM_PROPERTIES"}(a=e.Action||(e.Action={})),e.fetch=function(){return c(a.FETCH)},e.update=function(t){return c(a.UPDATE,t)},e.setCustomer=function(t){return c(a.SET_CUSTOMER,t)},e.addCustomerAddress=function(t){return c(a.ADD_CUSTOMER_ADDRESS,t)},e.updateCustomerAddress=function(t){return c(a.UPDATE_CUSTOMER_ADDRESS,t)},e.setDiscount=function(t){return c(a.SET_DISCOUNT,t)},e.setProperties=function(t){return c(a.SET_PROPERTIES,t)},e.removeProperties=function(t){return c(a.REMOVE_PROPERTIES,t)},e.addLineItem=function(t){return c(a.ADD_LINE_ITEM,t)},e.updateLineItem=function(t){return c(a.UPDATE_LINE_ITEM,t)},e.removeLineItem=function(t){return c(a.REMOVE_LINE_ITEM,t)},e.setLineItemDiscount=function(t){return c(a.SET_LINE_ITEM_DISCOUNT,t)},e.removeLineItemDiscount=function(t){return c(a.REMOVE_LINE_ITEM_DISCOUNT,t)},e.setLineItemProperties=function(t){return c(a.SET_LINE_ITEM_PROPERTIES,t)};var p=function(t){function e(e,n){return t.call(this,e,u.Group.Cart,u.Group.Cart,n?n.id:void 0)||this}return o(e,t),e.prototype.dispatch=function(t,e){switch(t){case a.FETCH:this.dispatchCartAction(a.FETCH);break;case a.UPDATE:this.dispatchCartAction(a.UPDATE,e);break;case a.SET_CUSTOMER:this.dispatchCartAction(a.SET_CUSTOMER,e);break;case a.REMOVE_CUSTOMER:this.dispatchCartAction(a.REMOVE_CUSTOMER,e);break;case a.ADD_CUSTOMER_ADDRESS:this.dispatchCartAction(a.ADD_CUSTOMER_ADDRESS,e);break;case a.UPDATE_CUSTOMER_ADDRESS:this.dispatchCartAction(a.UPDATE_CUSTOMER_ADDRESS,e);break;case a.SET_DISCOUNT:this.dispatchCartAction(a.SET_DISCOUNT,e);break;case a.REMOVE_DISCOUNT:this.dispatchCartAction(a.REMOVE_DISCOUNT,e);break;case a.SET_PROPERTIES:this.dispatchCartAction(a.SET_PROPERTIES,e);break;case a.REMOVE_PROPERTIES:this.dispatchCartAction(a.REMOVE_PROPERTIES,e);break;case a.CLEAR:this.dispatchCartAction(a.CLEAR,e);break;case a.ADD_LINE_ITEM:this.dispatchCartAction(a.ADD_LINE_ITEM,e);break;case a.UPDATE_LINE_ITEM:this.dispatchCartAction(a.UPDATE_LINE_ITEM,e);break;case a.REMOVE_LINE_ITEM:this.dispatchCartAction(a.REMOVE_LINE_ITEM,e);break;case a.SET_LINE_ITEM_DISCOUNT:this.dispatchCartAction(a.SET_LINE_ITEM_DISCOUNT,e);break;case a.REMOVE_LINE_ITEM_DISCOUNT:this.dispatchCartAction(a.REMOVE_LINE_ITEM_DISCOUNT,e);break;case a.SET_LINE_ITEM_PROPERTIES:this.dispatchCartAction(a.SET_LINE_ITEM_PROPERTIES,e);break;case a.REMOVE_LINE_ITEM_PROPERTIES:this.dispatchCartAction(a.REMOVE_LINE_ITEM_PROPERTIES,e)}return this},e.prototype.dispatchCartAction=function(t,e){this.app.dispatch(c(t,i(i({},e),{id:this.id})))},e}(s.ActionSet);e.Cart=p,e.create=function(t,e){return new p(t,e)}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(29),e)},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Flash=void 0;var i=n(8),a=n(8);Object.defineProperty(e,"ActionBase",{enumerable:!0,get:function(){return a.ActionBase}}),Object.defineProperty(e,"clear",{enumerable:!0,get:function(){return a.clear}}),Object.defineProperty(e,"ClearAction",{enumerable:!0,get:function(){return a.ClearAction}}),Object.defineProperty(e,"show",{enumerable:!0,get:function(){return a.show}}),Object.defineProperty(e,"ShowAction",{enumerable:!0,get:function(){return a.ShowAction}}),Object.defineProperty(e,"FlashAction",{enumerable:!0,get:function(){return a.ToastAction}});var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i.Toast);e.Flash=s,e.create=function(t,e){return new s(t,e)}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(31),e),o(n(13),e)},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Features=void 0;var a=n(0),s=n(1),u=n(13),c=function(t){function e(e,n){return t.call(this,e,s.Group.Features,s.Group.Features,n?n.id:void 0)||this}return o(e,t),e.prototype.dispatch=function(t,e){switch(t){case u.Action.REQUEST:this.dispatchFeaturesAction(u.Action.REQUEST,e)}return this},e.prototype.dispatchFeaturesAction=function(t,e){this.app.dispatch(a.actionWrapper({group:s.Group.Features,type:t,payload:i(i({},e||{}),{id:this.id})}))},e}(a.ActionSet);e.Features=c,e.create=function(t,e){return new c(t,e)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.FeedbackModal=e.close=e.open=e.Action=void 0;var a,s=n(0),u=n(1);function c(t){return s.actionWrapper({group:u.Group.FeedbackModal,payload:t,type:a.OPEN})}function p(t){return s.actionWrapper({group:u.Group.FeedbackModal,payload:t,type:a.CLOSE})}!function(t){t.OPEN="APP::FEEDBACK_MODAL::OPEN",t.CLOSE="APP::FEEDBACK_MODAL::CLOSE"}(a=e.Action||(e.Action={})),e.open=c,e.close=p;var d=function(t){function e(e,n){var r=t.call(this,e,u.Group.FeedbackModal,u.Group.FeedbackModal)||this;return r.options=n,r.set(n),r}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){return this.options=s.getMergedProps(this.options,t),this},e.prototype.dispatch=function(t){switch(t){case a.OPEN:var e=c(this.payload);this.app.dispatch(e);break;case a.CLOSE:var n=p(this.payload);this.app.dispatch(n)}return this},e}(s.ActionSet);e.FeedbackModal=d,e.create=function(t,e){return new d(t,e)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Fullscreen=e.exit=e.enter=e.Action=void 0;var i,a=n(0),s=n(1);!function(t){t.ENTER="APP::FULLSCREEN::ENTER",t.EXIT="APP::FULLSCREEN::EXIT"}(i=e.Action||(e.Action={})),e.enter=function(){return a.actionWrapper({group:s.Group.Fullscreen,type:i.ENTER})},e.exit=function(){return a.actionWrapper({group:s.Group.Fullscreen,type:i.EXIT})};var u=function(t){function e(e){return t.call(this,e,s.Group.Fullscreen,s.Group.Fullscreen)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t){return this.app.dispatch(a.actionWrapper({group:this.group,type:t,payload:this.payload})),this},e}(a.ActionSet);e.Fullscreen=u,e.create=function(t){return new u(t)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.LeaveConfirmation=e.confirm=e.disable=e.enable=e.Action=void 0;var a,s=n(0),u=n(1);function c(t){return void 0===t&&(t={}),s.actionWrapper({group:u.Group.LeaveConfirmation,payload:t,type:a.ENABLE})}function p(t){return void 0===t&&(t={}),s.actionWrapper({group:u.Group.LeaveConfirmation,payload:t,type:a.DISABLE})}function d(t){return void 0===t&&(t={}),s.actionWrapper({group:u.Group.LeaveConfirmation,payload:t,type:a.CONFIRM})}!function(t){t.ENABLE="APP::LEAVE_CONFIRMATION::ENABLE",t.DISABLE="APP::LEAVE_CONFIRMATION::DISABLE",t.CONFIRM="APP::LEAVE_CONFIRMATION::CONFIRM"}(a=e.Action||(e.Action={})),e.enable=c,e.disable=p,e.confirm=d;var f=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e,u.Group.LeaveConfirmation,u.Group.LeaveConfirmation)||this;return r.options=n,r.set(n),r}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){return this.options=s.getMergedProps(this.options,t),this},e.prototype.dispatch=function(t){switch(t){case a.ENABLE:var e=c(this.payload);this.app.dispatch(e);break;case a.DISABLE:var n=p(this.payload);this.app.dispatch(n);break;case a.CONFIRM:var r=d(this.payload);this.app.dispatch(r)}return this},e}(s.ActionSet);e.LeaveConfirmation=f,e.create=function(t,e){return void 0===e&&(e={}),new f(t,e)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Loading=e.stop=e.start=e.Action=void 0;var i,a=n(0),s=n(1);function u(t){return a.actionWrapper({payload:t,group:s.Group.Loading,type:i.START})}function c(t){return a.actionWrapper({payload:t,group:s.Group.Loading,type:i.STOP})}!function(t){t.START="APP::LOADING::START",t.STOP="APP::LOADING::STOP"}(i=e.Action||(e.Action={})),e.start=u,e.stop=c;var p=function(t){function e(e){return t.call(this,e,s.Group.Loading,s.Group.Loading)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t){switch(t){case i.START:this.app.dispatch(u(this.payload));break;case i.STOP:this.app.dispatch(c(this.payload))}return this},e}(a.ActionSet);e.Loading=p,e.create=function(t){return new p(t)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ModalIframe=e.ModalMessage=e.Modal=e.isMessageModal=e.isIframeModal=e.data=e.update=e.clickFooterButton=e.updateModalSize=e.closeModal=e.openModal=e.Size=e.Action=void 0;var a,s,u=n(5),c=n(0),p=n(1),d=n(4);!function(t){t.OPEN="APP::MODAL::OPEN",t.CLOSE="APP::MODAL::CLOSE",t.UPDATE="APP::MODAL::UPDATE",t.FOOTER_BUTTON_CLICK="APP::MODAL::FOOTER::BUTTON::CLICK",t.FOOTER_BUTTON_UPDATE="APP::MODAL::FOOTER::BUTTON::UPDATE",t.UPDATE_SIZE="APP::MODAL::UPDATE_SIZE",t.DATA="APP::MODAL::DATA"}(a=e.Action||(e.Action={})),function(t){t.Small="small",t.Medium="medium",t.Large="large",t.Full="full",t.Auto="auto"}(s=e.Size||(e.Size={}));var f={group:p.Group.Modal,subgroups:["Footer"],type:p.ComponentType.Button};function h(t){return c.actionWrapper({group:p.Group.Modal,payload:t,type:a.OPEN})}function l(t){return c.actionWrapper({group:p.Group.Modal,payload:t,type:a.CLOSE})}function y(t){return c.actionWrapper({payload:t,group:p.Group.Modal,type:a.UPDATE})}function A(t){return c.actionWrapper({payload:t,group:p.Group.Modal,type:a.DATA})}function P(t){return"string"==typeof t.url||"string"==typeof t.path}e.openModal=h,e.closeModal=l,e.updateModalSize=function(t){return c.actionWrapper({group:p.Group.Modal,payload:t,type:a.UPDATE_SIZE})},e.clickFooterButton=function(t,e){var n=i({id:t},f);return d.clickButton(p.Group.Modal,n,e)},e.update=y,e.data=A,e.isIframeModal=P,e.isMessageModal=function(t){return"string"==typeof t.message};var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=s.Small,e}return o(e,t),Object.defineProperty(e.prototype,"footer",{get:function(){if(this.footerPrimary||this.footerSecondary)return{buttons:{primary:this.footerPrimary,secondary:this.footerSecondary}}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"footerOptions",{get:function(){if(this.footerPrimaryOptions||this.footerSecondaryOptions)return{buttons:{primary:this.footerPrimaryOptions,secondary:this.footerSecondaryOptions}}},enumerable:!1,configurable:!0}),e.prototype.close=function(){this.app.dispatch(l({id:this.id}))},e.prototype.setFooterPrimaryButton=function(t,e){var n=this,r=f.subgroups;this.footerPrimaryOptions=this.getChildButton(t,this.footerPrimaryOptions),this.footerPrimary=this.footerPrimaryOptions?u.getSingleButton(this,this.footerPrimaryOptions,r,(function(t){n.updatePrimaryFooterButton(t,e)})):void 0},e.prototype.setFooterSecondaryButtons=function(t,e){var n=this,r=f.subgroups,o=t||[],i=this.footerOptions&&this.footerOptions.buttons.secondary||[];this.footerSecondaryOptions=this.getUpdatedChildActions(o,i),this.footerSecondary=this.footerSecondaryOptions?this.footerSecondaryOptions.map((function(t){return u.getSingleButton(n,t,r,(function(t){n.updateSecondaryFooterButton(t,e)}))})):void 0},e.prototype.getChildButton=function(t,e){var n=t?[t]:[],r=e?[e]:[],o=this.getUpdatedChildActions(n,r);return o?o[0]:void 0},e.prototype.updatePrimaryFooterButton=function(t,e){this.footer&&this.footer.buttons.primary&&c.updateActionFromPayload(this.footer.buttons.primary,t)&&e()},e.prototype.updateSecondaryFooterButton=function(t,e){if(this.footer&&this.footer.buttons&&this.footer.buttons.secondary){for(var n,r=0,o=this.footer.buttons.secondary;r<o.length;r++){var i=o[r];if(n=c.updateActionFromPayload(i,t))break}n&&e()}},e}(c.ActionSetWithChildren);e.Modal=E;var O=function(t){function e(e,n){var r=t.call(this,e,p.Group.Modal,p.Group.Modal)||this;return r.set(n,!1),r}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{footer:this.footer,id:this.id})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,message:this.message,size:this.size,title:this.title}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){var n=this;void 0===e&&(e=!0);var r=c.getMergedProps(this.options,t),o=r.title,i=r.footer,s=r.message,u=r.size;return this.title=o,this.message=s,this.size=u,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,(function(){n.dispatch(a.UPDATE)})),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,(function(){n.dispatch(a.UPDATE)})),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.OPEN:this.app.dispatch(h(this.payload));break;case a.CLOSE:this.close();break;case a.UPDATE:this.app.dispatch(y(this.payload))}return this},e}(E);e.ModalMessage=O;var v=function(t){function e(e,n){var r=t.call(this,e,p.Group.Modal,p.Group.Modal)||this;return r.set(n,!1),r}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{footer:this.footer,id:this.id})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,path:this.path,size:this.size,title:this.title,url:this.url}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){var n=this;void 0===e&&(e=!0);var r=c.getMergedProps(this.options,t),o=r.title,i=r.footer,s=r.path,u=r.url,p=r.size;return this.title=o,this.url=u,this.path=s,this.size=p,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,(function(){n.dispatch(a.UPDATE)})),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,(function(){n.dispatch(a.UPDATE)})),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case a.OPEN:this.app.dispatch(h(this.payload));break;case a.CLOSE:this.close();break;case a.UPDATE:this.app.dispatch(y(this.payload));break;case a.DATA:this.app.dispatch(A(e||{}))}return this},e}(E);e.ModalIframe=v,e.create=function(t,e){return P(e)?new v(t,e):new O(t,e)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.History=e.replace=e.push=e.Action=void 0;var a,s=n(0),u=n(1);function c(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.PUSH})}function p(t){return s.actionWrapper({payload:t,group:u.Group.Navigation,type:a.REPLACE})}!function(t){t.PUSH="APP::NAVIGATION::HISTORY::PUSH",t.REPLACE="APP::NAVIGATION::HISTORY::REPLACE"}(a=e.Action||(e.Action={})),e.push=c,e.replace=p;var d=function(t){function e(e){return t.call(this,e,"History",u.Group.Navigation)||this}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t,e){var n=i(i({},this.payload),{path:e});switch(t){case a.PUSH:this.app.dispatch(c(n));break;case a.REPLACE:this.app.dispatch(p(n))}return this},e}(s.ActionSet);e.History=d,e.create=function(t){return new d(t)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ResourcePicker=e.update=e.close=e.cancel=e.open=e.select=e.ActionVerb=e.ResourceType=e.ProductStatus=e.ProductVariantInventoryManagement=e.ProductVariantInventoryPolicy=e.WeightUnit=e.FulfillmentServiceType=e.CollectionSortOrder=e.Action=void 0;var a,s,u,c=n(0),p=n(1);function d(t){return c.actionWrapper({payload:t,group:p.Group.ResourcePicker,type:a.SELECT})}function f(t){return c.actionWrapper({payload:t,group:p.Group.ResourcePicker,type:a.OPEN})}function h(t){return c.actionWrapper({payload:t,group:p.Group.ResourcePicker,type:a.CANCEL})}function l(t){return c.actionWrapper({payload:t,group:p.Group.ResourcePicker,type:a.UPDATE})}!function(t){t.OPEN="APP::RESOURCE_PICKER::OPEN",t.SELECT="APP::RESOURCE_PICKER::SELECT",t.CLOSE="APP::RESOURCE_PICKER::CLOSE",t.UPDATE="APP::RESOURCE_PICKER::UPDATE",t.CANCEL="APP::RESOURCE_PICKER::CANCEL"}(a=e.Action||(e.Action={})),function(t){t.Manual="MANUAL",t.BestSelling="BEST_SELLING",t.AlphaAsc="ALPHA_ASC",t.AlphaDesc="ALPHA_DESC",t.PriceDesc="PRICE_DESC",t.PriceAsc="PRICE_ASC",t.CreatedDesc="CREATED_DESC",t.Created="CREATED"}(e.CollectionSortOrder||(e.CollectionSortOrder={})),function(t){t.GiftCard="GIFT_CARD",t.Manual="MANUAL",t.ThirdParty="THIRD_PARTY"}(e.FulfillmentServiceType||(e.FulfillmentServiceType={})),function(t){t.Kilograms="KILOGRAMS",t.Grams="GRAMS",t.Pounds="POUNDS",t.Ounces="OUNCES"}(e.WeightUnit||(e.WeightUnit={})),function(t){t.Deny="DENY",t.Continue="CONTINUE"}(e.ProductVariantInventoryPolicy||(e.ProductVariantInventoryPolicy={})),function(t){t.Shopify="SHOPIFY",t.NotManaged="NOT_MANAGED",t.FulfillmentService="FULFILLMENT_SERVICE"}(e.ProductVariantInventoryManagement||(e.ProductVariantInventoryManagement={})),function(t){t.Active="ACTIVE",t.Archived="ARCHIVED",t.Draft="DRAFT"}(e.ProductStatus||(e.ProductStatus={})),function(t){t.Product="product",t.ProductVariant="variant",t.Collection="collection"}(s=e.ResourceType||(e.ResourceType={})),function(t){t.Add="add",t.Select="select"}(u=e.ActionVerb||(e.ActionVerb={})),e.select=d,e.open=f,e.cancel=h,e.close=function(t){return c.actionWrapper({payload:t,group:p.Group.ResourcePicker,type:a.CANCEL})},e.update=l;var y=function(t){function e(e,n,r){var o=t.call(this,e,p.Group.ResourcePicker,p.Group.ResourcePicker)||this;return o.initialSelectionIds=[],o.selection=[],o.resourceType=r,o.set(n,!1),o}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{id:this.id,resourceType:this.resourceType})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){var t={initialQuery:this.initialQuery,selectMultiple:this.selectMultiple,initialSelectionIds:this.initialSelectionIds,showHidden:this.showHidden,actionVerb:this.actionVerb};return this.resourceType===s.Product?i(i({},t),{showVariants:this.showVariants,showDraft:this.showDraft,showArchived:this.showArchived,showDraftBadge:this.showDraftBadge,showArchivedBadge:this.showArchivedBadge}):t},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),r=n.initialQuery,o=n.initialSelectionIds,i=void 0===o?[]:o,a=n.showHidden,s=void 0===a||a,p=n.showVariants,d=void 0===p||p,f=n.showDraft,h=void 0===f||f,l=n.showArchived,y=void 0===l||l,A=n.showDraftBadge,P=void 0!==A&&A,E=n.showArchivedBadge,O=void 0!==E&&E,v=n.selectMultiple,_=void 0===v||v,b=n.actionVerb,T=void 0===b?u.Add:b;return this.initialQuery=r,this.initialSelectionIds=i,this.showHidden=s,this.showVariants=d,this.showDraft=h,this.showArchived=y,this.showDraftBadge=P,this.showArchivedBadge=O,this.selectMultiple=_,this.actionVerb=T,e&&this.update(),this},e.prototype.dispatch=function(t,e){return t===a.OPEN?this.open():t===a.UPDATE?this.update():t===a.CLOSE||t===a.CANCEL?this.cancel():t===a.SELECT&&(this.selection=e,this.app.dispatch(d({id:this.id,selection:this.selection}))),this},e.prototype.update=function(){this.app.dispatch(l(this.payload))},e.prototype.open=function(){this.app.dispatch(f(this.payload))},e.prototype.cancel=function(){this.app.dispatch(h({id:this.id}))},e.prototype.close=function(){this.cancel()},e}(c.ActionSet);e.ResourcePicker=y,e.create=function(t,e){var n=e.resourceType,r=e.options;return new y(t,void 0===r?{}:r,n)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Scanner=e.Action=void 0;var i,a=n(0),s=n(1);!function(t){t.OPEN_CAMERA="APP::SCANNER::OPEN::CAMERA",t.CAPTURE="APP::SCANNER::CAPTURE"}(i=e.Action||(e.Action={}));var u=function(t){function e(e,n){return t.call(this,e,s.Group.Scanner,s.Group.Scanner,n?n.id:void 0)||this}return o(e,t),e.prototype.dispatch=function(t){switch(t){case i.OPEN_CAMERA:this.dispatchScannerAction(i.OPEN_CAMERA)}return this},e.prototype.dispatchScannerAction=function(t){this.app.dispatch(a.actionWrapper({type:t,group:s.Group.Scanner,payload:{id:this.id}}))},e}(a.ActionSet);e.Scanner=u,e.create=function(t,e){return new u(t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.respond=e.request=e.Action=void 0;var r,o=n(0),i=n(1);!function(t){t.REQUEST="APP::SESSION_TOKEN::REQUEST",t.RESPOND="APP::SESSION_TOKEN::RESPOND"}(r=e.Action||(e.Action={})),e.request=function(){return o.actionWrapper({group:i.Group.SessionToken,type:r.REQUEST})},e.respond=function(t){return o.actionWrapper({payload:t,group:i.Group.SessionToken,type:r.RESPOND})}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.TitleBar=e.update=e.clickBreadcrumb=e.clickActionButton=e.Action=void 0;var a,s=n(4),u=n(7),c=n(42),p=n(5),d=n(0),f=n(1);!function(t){t.UPDATE="APP::TITLEBAR::UPDATE",t.BUTTON_CLICK="APP::TITLEBAR::BUTTONS::BUTTON::CLICK",t.BUTTON_UPDATE="APP::TITLEBAR::BUTTONS::BUTTON::UPDATE",t.BUTTON_GROUP_UPDATE="APP::TITLEBAR::BUTTONS::BUTTONGROUP::UPDATE",t.BREADCRUMBS_CLICK="APP::TITLEBAR::BREADCRUMBS::BUTTON::CLICK",t.BREADCRUMBS_UPDATE="APP::TITLEBAR::BREADCRUMBS::BUTTON::UPDATE"}(a=e.Action||(e.Action={}));var h={group:f.Group.TitleBar,subgroups:["Buttons"]},l={group:f.Group.TitleBar,subgroups:["Breadcrumbs"],type:f.ComponentType.Button};function y(t){return d.actionWrapper({payload:t,group:f.Group.TitleBar,type:a.UPDATE})}e.clickActionButton=function(t,e){var n=f.ComponentType.Button,r=i({id:t,type:n},h);return s.clickButton(f.Group.TitleBar,r,e)},e.clickBreadcrumb=function(t,e){var n=i({id:t},l);return s.clickButton(f.Group.TitleBar,n,e)},e.update=y;var A=function(t){function e(e,n){var r=t.call(this,e,f.Group.TitleBar,f.Group.TitleBar)||this;return r.set(n),r}return o(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{breadcrumbs:this.breadcrumbsOption,buttons:this.buttonsOptions,title:this.title}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{breadcrumbs:this.breadcrumb,buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=d.getMergedProps(this.options,t),r=n.title,o=n.buttons,i=n.breadcrumbs;return this.title=r,this.setBreadcrumbs(i),this.setPrimaryButton(o?o.primary:void 0),this.setSecondaryButton(o?o.secondary:void 0),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(y(this.payload))}return this},e.prototype.getButton=function(t,e,n){return t instanceof u.ButtonGroup?c.getGroupedButton(this,t,e,n):p.getSingleButton(this,t,e,n)},e.prototype.updatePrimaryButton=function(t){this.primary&&d.updateActionFromPayload(this.primary,t)&&this.dispatch(a.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find((function(e){return e.id===t.id}));if(e){(u.isGroupedButtonPayload(t),d.updateActionFromPayload(e,t))&&this.dispatch(a.UPDATE)}}},e.prototype.updateBreadcrumbButton=function(t){this.breadcrumb&&d.updateActionFromPayload(this.breadcrumb,t)&&this.dispatch(a.UPDATE)},e.prototype.setPrimaryButton=function(t){this.primaryOptions=this.getChildButton(t,this.primaryOptions),this.primary=this.primaryOptions?this.getButton(this.primaryOptions,h.subgroups,this.updatePrimaryButton):void 0},e.prototype.setSecondaryButton=function(t){var e=this,n=t||[],r=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(n,r),this.secondary=this.secondaryOptions?this.secondaryOptions.map((function(t){return e.getButton(t,h.subgroups,e.updateSecondaryButtons)})):void 0},e.prototype.setBreadcrumbs=function(t){this.breadcrumbsOption=this.getChildButton(t,this.breadcrumbsOption),this.breadcrumb=this.breadcrumbsOption?this.getButton(this.breadcrumbsOption,l.subgroups,this.updateBreadcrumbButton):void 0},e.prototype.getChildButton=function(t,e){var n=t?[t]:[],r=e?[e]:[],o=this.getUpdatedChildActions(n,r);return o?o[0]:void 0},e}(d.ActionSetWithChildren);e.TitleBar=A,e.create=function(t,e){return new A(t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getGroupedButton=void 0;var r=n(7);e.getGroupedButton=function(t,e,n,o){t.addChild(e,t.group,n);var i=e.id,a=e.label,s=e.disabled,u=e.buttons;return t.subscribeToChild(e,r.Action.UPDATE,o),{id:i,label:a,buttons:u,disabled:s}}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ContextualSaveBar=e.discard=e.save=e.hide=e.show=e.Action=void 0;var a,s=n(0),u=n(1);function c(t,e){return s.actionWrapper({group:u.Group.ContextualSaveBar,type:t,payload:e})}!function(t){t.DISCARD="APP::CONTEXTUAL_SAVE_BAR::DISCARD",t.SAVE="APP::CONTEXTUAL_SAVE_BAR::SAVE",t.SHOW="APP::CONTEXTUAL_SAVE_BAR::SHOW",t.HIDE="APP::CONTEXTUAL_SAVE_BAR::HIDE",t.UPDATE="APP::CONTEXTUAL_SAVE_BAR::UPDATE"}(a=e.Action||(e.Action={})),e.show=function(t){return c(a.SHOW,t)},e.hide=function(t){return c(a.HIDE,t)},e.save=function(t){return c(a.SAVE,t)},e.discard=function(t){return c(a.DISCARD,t)};var p=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e,u.Group.ContextualSaveBar,u.Group.ContextualSaveBar)||this;return r.options=n,r.set(n,!1),r}return o(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=s.getMergedProps(this.options,t);return this.options=n,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){return this.app.dispatch(c(t,this.payload)),this},e}(s.ActionSet);e.ContextualSaveBar=p,e.create=function(t,e){return new p(t,e)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Share=e.Action=void 0;var a,s=n(1),u=n(0);!function(t){t.SHOW="APP::SHARE::SHOW",t.CLOSE="APP::SHARE::CLOSE"}(a=e.Action||(e.Action={}));var c=function(t){function e(e){return t.call(this,e,s.Group.Share,s.Group.Share)||this}return o(e,t),e.prototype.dispatch=function(t,e){switch(t){case a.SHOW:this.dispatchShareAction(a.SHOW,e);break;default:throw"Action: "+t+" not supported"}return this},e.prototype.dispatchShareAction=function(t,e){this.app.dispatch(u.actionWrapper({type:t,group:s.Group.Share,payload:i({id:this.id},e)}))},e}(u.ActionSet);e.Share=c,e.create=function(t){return new c(t)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.NavigationMenu=e.update=e.Action=void 0;var a,s=n(9),u=n(0),c=n(1),p=["Navigation_Menu"];function d(t){return u.actionWrapper({payload:t,group:c.Group.Menu,type:a.UPDATE})}!function(t){t.UPDATE="APP::MENU::NAVIGATION_MENU::UPDATE",t.LINK_UPDATE="APP::MENU::NAVIGATION_MENU::LINK::UPDATE"}(a=e.Action||(e.Action={})),e.update=d;var f=function(t){function e(e,n){var r=t.call(this,e,"Navigation_Menu",c.Group.Menu)||this;return r.items=[],r.set(n),r}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{items:this.itemsOptions,active:this.activeOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{active:this.active,items:this.items,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=u.getMergedProps(this.options,t),r=n.items,o=n.active;return this.setItems(r),this.activeOptions=o,this.active=o&&o.id,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(d(this.payload))}return this},e.prototype.updateItem=function(t){if(this.items){var e=this.items.find((function(e){return e.id===t.id}));e&&u.updateActionFromPayload(e,t)&&this.dispatch(a.UPDATE)}},e.prototype.setItems=function(t){var e=this,n=t||[],r=this.itemsOptions||[];this.itemsOptions=this.getUpdatedChildActions(n,r),this.items=this.itemsOptions?this.itemsOptions.map((function(t){return e.addChild(t,e.group,p),e.subscribeToChild(t,s.Action.UPDATE,e.updateItem),t.payload})):[]},e}(u.ActionSetWithChildren);e.NavigationMenu=f,e.create=function(t,e){return new f(t,e)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ChannelMenu=e.update=e.Action=void 0;var a,s=n(9),u=n(0),c=n(1),p=["Channel_Menu"];function d(t){return u.actionWrapper({payload:t,group:c.Group.Menu,type:a.UPDATE})}!function(t){t.UPDATE="APP::MENU::CHANNEL_MENU::UPDATE",t.LINK_UPDATE="APP::MENU::CHANNEL_MENU::LINK::UPDATE"}(a=e.Action||(e.Action={})),e.update=d;var f=function(t){function e(e,n){var r=t.call(this,e,"Channel_Menu",c.Group.Menu)||this;return r.items=[],r.set(n),r}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{items:this.itemsOptions,active:this.activeOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{active:this.active,items:this.items,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=u.getMergedProps(this.options,t),r=n.items,o=n.active;return this.setItems(r),this.activeOptions=o,this.active=o&&o.id,e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(d(this.payload))}return this},e.prototype.updateItem=function(t){if(this.items){var e=this.items.find((function(e){return e.id===t.id}));e&&u.updateActionFromPayload(e,t)&&this.dispatch(a.UPDATE)}},e.prototype.setItems=function(t){var e=this,n=t||[],r=this.itemsOptions||[];this.itemsOptions=this.getUpdatedChildActions(n,r),this.items=this.itemsOptions?this.itemsOptions.map((function(t){return e.addChild(t,e.group,p),e.subscribeToChild(t,s.Action.UPDATE,e.updateItem),t.payload})):[]},e}(u.ActionSetWithChildren);e.ChannelMenu=f,e.create=function(t,e){return new f(t,e)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Pos=e.close=e.Action=void 0;var i,a=n(0),s=n(1);function u(){return a.actionWrapper({group:s.Group.Pos,type:i.CLOSE})}!function(t){t.CLOSE="APP::POS::CLOSE",t.LOCATION_UPDATE="APP::POS::LOCATION::UPDATE",t.USER_UPDATE="APP::POS::USER::UPDATE",t.DEVICE_UPDATE="APP::POS::DEVICE::UPDATE"}(i=e.Action||(e.Action={})),e.close=u;var c=function(t){function e(e){return t.call(this,e,s.Group.Pos,s.Group.Pos)||this}return o(e,t),e.prototype.dispatch=function(t){switch(t){case i.CLOSE:this.app.dispatch(u())}return this},e}(a.ActionSet);e.Pos=c,e.create=function(t){return new c(t)}},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.MarketingExternalActivityTopBar=e.update=e.clickActionButton=e.MarketingActivityStatusBadgeType=e.Action=void 0;var a,s=n(4),u=n(5),c=n(0),p=n(1);!function(t){t.UPDATE="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::UPDATE",t.BUTTON_CLICK="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::BUTTONS::BUTTON::CLICK",t.BUTTON_UPDATE="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::BUTTONS::BUTTON::UPDATE"}(a=e.Action||(e.Action={})),function(t){t.Default="DEFAULT",t.Success="SUCCESS",t.Attention="ATTENTION",t.Warning="WARNING",t.Info="INFO"}(e.MarketingActivityStatusBadgeType||(e.MarketingActivityStatusBadgeType={}));var d={group:p.Group.MarketingExternalActivityTopBar,subgroups:["Buttons"]};function f(t){return c.actionWrapper({payload:t,group:p.Group.MarketingExternalActivityTopBar,type:a.UPDATE})}e.clickActionButton=function(t,e){var n=p.ComponentType.Button,r=i({id:t,type:n},d);return s.clickButton(p.Group.MarketingExternalActivityTopBar,r,e)},e.update=f;var h=function(t){function e(e,n){var r=t.call(this,e,p.Group.MarketingExternalActivityTopBar,p.Group.MarketingExternalActivityTopBar)||this;return r.set(n),r}return o(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{title:this.title,status:this.status,saving:this.saving,saved:this.saved,buttons:this.buttonsOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),r=n.title,o=n.buttons,i=n.saved,s=n.saving,u=n.status;return this.title=r,this.saving=s,this.saved=i,this.status=u,this.setPrimaryButton(o?o.primary:void 0),this.setSecondaryButtons(o?o.secondary:void 0),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:this.app.dispatch(f(this.payload))}return this},e.prototype.getButton=function(t,e,n){return u.getSingleButton(this,t,e,n)},e.prototype.updatePrimaryButton=function(t){this.primary&&c.updateActionFromPayload(this.primary,t)&&this.dispatch(a.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find((function(e){return e.id===t.id}));if(e)c.updateActionFromPayload(e,t)&&this.dispatch(a.UPDATE)}},e.prototype.setPrimaryButton=function(t){this.primaryOptions=this.getChildButton(t,this.primaryOptions),this.primary=this.primaryOptions?this.getButton(this.primaryOptions,d.subgroups,this.updatePrimaryButton):void 0},e.prototype.setSecondaryButtons=function(t){var e=this,n=t||[],r=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(n,r),this.secondary=this.secondaryOptions?this.secondaryOptions.map((function(t){return e.getButton(t,d.subgroups,e.updateSecondaryButtons)})):void 0},e.prototype.updateSaving=function(t){this.saving=t,this.dispatch(a.UPDATE)},e.prototype.updateSaved=function(t){this.saved=t,this.dispatch(a.UPDATE)},e.prototype.updateStatus=function(t){this.status=t,this.dispatch(a.UPDATE)},e.prototype.getChildButton=function(t,e){var n=t?[t]:[],r=e?[e]:[],o=this.getUpdatedChildActions(n,r);return o?o[0]:void 0},e}(c.ActionSetWithChildren);e.MarketingExternalActivityTopBar=h,e.create=function(t,e){return new h(t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fullPageLoad=e.skeletonPageLoad=e.Action=void 0;var r,o=n(1),i=n(0);!function(t){t.SKELETON_PAGE_LOAD="APP::PERFORMANCE::SKELETON_PAGE_LOAD",t.FULL_PAGE_LOAD="APP::PERFORMANCE::FULL_PAGE_LOAD"}(r=e.Action||(e.Action={})),e.skeletonPageLoad=function(){return i.actionWrapper({group:o.Group.Performance,type:r.SKELETON_PAGE_LOAD})},e.fullPageLoad=function(){return i.actionWrapper({group:o.Group.Performance,type:r.FULL_PAGE_LOAD})}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0});var i=n(10);Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i.createApp}}),o(n(18),e),o(n(10),e)},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],p=!1,d=-1;function f(){p&&u&&(p=!1,u.length?c=u.concat(c):d=-1,c.length&&h())}function h(){if(!p){var t=s(f);p=!0;for(var e=c.length;e;){for(u=c,c=[];++d<e;)u&&u[d].run();d=-1,e=c.length}u=null,p=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function l(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new l(t,e)),1!==c.length||p||s(h)},l.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.serverAppBridge=void 0;var r=n(3),o=function(){};e.serverAppBridge={dispatch:function(){return{}},error:function(){return o},featuresAvailable:function(){return Promise.reject(r.fromAction("Feature detection is only available on the client side.",r.AppActionType.WINDOW_UNDEFINED))},getState:function(){return Promise.reject(r.fromAction("State is only available on the client side.",r.AppActionType.WINDOW_UNDEFINED))},localOrigin:"",subscribe:function(){return o}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.handleAppPrint=void 0;var r=n(20);function o(){r.getWindow()&&window.print()}function i(){var t=function(){var t=r.getWindow();if(t&&t.document&&t.document.body){var e=window.document.createElement("input");return e.style.display="none",window.document.body.appendChild(e),e}}();t&&(t.select(),o(),t.remove())}e.handleAppPrint=function(){navigator.userAgent.indexOf("iOS")>=0?i():o()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),o=function(){function t(){this.map={}}return t.prototype.set=function(t,e){this.map.hasOwnProperty(t)||(this.map[t]=[]);var n={handler:e,remove:function(){}},o=r.addAndRemoveFromCollection(this.map[t],n);return n={handler:e,remove:o},o},t.prototype.get=function(t){var e=this.map[t];return e?e.map((function(t){return t.handler})):void 0},t.prototype.run=function(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];var i=0,a=this.get(t)||[];function s(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=a[i++];return o?o(s).apply(n,t):e.apply(n,t)}return s.apply(n,r)},t}();e.default=o}])}));
\No newline at end of file