@aws-amplify/geo 1.3.12-size-improvement.21 → 1.3.12
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/CHANGELOG.md +8 -0
- package/dist/aws-amplify-geo.js +454 -339
- package/dist/aws-amplify-geo.js.map +1 -1
- package/dist/aws-amplify-geo.min.js +1 -1
- package/dist/aws-amplify-geo.min.js.map +1 -1
- package/lib-esm/Geo.js +52 -1
- package/lib-esm/Geo.js.map +1 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.js +56 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.js.map +1 -1
- package/lib-esm/util.js +16 -1
- package/lib-esm/util.js.map +1 -1
- package/package.json +3 -3
|
@@ -52,5 +52,5 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
52
52
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
53
53
|
PERFORMANCE OF THIS SOFTWARE.
|
|
54
54
|
***************************************************************************** */
|
|
55
|
-
var r=function(e,t){return(r=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,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=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}).apply(this,arguments)};function u(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}function a(e,t,n,r){var i,o=arguments.length,u=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(u=(o<3?i(u):o>3?i(t,n,u):i(t,n))||u);return o>3&&u&&Object.defineProperty(t,n,u),u}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function d(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function h(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function y(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],u=0,a=o.length;u<a;u++,i++)r[i]=o[u];return r}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function w(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof m?Promise.resolve(n.value.v).then(s,c):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function s(e){a("next",e)}function c(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function D(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function b(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function S(e){return e&&e.__esModule?e:{default:e}}function C(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function _(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMsWindow=void 0;var r=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];t.isMsWindow=function(e){if(function(e){return"MSInputMethodContext"in e&&"msCrypto"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,n=t.getRandomValues,i=t.subtle;return r.map((function(e){return i[e]})).concat(n).every((function(e){return"function"==typeof e}))}return!1}},function(e,t,n){"use strict";n.r(t),n.d(t,"Geo",(function(){return nu}));function r(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}var u=n(0),a=n(4),s=n.n(a),c=function(e,t){return(c=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)};function l(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}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var f=function(){return(f=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}).apply(this,arguments)};function d(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}function h(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))}function p(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;function v(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function y(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var m;Object.create;!function(e){e.ENV="env",e.CONFIG="shared config entry"}(m||(m={}));var w=function(e){if("boolean"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},D=function(e){var t=e.endpoint,n=e.urlParser;if("string"==typeof t){var r=Promise.resolve(n(t));return function(){return r}}if("object"==typeof t){var i=Promise.resolve(t);return function(){return i}}return t},b=function(e){var t,n=w(e.useDualstackEndpoint),r=e.endpoint,i=e.useFipsEndpoint;return f(f({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:r?D(f(f({},e),{endpoint:r})):function(){return function(e){return h(void 0,void 0,void 0,(function(){var t,n,r,i,o,u,a;return p(this,(function(s){switch(s.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(r=s.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw new Error("Invalid region in client config");return[4,e.useDualstackEndpoint()];case 2:return i=s.sent(),[4,e.useFipsEndpoint()];case 3:return o=s.sent(),[4,e.regionInfoProvider(r,{useDualstackEndpoint:i,useFipsEndpoint:o})];case 4:if(!(u=(null!==(a=s.sent())&&void 0!==a?a:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((n?"https:":"http:")+"//"+u)]}}))}))}(f(f({},e),{useDualstackEndpoint:n,useFipsEndpoint:i}))},isCustomEndpoint:!!r,useDualstackEndpoint:n})},E=function(e){return"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips"))},A=function(e){return E(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e},S=function(e,t){var n;void 0===e&&(e=[]);var r=t.useFipsEndpoint,i=t.useDualstackEndpoint;return null===(n=e.find((function(e){var t=e.tags;return r===t.includes("fips")&&i===t.includes("dualstack")})))||void 0===n?void 0:n.hostname},C=function(e,t){var n,r,i,o,u,a,s=t.useFipsEndpoint,c=void 0!==s&&s,l=t.useDualstackEndpoint,d=void 0!==l&&l,h=t.signingService,p=t.regionHash,v=t.partitionHash,g=function(e,t){var n,r=t.partitionHash;return null!==(n=Object.keys(r||{}).find((function(t){return r[t].regions.includes(e)})))&&void 0!==n?n:"aws"}(e,{partitionHash:v}),y=e in p?e:null!==(r=null===(n=v[g])||void 0===n?void 0:n.endpoint)&&void 0!==r?r:e,m={useFipsEndpoint:c,useDualstackEndpoint:d},w=function(e,t){var n=t.regionHostname,r=t.partitionHostname;return n||(r?r.replace("{region}",e):void 0)}(y,{regionHostname:S(null===(i=p[y])||void 0===i?void 0:i.variants,m),partitionHostname:S(null===(o=v[g])||void 0===o?void 0:o.variants,m)});if(void 0===w)throw new Error("Endpoint resolution failed for: "+{resolvedRegion:y,useFipsEndpoint:c,useDualstackEndpoint:d});var D=function(e,t){var n=t.signingRegion,r=t.regionRegex,i=t.useFipsEndpoint;if(n)return n;if(i){var o=r.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),u=e.match(o);if(u)return u[0].slice(1,-1)}}(w,{signingRegion:null===(u=p[y])||void 0===u?void 0:u.signingRegion,regionRegex:v[g].regionRegex,useFipsEndpoint:c});return f(f({partition:g,signingService:h,hostname:w},D&&{signingRegion:D}),(null===(a=p[y])||void 0===a?void 0:a.signingService)&&{signingService:p[y].signingService})},_=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.substr(-1)?e.protocol+":":e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/"+e.path:e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,n=new e(f(f({},this),{headers:f({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var r,i=t[n];return f(f({},e),((r={})[n]=Array.isArray(i)?y([],g(i)):i,r))}),{}))),n},e}();var F=function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers},e}();function P(e){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(e)}var x={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},B=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return h(t,void 0,void 0,(function(){var t,i,o,u,a;return p(this,(function(s){return t=r.request,_.isInstance(t)&&(i=t.body,o=t.headers,i&&-1===Object.keys(o).map((function(e){return e.toLowerCase()})).indexOf("content-length")&&void 0!==(u=e(i))&&(t.headers=f(f({},t.headers),((a={})["content-length"]=String(u),a)))),[2,n(f(f({},r),{request:t}))]}))}))}}}(e.bodyLengthChecker),x)}}};var T,M={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},L=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return h(void 0,void 0,void 0,(function(){var r,i;return p(this,(function(o){return _.isInstance(n.request)?(r=n.request,i=(e.requestHandler.metadata||{}).handlerProtocol,(void 0===i?"":i).indexOf("h2")>=0&&!r.headers[":authority"]?(delete r.headers.host,r.headers[":authority"]=""):r.headers.host||(r.headers.host=r.hostname),[2,t(n)]):[2,t(n)]}))}))}}}(e),M)}}},O={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},R=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return h(void 0,void 0,void 0,(function(){var r,i,o,u,a,s,c,l,f;return p(this,(function(h){switch(h.label){case 0:return r=t.clientName,i=t.commandName,o=t.inputFilterSensitiveLog,u=t.logger,a=t.outputFilterSensitiveLog,[4,e(n)];case 1:return s=h.sent(),u?("function"==typeof u.info&&(c=s.output,l=c.$metadata,f=d(c,["$metadata"]),u.info({clientName:r,commandName:i,input:o(n.input),output:a(f),metadata:l})),[2,s]):[2,s]}}))}))}}),O)}}};!function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(T||(T={}));var k,N=T.STANDARD,I=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],j=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],U=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],G=[500,502,503,504],z=function(e){var t,n;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||j.includes(e.name)||1==(null===(n=e.$retryable)||void 0===n?void 0:n.throttling)},H=function(){function e(e){var t,n,r,i,o;this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=null!==(t=null==e?void 0:e.beta)&&void 0!==t?t:.7,this.minCapacity=null!==(n=null==e?void 0:e.minCapacity)&&void 0!==n?n:1,this.minFillRate=null!==(r=null==e?void 0:e.minFillRate)&&void 0!==r?r:.5,this.scaleConstant=null!==(i=null==e?void 0:e.scaleConstant)&&void 0!==i?i:.4,this.smooth=null!==(o=null==e?void 0:e.smooth)&&void 0!==o?o:.8;var u=this.getCurrentTimeInSeconds();this.lastThrottleTime=u,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}return e.prototype.getCurrentTimeInSeconds=function(){return Date.now()/1e3},e.prototype.getSendToken=function(){return h(this,void 0,void 0,(function(){return p(this,(function(e){return[2,this.acquireTokenBucket(1)]}))}))},e.prototype.acquireTokenBucket=function(e){return h(this,void 0,void 0,(function(){var t;return p(this,(function(n){switch(n.label){case 0:return this.enabled?(this.refillTokenBucket(),e>this.currentCapacity?(t=(e-this.currentCapacity)/this.fillRate*1e3,[4,new Promise((function(e){return setTimeout(e,t)}))]):[3,2]):[2];case 1:n.sent(),n.label=2;case 2:return this.currentCapacity=this.currentCapacity-e,[2]}}))}))},e.prototype.refillTokenBucket=function(){var e=this.getCurrentTimeInSeconds();if(this.lastTimestamp){var t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}else this.lastTimestamp=e},e.prototype.updateClientSendingRate=function(e){var t;if(this.updateMeasuredRate(),z(e)){var n=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=n,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(n),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());var r=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(r)},e.prototype.calculateTimeWindow=function(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))},e.prototype.cubicThrottle=function(e){return this.getPrecise(e*this.beta)},e.prototype.cubicSuccess=function(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)},e.prototype.enableTokenBucket=function(){this.enabled=!0},e.prototype.updateTokenBucketRate=function(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)},e.prototype.updateMeasuredRate=function(){var e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){var n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}},e.prototype.getPrecise=function(e){return parseFloat(e.toFixed(8))},e}(),q=new Uint8Array(16);function $(){if(!k&&!(k="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return k(q)}var W=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var V=function(e){return"string"==typeof e&&W.test(e)},Y=[],K=0;K<256;++K)Y.push((K+256).toString(16).substr(1));var Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Y[e[t+0]]+Y[e[t+1]]+Y[e[t+2]]+Y[e[t+3]]+"-"+Y[e[t+4]]+Y[e[t+5]]+"-"+Y[e[t+6]]+Y[e[t+7]]+"-"+Y[e[t+8]]+Y[e[t+9]]+"-"+Y[e[t+10]]+Y[e[t+11]]+Y[e[t+12]]+Y[e[t+13]]+Y[e[t+14]]+Y[e[t+15]]).toLowerCase();if(!V(n))throw TypeError("Stringified UUID is invalid");return n};var J=function(e,t,n){var r=(e=e||{}).random||(e.rng||$)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return Z(r)},Q=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},X=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return I.includes(e.name)}(e)||z(e)||function(e){var t;return U.includes(e.name)||G.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},ee=function(){function e(e,t){var n,r,i;this.maxAttemptsProvider=e,this.mode=T.STANDARD,this.retryDecider=null!==(n=null==t?void 0:t.retryDecider)&&void 0!==n?n:X,this.delayDecider=null!==(r=null==t?void 0:t.delayDecider)&&void 0!==r?r:Q,this.retryQuota=null!==(i=null==t?void 0:t.retryQuota)&&void 0!==i?i:function(e,t){var n,r,i,o=e,u=null!==(n=null==t?void 0:t.noRetryIncrement)&&void 0!==n?n:1,a=null!==(r=null==t?void 0:t.retryCost)&&void 0!==r?r:5,s=null!==(i=null==t?void 0:t.timeoutRetryCost)&&void 0!==i?i:10,c=e,l=function(e){return"TimeoutError"===e.name?s:a},f=function(e){return l(e)<=c};return Object.freeze({hasRetryTokens:f,retrieveRetryTokens:function(e){if(!f(e))throw new Error("No retry token available");var t=l(e);return c-=t,t},releaseRetryTokens:function(e){c+=null!=e?e:u,c=Math.min(c,o)}})}(500)}return e.prototype.shouldRetry=function(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return h(this,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=t.sent(),[3,3];case 2:return t.sent(),e=3,[3,3];case 3:return[2,e]}}))}))},e.prototype.retry=function(e,t,n){return h(this,void 0,void 0,(function(){var r,i,o,u,a,s,c,l;return p(this,(function(f){switch(f.label){case 0:return i=0,o=0,[4,this.getMaxAttempts()];case 1:u=f.sent(),a=t.request,_.isInstance(a)&&(a.headers["amz-sdk-invocation-id"]=J()),s=function(){var s,l,f,d,h,v;return p(this,(function(p){switch(p.label){case 0:return p.trys.push([0,4,,7]),_.isInstance(a)&&(a.headers["amz-sdk-request"]="attempt="+(i+1)+"; max="+u),(null==n?void 0:n.beforeRequest)?[4,n.beforeRequest()]:[3,2];case 1:p.sent(),p.label=2;case 2:return[4,e(t)];case 3:return s=p.sent(),l=s.response,f=s.output,(null==n?void 0:n.afterRequest)&&n.afterRequest(l),c.retryQuota.releaseRetryTokens(r),f.$metadata.attempts=i+1,f.$metadata.totalRetryDelay=o,[2,{value:{response:l,output:f}}];case 4:return d=p.sent(),h=te(d),i++,c.shouldRetry(h,i,u)?(r=c.retryQuota.retrieveRetryTokens(h),v=c.delayDecider(z(h)?500:100,i),o+=v,[4,new Promise((function(e){return setTimeout(e,v)}))]):[3,6];case 5:return p.sent(),[2,"continue"];case 6:throw h.$metadata||(h.$metadata={}),h.$metadata.attempts=i,h.$metadata.totalRetryDelay=o,h;case 7:return[2]}}))},c=this,f.label=2;case 2:return[5,s()];case 3:return"object"==typeof(l=f.sent())?[2,l.value]:[3,2];case 4:return[2]}}))}))},e}(),te=function(e){return e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):"string"==typeof e?new Error(e):new Error("AWS SDK error wrapper for "+e)},ne=function(e){function t(t,n){var r=this,i=null!=n?n:{},o=i.rateLimiter,u=d(i,["rateLimiter"]);return(r=e.call(this,t,u)||this).rateLimiter=null!=o?o:new H,r.mode=T.ADAPTIVE,r}return l(t,e),t.prototype.retry=function(t,n){return h(this,void 0,void 0,(function(){var r=this;return p(this,(function(i){return[2,e.prototype.retry.call(this,t,n,{beforeRequest:function(){return h(r,void 0,void 0,(function(){return p(this,(function(e){return[2,this.rateLimiter.getSendToken()]}))}))},afterRequest:function(e){r.rateLimiter.updateClientSendingRate(e)}})]}))}))},t}(ee),re=function(e){return h(void 0,void 0,void 0,(function(){return p(this,(function(t){switch(t.label){case 0:return"string"==typeof e?[2,e]:[4,e()];case 1:return[2,t.sent()]}}))}))},ie=function(e){if(void 0===e&&(e=3),"number"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},oe={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},ue=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,n){return function(r){return h(void 0,void 0,void 0,(function(){var i;return p(this,(function(o){switch(o.label){case 0:return[4,e.retryStrategy()];case 1:return(null==(i=o.sent())?void 0:i.mode)&&(n.userAgent=y(y([],g(n.userAgent||[])),[["cfg/retry-mode",i.mode]])),[2,i.retry(t,r)]}}))}))}}}(e),oe)}}},ae=function(e,t){return(ae=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)};function se(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}ae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function ce(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))}function le(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;Object.create;(function(e){function t(t,n){void 0===n&&(n=!0);var r=e.call(this,t)||this;return r.tryNextLink=n,r}se(t,e),t.from=function(e,t){return void 0===t&&(t=!0),Object.defineProperty(e,"tryNextLink",{value:t,configurable:!1,enumerable:!1,writable:!1}),e}})(Error),function(e){function t(t,n){void 0===n&&(n=!0);var r=e.call(this,t)||this;return r.tryNextLink=n,r.name="CredentialsProviderError",r}se(t,e),t.from=function(e,t){return void 0===t&&(t=!0),Object.defineProperty(e,"tryNextLink",{value:t,configurable:!1,enumerable:!1,writable:!1}),e}}(Error);for(var fe=function(e,t,n){var r,i,o,u=function(){return ce(void 0,void 0,void 0,(function(){return le(this,(function(t){switch(t.label){case 0:i||(i=e()),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,i];case 2:return r=t.sent(),o=!0,[3,4];case 3:return i=void 0,[7];case 4:return[2,r]}}))}))};if(void 0===t)return function(){return ce(void 0,void 0,void 0,(function(){return le(this,(function(e){switch(e.label){case 0:return o?[3,2]:[4,u()];case 1:r=e.sent(),e.label=2;case 2:return[2,r]}}))}))};var a=!1;return function(){return ce(void 0,void 0,void 0,(function(){return le(this,(function(e){switch(e.label){case 0:return o?[3,2]:[4,u()];case 1:r=e.sent(),e.label=2;case 2:return a?[2,r]:n&&!n(r)?(a=!0,[2,r]):t(r)?[4,u()]:[3,4];case 3:return e.sent(),[2,r];case 4:return[2,r]}}))}))}},de={},he={},pe=0;pe<256;pe++){var ve=pe.toString(16).toLowerCase();1===ve.length&&(ve="0"+ve),de[pe]=ve,he[ve]=pe}function ge(e){for(var t="",n=0;n<e.byteLength;n++)t+=de[e[n]];return t}var ye="X-Amz-Date".toLowerCase(),me=["authorization",ye,"date"],we="X-Amz-Signature".toLowerCase(),De="X-Amz-Security-Token".toLowerCase(),be={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Ee=/^proxy-/,Ae=/^sec-/,Se="AWS4-HMAC-SHA256-PAYLOAD",Ce={},_e=[],Fe=function(e,t,n){return e+"/"+t+"/"+n+"/aws4_request"},Pe=function(e,t,n){var r=new e(t);return r.update(n),r.digest()},xe=function(e,t,n){var r,i,o=e.headers,u={};try{for(var a=v(Object.keys(o).sort()),s=a.next();!s.done;s=a.next()){var c=s.value,l=c.toLowerCase();(l in be||(null==t?void 0:t.has(l))||Ee.test(l)||Ae.test(l))&&(!n||n&&!n.has(l))||(u[l]=o[c].trim().replace(/\s+/g," "))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return u},Be=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,Te)},Te=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()},Me=function(e,t){var n=e.headers,r=e.body;return h(void 0,void 0,void 0,(function(){var e,i,o,u,a,s,c;return p(this,(function(l){switch(l.label){case 0:try{for(e=v(Object.keys(n)),i=e.next();!i.done;i=e.next())if("x-amz-content-sha256"===(o=i.value).toLowerCase())return[2,n[o]]}catch(e){s={error:e}}finally{try{i&&!i.done&&(c=e.return)&&c.call(e)}finally{if(s)throw s.error}}return null!=r?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof r||ArrayBuffer.isView(r)||(f=r,"function"==typeof ArrayBuffer&&f instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(f))?((u=new t).update(r),a=ge,[4,u.digest()]):[3,3];case 2:return[2,a.apply(void 0,[l.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var f}))}))},Le=function(e){var t=e.headers,n=e.query,r=d(e,["headers","query"]);return f(f({},r),{headers:f({},t),query:n?Oe(n):void 0})},Oe=function(e){return Object.keys(e).reduce((function(t,n){var r,i=e[n];return f(f({},t),((r={})[n]=Array.isArray(i)?y([],g(i)):i,r))}),{})},Re=function(e){var t,n;e="function"==typeof e.clone?e.clone():Le(e);try{for(var r=v(Object.keys(e.headers)),i=r.next();!i.done;i=r.next()){var o=i.value;me.indexOf(o.toLowerCase())>-1&&delete e.headers[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e},ke=function(e){return"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e},Ne=function(){function e(e){var t=e.applyChecksum,n=e.credentials,r=e.region,i=e.service,o=e.sha256,u=e.uriEscapePath,a=void 0===u||u;this.service=i,this.sha256=o,this.uriEscapePath=a,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}(r),this.credentialProvider=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),h(this,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d,h,g,y,m,w,D,b,E,A,S,C,_,F,P;return p(this,(function(p){switch(p.label){case 0:return n=t.signingDate,r=void 0===n?new Date:n,i=t.expiresIn,o=void 0===i?3600:i,u=t.unsignableHeaders,a=t.unhoistableHeaders,s=t.signableHeaders,c=t.signingRegion,l=t.signingService,[4,this.credentialProvider()];case 1:return d=p.sent(),null==c?[3,2]:(g=c,[3,4]);case 2:return[4,this.regionProvider()];case 3:g=p.sent(),p.label=4;case 4:return h=g,y=Ie(r),m=y.longDate,w=y.shortDate,o>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(D=Fe(w,h,null!=l?l:this.service),b=function(e,t){var n,r,i;void 0===t&&(t={});var o="function"==typeof e.clone?e.clone():Le(e),u=o.headers,a=o.query,s=void 0===a?{}:a;try{for(var c=v(Object.keys(u)),l=c.next();!l.done;l=c.next()){var d=l.value,h=d.toLowerCase();"x-amz-"!==h.substr(0,6)||(null===(i=t.unhoistableHeaders)||void 0===i?void 0:i.has(h))||(s[d]=u[d],delete u[d])}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return f(f({},e),{headers:u,query:s})}(Re(e),{unhoistableHeaders:a}),d.sessionToken&&(b.query["X-Amz-Security-Token"]=d.sessionToken),b.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",b.query["X-Amz-Credential"]=d.accessKeyId+"/"+D,b.query["X-Amz-Date"]=m,b.query["X-Amz-Expires"]=o.toString(10),E=xe(b,u,s),b.query["X-Amz-SignedHeaders"]=je(E),A=b.query,S="X-Amz-Signature",C=this.getSignature,_=[m,D,this.getSigningKey(d,h,w,l)],F=this.createCanonicalRequest,P=[b,E],[4,Me(e,this.sha256)]);case 5:return[4,C.apply(this,_.concat([F.apply(this,P.concat([p.sent()]))]))];case 6:return A[S]=p.sent(),[2,b]}}))}))},e.prototype.sign=function(e,t){return h(this,void 0,void 0,(function(){return p(this,(function(n){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]}))}))},e.prototype.signEvent=function(e,t){var n=e.headers,r=e.payload,i=t.signingDate,o=void 0===i?new Date:i,u=t.priorSignature,a=t.signingRegion,s=t.signingService;return h(this,void 0,void 0,(function(){var e,t,i,c,l,f,d,h,v,g,y;return p(this,(function(p){switch(p.label){case 0:return null==a?[3,1]:(t=a,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=p.sent(),p.label=3;case 3:return e=t,i=Ie(o),c=i.shortDate,l=i.longDate,f=Fe(c,e,null!=s?s:this.service),[4,Me({headers:{},body:r},this.sha256)];case 4:return d=p.sent(),(h=new this.sha256).update(n),g=ge,[4,h.digest()];case 5:return v=g.apply(void 0,[p.sent()]),y=[Se,l,f,u,v,d].join("\n"),[2,this.signString(y,{signingDate:o,signingRegion:e,signingService:s})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,i=void 0===r?new Date:r,o=n.signingRegion,u=n.signingService;return h(this,void 0,void 0,(function(){var t,n,r,a,s,c,l,f;return p(this,(function(d){switch(d.label){case 0:return[4,this.credentialProvider()];case 1:return t=d.sent(),null==o?[3,2]:(r=o,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=d.sent(),d.label=4;case 4:return n=r,a=Ie(i).shortDate,l=(c=this.sha256).bind,[4,this.getSigningKey(t,n,a,u)];case 5:return(s=new(l.apply(c,[void 0,d.sent()]))).update(e),f=ge,[4,s.digest()];case 6:return[2,f.apply(void 0,[d.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,i=void 0===r?new Date:r,o=n.signableHeaders,u=n.unsignableHeaders,a=n.signingRegion,s=n.signingService;return h(this,void 0,void 0,(function(){var t,n,r,c,l,f,d,h,g,y,m;return p(this,(function(p){switch(p.label){case 0:return[4,this.credentialProvider()];case 1:return t=p.sent(),null==a?[3,2]:(r=a,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=p.sent(),p.label=4;case 4:return n=r,c=Re(e),l=Ie(i),f=l.longDate,d=l.shortDate,h=Fe(d,n,null!=s?s:this.service),c.headers[ye]=f,t.sessionToken&&(c.headers[De]=t.sessionToken),[4,Me(c,this.sha256)];case 5:return g=p.sent(),!function(e,t){var n,r;e=e.toLowerCase();try{for(var i=v(Object.keys(t)),o=i.next();!o.done;o=i.next()){if(e===o.value.toLowerCase())return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1}("x-amz-content-sha256",c.headers)&&this.applyChecksum&&(c.headers["x-amz-content-sha256"]=g),y=xe(c,u,o),[4,this.getSignature(f,h,this.getSigningKey(t,n,d,s),this.createCanonicalRequest(c,y,g))];case 6:return m=p.sent(),c.headers.authorization="AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+h+", SignedHeaders="+je(y)+", Signature="+m,[2,c]}}))}))},e.prototype.createCanonicalRequest=function(e,t,n){var r=Object.keys(t).sort();return e.method+"\n"+this.getCanonicalPath(e)+"\n"+function(e){var t,n,r=e.query,i=void 0===r?{}:r,o=[],u={},a=function(e){if(e.toLowerCase()===we)return"continue";o.push(e);var t=i[e];"string"==typeof t?u[e]=Be(e)+"="+Be(t):Array.isArray(t)&&(u[e]=t.slice(0).sort().reduce((function(t,n){return t.concat([Be(e)+"="+Be(n)])}),[]).join("&"))};try{for(var s=v(Object.keys(i).sort()),c=s.next();!c.done;c=s.next()){a(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o.map((function(e){return u[e]})).filter((function(e){return e})).join("&")}(e)+"\n"+r.map((function(e){return e+":"+t[e]})).join("\n")+"\n\n"+r.join(";")+"\n"+n},e.prototype.createStringToSign=function(e,t,n){return h(this,void 0,void 0,(function(){var r,i;return p(this,(function(o){switch(o.label){case 0:return(r=new this.sha256).update(n),[4,r.digest()];case 1:return i=o.sent(),[2,"AWS4-HMAC-SHA256\n"+e+"\n"+t+"\n"+ge(i)]}}))}))},e.prototype.getCanonicalPath=function(e){var t=e.path;return this.uriEscapePath?"/"+encodeURIComponent(t.replace(/^\//,"")).replace(/%2F/g,"/"):t},e.prototype.getSignature=function(e,t,n,r){return h(this,void 0,void 0,(function(){var i,o,u,a,s;return p(this,(function(c){switch(c.label){case 0:return[4,this.createStringToSign(e,t,r)];case 1:return i=c.sent(),a=(u=this.sha256).bind,[4,n];case 2:return(o=new(a.apply(u,[void 0,c.sent()]))).update(i),s=ge,[4,o.digest()];case 3:return[2,s.apply(void 0,[c.sent()])]}}))}))},e.prototype.getSigningKey=function(e,t,n,r){return function(e,t,n,r,i){return h(void 0,void 0,void 0,(function(){var o,u,a,s,c,l,f,d,h;return p(this,(function(p){switch(p.label){case 0:return[4,Pe(e,t.secretAccessKey,t.accessKeyId)];case 1:if(o=p.sent(),(u=n+":"+r+":"+i+":"+ge(o)+":"+t.sessionToken)in Ce)return[2,Ce[u]];for(_e.push(u);_e.length>50;)delete Ce[_e.shift()];a="AWS4"+t.secretAccessKey,p.label=2;case 2:p.trys.push([2,7,8,9]),s=v([n,r,i,"aws4_request"]),c=s.next(),p.label=3;case 3:return c.done?[3,6]:(l=c.value,[4,Pe(e,a,l)]);case 4:a=p.sent(),p.label=5;case 5:return c=s.next(),[3,3];case 6:return[3,9];case 7:return f=p.sent(),d={error:f},[3,9];case 8:try{c&&!c.done&&(h=s.return)&&h.call(s)}finally{if(d)throw d.error}return[7];case 9:return[2,Ce[u]=a]}}))}))}(this.sha256,e,n,t,r||this.service)},e}(),Ie=function(e){var t,n=(t=e,ke(t).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");return{longDate:n,shortDate:n.substr(0,8)}},je=function(e){return Object.keys(e).sort().join(";")},Ue=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},Ge=function(e){return"function"==typeof e?fe(e,(function(e){return void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5}),(function(e){return void 0!==e.expiration})):Ue(e)},ze=function(e){return new Date(Date.now()+e)},He=function(e,t){var n=Date.parse(e);return function(e,t){return Math.abs(ze(t).getTime()-e)>=3e5}(n,t)?n-Date.now():t},qe=function(e){var t,n,r;return F.isInstance(e)?null!==(n=null===(t=e.headers)||void 0===t?void 0:t.date)&&void 0!==n?n:null===(r=e.headers)||void 0===r?void 0:r.Date:void 0},$e={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},We=function(e){return{applyToStack:function(t){t.addRelativeTo(function(e){return function(t,n){return function(r){return h(this,void 0,void 0,(function(){var i,o,u,a,s,c;return p(this,(function(l){switch(l.label){case 0:return _.isInstance(r.request)?[4,e.signer()]:[2,t(r)];case 1:return i=l.sent(),u=t,a=[f({},r)],c={},[4,i.sign(r.request,{signingDate:ze(e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 2:return[4,u.apply(void 0,[f.apply(void 0,a.concat([(c.request=l.sent(),c)]))]).catch((function(t){var n,r=null!==(n=t.ServerTime)&&void 0!==n?n:qe(t.$response);throw r&&(e.systemClockOffset=He(r,e.systemClockOffset)),t}))];case 3:return o=l.sent(),(s=qe(o.response))&&(e.systemClockOffset=He(s,e.systemClockOffset)),[2,o]}}))}))}}}(e),$e)}}};var Ve=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,Ye=function(e){var t=g(e,2),n=t[0],r=t[1],i=n.indexOf("/"),o=n.substring(0,i),u=n.substring(i+1);return"api"===o&&(u=u.toLowerCase()),[o,u,r].filter((function(e){return e&&e.length>0})).map((function(e){return null==e?void 0:e.replace(Ve,"_")})).join("/")},Ke={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Ze=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(r){return h(void 0,void 0,void 0,(function(){var i,o,u,a,s,c,l,d,h;return p(this,(function(p){switch(p.label){case 0:return i=r.request,_.isInstance(i)?(o=i.headers,u=(null===(d=null==t?void 0:t.userAgent)||void 0===d?void 0:d.map(Ye))||[],[4,n.defaultUserAgentProvider()]):[2,e(r)];case 1:return a=p.sent().map(Ye),s=(null===(h=null==n?void 0:n.customUserAgent)||void 0===h?void 0:h.map(Ye))||[],c=y(y(y([],g(a)),g(u)),g(s)).join(" "),l=y(y([],g(a.filter((function(e){return e.startsWith("aws-sdk-")})))),g(s)).join(" "),"browser"!==n.runtime?(l&&(o["x-amz-user-agent"]=o["x-amz-user-agent"]?o["user-agent"]+" "+l:l),o["user-agent"]=c):o["x-amz-user-agent"]=c,[2,e(f(f({},r),{request:i}))]}}))}))}}),Ke)}}},Je=function(){var e=[],t=[],n=new Set,r=function(n){return e.forEach((function(e){n.add(e.middleware,f({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,f({},e))})),n},i=function(e){var t=[];return e.before.forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,y([],g(i(e))))})),t.push(e),e.after.reverse().forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,y([],g(i(e))))})),t},o=function(){var n,r=[],o=[],u={};return e.forEach((function(e){var t=f(f({},e),{before:[],after:[]});t.name&&(u[t.name]=t),r.push(t)})),t.forEach((function(e){var t=f(f({},e),{before:[],after:[]});t.name&&(u[t.name]=t),o.push(t)})),o.forEach((function(e){if(e.toMiddleware){var t=u[e.toMiddleware];if(void 0===t)throw new Error(e.toMiddleware+" is not found when adding "+(e.name||"anonymous")+" middleware "+e.relation+" "+e.toMiddleware);"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}})),(n=r,n.sort((function(e,t){return Qe[t.step]-Qe[e.step]||Xe[t.priority||"normal"]-Xe[e.priority||"normal"]}))).map(i).reduce((function(e,t){return e.push.apply(e,y([],g(t))),e}),[]).map((function(e){return e.middleware}))},u={add:function(t,r){void 0===r&&(r={});var i=r.name,o=r.override,u=f({step:"initialize",priority:"normal",middleware:t},r);if(i){if(n.has(i)){if(!o)throw new Error("Duplicate middleware name '"+i+"'");var a=e.findIndex((function(e){return e.name===i})),s=e[a];if(s.step!==u.step||s.priority!==u.priority)throw new Error('"'+i+'" middleware with '+s.priority+" priority in "+s.step+" step cannot be overridden by same-name middleware with "+u.priority+" priority in "+u.step+" step.");e.splice(a,1)}n.add(i)}e.push(u)},addRelativeTo:function(e,r){var i=r.name,o=r.override,u=f({middleware:e},r);if(i){if(n.has(i)){if(!o)throw new Error("Duplicate middleware name '"+i+"'");var a=t.findIndex((function(e){return e.name===i})),s=t[a];if(s.toMiddleware!==u.toMiddleware||s.relation!==u.relation)throw new Error('"'+i+'" middleware '+s.relation+' "'+s.toMiddleware+'" middleware cannot be overridden by same-name middleware '+u.relation+' "'+u.toMiddleware+'" middleware.');t.splice(a,1)}n.add(i)}t.push(u)},clone:function(){return r(Je())},use:function(e){e.applyToStack(u)},remove:function(r){return"string"==typeof r?function(r){var i=!1,o=function(e){return!e.name||e.name!==r||(i=!0,n.delete(r),!1)};return e=e.filter(o),t=t.filter(o),i}(r):function(r){var i=!1,o=function(e){return e.middleware!==r||(i=!0,e.name&&n.delete(e.name),!1)};return e=e.filter(o),t=t.filter(o),i}(r)},removeByTag:function(r){var i=!1,o=function(e){var t=e.tags,o=e.name;return!t||!t.includes(r)||(o&&n.delete(o),i=!0,!1)};return e=e.filter(o),t=t.filter(o),i},concat:function(e){var t=r(Je());return t.use(e),t},applyToStack:r,resolve:function(e,t){var n,r;try{for(var i=v(o().reverse()),u=i.next();!u.done;u=i.next()){e=(0,u.value)(e,t)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e}};return u},Qe={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Xe={high:3,normal:2,low:1},et=function(){function e(e){this.middlewareStack=Je(),this.config=e}return e.prototype.send=function(e,t,n){var r="function"!=typeof t?t:void 0,i="function"==typeof t?t:n,o=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!i)return o(e).then((function(e){return e.output}));o(e).then((function(e){return i(null,e.output)}),(function(e){return i(e)})).catch((function(){}))},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),tt=function(){this.middlewareStack=Je()},nt="***SensitiveInformation***",rt=function(e){if(null!=e){if("boolean"==typeof e)return e;throw new TypeError("Expected boolean, got "+typeof e)}},it=function(e){if(null!=e){if("number"==typeof e)return e;throw new TypeError("Expected number, got "+typeof e)}},ot=Math.ceil(Math.pow(2,127)*(2-Math.pow(2,-23))),ut=function(e){var t=it(e);if(void 0!==t&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>ot)throw new TypeError("Expected 32-bit float, got "+e);return t},at=function(e){if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError("Expected integer, got "+typeof e)}},st=function(e){return ft(e,32)},ct=function(e){return ft(e,16)},lt=function(e){return ft(e,8)},ft=function(e,t){var n=at(e);if(void 0!==n&&dt(n,t)!==n)throw new TypeError("Expected "+t+"-bit integer, got "+e);return n},dt=function(e,t){switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},ht=function(e,t){if(null==e){if(t)throw new TypeError("Expected a non-null value for "+t);throw new TypeError("Expected a non-null value")}return e},pt=function(e){if(null!=e){if("object"==typeof e&&!Array.isArray(e))return e;throw new TypeError("Expected object, got "+typeof e)}},vt=function(e){if(null!=e){if("string"==typeof e)return e;throw new TypeError("Expected string, got "+typeof e)}},gt=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,yt=function(e){var t=e.match(gt);if(null===t||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},mt=function(e){return"string"==typeof e?wt(e):it(e)},wt=function(e){switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error("Unable to parse float value: "+e)}},Dt=function(e){return ct("string"==typeof e?yt(e):e)},bt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var Et=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),At=function(e){if(null!=e){if("string"!=typeof e)throw new TypeError("RFC-3339 date-times must be expressed as strings");var t=Et.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");var n=g(t,8),r=(n[0],n[1]),i=n[2],o=n[3],u=n[4],a=n[5],s=n[6],c=n[7],l=Dt(Bt(r)),f=Pt(i,"month",1,12),d=Pt(o,"day",1,31);return St(l,f,d,{hours:u,minutes:a,seconds:s,fractionalMilliseconds:c})}},St=(new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),function(e,t,n,r){var i=t-1;return _t(e,i,n),new Date(Date.UTC(e,i,n,Pt(r.hours,"hour",0,23),Pt(r.minutes,"minute",0,59),Pt(r.seconds,"seconds",0,60),xt(r.fractionalMilliseconds)))}),Ct=[31,28,31,30,31,30,31,31,30,31,30,31],_t=function(e,t,n){var r=Ct[t];if(1===t&&Ft(e)&&(r=29),n>r)throw new TypeError("Invalid day for "+bt[t]+" in "+e+": "+n)},Ft=function(e){return e%4==0&&(e%100!=0||e%400==0)},Pt=function(e,t,n,r){var i=function(e){return lt("string"==typeof e?yt(e):e)}(Bt(e));if(i<n||i>r)throw new TypeError(t+" must be between "+n+" and "+r+", inclusive");return i},xt=function(e){return null==e?0:1e3*function(e){return ut("string"==typeof e?yt(e):e)}("0."+e)},Bt=function(e){for(var t=0;t<e.length-1&&"0"===e.charAt(t);)t++;return 0===t?e:e.slice(t)},Tt=function(e){switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}};n(5);function Mt(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}var Lt=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,y([null],g(arguments))),n=new t;return Object.setPrototypeOf(n,e.prototype),n};Lt.prototype=Object.create(String.prototype,{constructor:{value:Lt,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(Lt,String);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}l(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"==typeof e?e:JSON.stringify(e))}}(Lt);var Ot=function(e){if(e!=e)return"NaN";switch(e){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return e}};var Rt=n(13),kt=n(12);for(var Nt=function(){function e(e){var t=this;"function"==typeof e?this.configProvider=function(){return h(t,void 0,void 0,(function(){return p(this,(function(t){switch(t.label){case 0:return[4,e()];case 1:return[2,t.sent()||{}]}}))}))}:this.config=null!=e?e:{}}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal;return h(this,void 0,void 0,(function(){var t,r,i,o,u,a,s,c,l,f,d,h;return p(this,(function(p){switch(p.label){case 0:return this.config||!this.configProvider?[3,2]:(t=this,[4,this.configProvider()]);case 1:t.config=p.sent(),p.label=2;case 2:return r=this.config.requestTimeout,(null==n?void 0:n.aborted)?((i=new Error("Request aborted")).name="AbortError",[2,Promise.reject(i)]):(o=e.path,e.query&&(u=function(e){var t,n,r=[];try{for(var i=v(Object.keys(e).sort()),o=i.next();!o.done;o=i.next()){var u=o.value,a=e[u];if(u=Be(u),Array.isArray(a))for(var s=0,c=a.length;s<c;s++)r.push(u+"="+Be(a[s]));else{var l=u;(a||"string"==typeof a)&&(l+="="+Be(a)),r.push(l)}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r.join("&")}(e.query))&&(o+="?"+u),a=e.port,s=e.method,c=e.protocol+"//"+e.hostname+(a?":"+a:"")+o,l="GET"===s||"HEAD"===s?void 0:e.body,f={body:l,headers:new Headers(e.headers),method:s},"undefined"!=typeof AbortController&&(f.signal=n),d=new Request(c,f),h=[fetch(d).then((function(e){var t,n,r=e.headers,i={};try{for(var o=v(r.entries()),u=o.next();!u.done;u=o.next()){var a=u.value;i[a[0]]=a[1]}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new F({headers:i,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new F({headers:i,statusCode:e.status,body:t})}}))})),(g=r,void 0===g&&(g=0),new Promise((function(e,t){g&&setTimeout((function(){var e=new Error("Request did not complete within "+g+" ms");e.name="TimeoutError",t(e)}),g)})))],n&&h.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),[2,Promise.race(h)])}var g}))}))},e}(),It={},jt=new Array(64),Ut=0,Gt="A".charCodeAt(0),zt="Z".charCodeAt(0);Ut+Gt<=zt;Ut++){var Ht=String.fromCharCode(Ut+Gt);It[Ht]=Ut,jt[Ut]=Ht}for(Ut=0,Gt="a".charCodeAt(0),zt="z".charCodeAt(0);Ut+Gt<=zt;Ut++){Ht=String.fromCharCode(Ut+Gt);var qt=Ut+26;It[Ht]=qt,jt[qt]=Ht}for(Ut=0;Ut<10;Ut++){It[Ut.toString(10)]=Ut+52;Ht=Ut.toString(10),qt=Ut+52;It[Ht]=qt,jt[qt]=Ht}It["+"]=62,jt[62]="+",It["/"]=63,jt[63]="/";function $t(e){var t=e.length/4*3;"=="===e.substr(-2)?t-=2:"="===e.substr(-1)&&t--;for(var n=new ArrayBuffer(t),r=new DataView(n),i=0;i<e.length;i+=4){for(var o=0,u=0,a=i,s=i+3;a<=s;a++)if("="!==e[a]){if(!(e[a]in It))throw new TypeError("Invalid character "+e[a]+" in base64 string.");o|=It[e[a]]<<6*(s-a),u+=6}else o>>=6;var c=i/4*3;o>>=u%8;for(var l=Math.floor(u/8),f=0;f<l;f++){var d=8*(l-f-1);r.setUint8(c+f,(o&255<<d)>>d)}}return new Uint8Array(n)}function Wt(e){for(var t="",n=0;n<e.length;n+=3){for(var r=0,i=0,o=n,u=Math.min(n+3,e.length);o<u;o++)r|=e[o]<<8*(u-o-1),i+=8;var a=Math.ceil(i/6);r<<=6*a-i;for(var s=1;s<=a;s++){var c=6*(a-s);t+=jt[(r&63<<c)>>c]}t+="==".slice(0,4-a)}return t}var Vt=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return h(this,void 0,void 0,(function(){var t,n;return p(this,(function(r){switch(r.label){case 0:return[4,Yt(e)];case 1:return t=r.sent(),n=$t(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return h(this,void 0,void 0,(function(){var t,n,r,i,o,u,a;return p(this,(function(s){switch(s.label){case 0:t=new Uint8Array(0),n=e.getReader(),r=!1,s.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return i=s.sent(),o=i.done,(u=i.value)&&(a=t,(t=new Uint8Array(a.length+u.length)).set(a),t.set(u,a.length)),r=o,[3,1];case 3:return[2,t]}}))}))}(e)};function Yt(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){var e;if(2!==r.readyState)return n(new Error("Reader aborted too early"));var i=null!==(e=r.result)&&void 0!==e?e:"",o=i.indexOf(","),u=o>-1?o+1:i.length;t(i.substring(u))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)}))}function Kt(e){if("string"==typeof e){for(var t=e.length,n=t-1;n>=0;n--){var r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2)}return t}return"number"==typeof e.byteLength?e.byteLength:"number"==typeof e.size?e.size:void 0}var Zt=n(1),Jt=n.n(Zt),Qt=function(e){var t=e.serviceId,n=e.clientVersion;return function(){return h(void 0,void 0,void 0,(function(){var e,r,i,o,u,a,s,c,l;return p(this,(function(f){return e="undefined"!=typeof window&&(null===(i=null===window||void 0===window?void 0:window.navigator)||void 0===i?void 0:i.userAgent)?Jt.a.parse(window.navigator.userAgent):void 0,r=[["aws-sdk-js",n],["os/"+((null===(o=null==e?void 0:e.os)||void 0===o?void 0:o.name)||"other"),null===(u=null==e?void 0:e.os)||void 0===u?void 0:u.version],["lang/js"],["md/browser",(null!==(s=null===(a=null==e?void 0:e.browser)||void 0===a?void 0:a.name)&&void 0!==s?s:"unknown")+"_"+(null!==(l=null===(c=null==e?void 0:e.browser)||void 0===c?void 0:c.version)&&void 0!==l?l:"unknown")]],t&&r.push(["api/"+t,n]),[2,r]}))}))}};var Xt=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192,63&i|128);else if(n+1<e.length&&55296==(64512&i)&&56320==(64512&e.charCodeAt(n+1))){var o=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(i>>12|224,i>>6&63|128,63&i|128)}return Uint8Array.from(t)}(e)},en=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var i=e[n];if(i<128)t+=String.fromCharCode(i);else if(192<=i&&i<224){var o=e[++n];t+=String.fromCharCode((31&i)<<6|63&o)}else if(240<=i&&i<365){var u="%"+[i,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(u)}else t+=String.fromCharCode((15&i)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)};var tn=function(e){var t,n=new URL(e),r=n.hostname,i=n.pathname,o=n.port,u=n.protocol,a=n.search;return a&&(t=function(e){var t,n,r={};if(e=e.replace(/^\?/,""))try{for(var i=v(e.split("&")),o=i.next();!o.done;o=i.next()){var u=g(o.value.split("="),2),a=u[0],s=u[1],c=void 0===s?null:s;a=decodeURIComponent(a),c&&(c=decodeURIComponent(c)),a in r?Array.isArray(r[a])?r[a].push(c):r[a]=[r[a],c]:r[a]=c}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(a)),{hostname:r,port:o?parseInt(o):void 0,protocol:u,path:i,query:t}},nn={},rn={aws:{regions:["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-southeast-1","ap-southeast-2","ap-southeast-3","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"],regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",variants:[{hostname:"geo.{region}.amazonaws.com",tags:[]},{hostname:"geo-fips.{region}.amazonaws.com",tags:["fips"]},{hostname:"geo-fips.{region}.api.aws",tags:["dualstack","fips"]},{hostname:"geo.{region}.api.aws",tags:["dualstack"]}]},"aws-cn":{regions:["cn-north-1","cn-northwest-1"],regionRegex:"^cn\\-\\w+\\-\\d+$",variants:[{hostname:"geo.{region}.amazonaws.com.cn",tags:[]},{hostname:"geo-fips.{region}.amazonaws.com.cn",tags:["fips"]},{hostname:"geo-fips.{region}.api.amazonwebservices.com.cn",tags:["dualstack","fips"]},{hostname:"geo.{region}.api.amazonwebservices.com.cn",tags:["dualstack"]}]},"aws-iso":{regions:["us-iso-east-1","us-iso-west-1"],regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",variants:[{hostname:"geo.{region}.c2s.ic.gov",tags:[]},{hostname:"geo-fips.{region}.c2s.ic.gov",tags:["fips"]}]},"aws-iso-b":{regions:["us-isob-east-1"],regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",variants:[{hostname:"geo.{region}.sc2s.sgov.gov",tags:[]},{hostname:"geo-fips.{region}.sc2s.sgov.gov",tags:["fips"]}]},"aws-us-gov":{regions:["us-gov-east-1","us-gov-west-1"],regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",variants:[{hostname:"geo.{region}.amazonaws.com",tags:[]},{hostname:"geo-fips.{region}.amazonaws.com",tags:["fips"]},{hostname:"geo-fips.{region}.api.aws",tags:["dualstack","fips"]},{hostname:"geo.{region}.api.aws",tags:["dualstack"]}]}},on=function(e,t){return h(void 0,void 0,void 0,(function(){return p(this,(function(n){return[2,C(e,f(f({},t),{signingService:"geo",regionHash:nn,partitionHash:rn}))]}))}))};function un(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))}function an(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;Object.create;var sn,cn,ln,fn,dn,hn,pn,vn,gn,yn,mn,wn,Dn,bn,En,An,Sn,Cn,_n,Fn,Pn,xn,Bn,Tn,Mn,Ln,On,Rn,kn,Nn,In,jn,Un,Gn,zn,Hn,qn,$n,Wn,Vn,Yn,Kn,Zn,Jn,Qn,Xn,er,tr,nr,rr,ir,or,ur,ar,sr,cr,lr,fr,dr,hr,pr,vr,gr,yr,mr,wr,Dr,br,Er,Ar,Sr,Cr,_r,Fr,Pr,xr,Br,Tr,Mr,Lr,Or,Rr,kr,Nr,Ir,jr,Ur,Gr,zr,Hr,qr,$r,Wr,Vr,Yr,Kr,Zr,Jr,Qr,Xr,ei,ti,ni,ri,ii,oi,ui,ai,si,ci,li,fi,di,hi,pi,vi,gi,yi,mi,wi,Di,bi,Ei,Ai,Si,Ci,_i,Fi,Pi,xi,Bi,Ti,Mi,Li,Oi,Ri,ki,Ni,Ii,ji,Ui,Gi,zi,Hi,qi,$i,Wi,Vi=["in-region","cross-region","mobile","standard","legacy"],Yi=function(){var e,t,n="undefined"!=typeof window&&(null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.userAgent)?Jt.a.parse(window.navigator.userAgent):void 0,r=null===(t=null==n?void 0:n.platform)||void 0===t?void 0:t.type;return"tablet"===r||"mobile"===r},Ki=function(e){var t,n,r,i,o,u,a,s,c,l,d,v,g,y,m,w,D=function(e){var t=(void 0===e?{}:e).defaultsMode;return fe((function(){return un(void 0,void 0,void 0,(function(){var e,n;return an(this,(function(r){switch(r.label){case 0:return"function"!=typeof t?[3,2]:[4,t()];case 1:return n=r.sent(),[3,3];case 2:n=t,r.label=3;case 3:switch(null==(e=n)?void 0:e.toLowerCase()){case"auto":return[2,Promise.resolve(Yi()?"mobile":"standard")];case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return[2,Promise.resolve(null==e?void 0:e.toLocaleLowerCase())];case void 0:return[2,Promise.resolve("legacy")];default:throw new Error('Invalid parameter for "defaultsMode", expect '+Vi.join(", ")+", got "+e)}return[2]}}))}))}))}(e),b=function(){return D().then(Tt)},E=function(e){var t,n,r,i,o;return{apiVersion:"2020-11-19",disableHostPrefix:null!==(t=null==e?void 0:e.disableHostPrefix)&&void 0!==t&&t,logger:null!==(n=null==e?void 0:e.logger)&&void 0!==n?n:{},regionInfoProvider:null!==(r=null==e?void 0:e.regionInfoProvider)&&void 0!==r?r:on,serviceId:null!==(i=null==e?void 0:e.serviceId)&&void 0!==i?i:"Location",urlParser:null!==(o=null==e?void 0:e.urlParser)&&void 0!==o?o:tn}}(e);return f(f(f({},E),e),{runtime:"browser",defaultsMode:D,base64Decoder:null!==(t=null==e?void 0:e.base64Decoder)&&void 0!==t?t:$t,base64Encoder:null!==(n=null==e?void 0:e.base64Encoder)&&void 0!==n?n:Wt,bodyLengthChecker:null!==(r=null==e?void 0:e.bodyLengthChecker)&&void 0!==r?r:Kt,credentialDefaultProvider:null!==(i=null==e?void 0:e.credentialDefaultProvider)&&void 0!==i?i:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:null!==(o=null==e?void 0:e.defaultUserAgentProvider)&&void 0!==o?o:Qt({serviceId:E.serviceId,clientVersion:Rt.version}),maxAttempts:null!==(u=null==e?void 0:e.maxAttempts)&&void 0!==u?u:3,region:null!==(a=null==e?void 0:e.region)&&void 0!==a?a:(w="Region is missing",function(){return Promise.reject(w)}),requestHandler:null!==(s=null==e?void 0:e.requestHandler)&&void 0!==s?s:new Nt(b),retryMode:null!==(c=null==e?void 0:e.retryMode)&&void 0!==c?c:function(){return h(void 0,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return[2,e.sent().retryMode||N]}}))}))},sha256:null!==(l=null==e?void 0:e.sha256)&&void 0!==l?l:kt.Sha256,streamCollector:null!==(d=null==e?void 0:e.streamCollector)&&void 0!==d?d:Vt,useDualstackEndpoint:null!==(v=null==e?void 0:e.useDualstackEndpoint)&&void 0!==v?v:function(){return Promise.resolve(!1)},useFipsEndpoint:null!==(g=null==e?void 0:e.useFipsEndpoint)&&void 0!==g?g:function(){return Promise.resolve(!1)},utf8Decoder:null!==(y=null==e?void 0:e.utf8Decoder)&&void 0!==y?y:Xt,utf8Encoder:null!==(m=null==e?void 0:e.utf8Encoder)&&void 0!==m?m:en})},Zi=function(e){function t(t){var n,r,i=this,o=function(e){var t=e.region,n=e.useFipsEndpoint;if(!t)throw new Error("Region is missing");return f(f({},e),{region:function(){return h(void 0,void 0,void 0,(function(){var e;return p(this,(function(n){switch(n.label){case 0:return"string"==typeof t?[2,A(t)]:[4,t()];case 1:return e=n.sent(),[2,A(e)]}}))}))},useFipsEndpoint:function(){return h(void 0,void 0,void 0,(function(){var e;return p(this,(function(r){switch(r.label){case 0:return"string"!=typeof t?[3,1]:(e=t,[3,3]);case 1:return[4,t()];case 2:e=r.sent(),r.label=3;case 3:return E(e)?[2,!0]:[2,"boolean"==typeof n?Promise.resolve(n):n()]}}))}))}})}(Ki(t)),u=b(o),a=function(e){return f(f({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}(function(e){var t,n=e.credentials?Ge(e.credentials):e.credentialDefaultProvider(e),r=e.signingEscapePath,i=void 0===r||r,o=e.systemClockOffset,u=void 0===o?e.systemClockOffset||0:o,a=e.sha256;return t=e.signer?Ue(e.signer):function(){return Ue(e.region)().then((function(t){return h(void 0,void 0,void 0,(function(){var n,r,i,o;return p(this,(function(u){switch(u.label){case 0:return r=(n=e).regionInfoProvider,i=[t],o={},[4,e.useFipsEndpoint()];case 1:return o.useFipsEndpoint=u.sent(),[4,e.useDualstackEndpoint()];case 2:return[4,r.apply(n,i.concat([(o.useDualstackEndpoint=u.sent(),o)]))];case 3:return[2,[u.sent()||{},t]]}}))}))})).then((function(t){var r=g(t,2),o=r[0],u=r[1],s=o.signingRegion,c=o.signingService;e.signingRegion=e.signingRegion||s||u,e.signingName=e.signingName||c||e.serviceId;var l=f(f({},e),{credentials:n,region:e.signingRegion,service:e.signingName,sha256:a,uriEscapePath:i});return new(e.signerConstructor||Ne)(l)}))},f(f({},e),{systemClockOffset:u,signingEscapePath:i,credentials:n,signer:t})}((r=ie((n=u).maxAttempts),f(f({},n),{maxAttempts:r,retryStrategy:function(){return h(void 0,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return n.retryStrategy?[2,n.retryStrategy]:[4,re(n.retryMode)];case 1:return e.sent()===T.ADAPTIVE?[2,new ne(r)]:[2,new ee(r)]}}))}))}}))));return(i=e.call(this,a)||this).config=a,i.middlewareStack.use(ue(i.config)),i.middlewareStack.use(B(i.config)),i.middlewareStack.use(L(i.config)),i.middlewareStack.use(R(i.config)),i.middlewareStack.use(We(i.config)),i.middlewareStack.use(Ze(i.config)),i}return l(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(et),Ji={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Qi={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Xi(e,t,n){return{applyToStack:function(r){r.add(function(e,t){return function(n,r){return function(r){return h(void 0,void 0,void 0,(function(){var i,o,u;return p(this,(function(a){switch(a.label){case 0:return[4,n(r)];case 1:i=a.sent().response,a.label=2;case 2:return a.trys.push([2,4,,5]),[4,t(i,e)];case 3:return o=a.sent(),[2,{response:i,output:o}];case 4:throw u=a.sent(),Object.assign(u,{$response:i});case 5:return[2]}}))}))}}}(e,n),Ji),r.add(function(e,t){return function(n,r){return function(r){return h(void 0,void 0,void 0,(function(){var i;return p(this,(function(o){switch(o.label){case 0:return[4,t(r.input,e)];case 1:return i=o.sent(),[2,n(f(f({},r),{request:i}))]}}))}))}}}(e,t),Qi)}}}(sn||(sn={})).filterSensitiveLog=function(e){return f({},e)},(cn||(cn={})).filterSensitiveLog=function(e){return f({},e)},(ln||(ln={})).filterSensitiveLog=function(e){return f({},e)},(fn||(fn={})).filterSensitiveLog=function(e){return f({},e)},(dn||(dn={})).filterSensitiveLog=function(e){return f({},e)},(hn||(hn={})).filterSensitiveLog=function(e){return f({},e)},(pn||(pn={})).filterSensitiveLog=function(e){return f({},e)},(vn||(vn={})).filterSensitiveLog=function(e){return f({},e)},(gn||(gn={})).filterSensitiveLog=function(e){return f({},e)},(yn||(yn={})).filterSensitiveLog=function(e){return f({},e)},(mn||(mn={})).filterSensitiveLog=function(e){return f({},e)},(wn||(wn={})).filterSensitiveLog=function(e){return f(f(f({},e),e.Position&&{Position:nt}),e.PositionProperties&&{PositionProperties:nt})},(Dn||(Dn={})).filterSensitiveLog=function(e){return f(f({},e),e.DevicePositionUpdates&&{DevicePositionUpdates:e.DevicePositionUpdates.map((function(e){return wn.filterSensitiveLog(e)}))})},(bn||(bn={})).filterSensitiveLog=function(e){return f({},e)},(En||(En={})).filterSensitiveLog=function(e){return f({},e)},(An||(An={})).filterSensitiveLog=function(e){return f({},e)},(Sn||(Sn={})).filterSensitiveLog=function(e){return f(f(f({},e),e.Position&&{Position:nt}),e.PositionProperties&&{PositionProperties:nt})},(Cn||(Cn={})).filterSensitiveLog=function(e){return f({},e)},(_n||(_n={})).filterSensitiveLog=function(e){return f(f({},e),e.DevicePositions&&{DevicePositions:e.DevicePositions.map((function(e){return Sn.filterSensitiveLog(e)}))})},(Fn||(Fn={})).filterSensitiveLog=function(e){return f(f({},e),e.Polygon&&{Polygon:e.Polygon.map((function(e){return nt}))})},(Pn||(Pn={})).filterSensitiveLog=function(e){return f(f({},e),e.Geometry&&{Geometry:Fn.filterSensitiveLog(e.Geometry)})},(xn||(xn={})).filterSensitiveLog=function(e){return f(f({},e),e.Entries&&{Entries:e.Entries.map((function(e){return Pn.filterSensitiveLog(e)}))})},(Bn||(Bn={})).filterSensitiveLog=function(e){return f({},e)},(Tn||(Tn={})).filterSensitiveLog=function(e){return f({},e)},(Mn||(Mn={})).filterSensitiveLog=function(e){return f({},e)},(Ln||(Ln={})).filterSensitiveLog=function(e){return f(f({},e),e.Updates&&{Updates:e.Updates.map((function(e){return wn.filterSensitiveLog(e)}))})},(On||(On={})).filterSensitiveLog=function(e){return f({},e)},(Rn||(Rn={})).filterSensitiveLog=function(e){return f({},e)},(kn||(kn={})).filterSensitiveLog=function(e){return f({},e)},(Nn||(Nn={})).filterSensitiveLog=function(e){return f({},e)},(In||(In={})).filterSensitiveLog=function(e){return f({},e)},(jn||(jn={})).filterSensitiveLog=function(e){return f({},e)},(Un||(Un={})).filterSensitiveLog=function(e){return f(f(f(f({},e),e.DeparturePosition&&{DeparturePosition:nt}),e.DestinationPosition&&{DestinationPosition:nt}),e.WaypointPositions&&{WaypointPositions:nt})},(Gn||(Gn={})).filterSensitiveLog=function(e){return f(f({},e),e.LineString&&{LineString:nt})},(zn||(zn={})).filterSensitiveLog=function(e){return f(f(f({},e),e.StartPosition&&{StartPosition:nt}),e.EndPosition&&{EndPosition:nt})},(Hn||(Hn={})).filterSensitiveLog=function(e){return f(f(f(f(f({},e),e.StartPosition&&{StartPosition:nt}),e.EndPosition&&{EndPosition:nt}),e.Geometry&&{Geometry:Gn.filterSensitiveLog(e.Geometry)}),e.Steps&&{Steps:e.Steps.map((function(e){return zn.filterSensitiveLog(e)}))})},(qn||(qn={})).filterSensitiveLog=function(e){return f(f({},e),e.RouteBBox&&{RouteBBox:nt})},($n||($n={})).filterSensitiveLog=function(e){return f(f(f({},e),e.Legs&&{Legs:e.Legs.map((function(e){return Hn.filterSensitiveLog(e)}))}),e.Summary&&{Summary:qn.filterSensitiveLog(e.Summary)})},(Wn||(Wn={})).filterSensitiveLog=function(e){return f(f(f({},e),e.DeparturePositions&&{DeparturePositions:nt}),e.DestinationPositions&&{DestinationPositions:nt})},(Vn||(Vn={})).filterSensitiveLog=function(e){return f({},e)},(Yn||(Yn={})).filterSensitiveLog=function(e){return f({},e)},(Kn||(Kn={})).filterSensitiveLog=function(e){return f({},e)},(Zn||(Zn={})).filterSensitiveLog=function(e){return f(f(f({},e),e.SnappedDeparturePositions&&{SnappedDeparturePositions:nt}),e.SnappedDestinationPositions&&{SnappedDestinationPositions:nt})},(Jn||(Jn={})).filterSensitiveLog=function(e){return f({},e)},(Qn||(Qn={})).filterSensitiveLog=function(e){return f({},e)},(Xn||(Xn={})).filterSensitiveLog=function(e){return f({},e)},(er||(er={})).filterSensitiveLog=function(e){return f({},e)},(tr||(tr={})).filterSensitiveLog=function(e){return f({},e)},(nr||(nr={})).filterSensitiveLog=function(e){return f({},e)},(rr||(rr={})).filterSensitiveLog=function(e){return f({},e)},(ir||(ir={})).filterSensitiveLog=function(e){return f({},e)},(or||(or={})).filterSensitiveLog=function(e){return f({},e)},(ur||(ur={})).filterSensitiveLog=function(e){return f({},e)},(ar||(ar={})).filterSensitiveLog=function(e){return f({},e)},(sr||(sr={})).filterSensitiveLog=function(e){return f({},e)},(cr||(cr={})).filterSensitiveLog=function(e){return f({},e)},(lr||(lr={})).filterSensitiveLog=function(e){return f({},e)},(fr||(fr={})).filterSensitiveLog=function(e){return f({},e)},(dr||(dr={})).filterSensitiveLog=function(e){return f({},e)},(hr||(hr={})).filterSensitiveLog=function(e){return f({},e)},(pr||(pr={})).filterSensitiveLog=function(e){return f({},e)},(vr||(vr={})).filterSensitiveLog=function(e){return f({},e)},(gr||(gr={})).filterSensitiveLog=function(e){return f({},e)},(yr||(yr={})).filterSensitiveLog=function(e){return f({},e)},(mr||(mr={})).filterSensitiveLog=function(e){return f({},e)},(wr||(wr={})).filterSensitiveLog=function(e){return f({},e)},(Dr||(Dr={})).filterSensitiveLog=function(e){return f({},e)},(br||(br={})).filterSensitiveLog=function(e){return f({},e)},(Er||(Er={})).filterSensitiveLog=function(e){return f({},e)},(Ar||(Ar={})).filterSensitiveLog=function(e){return f({},e)},(Sr||(Sr={})).filterSensitiveLog=function(e){return f({},e)},(Cr||(Cr={})).filterSensitiveLog=function(e){return f({},e)},(_r||(_r={})).filterSensitiveLog=function(e){return f({},e)},(Fr||(Fr={})).filterSensitiveLog=function(e){return f({},e)},(Pr||(Pr={})).filterSensitiveLog=function(e){return f({},e)},(xr||(xr={})).filterSensitiveLog=function(e){return f({},e)},(Br||(Br={})).filterSensitiveLog=function(e){return f({},e)},(Tr||(Tr={})).filterSensitiveLog=function(e){return f({},e)},(Mr||(Mr={})).filterSensitiveLog=function(e){return f({},e)},(Lr||(Lr={})).filterSensitiveLog=function(e){return f({},e)},(Or||(Or={})).filterSensitiveLog=function(e){return f({},e)},(Rr||(Rr={})).filterSensitiveLog=function(e){return f({},e)},(kr||(kr={})).filterSensitiveLog=function(e){return f({},e)},(Nr||(Nr={})).filterSensitiveLog=function(e){return f({},e)},(Ir||(Ir={})).filterSensitiveLog=function(e){return f(f({},e),e.Geometry&&{Geometry:Fn.filterSensitiveLog(e.Geometry)})},(jr||(jr={})).filterSensitiveLog=function(e){return f({},e)},(Ur||(Ur={})).filterSensitiveLog=function(e){return f({},e)},(Gr||(Gr={})).filterSensitiveLog=function(e){return f({},e)},(zr||(zr={})).filterSensitiveLog=function(e){return f({},e)},(Hr||(Hr={})).filterSensitiveLog=function(e){return f(f({},e),e.Geometry&&{Geometry:Fn.filterSensitiveLog(e.Geometry)})},(qr||(qr={})).filterSensitiveLog=function(e){return f(f({},e),e.Entries&&{Entries:e.Entries.map((function(e){return Hr.filterSensitiveLog(e)}))})},($r||($r={})).filterSensitiveLog=function(e){return f(f({},e),e.Geometry&&{Geometry:Fn.filterSensitiveLog(e.Geometry)})},(Wr||(Wr={})).filterSensitiveLog=function(e){return f({},e)},(Vr||(Vr={})).filterSensitiveLog=function(e){return f({},e)},(Yr||(Yr={})).filterSensitiveLog=function(e){return f({},e)},(Kr||(Kr={})).filterSensitiveLog=function(e){return f({},e)},(Zr||(Zr={})).filterSensitiveLog=function(e){return f(f(f({},e),e.Position&&{Position:nt}),e.PositionProperties&&{PositionProperties:nt})},(Jr||(Jr={})).filterSensitiveLog=function(e){return f({},e)},(Qr||(Qr={})).filterSensitiveLog=function(e){return f(f({},e),e.DevicePositions&&{DevicePositions:e.DevicePositions.map((function(e){return Sn.filterSensitiveLog(e)}))})},(Xr||(Xr={})).filterSensitiveLog=function(e){return f({},e)},(ei||(ei={})).filterSensitiveLog=function(e){return f({},e)},(ti||(ti={})).filterSensitiveLog=function(e){return f({},e)},(ni||(ni={})).filterSensitiveLog=function(e){return f({},e)},(ri||(ri={})).filterSensitiveLog=function(e){return f({},e)},(ii||(ii={})).filterSensitiveLog=function(e){return f({},e)},(oi||(oi={})).filterSensitiveLog=function(e){return f({},e)},(ui||(ui={})).filterSensitiveLog=function(e){return f({},e)},(ai||(ai={})).filterSensitiveLog=function(e){return f({},e)},(si||(si={})).filterSensitiveLog=function(e){return f(f(f({},e),e.Position&&{Position:nt}),e.PositionProperties&&{PositionProperties:nt})},(ci||(ci={})).filterSensitiveLog=function(e){return f(f({},e),e.Entries&&{Entries:e.Entries.map((function(e){return si.filterSensitiveLog(e)}))})},(li||(li={})).filterSensitiveLog=function(e){return f({},e)},(fi||(fi={})).filterSensitiveLog=function(e){return f({},e)},(di||(di={})).filterSensitiveLog=function(e){return f({},e)},(hi||(hi={})).filterSensitiveLog=function(e){return f({},e)},(pi||(pi={})).filterSensitiveLog=function(e){return f({},e)},(vi||(vi={})).filterSensitiveLog=function(e){return f({},e)},(gi||(gi={})).filterSensitiveLog=function(e){return f({},e)},(yi||(yi={})).filterSensitiveLog=function(e){return f({},e)},(mi||(mi={})).filterSensitiveLog=function(e){return f({},e)},(wi||(wi={})).filterSensitiveLog=function(e){return f({},e)},(Di||(Di={})).filterSensitiveLog=function(e){return f({},e)},(bi||(bi={})).filterSensitiveLog=function(e){return f({},e)},(Ei||(Ei={})).filterSensitiveLog=function(e){return f({},e)},(Ai||(Ai={})).filterSensitiveLog=function(e){return f({},e)},(Si||(Si={})).filterSensitiveLog=function(e){return f({},e)},(Ci||(Ci={})).filterSensitiveLog=function(e){return f({},e)},(_i||(_i={})).filterSensitiveLog=function(e){return f(f({},e),e.Position&&{Position:nt})},(Fi||(Fi={})).filterSensitiveLog=function(e){return f(f({},e),e.Point&&{Point:nt})},(Pi||(Pi={})).filterSensitiveLog=function(e){return f({},e)},(xi||(xi={})).filterSensitiveLog=function(e){return f(f({},e),e.Geometry&&{Geometry:Fi.filterSensitiveLog(e.Geometry)})},(Bi||(Bi={})).filterSensitiveLog=function(e){return f(f({},e),e.Place&&{Place:xi.filterSensitiveLog(e.Place)})},(Ti||(Ti={})).filterSensitiveLog=function(e){return f(f({},e),e.Position&&{Position:nt})},(Mi||(Mi={})).filterSensitiveLog=function(e){return f(f(f({},e),e.Summary&&{Summary:Ti.filterSensitiveLog(e.Summary)}),e.Results&&{Results:e.Results.map((function(e){return Bi.filterSensitiveLog(e)}))})},(Li||(Li={})).filterSensitiveLog=function(e){return f(f(f(f({},e),e.Text&&{Text:nt}),e.BiasPosition&&{BiasPosition:nt}),e.FilterBBox&&{FilterBBox:nt})},(Oi||(Oi={})).filterSensitiveLog=function(e){return f({},e)},(Ri||(Ri={})).filterSensitiveLog=function(e){return f(f(f(f({},e),e.Text&&{Text:nt}),e.BiasPosition&&{BiasPosition:nt}),e.FilterBBox&&{FilterBBox:nt})},(ki||(ki={})).filterSensitiveLog=function(e){return f(f({},e),e.Summary&&{Summary:Ri.filterSensitiveLog(e.Summary)})},(Ni||(Ni={})).filterSensitiveLog=function(e){return f(f(f(f({},e),e.Text&&{Text:nt}),e.BiasPosition&&{BiasPosition:nt}),e.FilterBBox&&{FilterBBox:nt})},(Ii||(Ii={})).filterSensitiveLog=function(e){return f(f({},e),e.Place&&{Place:xi.filterSensitiveLog(e.Place)})},(ji||(ji={})).filterSensitiveLog=function(e){return f(f(f(f(f({},e),e.Text&&{Text:nt}),e.BiasPosition&&{BiasPosition:nt}),e.FilterBBox&&{FilterBBox:nt}),e.ResultBBox&&{ResultBBox:nt})},(Ui||(Ui={})).filterSensitiveLog=function(e){return f(f(f({},e),e.Summary&&{Summary:ji.filterSensitiveLog(e.Summary)}),e.Results&&{Results:e.Results.map((function(e){return Ii.filterSensitiveLog(e)}))})},(Gi||(Gi={})).filterSensitiveLog=function(e){return f({},e)},(zi||(zi={})).filterSensitiveLog=function(e){return f({},e)},(Hi||(Hi={})).filterSensitiveLog=function(e){return f({},e)},(qi||(qi={})).filterSensitiveLog=function(e){return f({},e)},($i||($i={})).filterSensitiveLog=function(e){return f({},e)},(Wi||(Wi={})).filterSensitiveLog=function(e){return f({},e)};var eo=function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d,h,v;return p(this,(function(p){switch(p.label){case 0:return r=[f({},e)],v={},[4,jo(e.body,t)];case 1:switch(n=f.apply(void 0,r.concat([(v.body=p.sent(),v)])),o="UnknownError",o=Uo(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,uo(n,t)];case 3:return i=f.apply(void 0,[f.apply(void 0,u.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 4:return a=[{}],[4,ao(n,t)];case 5:return i=f.apply(void 0,[f.apply(void 0,a.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 6:return s=[{}],[4,so(n,t)];case 7:return i=f.apply(void 0,[f.apply(void 0,s.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 8:return c=[{}],[4,co(n,t)];case 9:return i=f.apply(void 0,[f.apply(void 0,c.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 10:return l=[{}],[4,lo(n,t)];case 11:return i=f.apply(void 0,[f.apply(void 0,l.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 12:d=n.body,o=d.code||d.Code||o,i=f(f({},d),{name:""+o,message:d.message||d.Message||o,$fault:"client",$metadata:No(e)}),p.label=13;case 13:return h=i.message||i.Message||o,i.message=h,delete i.Message,[2,Promise.reject(Object.assign(new Error(h),i))]}}))}))},to=function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d,h,v;return p(this,(function(p){switch(p.label){case 0:return r=[f({},e)],v={},[4,jo(e.body,t)];case 1:switch(n=f.apply(void 0,r.concat([(v.body=p.sent(),v)])),o="UnknownError",o=Uo(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,uo(n,t)];case 3:return i=f.apply(void 0,[f.apply(void 0,u.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 4:return a=[{}],[4,ao(n,t)];case 5:return i=f.apply(void 0,[f.apply(void 0,a.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 6:return s=[{}],[4,so(n,t)];case 7:return i=f.apply(void 0,[f.apply(void 0,s.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 8:return c=[{}],[4,co(n,t)];case 9:return i=f.apply(void 0,[f.apply(void 0,c.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 10:return l=[{}],[4,lo(n,t)];case 11:return i=f.apply(void 0,[f.apply(void 0,l.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 12:d=n.body,o=d.code||d.Code||o,i=f(f({},d),{name:""+o,message:d.message||d.Message||o,$fault:"client",$metadata:No(e)}),p.label=13;case 13:return h=i.message||i.Message||o,i.message=h,delete i.Message,[2,Promise.reject(Object.assign(new Error(h),i))]}}))}))},no=function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d,h,v;return p(this,(function(p){switch(p.label){case 0:return r=[f({},e)],v={},[4,jo(e.body,t)];case 1:switch(n=f.apply(void 0,r.concat([(v.body=p.sent(),v)])),o="UnknownError",o=Uo(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,uo(n,t)];case 3:return i=f.apply(void 0,[f.apply(void 0,u.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 4:return a=[{}],[4,ao(n,t)];case 5:return i=f.apply(void 0,[f.apply(void 0,a.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 6:return s=[{}],[4,so(n,t)];case 7:return i=f.apply(void 0,[f.apply(void 0,s.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 8:return c=[{}],[4,co(n,t)];case 9:return i=f.apply(void 0,[f.apply(void 0,c.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 10:return l=[{}],[4,lo(n,t)];case 11:return i=f.apply(void 0,[f.apply(void 0,l.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 12:d=n.body,o=d.code||d.Code||o,i=f(f({},d),{name:""+o,message:d.message||d.Message||o,$fault:"client",$metadata:No(e)}),p.label=13;case 13:return h=i.message||i.Message||o,i.message=h,delete i.Message,[2,Promise.reject(Object.assign(new Error(h),i))]}}))}))},ro=function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d,h,v;return p(this,(function(p){switch(p.label){case 0:return r=[f({},e)],v={},[4,jo(e.body,t)];case 1:switch(n=f.apply(void 0,r.concat([(v.body=p.sent(),v)])),o="UnknownError",o=Uo(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,uo(n,t)];case 3:return i=f.apply(void 0,[f.apply(void 0,u.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 4:return a=[{}],[4,ao(n,t)];case 5:return i=f.apply(void 0,[f.apply(void 0,a.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 6:return s=[{}],[4,so(n,t)];case 7:return i=f.apply(void 0,[f.apply(void 0,s.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 8:return c=[{}],[4,co(n,t)];case 9:return i=f.apply(void 0,[f.apply(void 0,c.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 10:return l=[{}],[4,lo(n,t)];case 11:return i=f.apply(void 0,[f.apply(void 0,l.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 12:d=n.body,o=d.code||d.Code||o,i=f(f({},d),{name:""+o,message:d.message||d.Message||o,$fault:"client",$metadata:No(e)}),p.label=13;case 13:return h=i.message||i.Message||o,i.message=h,delete i.Message,[2,Promise.reject(Object.assign(new Error(h),i))]}}))}))},io=function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d,h,v;return p(this,(function(p){switch(p.label){case 0:return r=[f({},e)],v={},[4,jo(e.body,t)];case 1:switch(n=f.apply(void 0,r.concat([(v.body=p.sent(),v)])),o="UnknownError",o=Uo(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,uo(n,t)];case 3:return i=f.apply(void 0,[f.apply(void 0,u.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 4:return a=[{}],[4,ao(n,t)];case 5:return i=f.apply(void 0,[f.apply(void 0,a.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 6:return s=[{}],[4,so(n,t)];case 7:return i=f.apply(void 0,[f.apply(void 0,s.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 8:return c=[{}],[4,co(n,t)];case 9:return i=f.apply(void 0,[f.apply(void 0,c.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 10:return l=[{}],[4,lo(n,t)];case 11:return i=f.apply(void 0,[f.apply(void 0,l.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 12:d=n.body,o=d.code||d.Code||o,i=f(f({},d),{name:""+o,message:d.message||d.Message||o,$fault:"client",$metadata:No(e)}),p.label=13;case 13:return h=i.message||i.Message||o,i.message=h,delete i.Message,[2,Promise.reject(Object.assign(new Error(h),i))]}}))}))},oo=function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d,h,v;return p(this,(function(p){switch(p.label){case 0:return r=[f({},e)],v={},[4,jo(e.body,t)];case 1:switch(n=f.apply(void 0,r.concat([(v.body=p.sent(),v)])),o="UnknownError",o=Uo(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,uo(n,t)];case 3:return i=f.apply(void 0,[f.apply(void 0,u.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 4:return a=[{}],[4,ao(n,t)];case 5:return i=f.apply(void 0,[f.apply(void 0,a.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 6:return s=[{}],[4,so(n,t)];case 7:return i=f.apply(void 0,[f.apply(void 0,s.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 8:return c=[{}],[4,co(n,t)];case 9:return i=f.apply(void 0,[f.apply(void 0,c.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 10:return l=[{}],[4,lo(n,t)];case 11:return i=f.apply(void 0,[f.apply(void 0,l.concat([p.sent()])),{name:o,$metadata:No(e)}]),[3,13];case 12:d=n.body,o=d.code||d.Code||o,i=f(f({},d),{name:""+o,message:d.message||d.Message||o,$fault:"client",$metadata:No(e)}),p.label=13;case 13:return h=i.message||i.Message||o,i.message=h,delete i.Message,[2,Promise.reject(Object.assign(new Error(h),i))]}}))}))},uo=function(e,t){return h(void 0,void 0,void 0,(function(){var t,n;return p(this,(function(r){return t={name:"AccessDeniedException",$fault:"client",$metadata:No(e),Message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.Message=vt(n.message)),[2,t]}))}))},ao=function(e,t){return h(void 0,void 0,void 0,(function(){var t,n;return p(this,(function(r){return t={name:"InternalServerException",$fault:"server",$retryable:{},$metadata:No(e),Message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.Message=vt(n.message)),[2,t]}))}))},so=function(e,t){return h(void 0,void 0,void 0,(function(){var t,n;return p(this,(function(r){return t={name:"ResourceNotFoundException",$fault:"client",$metadata:No(e),Message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.Message=vt(n.message)),[2,t]}))}))},co=function(e,t){return h(void 0,void 0,void 0,(function(){var t,n;return p(this,(function(r){return t={name:"ThrottlingException",$fault:"client",$retryable:{},$metadata:No(e),Message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.Message=vt(n.message)),[2,t]}))}))},lo=function(e,t){return h(void 0,void 0,void 0,(function(){var n,r;return p(this,(function(i){return n={name:"ValidationException",$fault:"client",$metadata:No(e),FieldList:void 0,Message:void 0,Reason:void 0},void 0!==(r=e.body).fieldList&&null!==r.fieldList&&(n.FieldList=ko(r.fieldList,t)),void 0!==r.message&&null!==r.message&&(n.Message=vt(r.message)),void 0!==r.reason&&null!==r.reason&&(n.Reason=vt(r.reason)),[2,n]}))}))},fo=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return f(f({},void 0!==e.GeofenceId&&null!==e.GeofenceId&&{GeofenceId:e.GeofenceId}),void 0!==e.Geometry&&null!==e.Geometry&&{Geometry:vo(e.Geometry,t)})}(e,t)}))},ho=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:Ot(e)}))},po=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:e}))},vo=function(e,t){return f({},void 0!==e.Polygon&&null!==e.Polygon&&{Polygon:yo(e.Polygon,t)})},go=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:e}))},yo=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:mo(e,t)}))}(e,t)}))},mo=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:Ot(e)}))},wo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{Error:void 0!==e.Error&&null!==e.Error?Do(e.Error,t):void 0,GeofenceId:vt(e.GeofenceId)}}(e,t)}))},Do=function(e,t){return{Code:vt(e.Code),Message:vt(e.Message)}},bo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{Error:void 0!==e.Error&&null!==e.Error?Do(e.Error,t):void 0,GeofenceId:vt(e.GeofenceId)}}(e,t)}))},Eo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{CreateTime:void 0!==e.CreateTime&&null!==e.CreateTime?ht(At(e.CreateTime)):void 0,GeofenceId:vt(e.GeofenceId),UpdateTime:void 0!==e.UpdateTime&&null!==e.UpdateTime?ht(At(e.UpdateTime)):void 0}}(e)}))},Ao=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:mt(e)}))},So=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:vt(e)}))},Co=function(e,t){return{Polygon:void 0!==e.Polygon&&null!==e.Polygon?_o(e.Polygon,t):void 0}},_o=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:Bo(e,t)}))}(e,t)}))},Fo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{CreateTime:void 0!==e.CreateTime&&null!==e.CreateTime?ht(At(e.CreateTime)):void 0,GeofenceId:vt(e.GeofenceId),Geometry:void 0!==e.Geometry&&null!==e.Geometry?Co(e.Geometry,t):void 0,Status:vt(e.Status),UpdateTime:void 0!==e.UpdateTime&&null!==e.UpdateTime?ht(At(e.UpdateTime)):void 0}}(e,t)}))},Po=function(e,t){return{AddressNumber:vt(e.AddressNumber),Country:vt(e.Country),Geometry:void 0!==e.Geometry&&null!==e.Geometry?xo(e.Geometry,t):void 0,Interpolated:rt(e.Interpolated),Label:vt(e.Label),Municipality:vt(e.Municipality),Neighborhood:vt(e.Neighborhood),PostalCode:vt(e.PostalCode),Region:vt(e.Region),Street:vt(e.Street),SubRegion:vt(e.SubRegion),TimeZone:void 0!==e.TimeZone&&null!==e.TimeZone?Ro(e.TimeZone,t):void 0}},xo=function(e,t){return{Point:void 0!==e.Point&&null!==e.Point?Bo(e.Point,t):void 0}},Bo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:mt(e)}))},To=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{Distance:mt(e.Distance),Place:void 0!==e.Place&&null!==e.Place?Po(e.Place,t):void 0}}(e,t)}))},Mo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{Distance:mt(e.Distance),Place:void 0!==e.Place&&null!==e.Place?Po(e.Place,t):void 0,Relevance:mt(e.Relevance)}}(e,t)}))},Lo=function(e,t){return{DataSource:vt(e.DataSource),Language:vt(e.Language),MaxResults:st(e.MaxResults),Position:void 0!==e.Position&&null!==e.Position?Bo(e.Position,t):void 0}},Oo=function(e,t){return{BiasPosition:void 0!==e.BiasPosition&&null!==e.BiasPosition?Bo(e.BiasPosition,t):void 0,DataSource:vt(e.DataSource),FilterBBox:void 0!==e.FilterBBox&&null!==e.FilterBBox?Ao(e.FilterBBox):void 0,FilterCountries:void 0!==e.FilterCountries&&null!==e.FilterCountries?So(e.FilterCountries):void 0,Language:vt(e.Language),MaxResults:st(e.MaxResults),ResultBBox:void 0!==e.ResultBBox&&null!==e.ResultBBox?Ao(e.ResultBBox):void 0,Text:vt(e.Text)}},Ro=function(e,t){return{Name:vt(e.Name),Offset:st(e.Offset)}},ko=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{Message:vt(e.message),Name:vt(e.name)}}(e)}))},No=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},Io=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},jo=function(e,t){return function(e,t){return Io(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},Uo=function(e,t){var n,r,i=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==o?i(e.headers[o]):void 0!==t.code?i(t.code):void 0!==t.__type?i(t.__type):""},Go=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return l(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Xi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"SearchPlaceIndexForTextCommand",inputFilterSensitiveLog:Ni.filterSensitiveLog,outputFilterSensitiveLog:Ui.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d;return p(this,(function(h){switch(h.label){case 0:return[4,t.endpoint()];case 1:if(n=h.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={"content-type":"application/json"},s=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/places/v0/indexes/{IndexName}/search/text",void 0===e.IndexName)throw new Error("No value provided for input HTTP label: IndexName.");if((c=e.IndexName).length<=0)throw new Error("Empty value provided for input HTTP label: IndexName.");return s=s.replace("{IndexName}",Mt(c)),l=JSON.stringify(f(f(f(f(f(f({},void 0!==e.BiasPosition&&null!==e.BiasPosition&&{BiasPosition:mo(e.BiasPosition,t)}),void 0!==e.FilterBBox&&null!==e.FilterBBox&&{FilterBBox:ho(e.FilterBBox,t)}),void 0!==e.FilterCountries&&null!==e.FilterCountries&&{FilterCountries:po(e.FilterCountries,t)}),void 0!==e.Language&&null!==e.Language&&{Language:e.Language}),void 0!==e.MaxResults&&null!==e.MaxResults&&{MaxResults:e.MaxResults}),void 0!==e.Text&&null!==e.Text&&{Text:e.Text})),[4,t.endpoint()];case 2:if(d=h.sent().hostname,!0!==t.disableHostPrefix&&!P(d="places."+d))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new _({protocol:i,hostname:d,port:o,method:"POST",headers:a,path:s,body:l})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o;return p(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,oo(e,t)]:(n={$metadata:No(e),Results:void 0,Summary:void 0},i=ht,o=pt,[4,jo(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).Results&&null!==r.Results&&(n.Results=Mo(r.Results,t)),void 0!==r.Summary&&null!==r.Summary&&(n.Summary=Oo(r.Summary,t)),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(tt),zo=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return l(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Xi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"SearchPlaceIndexForPositionCommand",inputFilterSensitiveLog:_i.filterSensitiveLog,outputFilterSensitiveLog:Mi.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d;return p(this,(function(h){switch(h.label){case 0:return[4,t.endpoint()];case 1:if(n=h.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={"content-type":"application/json"},s=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/places/v0/indexes/{IndexName}/search/position",void 0===e.IndexName)throw new Error("No value provided for input HTTP label: IndexName.");if((c=e.IndexName).length<=0)throw new Error("Empty value provided for input HTTP label: IndexName.");return s=s.replace("{IndexName}",Mt(c)),l=JSON.stringify(f(f(f({},void 0!==e.Language&&null!==e.Language&&{Language:e.Language}),void 0!==e.MaxResults&&null!==e.MaxResults&&{MaxResults:e.MaxResults}),void 0!==e.Position&&null!==e.Position&&{Position:mo(e.Position,t)})),[4,t.endpoint()];case 2:if(d=h.sent().hostname,!0!==t.disableHostPrefix&&!P(d="places."+d))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new _({protocol:i,hostname:d,port:o,method:"POST",headers:a,path:s,body:l})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o;return p(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,io(e,t)]:(n={$metadata:No(e),Results:void 0,Summary:void 0},i=ht,o=pt,[4,jo(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).Results&&null!==r.Results&&(n.Results=To(r.Results,t)),void 0!==r.Summary&&null!==r.Summary&&(n.Summary=Lo(r.Summary,t)),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(tt),Ho=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return l(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Xi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"GetGeofenceCommand",inputFilterSensitiveLog:Nr.filterSensitiveLog,outputFilterSensitiveLog:Ir.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l;return p(this,(function(f){switch(f.label){case 0:return[4,t.endpoint()];case 1:if(n=f.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={},s=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/geofencing/v0/collections/{CollectionName}/geofences/{GeofenceId}",void 0===e.CollectionName)throw new Error("No value provided for input HTTP label: CollectionName.");if((c=e.CollectionName).length<=0)throw new Error("Empty value provided for input HTTP label: CollectionName.");if(s=s.replace("{CollectionName}",Mt(c)),void 0===e.GeofenceId)throw new Error("No value provided for input HTTP label: GeofenceId.");if((c=e.GeofenceId).length<=0)throw new Error("Empty value provided for input HTTP label: GeofenceId.");return s=s.replace("{GeofenceId}",Mt(c)),[4,t.endpoint()];case 2:if(l=f.sent().hostname,!0!==t.disableHostPrefix&&!P(l="geofencing."+l))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new _({protocol:i,hostname:l,port:o,method:"GET",headers:a,path:s,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o;return p(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,no(e,t)]:(n={$metadata:No(e),CreateTime:void 0,GeofenceId:void 0,Geometry:void 0,Status:void 0,UpdateTime:void 0},i=ht,o=pt,[4,jo(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).CreateTime&&null!==r.CreateTime&&(n.CreateTime=ht(At(r.CreateTime))),void 0!==r.GeofenceId&&null!==r.GeofenceId&&(n.GeofenceId=vt(r.GeofenceId)),void 0!==r.Geometry&&null!==r.Geometry&&(n.Geometry=Co(r.Geometry,t)),void 0!==r.Status&&null!==r.Status&&(n.Status=vt(r.Status)),void 0!==r.UpdateTime&&null!==r.UpdateTime&&(n.UpdateTime=ht(At(r.UpdateTime))),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(tt),qo=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return l(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Xi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"ListGeofencesCommand",inputFilterSensitiveLog:zr.filterSensitiveLog,outputFilterSensitiveLog:qr.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d;return p(this,(function(h){switch(h.label){case 0:return[4,t.endpoint()];case 1:if(n=h.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={"content-type":"application/json"},s=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/geofencing/v0/collections/{CollectionName}/list-geofences",void 0===e.CollectionName)throw new Error("No value provided for input HTTP label: CollectionName.");if((c=e.CollectionName).length<=0)throw new Error("Empty value provided for input HTTP label: CollectionName.");return s=s.replace("{CollectionName}",Mt(c)),l=JSON.stringify(f({},void 0!==e.NextToken&&null!==e.NextToken&&{NextToken:e.NextToken})),[4,t.endpoint()];case 2:if(d=h.sent().hostname,!0!==t.disableHostPrefix&&!P(d="geofencing."+d))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new _({protocol:i,hostname:d,port:o,method:"POST",headers:a,path:s,body:l})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o;return p(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,ro(e,t)]:(n={$metadata:No(e),Entries:void 0,NextToken:void 0},i=ht,o=pt,[4,jo(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).Entries&&null!==r.Entries&&(n.Entries=Fo(r.Entries,t)),void 0!==r.NextToken&&null!==r.NextToken&&(n.NextToken=vt(r.NextToken)),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(tt),$o=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return l(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Xi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"BatchPutGeofenceCommand",inputFilterSensitiveLog:xn.filterSensitiveLog,outputFilterSensitiveLog:Mn.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d;return p(this,(function(h){switch(h.label){case 0:return[4,t.endpoint()];case 1:if(n=h.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={"content-type":"application/json"},s=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/geofencing/v0/collections/{CollectionName}/put-geofences",void 0===e.CollectionName)throw new Error("No value provided for input HTTP label: CollectionName.");if((c=e.CollectionName).length<=0)throw new Error("Empty value provided for input HTTP label: CollectionName.");return s=s.replace("{CollectionName}",Mt(c)),l=JSON.stringify(f({},void 0!==e.Entries&&null!==e.Entries&&{Entries:fo(e.Entries,t)})),[4,t.endpoint()];case 2:if(d=h.sent().hostname,!0!==t.disableHostPrefix&&!P(d="geofencing."+d))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new _({protocol:i,hostname:d,port:o,method:"POST",headers:a,path:s,body:l})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o;return p(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,to(e,t)]:(n={$metadata:No(e),Errors:void 0,Successes:void 0},i=ht,o=pt,[4,jo(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).Errors&&null!==r.Errors&&(n.Errors=bo(r.Errors,t)),void 0!==r.Successes&&null!==r.Successes&&(n.Successes=Eo(r.Successes,t)),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(tt),Wo=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return l(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Xi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"BatchDeleteGeofenceCommand",inputFilterSensitiveLog:vn.filterSensitiveLog,outputFilterSensitiveLog:yn.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l,d;return p(this,(function(h){switch(h.label){case 0:return[4,t.endpoint()];case 1:if(n=h.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={"content-type":"application/json"},s=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/geofencing/v0/collections/{CollectionName}/delete-geofences",void 0===e.CollectionName)throw new Error("No value provided for input HTTP label: CollectionName.");if((c=e.CollectionName).length<=0)throw new Error("Empty value provided for input HTTP label: CollectionName.");return s=s.replace("{CollectionName}",Mt(c)),l=JSON.stringify(f({},void 0!==e.GeofenceIds&&null!==e.GeofenceIds&&{GeofenceIds:go(e.GeofenceIds,t)})),[4,t.endpoint()];case 2:if(d=h.sent().hostname,!0!==t.disableHostPrefix&&!P(d="geofencing."+d))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new _({protocol:i,hostname:d,port:o,method:"POST",headers:a,path:s,body:l})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return h(void 0,void 0,void 0,(function(){var n,r,i,o;return p(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,eo(e,t)]:(n={$metadata:No(e),Errors:void 0},i=ht,o=pt,[4,jo(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).Errors&&null!==r.Errors&&(n.Errors=wo(r.Errors,t)),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(tt);function Vo(e){for(var t,n,r=function(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(e),i=0,o=1;o<r.length;)t=n||r[0],i+=((n=r[o])[0]-t[0])*(n[1]+t[1]),o++;return i>0}function Yo(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))throw new Error("Invalid coordinates: ["+e+","+t+"]");if(t<-90||90<t)throw new Error("Latitude must be between -90 and 90 degrees inclusive.");if(e<-180||180<e)throw new Error("Longitude must be between -180 and 180 degrees inclusive.")}function Ko(e){if(!/^(?:[\x2D\.0-9A-Z_a-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])+$/i.test(e))throw new Error("Invalid geofenceId: '"+e+"' - IDs can only contain alphanumeric characters, hyphens, underscores and periods.")}function Zo(e,t){var n=t?t+": ":"";if(e.length<4)throw new Error(n+"LinearRing must contain 4 or more coordinates.");var r=[];if(e.forEach((function(e){try{Yo(e[0],e[1])}catch(t){r.push({coordinates:e,error:t.message})}})),r.length>0)throw new Error(n+"One or more of the coordinates in the Polygon LinearRing are not valid: "+JSON.stringify(r));var i=o(e[0],2),u=i[0],a=i[1],s=o(e[e.length-1],2),c=s[0],l=s[1];if(u!==c||a!==l)throw new Error(n+"LinearRing's first and last coordinates are not the same");if(Vo(e))throw new Error(n+"LinearRing coordinates must be wound counterclockwise")}function Jo(e){var t={};e.forEach((function(e){if(!e.geofenceId)throw new Error("Geofence '"+e+"' is missing geofenceId");var n=e.geofenceId;if(Ko(n),t[n])throw new Error("Duplicate geofenceId: "+n);if(t[n]=!0,!e.geometry)throw new Error("Geofence '"+n+"' is missing geometry");var r=e.geometry;if(!r.polygon)throw new Error("Geofence '"+n+"' is missing geometry.polygon");var i=r.polygon;try{!function(e,t){var n=t?t+": ":"";if(!Array.isArray(e))throw new Error(n+"Polygon is of incorrect structure. It should be an array of LinearRings");if(e.length<1)throw new Error(n+"Polygon must have a single LinearRing array.");if(e.length>1)throw new Error(n+"Polygon must have a single LinearRing array. Note: We do not currently support polygons with holes, multipolygons, polygons that are wound clockwise, or that cross the antimeridian.");if(e.reduce((function(e,t){return e+t.length}),0)>1e3)throw new Error(n+"Polygon has more than the maximum 1000 vertices.");e.forEach((function(e){Zo(e,t)}))}(i,n)}catch(e){if(e.message.includes("Polygon has more than the maximum 1000 vertices."))throw new Error("Geofence '"+n+"' has more than the maximum of 1000 vertices")}Zo(o(i,1)[0],n)}))}var Qo=new u.ConsoleLogger("AmazonLocationServiceProvider"),Xo=function(){function e(e){this._config=e||{},Qo.debug("Geo Options",this._config)}return e.prototype.getCategory=function(){return e.CATEGORY},e.prototype.getProviderName=function(){return e.PROVIDER_NAME},e.prototype.configure=function(e){return Qo.debug("configure Amazon Location Service Provider",e),e?(this._config=Object.assign({},this._config,e),this._config):this._config},e.prototype.getAvailableMaps=function(){this._verifyMapResources();var e=[],t=this._config.maps.items,n=this._config.region;for(var r in t){var i=t[r].style;e.push({mapName:r,style:i,region:n})}return e},e.prototype.getDefaultMap=function(){this._verifyMapResources();var e=this._config.maps.default;return{mapName:e,style:this._config.maps.items[e].style,region:this._config.region}},e.prototype.searchByText=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,a,c,l;return i(this,(function(i){switch(i.label){case 0:return[4,this._ensureCredentials()];case 1:if(!i.sent())throw new Error("No credentials");if(this._verifySearchIndex(null==t?void 0:t.searchIndexName),n={Text:e,IndexName:this._config.search_indices.default},t){if(n.FilterCountries=t.countries,n.MaxResults=t.maxResults,t.searchIndexName&&(n.IndexName=t.searchIndexName),t.biasPosition&&t.searchAreaConstraints)throw new Error("BiasPosition and SearchAreaConstraints are mutually exclusive, please remove one or the other from the options object");t.biasPosition&&(n.BiasPosition=t.biasPosition),t.searchAreaConstraints&&(n.FilterBBox=t.searchAreaConstraints)}r=new Zi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(u.getAmplifyUserAgent)()}),o=new Go(n),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,r.send(o)];case 3:return a=i.sent(),[3,5];case 4:throw c=i.sent(),Qo.debug(c),c;case 5:return l=a.Results.map((function(e){return e.Place})),[2,s()(l,{deep:!0})]}}))}))},e.prototype.searchByCoordinates=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,a,c,l;return i(this,(function(i){switch(i.label){case 0:return[4,this._ensureCredentials()];case 1:if(!i.sent())throw new Error("No credentials");this._verifySearchIndex(null==t?void 0:t.searchIndexName),n={Position:e,IndexName:this._config.search_indices.default},t&&(t.searchIndexName&&(n.IndexName=t.searchIndexName),n.MaxResults=t.maxResults),r=new Zi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(u.getAmplifyUserAgent)()}),o=new zo(n),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,r.send(o)];case 3:return a=i.sent(),[3,5];case 4:throw c=i.sent(),Qo.debug(c),c;case 5:return l=a.Results.map((function(e){return e.Place})),[2,s()(l[0],{deep:!0})]}}))}))},e.prototype.saveGeofences=function(e,t){return r(this,void 0,void 0,(function(){var n,o,u,a=this;return i(this,(function(s){switch(s.label){case 0:if(e.length<1)throw new Error("Geofence input array is empty");return[4,this._ensureCredentials()];case 1:if(!s.sent())throw new Error("No credentials");try{this._verifyGeofenceCollections(null==t?void 0:t.collectionName)}catch(e){throw Qo.debug(e),e}for(Jo(e),n=e.map((function(e){return{GeofenceId:e.geofenceId,Geometry:{Polygon:e.geometry.polygon}}})),o={successes:[],errors:[]},u=[];n.length>0;)10,u.push(n.splice(0,10));return[4,Promise.all(u.map((function(e){return r(a,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this._AmazonLocationServiceBatchPutGeofenceCall(e,(null==t?void 0:t.collectionName)||this._config.geofenceCollections.default)];case 1:return n=i.sent(),[3,3];case 2:return r=i.sent(),e.forEach((function(e){o.errors.push({geofenceId:e.GeofenceId,error:{code:"APIConnectionError",message:r.message}})})),[2];case 3:return n.Successes.forEach((function(e){var t=e.GeofenceId,n=e.CreateTime,r=e.UpdateTime;o.successes.push({geofenceId:t,createTime:n,updateTime:r})})),n.Errors.forEach((function(e){var t=e.Error,n=t.Code,r=t.Message,i=e.GeofenceId;o.errors.push({error:{code:n,message:r},geofenceId:i})})),[2]}}))}))})))];case 2:return s.sent(),[2,o]}}))}))},e.prototype.getGeofence=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,a,s,c,l,f,d,h;return i(this,(function(i){switch(i.label){case 0:return[4,this._ensureCredentials()];case 1:if(!i.sent())throw new Error("No credentials");try{this._verifyGeofenceCollections(null==t?void 0:t.collectionName)}catch(e){throw Qo.debug(e),e}Ko(e),n=new Zi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(u.getAmplifyUserAgent)()}),r={GeofenceId:e,CollectionName:(null==t?void 0:t.collectionName)||this._config.geofenceCollections.default},o=new Ho(r),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,n.send(o)];case 3:return a=i.sent(),[3,5];case 4:throw s=i.sent(),Qo.debug(s),s;case 5:return c=a.GeofenceId,l=a.CreateTime,f=a.UpdateTime,d=a.Status,h=a.Geometry,[2,{createTime:l,geofenceId:c,geometry:{polygon:h.Polygon},status:d,updateTime:f}]}}))}))},e.prototype.listGeofences=function(e){return r(this,void 0,void 0,(function(){var t,n,r,o,a,s,c;return i(this,(function(i){switch(i.label){case 0:return[4,this._ensureCredentials()];case 1:if(!i.sent())throw new Error("No credentials");try{this._verifyGeofenceCollections(null==e?void 0:e.collectionName)}catch(e){throw Qo.debug(e),e}t=new Zi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(u.getAmplifyUserAgent)()}),n={NextToken:null==e?void 0:e.nextToken,CollectionName:(null==e?void 0:e.collectionName)||this._config.geofenceCollections.default},r=new qo(n),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,t.send(r)];case 3:return o=i.sent(),[3,5];case 4:throw a=i.sent(),Qo.debug(a),a;case 5:return s=o.NextToken,c=o.Entries,[2,{entries:c.map((function(e){return{geofenceId:e.GeofenceId,createTime:e.CreateTime,updateTime:e.UpdateTime,status:e.Status,geometry:{polygon:e.Geometry.Polygon}}})),nextToken:s}]}}))}))},e.prototype.deleteGeofences=function(e,t){return r(this,void 0,void 0,(function(){var n,u,a,s,c=this;return i(this,(function(l){switch(l.label){case 0:if(e.length<1)throw new Error("GeofenceId input array is empty");return[4,this._ensureCredentials()];case 1:if(!l.sent())throw new Error("No credentials");if(this._verifyGeofenceCollections(null==t?void 0:t.collectionName),(n=e.filter((function(e){try{Ko(e)}catch(e){return!0}}))).length>0)throw new Error("Invalid geofence ids: "+n.join(", "));for(u={successes:[],errors:[]},a=[],s=0;s<e.length;)a.push(e.slice(s,s+=10));return[4,Promise.all(a.map((function(e){return r(c,void 0,void 0,(function(){var n,r,a,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this._AmazonLocationServiceBatchDeleteGeofenceCall(e,(null==t?void 0:t.collectionName)||this._config.geofenceCollections.default)];case 1:return n=i.sent(),[3,3];case 2:return r=i.sent(),e.forEach((function(e){var t={geofenceId:e,error:{code:r.message,message:r.message}};u.errors.push(t)})),[2];case 3:return a=n.Errors.map((function(e){return e.geofenceId})),(s=u.successes).push.apply(s,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}(e.filter((function(e){return!a.includes(e)})))),[2]}}))}))})))];case 2:return l.sent(),[2,u]}}))}))},e.prototype._ensureCredentials=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,u.Credentials.get()];case 1:return(e=r.sent())?(t=u.Credentials.shear(e),Qo.debug("Set credentials for storage. Credentials are:",t),this._config.credentials=t,[2,!0]):[2,!1];case 2:return n=r.sent(),Qo.debug("Ensure credentials error. Credentials are:",n),[2,!1];case 3:return[2]}}))}))},e.prototype._verifyMapResources=function(){if(!this._config.maps){var e="No map resources found in amplify config, run 'amplify add geo' to create one and run `amplify push` after";throw Qo.debug(e),new Error(e)}if(!this._config.maps.default){e="No default map resource found in amplify config, run 'amplify add geo' to create one and run `amplify push` after";throw Qo.debug(e),new Error(e)}},e.prototype._verifySearchIndex=function(e){if(!(this._config.search_indices&&this._config.search_indices.default||e)){var t="No Search Index found in amplify config, please run `amplify add geo` to create one and run `amplify push` after.";throw Qo.debug(t),new Error(t)}},e.prototype._verifyGeofenceCollections=function(e){if(!(this._config.geofenceCollections&&this._config.geofenceCollections.default||e)){var t="No Geofence Collections found, please run `amplify add geo` to create one and run `amplify push` after.";throw Qo.debug(t),new Error(t)}},e.prototype._AmazonLocationServiceBatchPutGeofenceCall=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,a;return i(this,(function(i){switch(i.label){case 0:n={Entries:e,CollectionName:t||this._config.geofenceCollections.default},r=new Zi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(u.getAmplifyUserAgent)()}),o=new $o(n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.send(o)];case 2:return a=i.sent(),[3,4];case 3:throw i.sent();case 4:return[2,a]}}))}))},e.prototype._AmazonLocationServiceBatchDeleteGeofenceCall=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,a;return i(this,(function(i){switch(i.label){case 0:n={GeofenceIds:e,CollectionName:t||this._config.geofenceCollections.default},r=new Zi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(u.getAmplifyUserAgent)()}),o=new Wo(n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.send(o)];case 2:return a=i.sent(),[3,4];case 3:throw i.sent();case 4:return[2,a]}}))}))},e.CATEGORY="Geo",e.PROVIDER_NAME="AmazonLocationService",e}(),eu=new u.ConsoleLogger("Geo"),tu="AmazonLocationService",nu=new(function(){function e(){this._config={},this._pluggables=[],eu.debug("Geo Options",this._config)}return e.prototype.getModuleName=function(){return e.MODULE},e.prototype.addPluggable=function(e){if(e&&"Geo"===e.getCategory())return this._pluggables.push(e),e.configure(this._config[e.getProviderName()])},e.prototype.getPluggable=function(e){var t=this._pluggables.find((function(t){return t.getProviderName()===e}));if(void 0===t)throw eu.debug("No plugin found with providerName",e),new Error("No plugin found in Geo for the provider");return t},e.prototype.removePluggable=function(e){this._pluggables=this._pluggables.filter((function(t){return t.getProviderName()!==e}))},e.prototype.configure=function(e){var t=this;if(eu.debug("configure Geo"),!e)return this._config;var n=Object(u.parseMobileHubConfig)(e);return this._config=Object.assign({},this._config,n.Geo,e),this._pluggables.forEach((function(e){e.configure(t._config[e.getProviderName()])})),0===this._pluggables.length&&this.addPluggable(new Xo),this._config},e.prototype.getAvailableMaps=function(e){return void 0===e&&(e=tu),this.getPluggable(e).getAvailableMaps()},e.prototype.getDefaultMap=function(e){return void 0===e&&(e=tu),this.getPluggable(e).getDefaultMap()},e.prototype.searchByText=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,u;return i(this,(function(i){switch(i.label){case 0:n=(t||{}).providerName,r=void 0===n?tu:n,o=this.getPluggable(r),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,o.searchByText(e,t)];case 2:return[2,i.sent()];case 3:throw u=i.sent(),eu.debug(u),u;case 4:return[2]}}))}))},e.prototype.searchByCoordinates=function(e,t){return r(this,void 0,void 0,(function(){var n,r,u,a,s,c,l;return i(this,(function(i){switch(i.label){case 0:n=(t||{}).providerName,r=void 0===n?tu:n,u=this.getPluggable(r),a=o(e,2),s=a[0],c=a[1],i.label=1;case 1:return i.trys.push([1,3,,4]),Yo(s,c),[4,u.searchByCoordinates(e,t)];case 2:return[2,i.sent()];case 3:throw l=i.sent(),eu.debug(l),l;case 4:return[2]}}))}))},e.prototype.saveGeofences=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,u,a;return i(this,(function(i){switch(i.label){case 0:n=(t||{}).providerName,r=void 0===n?tu:n,o=this.getPluggable(r),u=Array.isArray(e)?e:[e],i.label=1;case 1:return i.trys.push([1,3,,4]),[4,o.saveGeofences(u,t)];case 2:return[2,i.sent()];case 3:throw a=i.sent(),eu.debug(a),a;case 4:return[2]}}))}))},e.prototype.getGeofence=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,u;return i(this,(function(i){switch(i.label){case 0:n=(t||{}).providerName,r=void 0===n?tu:n,o=this.getPluggable(r),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,o.getGeofence(e,t)];case 2:return[2,i.sent()];case 3:throw u=i.sent(),eu.debug(u),u;case 4:return[2]}}))}))},e.prototype.listGeofences=function(e){return r(this,void 0,void 0,(function(){var t,n,r,o;return i(this,(function(i){switch(i.label){case 0:t=(e||{}).providerName,n=void 0===t?tu:t,r=this.getPluggable(n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.listGeofences(e)];case 2:return[2,i.sent()];case 3:throw o=i.sent(),eu.debug(o),o;case 4:return[2]}}))}))},e.prototype.deleteGeofences=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,u,a;return i(this,(function(i){switch(i.label){case 0:n=(t||{}).providerName,r=void 0===n?tu:n,o=this.getPluggable(r),u=Array.isArray(e)?e:[e],i.label=1;case 1:return i.trys.push([1,3,,4]),[4,o.deleteGeofences(u,t)];case 2:return[2,i.sent()];case 3:throw a=i.sent(),eu.debug(a),a;case 4:return[2]}}))}))},e.MODULE="Geo",e}());u.Amplify.register(nu)},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return i}));var r=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192,63&i|128);else if(n+1<e.length&&55296==(64512&i)&&56320==(64512&e.charCodeAt(n+1))){var o=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(i>>12|224,i>>6&63|128,63&i|128)}return Uint8Array.from(t)}(e)},i=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var i=e[n];if(i<128)t+=String.fromCharCode(i);else if(192<=i&&i<224){var o=e[++n];t+=String.fromCharCode((31&i)<<6|63&o)}else if(240<=i&&i<365){var u="%"+[i,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(u)}else t+=String.fromCharCode((15&i)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return i}));var r=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192,63&i|128);else if(n+1<e.length&&55296==(64512&i)&&56320==(64512&e.charCodeAt(n+1))){var o=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(i>>12|224,i>>6&63|128,63&i|128)}return Uint8Array.from(t)}(e)},i=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var i=e[n];if(i<128)t+=String.fromCharCode(i);else if(192<=i&&i<224){var o=e[++n];t+=String.fromCharCode((31&i)<<6|63&o)}else if(240<=i&&i<365){var u="%"+[i,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(u)}else t+=String.fromCharCode((15&i)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}}])}));
|
|
55
|
+
var r=function(e,t){return(r=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,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=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}).apply(this,arguments)};function u(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}function a(e,t,n,r){var i,o=arguments.length,u=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(u=(o<3?i(u):o>3?i(t,n,u):i(t,n))||u);return o>3&&u&&Object.defineProperty(t,n,u),u}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function d(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function h(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function y(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],u=0,a=o.length;u<a;u++,i++)r[i]=o[u];return r}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function w(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof m?Promise.resolve(n.value.v).then(s,c):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function s(e){a("next",e)}function c(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function D(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function b(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function S(e){return e&&e.__esModule?e:{default:e}}function C(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function _(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMsWindow=void 0;var r=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];t.isMsWindow=function(e){if(function(e){return"MSInputMethodContext"in e&&"msCrypto"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,n=t.getRandomValues,i=t.subtle;return r.map((function(e){return i[e]})).concat(n).every((function(e){return"function"==typeof e}))}return!1}},function(e,t,n){"use strict";n.r(t),n.d(t,"Geo",(function(){return au}));var r=n(0),i=n(4),o=n.n(i),u=function(e,t){return(u=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)};function a(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}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return(s=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}).apply(this,arguments)};function c(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}function l(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;function d(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function p(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var v;Object.create;!function(e){e.ENV="env",e.CONFIG="shared config entry"}(v||(v={}));var g=function(e){if("boolean"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},y=function(e){var t=e.endpoint,n=e.urlParser;if("string"==typeof t){var r=Promise.resolve(n(t));return function(){return r}}if("object"==typeof t){var i=Promise.resolve(t);return function(){return i}}return t},m=function(e){var t,n=g(e.useDualstackEndpoint),r=e.endpoint,i=e.useFipsEndpoint;return s(s({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:r?y(s(s({},e),{endpoint:r})):function(){return function(e){return l(void 0,void 0,void 0,(function(){var t,n,r,i,o,u,a;return f(this,(function(s){switch(s.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(r=s.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw new Error("Invalid region in client config");return[4,e.useDualstackEndpoint()];case 2:return i=s.sent(),[4,e.useFipsEndpoint()];case 3:return o=s.sent(),[4,e.regionInfoProvider(r,{useDualstackEndpoint:i,useFipsEndpoint:o})];case 4:if(!(u=(null!==(a=s.sent())&&void 0!==a?a:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((n?"https:":"http:")+"//"+u)]}}))}))}(s(s({},e),{useDualstackEndpoint:n,useFipsEndpoint:i}))},isCustomEndpoint:!!r,useDualstackEndpoint:n})},w=function(e){return"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips"))},D=function(e){return w(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e},b=function(e,t){var n;void 0===e&&(e=[]);var r=t.useFipsEndpoint,i=t.useDualstackEndpoint;return null===(n=e.find((function(e){var t=e.tags;return r===t.includes("fips")&&i===t.includes("dualstack")})))||void 0===n?void 0:n.hostname},E=function(e,t){var n,r,i,o,u,a,c=t.useFipsEndpoint,l=void 0!==c&&c,f=t.useDualstackEndpoint,d=void 0!==f&&f,h=t.signingService,p=t.regionHash,v=t.partitionHash,g=function(e,t){var n,r=t.partitionHash;return null!==(n=Object.keys(r||{}).find((function(t){return r[t].regions.includes(e)})))&&void 0!==n?n:"aws"}(e,{partitionHash:v}),y=e in p?e:null!==(r=null===(n=v[g])||void 0===n?void 0:n.endpoint)&&void 0!==r?r:e,m={useFipsEndpoint:l,useDualstackEndpoint:d},w=function(e,t){var n=t.regionHostname,r=t.partitionHostname;return n||(r?r.replace("{region}",e):void 0)}(y,{regionHostname:b(null===(i=p[y])||void 0===i?void 0:i.variants,m),partitionHostname:b(null===(o=v[g])||void 0===o?void 0:o.variants,m)});if(void 0===w)throw new Error("Endpoint resolution failed for: "+{resolvedRegion:y,useFipsEndpoint:l,useDualstackEndpoint:d});var D=function(e,t){var n=t.signingRegion,r=t.regionRegex,i=t.useFipsEndpoint;if(n)return n;if(i){var o=r.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),u=e.match(o);if(u)return u[0].slice(1,-1)}}(w,{signingRegion:null===(u=p[y])||void 0===u?void 0:u.signingRegion,regionRegex:v[g].regionRegex,useFipsEndpoint:l});return s(s({partition:g,signingService:h,hostname:w},D&&{signingRegion:D}),(null===(a=p[y])||void 0===a?void 0:a.signingService)&&{signingService:p[y].signingService})},A=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.substr(-1)?e.protocol+":":e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/"+e.path:e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,n=new e(s(s({},this),{headers:s({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var r,i=t[n];return s(s({},e),((r={})[n]=Array.isArray(i)?p([],h(i)):i,r))}),{}))),n},e}();var S=function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers},e}();function C(e){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(e)}var _={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},F=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return l(t,void 0,void 0,(function(){var t,i,o,u,a;return f(this,(function(c){return t=r.request,A.isInstance(t)&&(i=t.body,o=t.headers,i&&-1===Object.keys(o).map((function(e){return e.toLowerCase()})).indexOf("content-length")&&void 0!==(u=e(i))&&(t.headers=s(s({},t.headers),((a={})["content-length"]=String(u),a)))),[2,n(s(s({},r),{request:t}))]}))}))}}}(e.bodyLengthChecker),_)}}};var P,x={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},B=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return l(void 0,void 0,void 0,(function(){var r,i;return f(this,(function(o){return A.isInstance(n.request)?(r=n.request,i=(e.requestHandler.metadata||{}).handlerProtocol,(void 0===i?"":i).indexOf("h2")>=0&&!r.headers[":authority"]?(delete r.headers.host,r.headers[":authority"]=""):r.headers.host||(r.headers.host=r.hostname),[2,t(n)]):[2,t(n)]}))}))}}}(e),x)}}},T={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},M=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return l(void 0,void 0,void 0,(function(){var r,i,o,u,a,s,l,d,h;return f(this,(function(f){switch(f.label){case 0:return r=t.clientName,i=t.commandName,o=t.inputFilterSensitiveLog,u=t.logger,a=t.outputFilterSensitiveLog,[4,e(n)];case 1:return s=f.sent(),u?("function"==typeof u.info&&(l=s.output,d=l.$metadata,h=c(l,["$metadata"]),u.info({clientName:r,commandName:i,input:o(n.input),output:a(h),metadata:d})),[2,s]):[2,s]}}))}))}}),T)}}};!function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(P||(P={}));var L,O=P.STANDARD,R=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],k=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],N=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],I=[500,502,503,504],j=function(e){var t,n;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||k.includes(e.name)||1==(null===(n=e.$retryable)||void 0===n?void 0:n.throttling)},U=function(){function e(e){var t,n,r,i,o;this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=null!==(t=null==e?void 0:e.beta)&&void 0!==t?t:.7,this.minCapacity=null!==(n=null==e?void 0:e.minCapacity)&&void 0!==n?n:1,this.minFillRate=null!==(r=null==e?void 0:e.minFillRate)&&void 0!==r?r:.5,this.scaleConstant=null!==(i=null==e?void 0:e.scaleConstant)&&void 0!==i?i:.4,this.smooth=null!==(o=null==e?void 0:e.smooth)&&void 0!==o?o:.8;var u=this.getCurrentTimeInSeconds();this.lastThrottleTime=u,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}return e.prototype.getCurrentTimeInSeconds=function(){return Date.now()/1e3},e.prototype.getSendToken=function(){return l(this,void 0,void 0,(function(){return f(this,(function(e){return[2,this.acquireTokenBucket(1)]}))}))},e.prototype.acquireTokenBucket=function(e){return l(this,void 0,void 0,(function(){var t;return f(this,(function(n){switch(n.label){case 0:return this.enabled?(this.refillTokenBucket(),e>this.currentCapacity?(t=(e-this.currentCapacity)/this.fillRate*1e3,[4,new Promise((function(e){return setTimeout(e,t)}))]):[3,2]):[2];case 1:n.sent(),n.label=2;case 2:return this.currentCapacity=this.currentCapacity-e,[2]}}))}))},e.prototype.refillTokenBucket=function(){var e=this.getCurrentTimeInSeconds();if(this.lastTimestamp){var t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}else this.lastTimestamp=e},e.prototype.updateClientSendingRate=function(e){var t;if(this.updateMeasuredRate(),j(e)){var n=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=n,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(n),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());var r=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(r)},e.prototype.calculateTimeWindow=function(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))},e.prototype.cubicThrottle=function(e){return this.getPrecise(e*this.beta)},e.prototype.cubicSuccess=function(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)},e.prototype.enableTokenBucket=function(){this.enabled=!0},e.prototype.updateTokenBucketRate=function(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)},e.prototype.updateMeasuredRate=function(){var e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){var n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}},e.prototype.getPrecise=function(e){return parseFloat(e.toFixed(8))},e}(),G=new Uint8Array(16);function z(){if(!L&&!(L="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L(G)}var H=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var q=function(e){return"string"==typeof e&&H.test(e)},$=[],W=0;W<256;++W)$.push((W+256).toString(16).substr(1));var V=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=($[e[t+0]]+$[e[t+1]]+$[e[t+2]]+$[e[t+3]]+"-"+$[e[t+4]]+$[e[t+5]]+"-"+$[e[t+6]]+$[e[t+7]]+"-"+$[e[t+8]]+$[e[t+9]]+"-"+$[e[t+10]]+$[e[t+11]]+$[e[t+12]]+$[e[t+13]]+$[e[t+14]]+$[e[t+15]]).toLowerCase();if(!q(n))throw TypeError("Stringified UUID is invalid");return n};var Y=function(e,t,n){var r=(e=e||{}).random||(e.rng||z)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return V(r)},K=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},Z=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return R.includes(e.name)}(e)||j(e)||function(e){var t;return N.includes(e.name)||I.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},J=function(){function e(e,t){var n,r,i;this.maxAttemptsProvider=e,this.mode=P.STANDARD,this.retryDecider=null!==(n=null==t?void 0:t.retryDecider)&&void 0!==n?n:Z,this.delayDecider=null!==(r=null==t?void 0:t.delayDecider)&&void 0!==r?r:K,this.retryQuota=null!==(i=null==t?void 0:t.retryQuota)&&void 0!==i?i:function(e,t){var n,r,i,o=e,u=null!==(n=null==t?void 0:t.noRetryIncrement)&&void 0!==n?n:1,a=null!==(r=null==t?void 0:t.retryCost)&&void 0!==r?r:5,s=null!==(i=null==t?void 0:t.timeoutRetryCost)&&void 0!==i?i:10,c=e,l=function(e){return"TimeoutError"===e.name?s:a},f=function(e){return l(e)<=c};return Object.freeze({hasRetryTokens:f,retrieveRetryTokens:function(e){if(!f(e))throw new Error("No retry token available");var t=l(e);return c-=t,t},releaseRetryTokens:function(e){c+=null!=e?e:u,c=Math.min(c,o)}})}(500)}return e.prototype.shouldRetry=function(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return l(this,void 0,void 0,(function(){var e;return f(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=t.sent(),[3,3];case 2:return t.sent(),e=3,[3,3];case 3:return[2,e]}}))}))},e.prototype.retry=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i,o,u,a,s,c,l;return f(this,(function(d){switch(d.label){case 0:return i=0,o=0,[4,this.getMaxAttempts()];case 1:u=d.sent(),a=t.request,A.isInstance(a)&&(a.headers["amz-sdk-invocation-id"]=Y()),s=function(){var s,l,d,h,p,v;return f(this,(function(f){switch(f.label){case 0:return f.trys.push([0,4,,7]),A.isInstance(a)&&(a.headers["amz-sdk-request"]="attempt="+(i+1)+"; max="+u),(null==n?void 0:n.beforeRequest)?[4,n.beforeRequest()]:[3,2];case 1:f.sent(),f.label=2;case 2:return[4,e(t)];case 3:return s=f.sent(),l=s.response,d=s.output,(null==n?void 0:n.afterRequest)&&n.afterRequest(l),c.retryQuota.releaseRetryTokens(r),d.$metadata.attempts=i+1,d.$metadata.totalRetryDelay=o,[2,{value:{response:l,output:d}}];case 4:return h=f.sent(),p=Q(h),i++,c.shouldRetry(p,i,u)?(r=c.retryQuota.retrieveRetryTokens(p),v=c.delayDecider(j(p)?500:100,i),o+=v,[4,new Promise((function(e){return setTimeout(e,v)}))]):[3,6];case 5:return f.sent(),[2,"continue"];case 6:throw p.$metadata||(p.$metadata={}),p.$metadata.attempts=i,p.$metadata.totalRetryDelay=o,p;case 7:return[2]}}))},c=this,d.label=2;case 2:return[5,s()];case 3:return"object"==typeof(l=d.sent())?[2,l.value]:[3,2];case 4:return[2]}}))}))},e}(),Q=function(e){return e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):"string"==typeof e?new Error(e):new Error("AWS SDK error wrapper for "+e)},X=function(e){function t(t,n){var r=this,i=null!=n?n:{},o=i.rateLimiter,u=c(i,["rateLimiter"]);return(r=e.call(this,t,u)||this).rateLimiter=null!=o?o:new U,r.mode=P.ADAPTIVE,r}return a(t,e),t.prototype.retry=function(t,n){return l(this,void 0,void 0,(function(){var r=this;return f(this,(function(i){return[2,e.prototype.retry.call(this,t,n,{beforeRequest:function(){return l(r,void 0,void 0,(function(){return f(this,(function(e){return[2,this.rateLimiter.getSendToken()]}))}))},afterRequest:function(e){r.rateLimiter.updateClientSendingRate(e)}})]}))}))},t}(J),ee=function(e){return l(void 0,void 0,void 0,(function(){return f(this,(function(t){switch(t.label){case 0:return"string"==typeof e?[2,e]:[4,e()];case 1:return[2,t.sent()]}}))}))},te=function(e){if(void 0===e&&(e=3),"number"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},ne={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},re=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,n){return function(r){return l(void 0,void 0,void 0,(function(){var i;return f(this,(function(o){switch(o.label){case 0:return[4,e.retryStrategy()];case 1:return(null==(i=o.sent())?void 0:i.mode)&&(n.userAgent=p(p([],h(n.userAgent||[])),[["cfg/retry-mode",i.mode]])),[2,i.retry(t,r)]}}))}))}}}(e),ne)}}},ie=function(e,t){return(ie=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)};function oe(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}ie(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function ue(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))}function ae(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;Object.create;(function(e){function t(t,n){void 0===n&&(n=!0);var r=e.call(this,t)||this;return r.tryNextLink=n,r}oe(t,e),t.from=function(e,t){return void 0===t&&(t=!0),Object.defineProperty(e,"tryNextLink",{value:t,configurable:!1,enumerable:!1,writable:!1}),e}})(Error),function(e){function t(t,n){void 0===n&&(n=!0);var r=e.call(this,t)||this;return r.tryNextLink=n,r.name="CredentialsProviderError",r}oe(t,e),t.from=function(e,t){return void 0===t&&(t=!0),Object.defineProperty(e,"tryNextLink",{value:t,configurable:!1,enumerable:!1,writable:!1}),e}}(Error);for(var se=function(e,t,n){var r,i,o,u=function(){return ue(void 0,void 0,void 0,(function(){return ae(this,(function(t){switch(t.label){case 0:i||(i=e()),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,i];case 2:return r=t.sent(),o=!0,[3,4];case 3:return i=void 0,[7];case 4:return[2,r]}}))}))};if(void 0===t)return function(){return ue(void 0,void 0,void 0,(function(){return ae(this,(function(e){switch(e.label){case 0:return o?[3,2]:[4,u()];case 1:r=e.sent(),e.label=2;case 2:return[2,r]}}))}))};var a=!1;return function(){return ue(void 0,void 0,void 0,(function(){return ae(this,(function(e){switch(e.label){case 0:return o?[3,2]:[4,u()];case 1:r=e.sent(),e.label=2;case 2:return a?[2,r]:n&&!n(r)?(a=!0,[2,r]):t(r)?[4,u()]:[3,4];case 3:return e.sent(),[2,r];case 4:return[2,r]}}))}))}},ce={},le={},fe=0;fe<256;fe++){var de=fe.toString(16).toLowerCase();1===de.length&&(de="0"+de),ce[fe]=de,le[de]=fe}function he(e){for(var t="",n=0;n<e.byteLength;n++)t+=ce[e[n]];return t}var pe="X-Amz-Date".toLowerCase(),ve=["authorization",pe,"date"],ge="X-Amz-Signature".toLowerCase(),ye="X-Amz-Security-Token".toLowerCase(),me={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},we=/^proxy-/,De=/^sec-/,be="AWS4-HMAC-SHA256-PAYLOAD",Ee={},Ae=[],Se=function(e,t,n){return e+"/"+t+"/"+n+"/aws4_request"},Ce=function(e,t,n){var r=new e(t);return r.update(n),r.digest()},_e=function(e,t,n){var r,i,o=e.headers,u={};try{for(var a=d(Object.keys(o).sort()),s=a.next();!s.done;s=a.next()){var c=s.value,l=c.toLowerCase();(l in me||(null==t?void 0:t.has(l))||we.test(l)||De.test(l))&&(!n||n&&!n.has(l))||(u[l]=o[c].trim().replace(/\s+/g," "))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return u},Fe=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,Pe)},Pe=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()},xe=function(e,t){var n=e.headers,r=e.body;return l(void 0,void 0,void 0,(function(){var e,i,o,u,a,s,c;return f(this,(function(l){switch(l.label){case 0:try{for(e=d(Object.keys(n)),i=e.next();!i.done;i=e.next())if("x-amz-content-sha256"===(o=i.value).toLowerCase())return[2,n[o]]}catch(e){s={error:e}}finally{try{i&&!i.done&&(c=e.return)&&c.call(e)}finally{if(s)throw s.error}}return null!=r?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof r||ArrayBuffer.isView(r)||(f=r,"function"==typeof ArrayBuffer&&f instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(f))?((u=new t).update(r),a=he,[4,u.digest()]):[3,3];case 2:return[2,a.apply(void 0,[l.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var f}))}))},Be=function(e){var t=e.headers,n=e.query,r=c(e,["headers","query"]);return s(s({},r),{headers:s({},t),query:n?Te(n):void 0})},Te=function(e){return Object.keys(e).reduce((function(t,n){var r,i=e[n];return s(s({},t),((r={})[n]=Array.isArray(i)?p([],h(i)):i,r))}),{})},Me=function(e){var t,n;e="function"==typeof e.clone?e.clone():Be(e);try{for(var r=d(Object.keys(e.headers)),i=r.next();!i.done;i=r.next()){var o=i.value;ve.indexOf(o.toLowerCase())>-1&&delete e.headers[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e},Le=function(e){return"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e},Oe=function(){function e(e){var t=e.applyChecksum,n=e.credentials,r=e.region,i=e.service,o=e.sha256,u=e.uriEscapePath,a=void 0===u||u;this.service=i,this.sha256=o,this.uriEscapePath=a,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}(r),this.credentialProvider=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),l(this,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,h,p,v,g,y,m,w,D,b,E,A,S,C,_,F,P;return f(this,(function(f){switch(f.label){case 0:return n=t.signingDate,r=void 0===n?new Date:n,i=t.expiresIn,o=void 0===i?3600:i,u=t.unsignableHeaders,a=t.unhoistableHeaders,c=t.signableHeaders,l=t.signingRegion,h=t.signingService,[4,this.credentialProvider()];case 1:return p=f.sent(),null==l?[3,2]:(g=l,[3,4]);case 2:return[4,this.regionProvider()];case 3:g=f.sent(),f.label=4;case 4:return v=g,y=Re(r),m=y.longDate,w=y.shortDate,o>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(D=Se(w,v,null!=h?h:this.service),b=function(e,t){var n,r,i;void 0===t&&(t={});var o="function"==typeof e.clone?e.clone():Be(e),u=o.headers,a=o.query,c=void 0===a?{}:a;try{for(var l=d(Object.keys(u)),f=l.next();!f.done;f=l.next()){var h=f.value,p=h.toLowerCase();"x-amz-"!==p.substr(0,6)||(null===(i=t.unhoistableHeaders)||void 0===i?void 0:i.has(p))||(c[h]=u[h],delete u[h])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return s(s({},e),{headers:u,query:c})}(Me(e),{unhoistableHeaders:a}),p.sessionToken&&(b.query["X-Amz-Security-Token"]=p.sessionToken),b.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",b.query["X-Amz-Credential"]=p.accessKeyId+"/"+D,b.query["X-Amz-Date"]=m,b.query["X-Amz-Expires"]=o.toString(10),E=_e(b,u,c),b.query["X-Amz-SignedHeaders"]=ke(E),A=b.query,S="X-Amz-Signature",C=this.getSignature,_=[m,D,this.getSigningKey(p,v,w,h)],F=this.createCanonicalRequest,P=[b,E],[4,xe(e,this.sha256)]);case 5:return[4,C.apply(this,_.concat([F.apply(this,P.concat([f.sent()]))]))];case 6:return A[S]=f.sent(),[2,b]}}))}))},e.prototype.sign=function(e,t){return l(this,void 0,void 0,(function(){return f(this,(function(n){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]}))}))},e.prototype.signEvent=function(e,t){var n=e.headers,r=e.payload,i=t.signingDate,o=void 0===i?new Date:i,u=t.priorSignature,a=t.signingRegion,s=t.signingService;return l(this,void 0,void 0,(function(){var e,t,i,c,l,d,h,p,v,g,y;return f(this,(function(f){switch(f.label){case 0:return null==a?[3,1]:(t=a,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=f.sent(),f.label=3;case 3:return e=t,i=Re(o),c=i.shortDate,l=i.longDate,d=Se(c,e,null!=s?s:this.service),[4,xe({headers:{},body:r},this.sha256)];case 4:return h=f.sent(),(p=new this.sha256).update(n),g=he,[4,p.digest()];case 5:return v=g.apply(void 0,[f.sent()]),y=[be,l,d,u,v,h].join("\n"),[2,this.signString(y,{signingDate:o,signingRegion:e,signingService:s})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,i=void 0===r?new Date:r,o=n.signingRegion,u=n.signingService;return l(this,void 0,void 0,(function(){var t,n,r,a,s,c,l,d;return f(this,(function(f){switch(f.label){case 0:return[4,this.credentialProvider()];case 1:return t=f.sent(),null==o?[3,2]:(r=o,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=f.sent(),f.label=4;case 4:return n=r,a=Re(i).shortDate,l=(c=this.sha256).bind,[4,this.getSigningKey(t,n,a,u)];case 5:return(s=new(l.apply(c,[void 0,f.sent()]))).update(e),d=he,[4,s.digest()];case 6:return[2,d.apply(void 0,[f.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,i=void 0===r?new Date:r,o=n.signableHeaders,u=n.unsignableHeaders,a=n.signingRegion,s=n.signingService;return l(this,void 0,void 0,(function(){var t,n,r,c,l,h,p,v,g,y,m;return f(this,(function(f){switch(f.label){case 0:return[4,this.credentialProvider()];case 1:return t=f.sent(),null==a?[3,2]:(r=a,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=f.sent(),f.label=4;case 4:return n=r,c=Me(e),l=Re(i),h=l.longDate,p=l.shortDate,v=Se(p,n,null!=s?s:this.service),c.headers[pe]=h,t.sessionToken&&(c.headers[ye]=t.sessionToken),[4,xe(c,this.sha256)];case 5:return g=f.sent(),!function(e,t){var n,r;e=e.toLowerCase();try{for(var i=d(Object.keys(t)),o=i.next();!o.done;o=i.next()){if(e===o.value.toLowerCase())return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1}("x-amz-content-sha256",c.headers)&&this.applyChecksum&&(c.headers["x-amz-content-sha256"]=g),y=_e(c,u,o),[4,this.getSignature(h,v,this.getSigningKey(t,n,p,s),this.createCanonicalRequest(c,y,g))];case 6:return m=f.sent(),c.headers.authorization="AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+v+", SignedHeaders="+ke(y)+", Signature="+m,[2,c]}}))}))},e.prototype.createCanonicalRequest=function(e,t,n){var r=Object.keys(t).sort();return e.method+"\n"+this.getCanonicalPath(e)+"\n"+function(e){var t,n,r=e.query,i=void 0===r?{}:r,o=[],u={},a=function(e){if(e.toLowerCase()===ge)return"continue";o.push(e);var t=i[e];"string"==typeof t?u[e]=Fe(e)+"="+Fe(t):Array.isArray(t)&&(u[e]=t.slice(0).sort().reduce((function(t,n){return t.concat([Fe(e)+"="+Fe(n)])}),[]).join("&"))};try{for(var s=d(Object.keys(i).sort()),c=s.next();!c.done;c=s.next()){a(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o.map((function(e){return u[e]})).filter((function(e){return e})).join("&")}(e)+"\n"+r.map((function(e){return e+":"+t[e]})).join("\n")+"\n\n"+r.join(";")+"\n"+n},e.prototype.createStringToSign=function(e,t,n){return l(this,void 0,void 0,(function(){var r,i;return f(this,(function(o){switch(o.label){case 0:return(r=new this.sha256).update(n),[4,r.digest()];case 1:return i=o.sent(),[2,"AWS4-HMAC-SHA256\n"+e+"\n"+t+"\n"+he(i)]}}))}))},e.prototype.getCanonicalPath=function(e){var t=e.path;return this.uriEscapePath?"/"+encodeURIComponent(t.replace(/^\//,"")).replace(/%2F/g,"/"):t},e.prototype.getSignature=function(e,t,n,r){return l(this,void 0,void 0,(function(){var i,o,u,a,s;return f(this,(function(c){switch(c.label){case 0:return[4,this.createStringToSign(e,t,r)];case 1:return i=c.sent(),a=(u=this.sha256).bind,[4,n];case 2:return(o=new(a.apply(u,[void 0,c.sent()]))).update(i),s=he,[4,o.digest()];case 3:return[2,s.apply(void 0,[c.sent()])]}}))}))},e.prototype.getSigningKey=function(e,t,n,r){return function(e,t,n,r,i){return l(void 0,void 0,void 0,(function(){var o,u,a,s,c,l,h,p,v;return f(this,(function(f){switch(f.label){case 0:return[4,Ce(e,t.secretAccessKey,t.accessKeyId)];case 1:if(o=f.sent(),(u=n+":"+r+":"+i+":"+he(o)+":"+t.sessionToken)in Ee)return[2,Ee[u]];for(Ae.push(u);Ae.length>50;)delete Ee[Ae.shift()];a="AWS4"+t.secretAccessKey,f.label=2;case 2:f.trys.push([2,7,8,9]),s=d([n,r,i,"aws4_request"]),c=s.next(),f.label=3;case 3:return c.done?[3,6]:(l=c.value,[4,Ce(e,a,l)]);case 4:a=f.sent(),f.label=5;case 5:return c=s.next(),[3,3];case 6:return[3,9];case 7:return h=f.sent(),p={error:h},[3,9];case 8:try{c&&!c.done&&(v=s.return)&&v.call(s)}finally{if(p)throw p.error}return[7];case 9:return[2,Ee[u]=a]}}))}))}(this.sha256,e,n,t,r||this.service)},e}(),Re=function(e){var t,n=(t=e,Le(t).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");return{longDate:n,shortDate:n.substr(0,8)}},ke=function(e){return Object.keys(e).sort().join(";")},Ne=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},Ie=function(e){return"function"==typeof e?se(e,(function(e){return void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5}),(function(e){return void 0!==e.expiration})):Ne(e)},je=function(e){return new Date(Date.now()+e)},Ue=function(e,t){var n=Date.parse(e);return function(e,t){return Math.abs(je(t).getTime()-e)>=3e5}(n,t)?n-Date.now():t},Ge=function(e){var t,n,r;return S.isInstance(e)?null!==(n=null===(t=e.headers)||void 0===t?void 0:t.date)&&void 0!==n?n:null===(r=e.headers)||void 0===r?void 0:r.Date:void 0},ze={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},He=function(e){return{applyToStack:function(t){t.addRelativeTo(function(e){return function(t,n){return function(r){return l(this,void 0,void 0,(function(){var i,o,u,a,c,l;return f(this,(function(f){switch(f.label){case 0:return A.isInstance(r.request)?[4,e.signer()]:[2,t(r)];case 1:return i=f.sent(),u=t,a=[s({},r)],l={},[4,i.sign(r.request,{signingDate:je(e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 2:return[4,u.apply(void 0,[s.apply(void 0,a.concat([(l.request=f.sent(),l)]))]).catch((function(t){var n,r=null!==(n=t.ServerTime)&&void 0!==n?n:Ge(t.$response);throw r&&(e.systemClockOffset=Ue(r,e.systemClockOffset)),t}))];case 3:return o=f.sent(),(c=Ge(o.response))&&(e.systemClockOffset=Ue(c,e.systemClockOffset)),[2,o]}}))}))}}}(e),ze)}}};var qe=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,$e=function(e){var t=h(e,2),n=t[0],r=t[1],i=n.indexOf("/"),o=n.substring(0,i),u=n.substring(i+1);return"api"===o&&(u=u.toLowerCase()),[o,u,r].filter((function(e){return e&&e.length>0})).map((function(e){return null==e?void 0:e.replace(qe,"_")})).join("/")},We={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Ve=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(r){return l(void 0,void 0,void 0,(function(){var i,o,u,a,c,l,d,v,g;return f(this,(function(f){switch(f.label){case 0:return i=r.request,A.isInstance(i)?(o=i.headers,u=(null===(v=null==t?void 0:t.userAgent)||void 0===v?void 0:v.map($e))||[],[4,n.defaultUserAgentProvider()]):[2,e(r)];case 1:return a=f.sent().map($e),c=(null===(g=null==n?void 0:n.customUserAgent)||void 0===g?void 0:g.map($e))||[],l=p(p(p([],h(a)),h(u)),h(c)).join(" "),d=p(p([],h(a.filter((function(e){return e.startsWith("aws-sdk-")})))),h(c)).join(" "),"browser"!==n.runtime?(d&&(o["x-amz-user-agent"]=o["x-amz-user-agent"]?o["user-agent"]+" "+d:d),o["user-agent"]=l):o["x-amz-user-agent"]=l,[2,e(s(s({},r),{request:i}))]}}))}))}}),We)}}},Ye=function(){var e=[],t=[],n=new Set,r=function(n){return e.forEach((function(e){n.add(e.middleware,s({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,s({},e))})),n},i=function(e){var t=[];return e.before.forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,p([],h(i(e))))})),t.push(e),e.after.reverse().forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,p([],h(i(e))))})),t},o=function(){var n,r=[],o=[],u={};return e.forEach((function(e){var t=s(s({},e),{before:[],after:[]});t.name&&(u[t.name]=t),r.push(t)})),t.forEach((function(e){var t=s(s({},e),{before:[],after:[]});t.name&&(u[t.name]=t),o.push(t)})),o.forEach((function(e){if(e.toMiddleware){var t=u[e.toMiddleware];if(void 0===t)throw new Error(e.toMiddleware+" is not found when adding "+(e.name||"anonymous")+" middleware "+e.relation+" "+e.toMiddleware);"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}})),(n=r,n.sort((function(e,t){return Ke[t.step]-Ke[e.step]||Ze[t.priority||"normal"]-Ze[e.priority||"normal"]}))).map(i).reduce((function(e,t){return e.push.apply(e,p([],h(t))),e}),[]).map((function(e){return e.middleware}))},u={add:function(t,r){void 0===r&&(r={});var i=r.name,o=r.override,u=s({step:"initialize",priority:"normal",middleware:t},r);if(i){if(n.has(i)){if(!o)throw new Error("Duplicate middleware name '"+i+"'");var a=e.findIndex((function(e){return e.name===i})),c=e[a];if(c.step!==u.step||c.priority!==u.priority)throw new Error('"'+i+'" middleware with '+c.priority+" priority in "+c.step+" step cannot be overridden by same-name middleware with "+u.priority+" priority in "+u.step+" step.");e.splice(a,1)}n.add(i)}e.push(u)},addRelativeTo:function(e,r){var i=r.name,o=r.override,u=s({middleware:e},r);if(i){if(n.has(i)){if(!o)throw new Error("Duplicate middleware name '"+i+"'");var a=t.findIndex((function(e){return e.name===i})),c=t[a];if(c.toMiddleware!==u.toMiddleware||c.relation!==u.relation)throw new Error('"'+i+'" middleware '+c.relation+' "'+c.toMiddleware+'" middleware cannot be overridden by same-name middleware '+u.relation+' "'+u.toMiddleware+'" middleware.');t.splice(a,1)}n.add(i)}t.push(u)},clone:function(){return r(Ye())},use:function(e){e.applyToStack(u)},remove:function(r){return"string"==typeof r?function(r){var i=!1,o=function(e){return!e.name||e.name!==r||(i=!0,n.delete(r),!1)};return e=e.filter(o),t=t.filter(o),i}(r):function(r){var i=!1,o=function(e){return e.middleware!==r||(i=!0,e.name&&n.delete(e.name),!1)};return e=e.filter(o),t=t.filter(o),i}(r)},removeByTag:function(r){var i=!1,o=function(e){var t=e.tags,o=e.name;return!t||!t.includes(r)||(o&&n.delete(o),i=!0,!1)};return e=e.filter(o),t=t.filter(o),i},concat:function(e){var t=r(Ye());return t.use(e),t},applyToStack:r,resolve:function(e,t){var n,r;try{for(var i=d(o().reverse()),u=i.next();!u.done;u=i.next()){e=(0,u.value)(e,t)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e}};return u},Ke={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Ze={high:3,normal:2,low:1},Je=function(){function e(e){this.middlewareStack=Ye(),this.config=e}return e.prototype.send=function(e,t,n){var r="function"!=typeof t?t:void 0,i="function"==typeof t?t:n,o=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!i)return o(e).then((function(e){return e.output}));o(e).then((function(e){return i(null,e.output)}),(function(e){return i(e)})).catch((function(){}))},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),Qe=function(){this.middlewareStack=Ye()},Xe="***SensitiveInformation***",et=function(e){if(null!=e){if("boolean"==typeof e)return e;throw new TypeError("Expected boolean, got "+typeof e)}},tt=function(e){if(null!=e){if("number"==typeof e)return e;throw new TypeError("Expected number, got "+typeof e)}},nt=Math.ceil(Math.pow(2,127)*(2-Math.pow(2,-23))),rt=function(e){var t=tt(e);if(void 0!==t&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>nt)throw new TypeError("Expected 32-bit float, got "+e);return t},it=function(e){if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError("Expected integer, got "+typeof e)}},ot=function(e){return st(e,32)},ut=function(e){return st(e,16)},at=function(e){return st(e,8)},st=function(e,t){var n=it(e);if(void 0!==n&&ct(n,t)!==n)throw new TypeError("Expected "+t+"-bit integer, got "+e);return n},ct=function(e,t){switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},lt=function(e,t){if(null==e){if(t)throw new TypeError("Expected a non-null value for "+t);throw new TypeError("Expected a non-null value")}return e},ft=function(e){if(null!=e){if("object"==typeof e&&!Array.isArray(e))return e;throw new TypeError("Expected object, got "+typeof e)}},dt=function(e){if(null!=e){if("string"==typeof e)return e;throw new TypeError("Expected string, got "+typeof e)}},ht=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,pt=function(e){var t=e.match(ht);if(null===t||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},vt=function(e){return"string"==typeof e?gt(e):tt(e)},gt=function(e){switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error("Unable to parse float value: "+e)}},yt=function(e){return ut("string"==typeof e?pt(e):e)},mt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var wt=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Dt=function(e){if(null!=e){if("string"!=typeof e)throw new TypeError("RFC-3339 date-times must be expressed as strings");var t=wt.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");var n=h(t,8),r=(n[0],n[1]),i=n[2],o=n[3],u=n[4],a=n[5],s=n[6],c=n[7],l=yt(Ft(r)),f=Ct(i,"month",1,12),d=Ct(o,"day",1,31);return bt(l,f,d,{hours:u,minutes:a,seconds:s,fractionalMilliseconds:c})}},bt=(new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),function(e,t,n,r){var i=t-1;return At(e,i,n),new Date(Date.UTC(e,i,n,Ct(r.hours,"hour",0,23),Ct(r.minutes,"minute",0,59),Ct(r.seconds,"seconds",0,60),_t(r.fractionalMilliseconds)))}),Et=[31,28,31,30,31,30,31,31,30,31,30,31],At=function(e,t,n){var r=Et[t];if(1===t&&St(e)&&(r=29),n>r)throw new TypeError("Invalid day for "+mt[t]+" in "+e+": "+n)},St=function(e){return e%4==0&&(e%100!=0||e%400==0)},Ct=function(e,t,n,r){var i=function(e){return at("string"==typeof e?pt(e):e)}(Ft(e));if(i<n||i>r)throw new TypeError(t+" must be between "+n+" and "+r+", inclusive");return i},_t=function(e){return null==e?0:1e3*function(e){return rt("string"==typeof e?pt(e):e)}("0."+e)},Ft=function(e){for(var t=0;t<e.length-1&&"0"===e.charAt(t);)t++;return 0===t?e:e.slice(t)},Pt=function(e){switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}};n(5);function xt(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}var Bt=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,p([null],h(arguments))),n=new t;return Object.setPrototypeOf(n,e.prototype),n};Bt.prototype=Object.create(String.prototype,{constructor:{value:Bt,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(Bt,String);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"==typeof e?e:JSON.stringify(e))}}(Bt);var Tt=function(e){if(e!=e)return"NaN";switch(e){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return e}};var Mt=n(13),Lt=n(12);for(var Ot=function(){function e(e){var t=this;"function"==typeof e?this.configProvider=function(){return l(t,void 0,void 0,(function(){return f(this,(function(t){switch(t.label){case 0:return[4,e()];case 1:return[2,t.sent()||{}]}}))}))}:this.config=null!=e?e:{}}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal;return l(this,void 0,void 0,(function(){var t,r,i,o,u,a,s,c,l,h,p,v;return f(this,(function(f){switch(f.label){case 0:return this.config||!this.configProvider?[3,2]:(t=this,[4,this.configProvider()]);case 1:t.config=f.sent(),f.label=2;case 2:return r=this.config.requestTimeout,(null==n?void 0:n.aborted)?((i=new Error("Request aborted")).name="AbortError",[2,Promise.reject(i)]):(o=e.path,e.query&&(u=function(e){var t,n,r=[];try{for(var i=d(Object.keys(e).sort()),o=i.next();!o.done;o=i.next()){var u=o.value,a=e[u];if(u=Fe(u),Array.isArray(a))for(var s=0,c=a.length;s<c;s++)r.push(u+"="+Fe(a[s]));else{var l=u;(a||"string"==typeof a)&&(l+="="+Fe(a)),r.push(l)}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r.join("&")}(e.query))&&(o+="?"+u),a=e.port,s=e.method,c=e.protocol+"//"+e.hostname+(a?":"+a:"")+o,l="GET"===s||"HEAD"===s?void 0:e.body,h={body:l,headers:new Headers(e.headers),method:s},"undefined"!=typeof AbortController&&(h.signal=n),p=new Request(c,h),v=[fetch(p).then((function(e){var t,n,r=e.headers,i={};try{for(var o=d(r.entries()),u=o.next();!u.done;u=o.next()){var a=u.value;i[a[0]]=a[1]}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new S({headers:i,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new S({headers:i,statusCode:e.status,body:t})}}))})),(g=r,void 0===g&&(g=0),new Promise((function(e,t){g&&setTimeout((function(){var e=new Error("Request did not complete within "+g+" ms");e.name="TimeoutError",t(e)}),g)})))],n&&v.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),[2,Promise.race(v)])}var g}))}))},e}(),Rt={},kt=new Array(64),Nt=0,It="A".charCodeAt(0),jt="Z".charCodeAt(0);Nt+It<=jt;Nt++){var Ut=String.fromCharCode(Nt+It);Rt[Ut]=Nt,kt[Nt]=Ut}for(Nt=0,It="a".charCodeAt(0),jt="z".charCodeAt(0);Nt+It<=jt;Nt++){Ut=String.fromCharCode(Nt+It);var Gt=Nt+26;Rt[Ut]=Gt,kt[Gt]=Ut}for(Nt=0;Nt<10;Nt++){Rt[Nt.toString(10)]=Nt+52;Ut=Nt.toString(10),Gt=Nt+52;Rt[Ut]=Gt,kt[Gt]=Ut}Rt["+"]=62,kt[62]="+",Rt["/"]=63,kt[63]="/";function zt(e){var t=e.length/4*3;"=="===e.substr(-2)?t-=2:"="===e.substr(-1)&&t--;for(var n=new ArrayBuffer(t),r=new DataView(n),i=0;i<e.length;i+=4){for(var o=0,u=0,a=i,s=i+3;a<=s;a++)if("="!==e[a]){if(!(e[a]in Rt))throw new TypeError("Invalid character "+e[a]+" in base64 string.");o|=Rt[e[a]]<<6*(s-a),u+=6}else o>>=6;var c=i/4*3;o>>=u%8;for(var l=Math.floor(u/8),f=0;f<l;f++){var d=8*(l-f-1);r.setUint8(c+f,(o&255<<d)>>d)}}return new Uint8Array(n)}function Ht(e){for(var t="",n=0;n<e.length;n+=3){for(var r=0,i=0,o=n,u=Math.min(n+3,e.length);o<u;o++)r|=e[o]<<8*(u-o-1),i+=8;var a=Math.ceil(i/6);r<<=6*a-i;for(var s=1;s<=a;s++){var c=6*(a-s);t+=kt[(r&63<<c)>>c]}t+="==".slice(0,4-a)}return t}var qt=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return l(this,void 0,void 0,(function(){var t,n;return f(this,(function(r){switch(r.label){case 0:return[4,$t(e)];case 1:return t=r.sent(),n=zt(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return l(this,void 0,void 0,(function(){var t,n,r,i,o,u,a;return f(this,(function(s){switch(s.label){case 0:t=new Uint8Array(0),n=e.getReader(),r=!1,s.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return i=s.sent(),o=i.done,(u=i.value)&&(a=t,(t=new Uint8Array(a.length+u.length)).set(a),t.set(u,a.length)),r=o,[3,1];case 3:return[2,t]}}))}))}(e)};function $t(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){var e;if(2!==r.readyState)return n(new Error("Reader aborted too early"));var i=null!==(e=r.result)&&void 0!==e?e:"",o=i.indexOf(","),u=o>-1?o+1:i.length;t(i.substring(u))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)}))}function Wt(e){if("string"==typeof e){for(var t=e.length,n=t-1;n>=0;n--){var r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2)}return t}return"number"==typeof e.byteLength?e.byteLength:"number"==typeof e.size?e.size:void 0}var Vt=n(1),Yt=n.n(Vt),Kt=function(e){var t=e.serviceId,n=e.clientVersion;return function(){return l(void 0,void 0,void 0,(function(){var e,r,i,o,u,a,s,c,l;return f(this,(function(f){return e="undefined"!=typeof window&&(null===(i=null===window||void 0===window?void 0:window.navigator)||void 0===i?void 0:i.userAgent)?Yt.a.parse(window.navigator.userAgent):void 0,r=[["aws-sdk-js",n],["os/"+((null===(o=null==e?void 0:e.os)||void 0===o?void 0:o.name)||"other"),null===(u=null==e?void 0:e.os)||void 0===u?void 0:u.version],["lang/js"],["md/browser",(null!==(s=null===(a=null==e?void 0:e.browser)||void 0===a?void 0:a.name)&&void 0!==s?s:"unknown")+"_"+(null!==(l=null===(c=null==e?void 0:e.browser)||void 0===c?void 0:c.version)&&void 0!==l?l:"unknown")]],t&&r.push(["api/"+t,n]),[2,r]}))}))}};var Zt=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192,63&i|128);else if(n+1<e.length&&55296==(64512&i)&&56320==(64512&e.charCodeAt(n+1))){var o=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(i>>12|224,i>>6&63|128,63&i|128)}return Uint8Array.from(t)}(e)},Jt=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var i=e[n];if(i<128)t+=String.fromCharCode(i);else if(192<=i&&i<224){var o=e[++n];t+=String.fromCharCode((31&i)<<6|63&o)}else if(240<=i&&i<365){var u="%"+[i,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(u)}else t+=String.fromCharCode((15&i)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)};var Qt=function(e){var t,n=new URL(e),r=n.hostname,i=n.pathname,o=n.port,u=n.protocol,a=n.search;return a&&(t=function(e){var t,n,r={};if(e=e.replace(/^\?/,""))try{for(var i=d(e.split("&")),o=i.next();!o.done;o=i.next()){var u=h(o.value.split("="),2),a=u[0],s=u[1],c=void 0===s?null:s;a=decodeURIComponent(a),c&&(c=decodeURIComponent(c)),a in r?Array.isArray(r[a])?r[a].push(c):r[a]=[r[a],c]:r[a]=c}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(a)),{hostname:r,port:o?parseInt(o):void 0,protocol:u,path:i,query:t}},Xt={},en={aws:{regions:["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-southeast-1","ap-southeast-2","ap-southeast-3","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"],regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",variants:[{hostname:"geo.{region}.amazonaws.com",tags:[]},{hostname:"geo-fips.{region}.amazonaws.com",tags:["fips"]},{hostname:"geo-fips.{region}.api.aws",tags:["dualstack","fips"]},{hostname:"geo.{region}.api.aws",tags:["dualstack"]}]},"aws-cn":{regions:["cn-north-1","cn-northwest-1"],regionRegex:"^cn\\-\\w+\\-\\d+$",variants:[{hostname:"geo.{region}.amazonaws.com.cn",tags:[]},{hostname:"geo-fips.{region}.amazonaws.com.cn",tags:["fips"]},{hostname:"geo-fips.{region}.api.amazonwebservices.com.cn",tags:["dualstack","fips"]},{hostname:"geo.{region}.api.amazonwebservices.com.cn",tags:["dualstack"]}]},"aws-iso":{regions:["us-iso-east-1","us-iso-west-1"],regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",variants:[{hostname:"geo.{region}.c2s.ic.gov",tags:[]},{hostname:"geo-fips.{region}.c2s.ic.gov",tags:["fips"]}]},"aws-iso-b":{regions:["us-isob-east-1"],regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",variants:[{hostname:"geo.{region}.sc2s.sgov.gov",tags:[]},{hostname:"geo-fips.{region}.sc2s.sgov.gov",tags:["fips"]}]},"aws-us-gov":{regions:["us-gov-east-1","us-gov-west-1"],regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",variants:[{hostname:"geo.{region}.amazonaws.com",tags:[]},{hostname:"geo-fips.{region}.amazonaws.com",tags:["fips"]},{hostname:"geo-fips.{region}.api.aws",tags:["dualstack","fips"]},{hostname:"geo.{region}.api.aws",tags:["dualstack"]}]}},tn=function(e,t){return l(void 0,void 0,void 0,(function(){return f(this,(function(n){return[2,E(e,s(s({},t),{signingService:"geo",regionHash:Xt,partitionHash:en}))]}))}))};function nn(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))}function rn(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;Object.create;var on,un,an,sn,cn,ln,fn,dn,hn,pn,vn,gn,yn,mn,wn,Dn,bn,En,An,Sn,Cn,_n,Fn,Pn,xn,Bn,Tn,Mn,Ln,On,Rn,kn,Nn,In,jn,Un,Gn,zn,Hn,qn,$n,Wn,Vn,Yn,Kn,Zn,Jn,Qn,Xn,er,tr,nr,rr,ir,or,ur,ar,sr,cr,lr,fr,dr,hr,pr,vr,gr,yr,mr,wr,Dr,br,Er,Ar,Sr,Cr,_r,Fr,Pr,xr,Br,Tr,Mr,Lr,Or,Rr,kr,Nr,Ir,jr,Ur,Gr,zr,Hr,qr,$r,Wr,Vr,Yr,Kr,Zr,Jr,Qr,Xr,ei,ti,ni,ri,ii,oi,ui,ai,si,ci,li,fi,di,hi,pi,vi,gi,yi,mi,wi,Di,bi,Ei,Ai,Si,Ci,_i,Fi,Pi,xi,Bi,Ti,Mi,Li,Oi,Ri,ki,Ni,Ii,ji,Ui,Gi,zi,Hi,qi=["in-region","cross-region","mobile","standard","legacy"],$i=function(){var e,t,n="undefined"!=typeof window&&(null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.userAgent)?Yt.a.parse(window.navigator.userAgent):void 0,r=null===(t=null==n?void 0:n.platform)||void 0===t?void 0:t.type;return"tablet"===r||"mobile"===r},Wi=function(e){var t,n,r,i,o,u,a,c,d,h,p,v,g,y,m,w,D=function(e){var t=(void 0===e?{}:e).defaultsMode;return se((function(){return nn(void 0,void 0,void 0,(function(){var e,n;return rn(this,(function(r){switch(r.label){case 0:return"function"!=typeof t?[3,2]:[4,t()];case 1:return n=r.sent(),[3,3];case 2:n=t,r.label=3;case 3:switch(null==(e=n)?void 0:e.toLowerCase()){case"auto":return[2,Promise.resolve($i()?"mobile":"standard")];case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return[2,Promise.resolve(null==e?void 0:e.toLocaleLowerCase())];case void 0:return[2,Promise.resolve("legacy")];default:throw new Error('Invalid parameter for "defaultsMode", expect '+qi.join(", ")+", got "+e)}return[2]}}))}))}))}(e),b=function(){return D().then(Pt)},E=function(e){var t,n,r,i,o;return{apiVersion:"2020-11-19",disableHostPrefix:null!==(t=null==e?void 0:e.disableHostPrefix)&&void 0!==t&&t,logger:null!==(n=null==e?void 0:e.logger)&&void 0!==n?n:{},regionInfoProvider:null!==(r=null==e?void 0:e.regionInfoProvider)&&void 0!==r?r:tn,serviceId:null!==(i=null==e?void 0:e.serviceId)&&void 0!==i?i:"Location",urlParser:null!==(o=null==e?void 0:e.urlParser)&&void 0!==o?o:Qt}}(e);return s(s(s({},E),e),{runtime:"browser",defaultsMode:D,base64Decoder:null!==(t=null==e?void 0:e.base64Decoder)&&void 0!==t?t:zt,base64Encoder:null!==(n=null==e?void 0:e.base64Encoder)&&void 0!==n?n:Ht,bodyLengthChecker:null!==(r=null==e?void 0:e.bodyLengthChecker)&&void 0!==r?r:Wt,credentialDefaultProvider:null!==(i=null==e?void 0:e.credentialDefaultProvider)&&void 0!==i?i:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:null!==(o=null==e?void 0:e.defaultUserAgentProvider)&&void 0!==o?o:Kt({serviceId:E.serviceId,clientVersion:Mt.version}),maxAttempts:null!==(u=null==e?void 0:e.maxAttempts)&&void 0!==u?u:3,region:null!==(a=null==e?void 0:e.region)&&void 0!==a?a:(w="Region is missing",function(){return Promise.reject(w)}),requestHandler:null!==(c=null==e?void 0:e.requestHandler)&&void 0!==c?c:new Ot(b),retryMode:null!==(d=null==e?void 0:e.retryMode)&&void 0!==d?d:function(){return l(void 0,void 0,void 0,(function(){return f(this,(function(e){switch(e.label){case 0:return[4,b()];case 1:return[2,e.sent().retryMode||O]}}))}))},sha256:null!==(h=null==e?void 0:e.sha256)&&void 0!==h?h:Lt.Sha256,streamCollector:null!==(p=null==e?void 0:e.streamCollector)&&void 0!==p?p:qt,useDualstackEndpoint:null!==(v=null==e?void 0:e.useDualstackEndpoint)&&void 0!==v?v:function(){return Promise.resolve(!1)},useFipsEndpoint:null!==(g=null==e?void 0:e.useFipsEndpoint)&&void 0!==g?g:function(){return Promise.resolve(!1)},utf8Decoder:null!==(y=null==e?void 0:e.utf8Decoder)&&void 0!==y?y:Zt,utf8Encoder:null!==(m=null==e?void 0:e.utf8Encoder)&&void 0!==m?m:Jt})},Vi=function(e){function t(t){var n,r,i=this,o=function(e){var t=e.region,n=e.useFipsEndpoint;if(!t)throw new Error("Region is missing");return s(s({},e),{region:function(){return l(void 0,void 0,void 0,(function(){var e;return f(this,(function(n){switch(n.label){case 0:return"string"==typeof t?[2,D(t)]:[4,t()];case 1:return e=n.sent(),[2,D(e)]}}))}))},useFipsEndpoint:function(){return l(void 0,void 0,void 0,(function(){var e;return f(this,(function(r){switch(r.label){case 0:return"string"!=typeof t?[3,1]:(e=t,[3,3]);case 1:return[4,t()];case 2:e=r.sent(),r.label=3;case 3:return w(e)?[2,!0]:[2,"boolean"==typeof n?Promise.resolve(n):n()]}}))}))}})}(Wi(t)),u=m(o),a=function(e){return s(s({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}(function(e){var t,n=e.credentials?Ie(e.credentials):e.credentialDefaultProvider(e),r=e.signingEscapePath,i=void 0===r||r,o=e.systemClockOffset,u=void 0===o?e.systemClockOffset||0:o,a=e.sha256;return t=e.signer?Ne(e.signer):function(){return Ne(e.region)().then((function(t){return l(void 0,void 0,void 0,(function(){var n,r,i,o;return f(this,(function(u){switch(u.label){case 0:return r=(n=e).regionInfoProvider,i=[t],o={},[4,e.useFipsEndpoint()];case 1:return o.useFipsEndpoint=u.sent(),[4,e.useDualstackEndpoint()];case 2:return[4,r.apply(n,i.concat([(o.useDualstackEndpoint=u.sent(),o)]))];case 3:return[2,[u.sent()||{},t]]}}))}))})).then((function(t){var r=h(t,2),o=r[0],u=r[1],c=o.signingRegion,l=o.signingService;e.signingRegion=e.signingRegion||c||u,e.signingName=e.signingName||l||e.serviceId;var f=s(s({},e),{credentials:n,region:e.signingRegion,service:e.signingName,sha256:a,uriEscapePath:i});return new(e.signerConstructor||Oe)(f)}))},s(s({},e),{systemClockOffset:u,signingEscapePath:i,credentials:n,signer:t})}((r=te((n=u).maxAttempts),s(s({},n),{maxAttempts:r,retryStrategy:function(){return l(void 0,void 0,void 0,(function(){return f(this,(function(e){switch(e.label){case 0:return n.retryStrategy?[2,n.retryStrategy]:[4,ee(n.retryMode)];case 1:return e.sent()===P.ADAPTIVE?[2,new X(r)]:[2,new J(r)]}}))}))}}))));return(i=e.call(this,a)||this).config=a,i.middlewareStack.use(re(i.config)),i.middlewareStack.use(F(i.config)),i.middlewareStack.use(B(i.config)),i.middlewareStack.use(M(i.config)),i.middlewareStack.use(He(i.config)),i.middlewareStack.use(Ve(i.config)),i}return a(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(Je),Yi={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Ki={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Zi(e,t,n){return{applyToStack:function(r){r.add(function(e,t){return function(n,r){return function(r){return l(void 0,void 0,void 0,(function(){var i,o,u;return f(this,(function(a){switch(a.label){case 0:return[4,n(r)];case 1:i=a.sent().response,a.label=2;case 2:return a.trys.push([2,4,,5]),[4,t(i,e)];case 3:return o=a.sent(),[2,{response:i,output:o}];case 4:throw u=a.sent(),Object.assign(u,{$response:i});case 5:return[2]}}))}))}}}(e,n),Yi),r.add(function(e,t){return function(n,r){return function(r){return l(void 0,void 0,void 0,(function(){var i;return f(this,(function(o){switch(o.label){case 0:return[4,t(r.input,e)];case 1:return i=o.sent(),[2,n(s(s({},r),{request:i}))]}}))}))}}}(e,t),Ki)}}}(on||(on={})).filterSensitiveLog=function(e){return s({},e)},(un||(un={})).filterSensitiveLog=function(e){return s({},e)},(an||(an={})).filterSensitiveLog=function(e){return s({},e)},(sn||(sn={})).filterSensitiveLog=function(e){return s({},e)},(cn||(cn={})).filterSensitiveLog=function(e){return s({},e)},(ln||(ln={})).filterSensitiveLog=function(e){return s({},e)},(fn||(fn={})).filterSensitiveLog=function(e){return s({},e)},(dn||(dn={})).filterSensitiveLog=function(e){return s({},e)},(hn||(hn={})).filterSensitiveLog=function(e){return s({},e)},(pn||(pn={})).filterSensitiveLog=function(e){return s({},e)},(vn||(vn={})).filterSensitiveLog=function(e){return s({},e)},(gn||(gn={})).filterSensitiveLog=function(e){return s(s(s({},e),e.Position&&{Position:Xe}),e.PositionProperties&&{PositionProperties:Xe})},(yn||(yn={})).filterSensitiveLog=function(e){return s(s({},e),e.DevicePositionUpdates&&{DevicePositionUpdates:e.DevicePositionUpdates.map((function(e){return gn.filterSensitiveLog(e)}))})},(mn||(mn={})).filterSensitiveLog=function(e){return s({},e)},(wn||(wn={})).filterSensitiveLog=function(e){return s({},e)},(Dn||(Dn={})).filterSensitiveLog=function(e){return s({},e)},(bn||(bn={})).filterSensitiveLog=function(e){return s(s(s({},e),e.Position&&{Position:Xe}),e.PositionProperties&&{PositionProperties:Xe})},(En||(En={})).filterSensitiveLog=function(e){return s({},e)},(An||(An={})).filterSensitiveLog=function(e){return s(s({},e),e.DevicePositions&&{DevicePositions:e.DevicePositions.map((function(e){return bn.filterSensitiveLog(e)}))})},(Sn||(Sn={})).filterSensitiveLog=function(e){return s(s({},e),e.Polygon&&{Polygon:e.Polygon.map((function(e){return Xe}))})},(Cn||(Cn={})).filterSensitiveLog=function(e){return s(s({},e),e.Geometry&&{Geometry:Sn.filterSensitiveLog(e.Geometry)})},(_n||(_n={})).filterSensitiveLog=function(e){return s(s({},e),e.Entries&&{Entries:e.Entries.map((function(e){return Cn.filterSensitiveLog(e)}))})},(Fn||(Fn={})).filterSensitiveLog=function(e){return s({},e)},(Pn||(Pn={})).filterSensitiveLog=function(e){return s({},e)},(xn||(xn={})).filterSensitiveLog=function(e){return s({},e)},(Bn||(Bn={})).filterSensitiveLog=function(e){return s(s({},e),e.Updates&&{Updates:e.Updates.map((function(e){return gn.filterSensitiveLog(e)}))})},(Tn||(Tn={})).filterSensitiveLog=function(e){return s({},e)},(Mn||(Mn={})).filterSensitiveLog=function(e){return s({},e)},(Ln||(Ln={})).filterSensitiveLog=function(e){return s({},e)},(On||(On={})).filterSensitiveLog=function(e){return s({},e)},(Rn||(Rn={})).filterSensitiveLog=function(e){return s({},e)},(kn||(kn={})).filterSensitiveLog=function(e){return s({},e)},(Nn||(Nn={})).filterSensitiveLog=function(e){return s(s(s(s({},e),e.DeparturePosition&&{DeparturePosition:Xe}),e.DestinationPosition&&{DestinationPosition:Xe}),e.WaypointPositions&&{WaypointPositions:Xe})},(In||(In={})).filterSensitiveLog=function(e){return s(s({},e),e.LineString&&{LineString:Xe})},(jn||(jn={})).filterSensitiveLog=function(e){return s(s(s({},e),e.StartPosition&&{StartPosition:Xe}),e.EndPosition&&{EndPosition:Xe})},(Un||(Un={})).filterSensitiveLog=function(e){return s(s(s(s(s({},e),e.StartPosition&&{StartPosition:Xe}),e.EndPosition&&{EndPosition:Xe}),e.Geometry&&{Geometry:In.filterSensitiveLog(e.Geometry)}),e.Steps&&{Steps:e.Steps.map((function(e){return jn.filterSensitiveLog(e)}))})},(Gn||(Gn={})).filterSensitiveLog=function(e){return s(s({},e),e.RouteBBox&&{RouteBBox:Xe})},(zn||(zn={})).filterSensitiveLog=function(e){return s(s(s({},e),e.Legs&&{Legs:e.Legs.map((function(e){return Un.filterSensitiveLog(e)}))}),e.Summary&&{Summary:Gn.filterSensitiveLog(e.Summary)})},(Hn||(Hn={})).filterSensitiveLog=function(e){return s(s(s({},e),e.DeparturePositions&&{DeparturePositions:Xe}),e.DestinationPositions&&{DestinationPositions:Xe})},(qn||(qn={})).filterSensitiveLog=function(e){return s({},e)},($n||($n={})).filterSensitiveLog=function(e){return s({},e)},(Wn||(Wn={})).filterSensitiveLog=function(e){return s({},e)},(Vn||(Vn={})).filterSensitiveLog=function(e){return s(s(s({},e),e.SnappedDeparturePositions&&{SnappedDeparturePositions:Xe}),e.SnappedDestinationPositions&&{SnappedDestinationPositions:Xe})},(Yn||(Yn={})).filterSensitiveLog=function(e){return s({},e)},(Kn||(Kn={})).filterSensitiveLog=function(e){return s({},e)},(Zn||(Zn={})).filterSensitiveLog=function(e){return s({},e)},(Jn||(Jn={})).filterSensitiveLog=function(e){return s({},e)},(Qn||(Qn={})).filterSensitiveLog=function(e){return s({},e)},(Xn||(Xn={})).filterSensitiveLog=function(e){return s({},e)},(er||(er={})).filterSensitiveLog=function(e){return s({},e)},(tr||(tr={})).filterSensitiveLog=function(e){return s({},e)},(nr||(nr={})).filterSensitiveLog=function(e){return s({},e)},(rr||(rr={})).filterSensitiveLog=function(e){return s({},e)},(ir||(ir={})).filterSensitiveLog=function(e){return s({},e)},(or||(or={})).filterSensitiveLog=function(e){return s({},e)},(ur||(ur={})).filterSensitiveLog=function(e){return s({},e)},(ar||(ar={})).filterSensitiveLog=function(e){return s({},e)},(sr||(sr={})).filterSensitiveLog=function(e){return s({},e)},(cr||(cr={})).filterSensitiveLog=function(e){return s({},e)},(lr||(lr={})).filterSensitiveLog=function(e){return s({},e)},(fr||(fr={})).filterSensitiveLog=function(e){return s({},e)},(dr||(dr={})).filterSensitiveLog=function(e){return s({},e)},(hr||(hr={})).filterSensitiveLog=function(e){return s({},e)},(pr||(pr={})).filterSensitiveLog=function(e){return s({},e)},(vr||(vr={})).filterSensitiveLog=function(e){return s({},e)},(gr||(gr={})).filterSensitiveLog=function(e){return s({},e)},(yr||(yr={})).filterSensitiveLog=function(e){return s({},e)},(mr||(mr={})).filterSensitiveLog=function(e){return s({},e)},(wr||(wr={})).filterSensitiveLog=function(e){return s({},e)},(Dr||(Dr={})).filterSensitiveLog=function(e){return s({},e)},(br||(br={})).filterSensitiveLog=function(e){return s({},e)},(Er||(Er={})).filterSensitiveLog=function(e){return s({},e)},(Ar||(Ar={})).filterSensitiveLog=function(e){return s({},e)},(Sr||(Sr={})).filterSensitiveLog=function(e){return s({},e)},(Cr||(Cr={})).filterSensitiveLog=function(e){return s({},e)},(_r||(_r={})).filterSensitiveLog=function(e){return s({},e)},(Fr||(Fr={})).filterSensitiveLog=function(e){return s({},e)},(Pr||(Pr={})).filterSensitiveLog=function(e){return s({},e)},(xr||(xr={})).filterSensitiveLog=function(e){return s({},e)},(Br||(Br={})).filterSensitiveLog=function(e){return s({},e)},(Tr||(Tr={})).filterSensitiveLog=function(e){return s({},e)},(Mr||(Mr={})).filterSensitiveLog=function(e){return s({},e)},(Lr||(Lr={})).filterSensitiveLog=function(e){return s({},e)},(Or||(Or={})).filterSensitiveLog=function(e){return s({},e)},(Rr||(Rr={})).filterSensitiveLog=function(e){return s(s({},e),e.Geometry&&{Geometry:Sn.filterSensitiveLog(e.Geometry)})},(kr||(kr={})).filterSensitiveLog=function(e){return s({},e)},(Nr||(Nr={})).filterSensitiveLog=function(e){return s({},e)},(Ir||(Ir={})).filterSensitiveLog=function(e){return s({},e)},(jr||(jr={})).filterSensitiveLog=function(e){return s({},e)},(Ur||(Ur={})).filterSensitiveLog=function(e){return s(s({},e),e.Geometry&&{Geometry:Sn.filterSensitiveLog(e.Geometry)})},(Gr||(Gr={})).filterSensitiveLog=function(e){return s(s({},e),e.Entries&&{Entries:e.Entries.map((function(e){return Ur.filterSensitiveLog(e)}))})},(zr||(zr={})).filterSensitiveLog=function(e){return s(s({},e),e.Geometry&&{Geometry:Sn.filterSensitiveLog(e.Geometry)})},(Hr||(Hr={})).filterSensitiveLog=function(e){return s({},e)},(qr||(qr={})).filterSensitiveLog=function(e){return s({},e)},($r||($r={})).filterSensitiveLog=function(e){return s({},e)},(Wr||(Wr={})).filterSensitiveLog=function(e){return s({},e)},(Vr||(Vr={})).filterSensitiveLog=function(e){return s(s(s({},e),e.Position&&{Position:Xe}),e.PositionProperties&&{PositionProperties:Xe})},(Yr||(Yr={})).filterSensitiveLog=function(e){return s({},e)},(Kr||(Kr={})).filterSensitiveLog=function(e){return s(s({},e),e.DevicePositions&&{DevicePositions:e.DevicePositions.map((function(e){return bn.filterSensitiveLog(e)}))})},(Zr||(Zr={})).filterSensitiveLog=function(e){return s({},e)},(Jr||(Jr={})).filterSensitiveLog=function(e){return s({},e)},(Qr||(Qr={})).filterSensitiveLog=function(e){return s({},e)},(Xr||(Xr={})).filterSensitiveLog=function(e){return s({},e)},(ei||(ei={})).filterSensitiveLog=function(e){return s({},e)},(ti||(ti={})).filterSensitiveLog=function(e){return s({},e)},(ni||(ni={})).filterSensitiveLog=function(e){return s({},e)},(ri||(ri={})).filterSensitiveLog=function(e){return s({},e)},(ii||(ii={})).filterSensitiveLog=function(e){return s({},e)},(oi||(oi={})).filterSensitiveLog=function(e){return s(s(s({},e),e.Position&&{Position:Xe}),e.PositionProperties&&{PositionProperties:Xe})},(ui||(ui={})).filterSensitiveLog=function(e){return s(s({},e),e.Entries&&{Entries:e.Entries.map((function(e){return oi.filterSensitiveLog(e)}))})},(ai||(ai={})).filterSensitiveLog=function(e){return s({},e)},(si||(si={})).filterSensitiveLog=function(e){return s({},e)},(ci||(ci={})).filterSensitiveLog=function(e){return s({},e)},(li||(li={})).filterSensitiveLog=function(e){return s({},e)},(fi||(fi={})).filterSensitiveLog=function(e){return s({},e)},(di||(di={})).filterSensitiveLog=function(e){return s({},e)},(hi||(hi={})).filterSensitiveLog=function(e){return s({},e)},(pi||(pi={})).filterSensitiveLog=function(e){return s({},e)},(vi||(vi={})).filterSensitiveLog=function(e){return s({},e)},(gi||(gi={})).filterSensitiveLog=function(e){return s({},e)},(yi||(yi={})).filterSensitiveLog=function(e){return s({},e)},(mi||(mi={})).filterSensitiveLog=function(e){return s({},e)},(wi||(wi={})).filterSensitiveLog=function(e){return s({},e)},(Di||(Di={})).filterSensitiveLog=function(e){return s({},e)},(bi||(bi={})).filterSensitiveLog=function(e){return s({},e)},(Ei||(Ei={})).filterSensitiveLog=function(e){return s({},e)},(Ai||(Ai={})).filterSensitiveLog=function(e){return s(s({},e),e.Position&&{Position:Xe})},(Si||(Si={})).filterSensitiveLog=function(e){return s(s({},e),e.Point&&{Point:Xe})},(Ci||(Ci={})).filterSensitiveLog=function(e){return s({},e)},(_i||(_i={})).filterSensitiveLog=function(e){return s(s({},e),e.Geometry&&{Geometry:Si.filterSensitiveLog(e.Geometry)})},(Fi||(Fi={})).filterSensitiveLog=function(e){return s(s({},e),e.Place&&{Place:_i.filterSensitiveLog(e.Place)})},(Pi||(Pi={})).filterSensitiveLog=function(e){return s(s({},e),e.Position&&{Position:Xe})},(xi||(xi={})).filterSensitiveLog=function(e){return s(s(s({},e),e.Summary&&{Summary:Pi.filterSensitiveLog(e.Summary)}),e.Results&&{Results:e.Results.map((function(e){return Fi.filterSensitiveLog(e)}))})},(Bi||(Bi={})).filterSensitiveLog=function(e){return s(s(s(s({},e),e.Text&&{Text:Xe}),e.BiasPosition&&{BiasPosition:Xe}),e.FilterBBox&&{FilterBBox:Xe})},(Ti||(Ti={})).filterSensitiveLog=function(e){return s({},e)},(Mi||(Mi={})).filterSensitiveLog=function(e){return s(s(s(s({},e),e.Text&&{Text:Xe}),e.BiasPosition&&{BiasPosition:Xe}),e.FilterBBox&&{FilterBBox:Xe})},(Li||(Li={})).filterSensitiveLog=function(e){return s(s({},e),e.Summary&&{Summary:Mi.filterSensitiveLog(e.Summary)})},(Oi||(Oi={})).filterSensitiveLog=function(e){return s(s(s(s({},e),e.Text&&{Text:Xe}),e.BiasPosition&&{BiasPosition:Xe}),e.FilterBBox&&{FilterBBox:Xe})},(Ri||(Ri={})).filterSensitiveLog=function(e){return s(s({},e),e.Place&&{Place:_i.filterSensitiveLog(e.Place)})},(ki||(ki={})).filterSensitiveLog=function(e){return s(s(s(s(s({},e),e.Text&&{Text:Xe}),e.BiasPosition&&{BiasPosition:Xe}),e.FilterBBox&&{FilterBBox:Xe}),e.ResultBBox&&{ResultBBox:Xe})},(Ni||(Ni={})).filterSensitiveLog=function(e){return s(s(s({},e),e.Summary&&{Summary:ki.filterSensitiveLog(e.Summary)}),e.Results&&{Results:e.Results.map((function(e){return Ri.filterSensitiveLog(e)}))})},(Ii||(Ii={})).filterSensitiveLog=function(e){return s({},e)},(ji||(ji={})).filterSensitiveLog=function(e){return s({},e)},(Ui||(Ui={})).filterSensitiveLog=function(e){return s({},e)},(Gi||(Gi={})).filterSensitiveLog=function(e){return s({},e)},(zi||(zi={})).filterSensitiveLog=function(e){return s({},e)},(Hi||(Hi={})).filterSensitiveLog=function(e){return s({},e)};var Ji=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,d,h,p,v;return f(this,(function(f){switch(f.label){case 0:return r=[s({},e)],v={},[4,ko(e.body,t)];case 1:switch(n=s.apply(void 0,r.concat([(v.body=f.sent(),v)])),o="UnknownError",o=No(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,ro(n,t)];case 3:return i=s.apply(void 0,[s.apply(void 0,u.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 4:return a=[{}],[4,io(n,t)];case 5:return i=s.apply(void 0,[s.apply(void 0,a.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 6:return c=[{}],[4,oo(n,t)];case 7:return i=s.apply(void 0,[s.apply(void 0,c.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 8:return l=[{}],[4,uo(n,t)];case 9:return i=s.apply(void 0,[s.apply(void 0,l.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 10:return d=[{}],[4,ao(n,t)];case 11:return i=s.apply(void 0,[s.apply(void 0,d.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 12:h=n.body,o=h.code||h.Code||o,i=s(s({},h),{name:""+o,message:h.message||h.Message||o,$fault:"client",$metadata:Oo(e)}),f.label=13;case 13:return p=i.message||i.Message||o,i.message=p,delete i.Message,[2,Promise.reject(Object.assign(new Error(p),i))]}}))}))},Qi=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,d,h,p,v;return f(this,(function(f){switch(f.label){case 0:return r=[s({},e)],v={},[4,ko(e.body,t)];case 1:switch(n=s.apply(void 0,r.concat([(v.body=f.sent(),v)])),o="UnknownError",o=No(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,ro(n,t)];case 3:return i=s.apply(void 0,[s.apply(void 0,u.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 4:return a=[{}],[4,io(n,t)];case 5:return i=s.apply(void 0,[s.apply(void 0,a.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 6:return c=[{}],[4,oo(n,t)];case 7:return i=s.apply(void 0,[s.apply(void 0,c.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 8:return l=[{}],[4,uo(n,t)];case 9:return i=s.apply(void 0,[s.apply(void 0,l.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 10:return d=[{}],[4,ao(n,t)];case 11:return i=s.apply(void 0,[s.apply(void 0,d.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 12:h=n.body,o=h.code||h.Code||o,i=s(s({},h),{name:""+o,message:h.message||h.Message||o,$fault:"client",$metadata:Oo(e)}),f.label=13;case 13:return p=i.message||i.Message||o,i.message=p,delete i.Message,[2,Promise.reject(Object.assign(new Error(p),i))]}}))}))},Xi=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,d,h,p,v;return f(this,(function(f){switch(f.label){case 0:return r=[s({},e)],v={},[4,ko(e.body,t)];case 1:switch(n=s.apply(void 0,r.concat([(v.body=f.sent(),v)])),o="UnknownError",o=No(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,ro(n,t)];case 3:return i=s.apply(void 0,[s.apply(void 0,u.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 4:return a=[{}],[4,io(n,t)];case 5:return i=s.apply(void 0,[s.apply(void 0,a.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 6:return c=[{}],[4,oo(n,t)];case 7:return i=s.apply(void 0,[s.apply(void 0,c.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 8:return l=[{}],[4,uo(n,t)];case 9:return i=s.apply(void 0,[s.apply(void 0,l.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 10:return d=[{}],[4,ao(n,t)];case 11:return i=s.apply(void 0,[s.apply(void 0,d.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 12:h=n.body,o=h.code||h.Code||o,i=s(s({},h),{name:""+o,message:h.message||h.Message||o,$fault:"client",$metadata:Oo(e)}),f.label=13;case 13:return p=i.message||i.Message||o,i.message=p,delete i.Message,[2,Promise.reject(Object.assign(new Error(p),i))]}}))}))},eo=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,d,h,p,v;return f(this,(function(f){switch(f.label){case 0:return r=[s({},e)],v={},[4,ko(e.body,t)];case 1:switch(n=s.apply(void 0,r.concat([(v.body=f.sent(),v)])),o="UnknownError",o=No(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,ro(n,t)];case 3:return i=s.apply(void 0,[s.apply(void 0,u.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 4:return a=[{}],[4,io(n,t)];case 5:return i=s.apply(void 0,[s.apply(void 0,a.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 6:return c=[{}],[4,oo(n,t)];case 7:return i=s.apply(void 0,[s.apply(void 0,c.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 8:return l=[{}],[4,uo(n,t)];case 9:return i=s.apply(void 0,[s.apply(void 0,l.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 10:return d=[{}],[4,ao(n,t)];case 11:return i=s.apply(void 0,[s.apply(void 0,d.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 12:h=n.body,o=h.code||h.Code||o,i=s(s({},h),{name:""+o,message:h.message||h.Message||o,$fault:"client",$metadata:Oo(e)}),f.label=13;case 13:return p=i.message||i.Message||o,i.message=p,delete i.Message,[2,Promise.reject(Object.assign(new Error(p),i))]}}))}))},to=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,d,h,p,v;return f(this,(function(f){switch(f.label){case 0:return r=[s({},e)],v={},[4,ko(e.body,t)];case 1:switch(n=s.apply(void 0,r.concat([(v.body=f.sent(),v)])),o="UnknownError",o=No(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,ro(n,t)];case 3:return i=s.apply(void 0,[s.apply(void 0,u.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 4:return a=[{}],[4,io(n,t)];case 5:return i=s.apply(void 0,[s.apply(void 0,a.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 6:return c=[{}],[4,oo(n,t)];case 7:return i=s.apply(void 0,[s.apply(void 0,c.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 8:return l=[{}],[4,uo(n,t)];case 9:return i=s.apply(void 0,[s.apply(void 0,l.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 10:return d=[{}],[4,ao(n,t)];case 11:return i=s.apply(void 0,[s.apply(void 0,d.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 12:h=n.body,o=h.code||h.Code||o,i=s(s({},h),{name:""+o,message:h.message||h.Message||o,$fault:"client",$metadata:Oo(e)}),f.label=13;case 13:return p=i.message||i.Message||o,i.message=p,delete i.Message,[2,Promise.reject(Object.assign(new Error(p),i))]}}))}))},no=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,d,h,p,v;return f(this,(function(f){switch(f.label){case 0:return r=[s({},e)],v={},[4,ko(e.body,t)];case 1:switch(n=s.apply(void 0,r.concat([(v.body=f.sent(),v)])),o="UnknownError",o=No(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.location#AccessDeniedException":return[3,2];case"InternalServerException":case"com.amazonaws.location#InternalServerException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.location#ResourceNotFoundException":return[3,6];case"ThrottlingException":case"com.amazonaws.location#ThrottlingException":return[3,8];case"ValidationException":case"com.amazonaws.location#ValidationException":return[3,10]}return[3,12];case 2:return u=[{}],[4,ro(n,t)];case 3:return i=s.apply(void 0,[s.apply(void 0,u.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 4:return a=[{}],[4,io(n,t)];case 5:return i=s.apply(void 0,[s.apply(void 0,a.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 6:return c=[{}],[4,oo(n,t)];case 7:return i=s.apply(void 0,[s.apply(void 0,c.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 8:return l=[{}],[4,uo(n,t)];case 9:return i=s.apply(void 0,[s.apply(void 0,l.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 10:return d=[{}],[4,ao(n,t)];case 11:return i=s.apply(void 0,[s.apply(void 0,d.concat([f.sent()])),{name:o,$metadata:Oo(e)}]),[3,13];case 12:h=n.body,o=h.code||h.Code||o,i=s(s({},h),{name:""+o,message:h.message||h.Message||o,$fault:"client",$metadata:Oo(e)}),f.label=13;case 13:return p=i.message||i.Message||o,i.message=p,delete i.Message,[2,Promise.reject(Object.assign(new Error(p),i))]}}))}))},ro=function(e,t){return l(void 0,void 0,void 0,(function(){var t,n;return f(this,(function(r){return t={name:"AccessDeniedException",$fault:"client",$metadata:Oo(e),Message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.Message=dt(n.message)),[2,t]}))}))},io=function(e,t){return l(void 0,void 0,void 0,(function(){var t,n;return f(this,(function(r){return t={name:"InternalServerException",$fault:"server",$retryable:{},$metadata:Oo(e),Message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.Message=dt(n.message)),[2,t]}))}))},oo=function(e,t){return l(void 0,void 0,void 0,(function(){var t,n;return f(this,(function(r){return t={name:"ResourceNotFoundException",$fault:"client",$metadata:Oo(e),Message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.Message=dt(n.message)),[2,t]}))}))},uo=function(e,t){return l(void 0,void 0,void 0,(function(){var t,n;return f(this,(function(r){return t={name:"ThrottlingException",$fault:"client",$retryable:{},$metadata:Oo(e),Message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.Message=dt(n.message)),[2,t]}))}))},ao=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r;return f(this,(function(i){return n={name:"ValidationException",$fault:"client",$metadata:Oo(e),FieldList:void 0,Message:void 0,Reason:void 0},void 0!==(r=e.body).fieldList&&null!==r.fieldList&&(n.FieldList=Lo(r.fieldList,t)),void 0!==r.message&&null!==r.message&&(n.Message=dt(r.message)),void 0!==r.reason&&null!==r.reason&&(n.Reason=dt(r.reason)),[2,n]}))}))},so=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return s(s({},void 0!==e.GeofenceId&&null!==e.GeofenceId&&{GeofenceId:e.GeofenceId}),void 0!==e.Geometry&&null!==e.Geometry&&{Geometry:fo(e.Geometry,t)})}(e,t)}))},co=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:Tt(e)}))},lo=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:e}))},fo=function(e,t){return s({},void 0!==e.Polygon&&null!==e.Polygon&&{Polygon:po(e.Polygon,t)})},ho=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:e}))},po=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:vo(e,t)}))}(e,t)}))},vo=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:Tt(e)}))},go=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{Error:void 0!==e.Error&&null!==e.Error?yo(e.Error,t):void 0,GeofenceId:dt(e.GeofenceId)}}(e,t)}))},yo=function(e,t){return{Code:dt(e.Code),Message:dt(e.Message)}},mo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{Error:void 0!==e.Error&&null!==e.Error?yo(e.Error,t):void 0,GeofenceId:dt(e.GeofenceId)}}(e,t)}))},wo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{CreateTime:void 0!==e.CreateTime&&null!==e.CreateTime?lt(Dt(e.CreateTime)):void 0,GeofenceId:dt(e.GeofenceId),UpdateTime:void 0!==e.UpdateTime&&null!==e.UpdateTime?lt(Dt(e.UpdateTime)):void 0}}(e)}))},Do=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:vt(e)}))},bo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:dt(e)}))},Eo=function(e,t){return{Polygon:void 0!==e.Polygon&&null!==e.Polygon?Ao(e.Polygon,t):void 0}},Ao=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:Fo(e,t)}))}(e,t)}))},So=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{CreateTime:void 0!==e.CreateTime&&null!==e.CreateTime?lt(Dt(e.CreateTime)):void 0,GeofenceId:dt(e.GeofenceId),Geometry:void 0!==e.Geometry&&null!==e.Geometry?Eo(e.Geometry,t):void 0,Status:dt(e.Status),UpdateTime:void 0!==e.UpdateTime&&null!==e.UpdateTime?lt(Dt(e.UpdateTime)):void 0}}(e,t)}))},Co=function(e,t){return{AddressNumber:dt(e.AddressNumber),Country:dt(e.Country),Geometry:void 0!==e.Geometry&&null!==e.Geometry?_o(e.Geometry,t):void 0,Interpolated:et(e.Interpolated),Label:dt(e.Label),Municipality:dt(e.Municipality),Neighborhood:dt(e.Neighborhood),PostalCode:dt(e.PostalCode),Region:dt(e.Region),Street:dt(e.Street),SubRegion:dt(e.SubRegion),TimeZone:void 0!==e.TimeZone&&null!==e.TimeZone?Mo(e.TimeZone,t):void 0}},_o=function(e,t){return{Point:void 0!==e.Point&&null!==e.Point?Fo(e.Point,t):void 0}},Fo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:vt(e)}))},Po=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{Distance:vt(e.Distance),Place:void 0!==e.Place&&null!==e.Place?Co(e.Place,t):void 0}}(e,t)}))},xo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{Distance:vt(e.Distance),Place:void 0!==e.Place&&null!==e.Place?Co(e.Place,t):void 0,Relevance:vt(e.Relevance)}}(e,t)}))},Bo=function(e,t){return{DataSource:dt(e.DataSource),Language:dt(e.Language),MaxResults:ot(e.MaxResults),Position:void 0!==e.Position&&null!==e.Position?Fo(e.Position,t):void 0}},To=function(e,t){return{BiasPosition:void 0!==e.BiasPosition&&null!==e.BiasPosition?Fo(e.BiasPosition,t):void 0,DataSource:dt(e.DataSource),FilterBBox:void 0!==e.FilterBBox&&null!==e.FilterBBox?Do(e.FilterBBox):void 0,FilterCountries:void 0!==e.FilterCountries&&null!==e.FilterCountries?bo(e.FilterCountries):void 0,Language:dt(e.Language),MaxResults:ot(e.MaxResults),ResultBBox:void 0!==e.ResultBBox&&null!==e.ResultBBox?Do(e.ResultBBox):void 0,Text:dt(e.Text)}},Mo=function(e,t){return{Name:dt(e.Name),Offset:ot(e.Offset)}},Lo=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{Message:dt(e.message),Name:dt(e.name)}}(e)}))},Oo=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},Ro=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},ko=function(e,t){return function(e,t){return Ro(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},No=function(e,t){var n,r,i=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==o?i(e.headers[o]):void 0!==t.code?i(t.code):void 0!==t.__type?i(t.__type):""},Io=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return a(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Zi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"SearchPlaceIndexForTextCommand",inputFilterSensitiveLog:Oi.filterSensitiveLog,outputFilterSensitiveLog:Ni.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,d,h;return f(this,(function(f){switch(f.label){case 0:return[4,t.endpoint()];case 1:if(n=f.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={"content-type":"application/json"},c=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/places/v0/indexes/{IndexName}/search/text",void 0===e.IndexName)throw new Error("No value provided for input HTTP label: IndexName.");if((l=e.IndexName).length<=0)throw new Error("Empty value provided for input HTTP label: IndexName.");return c=c.replace("{IndexName}",xt(l)),d=JSON.stringify(s(s(s(s(s(s({},void 0!==e.BiasPosition&&null!==e.BiasPosition&&{BiasPosition:vo(e.BiasPosition,t)}),void 0!==e.FilterBBox&&null!==e.FilterBBox&&{FilterBBox:co(e.FilterBBox,t)}),void 0!==e.FilterCountries&&null!==e.FilterCountries&&{FilterCountries:lo(e.FilterCountries,t)}),void 0!==e.Language&&null!==e.Language&&{Language:e.Language}),void 0!==e.MaxResults&&null!==e.MaxResults&&{MaxResults:e.MaxResults}),void 0!==e.Text&&null!==e.Text&&{Text:e.Text})),[4,t.endpoint()];case 2:if(h=f.sent().hostname,!0!==t.disableHostPrefix&&!C(h="places."+h))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new A({protocol:i,hostname:h,port:o,method:"POST",headers:a,path:c,body:d})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o;return f(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,no(e,t)]:(n={$metadata:Oo(e),Results:void 0,Summary:void 0},i=lt,o=ft,[4,ko(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).Results&&null!==r.Results&&(n.Results=xo(r.Results,t)),void 0!==r.Summary&&null!==r.Summary&&(n.Summary=To(r.Summary,t)),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Qe),jo=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return a(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Zi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"SearchPlaceIndexForPositionCommand",inputFilterSensitiveLog:Ai.filterSensitiveLog,outputFilterSensitiveLog:xi.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,d,h;return f(this,(function(f){switch(f.label){case 0:return[4,t.endpoint()];case 1:if(n=f.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={"content-type":"application/json"},c=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/places/v0/indexes/{IndexName}/search/position",void 0===e.IndexName)throw new Error("No value provided for input HTTP label: IndexName.");if((l=e.IndexName).length<=0)throw new Error("Empty value provided for input HTTP label: IndexName.");return c=c.replace("{IndexName}",xt(l)),d=JSON.stringify(s(s(s({},void 0!==e.Language&&null!==e.Language&&{Language:e.Language}),void 0!==e.MaxResults&&null!==e.MaxResults&&{MaxResults:e.MaxResults}),void 0!==e.Position&&null!==e.Position&&{Position:vo(e.Position,t)})),[4,t.endpoint()];case 2:if(h=f.sent().hostname,!0!==t.disableHostPrefix&&!C(h="places."+h))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new A({protocol:i,hostname:h,port:o,method:"POST",headers:a,path:c,body:d})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o;return f(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,to(e,t)]:(n={$metadata:Oo(e),Results:void 0,Summary:void 0},i=lt,o=ft,[4,ko(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).Results&&null!==r.Results&&(n.Results=Po(r.Results,t)),void 0!==r.Summary&&null!==r.Summary&&(n.Summary=Bo(r.Summary,t)),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Qe),Uo=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return a(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Zi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"GetGeofenceCommand",inputFilterSensitiveLog:Or.filterSensitiveLog,outputFilterSensitiveLog:Rr.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,s,c,l;return f(this,(function(f){switch(f.label){case 0:return[4,t.endpoint()];case 1:if(n=f.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={},s=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/geofencing/v0/collections/{CollectionName}/geofences/{GeofenceId}",void 0===e.CollectionName)throw new Error("No value provided for input HTTP label: CollectionName.");if((c=e.CollectionName).length<=0)throw new Error("Empty value provided for input HTTP label: CollectionName.");if(s=s.replace("{CollectionName}",xt(c)),void 0===e.GeofenceId)throw new Error("No value provided for input HTTP label: GeofenceId.");if((c=e.GeofenceId).length<=0)throw new Error("Empty value provided for input HTTP label: GeofenceId.");return s=s.replace("{GeofenceId}",xt(c)),[4,t.endpoint()];case 2:if(l=f.sent().hostname,!0!==t.disableHostPrefix&&!C(l="geofencing."+l))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new A({protocol:i,hostname:l,port:o,method:"GET",headers:a,path:s,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o;return f(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,Xi(e,t)]:(n={$metadata:Oo(e),CreateTime:void 0,GeofenceId:void 0,Geometry:void 0,Status:void 0,UpdateTime:void 0},i=lt,o=ft,[4,ko(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).CreateTime&&null!==r.CreateTime&&(n.CreateTime=lt(Dt(r.CreateTime))),void 0!==r.GeofenceId&&null!==r.GeofenceId&&(n.GeofenceId=dt(r.GeofenceId)),void 0!==r.Geometry&&null!==r.Geometry&&(n.Geometry=Eo(r.Geometry,t)),void 0!==r.Status&&null!==r.Status&&(n.Status=dt(r.Status)),void 0!==r.UpdateTime&&null!==r.UpdateTime&&(n.UpdateTime=lt(Dt(r.UpdateTime))),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Qe),Go=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return a(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Zi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"ListGeofencesCommand",inputFilterSensitiveLog:jr.filterSensitiveLog,outputFilterSensitiveLog:Gr.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,d,h;return f(this,(function(f){switch(f.label){case 0:return[4,t.endpoint()];case 1:if(n=f.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={"content-type":"application/json"},c=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/geofencing/v0/collections/{CollectionName}/list-geofences",void 0===e.CollectionName)throw new Error("No value provided for input HTTP label: CollectionName.");if((l=e.CollectionName).length<=0)throw new Error("Empty value provided for input HTTP label: CollectionName.");return c=c.replace("{CollectionName}",xt(l)),d=JSON.stringify(s({},void 0!==e.NextToken&&null!==e.NextToken&&{NextToken:e.NextToken})),[4,t.endpoint()];case 2:if(h=f.sent().hostname,!0!==t.disableHostPrefix&&!C(h="geofencing."+h))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new A({protocol:i,hostname:h,port:o,method:"POST",headers:a,path:c,body:d})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o;return f(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,eo(e,t)]:(n={$metadata:Oo(e),Entries:void 0,NextToken:void 0},i=lt,o=ft,[4,ko(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).Entries&&null!==r.Entries&&(n.Entries=So(r.Entries,t)),void 0!==r.NextToken&&null!==r.NextToken&&(n.NextToken=dt(r.NextToken)),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Qe),zo=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return a(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Zi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"BatchPutGeofenceCommand",inputFilterSensitiveLog:_n.filterSensitiveLog,outputFilterSensitiveLog:xn.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,d,h;return f(this,(function(f){switch(f.label){case 0:return[4,t.endpoint()];case 1:if(n=f.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={"content-type":"application/json"},c=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/geofencing/v0/collections/{CollectionName}/put-geofences",void 0===e.CollectionName)throw new Error("No value provided for input HTTP label: CollectionName.");if((l=e.CollectionName).length<=0)throw new Error("Empty value provided for input HTTP label: CollectionName.");return c=c.replace("{CollectionName}",xt(l)),d=JSON.stringify(s({},void 0!==e.Entries&&null!==e.Entries&&{Entries:so(e.Entries,t)})),[4,t.endpoint()];case 2:if(h=f.sent().hostname,!0!==t.disableHostPrefix&&!C(h="geofencing."+h))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new A({protocol:i,hostname:h,port:o,method:"POST",headers:a,path:c,body:d})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o;return f(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,Qi(e,t)]:(n={$metadata:Oo(e),Errors:void 0,Successes:void 0},i=lt,o=ft,[4,ko(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).Errors&&null!==r.Errors&&(n.Errors=mo(r.Errors,t)),void 0!==r.Successes&&null!==r.Successes&&(n.Successes=wo(r.Successes,t)),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Qe),Ho=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return a(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Zi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"LocationClient",commandName:"BatchDeleteGeofenceCommand",inputFilterSensitiveLog:dn.filterSensitiveLog,outputFilterSensitiveLog:pn.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,u,a,c,l,d,h;return f(this,(function(f){switch(f.label){case 0:return[4,t.endpoint()];case 1:if(n=f.sent(),n.hostname,r=n.protocol,i=void 0===r?"https":r,o=n.port,u=n.path,a={"content-type":"application/json"},c=((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/geofencing/v0/collections/{CollectionName}/delete-geofences",void 0===e.CollectionName)throw new Error("No value provided for input HTTP label: CollectionName.");if((l=e.CollectionName).length<=0)throw new Error("Empty value provided for input HTTP label: CollectionName.");return c=c.replace("{CollectionName}",xt(l)),d=JSON.stringify(s({},void 0!==e.GeofenceIds&&null!==e.GeofenceIds&&{GeofenceIds:ho(e.GeofenceIds,t)})),[4,t.endpoint()];case 2:if(h=f.sent().hostname,!0!==t.disableHostPrefix&&!C(h="geofencing."+h))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return[2,new A({protocol:i,hostname:h,port:o,method:"POST",headers:a,path:c,body:d})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o;return f(this,(function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,Ji(e,t)]:(n={$metadata:Oo(e),Errors:void 0},i=lt,o=ft,[4,ko(e.body,t)]);case 1:return void 0!==(r=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).Errors&&null!==r.Errors&&(n.Errors=go(r.Errors,t)),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Qe);function qo(e){for(var t,n,r=function(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(e),i=0,o=1;o<r.length;)t=n||r[0],i+=((n=r[o])[0]-t[0])*(n[1]+t[1]),o++;return i>0}var $o=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u};function Wo(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))throw new Error("Invalid coordinates: ["+e+","+t+"]");if(t<-90||90<t)throw new Error("Latitude must be between -90 and 90 degrees inclusive.");if(e<-180||180<e)throw new Error("Longitude must be between -180 and 180 degrees inclusive.")}function Vo(e){if(!/^(?:[\x2D\.0-9A-Z_a-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])+$/i.test(e))throw new Error("Invalid geofenceId: '"+e+"' - IDs can only contain alphanumeric characters, hyphens, underscores and periods.")}function Yo(e,t){var n=t?t+": ":"";if(e.length<4)throw new Error(n+"LinearRing must contain 4 or more coordinates.");var r=[];if(e.forEach((function(e){try{Wo(e[0],e[1])}catch(t){r.push({coordinates:e,error:t.message})}})),r.length>0)throw new Error(n+"One or more of the coordinates in the Polygon LinearRing are not valid: "+JSON.stringify(r));var i=$o(e[0],2),o=i[0],u=i[1],a=$o(e[e.length-1],2),s=a[0],c=a[1];if(o!==s||u!==c)throw new Error(n+"LinearRing's first and last coordinates are not the same");if(qo(e))throw new Error(n+"LinearRing coordinates must be wound counterclockwise")}function Ko(e){var t={};e.forEach((function(e){if(!e.geofenceId)throw new Error("Geofence '"+e+"' is missing geofenceId");var n=e.geofenceId;if(Vo(n),t[n])throw new Error("Duplicate geofenceId: "+n);if(t[n]=!0,!e.geometry)throw new Error("Geofence '"+n+"' is missing geometry");var r=e.geometry;if(!r.polygon)throw new Error("Geofence '"+n+"' is missing geometry.polygon");var i=r.polygon;try{!function(e,t){var n=t?t+": ":"";if(!Array.isArray(e))throw new Error(n+"Polygon is of incorrect structure. It should be an array of LinearRings");if(e.length<1)throw new Error(n+"Polygon must have a single LinearRing array.");if(e.length>1)throw new Error(n+"Polygon must have a single LinearRing array. Note: We do not currently support polygons with holes, multipolygons, polygons that are wound clockwise, or that cross the antimeridian.");if(e.reduce((function(e,t){return e+t.length}),0)>1e3)throw new Error(n+"Polygon has more than the maximum 1000 vertices.");e.forEach((function(e){Yo(e,t)}))}(i,n)}catch(e){if(e.message.includes("Polygon has more than the maximum 1000 vertices."))throw new Error("Geofence '"+n+"' has more than the maximum of 1000 vertices")}Yo($o(i,1)[0],n)}))}var Zo=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},Jo=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},Qo=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u},Xo=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Qo(arguments[t]));return e},eu=new r.ConsoleLogger("AmazonLocationServiceProvider"),tu=function(){function e(e){this._config=e||{},eu.debug("Geo Options",this._config)}return e.prototype.getCategory=function(){return e.CATEGORY},e.prototype.getProviderName=function(){return e.PROVIDER_NAME},e.prototype.configure=function(e){return eu.debug("configure Amazon Location Service Provider",e),e?(this._config=Object.assign({},this._config,e),this._config):this._config},e.prototype.getAvailableMaps=function(){this._verifyMapResources();var e=[],t=this._config.maps.items,n=this._config.region;for(var r in t){var i=t[r].style;e.push({mapName:r,style:i,region:n})}return e},e.prototype.getDefaultMap=function(){this._verifyMapResources();var e=this._config.maps.default;return{mapName:e,style:this._config.maps.items[e].style,region:this._config.region}},e.prototype.searchByText=function(e,t){return Zo(this,void 0,void 0,(function(){var n,i,u,a,s,c;return Jo(this,(function(l){switch(l.label){case 0:return[4,this._ensureCredentials()];case 1:if(!l.sent())throw new Error("No credentials");if(this._verifySearchIndex(null==t?void 0:t.searchIndexName),n={Text:e,IndexName:this._config.search_indices.default},t){if(n.FilterCountries=t.countries,n.MaxResults=t.maxResults,t.searchIndexName&&(n.IndexName=t.searchIndexName),t.biasPosition&&t.searchAreaConstraints)throw new Error("BiasPosition and SearchAreaConstraints are mutually exclusive, please remove one or the other from the options object");t.biasPosition&&(n.BiasPosition=t.biasPosition),t.searchAreaConstraints&&(n.FilterBBox=t.searchAreaConstraints)}i=new Vi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(r.getAmplifyUserAgent)()}),u=new Io(n),l.label=2;case 2:return l.trys.push([2,4,,5]),[4,i.send(u)];case 3:return a=l.sent(),[3,5];case 4:throw s=l.sent(),eu.debug(s),s;case 5:return c=a.Results.map((function(e){return e.Place})),[2,o()(c,{deep:!0})]}}))}))},e.prototype.searchByCoordinates=function(e,t){return Zo(this,void 0,void 0,(function(){var n,i,u,a,s,c;return Jo(this,(function(l){switch(l.label){case 0:return[4,this._ensureCredentials()];case 1:if(!l.sent())throw new Error("No credentials");this._verifySearchIndex(null==t?void 0:t.searchIndexName),n={Position:e,IndexName:this._config.search_indices.default},t&&(t.searchIndexName&&(n.IndexName=t.searchIndexName),n.MaxResults=t.maxResults),i=new Vi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(r.getAmplifyUserAgent)()}),u=new jo(n),l.label=2;case 2:return l.trys.push([2,4,,5]),[4,i.send(u)];case 3:return a=l.sent(),[3,5];case 4:throw s=l.sent(),eu.debug(s),s;case 5:return c=a.Results.map((function(e){return e.Place})),[2,o()(c[0],{deep:!0})]}}))}))},e.prototype.saveGeofences=function(e,t){return Zo(this,void 0,void 0,(function(){var n,r,i,o=this;return Jo(this,(function(u){switch(u.label){case 0:if(e.length<1)throw new Error("Geofence input array is empty");return[4,this._ensureCredentials()];case 1:if(!u.sent())throw new Error("No credentials");try{this._verifyGeofenceCollections(null==t?void 0:t.collectionName)}catch(e){throw eu.debug(e),e}for(Ko(e),n=e.map((function(e){return{GeofenceId:e.geofenceId,Geometry:{Polygon:e.geometry.polygon}}})),r={successes:[],errors:[]},i=[];n.length>0;)10,i.push(n.splice(0,10));return[4,Promise.all(i.map((function(e){return Zo(o,void 0,void 0,(function(){var n,i;return Jo(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._AmazonLocationServiceBatchPutGeofenceCall(e,(null==t?void 0:t.collectionName)||this._config.geofenceCollections.default)];case 1:return n=o.sent(),[3,3];case 2:return i=o.sent(),e.forEach((function(e){r.errors.push({geofenceId:e.GeofenceId,error:{code:"APIConnectionError",message:i.message}})})),[2];case 3:return n.Successes.forEach((function(e){var t=e.GeofenceId,n=e.CreateTime,i=e.UpdateTime;r.successes.push({geofenceId:t,createTime:n,updateTime:i})})),n.Errors.forEach((function(e){var t=e.Error,n=t.Code,i=t.Message,o=e.GeofenceId;r.errors.push({error:{code:n,message:i},geofenceId:o})})),[2]}}))}))})))];case 2:return u.sent(),[2,r]}}))}))},e.prototype.getGeofence=function(e,t){return Zo(this,void 0,void 0,(function(){var n,i,o,u,a,s,c,l,f,d;return Jo(this,(function(h){switch(h.label){case 0:return[4,this._ensureCredentials()];case 1:if(!h.sent())throw new Error("No credentials");try{this._verifyGeofenceCollections(null==t?void 0:t.collectionName)}catch(e){throw eu.debug(e),e}Vo(e),n=new Vi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(r.getAmplifyUserAgent)()}),i={GeofenceId:e,CollectionName:(null==t?void 0:t.collectionName)||this._config.geofenceCollections.default},o=new Uo(i),h.label=2;case 2:return h.trys.push([2,4,,5]),[4,n.send(o)];case 3:return u=h.sent(),[3,5];case 4:throw a=h.sent(),eu.debug(a),a;case 5:return s=u.GeofenceId,c=u.CreateTime,l=u.UpdateTime,f=u.Status,d=u.Geometry,[2,{createTime:c,geofenceId:s,geometry:{polygon:d.Polygon},status:f,updateTime:l}]}}))}))},e.prototype.listGeofences=function(e){return Zo(this,void 0,void 0,(function(){var t,n,i,o,u,a,s;return Jo(this,(function(c){switch(c.label){case 0:return[4,this._ensureCredentials()];case 1:if(!c.sent())throw new Error("No credentials");try{this._verifyGeofenceCollections(null==e?void 0:e.collectionName)}catch(e){throw eu.debug(e),e}t=new Vi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(r.getAmplifyUserAgent)()}),n={NextToken:null==e?void 0:e.nextToken,CollectionName:(null==e?void 0:e.collectionName)||this._config.geofenceCollections.default},i=new Go(n),c.label=2;case 2:return c.trys.push([2,4,,5]),[4,t.send(i)];case 3:return o=c.sent(),[3,5];case 4:throw u=c.sent(),eu.debug(u),u;case 5:return a=o.NextToken,s=o.Entries,[2,{entries:s.map((function(e){return{geofenceId:e.GeofenceId,createTime:e.CreateTime,updateTime:e.UpdateTime,status:e.Status,geometry:{polygon:e.Geometry.Polygon}}})),nextToken:a}]}}))}))},e.prototype.deleteGeofences=function(e,t){return Zo(this,void 0,void 0,(function(){var n,r,i,o,u=this;return Jo(this,(function(a){switch(a.label){case 0:if(e.length<1)throw new Error("GeofenceId input array is empty");return[4,this._ensureCredentials()];case 1:if(!a.sent())throw new Error("No credentials");if(this._verifyGeofenceCollections(null==t?void 0:t.collectionName),(n=e.filter((function(e){try{Vo(e)}catch(e){return!0}}))).length>0)throw new Error("Invalid geofence ids: "+n.join(", "));for(r={successes:[],errors:[]},i=[],o=0;o<e.length;)i.push(e.slice(o,o+=10));return[4,Promise.all(i.map((function(e){return Zo(u,void 0,void 0,(function(){var n,i,o,u;return Jo(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this._AmazonLocationServiceBatchDeleteGeofenceCall(e,(null==t?void 0:t.collectionName)||this._config.geofenceCollections.default)];case 1:return n=a.sent(),[3,3];case 2:return i=a.sent(),e.forEach((function(e){var t={geofenceId:e,error:{code:i.message,message:i.message}};r.errors.push(t)})),[2];case 3:return o=n.Errors.map((function(e){return e.geofenceId})),(u=r.successes).push.apply(u,Xo(e.filter((function(e){return!o.includes(e)})))),[2]}}))}))})))];case 2:return a.sent(),[2,r]}}))}))},e.prototype._ensureCredentials=function(){return Zo(this,void 0,void 0,(function(){var e,t,n;return Jo(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,r.Credentials.get()];case 1:return(e=i.sent())?(t=r.Credentials.shear(e),eu.debug("Set credentials for storage. Credentials are:",t),this._config.credentials=t,[2,!0]):[2,!1];case 2:return n=i.sent(),eu.debug("Ensure credentials error. Credentials are:",n),[2,!1];case 3:return[2]}}))}))},e.prototype._verifyMapResources=function(){if(!this._config.maps){var e="No map resources found in amplify config, run 'amplify add geo' to create one and run `amplify push` after";throw eu.debug(e),new Error(e)}if(!this._config.maps.default){e="No default map resource found in amplify config, run 'amplify add geo' to create one and run `amplify push` after";throw eu.debug(e),new Error(e)}},e.prototype._verifySearchIndex=function(e){if(!(this._config.search_indices&&this._config.search_indices.default||e)){var t="No Search Index found in amplify config, please run `amplify add geo` to create one and run `amplify push` after.";throw eu.debug(t),new Error(t)}},e.prototype._verifyGeofenceCollections=function(e){if(!(this._config.geofenceCollections&&this._config.geofenceCollections.default||e)){var t="No Geofence Collections found, please run `amplify add geo` to create one and run `amplify push` after.";throw eu.debug(t),new Error(t)}},e.prototype._AmazonLocationServiceBatchPutGeofenceCall=function(e,t){return Zo(this,void 0,void 0,(function(){var n,i,o,u;return Jo(this,(function(a){switch(a.label){case 0:n={Entries:e,CollectionName:t||this._config.geofenceCollections.default},i=new Vi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(r.getAmplifyUserAgent)()}),o=new zo(n),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i.send(o)];case 2:return u=a.sent(),[3,4];case 3:throw a.sent();case 4:return[2,u]}}))}))},e.prototype._AmazonLocationServiceBatchDeleteGeofenceCall=function(e,t){return Zo(this,void 0,void 0,(function(){var n,i,o,u;return Jo(this,(function(a){switch(a.label){case 0:n={GeofenceIds:e,CollectionName:t||this._config.geofenceCollections.default},i=new Vi({credentials:this._config.credentials,region:this._config.region,customUserAgent:Object(r.getAmplifyUserAgent)()}),o=new Ho(n),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i.send(o)];case 2:return u=a.sent(),[3,4];case 3:throw a.sent();case 4:return[2,u]}}))}))},e.CATEGORY="Geo",e.PROVIDER_NAME="AmazonLocationService",e}(),nu=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((r=r.apply(e,t||[])).next())}))},ru=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},iu=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u},ou=new r.ConsoleLogger("Geo"),uu="AmazonLocationService",au=new(function(){function e(){this._config={},this._pluggables=[],ou.debug("Geo Options",this._config)}return e.prototype.getModuleName=function(){return e.MODULE},e.prototype.addPluggable=function(e){if(e&&"Geo"===e.getCategory())return this._pluggables.push(e),e.configure(this._config[e.getProviderName()])},e.prototype.getPluggable=function(e){var t=this._pluggables.find((function(t){return t.getProviderName()===e}));if(void 0===t)throw ou.debug("No plugin found with providerName",e),new Error("No plugin found in Geo for the provider");return t},e.prototype.removePluggable=function(e){this._pluggables=this._pluggables.filter((function(t){return t.getProviderName()!==e}))},e.prototype.configure=function(e){var t=this;if(ou.debug("configure Geo"),!e)return this._config;var n=Object(r.parseMobileHubConfig)(e);return this._config=Object.assign({},this._config,n.Geo,e),this._pluggables.forEach((function(e){e.configure(t._config[e.getProviderName()])})),0===this._pluggables.length&&this.addPluggable(new tu),this._config},e.prototype.getAvailableMaps=function(e){return void 0===e&&(e=uu),this.getPluggable(e).getAvailableMaps()},e.prototype.getDefaultMap=function(e){return void 0===e&&(e=uu),this.getPluggable(e).getDefaultMap()},e.prototype.searchByText=function(e,t){return nu(this,void 0,void 0,(function(){var n,r,i,o;return ru(this,(function(u){switch(u.label){case 0:n=(t||{}).providerName,r=void 0===n?uu:n,i=this.getPluggable(r),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,i.searchByText(e,t)];case 2:return[2,u.sent()];case 3:throw o=u.sent(),ou.debug(o),o;case 4:return[2]}}))}))},e.prototype.searchByCoordinates=function(e,t){return nu(this,void 0,void 0,(function(){var n,r,i,o,u,a,s;return ru(this,(function(c){switch(c.label){case 0:n=(t||{}).providerName,r=void 0===n?uu:n,i=this.getPluggable(r),o=iu(e,2),u=o[0],a=o[1],c.label=1;case 1:return c.trys.push([1,3,,4]),Wo(u,a),[4,i.searchByCoordinates(e,t)];case 2:return[2,c.sent()];case 3:throw s=c.sent(),ou.debug(s),s;case 4:return[2]}}))}))},e.prototype.saveGeofences=function(e,t){return nu(this,void 0,void 0,(function(){var n,r,i,o,u;return ru(this,(function(a){switch(a.label){case 0:n=(t||{}).providerName,r=void 0===n?uu:n,i=this.getPluggable(r),o=Array.isArray(e)?e:[e],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i.saveGeofences(o,t)];case 2:return[2,a.sent()];case 3:throw u=a.sent(),ou.debug(u),u;case 4:return[2]}}))}))},e.prototype.getGeofence=function(e,t){return nu(this,void 0,void 0,(function(){var n,r,i,o;return ru(this,(function(u){switch(u.label){case 0:n=(t||{}).providerName,r=void 0===n?uu:n,i=this.getPluggable(r),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,i.getGeofence(e,t)];case 2:return[2,u.sent()];case 3:throw o=u.sent(),ou.debug(o),o;case 4:return[2]}}))}))},e.prototype.listGeofences=function(e){return nu(this,void 0,void 0,(function(){var t,n,r,i;return ru(this,(function(o){switch(o.label){case 0:t=(e||{}).providerName,n=void 0===t?uu:t,r=this.getPluggable(n),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r.listGeofences(e)];case 2:return[2,o.sent()];case 3:throw i=o.sent(),ou.debug(i),i;case 4:return[2]}}))}))},e.prototype.deleteGeofences=function(e,t){return nu(this,void 0,void 0,(function(){var n,r,i,o,u;return ru(this,(function(a){switch(a.label){case 0:n=(t||{}).providerName,r=void 0===n?uu:n,i=this.getPluggable(r),o=Array.isArray(e)?e:[e],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i.deleteGeofences(o,t)];case 2:return[2,a.sent()];case 3:throw u=a.sent(),ou.debug(u),u;case 4:return[2]}}))}))},e.MODULE="Geo",e}());r.Amplify.register(au)},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return i}));var r=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192,63&i|128);else if(n+1<e.length&&55296==(64512&i)&&56320==(64512&e.charCodeAt(n+1))){var o=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(i>>12|224,i>>6&63|128,63&i|128)}return Uint8Array.from(t)}(e)},i=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var i=e[n];if(i<128)t+=String.fromCharCode(i);else if(192<=i&&i<224){var o=e[++n];t+=String.fromCharCode((31&i)<<6|63&o)}else if(240<=i&&i<365){var u="%"+[i,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(u)}else t+=String.fromCharCode((15&i)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return i}));var r=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192,63&i|128);else if(n+1<e.length&&55296==(64512&i)&&56320==(64512&e.charCodeAt(n+1))){var o=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(i>>12|224,i>>6&63|128,63&i|128)}return Uint8Array.from(t)}(e)},i=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var i=e[n];if(i<128)t+=String.fromCharCode(i);else if(192<=i&&i<224){var o=e[++n];t+=String.fromCharCode((31&i)<<6|63&o)}else if(240<=i&&i<365){var u="%"+[i,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(u)}else t+=String.fromCharCode((15&i)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}}])}));
|
|
56
56
|
//# sourceMappingURL=aws-amplify-geo.min.js.map
|