Socket
Socket
Sign inDemoInstall

@duely/client

Package Overview
Dependencies
38
Maintainers
1
Versions
193
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.29 to 0.4.30

2

dist/index.js

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@apollo/client"),require("@duely/core"),require("react")):"function"==typeof define&&define.amd?define(["@apollo/client","@duely/core","react"],t):"object"==typeof exports?exports["@duely/client"]=t(require("@apollo/client"),require("@duely/core"),require("react")):e["@duely/client"]=t(e["@apollo/client"],e["@duely/core"],e.react)}(this,(function(e,t,n){return(()=>{var r={329:(e,t,n)=>{e.exports=n(516).Observable},516:(e,t)=>{"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}t.Observable=void 0;var u=function(){return"function"==typeof Symbol},i=function(e){return u()&&Boolean(Symbol[e])},c=function(e){return i(e)?Symbol[e]:"@@"+e};u()&&!i("observable")&&(Symbol.observable=Symbol("observable"));var a=c("iterator"),l=c("observable"),s=c("species");function d(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function f(e){var t=e.constructor;return void 0!==t&&null===(t=t[s])&&(t=void 0),void 0!==t?t:O}function v(e){return e instanceof O}function p(e){p.log?p.log(e):setTimeout((function(){throw e}))}function y(e){Promise.resolve().then((function(){try{e()}catch(e){p(e)}}))}function _(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=d(t,"unsubscribe");n&&n.call(t)}}catch(e){p(e)}}function m(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,n){e._state="running";var r=e._observer;try{var o=d(r,t);switch(t){case"next":o&&o.call(r,n);break;case"error":if(m(e),!o)throw n;o.call(r,n);break;case"complete":m(e),o&&o.call(r)}}catch(e){p(e)}"closed"===e._state?_(e):"running"===e._state&&(e._state="ready")}function b(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void y((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(g(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void g(e,t,n);e._queue.push({type:t,value:n})}}var h=function(){function e(t,r){n(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var o=new w(this);try{this._cleanup=r.call(void 0,o)}catch(e){o.error(e)}"initializing"===this._state&&(this._state="ready")}return o(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(m(this),_(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),w=function(){function e(t){n(this,e),this._subscription=t}return o(e,[{key:"next",value:function(e){b(this._subscription,"next",e)}},{key:"error",value:function(e){b(this._subscription,"error",e)}},{key:"complete",value:function(){b(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),O=function(){function e(t){if(n(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return o(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new h(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var o=t.subscribe({next:function(t){try{e(t,u)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function u(){o.unsubscribe(),n()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=f(this),r=arguments.length>1,o=!1,u=arguments[1],i=u;return new n((function(n){return t.subscribe({next:function(t){var u=!o;if(o=!0,!u||r)try{i=e(i,t)}catch(e){return n.error(e)}else i=t},error:function(e){n.error(e)},complete:function(){if(!o&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(i),n.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=f(this);return new o((function(t){var r,u=0;return function e(i){r=i.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){u===n.length?(r=void 0,t.complete()):e(o.from(n[u++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=f(this);return new n((function(r){var o=[],u=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var u=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=o.indexOf(u);e>=0&&o.splice(e,1),i()}});o.push(u)},error:function(e){r.error(e)},complete:function(){i()}});function i(){u.closed&&0===o.length&&r.complete()}return function(){o.forEach((function(e){return e.unsubscribe()})),u.unsubscribe()}}))}},{key:l,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=d(t,l);if(r){var o=r.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return v(o)&&o.constructor===n?o:new n((function(e){return o.subscribe(e)}))}if(i("iterator")&&(r=d(t,a)))return new n((function(e){y((function(){if(!e.closed){var n=!0,o=!1,u=void 0;try{for(var i,c=r.call(t)[Symbol.iterator]();!(n=(i=c.next()).done);n=!0){var a=i.value;if(e.next(a),e.closed)return}}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){y((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o="function"==typeof this?this:e;return new o((function(e){y((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))}},{key:s,get:function(){return this}}]),e}();t.Observable=O,u()&&Object.defineProperty(O,Symbol("extensions"),{value:{symbol:l,hostReportError:p},configurable:!0})},74:t=>{"use strict";t.exports=e},620:e=>{"use strict";e.exports=t},297:e=>{"use strict";e.exports=n}},o={};function u(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,u),n.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";u.r(i),u.d(i,{agencies_Q:()=>W,agency_Q:()=>H,agency_customers_Q:()=>X,agency_pages_Q:()=>Ce,agency_settings_Q:()=>Se,agency_stripe_account_Q:()=>Y,agency_stripe_account_balance_Q:()=>G,agency_stripe_account_balance_transactions_Q:()=>J,agency_stripe_account_bank_accounts_Q:()=>Ee,agency_stripe_account_payment_intents_Q:()=>K,agency_stripe_account_update_url_Q:()=>$,agency_subscription_plan_Q:()=>Ae,calculate_transaction_fee_Q:()=>Re,client:()=>I,count_customers_Q:()=>te,count_orders_Q:()=>Oe,count_products_Q:()=>ce,countries_Q:()=>L,country_spec_Q:()=>R,create_agency_M:()=>Xe,create_bank_account_M:()=>et,create_credential_M:()=>_t,create_customer_M:()=>it,create_integration_M:()=>gt,create_integration_config_M:()=>ht,create_page_block_M:()=>vt,create_price_M:()=>lt,create_product_M:()=>rt,credential_Q:()=>se,credential_type_Q:()=>fe,credential_types_Q:()=>ve,credentials_Q:()=>de,current_agency_Q:()=>je,current_agency_extended_Q:()=>xe,current_agency_stripe_account_update_url_Q:()=>Pe,current_subdomain_Q:()=>oe,current_user_Q:()=>F,current_user_agencies_Q:()=>ne,customer_Q:()=>Z,customers_Q:()=>ee,delete_bank_account_M:()=>nt,delete_customer_M:()=>at,delete_page_block_M:()=>yt,delete_product_M:()=>ut,form_field_Q:()=>ae,form_fields_Q:()=>le,image_Q:()=>z,images_Q:()=>V,integration_Q:()=>pe,integration_config_Q:()=>_e,integration_configs_Q:()=>me,integration_type_Q:()=>ge,integration_types_Q:()=>be,integrations_Q:()=>ye,log_in_M:()=>We,log_out_M:()=>Ye,mutate:()=>Ve,order_Q:()=>he,order_item_Q:()=>qe,order_items_Q:()=>De,orders_Q:()=>we,page_Q:()=>Me,page_block_Q:()=>Te,page_block_definition_Q:()=>Be,page_block_definition_by_name_Q:()=>Le,page_by_url_Q:()=>Ie,page_definition_Q:()=>Ue,page_definition_by_name_Q:()=>Ne,page_definition_by_url_path_Q:()=>Fe,product_Q:()=>ue,product_and_agency_from_url_parts_Q:()=>ke,product_settings_Q:()=>Qe,products_Q:()=>ie,query:()=>N,start_password_reset_M:()=>Je,start_sign_up_M:()=>Ke,subdomain_public_Q:()=>re,update_agency_M:()=>Ze,update_agency_settings_M:()=>st,update_bank_account_M:()=>tt,update_credential_M:()=>mt,update_customer_M:()=>ct,update_integration_M:()=>bt,update_integration_config_M:()=>wt,update_page_M:()=>ft,update_page_block_M:()=>pt,update_product_M:()=>ot,update_product_settings_M:()=>dt,useMutation:()=>jt,useQuery:()=>U,verify_password_reset_M:()=>$e,verify_sign_up_M:()=>Ge});var e=u(74),t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};Object.create,Object.create;var c="Invariant Violation",a=Object.setPrototypeOf,l=void 0===a?function(e,t){return e.__proto__=t,e}:a,s=function(e){function t(n){void 0===n&&(n=c);var r=e.call(this,"number"==typeof n?c+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=c,l(r,t.prototype),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error);function d(e,t){if(!e)throw new s(t)}var f,v=["log","warn","error","silent"],p=v.indexOf("log");function y(e){return function(){if(v.indexOf(e)>=p)return console[e].apply(console,arguments)}}(f=d||(d={})).log=y("log"),f.warn=y("warn"),f.error=y("error");var _,m=u(329),g=u.n(m);function b(e,t){return t?t(e):g().of()}function h(e){return"function"==typeof e?new O(e):e}function w(e){return e.request.length<=1}n((function(e,t){var n=_.call(this,e)||this;return n.link=t,n}),_=Error);var O=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return g().of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(h).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var o=h(n),u=h(r||new e(b));return w(o)&&w(u)?new e((function(e){return t(e)?o.request(e)||g().of():u.request(e)||g().of()})):new e((function(e,n){return t(e)?o.request(e,n)||g().of():u.request(e,n)||g().of()}))},e.execute=function(e,t){return e.request(function(e,t){var n=r({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=r(r({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return r({},n)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?t.query.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(t.indexOf(o)<0)throw new s(26)}return e}(t))))||g().of()},e.concat=function(t,n){var r=h(t);if(w(r))return r;var o=h(n);return w(o)?new e((function(e){return r.request(e,(function(e){return o.request(e)||g().of()}))||g().of()})):new e((function(e,t){return r.request(e,(function(e){return o.request(e,t)||g().of()}))||g().of()}))},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(b)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw new s(21)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}();function q(e){return new O((function(t,n){return new(g())((function(r){var o,u,i;try{o=n(t).subscribe({next:function(o){o.errors&&(i=e({graphQLErrors:o.errors,response:o,operation:t,forward:n}))?u=i.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.next(o)},error:function(o){(i=e({operation:t,networkError:o,graphQLErrors:o&&o.result&&o.result.errors,forward:n}))?u=i.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.error(o)},complete:function(){i||r.complete.bind(r)()}})}catch(o){e({networkError:o,operation:t,forward:n}),r.error(o)}return function(){o&&o.unsubscribe(),u&&o.unsubscribe()}}))}))}!function(e){function t(t){var n=e.call(this)||this;return n.link=q(t),n}n(t,e),t.prototype.request=function(e,t){return this.link.request(e,t)}}(O);var D=u(620),k=function(e,t,n,r){return new(n||(n=Promise))((function(o,u){function i(e){try{a(r.next(e))}catch(e){u(e)}}function c(e){try{a(r.throw(e))}catch(e){u(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,c)}a((r=r.apply(e,t||[])).next())}))};const j="undefined"==typeof window;let x=j?()=>null:()=>(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("user-jwt"))||(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("visitor-jwt"));const P=new e.InMemoryCache({typePolicies:{}}),S=new e.HttpLink({uri:"https://api.duely.app/graphql"});let Q=null;const C=S,A=(E=(t,{headers:n})=>k(void 0,void 0,void 0,(function*(){let t=yield function(){return k(this,void 0,void 0,(function*(){let t=x();return t||(Q||(Q=(0,e.toPromise)(e.ApolloLink.execute(S,{query:D.BeginVisitDocument})).then((({data:n})=>k(this,void 0,void 0,(function*(){if(!(null==n?void 0:n.begin_visit.success))throw Error(null==n?void 0:n.begin_visit.message);{const r=n.begin_visit.jwt;if(j){const{data:n}=yield(0,e.toPromise)(e.ApolloLink.execute(S,{query:D.LogInDocument,variables:{email_address:"serviceaccount@duely.app",password:process.env.DUELY_SERVICE_ACCOUNT_PASSWORD},context:{headers:{authorization:`Bearer ${r}`}}}));(null==n?void 0:n.log_in.success)?(t=n.log_in.jwt,x=()=>t):console.error(null==n?void 0:n.log_in.message)}else localStorage.setItem("visitor-jwt",r)}}))))),yield Q,x())}))}();return t?{headers:Object.assign(Object.assign({},n),{authorization:`Bearer ${t}`})}:{}})),new O((function(e,t){var n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,[]);return new(g())((function(r){var o,u=!1;return Promise.resolve(n).then((function(t){return E(0,e.getContext())})).then(e.setContext).then((function(){u||(o=t(e).subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}))})).catch(r.error.bind(r)),function(){u=!0,o&&o.unsubscribe()}}))})));var E;const M=q((({graphQLErrors:e,networkError:t,operation:n,forward:r})=>{var o;if(e)for(let t of e)switch(console.log(t),null===(o=t.extensions)||void 0===o?void 0:o.code){case"UNAUTHENTICATED":return j||(localStorage.removeItem("user-jwt"),localStorage.removeItem("visitor-jwt")),r(n)}})),I=new e.ApolloClient({ssrMode:j,link:e.ApolloLink.from([M,A,C]),cache:P,connectToDevTools:!1});var T=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function U(t,n,r){const{query:o,result:u,variables:i}=t,c=T(t,["query","result","variables"]),a=(0,e.useQuery)(o,Object.assign(Object.assign({variables:Object.assign(Object.assign({},i),n)},c),r)),{data:l,networkStatus:s,loading:d}=a,f=T(a,["data","networkStatus","loading"]),v=s?s<7:d,p=l&&u(l);return Object.assign({data:p,loading:v,initialLoading:d},f)}var B=u(297);function N(e,t,n){return r=this,o=void 0,i=function*(){const{result:r,variables:o}=e,u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["result","variables"]),i=Object.assign(Object.assign({},o),t),{data:c}=yield I.query(Object.assign(Object.assign({variables:i},u),n));return r(c)},new((u=void 0)||(u=Promise))((function(e,t){function n(e){try{a(i.next(e))}catch(e){t(e)}}function c(e){try{a(i.throw(e))}catch(e){t(e)}}function a(t){var r;t.done?e(t.value):(r=t.value,r instanceof u?r:new u((function(e){e(r)}))).then(n,c)}a((i=i.apply(r,o||[])).next())}));var r,o,u,i}const F={query:D.CurrentUserDocument,notifyOnNetworkStatusChange:!0,result:e=>null==e?void 0:e.current_user},L={query:D.CountriesDocument,result:e=>{var t;return null===(t=null==e?void 0:e.country_codes)||void 0===t?void 0:t.map((e=>D.CountryUtil.fromCode(e)))}},R={query:D.CountrySpecDocument,result:e=>null==e?void 0:e.country_spec},z={query:D.ImageDocument,result:e=>null==e?void 0:e.image},V={query:D.ImagesDocument,result:e=>null==e?void 0:e.images},H={query:D.AgencyDocument,result:e=>null==e?void 0:e.agency},W={query:D.AgenciesDocument,result:e=>null==e?void 0:e.agencies},Y={query:D.AgencyStripeAccountDocument,result:e=>{var t;return null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account}},$={query:D.AgencyStripeAccountUpdateUrlDocument,fetchPolicy:"no-cache",result:e=>{var t,n,r;return null===(r=null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.account_update_url)||void 0===r?void 0:r.url}},G={query:D.AgencyStripeAccountBalanceDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.balance}},J={query:D.AgencyStripeAccountBalanceTransactionsDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.balance_transactions}},K={query:D.AgencyStripeAccountPaymentIntentsDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.payment_intents}},X={query:D.AgencyCustomersDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.customers}},Z={query:D.CustomerDocument,result:e=>null==e?void 0:e.customer},ee={query:D.CustomersDocument,result:e=>null==e?void 0:e.customers},te={query:D.CountCustomersDocument,result:e=>null==e?void 0:e.count_customers},ne={query:D.CurrentUserAgenciesDocument,notifyOnNetworkStatusChange:!0,result:e=>{var t;return null===(t=null==e?void 0:e.current_user)||void 0===t?void 0:t.memberships.map((e=>Object.assign(Object.assign({},e.subdomain.agency),{subdomain:e.subdomain})))}},re={query:D.SubdomainPublicDocument,result:e=>{var t;return null===(t=null==e?void 0:e.subdomains)||void 0===t?void 0:t[0]}},oe=Object.assign(Object.assign({},re),{variables:{subdomain_name:function(){var e,t;const n=new URL(window.location.href),r=n.hostname.toLowerCase();if("localhost"===r||function(e){var t=e.split(".").map((e=>parseInt(e,10)));return 4===t.length&&!t.some(isNaN)&&(10===t[0]||172===t[0]&&t[1]>=16&&t[1]<=31||192===t[0]&&168===t[1])}(r)){let r=null!==(t=null===(e=n.searchParams.get("subdomain"))||void 0===e?void 0:e.toLowerCase())&&void 0!==t?t:null;return null!==r?(sessionStorage.setItem("development-subdomain",r),r):sessionStorage.getItem("development-subdomain")}if("duely.app"!==r){if(r.endsWith(".duely.app"))return r.slice(0,-".duely.app".length);throw new Error("Not implemented.")}return null}()}}),ue={query:D.ProductDocument,result:e=>null==e?void 0:e.product},ie={query:D.ProductsDocument,result:e=>null==e?void 0:e.products},ce={query:D.CountProductsDocument,result:e=>null==e?void 0:e.count_products},ae={query:D.FormFieldDocument,result:e=>null==e?void 0:e.form_field},le={query:D.FormFieldsDocument,result:e=>null==e?void 0:e.form_fields},se={query:D.CredentialDocument,result:e=>null==e?void 0:e.credential},de={query:D.CredentialsDocument,result:e=>null==e?void 0:e.credentials},fe={query:D.CredentialTypeDocument,result:e=>null==e?void 0:e.credential_type},ve={query:D.CredentialTypesDocument,result:e=>null==e?void 0:e.credential_types},pe={query:D.IntegrationDocument,result:e=>null==e?void 0:e.integration},ye={query:D.IntegrationsDocument,result:e=>null==e?void 0:e.integrations},_e={query:D.IntegrationConfigDocument,result:e=>null==e?void 0:e.integration_config},me={query:D.IntegrationConfigsDocument,result:e=>null==e?void 0:e.integration_configs},ge={query:D.IntegrationTypeDocument,result:e=>null==e?void 0:e.integration_type},be={query:D.IntegrationTypesDocument,result:e=>null==e?void 0:e.integration_types},he={query:D.OrderDocument,result:e=>null==e?void 0:e.order},we={query:D.OrdersDocument,result:e=>null==e?void 0:e.orders},Oe={query:D.CountOrdersDocument,result:e=>null==e?void 0:e.count_orders},qe={query:D.OrderItemDocument,result:e=>null==e?void 0:e.order_item},De={query:D.OrderItemsDocument,result:e=>null==e?void 0:e.order_items},ke={query:D.ProductAndAgencyFromUrlPartsDocument,result:e=>{var t,n,r;return null===(r=null===(n=null===(t=null==e?void 0:e.subdomains)||void 0===t?void 0:t[0])||void 0===n?void 0:n.agency.products)||void 0===r?void 0:r[0]}},je=Object.assign(Object.assign({},oe),{query:D.SubdomainAgencyDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.subdomains)||void 0===t?void 0:t[0])||void 0===n?void 0:n.agency}}),xe=Object.assign(Object.assign({},oe),{query:D.SubdomainAgencyExtendedDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.subdomains)||void 0===t?void 0:t[0])||void 0===n?void 0:n.agency}}),Pe=Object.assign(Object.assign({},oe),{query:D.SubdomainAgencyStripeAccountUpdateUrlDocument,fetchPolicy:"no-cache",result:e=>{var t,n,r,o,u;return null===(u=null===(o=null===(r=null===(n=null===(t=null==e?void 0:e.subdomains)||void 0===t?void 0:t[0])||void 0===n?void 0:n.agency)||void 0===r?void 0:r.stripe_account)||void 0===o?void 0:o.account_update_url)||void 0===u?void 0:u.url}}),Se={query:D.AgencySettingsDocument,result:e=>{var t;return null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.settings}},Qe={query:D.ProductSettingsDocument,result:e=>{var t;return null===(t=null==e?void 0:e.product)||void 0===t?void 0:t.settings}},Ce={query:D.AgencyPagesDocument,result:e=>null==e?void 0:e.pages},Ae={query:D.AgencySubscriptionPlanDocument,result:e=>{var t;return null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.subscription_plan}},Ee={query:D.AgencyStripeAccountBankAccountsDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.bank_accounts}},Me={query:D.PageDocument,result:e=>null==e?void 0:e.page},Ie={query:D.PageByUrlDocument,result:e=>null==e?void 0:e.page_by_url},Te={query:D.PageBlockDocument,result:e=>null==e?void 0:e.page_block},Ue={query:D.PageDefinitionDocument,result:e=>null==e?void 0:e.page_definition},Be={query:D.PageBlockDefinitionDocument,result:e=>null==e?void 0:e.page_block_definition},Ne={query:D.PageDefinitionsByNameDocument,result:e=>{var t;return null===(t=null==e?void 0:e.page_definitions)||void 0===t?void 0:t[0]}},Fe={query:D.PageDefinitionByUrlPathDocument,result:e=>null==e?void 0:e.page_definition_by_url_path},Le={query:D.PageBlockDefinitionsByNameDocument,result:e=>{var t;return null===(t=null==e?void 0:e.page_block_definitions)||void 0===t?void 0:t[0]}},Re={query:D.CalculateTransactionFeeDocument,result:e=>{var t;return null===(t=null==e?void 0:e.subscription_plan)||void 0===t?void 0:t.calculate_fee}};var ze=function(e,t,n,r){return new(n||(n=Promise))((function(o,u){function i(e){try{a(r.next(e))}catch(e){u(e)}}function c(e){try{a(r.throw(e))}catch(e){u(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,c)}a((r=r.apply(e,t||[])).next())}))};function Ve(e,t,n){return ze(this,void 0,void 0,(function*(){const{result:r,after:o,variables:u}=e,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["result","after","variables"]),c=Object.assign(Object.assign({},u),t),{data:a}=yield I.mutate(Object.assign(Object.assign({variables:c},i),n)),l=a&&r(a);return o&&(yield o(I.cache,null!=l?l:null,c)),l}))}function He(e,t){t.definitions.forEach((t=>{"OperationDefinition"===t.kind&&t.selectionSet.selections.forEach((t=>{"Field"===t.kind&&e.evict({id:"ROOT_QUERY",fieldName:t.name.value})}))}))}const We={mutation:D.LogInDocument,result:e=>null==e?void 0:e.log_in,after(e,t){return ze(this,void 0,void 0,(function*(){(null==t?void 0:t.success)&&t.jwt&&("undefined"!=typeof window&&localStorage.setItem("user-jwt",t.jwt),yield I.resetStore())}))}},Ye={mutation:D.LogOutDocument,result:e=>null==e?void 0:e.log_out,after(e,t){return ze(this,void 0,void 0,(function*(){(null==t?void 0:t.success)&&("undefined"!=typeof window&&localStorage.removeItem("user-jwt"),yield I.resetStore())}))}},$e={mutation:D.VerifyPasswordResetDocument,result:e=>null==e?void 0:e.verify_password_reset},Ge={mutation:D.VerifySignUpDocument,result:e=>null==e?void 0:e.verify_sign_up},Je={mutation:D.StartPasswordResetDocument,result:e=>null==e?void 0:e.start_password_reset},Ke={mutation:D.StartSignUpDocument,result:e=>null==e?void 0:e.start_sign_up},Xe={mutation:D.CreateAgencyDocument,result:e=>null==e?void 0:e.create_agency},Ze={mutation:D.UpdateAgencyDocument,result:e=>null==e?void 0:e.update_agency},et={mutation:D.CreateBankAccountDocument,result:e=>null==e?void 0:e.create_bank_account,after(e,t){return ze(this,void 0,void 0,(function*(){(null==t?void 0:t.success)&&t.bank_account&&(He(e,Ee.query),e.gc())}))}},tt={mutation:D.UpdateBankAccountDocument,result:e=>null==e?void 0:e.update_bank_account},nt={mutation:D.DeleteBankAccountDocument,result:e=>null==e?void 0:e.delete_bank_account,after(e,t){return ze(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.bank_account)return;const n=e.identify(t.bank_account);e.evict({id:n}),He(e,Ee.query),e.gc()}))}},rt={mutation:D.CreateProductDocument,result:e=>null==e?void 0:e.create_product,after(e,t){return ze(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.product)return;const{product:n}=t;e.modify({id:e.identify(n.agency),fields:{products(t=[],{readField:r}){const o=e.writeFragment({data:n,fragment:D.ProductFragmentDoc,fragmentName:"product"});return t.some((e=>r("id",e)===n.id))?t:[...t,o]}}}),He(e,ie.query),He(e,ce.query),e.gc()}))}},ot={mutation:D.UpdateProductDocument,result:e=>null==e?void 0:e.update_product},ut={mutation:D.DeleteProductDocument,result:e=>null==e?void 0:e.delete_product,after(e,t){return ze(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.product)return;const n=e.identify(t.product);e.evict({id:n}),He(e,ie.query),He(e,ce.query),e.gc()}))}},it={mutation:D.CreateCustomerDocument,result:e=>null==e?void 0:e.create_customer,after(e,t){return ze(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.customer)return;const{customer:n}=t;e.modify({id:e.identify(n.stripe_account),fields:{customers(t=[],{readField:r}){const o=e.writeFragment({data:n,fragment:D.CustomerFragmentDoc,fragmentName:"customer"});return t.some((e=>r("id",e)===n.id))?t:[...t,o]}}}),He(e,ee.query),He(e,te.query),e.gc()}))}},ct={mutation:D.UpdateCustomerDocument,result:e=>null==e?void 0:e.update_customer},at={mutation:D.DeleteCustomerDocument,result:e=>null==e?void 0:e.delete_customer,after(e,t){return ze(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.customer)return;const n=e.identify(t.customer);e.evict({id:n}),He(e,ee.query),He(e,te.query),e.gc()}))}},lt={mutation:D.CreatePriceDocument,result:e=>null==e?void 0:e.create_price},st={mutation:D.UpdateAgencySettingsDocument,result:e=>null==e?void 0:e.update_agency_settings},dt={mutation:D.UpdateProductSettingsDocument,result:e=>null==e?void 0:e.update_product_settings},ft={mutation:D.UpdatePageDocument,result:e=>null==e?void 0:e.update_page},vt={mutation:D.CreatePageBlockDocument,result:e=>null==e?void 0:e.create_page_block,after(e,t){return ze(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.page_block)return;const{page_block:n}=t;e.modify({id:e.identify(n.page),fields:{blocks(t=[],{readField:r}){const o=e.writeFragment({data:n,fragment:D.Page_BlockFragmentDoc,fragmentName:"page_block"});return t.some((e=>r("id",e)===n.id))?t:[...t,o]}}})}))}},pt={mutation:D.UpdatePageBlockDocument,result:e=>null==e?void 0:e.update_page_block},yt={mutation:D.DeletePageBlockDocument,result:e=>null==e?void 0:e.delete_page_block,after(e,t){return ze(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.page_block)return;const n=e.identify(t.page_block);e.evict({id:n}),e.gc()}))}},_t={mutation:D.CreateCredentialDocument,result:e=>null==e?void 0:e.create_credential},mt={mutation:D.UpdateCredentialDocument,result:e=>null==e?void 0:e.update_credential},gt={mutation:D.CreateIntegrationDocument,result:e=>null==e?void 0:e.create_integration},bt={mutation:D.UpdateIntegrationDocument,result:e=>null==e?void 0:e.update_integration},ht={mutation:D.CreateIntegrationConfigDocument,result:e=>null==e?void 0:e.create_integration_config},wt={mutation:D.UpdateIntegrationConfigDocument,result:e=>null==e?void 0:e.update_integration_config};const Ot={loading:!1,error:void 0,data:void 0},qt={loading:!0,error:void 0,data:void 0},Dt=e=>({loading:!1,error:e,data:void 0}),kt={resetErrorMs:6e3};function jt(e,t){const n=(0,B.useRef)(0),{resetErrorMs:r}=Object.assign(Object.assign({},kt),t),[o,u]=(0,B.useState)(Ot);return[(0,B.useCallback)(((t,o)=>{return i=this,c=void 0,l=function*(){n.current&&(clearTimeout(n.current),n.current=0),u(qt);try{const i=yield Ve(e,t,o);return i&&!i.success?(u(Dt(i)),r>0&&(n.current=window.setTimeout((()=>u(Ot)),r))):u({loading:!1,error:void 0,data:i}),i}catch(e){return u(Dt(e)),r>0&&(n.current=window.setTimeout((()=>u(Ot)),r)),null}},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function r(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof a?o:new a((function(e){e(o)}))).then(n,r)}o((l=l.apply(i,c||[])).next())}));var i,c,a,l}),[e,r]),o]}})(),i})()}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@apollo/client"),require("@duely/core"),require("react")):"function"==typeof define&&define.amd?define(["@apollo/client","@duely/core","react"],t):"object"==typeof exports?exports["@duely/client"]=t(require("@apollo/client"),require("@duely/core"),require("react")):e["@duely/client"]=t(e["@apollo/client"],e["@duely/core"],e.react)}(this,(function(e,t,n){return(()=>{var r={329:(e,t,n)=>{e.exports=n(516).Observable},516:(e,t)=>{"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}t.Observable=void 0;var u=function(){return"function"==typeof Symbol},i=function(e){return u()&&Boolean(Symbol[e])},c=function(e){return i(e)?Symbol[e]:"@@"+e};u()&&!i("observable")&&(Symbol.observable=Symbol("observable"));var a=c("iterator"),l=c("observable"),s=c("species");function d(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function f(e){var t=e.constructor;return void 0!==t&&null===(t=t[s])&&(t=void 0),void 0!==t?t:O}function v(e){return e instanceof O}function p(e){p.log?p.log(e):setTimeout((function(){throw e}))}function y(e){Promise.resolve().then((function(){try{e()}catch(e){p(e)}}))}function _(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=d(t,"unsubscribe");n&&n.call(t)}}catch(e){p(e)}}function m(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,n){e._state="running";var r=e._observer;try{var o=d(r,t);switch(t){case"next":o&&o.call(r,n);break;case"error":if(m(e),!o)throw n;o.call(r,n);break;case"complete":m(e),o&&o.call(r)}}catch(e){p(e)}"closed"===e._state?_(e):"running"===e._state&&(e._state="ready")}function b(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void y((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(g(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void g(e,t,n);e._queue.push({type:t,value:n})}}var h=function(){function e(t,r){n(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var o=new w(this);try{this._cleanup=r.call(void 0,o)}catch(e){o.error(e)}"initializing"===this._state&&(this._state="ready")}return o(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(m(this),_(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),w=function(){function e(t){n(this,e),this._subscription=t}return o(e,[{key:"next",value:function(e){b(this._subscription,"next",e)}},{key:"error",value:function(e){b(this._subscription,"error",e)}},{key:"complete",value:function(){b(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),O=function(){function e(t){if(n(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return o(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new h(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var o=t.subscribe({next:function(t){try{e(t,u)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function u(){o.unsubscribe(),n()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=f(this),r=arguments.length>1,o=!1,u=arguments[1],i=u;return new n((function(n){return t.subscribe({next:function(t){var u=!o;if(o=!0,!u||r)try{i=e(i,t)}catch(e){return n.error(e)}else i=t},error:function(e){n.error(e)},complete:function(){if(!o&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(i),n.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=f(this);return new o((function(t){var r,u=0;return function e(i){r=i.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){u===n.length?(r=void 0,t.complete()):e(o.from(n[u++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=f(this);return new n((function(r){var o=[],u=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var u=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=o.indexOf(u);e>=0&&o.splice(e,1),i()}});o.push(u)},error:function(e){r.error(e)},complete:function(){i()}});function i(){u.closed&&0===o.length&&r.complete()}return function(){o.forEach((function(e){return e.unsubscribe()})),u.unsubscribe()}}))}},{key:l,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=d(t,l);if(r){var o=r.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return v(o)&&o.constructor===n?o:new n((function(e){return o.subscribe(e)}))}if(i("iterator")&&(r=d(t,a)))return new n((function(e){y((function(){if(!e.closed){var n=!0,o=!1,u=void 0;try{for(var i,c=r.call(t)[Symbol.iterator]();!(n=(i=c.next()).done);n=!0){var a=i.value;if(e.next(a),e.closed)return}}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){y((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o="function"==typeof this?this:e;return new o((function(e){y((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))}},{key:s,get:function(){return this}}]),e}();t.Observable=O,u()&&Object.defineProperty(O,Symbol("extensions"),{value:{symbol:l,hostReportError:p},configurable:!0})},74:t=>{"use strict";t.exports=e},620:e=>{"use strict";e.exports=t},297:e=>{"use strict";e.exports=n}},o={};function u(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,u),n.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";u.r(i),u.d(i,{agencies_Q:()=>$,agency_Q:()=>Y,agency_customers_Q:()=>ee,agency_pages_Q:()=>Ee,agency_settings_Q:()=>Ce,agency_stripe_account_Q:()=>G,agency_stripe_account_balance_Q:()=>K,agency_stripe_account_balance_transactions_Q:()=>X,agency_stripe_account_bank_accounts_Q:()=>Ie,agency_stripe_account_payment_intents_Q:()=>Z,agency_stripe_account_update_url_Q:()=>J,agency_subscription_plan_Q:()=>Me,calculate_transaction_fee_Q:()=>Ve,client:()=>I,count_customers_Q:()=>re,count_orders_Q:()=>De,count_products_Q:()=>le,countries_Q:()=>L,country_spec_Q:()=>R,create_agency_M:()=>et,create_bank_account_M:()=>nt,create_credential_M:()=>gt,create_customer_M:()=>at,create_integration_M:()=>ht,create_integration_config_M:()=>Ot,create_page_block_M:()=>yt,create_price_M:()=>dt,create_product_M:()=>ut,credential_Q:()=>fe,credential_type_Q:()=>pe,credential_types_Q:()=>ye,credentials_Q:()=>ve,current_agency_Q:()=>Pe,current_agency_extended_Q:()=>Se,current_agency_stripe_account_update_url_Q:()=>Qe,current_subdomain_Q:()=>ie,current_user_Q:()=>F,current_user_agencies_Q:()=>oe,customer_Q:()=>te,customers_Q:()=>ne,delete_bank_account_M:()=>ot,delete_customer_M:()=>st,delete_page_block_M:()=>mt,delete_product_M:()=>ct,form_field_Q:()=>se,form_fields_Q:()=>de,image_Q:()=>H,images_Q:()=>W,integration_Q:()=>_e,integration_config_Q:()=>ge,integration_configs_Q:()=>be,integration_type_Q:()=>he,integration_types_Q:()=>we,integrations_Q:()=>me,log_in_M:()=>$e,log_out_M:()=>Ge,markdown_Q:()=>z,markdowns_Q:()=>V,mutate:()=>We,order_Q:()=>Oe,order_item_Q:()=>ke,order_items_Q:()=>je,orders_Q:()=>qe,page_Q:()=>Te,page_block_Q:()=>Be,page_block_definition_Q:()=>Fe,page_block_definition_by_name_Q:()=>ze,page_by_url_Q:()=>Ue,page_definition_Q:()=>Ne,page_definition_by_name_Q:()=>Le,page_definition_by_url_path_Q:()=>Re,product_Q:()=>ce,product_and_agency_from_url_parts_Q:()=>xe,product_settings_Q:()=>Ae,products_Q:()=>ae,query:()=>N,start_password_reset_M:()=>Xe,start_sign_up_M:()=>Ze,subdomain_public_Q:()=>ue,update_agency_M:()=>tt,update_agency_settings_M:()=>ft,update_bank_account_M:()=>rt,update_credential_M:()=>bt,update_customer_M:()=>lt,update_integration_M:()=>wt,update_integration_config_M:()=>qt,update_page_M:()=>pt,update_page_block_M:()=>_t,update_product_M:()=>it,update_product_settings_M:()=>vt,useMutation:()=>Pt,useQuery:()=>U,verify_password_reset_M:()=>Je,verify_sign_up_M:()=>Ke});var e=u(74),t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};Object.create,Object.create;var c="Invariant Violation",a=Object.setPrototypeOf,l=void 0===a?function(e,t){return e.__proto__=t,e}:a,s=function(e){function t(n){void 0===n&&(n=c);var r=e.call(this,"number"==typeof n?c+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=c,l(r,t.prototype),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error);function d(e,t){if(!e)throw new s(t)}var f,v=["log","warn","error","silent"],p=v.indexOf("log");function y(e){return function(){if(v.indexOf(e)>=p)return console[e].apply(console,arguments)}}(f=d||(d={})).log=y("log"),f.warn=y("warn"),f.error=y("error");var _,m=u(329),g=u.n(m);function b(e,t){return t?t(e):g().of()}function h(e){return"function"==typeof e?new O(e):e}function w(e){return e.request.length<=1}n((function(e,t){var n=_.call(this,e)||this;return n.link=t,n}),_=Error);var O=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return g().of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(h).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,n,r){var o=h(n),u=h(r||new e(b));return w(o)&&w(u)?new e((function(e){return t(e)?o.request(e)||g().of():u.request(e)||g().of()})):new e((function(e,n){return t(e)?o.request(e,n)||g().of():u.request(e,n)||g().of()}))},e.execute=function(e,t){return e.request(function(e,t){var n=r({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n=r(r({},n),"function"==typeof e?e(n):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return r({},n)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?t.query.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(t.indexOf(o)<0)throw new s(26)}return e}(t))))||g().of()},e.concat=function(t,n){var r=h(t);if(w(r))return r;var o=h(n);return w(o)?new e((function(e){return r.request(e,(function(e){return o.request(e)||g().of()}))||g().of()})):new e((function(e,t){return r.request(e,(function(e){return o.request(e,t)||g().of()}))||g().of()}))},e.prototype.split=function(t,n,r){return this.concat(e.split(t,n,r||new e(b)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw new s(21)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}();function q(e){return new O((function(t,n){return new(g())((function(r){var o,u,i;try{o=n(t).subscribe({next:function(o){o.errors&&(i=e({graphQLErrors:o.errors,response:o,operation:t,forward:n}))?u=i.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.next(o)},error:function(o){(i=e({operation:t,networkError:o,graphQLErrors:o&&o.result&&o.result.errors,forward:n}))?u=i.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.error(o)},complete:function(){i||r.complete.bind(r)()}})}catch(o){e({networkError:o,operation:t,forward:n}),r.error(o)}return function(){o&&o.unsubscribe(),u&&o.unsubscribe()}}))}))}!function(e){function t(t){var n=e.call(this)||this;return n.link=q(t),n}n(t,e),t.prototype.request=function(e,t){return this.link.request(e,t)}}(O);var D=u(620),k=function(e,t,n,r){return new(n||(n=Promise))((function(o,u){function i(e){try{a(r.next(e))}catch(e){u(e)}}function c(e){try{a(r.throw(e))}catch(e){u(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,c)}a((r=r.apply(e,t||[])).next())}))};const j="undefined"==typeof window;let x=j?()=>null:()=>(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("user-jwt"))||(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("visitor-jwt"));const P=new e.InMemoryCache({typePolicies:{}}),S=new e.HttpLink({uri:"https://api.duely.app/graphql"});let Q=null;const C=S,A=(E=(t,{headers:n})=>k(void 0,void 0,void 0,(function*(){let t=yield function(){return k(this,void 0,void 0,(function*(){let t=x();return t||(Q||(Q=(0,e.toPromise)(e.ApolloLink.execute(S,{query:D.BeginVisitDocument})).then((({data:n})=>k(this,void 0,void 0,(function*(){if(!(null==n?void 0:n.begin_visit.success))throw Error(null==n?void 0:n.begin_visit.message);{const r=n.begin_visit.jwt;if(j){const{data:n}=yield(0,e.toPromise)(e.ApolloLink.execute(S,{query:D.LogInDocument,variables:{email_address:"serviceaccount@duely.app",password:process.env.DUELY_SERVICE_ACCOUNT_PASSWORD},context:{headers:{authorization:`Bearer ${r}`}}}));(null==n?void 0:n.log_in.success)?(t=n.log_in.jwt,x=()=>t):console.error(null==n?void 0:n.log_in.message)}else localStorage.setItem("visitor-jwt",r)}}))))),yield Q,x())}))}();return t?{headers:Object.assign(Object.assign({},n),{authorization:`Bearer ${t}`})}:{}})),new O((function(e,t){var n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,[]);return new(g())((function(r){var o,u=!1;return Promise.resolve(n).then((function(t){return E(0,e.getContext())})).then(e.setContext).then((function(){u||(o=t(e).subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}))})).catch(r.error.bind(r)),function(){u=!0,o&&o.unsubscribe()}}))})));var E;const M=q((({graphQLErrors:e,networkError:t,operation:n,forward:r})=>{var o;if(e)for(let t of e)switch(console.log(t),null===(o=t.extensions)||void 0===o?void 0:o.code){case"UNAUTHENTICATED":return j||(localStorage.removeItem("user-jwt"),localStorage.removeItem("visitor-jwt")),r(n)}})),I=new e.ApolloClient({ssrMode:j,link:e.ApolloLink.from([M,A,C]),cache:P,connectToDevTools:!1});var T=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function U(t,n,r){const{query:o,result:u,variables:i}=t,c=T(t,["query","result","variables"]),a=(0,e.useQuery)(o,Object.assign(Object.assign({variables:Object.assign(Object.assign({},i),n)},c),r)),{data:l,networkStatus:s,loading:d}=a,f=T(a,["data","networkStatus","loading"]),v=s?s<7:d,p=l&&u(l);return Object.assign({data:p,loading:v,initialLoading:d},f)}var B=u(297);function N(e,t,n){return r=this,o=void 0,i=function*(){const{result:r,variables:o}=e,u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["result","variables"]),i=Object.assign(Object.assign({},o),t),{data:c}=yield I.query(Object.assign(Object.assign({variables:i},u),n));return r(c)},new((u=void 0)||(u=Promise))((function(e,t){function n(e){try{a(i.next(e))}catch(e){t(e)}}function c(e){try{a(i.throw(e))}catch(e){t(e)}}function a(t){var r;t.done?e(t.value):(r=t.value,r instanceof u?r:new u((function(e){e(r)}))).then(n,c)}a((i=i.apply(r,o||[])).next())}));var r,o,u,i}const F={query:D.CurrentUserDocument,notifyOnNetworkStatusChange:!0,result:e=>null==e?void 0:e.current_user},L={query:D.CountriesDocument,result:e=>{var t;return null===(t=null==e?void 0:e.country_codes)||void 0===t?void 0:t.map((e=>D.CountryUtil.fromCode(e)))}},R={query:D.CountrySpecDocument,result:e=>null==e?void 0:e.country_spec},z={query:D.MarkdownDocument,result:e=>null==e?void 0:e.markdown},V={query:D.MarkdownsDocument,result:e=>null==e?void 0:e.markdowns},H={query:D.ImageDocument,result:e=>null==e?void 0:e.image},W={query:D.ImagesDocument,result:e=>null==e?void 0:e.images},Y={query:D.AgencyDocument,result:e=>null==e?void 0:e.agency},$={query:D.AgenciesDocument,result:e=>null==e?void 0:e.agencies},G={query:D.AgencyStripeAccountDocument,result:e=>{var t;return null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account}},J={query:D.AgencyStripeAccountUpdateUrlDocument,fetchPolicy:"no-cache",result:e=>{var t,n,r;return null===(r=null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.account_update_url)||void 0===r?void 0:r.url}},K={query:D.AgencyStripeAccountBalanceDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.balance}},X={query:D.AgencyStripeAccountBalanceTransactionsDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.balance_transactions}},Z={query:D.AgencyStripeAccountPaymentIntentsDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.payment_intents}},ee={query:D.AgencyCustomersDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.customers}},te={query:D.CustomerDocument,result:e=>null==e?void 0:e.customer},ne={query:D.CustomersDocument,result:e=>null==e?void 0:e.customers},re={query:D.CountCustomersDocument,result:e=>null==e?void 0:e.count_customers},oe={query:D.CurrentUserAgenciesDocument,notifyOnNetworkStatusChange:!0,result:e=>{var t;return null===(t=null==e?void 0:e.current_user)||void 0===t?void 0:t.memberships.map((e=>Object.assign(Object.assign({},e.subdomain.agency),{subdomain:e.subdomain})))}},ue={query:D.SubdomainPublicDocument,result:e=>{var t;return null===(t=null==e?void 0:e.subdomains)||void 0===t?void 0:t[0]}},ie=Object.assign(Object.assign({},ue),{variables:{subdomain_name:function(){var e,t;const n=new URL(window.location.href),r=n.hostname.toLowerCase();if("localhost"===r||function(e){var t=e.split(".").map((e=>parseInt(e,10)));return 4===t.length&&!t.some(isNaN)&&(10===t[0]||172===t[0]&&t[1]>=16&&t[1]<=31||192===t[0]&&168===t[1])}(r)){let r=null!==(t=null===(e=n.searchParams.get("subdomain"))||void 0===e?void 0:e.toLowerCase())&&void 0!==t?t:null;return null!==r?(sessionStorage.setItem("development-subdomain",r),r):sessionStorage.getItem("development-subdomain")}if("duely.app"!==r){if(r.endsWith(".duely.app"))return r.slice(0,-".duely.app".length);throw new Error("Not implemented.")}return null}()}}),ce={query:D.ProductDocument,result:e=>null==e?void 0:e.product},ae={query:D.ProductsDocument,result:e=>null==e?void 0:e.products},le={query:D.CountProductsDocument,result:e=>null==e?void 0:e.count_products},se={query:D.FormFieldDocument,result:e=>null==e?void 0:e.form_field},de={query:D.FormFieldsDocument,result:e=>null==e?void 0:e.form_fields},fe={query:D.CredentialDocument,result:e=>null==e?void 0:e.credential},ve={query:D.CredentialsDocument,result:e=>null==e?void 0:e.credentials},pe={query:D.CredentialTypeDocument,result:e=>null==e?void 0:e.credential_type},ye={query:D.CredentialTypesDocument,result:e=>null==e?void 0:e.credential_types},_e={query:D.IntegrationDocument,result:e=>null==e?void 0:e.integration},me={query:D.IntegrationsDocument,result:e=>null==e?void 0:e.integrations},ge={query:D.IntegrationConfigDocument,result:e=>null==e?void 0:e.integration_config},be={query:D.IntegrationConfigsDocument,result:e=>null==e?void 0:e.integration_configs},he={query:D.IntegrationTypeDocument,result:e=>null==e?void 0:e.integration_type},we={query:D.IntegrationTypesDocument,result:e=>null==e?void 0:e.integration_types},Oe={query:D.OrderDocument,result:e=>null==e?void 0:e.order},qe={query:D.OrdersDocument,result:e=>null==e?void 0:e.orders},De={query:D.CountOrdersDocument,result:e=>null==e?void 0:e.count_orders},ke={query:D.OrderItemDocument,result:e=>null==e?void 0:e.order_item},je={query:D.OrderItemsDocument,result:e=>null==e?void 0:e.order_items},xe={query:D.ProductAndAgencyFromUrlPartsDocument,result:e=>{var t,n,r;return null===(r=null===(n=null===(t=null==e?void 0:e.subdomains)||void 0===t?void 0:t[0])||void 0===n?void 0:n.agency.products)||void 0===r?void 0:r[0]}},Pe=Object.assign(Object.assign({},ie),{query:D.SubdomainAgencyDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.subdomains)||void 0===t?void 0:t[0])||void 0===n?void 0:n.agency}}),Se=Object.assign(Object.assign({},ie),{query:D.SubdomainAgencyExtendedDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.subdomains)||void 0===t?void 0:t[0])||void 0===n?void 0:n.agency}}),Qe=Object.assign(Object.assign({},ie),{query:D.SubdomainAgencyStripeAccountUpdateUrlDocument,fetchPolicy:"no-cache",result:e=>{var t,n,r,o,u;return null===(u=null===(o=null===(r=null===(n=null===(t=null==e?void 0:e.subdomains)||void 0===t?void 0:t[0])||void 0===n?void 0:n.agency)||void 0===r?void 0:r.stripe_account)||void 0===o?void 0:o.account_update_url)||void 0===u?void 0:u.url}}),Ce={query:D.AgencySettingsDocument,result:e=>{var t;return null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.settings}},Ae={query:D.ProductSettingsDocument,result:e=>{var t;return null===(t=null==e?void 0:e.product)||void 0===t?void 0:t.settings}},Ee={query:D.AgencyPagesDocument,result:e=>null==e?void 0:e.pages},Me={query:D.AgencySubscriptionPlanDocument,result:e=>{var t;return null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.subscription_plan}},Ie={query:D.AgencyStripeAccountBankAccountsDocument,result:e=>{var t,n;return null===(n=null===(t=null==e?void 0:e.agency)||void 0===t?void 0:t.stripe_account)||void 0===n?void 0:n.bank_accounts}},Te={query:D.PageDocument,result:e=>null==e?void 0:e.page},Ue={query:D.PageByUrlDocument,result:e=>null==e?void 0:e.page_by_url},Be={query:D.PageBlockDocument,result:e=>null==e?void 0:e.page_block},Ne={query:D.PageDefinitionDocument,result:e=>null==e?void 0:e.page_definition},Fe={query:D.PageBlockDefinitionDocument,result:e=>null==e?void 0:e.page_block_definition},Le={query:D.PageDefinitionsByNameDocument,result:e=>{var t;return null===(t=null==e?void 0:e.page_definitions)||void 0===t?void 0:t[0]}},Re={query:D.PageDefinitionByUrlPathDocument,result:e=>null==e?void 0:e.page_definition_by_url_path},ze={query:D.PageBlockDefinitionsByNameDocument,result:e=>{var t;return null===(t=null==e?void 0:e.page_block_definitions)||void 0===t?void 0:t[0]}},Ve={query:D.CalculateTransactionFeeDocument,result:e=>{var t;return null===(t=null==e?void 0:e.subscription_plan)||void 0===t?void 0:t.calculate_fee}};var He=function(e,t,n,r){return new(n||(n=Promise))((function(o,u){function i(e){try{a(r.next(e))}catch(e){u(e)}}function c(e){try{a(r.throw(e))}catch(e){u(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,c)}a((r=r.apply(e,t||[])).next())}))};function We(e,t,n){return He(this,void 0,void 0,(function*(){const{result:r,after:o,variables:u}=e,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["result","after","variables"]),c=Object.assign(Object.assign({},u),t),{data:a}=yield I.mutate(Object.assign(Object.assign({variables:c},i),n)),l=a&&r(a);return o&&(yield o(I.cache,null!=l?l:null,c)),l}))}function Ye(e,t){t.definitions.forEach((t=>{"OperationDefinition"===t.kind&&t.selectionSet.selections.forEach((t=>{"Field"===t.kind&&e.evict({id:"ROOT_QUERY",fieldName:t.name.value})}))}))}const $e={mutation:D.LogInDocument,result:e=>null==e?void 0:e.log_in,after(e,t){return He(this,void 0,void 0,(function*(){(null==t?void 0:t.success)&&t.jwt&&("undefined"!=typeof window&&localStorage.setItem("user-jwt",t.jwt),yield I.resetStore())}))}},Ge={mutation:D.LogOutDocument,result:e=>null==e?void 0:e.log_out,after(e,t){return He(this,void 0,void 0,(function*(){(null==t?void 0:t.success)&&("undefined"!=typeof window&&localStorage.removeItem("user-jwt"),yield I.resetStore())}))}},Je={mutation:D.VerifyPasswordResetDocument,result:e=>null==e?void 0:e.verify_password_reset},Ke={mutation:D.VerifySignUpDocument,result:e=>null==e?void 0:e.verify_sign_up},Xe={mutation:D.StartPasswordResetDocument,result:e=>null==e?void 0:e.start_password_reset},Ze={mutation:D.StartSignUpDocument,result:e=>null==e?void 0:e.start_sign_up},et={mutation:D.CreateAgencyDocument,result:e=>null==e?void 0:e.create_agency},tt={mutation:D.UpdateAgencyDocument,result:e=>null==e?void 0:e.update_agency},nt={mutation:D.CreateBankAccountDocument,result:e=>null==e?void 0:e.create_bank_account,after(e,t){return He(this,void 0,void 0,(function*(){(null==t?void 0:t.success)&&t.bank_account&&(Ye(e,Ie.query),e.gc())}))}},rt={mutation:D.UpdateBankAccountDocument,result:e=>null==e?void 0:e.update_bank_account},ot={mutation:D.DeleteBankAccountDocument,result:e=>null==e?void 0:e.delete_bank_account,after(e,t){return He(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.bank_account)return;const n=e.identify(t.bank_account);e.evict({id:n}),Ye(e,Ie.query),e.gc()}))}},ut={mutation:D.CreateProductDocument,result:e=>null==e?void 0:e.create_product,after(e,t){return He(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.product)return;const{product:n}=t;e.modify({id:e.identify(n.agency),fields:{products(t=[],{readField:r}){const o=e.writeFragment({data:n,fragment:D.ProductFragmentDoc,fragmentName:"product"});return t.some((e=>r("id",e)===n.id))?t:[...t,o]}}}),Ye(e,ae.query),Ye(e,le.query),e.gc()}))}},it={mutation:D.UpdateProductDocument,result:e=>null==e?void 0:e.update_product},ct={mutation:D.DeleteProductDocument,result:e=>null==e?void 0:e.delete_product,after(e,t){return He(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.product)return;const n=e.identify(t.product);e.evict({id:n}),Ye(e,ae.query),Ye(e,le.query),e.gc()}))}},at={mutation:D.CreateCustomerDocument,result:e=>null==e?void 0:e.create_customer,after(e,t){return He(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.customer)return;const{customer:n}=t;e.modify({id:e.identify(n.stripe_account),fields:{customers(t=[],{readField:r}){const o=e.writeFragment({data:n,fragment:D.CustomerFragmentDoc,fragmentName:"customer"});return t.some((e=>r("id",e)===n.id))?t:[...t,o]}}}),Ye(e,ne.query),Ye(e,re.query),e.gc()}))}},lt={mutation:D.UpdateCustomerDocument,result:e=>null==e?void 0:e.update_customer},st={mutation:D.DeleteCustomerDocument,result:e=>null==e?void 0:e.delete_customer,after(e,t){return He(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.customer)return;const n=e.identify(t.customer);e.evict({id:n}),Ye(e,ne.query),Ye(e,re.query),e.gc()}))}},dt={mutation:D.CreatePriceDocument,result:e=>null==e?void 0:e.create_price},ft={mutation:D.UpdateAgencySettingsDocument,result:e=>null==e?void 0:e.update_agency_settings},vt={mutation:D.UpdateProductSettingsDocument,result:e=>null==e?void 0:e.update_product_settings},pt={mutation:D.UpdatePageDocument,result:e=>null==e?void 0:e.update_page},yt={mutation:D.CreatePageBlockDocument,result:e=>null==e?void 0:e.create_page_block,after(e,t){return He(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.page_block)return;const{page_block:n}=t;e.modify({id:e.identify(n.page),fields:{blocks(t=[],{readField:r}){const o=e.writeFragment({data:n,fragment:D.Page_BlockFragmentDoc,fragmentName:"page_block"});return t.some((e=>r("id",e)===n.id))?t:[...t,o]}}})}))}},_t={mutation:D.UpdatePageBlockDocument,result:e=>null==e?void 0:e.update_page_block},mt={mutation:D.DeletePageBlockDocument,result:e=>null==e?void 0:e.delete_page_block,after(e,t){return He(this,void 0,void 0,(function*(){if(!(null==t?void 0:t.success)||!t.page_block)return;const n=e.identify(t.page_block);e.evict({id:n}),e.gc()}))}},gt={mutation:D.CreateCredentialDocument,result:e=>null==e?void 0:e.create_credential},bt={mutation:D.UpdateCredentialDocument,result:e=>null==e?void 0:e.update_credential},ht={mutation:D.CreateIntegrationDocument,result:e=>null==e?void 0:e.create_integration},wt={mutation:D.UpdateIntegrationDocument,result:e=>null==e?void 0:e.update_integration},Ot={mutation:D.CreateIntegrationConfigDocument,result:e=>null==e?void 0:e.create_integration_config},qt={mutation:D.UpdateIntegrationConfigDocument,result:e=>null==e?void 0:e.update_integration_config};const Dt={loading:!1,error:void 0,data:void 0},kt={loading:!0,error:void 0,data:void 0},jt=e=>({loading:!1,error:e,data:void 0}),xt={resetErrorMs:6e3};function Pt(e,t){const n=(0,B.useRef)(0),{resetErrorMs:r}=Object.assign(Object.assign({},xt),t),[o,u]=(0,B.useState)(Dt);return[(0,B.useCallback)(((t,o)=>{return i=this,c=void 0,l=function*(){n.current&&(clearTimeout(n.current),n.current=0),u(kt);try{const i=yield We(e,t,o);return i&&!i.success?(u(jt(i)),r>0&&(n.current=window.setTimeout((()=>u(Dt)),r))):u({loading:!1,error:void 0,data:i}),i}catch(e){return u(jt(e)),r>0&&(n.current=window.setTimeout((()=>u(Dt)),r)),null}},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function r(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof a?o:new a((function(e){e(o)}))).then(n,r)}o((l=l.apply(i,c||[])).next())}));var i,c,a,l}),[e,r]),o]}})(),i})()}));
//# sourceMappingURL=index.js.map

@@ -122,3 +122,3 @@ import { ApolloCache, MutationOptions, NormalizedCacheObject } from '@apollo/client';

__typename?: "BankAccount" | undefined;
} & Pick<import("@duely/core").BankAccount, "id" | "id_ext" | "country" | "currency" | "status" | "account_holder_name" | "account_holder_type" | "available_payout_methods" | "bank_name" | "default_for_currency" | "fingerprint" | "last4" | "routing_number">> | undefined;
} & Pick<import("@duely/core").BankAccount, "id" | "id_ext" | "account_holder_name" | "account_holder_type" | "available_payout_methods" | "bank_name" | "country" | "currency" | "default_for_currency" | "fingerprint" | "last4" | "routing_number" | "status">> | undefined;
};

@@ -143,3 +143,3 @@ export declare const create_bank_account_M: {

__typename?: "BankAccount" | undefined;
} & Pick<import("@duely/core").BankAccount, "id" | "id_ext" | "country" | "currency" | "status" | "account_holder_name" | "account_holder_type" | "available_payout_methods" | "bank_name" | "default_for_currency" | "fingerprint" | "last4" | "routing_number">> | undefined;
} & Pick<import("@duely/core").BankAccount, "id" | "id_ext" | "account_holder_name" | "account_holder_type" | "available_payout_methods" | "bank_name" | "country" | "currency" | "default_for_currency" | "fingerprint" | "last4" | "routing_number" | "status">> | undefined;
};

@@ -163,3 +163,3 @@ after(cache: ApolloCache<NormalizedCacheObject>, result: ReturnType<typeof create_bank_account_R> | null): Promise<void>;

__typename?: "BankAccount" | undefined;
} & Pick<import("@duely/core").BankAccount, "id" | "id_ext" | "country" | "currency" | "status" | "account_holder_name" | "account_holder_type" | "available_payout_methods" | "bank_name" | "default_for_currency" | "fingerprint" | "last4" | "routing_number">> | undefined;
} & Pick<import("@duely/core").BankAccount, "id" | "id_ext" | "account_holder_name" | "account_holder_type" | "available_payout_methods" | "bank_name" | "country" | "currency" | "default_for_currency" | "fingerprint" | "last4" | "routing_number" | "status">> | undefined;
};

@@ -195,3 +195,3 @@ };

__typename?: "Product" | undefined;
} & Pick<import("@duely/core").Product, "id" | "name" | "description" | "status" | "url_name" | "duration" | "active"> & {
} & Pick<import("@duely/core").Product, "id" | "status" | "name" | "url_name" | "description" | "duration" | "active"> & {
default_price?: import("@duely/core").Maybe<{

@@ -201,3 +201,3 @@ __typename?: "Price" | undefined;

__typename?: "Price" | undefined;
} & Pick<import("@duely/core").Price, "id" | "name" | "currency" | "status" | "type" | "active" | "unit_amount" | "recurring_interval" | "recurring_interval_count">> | undefined;
} & Pick<import("@duely/core").Price, "id" | "currency" | "status" | "name" | "active" | "unit_amount" | "type" | "recurring_interval" | "recurring_interval_count">> | undefined;
prices?: import("@duely/core").Maybe<({

@@ -207,3 +207,3 @@ __typename?: "Price" | undefined;

__typename?: "Price" | undefined;
} & Pick<import("@duely/core").Price, "id" | "name" | "currency" | "status" | "type" | "active" | "unit_amount" | "recurring_interval" | "recurring_interval_count">)[]> | undefined;
} & Pick<import("@duely/core").Price, "id" | "currency" | "status" | "name" | "active" | "unit_amount" | "type" | "recurring_interval" | "recurring_interval_count">)[]> | undefined;
image_logo?: import("@duely/core").Maybe<{

@@ -246,3 +246,3 @@ __typename?: "Image" | undefined;

__typename?: "Product" | undefined;
} & Pick<import("@duely/core").Product, "id" | "name" | "description" | "status" | "url_name" | "duration" | "active"> & {
} & Pick<import("@duely/core").Product, "id" | "status" | "name" | "url_name" | "description" | "duration" | "active"> & {
default_price?: import("@duely/core").Maybe<{

@@ -252,3 +252,3 @@ __typename?: "Price" | undefined;

__typename?: "Price" | undefined;
} & Pick<import("@duely/core").Price, "id" | "name" | "currency" | "status" | "type" | "active" | "unit_amount" | "recurring_interval" | "recurring_interval_count">> | undefined;
} & Pick<import("@duely/core").Price, "id" | "currency" | "status" | "name" | "active" | "unit_amount" | "type" | "recurring_interval" | "recurring_interval_count">> | undefined;
prices?: import("@duely/core").Maybe<({

@@ -258,3 +258,3 @@ __typename?: "Price" | undefined;

__typename?: "Price" | undefined;
} & Pick<import("@duely/core").Price, "id" | "name" | "currency" | "status" | "type" | "active" | "unit_amount" | "recurring_interval" | "recurring_interval_count">)[]> | undefined;
} & Pick<import("@duely/core").Price, "id" | "currency" | "status" | "name" | "active" | "unit_amount" | "type" | "recurring_interval" | "recurring_interval_count">)[]> | undefined;
image_logo?: import("@duely/core").Maybe<{

@@ -300,3 +300,3 @@ __typename?: "Image" | undefined;

__typename?: "Product" | undefined;
} & Pick<import("@duely/core").Product, "id" | "name" | "description" | "status" | "url_name" | "duration" | "active"> & {
} & Pick<import("@duely/core").Product, "id" | "status" | "name" | "url_name" | "description" | "duration" | "active"> & {
default_price?: import("@duely/core").Maybe<{

@@ -306,3 +306,3 @@ __typename?: "Price" | undefined;

__typename?: "Price" | undefined;
} & Pick<import("@duely/core").Price, "id" | "name" | "currency" | "status" | "type" | "active" | "unit_amount" | "recurring_interval" | "recurring_interval_count">> | undefined;
} & Pick<import("@duely/core").Price, "id" | "currency" | "status" | "name" | "active" | "unit_amount" | "type" | "recurring_interval" | "recurring_interval_count">> | undefined;
prices?: import("@duely/core").Maybe<({

@@ -312,3 +312,3 @@ __typename?: "Price" | undefined;

__typename?: "Price" | undefined;
} & Pick<import("@duely/core").Price, "id" | "name" | "currency" | "status" | "type" | "active" | "unit_amount" | "recurring_interval" | "recurring_interval_count">)[]> | undefined;
} & Pick<import("@duely/core").Price, "id" | "currency" | "status" | "name" | "active" | "unit_amount" | "type" | "recurring_interval" | "recurring_interval_count">)[]> | undefined;
image_logo?: import("@duely/core").Maybe<{

@@ -369,3 +369,3 @@ __typename?: "Image" | undefined;

__typename?: "StripeCustomer" | undefined;
} & Pick<import("@duely/core").StripeCustomer, "id" | "name" | "id_ext" | "created" | "email" | "currency" | "description" | "phone" | "balance" | "delinquent" | "invoice_prefix" | "next_invoice_sequence" | "preferred_locales"> & {
} & Pick<import("@duely/core").StripeCustomer, "id" | "id_ext" | "currency" | "name" | "description" | "balance" | "created" | "delinquent" | "email" | "invoice_prefix" | "next_invoice_sequence" | "phone" | "preferred_locales"> & {
address?: import("@duely/core").Maybe<{

@@ -375,3 +375,3 @@ __typename?: "Address" | undefined;

__typename?: "Address" | undefined;
} & Pick<import("@duely/core").Address, "country" | "state" | "city" | "line1" | "line2" | "postal_code">> | undefined;
} & Pick<import("@duely/core").Address, "country" | "city" | "line1" | "line2" | "postal_code" | "state">> | undefined;
customer?: import("@duely/core").Maybe<{

@@ -385,3 +385,3 @@ __typename?: "Customer" | undefined;

__typename?: "StripeCustomer" | undefined;
} & Pick<import("@duely/core").StripeCustomer, "id" | "name" | "id_ext" | "created" | "email" | "currency" | "description" | "phone" | "balance" | "delinquent" | "invoice_prefix" | "next_invoice_sequence" | "preferred_locales"> & {
} & Pick<import("@duely/core").StripeCustomer, "id" | "id_ext" | "currency" | "name" | "description" | "balance" | "created" | "delinquent" | "email" | "invoice_prefix" | "next_invoice_sequence" | "phone" | "preferred_locales"> & {
address?: import("@duely/core").Maybe<{

@@ -391,3 +391,3 @@ __typename?: "Address" | undefined;

__typename?: "Address" | undefined;
} & Pick<import("@duely/core").Address, "country" | "state" | "city" | "line1" | "line2" | "postal_code">> | undefined;
} & Pick<import("@duely/core").Address, "country" | "city" | "line1" | "line2" | "postal_code" | "state">> | undefined;
customer?: import("@duely/core").Maybe<{

@@ -425,3 +425,3 @@ __typename?: "Customer" | undefined;

__typename?: "StripeCustomer" | undefined;
} & Pick<import("@duely/core").StripeCustomer, "id" | "name" | "id_ext" | "created" | "email" | "currency" | "description" | "phone" | "balance" | "delinquent" | "invoice_prefix" | "next_invoice_sequence" | "preferred_locales"> & {
} & Pick<import("@duely/core").StripeCustomer, "id" | "id_ext" | "currency" | "name" | "description" | "balance" | "created" | "delinquent" | "email" | "invoice_prefix" | "next_invoice_sequence" | "phone" | "preferred_locales"> & {
address?: import("@duely/core").Maybe<{

@@ -431,3 +431,3 @@ __typename?: "Address" | undefined;

__typename?: "Address" | undefined;
} & Pick<import("@duely/core").Address, "country" | "state" | "city" | "line1" | "line2" | "postal_code">> | undefined;
} & Pick<import("@duely/core").Address, "country" | "city" | "line1" | "line2" | "postal_code" | "state">> | undefined;
customer?: import("@duely/core").Maybe<{

@@ -441,3 +441,3 @@ __typename?: "Customer" | undefined;

__typename?: "StripeCustomer" | undefined;
} & Pick<import("@duely/core").StripeCustomer, "id" | "name" | "id_ext" | "created" | "email" | "currency" | "description" | "phone" | "balance" | "delinquent" | "invoice_prefix" | "next_invoice_sequence" | "preferred_locales"> & {
} & Pick<import("@duely/core").StripeCustomer, "id" | "id_ext" | "currency" | "name" | "description" | "balance" | "created" | "delinquent" | "email" | "invoice_prefix" | "next_invoice_sequence" | "phone" | "preferred_locales"> & {
address?: import("@duely/core").Maybe<{

@@ -447,3 +447,3 @@ __typename?: "Address" | undefined;

__typename?: "Address" | undefined;
} & Pick<import("@duely/core").Address, "country" | "state" | "city" | "line1" | "line2" | "postal_code">> | undefined;
} & Pick<import("@duely/core").Address, "country" | "city" | "line1" | "line2" | "postal_code" | "state">> | undefined;
customer?: import("@duely/core").Maybe<{

@@ -483,3 +483,3 @@ __typename?: "Customer" | undefined;

__typename?: "StripeCustomer" | undefined;
} & Pick<import("@duely/core").StripeCustomer, "id" | "name" | "id_ext" | "created" | "email" | "currency" | "description" | "phone" | "balance" | "delinquent" | "invoice_prefix" | "next_invoice_sequence" | "preferred_locales"> & {
} & Pick<import("@duely/core").StripeCustomer, "id" | "id_ext" | "currency" | "name" | "description" | "balance" | "created" | "delinquent" | "email" | "invoice_prefix" | "next_invoice_sequence" | "phone" | "preferred_locales"> & {
address?: import("@duely/core").Maybe<{

@@ -489,3 +489,3 @@ __typename?: "Address" | undefined;

__typename?: "Address" | undefined;
} & Pick<import("@duely/core").Address, "country" | "state" | "city" | "line1" | "line2" | "postal_code">> | undefined;
} & Pick<import("@duely/core").Address, "country" | "city" | "line1" | "line2" | "postal_code" | "state">> | undefined;
customer?: import("@duely/core").Maybe<{

@@ -499,3 +499,3 @@ __typename?: "Customer" | undefined;

__typename?: "StripeCustomer" | undefined;
} & Pick<import("@duely/core").StripeCustomer, "id" | "name" | "id_ext" | "created" | "email" | "currency" | "description" | "phone" | "balance" | "delinquent" | "invoice_prefix" | "next_invoice_sequence" | "preferred_locales"> & {
} & Pick<import("@duely/core").StripeCustomer, "id" | "id_ext" | "currency" | "name" | "description" | "balance" | "created" | "delinquent" | "email" | "invoice_prefix" | "next_invoice_sequence" | "phone" | "preferred_locales"> & {
address?: import("@duely/core").Maybe<{

@@ -505,3 +505,3 @@ __typename?: "Address" | undefined;

__typename?: "Address" | undefined;
} & Pick<import("@duely/core").Address, "country" | "state" | "city" | "line1" | "line2" | "postal_code">> | undefined;
} & Pick<import("@duely/core").Address, "country" | "city" | "line1" | "line2" | "postal_code" | "state">> | undefined;
customer?: import("@duely/core").Maybe<{

@@ -555,3 +555,3 @@ __typename?: "Customer" | undefined;

__typename?: "Price" | undefined;
} & Pick<import("@duely/core").Price, "id" | "name" | "currency" | "status" | "type" | "active" | "unit_amount" | "recurring_interval" | "recurring_interval_count">> | undefined;
} & Pick<import("@duely/core").Price, "id" | "currency" | "status" | "name" | "active" | "unit_amount" | "type" | "recurring_interval" | "recurring_interval_count">> | undefined;
};

@@ -603,3 +603,3 @@ };

__typename?: "Page" | undefined;
} & Pick<import("@duely/core").Page, "id" | "access" | "url_path"> & {
} & Pick<import("@duely/core").Page, "id" | "url_path" | "access"> & {
agency: {

@@ -606,0 +606,0 @@ __typename?: "Agency" | undefined;

{
"name": "@duely/client",
"version": "0.4.29",
"version": "0.4.30",
"description": "GraphQL client by Duely (wrapper for @apollo/client)",

@@ -35,5 +35,5 @@ "repository": "github:uoleevi/duely",

"@apollo/client": "^3.3.21",
"@duely/core": "0.4.24",
"@duely/core": "0.4.25",
"react": "^17.0.2"
}
}

@@ -59,3 +59,5 @@ import {

CountCustomersDocument,
AgencyStripeAccountBankAccountsDocument
AgencyStripeAccountBankAccountsDocument,
MarkdownDocument,
MarkdownsDocument
} from '@duely/core';

@@ -120,2 +122,13 @@ import { QueryOptions } from '@apollo/client';

export const markdown_Q = {
query: MarkdownDocument,
result: (d: ResultOf<typeof MarkdownDocument>) => d?.markdown
};
export const markdowns_Q = {
query: MarkdownsDocument,
result: (d: ResultOf<typeof MarkdownsDocument>) => d?.markdowns
};
export const image_Q = {

@@ -122,0 +135,0 @@ query: ImageDocument,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc