@freightos/fusion-location-input 3.0.0-7ce44782 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/asset-manifest.json +1 -1
- package/build/main.bundle.js +1 -1
- package/build/main.bundle.js.map +1 -1
- package/build/{precache-manifest.bd943a4da10dda31f79e54ea09f73afc.js → precache-manifest.c137a4886f23ca421a8a89c9f2298233.js} +1 -1
- package/build/service-worker.js +1 -1
- package/package.json +8 -7
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"main.js": "/main.bundle.js",
|
|
4
4
|
"main.js.map": "/main.bundle.js.map",
|
|
5
5
|
"index.html": "/index.html",
|
|
6
|
-
"precache-manifest.
|
|
6
|
+
"precache-manifest.c137a4886f23ca421a8a89c9f2298233.js": "/precache-manifest.c137a4886f23ca421a8a89c9f2298233.js",
|
|
7
7
|
"service-worker.js": "/service-worker.js"
|
|
8
8
|
},
|
|
9
9
|
"entrypoints": [
|
package/build/main.bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("react"),require("@freightos/design-system"),require("styled-components"),require("@freightos/freightos-i18n"),require("@freightos/http-client"),require("lodash")):"function"===typeof define&&define.amd?define("FusionLocationInput",["react","@freightos/design-system","styled-components","@freightos/freightos-i18n","@freightos/http-client","lodash"],e):"object"===typeof exports?exports.FusionLocationInput=e(require("react"),require("@freightos/design-system"),require("styled-components"),require("@freightos/freightos-i18n"),require("@freightos/http-client"),require("lodash")):t.FusionLocationInput=e(t.React,t["@freightos/design-system"],t["styled-components"],t["@freightos/freightos-i18n"],t["@freightos/http-client"],t.lodash)}(this,(function(t,e,n,r,o,a){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="http://ship.freightos.local:8800/FusionLocationInput/",n(n.s=7)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){t.exports=n(8)},function(t,e){t.exports=n},function(t,e){t.exports=r},function(t,e){t.exports=o},function(t,e){t.exports=a},function(t,e,n){t.exports=n(9)},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"===typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(_){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),i=new E(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=w(i,n);if(c){if(c===u)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,i),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(_){return{type:"throw",arg:_}}}t.wrap=l;var u={};function d(){}function f(){}function p(){}var m={};c(m,o,(function(){return this}));var h=Object.getPrototypeOf,v=h&&h(h(x([])));v&&v!==e&&n.call(v,o)&&(m=v);var y=p.prototype=d.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var l=s(t[o],t,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"===typeof d&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(d).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}(o,a,r,i)}))}return r=r?r.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function x(t){if(t){var e=t[o];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=p,c(y,"constructor",p),c(p,"constructor",f),f.displayName=c(p,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new b(l(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return i.type="throw",i.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,u):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=r}catch(o){"object"===typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(t){if("string"===typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(l){o=!0,a=l}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n}}(t,e)||o(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}n.r(e);var c=n(0),l=n.n(c),s=n(1),u=n(4),d=n(2),f=n.n(d);function p(t,e,n,r,o,a,i){try{var c=t[a](i),l=c.value}catch(s){return void n(s)}c.done?e(l):Promise.resolve(l).then(r,o)}function m(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){p(a,r,o,i,c,"next",t)}function c(t){p(a,r,o,i,c,"throw",t)}i(void 0)}))}}var h,v=n(6);function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g="airport",b="seaport",w="fulfillment_center",S="address_book",O="last_mile_address",E="address",x=(y(h={},g,{label:"Airports",key:g,icon:"mode-air"}),y(h,b,{label:"Ports",key:b,icon:"mode-ship"}),y(h,w,{label:"Fulfillment centers",key:w,icon:"fulfillment-center"}),y(h,S,{key:S,groupedBy:"address"}),y(h,O,{key:O,groupedBy:"address"}),y(h,E,{label:"Address",key:E,icon:"location"}),h),k="single",_="multiple",L="origin",T="destination";function j(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var C,P,I,A,F,R,U,N,z,M,D,V,$=n(3),W=n.n($),G=Object($.createGlobalStyle)(C||(C=j(["\n .ant-select-dropdown {\n .ant-select-dropdown-menu {\n max-height: 400px;\n padding: 0 !important;\n margin-top: 0 !important;\n }\n }\n"]))),X=W()(s.Select)(P||(P=j(["\n\t.ant-select-selection__rendered {\n\t\tmin-width: 100% !important;\n\t}\n\n\tli.ant-select-selection__choice {\n\t\tborder-radius: ",";\n\t\tborder: none;\n\t\tborder-color: ",";\n\t\tcolor: ",";\n\t\tbackground-color: ",";\n\t\tline-height: 10px !important;\n\t\tmargin-right: ",";\n\t\twidth: fit-content;\n\t\tmax-width: 90px;\n\t\theight: "," !important;\n\t\t","\n\n\t\t.ant-select-selection__choice__remove {\n\t\t\tcolor: ",";\n\t\t\tmargin-top: "," !important;\n\t\t}\n\n\t\t.ant-select-selection__choice__content {\n\t\t\tline-height: "," !important;\n\t\t\theight: "," !important;\n\t\t}\n\t}\n\n\tli.ant-select-selection__choice__disabled {\n\t\tborder: none;\n\t\tbackground-color: transparent;\n\t\tpadding: 0;\n\t\tpadding-left: 0;\n\t\twidth: fit-content;\n\t}\n\n\t.ant-select-dropdown .ant-select-not-found {\n\t\tcursor: pointer !important;\n\t}\n\n\t.ant-select-selection-selected-value {\n\t\tmax-width: 280px !important;\n\t}\n\n\tli.ant-select-search.ant-select-search--inline {\n\t\tmargin-left: -1px !important;\n\t}\n\t.ant-select-search__field {\n\t\tcolor: "," !important;\n\t}\n\t","\n"])),s.tokens.fdsBorderRadiusXl,s.tokens.fdsColorPrimaryBlue,s.tokens.fdsColorPrimaryBlue,s.tokens.fdsColorPrimaryBlue10,s.tokens.fdsComponentSpacingXxs,s.tokens.fdsSizeMd,(function(t){return"large"===t.size?"\n\t\t\tmargin-top: ".concat(s.tokens.fdsComponentSpacingSm," !important;\n\t\t"):"\n\t\t\tmargin-top: 5px !important;\n\t\t"}),s.tokens.fdsColorPrimaryBlue,s.tokens.fdsComponentSpacingXs,s.tokens.fdsSizeMd,s.tokens.fdsSizeMd,s.tokens.fdsColorPrimaryGray80,(function(t){return t.$hasError&&"\n\t\t.ant-select-selection {\n\t\t\tcolor: ".concat(s.tokens.fdsColorSemanticRed,";\n \t\tborder: 1px solid ").concat(s.tokens.fdsColorSemanticRed,";\n \t\tbackground-color: ").concat(s.tokens.fdsColorSemanticRed10,";\n\t\t}\n\n\t\t.ant-select-selection__placeholder, .ant-select-arrow {\n\t\t\tcolor: ").concat(s.tokens.fdsColorSemanticRed,";\n\t\t}\n\t")})),B=W.a.span(I||(I=j(["\n\tfont-size: "," !important;\n"])),s.tokens.fdsFontSizeSm),q=W.a.div(A||(A=j(["\n\tfont-size: "," !important;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: 2;\n\t-webkit-box-orient: vertical;\n"])),s.tokens.fdsFontSizeSm),K=W()(s.Menu)(F||(F=j(["\n\tcursor: pointer !important;\n\n\t.ant-menu-item-group-title {\n\t\tpadding: 0;\n\t\tcolor: ",";\n\t}\n\n\t.ant-menu-item {\n\t\tpadding: 0;\n\t\twhite-space: normal;\n\t\tline-height: normal;\n\n\t\t&:hover {\n\t\t\tbackground-color: #f5f5f5;\n\t\t}\n\t}\n"])),s.tokens.fdsBodyTextColorDisabled),H=W.a.div(R||(R=j(["\n\tfont-size: ",";\n\tline-height: ",";\n\tfont-family: ",";\n"])),s.tokens.fdsFontSizeSm,s.tokens.fdsSizeSm,s.tokens.fdsHeadingsFontFamily),J=(W()(s.Icon)(U||(U=j(["\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n"]))),{XXLARGE:s.tokens.fdsComponentSpacingXxl,XLARGE:s.tokens.fdsComponentSpacingXl,LARGE:s.tokens.fdsComponentSpacingLg,MEDIUM:s.tokens.fdsComponentSpacingMd,SMALL:s.tokens.fdsComponentSpacingSm,XSMALL:s.tokens.fdsComponentSpacingXs,XXSMALL:s.tokens.fdsComponentSpacingXxs,NONE:0}),Y="vertical",Z="horizontal";function Q(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var tt,et,nt,rt,ot="totalShipment",at="unitsShipment",it="containerPackages",ct="celsius",lt="fahrenheit",st="COL",ut="ERT",dt="CRT",ft=(y(V={},"FRO",(y(N={},ct,"-10\xbaC or below"),y(N,lt,"14\xbaF or below"),N)),y(V,st,(y(z={},ct,"From +2\xbaC To +8\xbaC"),y(z,lt,"From 35.6\xbaF To 46.4\xbaF"),z)),y(V,ut,(y(M={},ct,"From +2\xbaC To +25\xbaC"),y(M,lt,"From 35.6\xbaF To 77\xbaF"),M)),y(V,dt,(y(D={},ct,"From +15\xbaC To +25\xbaC"),y(D,lt,"From 59\xbaF To 77\xbaF"),D)),V),pt="quotation",mt="units",ht="totals",vt="container",yt="CBM",gt="CFT",bt="kg",wt="box",St="uld";function Ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Et(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ot(Object(n),!0).forEach((function(e){y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ot(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var xt=W.a.div(tt||(tt=j(["\n\tdisplay: flex;\n\tflex-direction: ",";\n\tflex-wrap: ",";\n\talign-items: ",";\n\tjustify-content: ",";\n\tbox-sizing: border-box;\n\n\t","\n\t",";\n"])),(function(t){return t.$direction===Y?"column":"row"}),(function(t){return t.$wrap?"wrap":"nowrap"}),(function(t){return t.$alignItems}),(function(t){return t.$justifyContent}),(function(t){return t.$fullWidth&&Object($.css)(et||(et=j(["\n\t\t\twidth: 100%;\n\t\t"])))}),(function(t){var e=t.$direction,n=t.$spacing;return e===Y?Object($.css)(nt||(nt=j(["\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-top: ",";\n\t\t\t\t\t}\n\t\t\t "])),n):Object($.css)(rt||(rt=j(["\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-left: ",";\n\t\t\t\t\t}\n\t\t\t "])),n)})),kt=["direction","alignItems","spacing","wrap","justifyContent","fullWidth"],_t=function(t){var e=t.direction,n=void 0===e?Z:e,r=t.alignItems,o=void 0===r?"start":r,a=t.spacing,c=void 0===a?J.NONE:a,s=t.wrap,u=t.justifyContent,d=t.fullWidth,f=i(t,kt);return l.a.createElement(xt,Object.assign({},f,{$direction:n,$alignItems:o,$spacing:c,$wrap:s,$justifyContent:u,$fullWidth:d}),f.children)},Lt=n(5),Tt=n.n(Lt),jt=function(){var t=m(f.a.mark((function t(e,n,r){var o,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o=e.reduce((function(t,e){return Et(Et({},t),{},y({},x[e].key,Et(Et({type:e.toUpperCase()},(null===r||void 0===r?void 0:r.code)?{searchTerm:r.name}:{}),x[e].groupedBy?{groupedBy:x[e].groupedBy}:{})))}),{}),t.next=4,Tt.a.post("/geocoder/api/v3/geocoder/locations",{query:n,limit:5,sources:o});case 4:return a=t.sent,t.abrupt("return",a.data);case 8:return t.prev=8,t.t0=t.catch(0),console.error("Error fetching locations:",t.t0),t.abrupt("return",{results:{}});case 12:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e,n,r){return t.apply(this,arguments)}}();function Ct(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Pt,It,At,Ft,Rt,Ut,Nt,zt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"isProduction",value:function(){return"prod"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}},{key:"isTest",value:function(){return"test"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}},{key:"isLocal",value:function(){return"dev"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}}],(n=null)&&Ct(e.prototype,n),r&&Ct(e,r),t}(),Mt=["address"],Dt=function(t){var e=zt.isProduction()?"freightos.com":"test-freightos.com";return"https://platform.".concat(e,"/gateway/").concat(t?"webcargo-talaia":"webcargo-alpha")},Vt=function(t){var e=[];JSON.stringify(t,(function(t,n){return e.push(t),n}));var n=Array.from(new Set(e)).sort();return JSON.stringify(t,n)},$t=function(t){var e=t||{},n=e.displayLabel,r=e.selectedValue,o=e.formattedNameOrAddress,a=e.code,i=e.countryCode,c=e.stateOrProvince,l=e.city,s=e.latitude,u=e.longitude,d=e.postalOrZipCode,f=e.sourceType,p=e.locationType,m=e.type;return{displayLabel:n,selectedValue:r||a,formattedNameOrAddress:o,code:a||r,country:i,countryName:e.countryName,stateOrProvince:null!==c&&void 0!==c?c:null,city:null!==l&&void 0!==l?l:null,latitude:null!==s&&void 0!==s?s:null,longitude:null!==u&&void 0!==u?u:null,postalOrZipCode:null!==d&&void 0!==d?d:null,sourceType:null!==f&&void 0!==f?f:null,locationType:null!==p&&void 0!==p?p:null,type:null!==m&&void 0!==m?m:f}},Wt=function(t){try{var e="string"===typeof(null===t||void 0===t?void 0:t.key)?JSON.parse(Ht(t.key)):t;return Vt($t(e))}catch(n){return Vt($t(t))}},Gt=function(t){var e=function(t){return function(t){if(t){var e,n=t.label||t.selectedValue;return{key:Wt(t),label:n?l.a.createElement(l.a.Fragment,null,l.a.createElement(s.Icon,{type:t.sourceType?null===(e=x[t.sourceType])||void 0===e?void 0:e.icon:"location",size:"tiny"}),"\xa0",l.a.createElement(B,null,n)):void 0}}}(t)};return Array.isArray(t)?t.map(e):e(t)},Xt=function(t){var e=Et({},t),n=t[E].filter((function(t){return t.sourceType===w}));if(n.length>0){var r,o=e,a=o.address;e=Et(Et({},i(o,Mt)),{},(y(r={},w,n),y(r,"address",a.filter((function(t){return t.type!==w}))),r))}return e},Bt=function(t,e,n){return function(){var r=m(f.a.mark((function r(o){var a,i,c;return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o){r.next=2;break}return r.abrupt("return",[]);case 2:return a=""!==t?[t]:e,r.next=5,jt(a,o,n);case 5:return i=r.sent,(c=i.results)[E]&&(c=Xt(c)),r.abrupt("return",Object.keys(c).map((function(t){var e;return{label:(null===(e=x[t])||void 0===e?void 0:e.label)||t,options:c[t].map((function(t){return Et(Et({},t),{},{type:t.sourceType})}))}})));case 9:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()},qt=function(){var t=m(f.a.mark((function t(e,n){var r,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Array.isArray(e)?e:[e],t.next=3,Promise.all(r.map(function(){var t=m(f.a.mark((function t(e){var n,r,o;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=null===e||void 0===e?void 0:e.key,r=Ht(n),o=JSON.parse(r),t.abrupt("return",Et({key:r},o));case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",void 0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}()));case 3:o=t.sent,n(o.filter(Boolean));case 5:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),Kt=function(t){return t&&(t===E||t===O||t===S||t===w)},Ht=function(t){return"string"===typeof t?t.replace(/"/g,'"').replace(/"/g,'"').replace(/&/g,"&"):t},Jt=function(){var t=m(f.a.mark((function t(e){var n,r,o,a,i,c,l,s;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.method,r=e.url,o=void 0===r?"":r,a=e.data,i=void 0===a?{}:a,c=e.options,l=void 0===c?{}:c,s=function(){if("get"===n)return[Object.keys(i).length?"".concat(o,"?").concat(new URLSearchParams(i).toString()):o,l];if("post"===n){var t=Et(Et({},null===l||void 0===l?void 0:l.headers),{},{accept:"application/json","content-type":"multipart/form-data"});return[o,i,Et(Et({},l),{},{headers:t})]}return[o,i,l]}(),t.next=4,Tt.a[n].apply(Tt.a,Q(s));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Yt=function(){var t=m(f.a.mark((function t(e){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Jt({method:"put",url:"".concat(Dt(!1),"/backend/api.php"),options:{headers:{namespace:"airops/user_searches",route:" user_search_used"}},data:{id:e}});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Zt=W.a.div(Pt||(Pt=j(["\n\tcolor: ",";\n\tfont-size: ",";\n\tfont-weight: ",";\n\tmargin-bottom: ",";\n\ti {\n\t\tmargin-right: ",";\n\t}\n\n"])),s.tokens.fdsColorPrimaryGray60,s.tokens.fdsSizeXs,s.tokens.fdsFontWeightRegular,s.tokens.fdsComponentSpacingSm,s.tokens.fdsComponentSpacingSm),Qt=W()(_t)(It||(It=j(["\n\tpadding-left: 0 !important;\n"]))),te=W()(s.Icon)(At||(At=j(["\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n"]))),ee=W.a.span(Ft||(Ft=j(["\n\twhite-space: nowrap;\n\tmin-width: 0;\n\tcolor: ",";\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\t","\n\t",";\n"])),s.tokens.fdsColorPrimaryGray80,(function(t){return!t.$isLocationLabel&&"\n\t\tfont-size: 10px; //TODO: FSN-145\n\t\tline-height: 15px;\n\t"}),(function(t){var e=t.$isPort;if(void 0!==e)return"min-width: ".concat(e?"65px":"55px",";")})),ne=W()(s.Avatar)(Rt||(Rt=j(["\n\tborder: 1px solid ",";\n\twidth: ",";\n\theight: ",";\n"])),s.tokens.fdsColorPrimaryGray20,s.tokens.fdsSizeSm,s.tokens.fdsSizeSm),re=W()(_t)(Ut||(Ut=j(["\n\toverflow: hidden !important;\n\tfont-size: 10px; //TODO: FSN-145\n\tline-height: 15px;\n\tflex: 1;\n\tmin-width: 0;\n"]))),oe=W()(_t)(Nt||(Nt=j(["\n\t:last-child {\n\t\tpadding-bottom: 0 !important;\n\t}\n"]))),ae=function(t){return t?t.toLocaleString("en-US",{maximumFractionDigits:3,useGrouping:!0}):"0"},ie=function(t){var e=t.reduce((function(t,e){var n=e.country;return t[n]||(t[n]=[]),t[n].push(e),t}),{});return Object.keys(e).forEach((function(t){e[t].sort((function(t,e){return t.value.localeCompare(e.value)}))})),e},ce=function(t){var e=t.text,n=void 0===e?"":e,r=t.testId,o=t.isPort,i=void 0===o?void 0:o,u=t.isLocationLabel,d=void 0!==u&&u,f=t.children,p=void 0===f?null:f,m=Object(c.useRef)(null),h=a(Object(c.useState)(!1),2),v=h[0],y=h[1];Object(c.useEffect)((function(){!function(){if(m.current){var t=m.current,e=t.scrollWidth>t.clientWidth;y(e)}}()}),[n]);var g=l.a.createElement(ee,{ref:m,"data-test-id":r,$isLocationLabel:d,$isPort:i},p||n);return v?l.a.createElement(s.Tooltip,{title:n,"data-test-id":"".concat(r,"-tooltip")},l.a.createElement(ee,{ref:m,"data-test-id":r,$isLocationLabel:d,$isPort:i},p||n)):g},le=function(t){var e=t.search,n=t.index,r=t.dataTestId,o=e.origin.length>1,a=e.destination.length>1,i=o?ie(e.origin):y({},e.origin[0].country,e.origin),c=a?ie(e.destination):y({},e.destination[0].country,e.destination);return l.a.createElement(_t,{alignItems:"center",spacing:J.XSMALL,fullWidth:!0},Object.keys(i).map((function(t){var e=i[t].map((function(t){return t.selectedValue})).join(", ");return l.a.createElement(ce,{key:t,text:e,isLocationLabel:!0,testId:"".concat(r,"-origin-").concat(n),isPort:i[t][0].type===b},l.a.createElement(ne,{type:"flag",country:t,size:"small","data-test-id":"".concat(r,"-origin-flag-").concat(n),style:{marginRight:"4px"}}),e)})),l.a.createElement(s.Icon,{type:"arrow-forward",style:{marginRight:0,color:s.tokens.fdsColorPrimaryGray90,flex:"none"}}),Object.keys(c).map((function(t){var e=c[t].map((function(t){return t.selectedValue})).join(", ");return l.a.createElement(ce,{key:t,text:e,isLocationLabel:!0,testId:"".concat(r,"-destination-").concat(n),isPort:c[t][0].type===b},l.a.createElement(ne,{type:"flag",country:t,size:"small","data-test-id":"".concat(r,"-destination-flag-").concat(n),style:{marginRight:"4px"}}),e)})))},se=function(t){var e,n,r,o=t.search,a=t.index,i=t.dataTestId,u=o.platform_type,d=function(t){var e=t.shipment_details.type;if(e===ht)return["box-total"];if(e===mt){var n=t.shipment_details[at];return(null===n||void 0===n?void 0:n.packageType)===wt?n.boxPackages.reduce((function(t,e){var n,r,o=null===(n=e.type)||void 0===n||null===(r=n.value)||void 0===r?void 0:r.icon;return t.includes(o)||t.push(o),t}),[]):(null===n||void 0===n?void 0:n.packageType)===St?["uld"]:["box"]}return e===vt?["container"]:["box"]}(o),f=Object(c.useMemo)((function(){return function(t){var e=t.shipment_details.type;if(t.platform_type===pt)return{units:0,volume:0,weight:0,weightUnit:bt,volumeUnit:yt};switch(e){case vt:var n,r=0,o=0;return null===(n=t.shipment_details[it])||void 0===n||n.forEach((function(t){var e=Number(t.units)||0;if(e>0){r+=e;var n=parseInt(t.dimensions.value,10);o+=e*(n/20)}})),{units:r,volume:o,weight:null,weightUnit:null,volumeUnit:"TEU"};case mt:var a=t.shipment_details[at],i=(null===a||void 0===a?void 0:a.volumeUnit)===gt?1728:1e6;if((null===a||void 0===a?void 0:a.packageType)===wt){var c=ae(null===a||void 0===a?void 0:a.boxPackages.reduce((function(t,e){return t+parseFloat(e.width||"0")*parseFloat(e.height||"0")*parseFloat(e.length||"0")*parseFloat(e.units||"0")/i}),0)),l=ae(a.boxPackages.reduce((function(t,e){return t+parseFloat(e.weight||"0")}),0));return{units:a.boxPackages.reduce((function(t,e){return t+parseFloat(e.units||"0")}),0),volume:c,weight:l,weightUnit:a.weightUnit,volumeUnit:a.volumeUnit}}if((null===a||void 0===a?void 0:a.packageType)===St){var s=ae(a.uldPackages.reduce((function(t,e){return t+parseFloat(e.volume||"0")}),0)),u=ae(a.uldPackages.reduce((function(t,e){return t+parseFloat(e.weight||"0")}),0));return{units:a.uldPackages.length,volume:s,weight:u,weightUnit:a.weightUnit,volumeUnit:a.volumeUnit}}return{units:0,volume:0,weight:0,weightUnit:bt,volumeUnit:yt};case ht:var d,f,p,m,h,v=ae(parseFloat((null===(d=t.shipment_details[ot])||void 0===d?void 0:d.volume)||"0")),y=ae(parseFloat((null===(f=t.shipment_details[ot])||void 0===f?void 0:f.weight)||"0"));return{units:(null===(p=t.shipment_details[ot])||void 0===p?void 0:p.units)||0,volume:v,weight:y,weightUnit:(null===(m=t.shipment_details[ot])||void 0===m?void 0:m.weightUnit)||bt,volumeUnit:(null===(h=t.shipment_details[ot])||void 0===h?void 0:h.volumeUnit)||yt};default:return{units:0,volume:0,weight:0,weightUnit:bt,volumeUnit:yt}}}(o)}),[o]),p=f.units,m=f.volume,h=f.weight,v=f.weightUnit,y=f.volumeUnit,g=1===o.commodity.length&&o.commodity[0].is_temperature,b=(null===(e=o.commodity_temperature)||void 0===e?void 0:e.tempRange)&&g?ft[null===(n=o.commodity_temperature)||void 0===n?void 0:n.tempRange][null===(r=o.commodity_temperature)||void 0===r?void 0:r.temperatureSystem]:"";return l.a.createElement(_t,{spacing:J.XSMALL,alignItems:"center",fullWidth:!0,key:a},u===pt?l.a.createElement(re,{alignItems:"center",spacing:J.SMALL,style:{flex:1}},d.map((function(t,e){return l.a.createElement(te,{type:t,key:"".concat(a,"-").concat(e),size:"tiny","data-test-id":"".concat(i,"rs-package-icon-").concat(a,"-").concat(e)})})),l.a.createElement(ce,{text:o.commodity.map((function(t){return t.label})).join(", "),testId:"".concat(i,"rs-commodity-").concat(a)})):l.a.createElement(re,{alignItems:"center",spacing:J.SMALL},l.a.createElement(_t,{alignItems:"center",spacing:J.XSMALL,"data-test-id":"rs-".concat(a,"-units")},p,"\xa0",d.map((function(t,e){return l.a.createElement(te,{type:t,key:"".concat(a,"-").concat(e),size:"tiny","data-test-id":"".concat(i,"rs-package-icon-").concat(a,"-").concat(e)})}))),l.a.createElement("span",{"data-test-id":"".concat(i,"rs-volume-").concat(a)},m,"\xa0",y),h&&l.a.createElement("span",{"data-test-id":"".concat(i,"rs-weight-").concat(a)},h,"\xa0",v),l.a.createElement(ce,{text:o.commodity.map((function(t){return t.label})).join(", "),testId:"".concat(i,"rs-commodity-").concat(a)}),g&&l.a.createElement(_t,{alignItems:"center",spacing:J.XSMALL,"data-test-id":"".concat(i,"rs-temperature-").concat(a)},l.a.createElement(s.Icon,{type:"temperature-low",size:"tiny","data-test-id":"".concat(i,"rs-temperature-icon-").concat(a)}),l.a.createElement("span",{style:{whiteSpace:"nowrap"}},b))))},ue=function(t){var e=t.search,n=t.index,r=t.setIsOpen,o=t.dataTestId,a=t.onRecentSearchSelect,i=function(){var t=m(f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a(e),t.prev=1,t.next=4,Yt(e.id);case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),console.error(t.t0);case 9:r(!1);case 10:case"end":return t.stop()}}),t,null,[[1,6]])})));return function(){return t.apply(this,arguments)}}();return l.a.createElement(Qt,{direction:Y,fullWidth:!0,spacing:J.XSMALL,key:e.id,style:{padding:s.tokens.fdsComponentSpacingSm},"data-test-id":"".concat(o,"rs-card-").concat(n),onClick:function(){i()}},l.a.createElement(le,{search:e,index:n,dataTestId:o}),l.a.createElement(se,{search:e,index:n,dataTestId:o}))},de=function(t){var e=t.recentSearches,n=t.setIsOpen,r=t.dataTestId,o=t.onRecentSearchSelect,a=t.initialValues,i=e?function(t){return Q(t).sort((function(t,e){if(t.is_saved!==e.is_saved)return t.is_saved?-1:1;if(t.is_saved&&e.is_saved){var n=new Date(t.saved_update_date).getTime();return new Date(e.saved_update_date).getTime()-n}var r=new Date(Math.max(new Date(t.last_time_used_date).getTime(),new Date(t.saved_update_date||0).getTime())).getTime();return new Date(Math.max(new Date(e.last_time_used_date).getTime(),new Date(e.saved_update_date||0).getTime())).getTime()-r})).slice(0,6)}(e):[];return l.a.createElement(K,null,l.a.createElement(Zt,null,l.a.createElement(s.Icon,{"data-test-id":"".concat(r,"rs-icon"),color:s.tokens.fdsColorPrimaryGray60,type:"history",size:"tiny"}),l.a.createElement(u.TranslatableText,{stringId:"Recent searches"})),l.a.createElement(oe,{direction:Y,fullWidth:!0},i.map((function(t,e){return l.a.createElement(ue,{onRecentSearchSelect:o,initialValues:a,search:t,index:e,key:t.id,setIsOpen:n,dataTestId:r})}))))},fe=function(t){var e=t.isLoading,n=t.recentSearches,r=t.searchKey,o=t.dataTestId,a=t.setIsOpen,i=t.onRecentSearchSelect,c=t.initialValues;return r||n&&0!==n.length?e?l.a.createElement(s.Spin,{size:"small"}):(null===n||void 0===n?void 0:n.length)>0&&!r.trim()?l.a.createElement(de,{recentSearches:n,dataTestId:o,setIsOpen:a,onRecentSearchSelect:i,initialValues:c}):r.trim()?l.a.createElement(H,null,l.a.createElement(u.TranslatableText,{stringId:"No matching results",module:u.TRANSLATION_MODULES.SearchAndBook})):null:null},pe=["fetchOptions","renderedOptions","recentSearches","hasError","mode","dataTestId","value","debounceTimeout","activeLocationMode","defaultLocation","onChange"],me=function(t){var e=t.fetchOptions,n=t.renderedOptions,r=t.recentSearches,o=void 0===r?[]:r,u=t.hasError,d=t.mode,p=t.dataTestId,h=t.value,y=t.debounceTimeout,g=void 0===y?800:y,b=t.activeLocationMode,w=t.defaultLocation,S=t.onChange,O=i(t,pe),E=a(Object(c.useState)([]),2),_=E[0],L=E[1],T=a(Object(c.useState)(!1),2),j=T[0],C=T[1],P=a(Object(c.useState)(""),2),I=P[0],A=P[1],F=Object(c.useRef)(0),R=a(Object(c.useState)(!1),2),U=R[0],N=R[1],z=a(Object(c.useState)(3),2),M=z[0],D=z[1],V=Object(c.useRef)();Object(c.useEffect)((function(){h&&0!==h.length||U||(L([]),A(""))}),[h,U]),Object(c.useEffect)((function(){return""!==b&&L((function(t){return t.filter((function(t){return t.label===x[b].label}))})),N(!1),V.current&&clearTimeout(V.current),V.current=setTimeout((function(){document.activeElement.blur(),document.body.click();var t=document.querySelector(".ant-select-focused");t&&t.classList.remove("ant-select-focused"),D(3)}),100),function(){V.current&&clearTimeout(V.current)}}),[b]);var $=Object(c.useMemo)((function(){var t=function(){var t=m(f.a.mark((function t(n){var r,o,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return A(n),F.current+=1,r=F.current,L([]),C(!0),o=null,t.prev=6,t.next=9,e(n);case 9:a=t.sent,r===F.current&&(L(a),o=a),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(6),console.error("Error fetching options:",t.t0),r===F.current&&s.Notification.danger({message:"Search failed",description:"Unable to fetch location results. Please try again later."});case 17:if(t.prev=17,r!==F.current){t.next=21;break}return C(!1),t.abrupt("return",o);case 21:return t.finish(17);case 22:case"end":return t.stop()}}),t,null,[[6,13,17,22]])})));return function(e){return t.apply(this,arguments)}}();return Object(v.debounce)(t,g)}),[e,g]);Object(c.useEffect)((function(){(null===w||void 0===w?void 0:w.code)&&function(){var t=m(f.a.mark((function t(){var n,r,o,a;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,L([]),C(!0),t.next=5,e(w.code);case 5:if(n=t.sent,L(n),n&&0!==n.length){t.next=9;break}return t.abrupt("return");case 9:r=null,w.type&&(null===(o=n.find((function(t){var e;return t.label.toLowerCase()===(null===(e=x[w.type])||void 0===e?void 0:e.label.toLowerCase())})))||void 0===o?void 0:o.options)&&(r=o.options.find((function(t){return t.code.toLowerCase()===w.code.toLowerCase()||t.selectedValue.toLowerCase()===w.code.toLowerCase()}))),r||(r=n.map((function(t){return t.options})).flat().find((function(t){return t.code.toLowerCase()===w.code.toLowerCase()||t.selectedValue.toLowerCase()===w.code.toLowerCase()}))),r&&S&&(a={key:JSON.stringify(r),label:r.selectedValue||r.displayLabel||r.code},S([a])),t.next=18;break;case 15:t.prev=15,t.t0=t.catch(0),zt.isLocal()&&console.error("Error loading default location:",t.t0);case 18:return t.prev=18,C(!1),t.finish(18);case 21:case"end":return t.stop()}}),t,null,[[0,15,18,21]])})));return function(){return t.apply(this,arguments)}}()()}),[null===w||void 0===w?void 0:w.code,null===w||void 0===w?void 0:w.type]);return l.a.createElement(l.a.Fragment,null,l.a.createElement(G,null),l.a.createElement(X,Object.assign({maxTagCount:M,onSearch:$,$hasError:u,loading:j,options:_,filterOption:!1,notFoundContent:l.a.createElement(fe,{isLoading:j,recentSearches:o,searchKey:I,dataTestId:p,setIsOpen:N,onRecentSearchSelect:O.onRecentSearchSelect,initialValues:O.initialValues}),mode:d,"data-test-id":"".concat(p,"-selector"),allowClear:d===k,labelInValue:!0,optionLabelProp:"label",showSearch:!0,onDropdownVisibleChange:function(t){D(t?2:3),L([]),A(""),N(t)},open:U&&(j||I.trim()||(null===o||void 0===o?void 0:o.length)>0),value:h,onChange:S},O),n(_)))},he=function(t){var e=t.omittedPorts,n=t.dataTestId,r=e.map((function(t){var e;return null===(e=JSON.parse(t.key))||void 0===e?void 0:e.selectedValue}));return l.a.createElement(s.Tooltip,{title:r.join(",")},l.a.createElement(B,{"data-test-id":"".concat(n,"-extra-ports")},"+".concat(e.length)))},ve=["value","onChange","hasError","dataTestId","isOriginLocation","maxPorts","supportedLocationModes","customer","defaultLocation"];e.default=function(t){var e=t.value,n=t.onChange,r=t.hasError,o=t.dataTestId,d=void 0===o?"location-input":o,f=t.isOriginLocation,p=void 0===f||f,m=t.maxPorts,h=void 0===m?1:m,v=t.supportedLocationModes,y=t.customer,b=t.defaultLocation,O=i(t,ve),E=a(Object(c.useState)(e),2),j=E[0],C=E[1],P=a(Object(c.useState)(1===v.length?v[0]:""),2),I=P[0],A=P[1],F=a(Object(c.useState)(Kt(I)||""===I?k:_),2),R=F[0],U=F[1];return Object(c.useEffect)((function(){Kt(I)?U(k):U(_)}),[I]),Object(c.useEffect)((function(){C(e),Array.isArray(e)&&e.length>0?A(e[0].type):(null===b||void 0===b?void 0:b.type)?A(b.type):A("")}),[e,null===b||void 0===b?void 0:b.type]),l.a.createElement(me,Object.assign({mode:R,dataTestId:d,hasError:r,placeholder:l.a.createElement(u.TranslatableText,{style:{fontSize:s.tokens.fdsFontSizeBase},stringId:"Select ".concat(p?L:T)}),value:Gt(j),fetchOptions:Bt(I,v,y),renderedOptions:function(t){return function(t,e){if((t||[]).some((function(t){var e;return(null===t||void 0===t||null===(e=t.options)||void 0===e?void 0:e.length)>0})))return t.map((function(t){var n,r=Object.values(x).find((function(e){return e.label===t.label})),o=null===r||void 0===r?void 0:r.icon;return l.a.createElement(s.Select.OptGroup,{label:l.a.createElement("span",{style:{fontFamily:"Open Sans"}},l.a.createElement(s.Icon,{size:"tiny",type:o}),"\xa0 \xa0",t.label),key:t.label,"data-test-id":"".concat(e,"-group-").concat(t.label)},null===(n=t.options)||void 0===n?void 0:n.map((function(n){var r=n.countryCode,a=n.selectedValue,i=n.displayLabel,c=n.type;return l.a.createElement(s.Option,{value:Wt(n),title:a,"data-test-id":"".concat(e,"-").concat(t.label,"-").concat(a),style:{paddingLeft:"8px"},label:l.a.createElement(l.a.Fragment,null,l.a.createElement(s.Icon,{type:o,size:"tiny"}),"\xa0",l.a.createElement(B,null,a)),key:n.code},l.a.createElement(_t,{fullWidth:!0,justifyContent:"space-between"},l.a.createElement(_t,{spacing:J.XSMALL},l.a.createElement("span",null,l.a.createElement(s.Avatar,{type:"flag",country:r,size:"small",style:{width:s.tokens.fdsSizeSm,height:s.tokens.fdsSizeSm}})),l.a.createElement(q,null,i)),c===w&&l.a.createElement(s.Icon,{type:"amazon",size:"small"}),c===S&&l.a.createElement(s.Chip,{type:"neutral",iconType:"address-book"})))})))}))}(t,d)},onChange:function(t){!function(t,e,n,r,o){if(e===_){var a=Array.isArray(t)?t:[];if(a.length<=n)r(a),qt(a,o);else{var i,c,d=(null===(i=JSON.parse(null===(c=a[0])||void 0===c?void 0:c.key))||void 0===i?void 0:i.sourceType)===g?n>1?"airports":"airport":n>1?"ports":"port";s.Message.danger(l.a.createElement(l.a.Fragment,null,l.a.createElement(u.TranslatableText,{stringId:"You cannot enter more than"})," "," ",n," "," ",l.a.createElement(u.TranslatableText,{stringId:d})))}}else r(t),qt(t,o)}(null!==t&&void 0!==t?t:[],R,h,C,n),A("")},activeLocationMode:I,maxTagPlaceholder:function(t){return l.a.createElement(he,{omittedPorts:t,dataTestId:d})},defaultLocation:b},O))}}])}));
|
|
1
|
+
!function(u,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("react"),require("@freightos/design-system"),require("styled-components"),require("@freightos/freightos-i18n"),require("@freightos/http-client"),require("lodash")):"function"===typeof define&&define.amd?define("FusionLocationInput",["react","@freightos/design-system","styled-components","@freightos/freightos-i18n","@freightos/http-client","lodash"],t):"object"===typeof exports?exports.FusionLocationInput=t(require("react"),require("@freightos/design-system"),require("styled-components"),require("@freightos/freightos-i18n"),require("@freightos/http-client"),require("lodash")):u.FusionLocationInput=t(u.React,u["@freightos/design-system"],u["styled-components"],u["@freightos/freightos-i18n"],u["@freightos/http-client"],u.lodash)}(this,(function(u,t,e,n,r,o){return function(u){var t={};function e(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return u[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=u,e.c=t,e.d=function(u,t,n){e.o(u,t)||Object.defineProperty(u,t,{enumerable:!0,get:n})},e.r=function(u){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},e.t=function(u,t){if(1&t&&(u=e(u)),8&t)return u;if(4&t&&"object"===typeof u&&u&&u.__esModule)return u;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:u}),2&t&&"string"!=typeof u)for(var r in u)e.d(n,r,function(t){return u[t]}.bind(null,r));return n},e.n=function(u){var t=u&&u.__esModule?function(){return u.default}:function(){return u};return e.d(t,"a",t),t},e.o=function(u,t){return Object.prototype.hasOwnProperty.call(u,t)},e.p="http://ship.freightos.local:8800/FusionLocationInput/",e(e.s=7)}([function(t,e){t.exports=u},function(u,e){u.exports=t},function(u,t,e){u.exports=e(8)},function(u,t){u.exports=e},function(u,t){u.exports=n},function(u,t){u.exports=r},function(u,t){u.exports=o},function(u,t,e){u.exports=e(9)},function(u,t,e){var n=function(u){"use strict";var t=Object.prototype,e=t.hasOwnProperty,n="function"===typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",D=n.toStringTag||"@@toStringTag";function a(u,t,e){return Object.defineProperty(u,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),u[t]}try{a({},"")}catch(w){a=function(u,t,e){return u[t]=e}}function i(u,t,e,n){var r=t&&t.prototype instanceof s?t:s,o=Object.create(r.prototype),D=new y(n||[]);return o._invoke=function(u,t,e){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return b()}for(e.method=r,e.arg=o;;){var D=e.delegate;if(D){var a=m(D,e);if(a){if(a===l)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var i=c(u,t,e);if("normal"===i.type){if(n=e.done?"completed":"suspendedYield",i.arg===l)continue;return{value:i.arg,done:e.done}}"throw"===i.type&&(n="completed",e.method="throw",e.arg=i.arg)}}}(u,e,D),o}function c(u,t,e){try{return{type:"normal",arg:u.call(t,e)}}catch(w){return{type:"throw",arg:w}}}u.wrap=i;var l={};function s(){}function F(){}function d(){}var C={};a(C,r,(function(){return this}));var E=Object.getPrototypeOf,A=E&&E(E(g([])));A&&A!==t&&e.call(A,r)&&(C=A);var f=d.prototype=s.prototype=Object.create(C);function p(u){["next","throw","return"].forEach((function(t){a(u,t,(function(u){return this._invoke(t,u)}))}))}function v(u,t){var n;this._invoke=function(r,o){function D(){return new t((function(n,D){!function n(r,o,D,a){var i=c(u[r],u,o);if("throw"!==i.type){var l=i.arg,s=l.value;return s&&"object"===typeof s&&e.call(s,"__await")?t.resolve(s.__await).then((function(u){n("next",u,D,a)}),(function(u){n("throw",u,D,a)})):t.resolve(s).then((function(u){l.value=u,D(l)}),(function(u){return n("throw",u,D,a)}))}a(i.arg)}(r,o,n,D)}))}return n=n?n.then(D,D):D()}}function m(u,t){var e=u.iterator[t.method];if(void 0===e){if(t.delegate=null,"throw"===t.method){if(u.iterator.return&&(t.method="return",t.arg=void 0,m(u,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(e,u.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,l;var r=n.arg;return r?r.done?(t[u.resultName]=r.value,t.next=u.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function B(u){var t={tryLoc:u[0]};1 in u&&(t.catchLoc=u[1]),2 in u&&(t.finallyLoc=u[2],t.afterLoc=u[3]),this.tryEntries.push(t)}function h(u){var t=u.completion||{};t.type="normal",delete t.arg,u.completion=t}function y(u){this.tryEntries=[{tryLoc:"root"}],u.forEach(B,this),this.reset(!0)}function g(u){if(u){var t=u[r];if(t)return t.call(u);if("function"===typeof u.next)return u;if(!isNaN(u.length)){var n=-1,o=function t(){for(;++n<u.length;)if(e.call(u,n))return t.value=u[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:b}}function b(){return{value:void 0,done:!0}}return F.prototype=d,a(f,"constructor",d),a(d,"constructor",F),F.displayName=a(d,D,"GeneratorFunction"),u.isGeneratorFunction=function(u){var t="function"===typeof u&&u.constructor;return!!t&&(t===F||"GeneratorFunction"===(t.displayName||t.name))},u.mark=function(u){return Object.setPrototypeOf?Object.setPrototypeOf(u,d):(u.__proto__=d,a(u,D,"GeneratorFunction")),u.prototype=Object.create(f),u},u.awrap=function(u){return{__await:u}},p(v.prototype),a(v.prototype,o,(function(){return this})),u.AsyncIterator=v,u.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var D=new v(i(t,e,n,r),o);return u.isGeneratorFunction(e)?D:D.next().then((function(u){return u.done?u.value:D.next()}))},p(f),a(f,D,"Generator"),a(f,r,(function(){return this})),a(f,"toString",(function(){return"[object Generator]"})),u.keys=function(u){var t=[];for(var e in u)t.push(e);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in u)return e.value=n,e.done=!1,e}return e.done=!0,e}},u.values=g,y.prototype={constructor:y,reset:function(u){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(h),!u)for(var t in this)"t"===t.charAt(0)&&e.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if("throw"===u.type)throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var t=this;function n(e,n){return D.type="throw",D.arg=u,t.next=e,n&&(t.method="next",t.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],D=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=e.call(o,"catchLoc"),i=e.call(o,"finallyLoc");if(a&&i){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!i)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(u,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&e.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===u||"continue"===u)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var D=o?o.completion:{};return D.type=u,D.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(D)},complete:function(u,t){if("throw"===u.type)throw u.arg;return"break"===u.type||"continue"===u.type?this.next=u.arg:"return"===u.type?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):"normal"===u.type&&t&&(this.next=t),l},finish:function(u){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.finallyLoc===u)return this.complete(e.completion,e.afterLoc),h(e),l}},catch:function(u){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.tryLoc===u){var n=e.completion;if("throw"===n.type){var r=n.arg;h(e)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(u,t,e){return this.delegate={iterator:g(u),resultName:t,nextLoc:e},"next"===this.method&&(this.arg=void 0),l}},u}(u.exports);try{regeneratorRuntime=n}catch(r){"object"===typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(u,t,e){"use strict";e.r(t);var n=e(2),r=e.n(n);function o(u,t){(null==t||t>u.length)&&(t=u.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=u[e];return n}function D(u){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(u))return Array.from(u)}function a(u,t){if(u){if("string"===typeof u)return o(u,t);var e=Object.prototype.toString.call(u).slice(8,-1);return"Object"===e&&u.constructor&&(e=u.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(u,t):void 0}}function i(u){return function(u){if(Array.isArray(u))return o(u)}(u)||D(u)||a(u)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(u,t,e,n,r,o,D){try{var a=u[o](D),i=a.value}catch(c){return void e(c)}a.done?t(i):Promise.resolve(i).then(n,r)}function l(u){return function(){var t=this,e=arguments;return new Promise((function(n,r){var o=u.apply(t,e);function D(u){c(o,n,r,D,a,"next",u)}function a(u){c(o,n,r,D,a,"throw",u)}D(void 0)}))}}function s(u){if(Array.isArray(u))return u}function F(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(u,t){return s(u)||function(u,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(u)){var e=[],n=!0,r=!1,o=void 0;try{for(var D,a=u[Symbol.iterator]();!(n=(D=a.next()).done)&&(e.push(D.value),!t||e.length!==t);n=!0);}catch(i){r=!0,o=i}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return e}}(u,t)||a(u,t)||F()}function C(u,t){if(null==u)return{};var e,n,r=function(u,t){if(null==u)return{};var e,n,r={},o=Object.keys(u);for(n=0;n<o.length;n++)e=o[n],t.indexOf(e)>=0||(r[e]=u[e]);return r}(u,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(u);for(n=0;n<o.length;n++)e=o[n],t.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(u,e)&&(r[e]=u[e])}return r}var E,A=e(0),f=e.n(A),p=e(1),v=e(4),m=e(6);function B(u,t,e){return t in u?Object.defineProperty(u,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):u[t]=e,u}var h="airport",y="seaport",g="fulfillment_center",b="address_book",w="last_mile_address",x="address",S="city",O="postal_code",k="country",L=[S,O,k],_=(B(E={},h,{label:"Airports",key:h,icon:"mode-air"}),B(E,y,{label:"Ports",key:y,icon:"mode-ship"}),B(E,g,{label:"Fulfillment centers",key:g,icon:"fulfillment-center"}),B(E,b,{key:b,groupedBy:"address"}),B(E,w,{key:w,groupedBy:"address"}),B(E,x,{label:"Address",key:x,icon:"location"}),B(E,S,{label:"Cities",key:S,icon:"office"}),B(E,O,{label:"Postal codes",key:O,icon:"location"}),B(E,k,{label:"Countries",key:k,icon:"flag"}),E),T="single",j="multiple",P="origin",I="destination";function M(u){return s(u)||D(u)||a(u)||F()}function z(u){if("undefined"===typeof Symbol||null==u[Symbol.iterator]){if(Array.isArray(u)||(u=a(u))){var t=0,e=function(){};return{s:e,n:function(){return t>=u.length?{done:!0}:{done:!1,value:u[t++]}},e:function(u){throw u},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,r,o=!0,D=!1;return{s:function(){n=u[Symbol.iterator]()},n:function(){var u=n.next();return o=u.done,u},e:function(u){D=!0,r=u},f:function(){try{o||null==n.return||n.return()}finally{if(D)throw r}}}}function R(u,t){var e=Object.keys(u);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(u);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(u,t).enumerable}))),e.push.apply(e,n)}return e}function N(u){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?R(Object(e),!0).forEach((function(t){B(u,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(e)):R(Object(e)).forEach((function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(e,t))}))}return u}var U={XXLARGE:p.tokens.fdsComponentSpacingXxl,XLARGE:p.tokens.fdsComponentSpacingXl,LARGE:p.tokens.fdsComponentSpacingLg,MEDIUM:p.tokens.fdsComponentSpacingMd,SMALL:p.tokens.fdsComponentSpacingSm,XSMALL:p.tokens.fdsComponentSpacingXs,XXSMALL:p.tokens.fdsComponentSpacingXxs,NONE:0},V="vertical",$="horizontal";function G(u,t){return t||(t=u.slice(0)),Object.freeze(Object.defineProperties(u,{raw:{value:Object.freeze(t)}}))}var W,X,q,K,J,H,Z,Y,Q,uu,tu,eu=e(3),nu=e.n(eu),ru=nu.a.div(W||(W=G(["\n\tdisplay: flex;\n\tflex-direction: ",";\n\tflex-wrap: ",";\n\talign-items: ",";\n\tjustify-content: ",";\n\tbox-sizing: border-box;\n\n\t","\n\t",";\n"])),(function(u){return u.$direction===V?"column":"row"}),(function(u){return u.$wrap?"wrap":"nowrap"}),(function(u){return u.$alignItems}),(function(u){return u.$justifyContent}),(function(u){return u.$fullWidth&&Object(eu.css)(X||(X=G(["\n\t\t\twidth: 100%;\n\t\t"])))}),(function(u){var t=u.$direction,e=u.$spacing;return t===V?Object(eu.css)(q||(q=G(["\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-top: ",";\n\t\t\t\t\t}\n\t\t\t "])),e):Object(eu.css)(K||(K=G(["\n\t\t\t\t\t> *:not(:first-child) {\n\t\t\t\t\t\tmargin-left: ",";\n\t\t\t\t\t}\n\t\t\t "])),e)})),ou=["direction","alignItems","spacing","wrap","justifyContent","fullWidth"],Du=function(u){var t=u.direction,e=void 0===t?$:t,n=u.alignItems,r=void 0===n?"start":n,o=u.spacing,D=void 0===o?U.NONE:o,a=u.wrap,i=u.justifyContent,c=u.fullWidth,l=C(u,ou);return f.a.createElement(ru,Object.assign({},l,{$direction:e,$alignItems:r,$spacing:D,$wrap:a,$justifyContent:i,$fullWidth:c}),l.children)},au=e(5),iu=e.n(au),cu=function(){var u=l(r.a.mark((function u(t,e,n){var o,D,a,i=arguments;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(o=i.length>3&&void 0!==i[3]?i[3]:5,u.prev=1,D=(t||[]).filter((function(u){return _[u]})).reduce((function(u,t){return N(N({},u),{},B({},_[t].key,N(N({type:t.toUpperCase()},(null===n||void 0===n?void 0:n.code)?{searchTerm:n.name}:{}),_[t].groupedBy?{groupedBy:_[t].groupedBy}:{})))}),{}),0!==Object.keys(D).length){u.next=5;break}return u.abrupt("return",{results:{}});case 5:return u.next=7,iu.a.post("/geocoder/api/v3/geocoder/locations",{query:e,limit:null!==o&&void 0!==o?o:5,sources:D});case 7:return a=u.sent,u.abrupt("return",a.data);case 11:return u.prev=11,u.t0=u.catch(1),console.error("Error fetching locations:",u.t0),u.abrupt("return",{results:{}});case 15:case"end":return u.stop()}}),u,null,[[1,11]])})));return function(t,e,n){return u.apply(this,arguments)}}(),lu=Object(eu.createGlobalStyle)(J||(J=G(["\n .ant-select-dropdown {\n .ant-select-dropdown-menu {\n max-height: 400px;\n padding: 0 !important;\n margin-top: 0 !important;\n }\n }\n"]))),su=nu()(p.Select)(H||(H=G(["\n\t.ant-select-selection__rendered {\n\t\tmin-width: 100% !important;\n\t}\n\n\tli.ant-select-selection__choice {\n\t\tborder-radius: ",";\n\t\tborder: none;\n\t\tborder-color: ",";\n\t\tcolor: ",";\n\t\tbackground-color: ",";\n\t\tline-height: 10px !important;\n\t\tmargin-right: ",";\n\t\twidth: fit-content;\n\t\tmax-width: 90px;\n\t\theight: "," !important;\n\t\t","\n\n\t\t.ant-select-selection__choice__remove {\n\t\t\tcolor: ",";\n\t\t\tmargin-top: "," !important;\n\t\t}\n\n\t\t.ant-select-selection__choice__content {\n\t\t\tline-height: "," !important;\n\t\t\theight: "," !important;\n\t\t}\n\t}\n\n\tli.ant-select-selection__choice__disabled {\n\t\tborder: none;\n\t\tbackground-color: transparent;\n\t\tpadding: 0;\n\t\tpadding-left: 0;\n\t\twidth: fit-content;\n\t}\n\n\t.ant-select-dropdown .ant-select-not-found {\n\t\tcursor: pointer !important;\n\t}\n\n\t.ant-select-selection-selected-value {\n\t\tmax-width: 280px !important;\n\t}\n\n\tli.ant-select-search.ant-select-search--inline {\n\t\tmargin-left: -1px !important;\n\t}\n\t.ant-select-search__field {\n\t\tcolor: "," !important;\n\t}\n\t","\n"])),p.tokens.fdsBorderRadiusXl,p.tokens.fdsColorPrimaryBlue,p.tokens.fdsColorPrimaryBlue,p.tokens.fdsColorPrimaryBlue10,p.tokens.fdsComponentSpacingXxs,p.tokens.fdsSizeMd,(function(u){return"large"===u.size?"\n\t\t\tmargin-top: ".concat(p.tokens.fdsComponentSpacingSm," !important;\n\t\t"):"\n\t\t\tmargin-top: 5px !important;\n\t\t"}),p.tokens.fdsColorPrimaryBlue,p.tokens.fdsComponentSpacingXs,p.tokens.fdsSizeMd,p.tokens.fdsSizeMd,p.tokens.fdsColorPrimaryGray80,(function(u){return u.$hasError&&"\n\t\t.ant-select-selection {\n\t\t\tcolor: ".concat(p.tokens.fdsColorSemanticRed,";\n \t\tborder: 1px solid ").concat(p.tokens.fdsColorSemanticRed,";\n \t\tbackground-color: ").concat(p.tokens.fdsColorSemanticRed10,";\n\t\t}\n\n\t\t.ant-select-selection__placeholder, .ant-select-arrow {\n\t\t\tcolor: ").concat(p.tokens.fdsColorSemanticRed,";\n\t\t}\n\t")})),Fu=nu.a.span(Z||(Z=G(["\n\tfont-size: "," !important;\n"])),p.tokens.fdsFontSizeSm),du=nu.a.div(Y||(Y=G(["\n\tfont-size: "," !important;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: 2;\n\t-webkit-box-orient: vertical;\n"])),p.tokens.fdsFontSizeSm),Cu=nu()(p.Menu)(Q||(Q=G(["\n\tcursor: pointer !important;\n\n\t.ant-menu-item-group-title {\n\t\tpadding: 0;\n\t\tcolor: ",";\n\t}\n\n\t.ant-menu-item {\n\t\tpadding: 0;\n\t\twhite-space: normal;\n\t\tline-height: normal;\n\n\t\t&:hover {\n\t\t\tbackground-color: #f5f5f5;\n\t\t}\n\t}\n"])),p.tokens.fdsBodyTextColorDisabled),Eu=nu.a.div(uu||(uu=G(["\n\tfont-size: ",";\n\tline-height: ",";\n\tfont-family: ",";\n"])),p.tokens.fdsFontSizeSm,p.tokens.fdsSizeSm,p.tokens.fdsHeadingsFontFamily);nu()(p.Icon)(tu||(tu=G(["\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n"])));function Au(u,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(u,n.key,n)}}var fu,pu,vu,mu,Bu,hu,yu,gu,bu,wu,xu,Su,Ou=function(){function u(){!function(u,t){if(!(u instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u)}var t,e,n;return t=u,n=[{key:"isProduction",value:function(){return"prod"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}},{key:"isTest",value:function(){return"test"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}},{key:"isLocal",value:function(){return"dev"===Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0}).REACT_APP_CUSTOM_ENV}}],(e=null)&&Au(t.prototype,e),n&&Au(t,n),u}(),ku=["address"],Lu=function(u){return(u||"").trim().toUpperCase()},_u=function(u){var t=function(u){try{return"string"===typeof u?JSON.parse(u):null}catch(t){return null}}(null===u||void 0===u?void 0:u.key);return Lu((null===t||void 0===t?void 0:t.code)||(null===t||void 0===t?void 0:t.selectedValue))},Tu=function(u){var t=[];JSON.stringify(u,(function(u,e){return t.push(u),e}));var e=Array.from(new Set(t)).sort();return JSON.stringify(u,e)},ju=function(u){var t=u||{},e=t.displayLabel,n=t.selectedValue,r=t.formattedNameOrAddress,o=t.code,D=t.countryCode,a=t.stateOrProvince,i=t.city,c=t.latitude,l=t.longitude,s=t.postalOrZipCode,F=t.sourceType,d=t.locationType,C=t.type;return{displayLabel:e,selectedValue:n||o,formattedNameOrAddress:r,code:o||n,country:D,countryName:t.countryName,stateOrProvince:null!==a&&void 0!==a?a:null,city:null!==i&&void 0!==i?i:null,latitude:null!==c&&void 0!==c?c:null,longitude:null!==l&&void 0!==l?l:null,postalOrZipCode:null!==s&&void 0!==s?s:null,sourceType:null!==F&&void 0!==F?F:null,locationType:null!==d&&void 0!==d?d:null,type:null!==C&&void 0!==C?C:F}},Pu=function(u){try{var t="string"===typeof(null===u||void 0===u?void 0:u.key)?JSON.parse(Xu(u.key)):u;return Tu(ju(t))}catch(e){return Tu(ju(u))}},Iu=function(u){var t=function(u){return function(u){if(u){var t,e=u.label||u.selectedValue;return{key:Pu(u),label:e?f.a.createElement(f.a.Fragment,null,f.a.createElement(p.Icon,{type:u.sourceType?null===(t=_[u.sourceType])||void 0===t?void 0:t.icon:"location",size:"tiny"}),"\xa0",f.a.createElement(Fu,null,e)):void 0}}}(u)};return Array.isArray(u)?u.map(t):t(u)},Mu=function(u){var t=u.type,e=u.displayLabel,n=u.selectedValue;return t===S&&n||e},zu=function(u){var t=N({},u),e=u[x].filter((function(u){return u.sourceType===g}));if(e.length>0){var n,r=t,o=r.address;t=N(N({},C(r,ku)),{},(B(n={},g,e),B(n,"address",o.filter((function(u){return u.type!==g}))),n))}return t},Ru=function(u,t,e,n){return function(){var o=l(r.a.mark((function o(D){var a,i,c;return r.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(D){r.next=2;break}return r.abrupt("return",[]);case 2:return a=""!==u?[u]:t,r.next=5,cu(a,D,e,n);case 5:return i=r.sent,(c=i.results)[x]&&(c=zu(c)),r.abrupt("return",Object.keys(c).map((function(u){var t;return{label:(null===(t=_[u])||void 0===t?void 0:t.label)||u,options:c[u].map((function(u){return N(N({},u),{},{type:u.sourceType})}))}})));case 9:case"end":return r.stop()}}),o)})));return function(u){return o.apply(this,arguments)}}()},Nu=function(){var u=l(r.a.mark((function u(t,e){var n,o;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return n=Array.isArray(t)?t:[t],u.next=3,Promise.all(n.map(function(){var u=l(r.a.mark((function u(t){var e,n,o;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,e=null===t||void 0===t?void 0:t.key,n=Xu(e),o=JSON.parse(n),u.abrupt("return",N({key:n},o));case 7:return u.prev=7,u.t0=u.catch(0),u.abrupt("return",void 0);case 10:case"end":return u.stop()}}),u,null,[[0,7]])})));return function(t){return u.apply(this,arguments)}}()));case 3:o=u.sent,e(o.filter(Boolean));case 5:case"end":return u.stop()}}),u)})));return function(t,e){return u.apply(this,arguments)}}(),Uu=function(u,t,e,n,r){if(t===j){var o=Array.isArray(u)?u:[];if(o.length<=e)n(o),Nu(o,r);else{var D,a,i=Gu(null===(D=JSON.parse(null===(a=o[0])||void 0===a?void 0:a.key))||void 0===D?void 0:D.sourceType,e);p.Message.danger(f.a.createElement(f.a.Fragment,null,f.a.createElement(v.TranslatableText,{stringId:"You cannot enter more than"})," "," ",e," "," ",f.a.createElement(v.TranslatableText,{stringId:i})))}}else n(u),Nu(u,r)},Vu=function(u){var t,e,n,r=null;try{if("string"===typeof(null===u||void 0===u?void 0:u.key)){var o=JSON.parse(u.key);r=(null===o||void 0===o?void 0:o.code)||(null===o||void 0===o?void 0:o.selectedValue)||null}}catch(D){}return((null!==(t=null!==(e=null!==(n=r)&&void 0!==n?n:null===u||void 0===u?void 0:u.code)&&void 0!==e?e:null===u||void 0===u?void 0:u.selectedValue)&&void 0!==t?t:"")||"").trim().toUpperCase()},$u=function(u){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return L.includes(u)&&!t.includes(u)?"":u},Gu=function(u,t){var e=t>1;return u===h?e?"airports":"airport":u!==y&&L.includes(u)?e?"locations":"location":e?"ports":"port"},Wu=function(u){return u&&(u===x||u===w||u===b||u===g)},Xu=function(u){return"string"===typeof u?u.replace(/"/g,'"').replace(/"/g,'"').replace(/&/g,"&"):u},qu=function(u){return function(u){return(u||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[\u00df\u1e9e]/g,"ss").replace(/(?:(?![0-9A-Za-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])[\s\S])+/g," ").trim()}(u).split(" ").filter(Boolean)},Ku=/^(?:[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9\uDD50-\uDD59]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD83A[\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9])+(?:[A-Za-z\xAA\xB5\xBA\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\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\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\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\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\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\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\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\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\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\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\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\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\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\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\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\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\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\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]|\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]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\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]|\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])?$/,Ju=function(u){return(u||"").split(",")[0].trim()},Hu=[/\b\d{5}\s?-\s?\d{4}\b/g,/\b\d{4}\s?-\s?\d{3}\b/g,/\b\d{3}\s?-\s?\d{4}\b/g,/\b\d{4}\s?[a-z]{2}\b/gi,/\b[a-z]{1,2}\d[a-z\d]?\s?\d[a-z]{2}\b/gi,/\b\d{4,6}\b/g],Zu=function(u){var t=M((u||"").split(",")),e=t[0],n=t.slice(1);if(0===n.length)return"";var r=n.map((function(u){return Hu.reduce((function(u,t){return u.replace(t," ")}),u)})).map((function(u){return u.replace(/\s+/g," ").trim()})).filter(Boolean);return[e.trim()].concat(i(r)).join(", ")},Yu=function(u){var t=(u||"").trim();return Array.from(new Set([t,Ju(t),Zu(t)].filter(Boolean)))},Qu=function(u,t,e,n,r){var o=new Set(qu(function(u){return[null===u||void 0===u?void 0:u.formattedNameOrAddress,null===u||void 0===u?void 0:u.displayLabel,null===u||void 0===u?void 0:u.selectedValue].filter(Boolean).join(" ")}(u)));if(0===o.size)return 0;var D=qu(null===u||void 0===u?void 0:u.postalOrZipCode);if(r.size>0&&D.length>0&&!D.some((function(u){return r.has(u)})))return 0;var a=function(u){return[].concat(i(qu(null===u||void 0===u?void 0:u.city)),i(qu((null===u||void 0===u?void 0:u.stateOrProvince)||(null===u||void 0===u?void 0:u.state))),i(qu(null===u||void 0===u?void 0:u.postalOrZipCode)))}(u);if(a.length>0&&!a.some((function(u){return e.has(u)})))return 0;if(n){var c=function(u){var t=qu(null===u||void 0===u?void 0:u.formattedNameOrAddress).filter((function(u){return Ku.test(u)}));return qu(null===u||void 0===u?void 0:u.postalOrZipCode).forEach((function(u){var e=t.indexOf(u);-1!==e&&t.splice(e,1)})),t}(u);if(c.length>0&&!c.some((function(u){return e.has(u)})))return 0}return t.filter((function(u){return o.has(u)})).length/t.length},ut=function(u){var t=new Map;return u.forEach((function(u){var e=(null===u||void 0===u?void 0:u.code)||(null===u||void 0===u?void 0:u.selectedValue)||(null===u||void 0===u?void 0:u.formattedNameOrAddress);e&&!t.has(e)&&t.set(e,u)})),Array.from(t.values())},tt=function(u,t){var e=qu(t);if(0===e.length)return[];var n=new Set(e),r=function(u){var t=M((u||"").split(",")).slice(1).join(","),e=Hu.reduce((function(u,e){return u.concat(t.match(e)||[])}),[]);return new Set(e.reduce((function(u,t){return u.concat(qu(t))}),[]))}(t);return u.map((function(u){return{address:u,score:Qu(u,e,n,(null===u||void 0===u?void 0:u.sourceType)!==g,r)}})).filter((function(u){return u.score>=.5})).sort((function(u,t){return t.score-u.score}))},et=function(u,t){if(0===u.length)return null;var e=u[0].score,n=u.filter((function(u){return u.score===e})).map((function(u){return u.address}));if(1===n.length||!t)return n[0];var r=t.toLowerCase();return n.find((function(u){return(u.countryCode||u.country||"").toLowerCase()===r}))||n[0]},nt=function(u,t){var e=u[h]||[],n=u[y]||[],r=Lu(t);return[].concat(i(e),i(n)).find((function(u){return Lu(null===u||void 0===u?void 0:u.code)===r}))},rt=function(u){var t=u.selectedValue||u.displayLabel||u.code,e=N(N({},u),{},{selectedValue:t,displayLabel:u.displayLabel||t,country:u.countryCode||u.country,type:u.type||u.sourceType});return e.country&&delete e.countryCode,{key:JSON.stringify(e),label:t}},ot=function(u){return(u||[]).some(Wu)},Dt=function(){var u=l(r.a.mark((function u(t){var e,n,o,D,a,c,l;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return n=t.address,o=t.supportedLocationModes,D=t.customer,a=t.userCountryCode,u.next=3,Promise.all(Yu(n).map((function(u){return cu(o,u,D).then((function(u){return t=null===u||void 0===u?void 0:u.results,[].concat(i((null===t||void 0===t?void 0:t[x])||[]),i((null===t||void 0===t?void 0:t[g])||[]));var t})).catch((function(){return[]}))})));case 3:return c=u.sent,l=ut((e=[]).concat.apply(e,i(c))),u.abrupt("return",et(tt(l,n),a));case 6:case"end":return u.stop()}}),u)})));return function(t){return u.apply(this,arguments)}}(),at=function(){var u=l(r.a.mark((function u(t){var e,n,o,D,a,i,c;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(e=t.autofillLocationAddress,n=t.autofillLocationCode,o=t.supportedLocationModes,D=t.customer,a=t.userCountryCode,e||n){u.next=3;break}return u.abrupt("return",null);case 3:if(i=null,!n){u.next=9;break}return u.next=7,cu(o,n,D).catch((function(){return null}));case 7:c=u.sent,i=nt((null===c||void 0===c?void 0:c.results)||{},n);case 9:if(i||!e||!ot(o)){u.next=13;break}return u.next=12,Dt({address:e,supportedLocationModes:o,customer:D,userCountryCode:a});case 12:i=u.sent;case 13:return u.abrupt("return",i?rt(i):null);case 14:case"end":return u.stop()}}),u)})));return function(t){return u.apply(this,arguments)}}(),it="totalShipment",ct="unitsShipment",lt="containerPackages",st="celsius",Ft="fahrenheit",dt="COL",Ct="ERT",Et="CRT",At=(B(Bu={},"FRO",(B(fu={},st,"-10\xbaC or below"),B(fu,Ft,"14\xbaF or below"),fu)),B(Bu,dt,(B(pu={},st,"From +2\xbaC To +8\xbaC"),B(pu,Ft,"From 35.6\xbaF To 46.4\xbaF"),pu)),B(Bu,Ct,(B(vu={},st,"From +2\xbaC To +25\xbaC"),B(vu,Ft,"From 35.6\xbaF To 77\xbaF"),vu)),B(Bu,Et,(B(mu={},st,"From +15\xbaC To +25\xbaC"),B(mu,Ft,"From 59\xbaF To 77\xbaF"),mu)),Bu),ft="quotation",pt="units",vt="totals",mt="container",Bt="CBM",ht="CFT",yt="kg",gt="box",bt="uld",wt=function(){var u=l(r.a.mark((function u(t){var e,n,o,D,a,c,l,s;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return e=t.method,n=t.url,o=void 0===n?"":n,D=t.data,a=void 0===D?{}:D,c=t.options,l=void 0===c?{}:c,s=function(){if("get"===e)return[Object.keys(a).length?"".concat(o,"?").concat(new URLSearchParams(a).toString()):o,l];if("post"===e){var u=N(N({},null===l||void 0===l?void 0:l.headers),{},{accept:"application/json","content-type":"multipart/form-data"});return[o,a,N(N({},l),{},{headers:u})]}return[o,a,l]}(),u.next=4,iu.a[e].apply(iu.a,i(s));case 4:return u.abrupt("return",u.sent);case 5:case"end":return u.stop()}}),u)})));return function(t){return u.apply(this,arguments)}}(),xt=function(){var u=l(r.a.mark((function u(t){return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,wt({method:"put",url:"".concat("/webcargo-alpha","/backend/api.php"),options:{headers:{namespace:"airops/user_searches",route:" user_search_used"}},data:{id:t}});case 2:case"end":return u.stop()}}),u)})));return function(t){return u.apply(this,arguments)}}(),St=nu.a.div(hu||(hu=G(["\n\tcolor: ",";\n\tfont-size: ",";\n\tfont-weight: ",";\n\tmargin-bottom: ",";\n\ti {\n\t\tmargin-right: ",";\n\t}\n\n"])),p.tokens.fdsColorPrimaryGray60,p.tokens.fdsSizeXs,p.tokens.fdsFontWeightRegular,p.tokens.fdsComponentSpacingSm,p.tokens.fdsComponentSpacingSm),Ot=nu()(Du)(yu||(yu=G(["\n\tpadding-left: 0 !important;\n"]))),kt=nu()(p.Icon)(gu||(gu=G(["\n\tmargin-right: 0 !important;\n\tvertical-align: bottom;\n"]))),Lt=nu.a.span(bu||(bu=G(["\n\twhite-space: nowrap;\n\tmin-width: 0;\n\tcolor: ",";\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\t","\n\t",";\n"])),p.tokens.fdsColorPrimaryGray80,(function(u){return!u.$isLocationLabel&&"\n\t\tfont-size: 10px; //TODO: FSN-145\n\t\tline-height: 15px;\n\t"}),(function(u){var t=u.$isPort;if(void 0!==t)return"min-width: ".concat(t?"65px":"55px",";")})),_t=nu()(p.Avatar)(wu||(wu=G(["\n\tborder: 1px solid ",";\n\twidth: ",";\n\theight: ",";\n"])),p.tokens.fdsColorPrimaryGray20,p.tokens.fdsSizeSm,p.tokens.fdsSizeSm),Tt=nu()(Du)(xu||(xu=G(["\n\toverflow: hidden !important;\n\tfont-size: 10px; //TODO: FSN-145\n\tline-height: 15px;\n\tflex: 1;\n\tmin-width: 0;\n"]))),jt=nu()(Du)(Su||(Su=G(["\n\t:last-child {\n\t\tpadding-bottom: 0 !important;\n\t}\n"]))),Pt=function(u){return u?u.toLocaleString("en-US",{maximumFractionDigits:3,useGrouping:!0}):"0"},It=function(u){var t=u.reduce((function(u,t){var e=t.country;return u[e]||(u[e]=[]),u[e].push(t),u}),{});return Object.keys(t).forEach((function(u){t[u].sort((function(u,t){return(u.selectedValue||"").localeCompare(t.selectedValue||"")}))})),t},Mt=function(u){var t=u.text,e=void 0===t?"":t,n=u.testId,r=u.isPort,o=void 0===r?void 0:r,D=u.isLocationLabel,a=void 0!==D&&D,i=u.children,c=void 0===i?null:i,l=Object(A.useRef)(null),s=d(Object(A.useState)(!1),2),F=s[0],C=s[1];Object(A.useEffect)((function(){!function(){if(l.current){var u=l.current,t=u.scrollWidth>u.clientWidth;C(t)}}()}),[e]);var E=f.a.createElement(Lt,{ref:l,"data-test-id":n,$isLocationLabel:a,$isPort:o},c||e);return F?f.a.createElement(p.Tooltip,{title:e,"data-test-id":"".concat(n,"-tooltip")},f.a.createElement(Lt,{ref:l,"data-test-id":n,$isLocationLabel:a,$isPort:o},c||e)):E},zt=function(u){var t=u.search,e=u.index,n=u.dataTestId,r=t.origin.length>1,o=t.destination.length>1,D=r?It(t.origin):B({},t.origin[0].country,t.origin),a=o?It(t.destination):B({},t.destination[0].country,t.destination);return f.a.createElement(Du,{alignItems:"center",spacing:U.XSMALL,fullWidth:!0},Object.keys(D).map((function(u){var t=D[u].map((function(u){return u.selectedValue})).join(", ");return f.a.createElement(Mt,{key:u,text:t,isLocationLabel:!0,testId:"".concat(n,"-origin-").concat(e),isPort:D[u][0].type===y},f.a.createElement(_t,{type:"flag",country:u,size:"small","data-test-id":"".concat(n,"-origin-flag-").concat(e),style:{marginRight:"4px"}}),t)})),f.a.createElement(p.Icon,{type:"arrow-forward",style:{marginRight:0,color:p.tokens.fdsColorPrimaryGray90,flex:"none"}}),Object.keys(a).map((function(u){var t=a[u].map((function(u){return u.selectedValue})).join(", ");return f.a.createElement(Mt,{key:u,text:t,isLocationLabel:!0,testId:"".concat(n,"-destination-").concat(e),isPort:a[u][0].type===y},f.a.createElement(_t,{type:"flag",country:u,size:"small","data-test-id":"".concat(n,"-destination-flag-").concat(e),style:{marginRight:"4px"}}),t)})))},Rt=function(u){var t,e,n,r=u.search,o=u.index,D=u.dataTestId,a=r.platform_type,i=function(u){var t=u.shipment_details.type;if(t===vt)return["box-total"];if(t===pt){var e=u.shipment_details[ct];return(null===e||void 0===e?void 0:e.packageType)===gt?e.boxPackages.reduce((function(u,t){var e,n,r=null===(e=t.type)||void 0===e||null===(n=e.value)||void 0===n?void 0:n.icon;return u.includes(r)||u.push(r),u}),[]):(null===e||void 0===e?void 0:e.packageType)===bt?["uld"]:["box"]}return t===mt?["container"]:["box"]}(r),c=Object(A.useMemo)((function(){return function(u){var t=u.shipment_details.type;if(u.platform_type===ft)return{units:0,volume:0,weight:0,weightUnit:yt,volumeUnit:Bt};switch(t){case mt:var e,n=0,r=0;return null===(e=u.shipment_details[lt])||void 0===e||e.forEach((function(u){var t=Number(u.units)||0;if(t>0){n+=t;var e=parseInt(u.dimensions.value,10);r+=t*(e/20)}})),{units:n,volume:r,weight:null,weightUnit:null,volumeUnit:"TEU"};case pt:var o=u.shipment_details[ct],D=(null===o||void 0===o?void 0:o.volumeUnit)===ht?1728:1e6;if((null===o||void 0===o?void 0:o.packageType)===gt){var a=Pt(null===o||void 0===o?void 0:o.boxPackages.reduce((function(u,t){return u+parseFloat(t.width||"0")*parseFloat(t.height||"0")*parseFloat(t.length||"0")*parseFloat(t.units||"0")/D}),0)),i=Pt(o.boxPackages.reduce((function(u,t){return u+parseFloat(t.weight||"0")}),0));return{units:o.boxPackages.reduce((function(u,t){return u+parseFloat(t.units||"0")}),0),volume:a,weight:i,weightUnit:o.weightUnit,volumeUnit:o.volumeUnit}}if((null===o||void 0===o?void 0:o.packageType)===bt){var c=Pt(o.uldPackages.reduce((function(u,t){return u+parseFloat(t.volume||"0")}),0)),l=Pt(o.uldPackages.reduce((function(u,t){return u+parseFloat(t.weight||"0")}),0));return{units:o.uldPackages.length,volume:c,weight:l,weightUnit:o.weightUnit,volumeUnit:o.volumeUnit}}return{units:0,volume:0,weight:0,weightUnit:yt,volumeUnit:Bt};case vt:var s,F,d,C,E,A=Pt(parseFloat((null===(s=u.shipment_details[it])||void 0===s?void 0:s.volume)||"0")),f=Pt(parseFloat((null===(F=u.shipment_details[it])||void 0===F?void 0:F.weight)||"0"));return{units:(null===(d=u.shipment_details[it])||void 0===d?void 0:d.units)||0,volume:A,weight:f,weightUnit:(null===(C=u.shipment_details[it])||void 0===C?void 0:C.weightUnit)||yt,volumeUnit:(null===(E=u.shipment_details[it])||void 0===E?void 0:E.volumeUnit)||Bt};default:return{units:0,volume:0,weight:0,weightUnit:yt,volumeUnit:Bt}}}(r)}),[r]),l=c.units,s=c.volume,F=c.weight,d=c.weightUnit,C=c.volumeUnit,E=1===r.commodity.length&&r.commodity[0].is_temperature,v=(null===(t=r.commodity_temperature)||void 0===t?void 0:t.tempRange)&&E?At[null===(e=r.commodity_temperature)||void 0===e?void 0:e.tempRange][null===(n=r.commodity_temperature)||void 0===n?void 0:n.temperatureSystem]:"";return f.a.createElement(Du,{spacing:U.XSMALL,alignItems:"center",fullWidth:!0,key:o},a===ft?f.a.createElement(Tt,{alignItems:"center",spacing:U.SMALL,style:{flex:1}},i.map((function(u,t){return f.a.createElement(kt,{type:u,key:"".concat(o,"-").concat(t),size:"tiny","data-test-id":"".concat(D,"rs-package-icon-").concat(o,"-").concat(t)})})),f.a.createElement(Mt,{text:r.commodity.map((function(u){return u.label})).join(", "),testId:"".concat(D,"rs-commodity-").concat(o)})):f.a.createElement(Tt,{alignItems:"center",spacing:U.SMALL},f.a.createElement(Du,{alignItems:"center",spacing:U.XSMALL,"data-test-id":"rs-".concat(o,"-units")},l,"\xa0",i.map((function(u,t){return f.a.createElement(kt,{type:u,key:"".concat(o,"-").concat(t),size:"tiny","data-test-id":"".concat(D,"rs-package-icon-").concat(o,"-").concat(t)})}))),f.a.createElement("span",{"data-test-id":"".concat(D,"rs-volume-").concat(o)},s,"\xa0",C),F&&f.a.createElement("span",{"data-test-id":"".concat(D,"rs-weight-").concat(o)},F,"\xa0",d),f.a.createElement(Mt,{text:r.commodity.map((function(u){return u.label})).join(", "),testId:"".concat(D,"rs-commodity-").concat(o)}),E&&f.a.createElement(Du,{alignItems:"center",spacing:U.XSMALL,"data-test-id":"".concat(D,"rs-temperature-").concat(o)},f.a.createElement(p.Icon,{type:"temperature-low",size:"tiny","data-test-id":"".concat(D,"rs-temperature-icon-").concat(o)}),f.a.createElement("span",{style:{whiteSpace:"nowrap"}},v))))},Nt=function(u){var t=u.search,e=u.index,n=u.setIsOpen,o=u.dataTestId,D=u.onRecentSearchSelect,a=function(){var u=l(r.a.mark((function u(){return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return D(t),u.prev=1,u.next=4,xt(t.id);case 4:u.next=9;break;case 6:u.prev=6,u.t0=u.catch(1),console.error(u.t0);case 9:n(!1);case 10:case"end":return u.stop()}}),u,null,[[1,6]])})));return function(){return u.apply(this,arguments)}}();return f.a.createElement(Ot,{direction:V,fullWidth:!0,spacing:U.XSMALL,key:t.id,style:{padding:p.tokens.fdsComponentSpacingSm},"data-test-id":"".concat(o,"rs-card-").concat(e),onClick:function(){a()}},f.a.createElement(zt,{search:t,index:e,dataTestId:o}),f.a.createElement(Rt,{search:t,index:e,dataTestId:o}))},Ut=function(u){var t=u.recentSearches,e=u.setIsOpen,n=u.dataTestId,r=u.onRecentSearchSelect,o=u.initialValues,D=t?function(u){return i(u).sort((function(u,t){if(u.is_saved!==t.is_saved)return u.is_saved?-1:1;if(u.is_saved&&t.is_saved){var e=new Date(u.saved_update_date).getTime();return new Date(t.saved_update_date).getTime()-e}var n=new Date(Math.max(new Date(u.last_time_used_date).getTime(),new Date(u.saved_update_date||0).getTime())).getTime();return new Date(Math.max(new Date(t.last_time_used_date).getTime(),new Date(t.saved_update_date||0).getTime())).getTime()-n})).slice(0,6)}(t):[];return f.a.createElement(Cu,null,f.a.createElement(St,null,f.a.createElement(p.Icon,{"data-test-id":"".concat(n,"rs-icon"),color:p.tokens.fdsColorPrimaryGray60,type:"history",size:"tiny"}),f.a.createElement(v.TranslatableText,{stringId:"Recent searches"})),f.a.createElement(jt,{direction:V,fullWidth:!0},D.map((function(u,t){return f.a.createElement(Nt,{onRecentSearchSelect:r,initialValues:o,search:u,index:t,key:u.id,setIsOpen:e,dataTestId:n})}))))},Vt=function(u){var t=u.isLoading,e=u.recentSearches,n=u.searchKey,r=u.dataTestId,o=u.setIsOpen,D=u.onRecentSearchSelect,a=u.initialValues;return n||e&&0!==e.length?t?f.a.createElement(p.Spin,{size:"small"}):(null===e||void 0===e?void 0:e.length)>0&&!n.trim()?f.a.createElement(Ut,{recentSearches:e,dataTestId:r,setIsOpen:o,onRecentSearchSelect:D,initialValues:a}):n.trim()?f.a.createElement(Eu,null,f.a.createElement(v.TranslatableText,{stringId:"No matching results",module:v.TRANSLATION_MODULES.SearchAndBook})):null:null},$t=["fetchOptions","renderedOptions","recentSearches","hasError","mode","dataTestId","value","debounceTimeout","activeLocationMode","defaultLocation","onChange"],Gt=function(u){var t=u.fetchOptions,e=u.renderedOptions,n=u.recentSearches,o=void 0===n?[]:n,D=u.hasError,a=u.mode,i=u.dataTestId,c=u.value,s=u.debounceTimeout,F=void 0===s?800:s,E=u.activeLocationMode,v=u.defaultLocation,B=u.onChange,h=C(u,$t),y=d(Object(A.useState)([]),2),g=y[0],b=y[1],w=d(Object(A.useState)(!1),2),x=w[0],S=w[1],O=d(Object(A.useState)(""),2),k=O[0],L=O[1],j=Object(A.useRef)(0),P=d(Object(A.useState)(!1),2),I=P[0],M=P[1],z=Object(A.useRef)();Object(A.useEffect)((function(){c&&0!==c.length||I||(b([]),L(""))}),[c,I]),Object(A.useEffect)((function(){return""!==E&&b((function(u){return u.filter((function(u){return u.label===_[E].label}))})),M(!1),z.current&&clearTimeout(z.current),z.current=setTimeout((function(){document.activeElement.blur(),document.body.click();var u=document.querySelector(".ant-select-focused");u&&u.classList.remove("ant-select-focused")}),100),function(){z.current&&clearTimeout(z.current)}}),[E]);var R=Object(A.useMemo)((function(){var u=function(){var u=l(r.a.mark((function u(e){var n,o,D;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return L(e),j.current+=1,n=j.current,b([]),S(!0),o=null,u.prev=6,u.next=9,t(e);case 9:D=u.sent,n===j.current&&(b(D),o=D),u.next=17;break;case 13:u.prev=13,u.t0=u.catch(6),console.error("Error fetching options:",u.t0),n===j.current&&p.Notification.danger({message:"Search failed",description:"Unable to fetch location results. Please try again later."});case 17:if(u.prev=17,n!==j.current){u.next=21;break}return S(!1),u.abrupt("return",o);case 21:return u.finish(17);case 22:case"end":return u.stop()}}),u,null,[[6,13,17,22]])})));return function(t){return u.apply(this,arguments)}}();return Object(m.debounce)(u,F)}),[t,F]);Object(A.useEffect)((function(){(null===v||void 0===v?void 0:v.code)&&function(){var u=l(r.a.mark((function u(){var e,n,o,D;return r.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,b([]),S(!0),u.next=5,t(v.code);case 5:if(e=u.sent,b(e),e&&0!==e.length){u.next=9;break}return u.abrupt("return");case 9:n=null,v.type&&(null===(o=e.find((function(u){var t;return u.label.toLowerCase()===(null===(t=_[v.type])||void 0===t?void 0:t.label.toLowerCase())})))||void 0===o?void 0:o.options)&&(n=o.options.find((function(u){return u.code.toLowerCase()===v.code.toLowerCase()||u.selectedValue.toLowerCase()===v.code.toLowerCase()}))),n||(n=e.map((function(u){return u.options})).flat().find((function(u){return u.code.toLowerCase()===v.code.toLowerCase()||u.selectedValue.toLowerCase()===v.code.toLowerCase()}))),n&&B&&(D=rt(n),B([D])),u.next=18;break;case 15:u.prev=15,u.t0=u.catch(0),Ou.isLocal()&&console.error("Error loading default location:",u.t0);case 18:return u.prev=18,S(!1),u.finish(18);case 21:case"end":return u.stop()}}),u,null,[[0,15,18,21]])})));return function(){return u.apply(this,arguments)}}()()}),[null===v||void 0===v?void 0:v.code,null===v||void 0===v?void 0:v.type]);var N=x||k.trim()||(null===o||void 0===o?void 0:o.length)>0,U=I&&N?2:3;return f.a.createElement(f.a.Fragment,null,f.a.createElement(lu,null),f.a.createElement(su,Object.assign({maxTagCount:U,onSearch:R,$hasError:D,loading:x,options:g,filterOption:!1,notFoundContent:f.a.createElement(Vt,{isLoading:x,recentSearches:o,searchKey:k,dataTestId:i,setIsOpen:M,onRecentSearchSelect:h.onRecentSearchSelect,initialValues:h.initialValues}),mode:a,"data-test-id":"".concat(i,"-selector"),allowClear:a===T,labelInValue:!0,optionLabelProp:"label",showSearch:!0,onDropdownVisibleChange:function(u){M(u),b([]),L("")},open:I&&(x||k.trim()||(null===o||void 0===o?void 0:o.length)>0),value:c,onChange:B},h),e(g)))},Wt=function(u){var t=u.omittedPorts,e=u.dataTestId,n=t.map((function(u){var t;return null===(t=JSON.parse(u.key))||void 0===t?void 0:t.selectedValue}));return f.a.createElement(p.Tooltip,{title:n.join(",")},f.a.createElement(Fu,{"data-test-id":"".concat(e,"-extra-ports")},"+".concat(t.length)))},Xt=["value","onChange","hasError","dataTestId","isOriginLocation","maxPorts","supportedLocationModes","customer","defaultLocation","autofillLocationAddress","autofillLocationCode","userCountryCode","resultsLimit","hideEmptyGroups"];t.default=function(u){var t=u.value,e=u.onChange,n=u.hasError,o=u.dataTestId,D=void 0===o?"location-input":o,a=u.isOriginLocation,c=void 0===a||a,s=u.maxPorts,F=void 0===s?1:s,E=u.supportedLocationModes,m=u.customer,B=u.defaultLocation,h=u.autofillLocationAddress,y=u.autofillLocationCode,w=u.userCountryCode,x=u.resultsLimit,S=u.hideEmptyGroups,O=void 0!==S&&S,k=C(u,Xt),L=d(Object(A.useState)(t),2),M=L[0],R=L[1],N=d(Object(A.useState)(1===E.length?E[0]:""),2),V=N[0],$=N[1],G=d(Object(A.useState)(Wu(V)||""===V?T:j),2),W=G[0],X=G[1],q=Object(A.useRef)(t),K=Object(A.useRef)(null);Object(A.useEffect)((function(){Wu(V)?X(T):X(j)}),[V]),Object(A.useEffect)((function(){R(t),q.current=t,Array.isArray(t)&&t.length>0?$($u(t[0].type,E)):(null===B||void 0===B?void 0:B.type)?$($u(B.type,E)):$("")}),[t,null===B||void 0===B?void 0:B.type]);var J=Object(A.useRef)({onChange:e,selectionMode:W,maxPorts:F});return Object(A.useEffect)((function(){J.current={onChange:e,selectionMode:W,maxPorts:F}}),[e,W,F]),Object(A.useEffect)((function(){var u="".concat(h||"","::").concat(y||"");if((h||y)&&u!==K.current){var t=q.current,e=J.current,n=e.selectionMode,o=e.maxPorts,D=n===j&&"number"===typeof o&&o>1&&Array.isArray(t)&&t.length<o;if(!function(u){return!!u&&(Array.isArray(u)?u.length>0:Object.keys(u).length>0)}(t)||D)(function(){var t=l(r.a.mark((function t(){var e,n,o,D,a,c,l,s,F,d,C;return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,at({autofillLocationAddress:h,autofillLocationCode:y,supportedLocationModes:E,customer:m,userCountryCode:w});case 3:if(e=t.sent){t.next=6;break}return t.abrupt("return");case 6:if(n=J.current,o=n.onChange,D=n.selectionMode,a=n.maxPorts,c=q.current,!(D===j&&"number"===typeof a&&a>1&&Array.isArray(c))){t.next=19;break}if(l=_u(e),s=new Set((c||[]).map((function(u){return Lu((null===u||void 0===u?void 0:u.code)||(null===u||void 0===u?void 0:u.selectedValue))}))),l&&!s.has(l)){t.next=13;break}return t.abrupt("return");case 13:F=Iu(c)||[],d=Array.isArray(F)?F.filter(Boolean):[],C=[].concat(i(d),[e]).slice(0,a),Uu(C,D,a,R,o),t.next=20;break;case 19:Uu(D===j?[e]:e,D,a,R,o);case 20:K.current=u,t.next=26;break;case 23:t.prev=23,t.t0=t.catch(0),console.error("Error performing autofill:",t.t0);case 26:case"end":return t.stop()}}),t,null,[[0,23]])})));return function(){return t.apply(this,arguments)}})()()}}),[h,y,E,m,w]),f.a.createElement(Gt,Object.assign({mode:W,dataTestId:D,hasError:n,placeholder:f.a.createElement(v.TranslatableText,{style:{fontSize:p.tokens.fdsFontSizeBase},stringId:"Select ".concat(c?P:I)}),value:Iu(M),fetchOptions:Ru(V,E,m,x),renderedOptions:function(u){return function(u,t){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((u||[]).some((function(u){var t;return(null===u||void 0===u||null===(t=u.options)||void 0===t?void 0:t.length)>0}))){var n=e?u.filter((function(u){var t;return(null===u||void 0===u||null===(t=u.options)||void 0===t?void 0:t.length)>0})):u;return n.map((function(u){var e,n=Object.values(_).find((function(t){return t.label===u.label})),r=null===n||void 0===n?void 0:n.icon;return f.a.createElement(p.Select.OptGroup,{label:f.a.createElement("span",{style:{fontFamily:"Open Sans"}},f.a.createElement(p.Icon,{size:"tiny",type:r}),"\xa0 \xa0",u.label),key:u.label,"data-test-id":"".concat(t,"-group-").concat(u.label)},null===(e=u.options)||void 0===e?void 0:e.map((function(e){var n=e.countryCode,o=e.selectedValue,D=e.type;return f.a.createElement(p.Option,{value:Pu(e),title:o,"data-test-id":"".concat(t,"-").concat(u.label,"-").concat(o),style:{paddingLeft:"8px"},label:f.a.createElement(f.a.Fragment,null,f.a.createElement(p.Icon,{type:r,size:"tiny"}),"\xa0",f.a.createElement(Fu,null,o)),key:e.code},f.a.createElement(Du,{fullWidth:!0,justifyContent:"space-between"},f.a.createElement(Du,{spacing:U.XSMALL},f.a.createElement("span",null,f.a.createElement(p.Avatar,{type:"flag",country:n,size:"small",style:{width:p.tokens.fdsSizeSm,height:p.tokens.fdsSizeSm}})),f.a.createElement(du,null,Mu(e))),D===g&&f.a.createElement(p.Icon,{type:"amazon",size:"small"}),D===b&&f.a.createElement(p.Chip,{type:"neutral",iconType:"address-book"})))})))}))}}(u,D,O)},onChange:function(u){var t=null!==u&&void 0!==u?u:[],n=W===j&&Array.isArray(t)&&t.length>0?function(u,t){var e,n=new Map,r=z(Array.isArray(t)?t:[]);try{for(r.s();!(e=r.n()).done;){var o,D=e.value,a=Vu(D);a&&n.set(a,(null!==(o=n.get(a))&&void 0!==o?o:0)+1)}}catch(h){r.e(h)}finally{r.f()}var i,c=new Map,l=z(u);try{for(l.s();!(i=l.n()).done;){var s,F=i.value,C=Vu(F);C&&c.set(C,(null!==(s=c.get(C))&&void 0!==s?s:0)+1)}}catch(h){l.e(h)}finally{l.f()}var E,A=z(c);try{for(A.s();!(E=A.n()).done;){var f,p=d(E.value,2),v=p[0],m=p[1],B=null!==(f=n.get(v))&&void 0!==f?f:0;if(m>B&&B>0)return v}}catch(h){A.e(h)}finally{A.f()}return null}(t,M):null;null!==n?function(u,t,e,n){var r=(Array.isArray(t)?t:[]).filter((function(t){return Vu(t)!==u}));e(r),Nu(r,n)}(n,M,R,e):Uu(t,W,F,R,e),$("")},activeLocationMode:V,maxTagPlaceholder:function(u){return f.a.createElement(Wt,{omittedPorts:u,dataTestId:D})},defaultLocation:B},k))}}])}));
|
|
2
2
|
//# sourceMappingURL=main.bundle.js.map
|