@sankhyalabs/sankhyablocks 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # sankhya-blocks
2
+
3
+ Projeto para integração do design system ez-ui com as regras de negocio/framework do ERP Sankhya
package/build/index.js ADDED
@@ -0,0 +1,2 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.sankhyablocks=t():e.sankhyablocks=t()}(self,(()=>(()=>{var e={98:function(e,t){var n="undefined"!=typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in e,o="ArrayBuffer"in e;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function y(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function E(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=E(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=E(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,n,r=h(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=f(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=u(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},p.prototype.delete=function(e){delete this.map[u(e)]},p.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},p.prototype.set=function(e,t){this.map[u(e)]=l(t)},p.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),d(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),d(e)},r&&(p.prototype[Symbol.iterator]=p.prototype.entries);var T=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(e,t){var n,r,i=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),T.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function A(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},v.call(m.prototype),v.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},A.error=function(){var e=new A(null,{status:0,statusText:""});return e.type="error",e};var O=[301,302,303,307,308];A.redirect=function(e,t){if(-1===O.indexOf(t))throw new RangeError("Invalid status code");return new A(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function N(e,n){return new Promise((function(r,s){var o=new m(e,n);if(o.signal&&o.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;r(new A(i,n))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",c)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}N.polyfill=!0,e.fetch||(e.fetch=N,e.Headers=p,e.Request=m,e.Response=A),t.Headers=p,t.Request=m,t.Response=A,t.fetch=N,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},445:e=>{"use strict";e.exports=function(e){var t=e.uri,n=e.name,r=e.type;this.uri=t,this.name=n,this.type=r}},804:(e,t,n)=>{"use strict";var r=n(268);e.exports=function e(t,n,i){var s;void 0===n&&(n=""),void 0===i&&(i=r);var o=new Map;function a(e,t){var n=o.get(t);n?n.push.apply(n,e):o.set(t,e)}if(i(t))s=null,a([n],t);else{var c=n?n+".":"";if("undefined"!=typeof FileList&&t instanceof FileList)s=Array.prototype.map.call(t,(function(e,t){return a([""+c+t],e),null}));else if(Array.isArray(t))s=t.map((function(t,n){var r=e(t,""+c+n,i);return r.files.forEach(a),r.clone}));else if(t&&t.constructor===Object)for(var u in s={},t){var l=e(t[u],""+c+u,i);l.files.forEach(a),s[u]=l.clone}else s=t}return{clone:s,files:o}}},823:(e,t,n)=>{"use strict";t.ReactNativeFile=n(445),t.extractFiles=n(804),t.isExtractableFile=n(268)},268:(e,t,n)=>{"use strict";var r=n(445);e.exports=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof r}},230:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},458:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(823),s=r(n(230)),o=n(456),a=function(e){return i.isExtractableFile(e)||null!==e&&"object"==typeof e&&"function"==typeof e.pipe};t.default=function(e,t,n,r){void 0===r&&(r=o.defaultJsonSerializer);var c=i.extractFiles({query:e,variables:t,operationName:n},"",a),u=c.clone,l=c.files;if(0===l.size){if(!Array.isArray(e))return r.stringify(u);if(void 0!==t&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");var d=e.reduce((function(e,n,r){return e.push({query:n,variables:t?t[r]:void 0}),e}),[]);return r.stringify(d)}var p=new("undefined"==typeof FormData?s.default:FormData);p.append("operations",r.stringify(u));var h={},f=0;return l.forEach((function(e){h[++f]=e})),p.append("map",r.stringify(h)),f=0,l.forEach((function(e,t){p.append(""+ ++f,t)})),p}},456:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultJsonSerializer=void 0,t.defaultJsonSerializer={parse:JSON.parse,stringify:JSON.stringify}},687:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},u=this&&this.__rest||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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.gql=t.batchRequests=t.request=t.rawRequest=t.GraphQLClient=t.ClientError=void 0;var d=o(n(98)),p=d,h=n(370),f=n(33),y=l(n(458)),E=n(456),v=n(980),T=n(308);Object.defineProperty(t,"ClientError",{enumerable:!0,get:function(){return T.ClientError}});var m=function(e){var t={};return e&&("undefined"!=typeof Headers&&e instanceof Headers||e instanceof p.Headers?t=function(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}(e):Array.isArray(e)?e.forEach((function(e){var n=e[0],r=e[1];t[n]=r})):t=e),t},_=function(e){return e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},A=function(e){var t=e.url,n=e.query,i=e.variables,s=e.operationName,o=e.headers,u=e.fetch,l=e.fetchOptions;return a(void 0,void 0,void 0,(function(){var e;return c(this,(function(a){switch(a.label){case 0:return e=y.default(n,i,s,l.jsonSerializer),[4,u(t,r({method:"POST",headers:r(r({},"string"==typeof e?{"Content-Type":"application/json"}:{}),o),body:e},l))];case 1:return[2,a.sent()]}}))}))},O=function(e){var t=e.url,n=e.query,i=e.variables,s=e.operationName,o=e.headers,u=e.fetch,l=e.fetchOptions;return a(void 0,void 0,void 0,(function(){var e;return c(this,(function(a){switch(a.label){case 0:return e=function(e){var t=e.query,n=e.variables,r=e.operationName,i=e.jsonSerializer;if(!Array.isArray(t)){var s=["query="+encodeURIComponent(_(t))];return n&&s.push("variables="+encodeURIComponent(i.stringify(n))),r&&s.push("operationName="+encodeURIComponent(r)),s.join("&")}if(void 0!==n&&!Array.isArray(n))throw new Error("Cannot create query with given variable type, array expected");var o=t.reduce((function(e,t,r){return e.push({query:_(t),variables:n?i.stringify(n[r]):void 0}),e}),[]);return"query="+encodeURIComponent(i.stringify(o))}({query:n,variables:i,operationName:s,jsonSerializer:l.jsonSerializer}),[4,u(t+"?"+e,r({method:"GET",headers:o},l))];case 1:return[2,a.sent()]}}))}))},N=function(){function e(e,t){this.url=e,this.options=t||{}}return e.prototype.rawRequest=function(e,t,n){return a(this,void 0,void 0,(function(){var i,s,o,a,l,p,h,f,y,E;return c(this,(function(c){return i=v.parseRawRequestArgs(e,t,n),s=this.options,o=s.headers,a=s.fetch,l=void 0===a?d.default:a,p=s.method,h=void 0===p?"POST":p,f=u(s,["headers","fetch","method"]),y=this.url,void 0!==i.signal&&(f.signal=i.signal),E=k(i.query).operationName,[2,b({url:y,query:i.query,variables:i.variables,headers:r(r({},m(o)),m(i.requestHeaders)),operationName:E,fetch:l,method:h,fetchOptions:f})]}))}))},e.prototype.request=function(e,t,n){return a(this,void 0,void 0,(function(){var i,s,o,a,l,p,h,f,y,E,T,_;return c(this,(function(c){switch(c.label){case 0:return i=v.parseRequestArgs(e,t,n),s=this.options,o=s.headers,a=s.fetch,l=void 0===a?d.default:a,p=s.method,h=void 0===p?"POST":p,f=u(s,["headers","fetch","method"]),y=this.url,void 0!==i.signal&&(f.signal=i.signal),E=k(i.document),T=E.query,_=E.operationName,[4,b({url:y,query:T,variables:i.variables,headers:r(r({},m(o)),m(i.requestHeaders)),operationName:_,fetch:l,method:h,fetchOptions:f})];case 1:return[2,c.sent().data]}}))}))},e.prototype.batchRequests=function(e,t){return a(this,void 0,void 0,(function(){var n,i,s,o,a,l,p,h,f,y,E;return c(this,(function(c){switch(c.label){case 0:return n=v.parseBatchRequestArgs(e,t),i=this.options,s=i.headers,o=i.fetch,a=void 0===o?d.default:o,l=i.method,p=void 0===l?"POST":l,h=u(i,["headers","fetch","method"]),f=this.url,void 0!==n.signal&&(h.signal=n.signal),y=n.documents.map((function(e){return k(e.document).query})),E=n.documents.map((function(e){return e.variables})),[4,b({url:f,query:y,variables:E,headers:r(r({},m(s)),m(n.requestHeaders)),operationName:void 0,fetch:a,method:p,fetchOptions:h})];case 1:return[2,c.sent().data]}}))}))},e.prototype.setHeaders=function(e){return this.options.headers=e,this},e.prototype.setHeader=function(e,t){var n,r=this.options.headers;return r?r[e]=t:this.options.headers=((n={})[e]=t,n),this},e.prototype.setEndpoint=function(e){return this.url=e,this},e}();function b(e){var t=e.url,n=e.query,i=e.variables,s=e.headers,o=e.operationName,u=e.fetch,l=e.method,d=void 0===l?"POST":l,p=e.fetchOptions;return a(this,void 0,void 0,(function(){var e,a,l,h,f,y,E,v;return c(this,(function(c){switch(c.label){case 0:return e="POST"===d.toUpperCase()?A:O,a=Array.isArray(n),[4,e({url:t,query:n,variables:i,operationName:o,headers:s,fetch:u,fetchOptions:p})];case 1:return[4,D(l=c.sent(),p.jsonSerializer)];case 2:if(h=c.sent(),f=a&&Array.isArray(h)?!h.some((function(e){return!e.data})):!!h.data,l.ok&&!h.errors&&f)return y=l.headers,E=l.status,[2,r(r({},a?{data:h}:h),{headers:y,status:E})];throw v="string"==typeof h?{error:h}:h,new T.ClientError(r(r({},v),{status:l.status,headers:l.headers}),{query:n,variables:i})}}))}))}function g(e,t,n,i){return a(this,void 0,void 0,(function(){var s;return c(this,(function(o){return s=v.parseRequestExtendedArgs(e,t,n,i),[2,new N(s.url).request(r({},s))]}))}))}function D(e,t){return void 0===t&&(t=E.defaultJsonSerializer),a(this,void 0,void 0,(function(){var n,r,i;return c(this,(function(s){switch(s.label){case 0:return e.headers.forEach((function(e,t){"content-type"===t.toLowerCase()&&(n=e)})),n&&n.toLowerCase().startsWith("application/json")?(i=(r=t).parse,[4,e.text()]):[3,2];case 1:return[2,i.apply(r,[s.sent()])];case 2:return[2,e.text()]}}))}))}function I(e){var t,n=void 0,r=e.definitions.filter((function(e){return"OperationDefinition"===e.kind}));return 1===r.length&&(n=null===(t=r[0].name)||void 0===t?void 0:t.value),n}function k(e){if("string"==typeof e){var t=void 0;try{t=I(h.parse(e))}catch(e){}return{query:e,operationName:t}}var n=I(e);return{query:f.print(e),operationName:n}}t.GraphQLClient=N,t.rawRequest=function(e,t,n,i){return a(this,void 0,void 0,(function(){var s;return c(this,(function(o){return s=v.parseRawRequestExtendedArgs(e,t,n,i),[2,new N(s.url).rawRequest(r({},s))]}))}))},t.request=g,t.batchRequests=function(e,t,n){return a(this,void 0,void 0,(function(){var i;return c(this,(function(s){return i=v.parseBatchRequestsExtendedArgs(e,t,n),[2,new N(i.url).batchRequests(r({},i))]}))}))},t.default=g,t.gql=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.reduce((function(e,n,r){return""+e+n+(r in t?t[r]:"")}),"")}},980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchRequestsExtendedArgs=t.parseRawRequestExtendedArgs=t.parseRequestExtendedArgs=t.parseBatchRequestArgs=t.parseRawRequestArgs=t.parseRequestArgs=void 0,t.parseRequestArgs=function(e,t,n){return e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0}},t.parseRawRequestArgs=function(e,t,n){return e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0}},t.parseBatchRequestArgs=function(e,t){return e.documents?e:{documents:e,requestHeaders:t,signal:void 0}},t.parseRequestExtendedArgs=function(e,t,n,r){return e.document?e:{url:e,document:t,variables:n,requestHeaders:r,signal:void 0}},t.parseRawRequestExtendedArgs=function(e,t,n,r){return e.query?e:{url:e,query:t,variables:n,requestHeaders:r,signal:void 0}},t.parseBatchRequestsExtendedArgs=function(e,t,n){return e.documents?e:{url:e,documents:t,requestHeaders:n,signal:void 0}}},308:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ClientError=void 0;var i=function(e){function t(n,r){var i=this,s=t.extractMessage(n)+": "+JSON.stringify({response:n,request:r});return i=e.call(this,s)||this,Object.setPrototypeOf(i,t.prototype),i.response=n,i.request=r,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i,t),i}return r(t,e),t.extractMessage=function(e){try{return e.errors[0].message}catch(t){return"GraphQL Error (Code: "+e.status+")"}},t}(Error);t.ClientError=i},822:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLError=void 0,t.formatError=function(e){return e.toJSON()},t.printError=function(e){return e.toString()};var r=n(690),i=n(16),s=n(38);class o extends Error{constructor(e,...t){var n,s,c;const{nodes:u,source:l,positions:d,path:p,originalError:h,extensions:f}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=p?p:void 0,this.originalError=null!=h?h:void 0,this.nodes=a(Array.isArray(u)?u:u?[u]:void 0);const y=a(null===(n=this.nodes)||void 0===n?void 0:n.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=l?l:null==y||null===(s=y[0])||void 0===s?void 0:s.source,this.positions=null!=d?d:null==y?void 0:y.map((e=>e.start)),this.locations=d&&l?d.map((e=>(0,i.getLocation)(l,e))):null==y?void 0:y.map((e=>(0,i.getLocation)(e.source,e.start)));const E=(0,r.isObjectLike)(null==h?void 0:h.extensions)?null==h?void 0:h.extensions:void 0;this.extensions=null!==(c=null!=f?f:E)&&void 0!==c?c:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=h&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,o):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+(0,s.printLocation)(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+(0,s.printSourceLocation)(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}t.GraphQLError=o},338:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,n){return new r.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})};var r=n(822)},242:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.devAssert=function(e,t){if(!Boolean(e))throw new Error(t)}},2:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inspect=function(e){return n(e,[])};function n(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:n(t,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const r=Math.min(10,e.length),i=e.length-r,s=[];for(let i=0;i<r;++i)s.push(n(e[i],t));1===i?s.push("... 1 more item"):i>1&&s.push(`... ${i} more items`);return"["+s.join(", ")+"]"}(e,r);return function(e,t){const r=Object.entries(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const i=r.map((([e,r])=>e+": "+n(r,t)));return"{ "+i.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},752:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.instanceOf=void 0;n(2);const r=function(e,t){return e instanceof t};t.instanceOf=r},706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invariant=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObjectLike=function(e){return"object"==typeof e&&null!==e}},807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Token=t.QueryDocumentKeys=t.OperationTypeNode=t.Location=void 0,t.isNode=function(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&s.has(t)};class n{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}t.Location=n;class r{constructor(e,t,n,r,i,s){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}t.Token=r;const i={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};t.QueryDocumentKeys=i;const s=new Set(Object.keys(i));let o;t.OperationTypeNode=o,function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(o||(t.OperationTypeNode=o={}))},849:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringLines=function(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,s=-1;for(let t=0;t<e.length;++t){var o;const a=e[t],c=i(a);c!==a.length&&(r=null!==(o=r)&&void 0!==o?o:t,s=t,0!==t&&c<n&&(n=c))}return e.map(((e,t)=>0===t?e:e.slice(n))).slice(null!==(t=r)&&void 0!==t?t:0,s+1)},t.isPrintableAsBlockString=function(e){if(""===e)return!0;let t=!0,n=!1,r=!0,i=!1;for(let s=0;s<e.length;++s)switch(e.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(t&&!i)return!1;i=!0,t=!0,n=!1;break;case 9:case 32:n||(n=t);break;default:r&&(r=n),t=!1}if(t)return!1;if(r&&i)return!1;return!0},t.printBlockString=function(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),s=1===i.length,o=i.length>1&&i.slice(1).every((e=>0===e.length||(0,r.isWhiteSpace)(e.charCodeAt(0)))),a=n.endsWith('\\"""'),c=e.endsWith('"')&&!a,u=e.endsWith("\\"),l=c||u,d=!(null!=t&&t.minimize)&&(!s||e.length>70||l||o||a);let p="";const h=s&&(0,r.isWhiteSpace)(e.charCodeAt(0));(d&&!h||o)&&(p+="\n");p+=n,(d||l)&&(p+="\n");return'"""'+p+'"""'};var r=n(100);function i(e){let t=0;for(;t<e.length&&(0,r.isWhiteSpace)(e.charCodeAt(t));)++t;return t}},100:(e,t)=>{"use strict";function n(e){return e>=48&&e<=57}function r(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(t,"__esModule",{value:!0}),t.isDigit=n,t.isLetter=r,t.isNameContinue=function(e){return r(e)||n(e)||95===e},t.isNameStart=function(e){return r(e)||95===e},t.isWhiteSpace=function(e){return 9===e||32===e}},333:(e,t)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveLocation=void 0,t.DirectiveLocation=n,function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(n||(t.DirectiveLocation=n={}))},828:(e,t)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.Kind=void 0,t.Kind=n,function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(n||(t.Kind=n={}))},274:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Lexer=void 0,t.isPunctuatorTokenKind=function(e){return e===a.TokenKind.BANG||e===a.TokenKind.DOLLAR||e===a.TokenKind.AMP||e===a.TokenKind.PAREN_L||e===a.TokenKind.PAREN_R||e===a.TokenKind.SPREAD||e===a.TokenKind.COLON||e===a.TokenKind.EQUALS||e===a.TokenKind.AT||e===a.TokenKind.BRACKET_L||e===a.TokenKind.BRACKET_R||e===a.TokenKind.BRACE_L||e===a.TokenKind.PIPE||e===a.TokenKind.BRACE_R};var r=n(338),i=n(807),s=n(849),o=n(100),a=n(175);class c{constructor(e){const t=new i.Token(a.TokenKind.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==a.TokenKind.EOF)do{if(e.next)e=e.next;else{const t=y(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===a.TokenKind.COMMENT);return e}}function u(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function l(e,t){return d(e.charCodeAt(t))&&p(e.charCodeAt(t+1))}function d(e){return e>=55296&&e<=56319}function p(e){return e>=56320&&e<=57343}function h(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return a.TokenKind.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function f(e,t,n,r,s){const o=e.line,a=1+n-e.lineStart;return new i.Token(t,n,r,o,a,s)}function y(e,t){const n=e.source.body,i=n.length;let s=t;for(;s<i;){const t=n.charCodeAt(s);switch(t){case 65279:case 9:case 32:case 44:++s;continue;case 10:++s,++e.line,e.lineStart=s;continue;case 13:10===n.charCodeAt(s+1)?s+=2:++s,++e.line,e.lineStart=s;continue;case 35:return E(e,s);case 33:return f(e,a.TokenKind.BANG,s,s+1);case 36:return f(e,a.TokenKind.DOLLAR,s,s+1);case 38:return f(e,a.TokenKind.AMP,s,s+1);case 40:return f(e,a.TokenKind.PAREN_L,s,s+1);case 41:return f(e,a.TokenKind.PAREN_R,s,s+1);case 46:if(46===n.charCodeAt(s+1)&&46===n.charCodeAt(s+2))return f(e,a.TokenKind.SPREAD,s,s+3);break;case 58:return f(e,a.TokenKind.COLON,s,s+1);case 61:return f(e,a.TokenKind.EQUALS,s,s+1);case 64:return f(e,a.TokenKind.AT,s,s+1);case 91:return f(e,a.TokenKind.BRACKET_L,s,s+1);case 93:return f(e,a.TokenKind.BRACKET_R,s,s+1);case 123:return f(e,a.TokenKind.BRACE_L,s,s+1);case 124:return f(e,a.TokenKind.PIPE,s,s+1);case 125:return f(e,a.TokenKind.BRACE_R,s,s+1);case 34:return 34===n.charCodeAt(s+1)&&34===n.charCodeAt(s+2)?g(e,s):m(e,s)}if((0,o.isDigit)(t)||45===t)return v(e,s,t);if((0,o.isNameStart)(t))return D(e,s);throw(0,r.syntaxError)(e.source,s,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":u(t)||l(n,s)?`Unexpected character: ${h(e,s)}.`:`Invalid character: ${h(e,s)}.`)}return f(e,a.TokenKind.EOF,i,i)}function E(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(u(e))++i;else{if(!l(n,i))break;i+=2}}return f(e,a.TokenKind.COMMENT,t,i,n.slice(t+1,i))}function v(e,t,n){const i=e.source.body;let s=t,c=n,u=!1;if(45===c&&(c=i.charCodeAt(++s)),48===c){if(c=i.charCodeAt(++s),(0,o.isDigit)(c))throw(0,r.syntaxError)(e.source,s,`Invalid number, unexpected digit after 0: ${h(e,s)}.`)}else s=T(e,s,c),c=i.charCodeAt(s);if(46===c&&(u=!0,c=i.charCodeAt(++s),s=T(e,s,c),c=i.charCodeAt(s)),69!==c&&101!==c||(u=!0,c=i.charCodeAt(++s),43!==c&&45!==c||(c=i.charCodeAt(++s)),s=T(e,s,c),c=i.charCodeAt(s)),46===c||(0,o.isNameStart)(c))throw(0,r.syntaxError)(e.source,s,`Invalid number, expected digit but got: ${h(e,s)}.`);return f(e,u?a.TokenKind.FLOAT:a.TokenKind.INT,t,s,i.slice(t,s))}function T(e,t,n){if(!(0,o.isDigit)(n))throw(0,r.syntaxError)(e.source,t,`Invalid number, expected digit but got: ${h(e,t)}.`);const i=e.source.body;let s=t+1;for(;(0,o.isDigit)(i.charCodeAt(s));)++s;return s}function m(e,t){const n=e.source.body,i=n.length;let s=t+1,o=s,c="";for(;s<i;){const i=n.charCodeAt(s);if(34===i)return c+=n.slice(o,s),f(e,a.TokenKind.STRING,t,s+1,c);if(92!==i){if(10===i||13===i)break;if(u(i))++s;else{if(!l(n,s))throw(0,r.syntaxError)(e.source,s,`Invalid character within String: ${h(e,s)}.`);s+=2}}else{c+=n.slice(o,s);const t=117===n.charCodeAt(s+1)?123===n.charCodeAt(s+2)?_(e,s):A(e,s):b(e,s);c+=t.value,s+=t.size,o=s}}throw(0,r.syntaxError)(e.source,s,"Unterminated string.")}function _(e,t){const n=e.source.body;let i=0,s=3;for(;s<12;){const e=n.charCodeAt(t+s++);if(125===e){if(s<5||!u(i))break;return{value:String.fromCodePoint(i),size:s}}if(i=i<<4|N(e),i<0)break}throw(0,r.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+s)}".`)}function A(e,t){const n=e.source.body,i=O(n,t+2);if(u(i))return{value:String.fromCodePoint(i),size:6};if(d(i)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=O(n,t+8);if(p(e))return{value:String.fromCodePoint(i,e),size:12}}throw(0,r.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function O(e,t){return N(e.charCodeAt(t))<<12|N(e.charCodeAt(t+1))<<8|N(e.charCodeAt(t+2))<<4|N(e.charCodeAt(t+3))}function N(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function b(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,r.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function g(e,t){const n=e.source.body,i=n.length;let o=e.lineStart,c=t+3,d=c,p="";const y=[];for(;c<i;){const i=n.charCodeAt(c);if(34===i&&34===n.charCodeAt(c+1)&&34===n.charCodeAt(c+2)){p+=n.slice(d,c),y.push(p);const r=f(e,a.TokenKind.BLOCK_STRING,t,c+3,(0,s.dedentBlockStringLines)(y).join("\n"));return e.line+=y.length-1,e.lineStart=o,r}if(92!==i||34!==n.charCodeAt(c+1)||34!==n.charCodeAt(c+2)||34!==n.charCodeAt(c+3))if(10!==i&&13!==i)if(u(i))++c;else{if(!l(n,c))throw(0,r.syntaxError)(e.source,c,`Invalid character within String: ${h(e,c)}.`);c+=2}else p+=n.slice(d,c),y.push(p),13===i&&10===n.charCodeAt(c+1)?c+=2:++c,p="",d=c,o=c;else p+=n.slice(d,c),d=c+1,c+=4}throw(0,r.syntaxError)(e.source,c,"Unterminated string.")}function D(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(!(0,o.isNameContinue)(e))break;++i}return f(e,a.TokenKind.NAME,t,i,n.slice(t,i))}t.Lexer=c},16:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLocation=function(e,t){let n=0,s=1;for(const o of e.body.matchAll(i)){if("number"==typeof o.index||(0,r.invariant)(!1),o.index>=t)break;n=o.index+o[0].length,s+=1}return{line:s,column:t+1-n}};var r=n(706);const i=/\r\n|[\n\r]/g},370:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0,t.parse=function(e,t){return new l(e,t).parseDocument()},t.parseConstValue=function(e,t){const n=new l(e,t);n.expectToken(u.TokenKind.SOF);const r=n.parseConstValueLiteral();return n.expectToken(u.TokenKind.EOF),r},t.parseType=function(e,t){const n=new l(e,t);n.expectToken(u.TokenKind.SOF);const r=n.parseTypeReference();return n.expectToken(u.TokenKind.EOF),r},t.parseValue=function(e,t){const n=new l(e,t);n.expectToken(u.TokenKind.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(u.TokenKind.EOF),r};var r=n(338),i=n(807),s=n(333),o=n(828),a=n(274),c=n(412),u=n(175);class l{constructor(e,t){const n=(0,c.isSource)(e)?e:new c.Source(e);this._lexer=new a.Lexer(n),this._options=t}parseName(){const e=this.expectToken(u.TokenKind.NAME);return this.node(e,{kind:o.Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:o.Kind.DOCUMENT,definitions:this.many(u.TokenKind.SOF,this.parseDefinition,u.TokenKind.EOF)})}parseDefinition(){if(this.peek(u.TokenKind.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===u.TokenKind.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,r.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(u.TokenKind.BRACE_L))return this.node(e,{kind:o.Kind.OPERATION_DEFINITION,operation:i.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(u.TokenKind.NAME)&&(n=this.parseName()),this.node(e,{kind:o.Kind.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(u.TokenKind.NAME);switch(e.value){case"query":return i.OperationTypeNode.QUERY;case"mutation":return i.OperationTypeNode.MUTATION;case"subscription":return i.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(u.TokenKind.PAREN_L,this.parseVariableDefinition,u.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:o.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(u.TokenKind.DOLLAR),this.node(e,{kind:o.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:o.Kind.SELECTION_SET,selections:this.many(u.TokenKind.BRACE_L,this.parseSelection,u.TokenKind.BRACE_R)})}parseSelection(){return this.peek(u.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(u.TokenKind.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:o.Kind.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.TokenKind.PAREN_L,t,u.TokenKind.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(u.TokenKind.COLON),this.node(t,{kind:o.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(u.TokenKind.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(u.TokenKind.NAME)?this.node(e,{kind:o.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:o.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){var e;const t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacyFragmentVariables)?this.node(t,{kind:o.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:o.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case u.TokenKind.BRACKET_L:return this.parseList(e);case u.TokenKind.BRACE_L:return this.parseObject(e);case u.TokenKind.INT:return this._lexer.advance(),this.node(t,{kind:o.Kind.INT,value:t.value});case u.TokenKind.FLOAT:return this._lexer.advance(),this.node(t,{kind:o.Kind.FLOAT,value:t.value});case u.TokenKind.STRING:case u.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case u.TokenKind.NAME:switch(this._lexer.advance(),t.value){case"true":return this.node(t,{kind:o.Kind.BOOLEAN,value:!0});case"false":return this.node(t,{kind:o.Kind.BOOLEAN,value:!1});case"null":return this.node(t,{kind:o.Kind.NULL});default:return this.node(t,{kind:o.Kind.ENUM,value:t.value})}case u.TokenKind.DOLLAR:if(e){if(this.expectToken(u.TokenKind.DOLLAR),this._lexer.token.kind===u.TokenKind.NAME){const e=this._lexer.token.value;throw(0,r.syntaxError)(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this._lexer.advance(),this.node(e,{kind:o.Kind.STRING,value:e.value,block:e.kind===u.TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:o.Kind.LIST,values:this.any(u.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(e)),u.TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:o.Kind.OBJECT,fields:this.any(u.TokenKind.BRACE_L,(()=>this.parseObjectField(e)),u.TokenKind.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(u.TokenKind.COLON),this.node(t,{kind:o.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(u.TokenKind.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(u.TokenKind.AT),this.node(t,{kind:o.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(u.TokenKind.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(u.TokenKind.BRACKET_R),t=this.node(e,{kind:o.Kind.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(u.TokenKind.BANG)?this.node(e,{kind:o.Kind.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:o.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.TokenKind.STRING)||this.peek(u.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(u.TokenKind.BRACE_L,this.parseOperationTypeDefinition,u.TokenKind.BRACE_R);return this.node(e,{kind:o.Kind.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(u.TokenKind.COLON);const n=this.parseNamedType();return this.node(e,{kind:o.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:o.Kind.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:o.Kind.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.TokenKind.BRACE_L,this.parseFieldDefinition,u.TokenKind.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(u.TokenKind.COLON);const i=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:o.Kind.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:s})}parseArgumentDefs(){return this.optionalMany(u.TokenKind.PAREN_L,this.parseInputValueDef,u.TokenKind.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(u.TokenKind.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(u.TokenKind.EQUALS)&&(i=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:o.Kind.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:o.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:o.Kind.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(u.TokenKind.EQUALS)?this.delimitedMany(u.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:o.Kind.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(u.TokenKind.BRACE_L,this.parseEnumValueDefinition,u.TokenKind.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:o.Kind.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,r.syntaxError)(this._lexer.source,this._lexer.token.start,`${d(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:o.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(u.TokenKind.BRACE_L,this.parseInputValueDef,u.TokenKind.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===u.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(u.TokenKind.BRACE_L,this.parseOperationTypeDefinition,u.TokenKind.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:o.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:o.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:o.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:o.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:o.Kind.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:o.Kind.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:o.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.TokenKind.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(e,{kind:o.Kind.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:s})}parseDirectiveLocations(){return this.delimitedMany(u.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(s.DirectiveLocation,t.value))return t;throw this.unexpected(e)}node(e,t){var n;return!0!==(null===(n=this._options)||void 0===n?void 0:n.noLocation)&&(t.loc=new i.Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw(0,r.syntaxError)(this._lexer.source,t.start,`Expected ${p(e)}, found ${d(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this._lexer.advance(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==u.TokenKind.NAME||t.value!==e)throw(0,r.syntaxError)(this._lexer.source,t.start,`Expected "${e}", found ${d(t)}.`);this._lexer.advance()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===u.TokenKind.NAME&&t.value===e&&(this._lexer.advance(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return(0,r.syntaxError)(this._lexer.source,t.start,`Unexpected ${d(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}}function d(e){const t=e.value;return p(e.kind)+(null!=t?` "${t}"`:"")}function p(e){return(0,a.isPunctuatorTokenKind)(e)?`"${e}"`:e}t.Parser=l},38:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printLocation=function(e){return i(e.source,(0,r.getLocation)(e.source,e.start))},t.printSourceLocation=i;var r=n(16);function i(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${a}:${u}\n`,d=r.split(/\r\n|[\n\r]/g),p=d[i];if(p.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e<p.length;e+=80)n.push(p.slice(e,e+80));return l+s([[`${a} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return l+s([[a-1+" |",d[i-1]],[`${a} |`,p],["|","^".padStart(u)],[`${a+1} |`,d[i+1]]])}function s(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}},942:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printString=function(e){return`"${e.replace(n,r)}"`};const n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function r(e){return i[e.charCodeAt(0)]}const i=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]},33:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,s.visit)(e,o)};var r=n(849),i=n(942),s=n(285);const o={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>a(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=u("(",a(e.variableDefinitions,", "),")"),n=a([e.operation,a([e.name,t]),a(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+u(" = ",n)+u(" ",a(r," "))},SelectionSet:{leave:({selections:e})=>c(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const s=u("",e,": ")+t;let o=s+u("(",a(n,", "),")");return o.length>80&&(o=s+u("(\n",l(a(n,"\n")),"\n)")),a([o,a(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+u(" ",a(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>a(["...",u("on ",e),a(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${u("(",a(n,", "),")")} on ${t} ${u("",a(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,r.printBlockString)(e):(0,i.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+a(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+a(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+u("(",a(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>u("",e,"\n")+a(["schema",a(t," "),c(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>u("",e,"\n")+a(["scalar",t,a(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>u("",e,"\n")+a(["type",t,u("implements ",a(n," & ")),a(r," "),c(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>u("",e,"\n")+t+(d(n)?u("(\n",l(a(n,"\n")),"\n)"):u("(",a(n,", "),")"))+": "+r+u(" ",a(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>u("",e,"\n")+a([t+": "+n,u("= ",r),a(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>u("",e,"\n")+a(["interface",t,u("implements ",a(n," & ")),a(r," "),c(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>u("",e,"\n")+a(["union",t,a(n," "),u("= ",a(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>u("",e,"\n")+a(["enum",t,a(n," "),c(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>u("",e,"\n")+a([t,a(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>u("",e,"\n")+a(["input",t,a(n," "),c(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>u("",e,"\n")+"directive @"+t+(d(n)?u("(\n",l(a(n,"\n")),"\n)"):u("(",a(n,", "),")"))+(r?" repeatable":"")+" on "+a(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>a(["extend schema",a(e," "),c(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>a(["extend scalar",e,a(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>a(["extend type",e,u("implements ",a(t," & ")),a(n," "),c(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>a(["extend interface",e,u("implements ",a(t," & ")),a(n," "),c(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>a(["extend union",e,a(t," "),u("= ",a(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>a(["extend enum",e,a(t," "),c(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>a(["extend input",e,a(t," "),c(n)]," ")}};function a(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function c(e){return u("{\n",l(a(e,"\n")),"\n}")}function u(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function l(e){return u(" ",e.replace(/\n/g,"\n "))}function d(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}},412:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0,t.isSource=function(e){return(0,s.instanceOf)(e,o)};var r=n(242),i=n(2),s=n(752);class o{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||(0,r.devAssert)(!1,`Body must be a string. Received: ${(0,i.inspect)(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||(0,r.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,r.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}t.Source=o},175:(e,t)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0,t.TokenKind=n,function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(n||(t.TokenKind=n={}))},285:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BREAK=void 0,t.getEnterLeaveForKind=c,t.getVisitFn=function(e,t,n){const{enter:r,leave:i}=c(e,t);return n?i:r},t.visit=function(e,t,n=s.QueryDocumentKeys){const u=new Map;for(const e of Object.values(o.Kind))u.set(e,c(t,e));let l,d,p,h=Array.isArray(e),f=[e],y=-1,E=[],v=e;const T=[],m=[];do{y++;const e=y===f.length,o=e&&0!==E.length;if(e){if(d=0===m.length?void 0:T[T.length-1],v=p,p=m.pop(),o)if(h){v=v.slice();let e=0;for(const[t,n]of E){const r=t-e;null===n?(v.splice(r,1),e++):v[r]=n}}else{v=Object.defineProperties({},Object.getOwnPropertyDescriptors(v));for(const[e,t]of E)v[e]=t}y=l.index,f=l.keys,E=l.edits,h=l.inArray,l=l.prev}else if(p){if(d=h?y:f[y],v=p[d],null==v)continue;T.push(d)}let c;if(!Array.isArray(v)){var _,A;(0,s.isNode)(v)||(0,r.devAssert)(!1,`Invalid AST Node: ${(0,i.inspect)(v)}.`);const n=e?null===(_=u.get(v.kind))||void 0===_?void 0:_.leave:null===(A=u.get(v.kind))||void 0===A?void 0:A.enter;if(c=null==n?void 0:n.call(t,v,d,p,T,m),c===a)break;if(!1===c){if(!e){T.pop();continue}}else if(void 0!==c&&(E.push([d,c]),!e)){if(!(0,s.isNode)(c)){T.pop();continue}v=c}}var O;if(void 0===c&&o&&E.push([d,v]),e)T.pop();else l={inArray:h,index:y,keys:f,edits:E,prev:l},h=Array.isArray(v),f=h?v:null!==(O=n[v.kind])&&void 0!==O?O:[],y=-1,E=[],p&&m.push(p),p=v}while(void 0!==l);if(0!==E.length)return E[E.length-1][1];return e},t.visitInParallel=function(e){const t=new Array(e.length).fill(null),n=Object.create(null);for(const r of Object.values(o.Kind)){let i=!1;const s=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){const{enter:n,leave:a}=c(e[t],r);i||(i=null!=n||null!=a),s[t]=n,o[t]=a}if(!i)continue;const u={enter(...n){const r=n[0];for(let o=0;o<e.length;o++)if(null===t[o]){var i;const c=null===(i=s[o])||void 0===i?void 0:i.apply(e[o],n);if(!1===c)t[o]=r;else if(c===a)t[o]=a;else if(void 0!==c)return c}},leave(...n){const r=n[0];for(let s=0;s<e.length;s++)if(null===t[s]){var i;const r=null===(i=o[s])||void 0===i?void 0:i.apply(e[s],n);if(r===a)t[s]=a;else if(void 0!==r&&!1!==r)return r}else t[s]===r&&(t[s]=null)}};n[r]=u}return n};var r=n(242),i=n(2),s=n(807),o=n(828);const a=Object.freeze({});function c(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}t.BREAK=a}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{ApplicationConfigFetcher:()=>Y,DataUnitFetcher:()=>$,SankhyaAppProvider:()=>l});class e{static async showDialog(e,t,n=null,r,i=!1){return new Promise((s=>{let o=document.querySelector("ez-dialog");o||(o=document.createElement("ez-dialog"),window.document.body.appendChild(o)),o.show(e,t,i,r,n).then((e=>s(e)))}))}static async alert(t,n,r=null){return e.showDialog(t,n,r,!1,!1)}static async error(t,n,r=null){return e.showDialog(t,n,r,!1,!0)}static async confirm(t,n,r=null,i=!1){return e.showDialog(t,n,r,!0,i)}static async info(e){let t=document.querySelector("ez-toast");t||(t=document.createElement("ez-toast"),window.document.body.appendChild(t)),t.message=e,t.fadeTime=4e3,t.show()}}function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}function c(e,n){if(n&&("object"===t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(u,e);var t,n,r,c=a(u);function u(){return i(this,u),c.apply(this,arguments)}return t=u,r=[{key:"getResourceID",value:function(){return"br.com.sankhya.mge.cad.parceiro"}}],(n=null)&&s(t.prototype,n),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(e);const d=/^([+-])?(\d+).?(\d*)[eE]([-+]?\d+)$/;class p{}p.stringToNumber=e=>{if(""===e||null==e)return NaN;if(e){var t="-"===(e=e.toString()).charAt(0);if(""===(e=d.test(e)?e.replace(/^-/g,""):e.replace(/[^\d.,]/g,"")))return Number(NaN);var n=e.indexOf(","),r=e.indexOf(".");r>n?e=e.replace(",",""):r<n&&(e=e.replace(/\./g,"@").replace(",",".").replace(/@/g,"")),t&&(e="-"+e)}return Number(e)},p.format=(e,t,n=NaN)=>{if(""===e||void 0===e||"NaN"===e)return NaN.toString();let r=p.stringToNumber(e);if(NaN===r)return NaN.toString();if(t<0||Math.abs(Math.round(1*t)/1)!==t)return p.changeFormat(r.toString());let i,s=0;s=NaN===n||Math.abs(Math.round(1*n)/1)!==n?t:n,i=(Math.round(r*Math.pow(10,t))/Math.pow(10,t)).toLocaleString("pt-br",{minimumFractionDigits:t});const o=t-s;if(o>0)for(let e=0;e<o;e++)"0"==i.substring(i.length-1)&&t>0&&(i=i.substring(0,i.length-1));return"."!=i.substring(i.length-1)&&","!=i.substring(i.length-1)||(i=i.substring(0,i.length-1)),i},p.keepOnlyDecimalSeparator=(e,t="pt-BR")=>e="EN-US"===(t=t.toUpperCase())?e.replace(/\,/g,""):e.replace(/\./g,""),p.changeFormat=e=>e.replace(/\./g,"_").replace(/\,/g,".").replace(/\_/g,",");class h{constructor(e){this._mask="",this._maskChars=new Array,this.placeholder=" ",this.mask=e}set mask(e){this._mask=e,this.updateInternalMask()}get mask(){return this._mask}format(e){let t="";const n=[0];let r=0;const i=this._maskChars.length;for(;r<i;)t=this._maskChars[r].append(t,e,n),r++;return t}updateInternalMask(){if(this._maskChars.length=0,null!=this.mask){let e=0;const t=this.mask.length;for(;e<t;){let n=this.mask.charAt(e);switch(n){case h.DIGIT_KEY:this._maskChars.push(new h.DigitMaskCharacter(this,n));break;case h.LITERAL_KEY:++e<t&&(n=this.mask.charAt(e),this._maskChars.push(new h.LiteralCharacter(this,n)));break;case h.UPPERCASE_KEY:this._maskChars.push(new h.UpperCaseCharacter(this,n));break;case h.LOWERCASE_KEY:this._maskChars.push(new h.LowerCaseCharacter(this,n));break;case h.ALPHA_NUMERIC_KEY:this._maskChars.push(new h.AlphaNumericCharacter(this,n));break;case h.CHARACTER_KEY:this._maskChars.push(new h.CharCharacter(this,n));break;case h.ANYTHING_KEY:this._maskChars.push(new h.MaskCharacter(this,n));break;default:this._maskChars.push(new h.LiteralCharacter(this,n))}e++}}}}h.DIGIT_KEY="#",h.LITERAL_KEY="'",h.UPPERCASE_KEY="U",h.LOWERCASE_KEY="L",h.ALPHA_NUMERIC_KEY="A",h.CHARACTER_KEY="?",h.ANYTHING_KEY="*",h.MaskCharacter=class{constructor(e,t){this.maskFormatter=e,this.type=t}isLiteral(){return!1}isValidCharacter(e){return this.isLiteral()?this.getChar(e)==e:(e=this.getChar(e),!0)}getChar(e){return e}append(e,t,n){const r=n[0]<t.length?t.charAt(n[0]):"";if(this.isLiteral()){const t=this.getChar(r);e+=t,t===r&&(n[0]=n[0]+1)}else if(n[0]>=t.length)e+=this.maskFormatter.placeholder,n[0]=n[0]+1;else{if(!this.isValidCharacter(r))throw new Error(`Valor inválido: "${r}". Na posição ${n[0]+1} espera-se ${this.getFormatMessage()}.`);e+=this.getChar(r),n[0]=n[0]+1}return e}getFormatMessage(){let e;switch(this.type){case h.UPPERCASE_KEY:case h.LOWERCASE_KEY:case h.CHARACTER_KEY:e="uma letra";break;case h.DIGIT_KEY:e="um número";break;case h.ALPHA_NUMERIC_KEY:e="uma letra ou um número";break;default:e=""}return e}},h.LiteralCharacter=class extends h.MaskCharacter{constructor(e,t){super(e,t),this._fixedChar=t}isLiteral(){return!0}getChar(e){return this._fixedChar}},h.DigitMaskCharacter=class extends h.MaskCharacter{isValidCharacter(e){return this.isDigit(e)&&super.isValidCharacter(e)}isDigit(e){return e>="0"&&e<="9"}},h.UpperCaseCharacter=class extends h.MaskCharacter{isValidCharacter(e){return/[a-z]/i.test(e)&&super.isValidCharacter(e)}getChar(e){return e.toUpperCase()}},h.LowerCaseCharacter=class extends h.MaskCharacter{isValidCharacter(e){return/[a-z]/i.test(e)&&super.isValidCharacter(e)}getChar(e){return e.toLocaleLowerCase()}},h.AlphaNumericCharacter=class extends h.MaskCharacter{isValidCharacter(e){return/[a-z0-9]/i.test(e)&&super.isValidCharacter(e)}},h.CharCharacter=class extends h.MaskCharacter{isValidCharacter(e){return/[a-z]/i.test(e)&&super.isValidCharacter(e)}};new h("##:##");var f;!function(e){e[e.GET=0]="GET",e[e.PUT=1]="PUT",e[e.POST=2]="POST",e[e.DELETE=3]="DELETE"}(f||(f={}));class y{static callService(e,t){return new Promise(((n,r)=>{let i="mge";if(this._counter++,e.indexOf("@")>-1){var s=e.split("@");i=s[0],e=s[1]}let o=`http://192.168.1.218:8503/mge//${i}/service.sbr?serviceName=${e}&counter=${this._counter}&application=ListaTarefa&outputType=json&preventTransform=false`,a={serviceName:e,requestBody:t},c=new Headers;c.append("Content-Type","application/json"),fetch(o,{body:JSON.stringify(a),method:"POST",headers:c}).then((e=>e.json())).then((e=>{console.log(e)}))}))}}y._counter=0,y.STATUS_ERROR=0,y.STATUS_OK=1,y.STATUS_INFO=2,y.STATUS_TIMEOUT=3,y.STATUS_CANCELED=4;var E;!function(e){e.NUMBER="NUMBER",e.DATE="DATE",e.TEXT="TEXT",e.BOOLEAN="BOOLEAN",e.OBJECT="OBJECT"}(E||(E={}));var v;!function(e){e.LOADING_METADATA="loadingMetadata",e.METADATA_LOADED="metadataLoaded",e.LOADING_DATA="loadingData",e.DATA_LOADED="dataLoaded",e.SAVING_DATA="savingData",e.DATA_SAVED="dataSaved",e.RECORDS_REMOVED="recordsRemoved",e.RECORDS_ADDED="recordsAdded",e.DATA_CHANGED="dataChanged",e.EDITION_CANCELED="editionCanceled",e.CHANGE_UNDONE="changeUndone",e.CHANGE_REDONE="changeRedone",e.SELECTION_CHANGED="selectionChanged",e.NEXT_SELECTED="nextSelected",e.PREVIOUS_SELECTED="previousSelected",e.STATE_CHANGED="stateChanged"}(v||(v={}));new class{constructor(){this.sliceName=""}reduce(e,t,n){switch(n.type){case v.DATA_SAVED:case v.EDITION_CANCELED:e.clearUndo();break;case v.CHANGE_UNDONE:e.undo();break;case v.CHANGE_REDONE:e.redo()}}};new class{constructor(){this.sliceName="unitMetadata"}reduce(e,t,n){return n.type===v.METADATA_LOADED?n.payload:t}};const T=new class{constructor(){this.sliceName="hist::removedRecords"}reduce(e,t,n){switch(n.type){case v.RECORDS_REMOVED:return(t||[]).concat(n.payload);case v.EDITION_CANCELED:case v.DATA_SAVED:return}return t}},m=e=>e.select(T.sliceName,(e=>e));const _=new class{constructor(){this.sliceName="records"}reduce(e,t,n){switch(n.type){case v.DATA_LOADED:return n.payload;case v.DATA_SAVED:const t=new Map,r=A(e);if(r){const n=m(e)||[];r.forEach((e=>{n.includes(e.__record__id__)||t.set(e.__record__id__,e)}))}return n.payload.records.forEach((e=>{const n=e.__old__id__||e.__record__id__,r=Object.assign({},e);delete r.__old__id__,t.set(n,r)})),Array.from(t.values())}return t}},A=e=>e.select(_.sliceName,(e=>e));const O=new class{constructor(){this.sliceName="hist::addedRecords"}reduce(e,t,n){switch(n.type){case v.RECORDS_ADDED:const e=t?t.slice():[];return n.payload.forEach((t=>{e.push(Object.assign({__record__id__:"NEW_"+(e.length+1)},t))})),e;case v.DATA_SAVED:case v.EDITION_CANCELED:return}return t}};const N=new class{constructor(){this.sliceName="hist::changes"}reduce(e,t,n){switch(n.type){case v.DATA_CHANGED:const r=n.payload.records||k(e);if(r){const e=new Map(t);return r.forEach((t=>{e.set(t,Object.assign(Object.assign({},e.get(t)),n.payload))})),e}return t;case v.DATA_SAVED:case v.EDITION_CANCELED:return}return t}},b=e=>e.select(N.sliceName,(e=>e));const g=new class{constructor(){this.sliceName="currentRecords"}reduce(e,t,n){let r=A(e);const i=(e=>e.select(O.sliceName,(e=>e)))(e);if(!r&&!i)return;i&&(r=(r||[]).concat(i));const s=m(e);s&&(r=r.filter((e=>!s.includes(e.__record__id__))));const o=b(e);return new Map(r.map((e=>{const t=e.__record__id__;return[t,Object.assign(Object.assign({},e),null==o?void 0:o.get(t))]})))}},D=e=>e.select(g.sliceName,(e=>e));const I=new class{constructor(){this.sliceName="hist::selection"}reduce(e,t,n){switch(n.type){case v.DATA_SAVED:return function(e,t){const n=k(e);if(n){const e=[];return n.forEach((n=>{const r=t.find((e=>e.__old__id__===n));r?e.push(r.__record__id__):e.push(n)})),e}return n}(e,n.payload.records);case v.RECORDS_REMOVED:const r=n.payload;return t&&r?t.filter((e=>!r.includes(e))):t;case v.NEXT_SELECTED:case v.PREVIOUS_SELECTED:const i=D(e);if(i&&i.size>0){let e;if(e=t&&0!==t.length?C(t[0],i)+(n.type===v.PREVIOUS_SELECTED?-1:1):n.type===v.PREVIOUS_SELECTED?0:Math.min(1,i.size),e<i.size&&e>=0)return[Array.from(i.values())[e].__record__id__]}return;case v.SELECTION_CHANGED:const{type:s,selection:o}=n.payload;if(o&&"index"===s){const t=D(e);if(t){const e=Array.from(t.values()),n=[];return o.forEach((r=>{r>0&&r<t.size&&n.push(e[r].__record__id__)})),n}}return o}return t}},k=e=>{let t=e.select(I.sliceName,(e=>e));const n=Array.from((D(e)||new Map).keys());return t&&(t=t.filter((e=>n.includes(e)))),(!t||0===t.length)&&n&&n.length>0?[n[0]]:t};function C(e,t){return Array.from(t.keys()).indexOf(e)}var x,S,R,w;!function(e){e[e.INSERT=0]="INSERT",e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(x||(x={}));!function(e){e.ASC="ASC",e.DESC="DESC"}(S||(S={})),function(e){e.SEARCHING="SEARCHING",e.REQUIREMENT="REQUIREMENT",e.VISIBILITY="REQUIREMENT"}(R||(R={})),function(e){e.FILE="FILE",e.IMAGE="IMAGE",e.DATE="DATE",e.DATETIME="DATETIME",e.ELAPSEDTIME="ELAPSEDTIME",e.CHECKBOX="CHECKBOX",e.SWITCH="SWITCH",e.OPTIONSELECTOR="OPTIONSELECTOR",e.DECIMALNUMBER="DECIMALNUMBER",e.INTEGERNUMBER="INTEGERNUMBER",e.SEARCH="SEARCH",e.SHORTTEXT="SHORTTEXT",e.PASSWORD="PASSWORD",e.MASKEDTEXT="MASKEDTEXT",e.LONGTEXT="LONGTEXT",e.HTML="HTML"}(w||(w={}));var L,P,K=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class M{constructor(e="ez-application"){var t;this._state=L.DOM_LOADED,this._application=document.querySelector(e),null===this._application?(console.warn(`application${e} not found, then state is loadded`),this.onStatusChange(L.LOADED)):null===(t=this._application)||void 0===t||t.addEventListener("applicationLoaded",(()=>this.onStatusChange(L.LOADED))),this.onStatusChange(L.PRE_INITIALIZE)}onStatusChange(e){return K(this,void 0,void 0,(function*(){this._state=e,(M.listenersByType.get(e)||[]).forEach((e=>{e()}))}))}addListener(e,t){var n;M.listenersByType.has(e)||M.listenersByType.set(e,[]),null===(n=M.listenersByType.get(e))||void 0===n||n.push(t),e===this._state&&t()}onPreInitialize(e){return this.addListener(L.PRE_INITIALIZE,e),this}onLoaded(e){return this.addListener(L.LOADED,e),this}getStatus(){return this._state}isPreInitialize(){return this._state===L.PRE_INITIALIZE}isLoaded(){return this._state===L.LOADED}static get(e=P.APP_LOAD){return M.instanceByStatus.has(e)||M.instanceByStatus.set(e,new M),M.instanceByStatus.get(e)||new M}}M.instanceByStatus=new Map,M.listenersByType=new Map,function(e){e.DOM_LOADED="DOM_LOADED",e.PRE_INITIALIZE="PRE_INITIALIZE",e.LOADED="LOADED"}(L||(L={})),function(e){e.APP_LOAD="APP_LOAD"}(P||(P={}));var F,j=n(687),B=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class U{constructor(){U.loadStateManager=M.get(P.APP_LOAD),U.loadStateManager.onLoaded(this.onApplicationLoaded)}static get(){return U.instance||(U.instance=new U),U.instance}callGraphQL(e){var t;return B(this,void 0,void 0,(function*(){if(U.loadStateManager.isPreInitialize()){const n=this.getReqKey(e);return e.queryID=n,e.values.queryID=n,U.watingRequestsById.has(n)||U.watingRequestsById.set(n,new q(e)),null===(t=U.getWatingRequest(n))||void 0===t?void 0:t.promise}return new Promise((function(e){const t={name:"dd://br.com.sankhya.cad.parceiro/Parceiro",label:"Parceiro",fields:[{name:"CODPARC",label:"Cód. Parceiro",dataType:E.NUMBER},{name:"NOMEPARC",label:"Nome",dataType:E.TEXT,userInterface:w.LONGTEXT,required:!0},{name:"P",label:"pera",dataType:E.TEXT,userInterface:w.OPTIONSELECTOR,properties:{options:'{"M": "Madura", "V": "Verde", "P": "Passada"}'}},{name:"ME",label:"ME",dataType:E.NUMBER,userInterface:w.DECIMALNUMBER,properties:{precision:4,prettyPrecision:1}}]};setTimeout((()=>e(t)))}))}))}getReqKey(e){return window.btoa(this.hashCode(`${e.query}${JSON.stringify(e.values||"")}`)).replaceAll("=","")}static getQueryTemplate(e){return(e.query||"").replaceAll("$queryAlias$",e.queryID)}static getWatingRequest(e){return U.watingRequestsById.get(e)}onApplicationLoaded(){return B(this,void 0,void 0,(function*(){const e=[];let t;U.watingRequestsById.forEach((t=>B(this,void 0,void 0,(function*(){let n=U.getQueryTemplate(t.request);e.push({document:n,variables:Object.assign({},t.request.values)})}))));let n=[],r=[];try{t=yield(0,j.batchRequests)("http://localhost:8082/",e),t.forEach((e=>{n.push(e.data)}))}catch(e){t=e.response;const i=e.request;Object.entries(t).forEach((([e,t])=>{t.errors?r.push(t.errors.map((t=>(t.request=i,t.index=Number(e),t)))):t.data&&n.push(t.data)}))}r.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var n;((null===(n=U.getWatingRequest(t.request.variables[t.index].queryID))||void 0===n?void 0:n.reject)||Promise.reject)(t)}))})),n.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var n;((null===(n=U.getWatingRequest(e))||void 0===n?void 0:n.resolve)||Promise.resolve)(t)}))})),U.watingRequestsById.clear()}))}hashCode(e){var t,n=0;if(0===e.length)return n.toString();for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n.toString()}}U.watingRequestsById=new Map;class q{constructor(e){this._resolve=()=>{},this._reject=()=>{},this._request=void 0,this._request=e,this._promisse=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promisse}get request(){return this._request}}function V(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)}}var G,$=function(){function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,n="templateByQuery",r=new Map,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this.buldTemplates()}var t,n,r;return t=e,r=[{key:"bindTo",value:function(t,n){var r=new e;return t.metadataLoader=function(e){return r.getDataUnit(e,n)},r}}],(n=[{key:"buldTemplates",value:function(){var e,t;this.templateByQuery.set("getDataUnit",(0,j.gql)(F||(e=["query($name: String!) {\n $queryAlias$: getDataUnit(name: $name){\n name,\n cardinality,\n fields{\n name,\n defaultValue,\n label,\n readOnly,\n required,\n dataType,\n userInterface,\n properties{\n name,\n value\n },\n dependencies{\n masterFields,\n type,\n expression\n }\n }\n }\n }"],t||(t=e.slice(0)),F=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})))))}},{key:"getDataUnit",value:function(e,t){var n="dd://".concat(t,"/").concat(e);return U.get().callGraphQL({values:{name:n},query:this.templateByQuery.get("getDataUnit")})}}])&&V(t.prototype,n),r&&V(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function H(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)}}var Y=function(){function e(){var t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,n="templateByQuery",r=new Map,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this.buldTemplates()}var t,n,r;return t=e,(n=[{key:"buldTemplates",value:function(){var e,t;this.templateByQuery.set("getResource",(0,j.gql)(G||(e=["query($name: String!) {\n $queryAlias$: getResource(name: $name){\n name\n resource\n }\n }"],t||(t=e.slice(0)),G=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})))))}},{key:"getResource",value:function(e,t){var n="cfg://app/".concat(t,"/").concat(e);return U.get().callGraphQL({values:{name:n},query:this.templateByQuery.get("getResource")})}}])&&H(t.prototype,n),r&&H(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()})(),r})()));
2
+ //# sourceMappingURL=index.js.map