chunk-SMXOUF54.js 202 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537
  1. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/ParseError.js
  2. function _typeof(obj) {
  3. "@babel/helpers - typeof";
  4. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
  5. return typeof obj2;
  6. } : function(obj2) {
  7. return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
  8. }, _typeof(obj);
  9. }
  10. function _defineProperties(target, props) {
  11. for (var i = 0; i < props.length; i++) {
  12. var descriptor = props[i];
  13. descriptor.enumerable = descriptor.enumerable || false;
  14. descriptor.configurable = true;
  15. if ("value" in descriptor)
  16. descriptor.writable = true;
  17. Object.defineProperty(target, descriptor.key, descriptor);
  18. }
  19. }
  20. function _createClass(Constructor, protoProps, staticProps) {
  21. if (protoProps)
  22. _defineProperties(Constructor.prototype, protoProps);
  23. if (staticProps)
  24. _defineProperties(Constructor, staticProps);
  25. Object.defineProperty(Constructor, "prototype", { writable: false });
  26. return Constructor;
  27. }
  28. function _classCallCheck(instance, Constructor) {
  29. if (!(instance instanceof Constructor)) {
  30. throw new TypeError("Cannot call a class as a function");
  31. }
  32. }
  33. function _inherits(subClass, superClass) {
  34. if (typeof superClass !== "function" && superClass !== null) {
  35. throw new TypeError("Super expression must either be null or a function");
  36. }
  37. subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  38. Object.defineProperty(subClass, "prototype", { writable: false });
  39. if (superClass)
  40. _setPrototypeOf(subClass, superClass);
  41. }
  42. function _createSuper(Derived) {
  43. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  44. return function _createSuperInternal() {
  45. var Super = _getPrototypeOf(Derived), result2;
  46. if (hasNativeReflectConstruct) {
  47. var NewTarget = _getPrototypeOf(this).constructor;
  48. result2 = Reflect.construct(Super, arguments, NewTarget);
  49. } else {
  50. result2 = Super.apply(this, arguments);
  51. }
  52. return _possibleConstructorReturn(this, result2);
  53. };
  54. }
  55. function _possibleConstructorReturn(self, call) {
  56. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  57. return call;
  58. } else if (call !== void 0) {
  59. throw new TypeError("Derived constructors may only return object or undefined");
  60. }
  61. return _assertThisInitialized(self);
  62. }
  63. function _assertThisInitialized(self) {
  64. if (self === void 0) {
  65. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  66. }
  67. return self;
  68. }
  69. function _wrapNativeSuper(Class) {
  70. var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
  71. _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
  72. if (Class2 === null || !_isNativeFunction(Class2))
  73. return Class2;
  74. if (typeof Class2 !== "function") {
  75. throw new TypeError("Super expression must either be null or a function");
  76. }
  77. if (typeof _cache !== "undefined") {
  78. if (_cache.has(Class2))
  79. return _cache.get(Class2);
  80. _cache.set(Class2, Wrapper);
  81. }
  82. function Wrapper() {
  83. return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
  84. }
  85. Wrapper.prototype = Object.create(Class2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });
  86. return _setPrototypeOf(Wrapper, Class2);
  87. };
  88. return _wrapNativeSuper(Class);
  89. }
  90. function _construct(Parent, args, Class) {
  91. if (_isNativeReflectConstruct()) {
  92. _construct = Reflect.construct;
  93. } else {
  94. _construct = function _construct2(Parent2, args2, Class2) {
  95. var a = [null];
  96. a.push.apply(a, args2);
  97. var Constructor = Function.bind.apply(Parent2, a);
  98. var instance = new Constructor();
  99. if (Class2)
  100. _setPrototypeOf(instance, Class2.prototype);
  101. return instance;
  102. };
  103. }
  104. return _construct.apply(null, arguments);
  105. }
  106. function _isNativeReflectConstruct() {
  107. if (typeof Reflect === "undefined" || !Reflect.construct)
  108. return false;
  109. if (Reflect.construct.sham)
  110. return false;
  111. if (typeof Proxy === "function")
  112. return true;
  113. try {
  114. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
  115. }));
  116. return true;
  117. } catch (e) {
  118. return false;
  119. }
  120. }
  121. function _isNativeFunction(fn) {
  122. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  123. }
  124. function _setPrototypeOf(o, p) {
  125. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
  126. o2.__proto__ = p2;
  127. return o2;
  128. };
  129. return _setPrototypeOf(o, p);
  130. }
  131. function _getPrototypeOf(o) {
  132. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
  133. return o2.__proto__ || Object.getPrototypeOf(o2);
  134. };
  135. return _getPrototypeOf(o);
  136. }
  137. var ParseError = function(_Error) {
  138. _inherits(ParseError2, _Error);
  139. var _super = _createSuper(ParseError2);
  140. function ParseError2(code) {
  141. var _this;
  142. _classCallCheck(this, ParseError2);
  143. _this = _super.call(this, code);
  144. Object.setPrototypeOf(_assertThisInitialized(_this), ParseError2.prototype);
  145. _this.name = _this.constructor.name;
  146. return _this;
  147. }
  148. return _createClass(ParseError2);
  149. }(_wrapNativeSuper(Error));
  150. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/tools/semver-compare.js
  151. function semver_compare_default(a, b) {
  152. a = a.split("-");
  153. b = b.split("-");
  154. var pa = a[0].split(".");
  155. var pb = b[0].split(".");
  156. for (var i = 0; i < 3; i++) {
  157. var na = Number(pa[i]);
  158. var nb = Number(pb[i]);
  159. if (na > nb)
  160. return 1;
  161. if (nb > na)
  162. return -1;
  163. if (!isNaN(na) && isNaN(nb))
  164. return 1;
  165. if (isNaN(na) && !isNaN(nb))
  166. return -1;
  167. }
  168. if (a[1] && b[1]) {
  169. return a[1] > b[1] ? 1 : a[1] < b[1] ? -1 : 0;
  170. }
  171. return !a[1] && b[1] ? 1 : a[1] && !b[1] ? -1 : 0;
  172. }
  173. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/isObject.js
  174. var objectConstructor = {}.constructor;
  175. function isObject(object) {
  176. return object !== void 0 && object !== null && object.constructor === objectConstructor;
  177. }
  178. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/metadata.js
  179. function _typeof2(obj) {
  180. "@babel/helpers - typeof";
  181. return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
  182. return typeof obj2;
  183. } : function(obj2) {
  184. return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
  185. }, _typeof2(obj);
  186. }
  187. function _classCallCheck2(instance, Constructor) {
  188. if (!(instance instanceof Constructor)) {
  189. throw new TypeError("Cannot call a class as a function");
  190. }
  191. }
  192. function _defineProperties2(target, props) {
  193. for (var i = 0; i < props.length; i++) {
  194. var descriptor = props[i];
  195. descriptor.enumerable = descriptor.enumerable || false;
  196. descriptor.configurable = true;
  197. if ("value" in descriptor)
  198. descriptor.writable = true;
  199. Object.defineProperty(target, descriptor.key, descriptor);
  200. }
  201. }
  202. function _createClass2(Constructor, protoProps, staticProps) {
  203. if (protoProps)
  204. _defineProperties2(Constructor.prototype, protoProps);
  205. if (staticProps)
  206. _defineProperties2(Constructor, staticProps);
  207. Object.defineProperty(Constructor, "prototype", { writable: false });
  208. return Constructor;
  209. }
  210. var V3 = "1.2.0";
  211. var V4 = "1.7.35";
  212. var DEFAULT_EXT_PREFIX = " ext. ";
  213. var CALLING_CODE_REG_EXP = /^\d+$/;
  214. var Metadata = function() {
  215. function Metadata2(metadata) {
  216. _classCallCheck2(this, Metadata2);
  217. validateMetadata(metadata);
  218. this.metadata = metadata;
  219. setVersion.call(this, metadata);
  220. }
  221. _createClass2(Metadata2, [{
  222. key: "getCountries",
  223. value: function getCountries2() {
  224. return Object.keys(this.metadata.countries).filter(function(_) {
  225. return _ !== "001";
  226. });
  227. }
  228. }, {
  229. key: "getCountryMetadata",
  230. value: function getCountryMetadata(countryCode) {
  231. return this.metadata.countries[countryCode];
  232. }
  233. }, {
  234. key: "nonGeographic",
  235. value: function nonGeographic() {
  236. if (this.v1 || this.v2 || this.v3)
  237. return;
  238. return this.metadata.nonGeographic || this.metadata.nonGeographical;
  239. }
  240. }, {
  241. key: "hasCountry",
  242. value: function hasCountry(country2) {
  243. return this.getCountryMetadata(country2) !== void 0;
  244. }
  245. }, {
  246. key: "hasCallingCode",
  247. value: function hasCallingCode(callingCode) {
  248. if (this.getCountryCodesForCallingCode(callingCode)) {
  249. return true;
  250. }
  251. if (this.nonGeographic()) {
  252. if (this.nonGeographic()[callingCode]) {
  253. return true;
  254. }
  255. } else {
  256. var countryCodes = this.countryCallingCodes()[callingCode];
  257. if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
  258. return true;
  259. }
  260. }
  261. }
  262. }, {
  263. key: "isNonGeographicCallingCode",
  264. value: function isNonGeographicCallingCode(callingCode) {
  265. if (this.nonGeographic()) {
  266. return this.nonGeographic()[callingCode] ? true : false;
  267. } else {
  268. return this.getCountryCodesForCallingCode(callingCode) ? false : true;
  269. }
  270. }
  271. // Deprecated.
  272. }, {
  273. key: "country",
  274. value: function country2(countryCode) {
  275. return this.selectNumberingPlan(countryCode);
  276. }
  277. }, {
  278. key: "selectNumberingPlan",
  279. value: function selectNumberingPlan(countryCode, callingCode) {
  280. if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {
  281. callingCode = countryCode;
  282. countryCode = null;
  283. }
  284. if (countryCode && countryCode !== "001") {
  285. if (!this.hasCountry(countryCode)) {
  286. throw new Error("Unknown country: ".concat(countryCode));
  287. }
  288. this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);
  289. } else if (callingCode) {
  290. if (!this.hasCallingCode(callingCode)) {
  291. throw new Error("Unknown calling code: ".concat(callingCode));
  292. }
  293. this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);
  294. } else {
  295. this.numberingPlan = void 0;
  296. }
  297. return this;
  298. }
  299. }, {
  300. key: "getCountryCodesForCallingCode",
  301. value: function getCountryCodesForCallingCode(callingCode) {
  302. var countryCodes = this.countryCallingCodes()[callingCode];
  303. if (countryCodes) {
  304. if (countryCodes.length === 1 && countryCodes[0].length === 3) {
  305. return;
  306. }
  307. return countryCodes;
  308. }
  309. }
  310. }, {
  311. key: "getCountryCodeForCallingCode",
  312. value: function getCountryCodeForCallingCode(callingCode) {
  313. var countryCodes = this.getCountryCodesForCallingCode(callingCode);
  314. if (countryCodes) {
  315. return countryCodes[0];
  316. }
  317. }
  318. }, {
  319. key: "getNumberingPlanMetadata",
  320. value: function getNumberingPlanMetadata(callingCode) {
  321. var countryCode = this.getCountryCodeForCallingCode(callingCode);
  322. if (countryCode) {
  323. return this.getCountryMetadata(countryCode);
  324. }
  325. if (this.nonGeographic()) {
  326. var metadata = this.nonGeographic()[callingCode];
  327. if (metadata) {
  328. return metadata;
  329. }
  330. } else {
  331. var countryCodes = this.countryCallingCodes()[callingCode];
  332. if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
  333. return this.metadata.countries["001"];
  334. }
  335. }
  336. }
  337. // Deprecated.
  338. }, {
  339. key: "countryCallingCode",
  340. value: function countryCallingCode() {
  341. return this.numberingPlan.callingCode();
  342. }
  343. // Deprecated.
  344. }, {
  345. key: "IDDPrefix",
  346. value: function IDDPrefix() {
  347. return this.numberingPlan.IDDPrefix();
  348. }
  349. // Deprecated.
  350. }, {
  351. key: "defaultIDDPrefix",
  352. value: function defaultIDDPrefix() {
  353. return this.numberingPlan.defaultIDDPrefix();
  354. }
  355. // Deprecated.
  356. }, {
  357. key: "nationalNumberPattern",
  358. value: function nationalNumberPattern() {
  359. return this.numberingPlan.nationalNumberPattern();
  360. }
  361. // Deprecated.
  362. }, {
  363. key: "possibleLengths",
  364. value: function possibleLengths() {
  365. return this.numberingPlan.possibleLengths();
  366. }
  367. // Deprecated.
  368. }, {
  369. key: "formats",
  370. value: function formats() {
  371. return this.numberingPlan.formats();
  372. }
  373. // Deprecated.
  374. }, {
  375. key: "nationalPrefixForParsing",
  376. value: function nationalPrefixForParsing() {
  377. return this.numberingPlan.nationalPrefixForParsing();
  378. }
  379. // Deprecated.
  380. }, {
  381. key: "nationalPrefixTransformRule",
  382. value: function nationalPrefixTransformRule() {
  383. return this.numberingPlan.nationalPrefixTransformRule();
  384. }
  385. // Deprecated.
  386. }, {
  387. key: "leadingDigits",
  388. value: function leadingDigits() {
  389. return this.numberingPlan.leadingDigits();
  390. }
  391. // Deprecated.
  392. }, {
  393. key: "hasTypes",
  394. value: function hasTypes() {
  395. return this.numberingPlan.hasTypes();
  396. }
  397. // Deprecated.
  398. }, {
  399. key: "type",
  400. value: function type(_type) {
  401. return this.numberingPlan.type(_type);
  402. }
  403. // Deprecated.
  404. }, {
  405. key: "ext",
  406. value: function ext() {
  407. return this.numberingPlan.ext();
  408. }
  409. }, {
  410. key: "countryCallingCodes",
  411. value: function countryCallingCodes() {
  412. if (this.v1)
  413. return this.metadata.country_phone_code_to_countries;
  414. return this.metadata.country_calling_codes;
  415. }
  416. // Deprecated.
  417. }, {
  418. key: "chooseCountryByCountryCallingCode",
  419. value: function chooseCountryByCountryCallingCode(callingCode) {
  420. return this.selectNumberingPlan(callingCode);
  421. }
  422. }, {
  423. key: "hasSelectedNumberingPlan",
  424. value: function hasSelectedNumberingPlan() {
  425. return this.numberingPlan !== void 0;
  426. }
  427. }]);
  428. return Metadata2;
  429. }();
  430. var NumberingPlan = function() {
  431. function NumberingPlan2(metadata, globalMetadataObject) {
  432. _classCallCheck2(this, NumberingPlan2);
  433. this.globalMetadataObject = globalMetadataObject;
  434. this.metadata = metadata;
  435. setVersion.call(this, globalMetadataObject.metadata);
  436. }
  437. _createClass2(NumberingPlan2, [{
  438. key: "callingCode",
  439. value: function callingCode() {
  440. return this.metadata[0];
  441. }
  442. // Formatting information for regions which share
  443. // a country calling code is contained by only one region
  444. // for performance reasons. For example, for NANPA region
  445. // ("North American Numbering Plan Administration",
  446. // which includes USA, Canada, Cayman Islands, Bahamas, etc)
  447. // it will be contained in the metadata for `US`.
  448. }, {
  449. key: "getDefaultCountryMetadataForRegion",
  450. value: function getDefaultCountryMetadataForRegion() {
  451. return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
  452. }
  453. // Is always present.
  454. }, {
  455. key: "IDDPrefix",
  456. value: function IDDPrefix() {
  457. if (this.v1 || this.v2)
  458. return;
  459. return this.metadata[1];
  460. }
  461. // Is only present when a country supports multiple IDD prefixes.
  462. }, {
  463. key: "defaultIDDPrefix",
  464. value: function defaultIDDPrefix() {
  465. if (this.v1 || this.v2)
  466. return;
  467. return this.metadata[12];
  468. }
  469. }, {
  470. key: "nationalNumberPattern",
  471. value: function nationalNumberPattern() {
  472. if (this.v1 || this.v2)
  473. return this.metadata[1];
  474. return this.metadata[2];
  475. }
  476. // "possible length" data is always present in Google's metadata.
  477. }, {
  478. key: "possibleLengths",
  479. value: function possibleLengths() {
  480. if (this.v1)
  481. return;
  482. return this.metadata[this.v2 ? 2 : 3];
  483. }
  484. }, {
  485. key: "_getFormats",
  486. value: function _getFormats(metadata) {
  487. return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];
  488. }
  489. // For countries of the same region (e.g. NANPA)
  490. // formats are all stored in the "main" country for that region.
  491. // E.g. "RU" and "KZ", "US" and "CA".
  492. }, {
  493. key: "formats",
  494. value: function formats() {
  495. var _this = this;
  496. var formats2 = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];
  497. return formats2.map(function(_) {
  498. return new Format(_, _this);
  499. });
  500. }
  501. }, {
  502. key: "nationalPrefix",
  503. value: function nationalPrefix() {
  504. return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
  505. }
  506. }, {
  507. key: "_getNationalPrefixFormattingRule",
  508. value: function _getNationalPrefixFormattingRule(metadata) {
  509. return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];
  510. }
  511. // For countries of the same region (e.g. NANPA)
  512. // national prefix formatting rule is stored in the "main" country for that region.
  513. // E.g. "RU" and "KZ", "US" and "CA".
  514. }, {
  515. key: "nationalPrefixFormattingRule",
  516. value: function nationalPrefixFormattingRule() {
  517. return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());
  518. }
  519. }, {
  520. key: "_nationalPrefixForParsing",
  521. value: function _nationalPrefixForParsing() {
  522. return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
  523. }
  524. }, {
  525. key: "nationalPrefixForParsing",
  526. value: function nationalPrefixForParsing() {
  527. return this._nationalPrefixForParsing() || this.nationalPrefix();
  528. }
  529. }, {
  530. key: "nationalPrefixTransformRule",
  531. value: function nationalPrefixTransformRule() {
  532. return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
  533. }
  534. }, {
  535. key: "_getNationalPrefixIsOptionalWhenFormatting",
  536. value: function _getNationalPrefixIsOptionalWhenFormatting() {
  537. return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
  538. }
  539. // For countries of the same region (e.g. NANPA)
  540. // "national prefix is optional when formatting" flag is
  541. // stored in the "main" country for that region.
  542. // E.g. "RU" and "KZ", "US" and "CA".
  543. }, {
  544. key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
  545. value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
  546. return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());
  547. }
  548. }, {
  549. key: "leadingDigits",
  550. value: function leadingDigits() {
  551. return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
  552. }
  553. }, {
  554. key: "types",
  555. value: function types() {
  556. return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
  557. }
  558. }, {
  559. key: "hasTypes",
  560. value: function hasTypes() {
  561. if (this.types() && this.types().length === 0) {
  562. return false;
  563. }
  564. return !!this.types();
  565. }
  566. }, {
  567. key: "type",
  568. value: function type(_type2) {
  569. if (this.hasTypes() && getType(this.types(), _type2)) {
  570. return new Type(getType(this.types(), _type2), this);
  571. }
  572. }
  573. }, {
  574. key: "ext",
  575. value: function ext() {
  576. if (this.v1 || this.v2)
  577. return DEFAULT_EXT_PREFIX;
  578. return this.metadata[13] || DEFAULT_EXT_PREFIX;
  579. }
  580. }]);
  581. return NumberingPlan2;
  582. }();
  583. var Format = function() {
  584. function Format2(format, metadata) {
  585. _classCallCheck2(this, Format2);
  586. this._format = format;
  587. this.metadata = metadata;
  588. }
  589. _createClass2(Format2, [{
  590. key: "pattern",
  591. value: function pattern() {
  592. return this._format[0];
  593. }
  594. }, {
  595. key: "format",
  596. value: function format() {
  597. return this._format[1];
  598. }
  599. }, {
  600. key: "leadingDigitsPatterns",
  601. value: function leadingDigitsPatterns() {
  602. return this._format[2] || [];
  603. }
  604. }, {
  605. key: "nationalPrefixFormattingRule",
  606. value: function nationalPrefixFormattingRule() {
  607. return this._format[3] || this.metadata.nationalPrefixFormattingRule();
  608. }
  609. }, {
  610. key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
  611. value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
  612. return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
  613. }
  614. }, {
  615. key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
  616. value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {
  617. return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
  618. }
  619. // Checks whether national prefix formatting rule contains national prefix.
  620. }, {
  621. key: "usesNationalPrefix",
  622. value: function usesNationalPrefix() {
  623. return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one.
  624. !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) ? true : false;
  625. }
  626. }, {
  627. key: "internationalFormat",
  628. value: function internationalFormat() {
  629. return this._format[5] || this.format();
  630. }
  631. }]);
  632. return Format2;
  633. }();
  634. var FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/;
  635. var Type = function() {
  636. function Type2(type, metadata) {
  637. _classCallCheck2(this, Type2);
  638. this.type = type;
  639. this.metadata = metadata;
  640. }
  641. _createClass2(Type2, [{
  642. key: "pattern",
  643. value: function pattern() {
  644. if (this.metadata.v1)
  645. return this.type;
  646. return this.type[0];
  647. }
  648. }, {
  649. key: "possibleLengths",
  650. value: function possibleLengths() {
  651. if (this.metadata.v1)
  652. return;
  653. return this.type[1] || this.metadata.possibleLengths();
  654. }
  655. }]);
  656. return Type2;
  657. }();
  658. function getType(types, type) {
  659. switch (type) {
  660. case "FIXED_LINE":
  661. return types[0];
  662. case "MOBILE":
  663. return types[1];
  664. case "TOLL_FREE":
  665. return types[2];
  666. case "PREMIUM_RATE":
  667. return types[3];
  668. case "PERSONAL_NUMBER":
  669. return types[4];
  670. case "VOICEMAIL":
  671. return types[5];
  672. case "UAN":
  673. return types[6];
  674. case "PAGER":
  675. return types[7];
  676. case "VOIP":
  677. return types[8];
  678. case "SHARED_COST":
  679. return types[9];
  680. }
  681. }
  682. function validateMetadata(metadata) {
  683. if (!metadata) {
  684. throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
  685. }
  686. if (!isObject(metadata) || !isObject(metadata.countries)) {
  687. throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(isObject(metadata) ? "an object of shape: { " + Object.keys(metadata).join(", ") + " }" : "a " + typeOf(metadata) + ": " + metadata, "."));
  688. }
  689. }
  690. var typeOf = function typeOf2(_) {
  691. return _typeof2(_);
  692. };
  693. function getExtPrefix(country2, metadata) {
  694. metadata = new Metadata(metadata);
  695. if (metadata.hasCountry(country2)) {
  696. return metadata.country(country2).ext();
  697. }
  698. return DEFAULT_EXT_PREFIX;
  699. }
  700. function getCountryCallingCode(country2, metadata) {
  701. metadata = new Metadata(metadata);
  702. if (metadata.hasCountry(country2)) {
  703. return metadata.country(country2).countryCallingCode();
  704. }
  705. throw new Error("Unknown country: ".concat(country2));
  706. }
  707. function isSupportedCountry(country2, metadata) {
  708. return metadata.countries.hasOwnProperty(country2);
  709. }
  710. function setVersion(metadata) {
  711. var version = metadata.version;
  712. if (typeof version === "number") {
  713. this.v1 = version === 1;
  714. this.v2 = version === 2;
  715. this.v3 = version === 3;
  716. this.v4 = version === 4;
  717. } else {
  718. if (!version) {
  719. this.v1 = true;
  720. } else if (semver_compare_default(version, V3) === -1) {
  721. this.v2 = true;
  722. } else if (semver_compare_default(version, V4) === -1) {
  723. this.v3 = true;
  724. } else {
  725. this.v4 = true;
  726. }
  727. }
  728. }
  729. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/parseDigits.js
  730. function _createForOfIteratorHelperLoose(o, allowArrayLike) {
  731. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  732. if (it)
  733. return (it = it.call(o)).next.bind(it);
  734. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  735. if (it)
  736. o = it;
  737. var i = 0;
  738. return function() {
  739. if (i >= o.length)
  740. return { done: true };
  741. return { done: false, value: o[i++] };
  742. };
  743. }
  744. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  745. }
  746. function _unsupportedIterableToArray(o, minLen) {
  747. if (!o)
  748. return;
  749. if (typeof o === "string")
  750. return _arrayLikeToArray(o, minLen);
  751. var n = Object.prototype.toString.call(o).slice(8, -1);
  752. if (n === "Object" && o.constructor)
  753. n = o.constructor.name;
  754. if (n === "Map" || n === "Set")
  755. return Array.from(o);
  756. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  757. return _arrayLikeToArray(o, minLen);
  758. }
  759. function _arrayLikeToArray(arr, len) {
  760. if (len == null || len > arr.length)
  761. len = arr.length;
  762. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  763. arr2[i] = arr[i];
  764. }
  765. return arr2;
  766. }
  767. var DIGITS = {
  768. "0": "0",
  769. "1": "1",
  770. "2": "2",
  771. "3": "3",
  772. "4": "4",
  773. "5": "5",
  774. "6": "6",
  775. "7": "7",
  776. "8": "8",
  777. "9": "9",
  778. "0": "0",
  779. // Fullwidth digit 0
  780. "1": "1",
  781. // Fullwidth digit 1
  782. "2": "2",
  783. // Fullwidth digit 2
  784. "3": "3",
  785. // Fullwidth digit 3
  786. "4": "4",
  787. // Fullwidth digit 4
  788. "5": "5",
  789. // Fullwidth digit 5
  790. "6": "6",
  791. // Fullwidth digit 6
  792. "7": "7",
  793. // Fullwidth digit 7
  794. "8": "8",
  795. // Fullwidth digit 8
  796. "9": "9",
  797. // Fullwidth digit 9
  798. "٠": "0",
  799. // Arabic-indic digit 0
  800. "١": "1",
  801. // Arabic-indic digit 1
  802. "٢": "2",
  803. // Arabic-indic digit 2
  804. "٣": "3",
  805. // Arabic-indic digit 3
  806. "٤": "4",
  807. // Arabic-indic digit 4
  808. "٥": "5",
  809. // Arabic-indic digit 5
  810. "٦": "6",
  811. // Arabic-indic digit 6
  812. "٧": "7",
  813. // Arabic-indic digit 7
  814. "٨": "8",
  815. // Arabic-indic digit 8
  816. "٩": "9",
  817. // Arabic-indic digit 9
  818. "۰": "0",
  819. // Eastern-Arabic digit 0
  820. "۱": "1",
  821. // Eastern-Arabic digit 1
  822. "۲": "2",
  823. // Eastern-Arabic digit 2
  824. "۳": "3",
  825. // Eastern-Arabic digit 3
  826. "۴": "4",
  827. // Eastern-Arabic digit 4
  828. "۵": "5",
  829. // Eastern-Arabic digit 5
  830. "۶": "6",
  831. // Eastern-Arabic digit 6
  832. "۷": "7",
  833. // Eastern-Arabic digit 7
  834. "۸": "8",
  835. // Eastern-Arabic digit 8
  836. "۹": "9"
  837. // Eastern-Arabic digit 9
  838. };
  839. function parseDigit(character) {
  840. return DIGITS[character];
  841. }
  842. function parseDigits(string) {
  843. var result2 = "";
  844. for (var _iterator = _createForOfIteratorHelperLoose(string.split("")), _step; !(_step = _iterator()).done; ) {
  845. var character = _step.value;
  846. var digit = parseDigit(character);
  847. if (digit) {
  848. result2 += digit;
  849. }
  850. }
  851. return result2;
  852. }
  853. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js
  854. function _createForOfIteratorHelperLoose2(o, allowArrayLike) {
  855. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  856. if (it)
  857. return (it = it.call(o)).next.bind(it);
  858. if (Array.isArray(o) || (it = _unsupportedIterableToArray2(o)) || allowArrayLike && o && typeof o.length === "number") {
  859. if (it)
  860. o = it;
  861. var i = 0;
  862. return function() {
  863. if (i >= o.length)
  864. return { done: true };
  865. return { done: false, value: o[i++] };
  866. };
  867. }
  868. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  869. }
  870. function _unsupportedIterableToArray2(o, minLen) {
  871. if (!o)
  872. return;
  873. if (typeof o === "string")
  874. return _arrayLikeToArray2(o, minLen);
  875. var n = Object.prototype.toString.call(o).slice(8, -1);
  876. if (n === "Object" && o.constructor)
  877. n = o.constructor.name;
  878. if (n === "Map" || n === "Set")
  879. return Array.from(o);
  880. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  881. return _arrayLikeToArray2(o, minLen);
  882. }
  883. function _arrayLikeToArray2(arr, len) {
  884. if (len == null || len > arr.length)
  885. len = arr.length;
  886. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  887. arr2[i] = arr[i];
  888. }
  889. return arr2;
  890. }
  891. function parseIncompletePhoneNumber(string) {
  892. var result2 = "";
  893. for (var _iterator = _createForOfIteratorHelperLoose2(string.split("")), _step; !(_step = _iterator()).done; ) {
  894. var character = _step.value;
  895. result2 += parsePhoneNumberCharacter(character, result2) || "";
  896. }
  897. return result2;
  898. }
  899. function parsePhoneNumberCharacter(character, prevParsedCharacters, emitEvent) {
  900. if (character === "+") {
  901. if (prevParsedCharacters) {
  902. if (typeof emitEvent === "function") {
  903. emitEvent("end");
  904. }
  905. return;
  906. }
  907. return "+";
  908. }
  909. return parseDigit(character);
  910. }
  911. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/constants.js
  912. var MIN_LENGTH_FOR_NSN = 2;
  913. var MAX_LENGTH_FOR_NSN = 17;
  914. var MAX_LENGTH_COUNTRY_CODE = 3;
  915. var VALID_DIGITS = "0-90-9٠-٩۰-۹";
  916. var DASHES = "-‐-―−ー-";
  917. var SLASHES = "//";
  918. var DOTS = "..";
  919. var WHITESPACE = "  ­​⁠ ";
  920. var BRACKETS = "()()[]\\[\\]";
  921. var TILDES = "~⁓∼~";
  922. var VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);
  923. var PLUS_CHARS = "++";
  924. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js
  925. var RFC3966_EXTN_PREFIX = ";ext=";
  926. var getExtensionDigitsPattern = function getExtensionDigitsPattern2(maxLength) {
  927. return "([".concat(VALID_DIGITS, "]{1,").concat(maxLength, "})");
  928. };
  929. function createExtensionPattern(purpose) {
  930. var extLimitAfterExplicitLabel = "20";
  931. var extLimitAfterLikelyLabel = "15";
  932. var extLimitAfterAmbiguousChar = "9";
  933. var extLimitWhenNotSure = "6";
  934. var possibleSeparatorsBetweenNumberAndExtLabel = "[  \\t,]*";
  935. var possibleCharsAfterExtLabel = "[:\\..]?[  \\t,-]*";
  936. var optionalExtnSuffix = "#?";
  937. var explicitExtLabels = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)";
  938. var ambiguousExtLabels = "(?:[xx##~~]|int|int)";
  939. var ambiguousSeparator = "[- ]+";
  940. var possibleSeparatorsNumberExtLabelNoComma = "[  \\t]*";
  941. var autoDiallingAndExtLabelsFound = "(?:,{2}|;)";
  942. var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);
  943. var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;
  944. var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
  945. var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#";
  946. var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;
  947. var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
  948. return rfcExtn + "|" + explicitExtn + "|" + ambiguousExtn + "|" + americanStyleExtnWithSuffix + "|" + autoDiallingExtn + "|" + onlyCommasExtn;
  949. }
  950. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js
  951. var MIN_LENGTH_PHONE_NUMBER_PATTERN = "[" + VALID_DIGITS + "]{" + MIN_LENGTH_FOR_NSN + "}";
  952. var VALID_PHONE_NUMBER = "[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){3,}[" + VALID_PUNCTUATION + VALID_DIGITS + "]*";
  953. var VALID_PHONE_NUMBER_START_REG_EXP = new RegExp("^[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){1,2}$", "i");
  954. var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions
  955. "(?:" + createExtensionPattern() + ")?";
  956. var VALID_PHONE_NUMBER_PATTERN = new RegExp(
  957. // Either a short two-digit-only phone number
  958. "^" + MIN_LENGTH_PHONE_NUMBER_PATTERN + "$|^" + VALID_PHONE_NUMBER_WITH_EXTENSION + "$",
  959. "i"
  960. );
  961. function isViablePhoneNumber(number) {
  962. return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);
  963. }
  964. function isViablePhoneNumberStart(number) {
  965. return VALID_PHONE_NUMBER_START_REG_EXP.test(number);
  966. }
  967. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/RFC3966.js
  968. function _slicedToArray(arr, i) {
  969. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray3(arr, i) || _nonIterableRest();
  970. }
  971. function _nonIterableRest() {
  972. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  973. }
  974. function _iterableToArrayLimit(arr, i) {
  975. var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
  976. if (_i == null)
  977. return;
  978. var _arr = [];
  979. var _n = true;
  980. var _d = false;
  981. var _s, _e;
  982. try {
  983. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  984. _arr.push(_s.value);
  985. if (i && _arr.length === i)
  986. break;
  987. }
  988. } catch (err) {
  989. _d = true;
  990. _e = err;
  991. } finally {
  992. try {
  993. if (!_n && _i["return"] != null)
  994. _i["return"]();
  995. } finally {
  996. if (_d)
  997. throw _e;
  998. }
  999. }
  1000. return _arr;
  1001. }
  1002. function _arrayWithHoles(arr) {
  1003. if (Array.isArray(arr))
  1004. return arr;
  1005. }
  1006. function _createForOfIteratorHelperLoose3(o, allowArrayLike) {
  1007. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  1008. if (it)
  1009. return (it = it.call(o)).next.bind(it);
  1010. if (Array.isArray(o) || (it = _unsupportedIterableToArray3(o)) || allowArrayLike && o && typeof o.length === "number") {
  1011. if (it)
  1012. o = it;
  1013. var i = 0;
  1014. return function() {
  1015. if (i >= o.length)
  1016. return { done: true };
  1017. return { done: false, value: o[i++] };
  1018. };
  1019. }
  1020. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  1021. }
  1022. function _unsupportedIterableToArray3(o, minLen) {
  1023. if (!o)
  1024. return;
  1025. if (typeof o === "string")
  1026. return _arrayLikeToArray3(o, minLen);
  1027. var n = Object.prototype.toString.call(o).slice(8, -1);
  1028. if (n === "Object" && o.constructor)
  1029. n = o.constructor.name;
  1030. if (n === "Map" || n === "Set")
  1031. return Array.from(o);
  1032. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  1033. return _arrayLikeToArray3(o, minLen);
  1034. }
  1035. function _arrayLikeToArray3(arr, len) {
  1036. if (len == null || len > arr.length)
  1037. len = arr.length;
  1038. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  1039. arr2[i] = arr[i];
  1040. }
  1041. return arr2;
  1042. }
  1043. function parseRFC3966(text) {
  1044. var number;
  1045. var ext;
  1046. text = text.replace(/^tel:/, "tel=");
  1047. for (var _iterator = _createForOfIteratorHelperLoose3(text.split(";")), _step; !(_step = _iterator()).done; ) {
  1048. var part = _step.value;
  1049. var _part$split = part.split("="), _part$split2 = _slicedToArray(_part$split, 2), name = _part$split2[0], value = _part$split2[1];
  1050. switch (name) {
  1051. case "tel":
  1052. number = value;
  1053. break;
  1054. case "ext":
  1055. ext = value;
  1056. break;
  1057. case "phone-context":
  1058. if (value[0] === "+") {
  1059. number = value + number;
  1060. }
  1061. break;
  1062. }
  1063. }
  1064. if (!isViablePhoneNumber(number)) {
  1065. return {};
  1066. }
  1067. var result2 = {
  1068. number
  1069. };
  1070. if (ext) {
  1071. result2.ext = ext;
  1072. }
  1073. return result2;
  1074. }
  1075. function formatRFC3966(_ref) {
  1076. var number = _ref.number, ext = _ref.ext;
  1077. if (!number) {
  1078. return "";
  1079. }
  1080. if (number[0] !== "+") {
  1081. throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');
  1082. }
  1083. return "tel:".concat(number).concat(ext ? ";ext=" + ext : "");
  1084. }
  1085. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js
  1086. function _createForOfIteratorHelperLoose4(o, allowArrayLike) {
  1087. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  1088. if (it)
  1089. return (it = it.call(o)).next.bind(it);
  1090. if (Array.isArray(o) || (it = _unsupportedIterableToArray4(o)) || allowArrayLike && o && typeof o.length === "number") {
  1091. if (it)
  1092. o = it;
  1093. var i = 0;
  1094. return function() {
  1095. if (i >= o.length)
  1096. return { done: true };
  1097. return { done: false, value: o[i++] };
  1098. };
  1099. }
  1100. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  1101. }
  1102. function _unsupportedIterableToArray4(o, minLen) {
  1103. if (!o)
  1104. return;
  1105. if (typeof o === "string")
  1106. return _arrayLikeToArray4(o, minLen);
  1107. var n = Object.prototype.toString.call(o).slice(8, -1);
  1108. if (n === "Object" && o.constructor)
  1109. n = o.constructor.name;
  1110. if (n === "Map" || n === "Set")
  1111. return Array.from(o);
  1112. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  1113. return _arrayLikeToArray4(o, minLen);
  1114. }
  1115. function _arrayLikeToArray4(arr, len) {
  1116. if (len == null || len > arr.length)
  1117. len = arr.length;
  1118. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  1119. arr2[i] = arr[i];
  1120. }
  1121. return arr2;
  1122. }
  1123. var DIGIT_PLACEHOLDER = "x";
  1124. var DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER);
  1125. function repeat(string, times) {
  1126. if (times < 1) {
  1127. return "";
  1128. }
  1129. var result2 = "";
  1130. while (times > 1) {
  1131. if (times & 1) {
  1132. result2 += string;
  1133. }
  1134. times >>= 1;
  1135. string += string;
  1136. }
  1137. return result2 + string;
  1138. }
  1139. function cutAndStripNonPairedParens(string, cutBeforeIndex) {
  1140. if (string[cutBeforeIndex] === ")") {
  1141. cutBeforeIndex++;
  1142. }
  1143. return stripNonPairedParens(string.slice(0, cutBeforeIndex));
  1144. }
  1145. function stripNonPairedParens(string) {
  1146. var dangling_braces = [];
  1147. var i = 0;
  1148. while (i < string.length) {
  1149. if (string[i] === "(") {
  1150. dangling_braces.push(i);
  1151. } else if (string[i] === ")") {
  1152. dangling_braces.pop();
  1153. }
  1154. i++;
  1155. }
  1156. var start = 0;
  1157. var cleared_string = "";
  1158. dangling_braces.push(string.length);
  1159. for (var _i = 0, _dangling_braces = dangling_braces; _i < _dangling_braces.length; _i++) {
  1160. var index = _dangling_braces[_i];
  1161. cleared_string += string.slice(start, index);
  1162. start = index + 1;
  1163. }
  1164. return cleared_string;
  1165. }
  1166. function populateTemplateWithDigits(template, position, digits) {
  1167. for (var _iterator2 = _createForOfIteratorHelperLoose4(digits.split("")), _step2; !(_step2 = _iterator2()).done; ) {
  1168. var digit = _step2.value;
  1169. if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {
  1170. return;
  1171. }
  1172. position = template.search(DIGIT_PLACEHOLDER_MATCHER);
  1173. template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);
  1174. }
  1175. return [template, position];
  1176. }
  1177. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/mergeArrays.js
  1178. function _createForOfIteratorHelperLoose5(o, allowArrayLike) {
  1179. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  1180. if (it)
  1181. return (it = it.call(o)).next.bind(it);
  1182. if (Array.isArray(o) || (it = _unsupportedIterableToArray5(o)) || allowArrayLike && o && typeof o.length === "number") {
  1183. if (it)
  1184. o = it;
  1185. var i = 0;
  1186. return function() {
  1187. if (i >= o.length)
  1188. return { done: true };
  1189. return { done: false, value: o[i++] };
  1190. };
  1191. }
  1192. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  1193. }
  1194. function _unsupportedIterableToArray5(o, minLen) {
  1195. if (!o)
  1196. return;
  1197. if (typeof o === "string")
  1198. return _arrayLikeToArray5(o, minLen);
  1199. var n = Object.prototype.toString.call(o).slice(8, -1);
  1200. if (n === "Object" && o.constructor)
  1201. n = o.constructor.name;
  1202. if (n === "Map" || n === "Set")
  1203. return Array.from(o);
  1204. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  1205. return _arrayLikeToArray5(o, minLen);
  1206. }
  1207. function _arrayLikeToArray5(arr, len) {
  1208. if (len == null || len > arr.length)
  1209. len = arr.length;
  1210. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  1211. arr2[i] = arr[i];
  1212. }
  1213. return arr2;
  1214. }
  1215. function mergeArrays(a, b) {
  1216. var merged = a.slice();
  1217. for (var _iterator = _createForOfIteratorHelperLoose5(b), _step; !(_step = _iterator()).done; ) {
  1218. var element = _step.value;
  1219. if (a.indexOf(element) < 0) {
  1220. merged.push(element);
  1221. }
  1222. }
  1223. return merged.sort(function(a2, b2) {
  1224. return a2 - b2;
  1225. });
  1226. }
  1227. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js
  1228. function checkNumberLength(nationalNumber, metadata) {
  1229. return checkNumberLengthForType(nationalNumber, void 0, metadata);
  1230. }
  1231. function checkNumberLengthForType(nationalNumber, type, metadata) {
  1232. var type_info = metadata.type(type);
  1233. var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths();
  1234. if (!possible_lengths) {
  1235. return "IS_POSSIBLE";
  1236. }
  1237. if (type === "FIXED_LINE_OR_MOBILE") {
  1238. if (!metadata.type("FIXED_LINE")) {
  1239. return checkNumberLengthForType(nationalNumber, "MOBILE", metadata);
  1240. }
  1241. var mobile_type = metadata.type("MOBILE");
  1242. if (mobile_type) {
  1243. possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths());
  1244. }
  1245. } else if (type && !type_info) {
  1246. return "INVALID_LENGTH";
  1247. }
  1248. var actual_length = nationalNumber.length;
  1249. var minimum_length = possible_lengths[0];
  1250. if (minimum_length === actual_length) {
  1251. return "IS_POSSIBLE";
  1252. }
  1253. if (minimum_length > actual_length) {
  1254. return "TOO_SHORT";
  1255. }
  1256. if (possible_lengths[possible_lengths.length - 1] < actual_length) {
  1257. return "TOO_LONG";
  1258. }
  1259. return possible_lengths.indexOf(actual_length, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
  1260. }
  1261. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js
  1262. function applyInternationalSeparatorStyle(formattedNumber) {
  1263. return formattedNumber.replace(new RegExp("[".concat(VALID_PUNCTUATION, "]+"), "g"), " ").trim();
  1264. }
  1265. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js
  1266. var FIRST_GROUP_PATTERN = /(\$\d)/;
  1267. function formatNationalNumberUsingFormat(number, format, _ref) {
  1268. var useInternationalFormat = _ref.useInternationalFormat, withNationalPrefix = _ref.withNationalPrefix, carrierCode = _ref.carrierCode, metadata = _ref.metadata;
  1269. var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : (
  1270. // This library doesn't use `domestic_carrier_code_formatting_rule`,
  1271. // because that one is only used when formatting phone numbers
  1272. // for dialing from a mobile phone, and this is not a dialing library.
  1273. // carrierCode && format.domesticCarrierCodeFormattingRule()
  1274. // // First, replace the $CC in the formatting rule with the desired carrier code.
  1275. // // Then, replace the $FG in the formatting rule with the first group
  1276. // // and the carrier code combined in the appropriate way.
  1277. // ? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))
  1278. // : (
  1279. // withNationalPrefix && format.nationalPrefixFormattingRule()
  1280. // ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())
  1281. // : format.format()
  1282. // )
  1283. withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format()
  1284. ));
  1285. if (useInternationalFormat) {
  1286. return applyInternationalSeparatorStyle(formattedNumber);
  1287. }
  1288. return formattedNumber;
  1289. }
  1290. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js
  1291. function formatCompleteNumber(state, format, _ref) {
  1292. var metadata = _ref.metadata, shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;
  1293. var matcher = new RegExp("^(?:".concat(format.pattern(), ")$"));
  1294. if (matcher.test(state.nationalSignificantNumber)) {
  1295. return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, {
  1296. metadata,
  1297. shouldTryNationalPrefixFormattingRule,
  1298. getSeparatorAfterNationalPrefix
  1299. });
  1300. }
  1301. }
  1302. function canFormatCompleteNumber(nationalSignificantNumber, metadata) {
  1303. return checkNumberLength(nationalSignificantNumber, metadata) === "IS_POSSIBLE";
  1304. }
  1305. function formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) {
  1306. var metadata = _ref2.metadata, shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;
  1307. var nationalSignificantNumber = state.nationalSignificantNumber, international = state.international, nationalPrefix = state.nationalPrefix, carrierCode = state.carrierCode;
  1308. if (shouldTryNationalPrefixFormattingRule(format)) {
  1309. var formattedNumber = formatNationalNumber(state, format, {
  1310. useNationalPrefixFormattingRule: true,
  1311. getSeparatorAfterNationalPrefix,
  1312. metadata
  1313. });
  1314. if (formattedNumber) {
  1315. return formattedNumber;
  1316. }
  1317. }
  1318. return formatNationalNumber(state, format, {
  1319. useNationalPrefixFormattingRule: false,
  1320. getSeparatorAfterNationalPrefix,
  1321. metadata
  1322. });
  1323. }
  1324. function formatNationalNumber(state, format, _ref3) {
  1325. var metadata = _ref3.metadata, useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;
  1326. var formattedNationalNumber = formatNationalNumberUsingFormat(state.nationalSignificantNumber, format, {
  1327. carrierCode: state.carrierCode,
  1328. useInternationalFormat: state.international,
  1329. withNationalPrefix: useNationalPrefixFormattingRule,
  1330. metadata
  1331. });
  1332. if (!useNationalPrefixFormattingRule) {
  1333. if (state.nationalPrefix) {
  1334. formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format) + formattedNationalNumber;
  1335. } else if (state.complexPrefixBeforeNationalSignificantNumber) {
  1336. formattedNationalNumber = state.complexPrefixBeforeNationalSignificantNumber + " " + formattedNationalNumber;
  1337. }
  1338. }
  1339. if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {
  1340. return formattedNationalNumber;
  1341. }
  1342. }
  1343. function isValidFormattedNationalNumber(formattedNationalNumber, state) {
  1344. return parseDigits(formattedNationalNumber) === state.getNationalDigits();
  1345. }
  1346. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js
  1347. function _classCallCheck3(instance, Constructor) {
  1348. if (!(instance instanceof Constructor)) {
  1349. throw new TypeError("Cannot call a class as a function");
  1350. }
  1351. }
  1352. function _defineProperties3(target, props) {
  1353. for (var i = 0; i < props.length; i++) {
  1354. var descriptor = props[i];
  1355. descriptor.enumerable = descriptor.enumerable || false;
  1356. descriptor.configurable = true;
  1357. if ("value" in descriptor)
  1358. descriptor.writable = true;
  1359. Object.defineProperty(target, descriptor.key, descriptor);
  1360. }
  1361. }
  1362. function _createClass3(Constructor, protoProps, staticProps) {
  1363. if (protoProps)
  1364. _defineProperties3(Constructor.prototype, protoProps);
  1365. if (staticProps)
  1366. _defineProperties3(Constructor, staticProps);
  1367. Object.defineProperty(Constructor, "prototype", { writable: false });
  1368. return Constructor;
  1369. }
  1370. var PatternParser = function() {
  1371. function PatternParser2() {
  1372. _classCallCheck3(this, PatternParser2);
  1373. }
  1374. _createClass3(PatternParser2, [{
  1375. key: "parse",
  1376. value: function parse2(pattern) {
  1377. this.context = [{
  1378. or: true,
  1379. instructions: []
  1380. }];
  1381. this.parsePattern(pattern);
  1382. if (this.context.length !== 1) {
  1383. throw new Error("Non-finalized contexts left when pattern parse ended");
  1384. }
  1385. var _this$context$ = this.context[0], branches = _this$context$.branches, instructions = _this$context$.instructions;
  1386. if (branches) {
  1387. return {
  1388. op: "|",
  1389. args: branches.concat([expandSingleElementArray(instructions)])
  1390. };
  1391. }
  1392. if (instructions.length === 0) {
  1393. throw new Error("Pattern is required");
  1394. }
  1395. if (instructions.length === 1) {
  1396. return instructions[0];
  1397. }
  1398. return instructions;
  1399. }
  1400. }, {
  1401. key: "startContext",
  1402. value: function startContext(context) {
  1403. this.context.push(context);
  1404. }
  1405. }, {
  1406. key: "endContext",
  1407. value: function endContext() {
  1408. this.context.pop();
  1409. }
  1410. }, {
  1411. key: "getContext",
  1412. value: function getContext() {
  1413. return this.context[this.context.length - 1];
  1414. }
  1415. }, {
  1416. key: "parsePattern",
  1417. value: function parsePattern(pattern) {
  1418. if (!pattern) {
  1419. throw new Error("Pattern is required");
  1420. }
  1421. var match = pattern.match(OPERATOR);
  1422. if (!match) {
  1423. if (ILLEGAL_CHARACTER_REGEXP.test(pattern)) {
  1424. throw new Error("Illegal characters found in a pattern: ".concat(pattern));
  1425. }
  1426. this.getContext().instructions = this.getContext().instructions.concat(pattern.split(""));
  1427. return;
  1428. }
  1429. var operator = match[1];
  1430. var before = pattern.slice(0, match.index);
  1431. var rightPart = pattern.slice(match.index + operator.length);
  1432. switch (operator) {
  1433. case "(?:":
  1434. if (before) {
  1435. this.parsePattern(before);
  1436. }
  1437. this.startContext({
  1438. or: true,
  1439. instructions: [],
  1440. branches: []
  1441. });
  1442. break;
  1443. case ")":
  1444. if (!this.getContext().or) {
  1445. throw new Error('")" operator must be preceded by "(?:" operator');
  1446. }
  1447. if (before) {
  1448. this.parsePattern(before);
  1449. }
  1450. if (this.getContext().instructions.length === 0) {
  1451. throw new Error('No instructions found after "|" operator in an "or" group');
  1452. }
  1453. var _this$getContext = this.getContext(), branches = _this$getContext.branches;
  1454. branches.push(expandSingleElementArray(this.getContext().instructions));
  1455. this.endContext();
  1456. this.getContext().instructions.push({
  1457. op: "|",
  1458. args: branches
  1459. });
  1460. break;
  1461. case "|":
  1462. if (!this.getContext().or) {
  1463. throw new Error('"|" operator can only be used inside "or" groups');
  1464. }
  1465. if (before) {
  1466. this.parsePattern(before);
  1467. }
  1468. if (!this.getContext().branches) {
  1469. if (this.context.length === 1) {
  1470. this.getContext().branches = [];
  1471. } else {
  1472. throw new Error('"branches" not found in an "or" group context');
  1473. }
  1474. }
  1475. this.getContext().branches.push(expandSingleElementArray(this.getContext().instructions));
  1476. this.getContext().instructions = [];
  1477. break;
  1478. case "[":
  1479. if (before) {
  1480. this.parsePattern(before);
  1481. }
  1482. this.startContext({
  1483. oneOfSet: true
  1484. });
  1485. break;
  1486. case "]":
  1487. if (!this.getContext().oneOfSet) {
  1488. throw new Error('"]" operator must be preceded by "[" operator');
  1489. }
  1490. this.endContext();
  1491. this.getContext().instructions.push({
  1492. op: "[]",
  1493. args: parseOneOfSet(before)
  1494. });
  1495. break;
  1496. default:
  1497. throw new Error("Unknown operator: ".concat(operator));
  1498. }
  1499. if (rightPart) {
  1500. this.parsePattern(rightPart);
  1501. }
  1502. }
  1503. }]);
  1504. return PatternParser2;
  1505. }();
  1506. function parseOneOfSet(pattern) {
  1507. var values = [];
  1508. var i = 0;
  1509. while (i < pattern.length) {
  1510. if (pattern[i] === "-") {
  1511. if (i === 0 || i === pattern.length - 1) {
  1512. throw new Error("Couldn't parse a one-of set pattern: ".concat(pattern));
  1513. }
  1514. var prevValue = pattern[i - 1].charCodeAt(0) + 1;
  1515. var nextValue = pattern[i + 1].charCodeAt(0) - 1;
  1516. var value = prevValue;
  1517. while (value <= nextValue) {
  1518. values.push(String.fromCharCode(value));
  1519. value++;
  1520. }
  1521. } else {
  1522. values.push(pattern[i]);
  1523. }
  1524. i++;
  1525. }
  1526. return values;
  1527. }
  1528. var ILLEGAL_CHARACTER_REGEXP = /[\(\)\[\]\?\:\|]/;
  1529. var OPERATOR = new RegExp(
  1530. // any of:
  1531. "(\\||\\(\\?\\:|\\)|\\[|\\])"
  1532. );
  1533. function expandSingleElementArray(array) {
  1534. if (array.length === 1) {
  1535. return array[0];
  1536. }
  1537. return array;
  1538. }
  1539. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js
  1540. function _createForOfIteratorHelperLoose6(o, allowArrayLike) {
  1541. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  1542. if (it)
  1543. return (it = it.call(o)).next.bind(it);
  1544. if (Array.isArray(o) || (it = _unsupportedIterableToArray6(o)) || allowArrayLike && o && typeof o.length === "number") {
  1545. if (it)
  1546. o = it;
  1547. var i = 0;
  1548. return function() {
  1549. if (i >= o.length)
  1550. return { done: true };
  1551. return { done: false, value: o[i++] };
  1552. };
  1553. }
  1554. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  1555. }
  1556. function _unsupportedIterableToArray6(o, minLen) {
  1557. if (!o)
  1558. return;
  1559. if (typeof o === "string")
  1560. return _arrayLikeToArray6(o, minLen);
  1561. var n = Object.prototype.toString.call(o).slice(8, -1);
  1562. if (n === "Object" && o.constructor)
  1563. n = o.constructor.name;
  1564. if (n === "Map" || n === "Set")
  1565. return Array.from(o);
  1566. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  1567. return _arrayLikeToArray6(o, minLen);
  1568. }
  1569. function _arrayLikeToArray6(arr, len) {
  1570. if (len == null || len > arr.length)
  1571. len = arr.length;
  1572. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  1573. arr2[i] = arr[i];
  1574. }
  1575. return arr2;
  1576. }
  1577. function _classCallCheck4(instance, Constructor) {
  1578. if (!(instance instanceof Constructor)) {
  1579. throw new TypeError("Cannot call a class as a function");
  1580. }
  1581. }
  1582. function _defineProperties4(target, props) {
  1583. for (var i = 0; i < props.length; i++) {
  1584. var descriptor = props[i];
  1585. descriptor.enumerable = descriptor.enumerable || false;
  1586. descriptor.configurable = true;
  1587. if ("value" in descriptor)
  1588. descriptor.writable = true;
  1589. Object.defineProperty(target, descriptor.key, descriptor);
  1590. }
  1591. }
  1592. function _createClass4(Constructor, protoProps, staticProps) {
  1593. if (protoProps)
  1594. _defineProperties4(Constructor.prototype, protoProps);
  1595. if (staticProps)
  1596. _defineProperties4(Constructor, staticProps);
  1597. Object.defineProperty(Constructor, "prototype", { writable: false });
  1598. return Constructor;
  1599. }
  1600. var PatternMatcher = function() {
  1601. function PatternMatcher2(pattern) {
  1602. _classCallCheck4(this, PatternMatcher2);
  1603. this.matchTree = new PatternParser().parse(pattern);
  1604. }
  1605. _createClass4(PatternMatcher2, [{
  1606. key: "match",
  1607. value: function match(string) {
  1608. var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, allowOverflow = _ref.allowOverflow;
  1609. if (!string) {
  1610. throw new Error("String is required");
  1611. }
  1612. var result2 = _match(string.split(""), this.matchTree, true);
  1613. if (result2 && result2.match) {
  1614. delete result2.matchedChars;
  1615. }
  1616. if (result2 && result2.overflow) {
  1617. if (!allowOverflow) {
  1618. return;
  1619. }
  1620. }
  1621. return result2;
  1622. }
  1623. }]);
  1624. return PatternMatcher2;
  1625. }();
  1626. function _match(characters, tree, last) {
  1627. if (typeof tree === "string") {
  1628. var characterString = characters.join("");
  1629. if (tree.indexOf(characterString) === 0) {
  1630. if (characters.length === tree.length) {
  1631. return {
  1632. match: true,
  1633. matchedChars: characters
  1634. };
  1635. }
  1636. return {
  1637. partialMatch: true
  1638. // matchedChars: characters
  1639. };
  1640. }
  1641. if (characterString.indexOf(tree) === 0) {
  1642. if (last) {
  1643. if (characters.length > tree.length) {
  1644. return {
  1645. overflow: true
  1646. };
  1647. }
  1648. }
  1649. return {
  1650. match: true,
  1651. matchedChars: characters.slice(0, tree.length)
  1652. };
  1653. }
  1654. return;
  1655. }
  1656. if (Array.isArray(tree)) {
  1657. var restCharacters = characters.slice();
  1658. var i = 0;
  1659. while (i < tree.length) {
  1660. var subtree = tree[i];
  1661. var result2 = _match(restCharacters, subtree, last && i === tree.length - 1);
  1662. if (!result2) {
  1663. return;
  1664. } else if (result2.overflow) {
  1665. return result2;
  1666. } else if (result2.match) {
  1667. restCharacters = restCharacters.slice(result2.matchedChars.length);
  1668. if (restCharacters.length === 0) {
  1669. if (i === tree.length - 1) {
  1670. return {
  1671. match: true,
  1672. matchedChars: characters
  1673. };
  1674. } else {
  1675. return {
  1676. partialMatch: true
  1677. // matchedChars: characters
  1678. };
  1679. }
  1680. }
  1681. } else {
  1682. if (result2.partialMatch) {
  1683. return {
  1684. partialMatch: true
  1685. // matchedChars: characters
  1686. };
  1687. } else {
  1688. throw new Error("Unsupported match result:\n".concat(JSON.stringify(result2, null, 2)));
  1689. }
  1690. }
  1691. i++;
  1692. }
  1693. if (last) {
  1694. return {
  1695. overflow: true
  1696. };
  1697. }
  1698. return {
  1699. match: true,
  1700. matchedChars: characters.slice(0, characters.length - restCharacters.length)
  1701. };
  1702. }
  1703. switch (tree.op) {
  1704. case "|":
  1705. var partialMatch;
  1706. for (var _iterator = _createForOfIteratorHelperLoose6(tree.args), _step; !(_step = _iterator()).done; ) {
  1707. var branch = _step.value;
  1708. var _result = _match(characters, branch, last);
  1709. if (_result) {
  1710. if (_result.overflow) {
  1711. return _result;
  1712. } else if (_result.match) {
  1713. return {
  1714. match: true,
  1715. matchedChars: _result.matchedChars
  1716. };
  1717. } else {
  1718. if (_result.partialMatch) {
  1719. partialMatch = true;
  1720. } else {
  1721. throw new Error("Unsupported match result:\n".concat(JSON.stringify(_result, null, 2)));
  1722. }
  1723. }
  1724. }
  1725. }
  1726. if (partialMatch) {
  1727. return {
  1728. partialMatch: true
  1729. // matchedChars: ...
  1730. };
  1731. }
  1732. return;
  1733. case "[]":
  1734. for (var _iterator2 = _createForOfIteratorHelperLoose6(tree.args), _step2; !(_step2 = _iterator2()).done; ) {
  1735. var _char = _step2.value;
  1736. if (characters[0] === _char) {
  1737. if (characters.length === 1) {
  1738. return {
  1739. match: true,
  1740. matchedChars: characters
  1741. };
  1742. }
  1743. if (last) {
  1744. return {
  1745. overflow: true
  1746. };
  1747. }
  1748. return {
  1749. match: true,
  1750. matchedChars: [_char]
  1751. };
  1752. }
  1753. }
  1754. return;
  1755. default:
  1756. throw new Error("Unsupported instruction tree: ".concat(tree));
  1757. }
  1758. }
  1759. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js
  1760. function _createForOfIteratorHelperLoose7(o, allowArrayLike) {
  1761. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  1762. if (it)
  1763. return (it = it.call(o)).next.bind(it);
  1764. if (Array.isArray(o) || (it = _unsupportedIterableToArray7(o)) || allowArrayLike && o && typeof o.length === "number") {
  1765. if (it)
  1766. o = it;
  1767. var i = 0;
  1768. return function() {
  1769. if (i >= o.length)
  1770. return { done: true };
  1771. return { done: false, value: o[i++] };
  1772. };
  1773. }
  1774. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  1775. }
  1776. function _unsupportedIterableToArray7(o, minLen) {
  1777. if (!o)
  1778. return;
  1779. if (typeof o === "string")
  1780. return _arrayLikeToArray7(o, minLen);
  1781. var n = Object.prototype.toString.call(o).slice(8, -1);
  1782. if (n === "Object" && o.constructor)
  1783. n = o.constructor.name;
  1784. if (n === "Map" || n === "Set")
  1785. return Array.from(o);
  1786. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  1787. return _arrayLikeToArray7(o, minLen);
  1788. }
  1789. function _arrayLikeToArray7(arr, len) {
  1790. if (len == null || len > arr.length)
  1791. len = arr.length;
  1792. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  1793. arr2[i] = arr[i];
  1794. }
  1795. return arr2;
  1796. }
  1797. function _classCallCheck5(instance, Constructor) {
  1798. if (!(instance instanceof Constructor)) {
  1799. throw new TypeError("Cannot call a class as a function");
  1800. }
  1801. }
  1802. function _defineProperties5(target, props) {
  1803. for (var i = 0; i < props.length; i++) {
  1804. var descriptor = props[i];
  1805. descriptor.enumerable = descriptor.enumerable || false;
  1806. descriptor.configurable = true;
  1807. if ("value" in descriptor)
  1808. descriptor.writable = true;
  1809. Object.defineProperty(target, descriptor.key, descriptor);
  1810. }
  1811. }
  1812. function _createClass5(Constructor, protoProps, staticProps) {
  1813. if (protoProps)
  1814. _defineProperties5(Constructor.prototype, protoProps);
  1815. if (staticProps)
  1816. _defineProperties5(Constructor, staticProps);
  1817. Object.defineProperty(Constructor, "prototype", { writable: false });
  1818. return Constructor;
  1819. }
  1820. var DUMMY_DIGIT = "9";
  1821. var LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15;
  1822. var LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH);
  1823. var NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/;
  1824. var SUPPORT_LEGACY_FORMATTING_PATTERNS = true;
  1825. var CREATE_CHARACTER_CLASS_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function() {
  1826. return /\[([^\[\]])*\]/g;
  1827. };
  1828. var CREATE_STANDALONE_DIGIT_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function() {
  1829. return /\d(?=[^,}][^,}])/g;
  1830. };
  1831. var NON_ALTERING_FORMAT_REG_EXP = new RegExp("[" + VALID_PUNCTUATION + "]*\\$1[" + VALID_PUNCTUATION + "]*(\\$\\d[" + VALID_PUNCTUATION + "]*)*$");
  1832. var MIN_LEADING_DIGITS_LENGTH = 3;
  1833. var AsYouTypeFormatter = function() {
  1834. function AsYouTypeFormatter2(_ref) {
  1835. var state = _ref.state, metadata = _ref.metadata;
  1836. _classCallCheck5(this, AsYouTypeFormatter2);
  1837. this.metadata = metadata;
  1838. this.resetFormat();
  1839. }
  1840. _createClass5(AsYouTypeFormatter2, [{
  1841. key: "resetFormat",
  1842. value: function resetFormat() {
  1843. this.chosenFormat = void 0;
  1844. this.template = void 0;
  1845. this.nationalNumberTemplate = void 0;
  1846. this.populatedNationalNumberTemplate = void 0;
  1847. this.populatedNationalNumberTemplatePosition = -1;
  1848. }
  1849. }, {
  1850. key: "reset",
  1851. value: function reset(numberingPlan, state) {
  1852. this.resetFormat();
  1853. if (numberingPlan) {
  1854. this.isNANP = numberingPlan.callingCode() === "1";
  1855. this.matchingFormats = numberingPlan.formats();
  1856. if (state.nationalSignificantNumber) {
  1857. this.narrowDownMatchingFormats(state);
  1858. }
  1859. } else {
  1860. this.isNANP = void 0;
  1861. this.matchingFormats = [];
  1862. }
  1863. }
  1864. /**
  1865. * Formats an updated phone number.
  1866. * @param {string} nextDigits — Additional phone number digits.
  1867. * @param {object} state — `AsYouType` state.
  1868. * @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats.
  1869. */
  1870. }, {
  1871. key: "format",
  1872. value: function format(nextDigits, state) {
  1873. var _this = this;
  1874. if (canFormatCompleteNumber(state.nationalSignificantNumber, this.metadata)) {
  1875. for (var _iterator = _createForOfIteratorHelperLoose7(this.matchingFormats), _step; !(_step = _iterator()).done; ) {
  1876. var format2 = _step.value;
  1877. var formattedCompleteNumber = formatCompleteNumber(state, format2, {
  1878. metadata: this.metadata,
  1879. shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format3) {
  1880. return _this.shouldTryNationalPrefixFormattingRule(format3, {
  1881. international: state.international,
  1882. nationalPrefix: state.nationalPrefix
  1883. });
  1884. },
  1885. getSeparatorAfterNationalPrefix: function getSeparatorAfterNationalPrefix(format3) {
  1886. return _this.getSeparatorAfterNationalPrefix(format3);
  1887. }
  1888. });
  1889. if (formattedCompleteNumber) {
  1890. this.resetFormat();
  1891. this.chosenFormat = format2;
  1892. this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\d/g, DIGIT_PLACEHOLDER), state);
  1893. this.populatedNationalNumberTemplate = formattedCompleteNumber;
  1894. this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);
  1895. return formattedCompleteNumber;
  1896. }
  1897. }
  1898. }
  1899. return this.formatNationalNumberWithNextDigits(nextDigits, state);
  1900. }
  1901. // Formats the next phone number digits.
  1902. }, {
  1903. key: "formatNationalNumberWithNextDigits",
  1904. value: function formatNationalNumberWithNextDigits(nextDigits, state) {
  1905. var previouslyChosenFormat = this.chosenFormat;
  1906. var newlyChosenFormat = this.chooseFormat(state);
  1907. if (newlyChosenFormat) {
  1908. if (newlyChosenFormat === previouslyChosenFormat) {
  1909. return this.formatNextNationalNumberDigits(nextDigits);
  1910. } else {
  1911. return this.formatNextNationalNumberDigits(state.getNationalDigits());
  1912. }
  1913. }
  1914. }
  1915. }, {
  1916. key: "narrowDownMatchingFormats",
  1917. value: function narrowDownMatchingFormats(_ref2) {
  1918. var _this2 = this;
  1919. var nationalSignificantNumber = _ref2.nationalSignificantNumber, nationalPrefix = _ref2.nationalPrefix, international = _ref2.international;
  1920. var leadingDigits = nationalSignificantNumber;
  1921. var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;
  1922. if (leadingDigitsPatternIndex < 0) {
  1923. leadingDigitsPatternIndex = 0;
  1924. }
  1925. this.matchingFormats = this.matchingFormats.filter(function(format) {
  1926. return _this2.formatSuits(format, international, nationalPrefix) && _this2.formatMatches(format, leadingDigits, leadingDigitsPatternIndex);
  1927. });
  1928. if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {
  1929. this.resetFormat();
  1930. }
  1931. }
  1932. }, {
  1933. key: "formatSuits",
  1934. value: function formatSuits(format, international, nationalPrefix) {
  1935. if (nationalPrefix && !format.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() &&
  1936. !format.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {
  1937. return false;
  1938. }
  1939. if (!international && !nationalPrefix && format.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {
  1940. return false;
  1941. }
  1942. return true;
  1943. }
  1944. }, {
  1945. key: "formatMatches",
  1946. value: function formatMatches(format, leadingDigits, leadingDigitsPatternIndex) {
  1947. var leadingDigitsPatternsCount = format.leadingDigitsPatterns().length;
  1948. if (leadingDigitsPatternsCount === 0) {
  1949. return true;
  1950. }
  1951. leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);
  1952. var leadingDigitsPattern = format.leadingDigitsPatterns()[leadingDigitsPatternIndex];
  1953. if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {
  1954. try {
  1955. return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, {
  1956. allowOverflow: true
  1957. }) !== void 0;
  1958. } catch (error) {
  1959. console.error(error);
  1960. return true;
  1961. }
  1962. }
  1963. return new RegExp("^(".concat(leadingDigitsPattern, ")")).test(leadingDigits);
  1964. }
  1965. }, {
  1966. key: "getFormatFormat",
  1967. value: function getFormatFormat(format, international) {
  1968. return international ? format.internationalFormat() : format.format();
  1969. }
  1970. }, {
  1971. key: "chooseFormat",
  1972. value: function chooseFormat(state) {
  1973. var _this3 = this;
  1974. var _loop = function _loop2() {
  1975. var format = _step2.value;
  1976. if (_this3.chosenFormat === format) {
  1977. return "break";
  1978. }
  1979. if (!NON_ALTERING_FORMAT_REG_EXP.test(_this3.getFormatFormat(format, state.international))) {
  1980. return "continue";
  1981. }
  1982. if (!_this3.createTemplateForFormat(format, state)) {
  1983. _this3.matchingFormats = _this3.matchingFormats.filter(function(_) {
  1984. return _ !== format;
  1985. });
  1986. return "continue";
  1987. }
  1988. _this3.chosenFormat = format;
  1989. return "break";
  1990. };
  1991. for (var _iterator2 = _createForOfIteratorHelperLoose7(this.matchingFormats.slice()), _step2; !(_step2 = _iterator2()).done; ) {
  1992. var _ret = _loop();
  1993. if (_ret === "break")
  1994. break;
  1995. if (_ret === "continue")
  1996. continue;
  1997. }
  1998. if (!this.chosenFormat) {
  1999. this.resetFormat();
  2000. }
  2001. return this.chosenFormat;
  2002. }
  2003. }, {
  2004. key: "createTemplateForFormat",
  2005. value: function createTemplateForFormat(format, state) {
  2006. if (SUPPORT_LEGACY_FORMATTING_PATTERNS && format.pattern().indexOf("|") >= 0) {
  2007. return;
  2008. }
  2009. var template = this.getTemplateForFormat(format, state);
  2010. if (template) {
  2011. this.setNationalNumberTemplate(template, state);
  2012. return true;
  2013. }
  2014. }
  2015. }, {
  2016. key: "getSeparatorAfterNationalPrefix",
  2017. value: function getSeparatorAfterNationalPrefix(format) {
  2018. if (this.isNANP) {
  2019. return " ";
  2020. }
  2021. if (format && format.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format.nationalPrefixFormattingRule())) {
  2022. return " ";
  2023. }
  2024. return "";
  2025. }
  2026. }, {
  2027. key: "getInternationalPrefixBeforeCountryCallingCode",
  2028. value: function getInternationalPrefixBeforeCountryCallingCode(_ref3, options) {
  2029. var IDDPrefix = _ref3.IDDPrefix, missingPlus = _ref3.missingPlus;
  2030. if (IDDPrefix) {
  2031. return options && options.spacing === false ? IDDPrefix : IDDPrefix + " ";
  2032. }
  2033. if (missingPlus) {
  2034. return "";
  2035. }
  2036. return "+";
  2037. }
  2038. }, {
  2039. key: "getTemplate",
  2040. value: function getTemplate(state) {
  2041. if (!this.template) {
  2042. return;
  2043. }
  2044. var index = -1;
  2045. var i = 0;
  2046. var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {
  2047. spacing: false
  2048. }) : "";
  2049. while (i < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {
  2050. index = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);
  2051. i++;
  2052. }
  2053. return cutAndStripNonPairedParens(this.template, index + 1);
  2054. }
  2055. }, {
  2056. key: "setNationalNumberTemplate",
  2057. value: function setNationalNumberTemplate(template, state) {
  2058. this.nationalNumberTemplate = template;
  2059. this.populatedNationalNumberTemplate = template;
  2060. this.populatedNationalNumberTemplatePosition = -1;
  2061. if (state.international) {
  2062. this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\d\+]/g, DIGIT_PLACEHOLDER) + repeat(DIGIT_PLACEHOLDER, state.callingCode.length) + " " + template;
  2063. } else {
  2064. this.template = template;
  2065. }
  2066. }
  2067. /**
  2068. * Generates formatting template for a national phone number,
  2069. * optionally containing a national prefix, for a format.
  2070. * @param {Format} format
  2071. * @param {string} nationalPrefix
  2072. * @return {string}
  2073. */
  2074. }, {
  2075. key: "getTemplateForFormat",
  2076. value: function getTemplateForFormat(format, _ref4) {
  2077. var nationalSignificantNumber = _ref4.nationalSignificantNumber, international = _ref4.international, nationalPrefix = _ref4.nationalPrefix, complexPrefixBeforeNationalSignificantNumber = _ref4.complexPrefixBeforeNationalSignificantNumber;
  2078. var pattern = format.pattern();
  2079. if (SUPPORT_LEGACY_FORMATTING_PATTERNS) {
  2080. pattern = pattern.replace(CREATE_CHARACTER_CLASS_PATTERN(), "\\d").replace(CREATE_STANDALONE_DIGIT_PATTERN(), "\\d");
  2081. }
  2082. var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0];
  2083. if (nationalSignificantNumber.length > digits.length) {
  2084. return;
  2085. }
  2086. var strictPattern = new RegExp("^" + pattern + "$");
  2087. var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\d/g, DUMMY_DIGIT);
  2088. if (strictPattern.test(nationalNumberDummyDigits)) {
  2089. digits = nationalNumberDummyDigits;
  2090. }
  2091. var numberFormat = this.getFormatFormat(format, international);
  2092. var nationalPrefixIncludedInTemplate;
  2093. if (this.shouldTryNationalPrefixFormattingRule(format, {
  2094. international,
  2095. nationalPrefix
  2096. })) {
  2097. var numberFormatWithNationalPrefix = numberFormat.replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule());
  2098. if (parseDigits(format.nationalPrefixFormattingRule()) === (nationalPrefix || "") + parseDigits("$1")) {
  2099. numberFormat = numberFormatWithNationalPrefix;
  2100. nationalPrefixIncludedInTemplate = true;
  2101. if (nationalPrefix) {
  2102. var i = nationalPrefix.length;
  2103. while (i > 0) {
  2104. numberFormat = numberFormat.replace(/\d/, DIGIT_PLACEHOLDER);
  2105. i--;
  2106. }
  2107. }
  2108. }
  2109. }
  2110. var template = digits.replace(new RegExp(pattern), numberFormat).replace(new RegExp(DUMMY_DIGIT, "g"), DIGIT_PLACEHOLDER);
  2111. if (!nationalPrefixIncludedInTemplate) {
  2112. if (complexPrefixBeforeNationalSignificantNumber) {
  2113. template = repeat(DIGIT_PLACEHOLDER, complexPrefixBeforeNationalSignificantNumber.length) + " " + template;
  2114. } else if (nationalPrefix) {
  2115. template = repeat(DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format) + template;
  2116. }
  2117. }
  2118. if (international) {
  2119. template = applyInternationalSeparatorStyle(template);
  2120. }
  2121. return template;
  2122. }
  2123. }, {
  2124. key: "formatNextNationalNumberDigits",
  2125. value: function formatNextNationalNumberDigits(digits) {
  2126. var result2 = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);
  2127. if (!result2) {
  2128. this.resetFormat();
  2129. return;
  2130. }
  2131. this.populatedNationalNumberTemplate = result2[0];
  2132. this.populatedNationalNumberTemplatePosition = result2[1];
  2133. return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1);
  2134. }
  2135. }, {
  2136. key: "shouldTryNationalPrefixFormattingRule",
  2137. value: function shouldTryNationalPrefixFormattingRule(format, _ref5) {
  2138. var international = _ref5.international, nationalPrefix = _ref5.nationalPrefix;
  2139. if (format.nationalPrefixFormattingRule()) {
  2140. var usesNationalPrefix = format.usesNationalPrefix();
  2141. if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {
  2142. return true;
  2143. }
  2144. }
  2145. }
  2146. }]);
  2147. return AsYouTypeFormatter2;
  2148. }();
  2149. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/isPossible.js
  2150. function isPossiblePhoneNumber(input, options, metadata) {
  2151. if (options === void 0) {
  2152. options = {};
  2153. }
  2154. metadata = new Metadata(metadata);
  2155. if (options.v2) {
  2156. if (!input.countryCallingCode) {
  2157. throw new Error("Invalid phone number object passed");
  2158. }
  2159. metadata.selectNumberingPlan(input.countryCallingCode);
  2160. } else {
  2161. if (!input.phone) {
  2162. return false;
  2163. }
  2164. if (input.country) {
  2165. if (!metadata.hasCountry(input.country)) {
  2166. throw new Error("Unknown country: ".concat(input.country));
  2167. }
  2168. metadata.country(input.country);
  2169. } else {
  2170. if (!input.countryCallingCode) {
  2171. throw new Error("Invalid phone number object passed");
  2172. }
  2173. metadata.selectNumberingPlan(input.countryCallingCode);
  2174. }
  2175. }
  2176. if (metadata.possibleLengths()) {
  2177. return isPossibleNumber(input.phone || input.nationalNumber, metadata);
  2178. } else {
  2179. if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {
  2180. return true;
  2181. } else {
  2182. throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
  2183. }
  2184. }
  2185. }
  2186. function isPossibleNumber(nationalNumber, metadata) {
  2187. switch (checkNumberLength(nationalNumber, metadata)) {
  2188. case "IS_POSSIBLE":
  2189. return true;
  2190. default:
  2191. return false;
  2192. }
  2193. }
  2194. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js
  2195. function matchesEntirely(text, regular_expression) {
  2196. text = text || "";
  2197. return new RegExp("^(?:" + regular_expression + ")$").test(text);
  2198. }
  2199. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/getNumberType.js
  2200. function _createForOfIteratorHelperLoose8(o, allowArrayLike) {
  2201. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  2202. if (it)
  2203. return (it = it.call(o)).next.bind(it);
  2204. if (Array.isArray(o) || (it = _unsupportedIterableToArray8(o)) || allowArrayLike && o && typeof o.length === "number") {
  2205. if (it)
  2206. o = it;
  2207. var i = 0;
  2208. return function() {
  2209. if (i >= o.length)
  2210. return { done: true };
  2211. return { done: false, value: o[i++] };
  2212. };
  2213. }
  2214. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2215. }
  2216. function _unsupportedIterableToArray8(o, minLen) {
  2217. if (!o)
  2218. return;
  2219. if (typeof o === "string")
  2220. return _arrayLikeToArray8(o, minLen);
  2221. var n = Object.prototype.toString.call(o).slice(8, -1);
  2222. if (n === "Object" && o.constructor)
  2223. n = o.constructor.name;
  2224. if (n === "Map" || n === "Set")
  2225. return Array.from(o);
  2226. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  2227. return _arrayLikeToArray8(o, minLen);
  2228. }
  2229. function _arrayLikeToArray8(arr, len) {
  2230. if (len == null || len > arr.length)
  2231. len = arr.length;
  2232. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  2233. arr2[i] = arr[i];
  2234. }
  2235. return arr2;
  2236. }
  2237. var NON_FIXED_LINE_PHONE_TYPES = ["MOBILE", "PREMIUM_RATE", "TOLL_FREE", "SHARED_COST", "VOIP", "PERSONAL_NUMBER", "PAGER", "UAN", "VOICEMAIL"];
  2238. function getNumberType(input, options, metadata) {
  2239. options = options || {};
  2240. if (!input.country && !input.countryCallingCode) {
  2241. return;
  2242. }
  2243. metadata = new Metadata(metadata);
  2244. metadata.selectNumberingPlan(input.country, input.countryCallingCode);
  2245. var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
  2246. if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {
  2247. return;
  2248. }
  2249. if (isNumberTypeEqualTo(nationalNumber, "FIXED_LINE", metadata)) {
  2250. if (metadata.type("MOBILE") && metadata.type("MOBILE").pattern() === "") {
  2251. return "FIXED_LINE_OR_MOBILE";
  2252. }
  2253. if (!metadata.type("MOBILE")) {
  2254. return "FIXED_LINE_OR_MOBILE";
  2255. }
  2256. if (isNumberTypeEqualTo(nationalNumber, "MOBILE", metadata)) {
  2257. return "FIXED_LINE_OR_MOBILE";
  2258. }
  2259. return "FIXED_LINE";
  2260. }
  2261. for (var _iterator = _createForOfIteratorHelperLoose8(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done; ) {
  2262. var type = _step.value;
  2263. if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {
  2264. return type;
  2265. }
  2266. }
  2267. }
  2268. function isNumberTypeEqualTo(nationalNumber, type, metadata) {
  2269. type = metadata.type(type);
  2270. if (!type || !type.pattern()) {
  2271. return false;
  2272. }
  2273. if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {
  2274. return false;
  2275. }
  2276. return matchesEntirely(nationalNumber, type.pattern());
  2277. }
  2278. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/isValid.js
  2279. function isValidNumber(input, options, metadata) {
  2280. options = options || {};
  2281. metadata = new Metadata(metadata);
  2282. metadata.selectNumberingPlan(input.country, input.countryCallingCode);
  2283. if (metadata.hasTypes()) {
  2284. return getNumberType(input, options, metadata.metadata) !== void 0;
  2285. }
  2286. var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
  2287. return matchesEntirely(nationalNumber, metadata.nationalNumberPattern());
  2288. }
  2289. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js
  2290. function getPossibleCountriesForNumber(callingCode, nationalNumber, metadata) {
  2291. var _metadata = new Metadata(metadata);
  2292. var possibleCountries = _metadata.getCountryCodesForCallingCode(callingCode);
  2293. if (!possibleCountries) {
  2294. return [];
  2295. }
  2296. return possibleCountries.filter(function(country2) {
  2297. return couldNationalNumberBelongToCountry(nationalNumber, country2, metadata);
  2298. });
  2299. }
  2300. function couldNationalNumberBelongToCountry(nationalNumber, country2, metadata) {
  2301. var _metadata = new Metadata(metadata);
  2302. _metadata.selectNumberingPlan(country2);
  2303. if (_metadata.numberingPlan.possibleLengths().indexOf(nationalNumber.length) >= 0) {
  2304. return true;
  2305. }
  2306. return false;
  2307. }
  2308. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js
  2309. var SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
  2310. function getIddPrefix(country2, callingCode, metadata) {
  2311. var countryMetadata = new Metadata(metadata);
  2312. countryMetadata.selectNumberingPlan(country2, callingCode);
  2313. if (countryMetadata.defaultIDDPrefix()) {
  2314. return countryMetadata.defaultIDDPrefix();
  2315. }
  2316. if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {
  2317. return countryMetadata.IDDPrefix();
  2318. }
  2319. }
  2320. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/format.js
  2321. function _createForOfIteratorHelperLoose9(o, allowArrayLike) {
  2322. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  2323. if (it)
  2324. return (it = it.call(o)).next.bind(it);
  2325. if (Array.isArray(o) || (it = _unsupportedIterableToArray9(o)) || allowArrayLike && o && typeof o.length === "number") {
  2326. if (it)
  2327. o = it;
  2328. var i = 0;
  2329. return function() {
  2330. if (i >= o.length)
  2331. return { done: true };
  2332. return { done: false, value: o[i++] };
  2333. };
  2334. }
  2335. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2336. }
  2337. function _unsupportedIterableToArray9(o, minLen) {
  2338. if (!o)
  2339. return;
  2340. if (typeof o === "string")
  2341. return _arrayLikeToArray9(o, minLen);
  2342. var n = Object.prototype.toString.call(o).slice(8, -1);
  2343. if (n === "Object" && o.constructor)
  2344. n = o.constructor.name;
  2345. if (n === "Map" || n === "Set")
  2346. return Array.from(o);
  2347. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  2348. return _arrayLikeToArray9(o, minLen);
  2349. }
  2350. function _arrayLikeToArray9(arr, len) {
  2351. if (len == null || len > arr.length)
  2352. len = arr.length;
  2353. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  2354. arr2[i] = arr[i];
  2355. }
  2356. return arr2;
  2357. }
  2358. function ownKeys(object, enumerableOnly) {
  2359. var keys = Object.keys(object);
  2360. if (Object.getOwnPropertySymbols) {
  2361. var symbols = Object.getOwnPropertySymbols(object);
  2362. enumerableOnly && (symbols = symbols.filter(function(sym) {
  2363. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  2364. })), keys.push.apply(keys, symbols);
  2365. }
  2366. return keys;
  2367. }
  2368. function _objectSpread(target) {
  2369. for (var i = 1; i < arguments.length; i++) {
  2370. var source = null != arguments[i] ? arguments[i] : {};
  2371. i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
  2372. _defineProperty(target, key, source[key]);
  2373. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
  2374. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  2375. });
  2376. }
  2377. return target;
  2378. }
  2379. function _defineProperty(obj, key, value) {
  2380. if (key in obj) {
  2381. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  2382. } else {
  2383. obj[key] = value;
  2384. }
  2385. return obj;
  2386. }
  2387. var DEFAULT_OPTIONS = {
  2388. formatExtension: function formatExtension(formattedNumber, extension, metadata) {
  2389. return "".concat(formattedNumber).concat(metadata.ext()).concat(extension);
  2390. }
  2391. };
  2392. function formatNumber2(input, format, options, metadata) {
  2393. if (options) {
  2394. options = _objectSpread(_objectSpread({}, DEFAULT_OPTIONS), options);
  2395. } else {
  2396. options = DEFAULT_OPTIONS;
  2397. }
  2398. metadata = new Metadata(metadata);
  2399. if (input.country && input.country !== "001") {
  2400. if (!metadata.hasCountry(input.country)) {
  2401. throw new Error("Unknown country: ".concat(input.country));
  2402. }
  2403. metadata.country(input.country);
  2404. } else if (input.countryCallingCode) {
  2405. metadata.selectNumberingPlan(input.countryCallingCode);
  2406. } else
  2407. return input.phone || "";
  2408. var countryCallingCode = metadata.countryCallingCode();
  2409. var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
  2410. var number;
  2411. switch (format) {
  2412. case "NATIONAL":
  2413. if (!nationalNumber) {
  2414. return "";
  2415. }
  2416. number = formatNationalNumber2(nationalNumber, input.carrierCode, "NATIONAL", metadata, options);
  2417. return addExtension(number, input.ext, metadata, options.formatExtension);
  2418. case "INTERNATIONAL":
  2419. if (!nationalNumber) {
  2420. return "+".concat(countryCallingCode);
  2421. }
  2422. number = formatNationalNumber2(nationalNumber, null, "INTERNATIONAL", metadata, options);
  2423. number = "+".concat(countryCallingCode, " ").concat(number);
  2424. return addExtension(number, input.ext, metadata, options.formatExtension);
  2425. case "E.164":
  2426. return "+".concat(countryCallingCode).concat(nationalNumber);
  2427. case "RFC3966":
  2428. return formatRFC3966({
  2429. number: "+".concat(countryCallingCode).concat(nationalNumber),
  2430. ext: input.ext
  2431. });
  2432. case "IDD":
  2433. if (!options.fromCountry) {
  2434. return;
  2435. }
  2436. var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);
  2437. return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);
  2438. default:
  2439. throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(format, '"'));
  2440. }
  2441. }
  2442. function formatNationalNumber2(number, carrierCode, formatAs, metadata, options) {
  2443. var format = chooseFormatForNumber(metadata.formats(), number);
  2444. if (!format) {
  2445. return number;
  2446. }
  2447. return formatNationalNumberUsingFormat(number, format, {
  2448. useInternationalFormat: formatAs === "INTERNATIONAL",
  2449. withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,
  2450. carrierCode,
  2451. metadata
  2452. });
  2453. }
  2454. function chooseFormatForNumber(availableFormats, nationalNnumber) {
  2455. for (var _iterator = _createForOfIteratorHelperLoose9(availableFormats), _step; !(_step = _iterator()).done; ) {
  2456. var format = _step.value;
  2457. if (format.leadingDigitsPatterns().length > 0) {
  2458. var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1];
  2459. if (nationalNnumber.search(lastLeadingDigitsPattern) !== 0) {
  2460. continue;
  2461. }
  2462. }
  2463. if (matchesEntirely(nationalNnumber, format.pattern())) {
  2464. return format;
  2465. }
  2466. }
  2467. }
  2468. function addExtension(formattedNumber, ext, metadata, formatExtension2) {
  2469. return ext ? formatExtension2(formattedNumber, ext, metadata) : formattedNumber;
  2470. }
  2471. function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {
  2472. var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata);
  2473. if (fromCountryCallingCode === countryCallingCode) {
  2474. var formattedNumber = formatNationalNumber2(nationalNumber, carrierCode, "NATIONAL", metadata);
  2475. if (countryCallingCode === "1") {
  2476. return countryCallingCode + " " + formattedNumber;
  2477. }
  2478. return formattedNumber;
  2479. }
  2480. var iddPrefix = getIddPrefix(fromCountry, void 0, metadata.metadata);
  2481. if (iddPrefix) {
  2482. return "".concat(iddPrefix, " ").concat(countryCallingCode, " ").concat(formatNationalNumber2(nationalNumber, null, "INTERNATIONAL", metadata));
  2483. }
  2484. }
  2485. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/PhoneNumber.js
  2486. function ownKeys2(object, enumerableOnly) {
  2487. var keys = Object.keys(object);
  2488. if (Object.getOwnPropertySymbols) {
  2489. var symbols = Object.getOwnPropertySymbols(object);
  2490. enumerableOnly && (symbols = symbols.filter(function(sym) {
  2491. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  2492. })), keys.push.apply(keys, symbols);
  2493. }
  2494. return keys;
  2495. }
  2496. function _objectSpread2(target) {
  2497. for (var i = 1; i < arguments.length; i++) {
  2498. var source = null != arguments[i] ? arguments[i] : {};
  2499. i % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
  2500. _defineProperty2(target, key, source[key]);
  2501. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
  2502. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  2503. });
  2504. }
  2505. return target;
  2506. }
  2507. function _defineProperty2(obj, key, value) {
  2508. if (key in obj) {
  2509. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  2510. } else {
  2511. obj[key] = value;
  2512. }
  2513. return obj;
  2514. }
  2515. function _classCallCheck6(instance, Constructor) {
  2516. if (!(instance instanceof Constructor)) {
  2517. throw new TypeError("Cannot call a class as a function");
  2518. }
  2519. }
  2520. function _defineProperties6(target, props) {
  2521. for (var i = 0; i < props.length; i++) {
  2522. var descriptor = props[i];
  2523. descriptor.enumerable = descriptor.enumerable || false;
  2524. descriptor.configurable = true;
  2525. if ("value" in descriptor)
  2526. descriptor.writable = true;
  2527. Object.defineProperty(target, descriptor.key, descriptor);
  2528. }
  2529. }
  2530. function _createClass6(Constructor, protoProps, staticProps) {
  2531. if (protoProps)
  2532. _defineProperties6(Constructor.prototype, protoProps);
  2533. if (staticProps)
  2534. _defineProperties6(Constructor, staticProps);
  2535. Object.defineProperty(Constructor, "prototype", { writable: false });
  2536. return Constructor;
  2537. }
  2538. var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;
  2539. var PhoneNumber = function() {
  2540. function PhoneNumber2(countryOrCountryCallingCode, nationalNumber, metadata) {
  2541. _classCallCheck6(this, PhoneNumber2);
  2542. if (!countryOrCountryCallingCode) {
  2543. throw new TypeError("`country` or `countryCallingCode` not passed");
  2544. }
  2545. if (!nationalNumber) {
  2546. throw new TypeError("`nationalNumber` not passed");
  2547. }
  2548. if (!metadata) {
  2549. throw new TypeError("`metadata` not passed");
  2550. }
  2551. var _getCountryAndCountry = getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadata), country2 = _getCountryAndCountry.country, countryCallingCode = _getCountryAndCountry.countryCallingCode;
  2552. this.country = country2;
  2553. this.countryCallingCode = countryCallingCode;
  2554. this.nationalNumber = nationalNumber;
  2555. this.number = "+" + this.countryCallingCode + this.nationalNumber;
  2556. this.getMetadata = function() {
  2557. return metadata;
  2558. };
  2559. }
  2560. _createClass6(PhoneNumber2, [{
  2561. key: "setExt",
  2562. value: function setExt(ext) {
  2563. this.ext = ext;
  2564. }
  2565. }, {
  2566. key: "getPossibleCountries",
  2567. value: function getPossibleCountries() {
  2568. if (this.country) {
  2569. return [this.country];
  2570. }
  2571. return getPossibleCountriesForNumber(this.countryCallingCode, this.nationalNumber, this.getMetadata());
  2572. }
  2573. }, {
  2574. key: "isPossible",
  2575. value: function isPossible() {
  2576. return isPossiblePhoneNumber(this, {
  2577. v2: true
  2578. }, this.getMetadata());
  2579. }
  2580. }, {
  2581. key: "isValid",
  2582. value: function isValid() {
  2583. return isValidNumber(this, {
  2584. v2: true
  2585. }, this.getMetadata());
  2586. }
  2587. }, {
  2588. key: "isNonGeographic",
  2589. value: function isNonGeographic() {
  2590. var metadata = new Metadata(this.getMetadata());
  2591. return metadata.isNonGeographicCallingCode(this.countryCallingCode);
  2592. }
  2593. }, {
  2594. key: "isEqual",
  2595. value: function isEqual(phoneNumber) {
  2596. return this.number === phoneNumber.number && this.ext === phoneNumber.ext;
  2597. }
  2598. // This function was originally meant to be an equivalent for `validatePhoneNumberLength()`,
  2599. // but later it was found out that it doesn't include the possible `TOO_SHORT` result
  2600. // returned from `parsePhoneNumberWithError()` in the original `validatePhoneNumberLength()`,
  2601. // so eventually I simply commented out this method from the `PhoneNumber` class
  2602. // and just left the `validatePhoneNumberLength()` function, even though that one would require
  2603. // and additional step to also validate the actual country / calling code of the phone number.
  2604. // validateLength() {
  2605. // const metadata = new Metadata(this.getMetadata())
  2606. // metadata.selectNumberingPlan(this.countryCallingCode)
  2607. // const result = checkNumberLength(this.nationalNumber, metadata)
  2608. // if (result !== 'IS_POSSIBLE') {
  2609. // return result
  2610. // }
  2611. // }
  2612. }, {
  2613. key: "getType",
  2614. value: function getType2() {
  2615. return getNumberType(this, {
  2616. v2: true
  2617. }, this.getMetadata());
  2618. }
  2619. }, {
  2620. key: "format",
  2621. value: function format(_format, options) {
  2622. return formatNumber2(this, _format, options ? _objectSpread2(_objectSpread2({}, options), {}, {
  2623. v2: true
  2624. }) : {
  2625. v2: true
  2626. }, this.getMetadata());
  2627. }
  2628. }, {
  2629. key: "formatNational",
  2630. value: function formatNational(options) {
  2631. return this.format("NATIONAL", options);
  2632. }
  2633. }, {
  2634. key: "formatInternational",
  2635. value: function formatInternational(options) {
  2636. return this.format("INTERNATIONAL", options);
  2637. }
  2638. }, {
  2639. key: "getURI",
  2640. value: function getURI(options) {
  2641. return this.format("RFC3966", options);
  2642. }
  2643. }]);
  2644. return PhoneNumber2;
  2645. }();
  2646. var isCountryCode = function isCountryCode2(value) {
  2647. return /^[A-Z]{2}$/.test(value);
  2648. };
  2649. function getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadataJson) {
  2650. var country2;
  2651. var countryCallingCode;
  2652. var metadata = new Metadata(metadataJson);
  2653. if (isCountryCode(countryOrCountryCallingCode)) {
  2654. country2 = countryOrCountryCallingCode;
  2655. metadata.selectNumberingPlan(country2);
  2656. countryCallingCode = metadata.countryCallingCode();
  2657. } else {
  2658. countryCallingCode = countryOrCountryCallingCode;
  2659. if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {
  2660. if (metadata.isNonGeographicCallingCode(countryCallingCode)) {
  2661. country2 = "001";
  2662. }
  2663. }
  2664. }
  2665. return {
  2666. country: country2,
  2667. countryCallingCode
  2668. };
  2669. }
  2670. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/AsYouTypeState.js
  2671. function _classCallCheck7(instance, Constructor) {
  2672. if (!(instance instanceof Constructor)) {
  2673. throw new TypeError("Cannot call a class as a function");
  2674. }
  2675. }
  2676. function _defineProperties7(target, props) {
  2677. for (var i = 0; i < props.length; i++) {
  2678. var descriptor = props[i];
  2679. descriptor.enumerable = descriptor.enumerable || false;
  2680. descriptor.configurable = true;
  2681. if ("value" in descriptor)
  2682. descriptor.writable = true;
  2683. Object.defineProperty(target, descriptor.key, descriptor);
  2684. }
  2685. }
  2686. function _createClass7(Constructor, protoProps, staticProps) {
  2687. if (protoProps)
  2688. _defineProperties7(Constructor.prototype, protoProps);
  2689. if (staticProps)
  2690. _defineProperties7(Constructor, staticProps);
  2691. Object.defineProperty(Constructor, "prototype", { writable: false });
  2692. return Constructor;
  2693. }
  2694. var AsYouTypeState = function() {
  2695. function AsYouTypeState2(_ref) {
  2696. var onCountryChange = _ref.onCountryChange, onCallingCodeChange = _ref.onCallingCodeChange;
  2697. _classCallCheck7(this, AsYouTypeState2);
  2698. this.onCountryChange = onCountryChange;
  2699. this.onCallingCodeChange = onCallingCodeChange;
  2700. }
  2701. _createClass7(AsYouTypeState2, [{
  2702. key: "reset",
  2703. value: function reset(_ref2) {
  2704. var country2 = _ref2.country, callingCode = _ref2.callingCode;
  2705. this.international = false;
  2706. this.missingPlus = false;
  2707. this.IDDPrefix = void 0;
  2708. this.callingCode = void 0;
  2709. this.digits = "";
  2710. this.resetNationalSignificantNumber();
  2711. this.initCountryAndCallingCode(country2, callingCode);
  2712. }
  2713. }, {
  2714. key: "resetNationalSignificantNumber",
  2715. value: function resetNationalSignificantNumber() {
  2716. this.nationalSignificantNumber = this.getNationalDigits();
  2717. this.nationalSignificantNumberMatchesInput = true;
  2718. this.nationalPrefix = void 0;
  2719. this.carrierCode = void 0;
  2720. this.complexPrefixBeforeNationalSignificantNumber = void 0;
  2721. }
  2722. }, {
  2723. key: "update",
  2724. value: function update(properties) {
  2725. for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) {
  2726. var key = _Object$keys[_i];
  2727. this[key] = properties[key];
  2728. }
  2729. }
  2730. }, {
  2731. key: "initCountryAndCallingCode",
  2732. value: function initCountryAndCallingCode(country2, callingCode) {
  2733. this.setCountry(country2);
  2734. this.setCallingCode(callingCode);
  2735. }
  2736. }, {
  2737. key: "setCountry",
  2738. value: function setCountry(country2) {
  2739. this.country = country2;
  2740. this.onCountryChange(country2);
  2741. }
  2742. }, {
  2743. key: "setCallingCode",
  2744. value: function setCallingCode(callingCode) {
  2745. this.callingCode = callingCode;
  2746. this.onCallingCodeChange(callingCode, this.country);
  2747. }
  2748. }, {
  2749. key: "startInternationalNumber",
  2750. value: function startInternationalNumber(country2, callingCode) {
  2751. this.international = true;
  2752. this.initCountryAndCallingCode(country2, callingCode);
  2753. }
  2754. }, {
  2755. key: "appendDigits",
  2756. value: function appendDigits(nextDigits) {
  2757. this.digits += nextDigits;
  2758. }
  2759. }, {
  2760. key: "appendNationalSignificantNumberDigits",
  2761. value: function appendNationalSignificantNumberDigits(nextDigits) {
  2762. this.nationalSignificantNumber += nextDigits;
  2763. }
  2764. /**
  2765. * Returns the part of `this.digits` that corresponds to the national number.
  2766. * Basically, all digits that have been input by the user, except for the
  2767. * international prefix and the country calling code part
  2768. * (if the number is an international one).
  2769. * @return {string}
  2770. */
  2771. }, {
  2772. key: "getNationalDigits",
  2773. value: function getNationalDigits() {
  2774. if (this.international) {
  2775. return this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0));
  2776. }
  2777. return this.digits;
  2778. }
  2779. }, {
  2780. key: "getDigitsWithoutInternationalPrefix",
  2781. value: function getDigitsWithoutInternationalPrefix() {
  2782. if (this.international) {
  2783. if (this.IDDPrefix) {
  2784. return this.digits.slice(this.IDDPrefix.length);
  2785. }
  2786. }
  2787. return this.digits;
  2788. }
  2789. }]);
  2790. return AsYouTypeState2;
  2791. }();
  2792. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js
  2793. var CAPTURING_DIGIT_PATTERN = new RegExp("([" + VALID_DIGITS + "])");
  2794. function stripIddPrefix(number, country2, callingCode, metadata) {
  2795. if (!country2) {
  2796. return;
  2797. }
  2798. var countryMetadata = new Metadata(metadata);
  2799. countryMetadata.selectNumberingPlan(country2, callingCode);
  2800. var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());
  2801. if (number.search(IDDPrefixPattern) !== 0) {
  2802. return;
  2803. }
  2804. number = number.slice(number.match(IDDPrefixPattern)[0].length);
  2805. var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);
  2806. if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {
  2807. if (matchedGroups[1] === "0") {
  2808. return;
  2809. }
  2810. }
  2811. return number;
  2812. }
  2813. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js
  2814. function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {
  2815. if (number && metadata.numberingPlan.nationalPrefixForParsing()) {
  2816. var prefixPattern = new RegExp("^(?:" + metadata.numberingPlan.nationalPrefixForParsing() + ")");
  2817. var prefixMatch = prefixPattern.exec(number);
  2818. if (prefixMatch) {
  2819. var nationalNumber;
  2820. var carrierCode;
  2821. var capturedGroupsCount = prefixMatch.length - 1;
  2822. var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];
  2823. if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {
  2824. nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule());
  2825. if (capturedGroupsCount > 1) {
  2826. carrierCode = prefixMatch[1];
  2827. }
  2828. } else {
  2829. var prefixBeforeNationalNumber = prefixMatch[0];
  2830. nationalNumber = number.slice(prefixBeforeNationalNumber.length);
  2831. if (hasCapturedGroups) {
  2832. carrierCode = prefixMatch[1];
  2833. }
  2834. }
  2835. var nationalPrefix;
  2836. if (hasCapturedGroups) {
  2837. var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);
  2838. var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup);
  2839. if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {
  2840. nationalPrefix = metadata.numberingPlan.nationalPrefix();
  2841. }
  2842. } else {
  2843. nationalPrefix = prefixMatch[0];
  2844. }
  2845. return {
  2846. nationalNumber,
  2847. nationalPrefix,
  2848. carrierCode
  2849. };
  2850. }
  2851. }
  2852. return {
  2853. nationalNumber: number
  2854. };
  2855. }
  2856. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js
  2857. function extractNationalNumber(number, metadata) {
  2858. var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata), carrierCode = _extractNationalNumbe.carrierCode, nationalNumber = _extractNationalNumbe.nationalNumber;
  2859. if (nationalNumber !== number) {
  2860. if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata)) {
  2861. return {
  2862. nationalNumber: number
  2863. };
  2864. }
  2865. if (metadata.possibleLengths()) {
  2866. if (!isPossibleIncompleteNationalNumber(nationalNumber, metadata)) {
  2867. return {
  2868. nationalNumber: number
  2869. };
  2870. }
  2871. }
  2872. }
  2873. return {
  2874. nationalNumber,
  2875. carrierCode
  2876. };
  2877. }
  2878. function shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata) {
  2879. if (matchesEntirely(nationalNumberBefore, metadata.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata.nationalNumberPattern())) {
  2880. return false;
  2881. }
  2882. return true;
  2883. }
  2884. function isPossibleIncompleteNationalNumber(nationalNumber, metadata) {
  2885. switch (checkNumberLength(nationalNumber, metadata)) {
  2886. case "TOO_SHORT":
  2887. case "INVALID_LENGTH":
  2888. return false;
  2889. default:
  2890. return true;
  2891. }
  2892. }
  2893. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js
  2894. function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country2, callingCode, metadata) {
  2895. var countryCallingCode = country2 ? getCountryCallingCode(country2, metadata) : callingCode;
  2896. if (number.indexOf(countryCallingCode) === 0) {
  2897. metadata = new Metadata(metadata);
  2898. metadata.selectNumberingPlan(country2, callingCode);
  2899. var possibleShorterNumber = number.slice(countryCallingCode.length);
  2900. var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, metadata), possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;
  2901. var _extractNationalNumbe2 = extractNationalNumber(number, metadata), nationalNumber = _extractNationalNumbe2.nationalNumber;
  2902. if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, metadata) === "TOO_LONG") {
  2903. return {
  2904. countryCallingCode,
  2905. number: possibleShorterNumber
  2906. };
  2907. }
  2908. }
  2909. return {
  2910. number
  2911. };
  2912. }
  2913. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js
  2914. function extractCountryCallingCode(number, country2, callingCode, metadata) {
  2915. if (!number) {
  2916. return {};
  2917. }
  2918. var isNumberWithIddPrefix;
  2919. if (number[0] !== "+") {
  2920. var numberWithoutIDD = stripIddPrefix(number, country2, callingCode, metadata);
  2921. if (numberWithoutIDD && numberWithoutIDD !== number) {
  2922. isNumberWithIddPrefix = true;
  2923. number = "+" + numberWithoutIDD;
  2924. } else {
  2925. if (country2 || callingCode) {
  2926. var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country2, callingCode, metadata), countryCallingCode = _extractCountryCallin.countryCallingCode, shorterNumber = _extractCountryCallin.number;
  2927. if (countryCallingCode) {
  2928. return {
  2929. countryCallingCodeSource: "FROM_NUMBER_WITHOUT_PLUS_SIGN",
  2930. countryCallingCode,
  2931. number: shorterNumber
  2932. };
  2933. }
  2934. }
  2935. return {
  2936. // No need to set it to `UNSPECIFIED`. It can be just `undefined`.
  2937. // countryCallingCodeSource: 'UNSPECIFIED',
  2938. number
  2939. };
  2940. }
  2941. }
  2942. if (number[1] === "0") {
  2943. return {};
  2944. }
  2945. metadata = new Metadata(metadata);
  2946. var i = 2;
  2947. while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {
  2948. var _countryCallingCode = number.slice(1, i);
  2949. if (metadata.hasCallingCode(_countryCallingCode)) {
  2950. metadata.selectNumberingPlan(_countryCallingCode);
  2951. return {
  2952. countryCallingCodeSource: isNumberWithIddPrefix ? "FROM_NUMBER_WITH_IDD" : "FROM_NUMBER_WITH_PLUS_SIGN",
  2953. countryCallingCode: _countryCallingCode,
  2954. number: number.slice(i)
  2955. };
  2956. }
  2957. i++;
  2958. }
  2959. return {};
  2960. }
  2961. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/AsYouTypeParser.js
  2962. function _slicedToArray2(arr, i) {
  2963. return _arrayWithHoles2(arr) || _iterableToArrayLimit2(arr, i) || _unsupportedIterableToArray10(arr, i) || _nonIterableRest2();
  2964. }
  2965. function _nonIterableRest2() {
  2966. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2967. }
  2968. function _unsupportedIterableToArray10(o, minLen) {
  2969. if (!o)
  2970. return;
  2971. if (typeof o === "string")
  2972. return _arrayLikeToArray10(o, minLen);
  2973. var n = Object.prototype.toString.call(o).slice(8, -1);
  2974. if (n === "Object" && o.constructor)
  2975. n = o.constructor.name;
  2976. if (n === "Map" || n === "Set")
  2977. return Array.from(o);
  2978. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  2979. return _arrayLikeToArray10(o, minLen);
  2980. }
  2981. function _arrayLikeToArray10(arr, len) {
  2982. if (len == null || len > arr.length)
  2983. len = arr.length;
  2984. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  2985. arr2[i] = arr[i];
  2986. }
  2987. return arr2;
  2988. }
  2989. function _iterableToArrayLimit2(arr, i) {
  2990. var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
  2991. if (_i == null)
  2992. return;
  2993. var _arr = [];
  2994. var _n = true;
  2995. var _d = false;
  2996. var _s, _e;
  2997. try {
  2998. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  2999. _arr.push(_s.value);
  3000. if (i && _arr.length === i)
  3001. break;
  3002. }
  3003. } catch (err) {
  3004. _d = true;
  3005. _e = err;
  3006. } finally {
  3007. try {
  3008. if (!_n && _i["return"] != null)
  3009. _i["return"]();
  3010. } finally {
  3011. if (_d)
  3012. throw _e;
  3013. }
  3014. }
  3015. return _arr;
  3016. }
  3017. function _arrayWithHoles2(arr) {
  3018. if (Array.isArray(arr))
  3019. return arr;
  3020. }
  3021. function _classCallCheck8(instance, Constructor) {
  3022. if (!(instance instanceof Constructor)) {
  3023. throw new TypeError("Cannot call a class as a function");
  3024. }
  3025. }
  3026. function _defineProperties8(target, props) {
  3027. for (var i = 0; i < props.length; i++) {
  3028. var descriptor = props[i];
  3029. descriptor.enumerable = descriptor.enumerable || false;
  3030. descriptor.configurable = true;
  3031. if ("value" in descriptor)
  3032. descriptor.writable = true;
  3033. Object.defineProperty(target, descriptor.key, descriptor);
  3034. }
  3035. }
  3036. function _createClass8(Constructor, protoProps, staticProps) {
  3037. if (protoProps)
  3038. _defineProperties8(Constructor.prototype, protoProps);
  3039. if (staticProps)
  3040. _defineProperties8(Constructor, staticProps);
  3041. Object.defineProperty(Constructor, "prototype", { writable: false });
  3042. return Constructor;
  3043. }
  3044. var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = "[" + VALID_PUNCTUATION + VALID_DIGITS + "]+";
  3045. var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp("^" + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + "$", "i");
  3046. var VALID_FORMATTED_PHONE_NUMBER_PART = "(?:[" + PLUS_CHARS + "][" + VALID_PUNCTUATION + VALID_DIGITS + "]*|[" + VALID_PUNCTUATION + VALID_DIGITS + "]+)";
  3047. var AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp("[^" + VALID_PUNCTUATION + VALID_DIGITS + "]+.*$");
  3048. var COMPLEX_NATIONAL_PREFIX = /[^\d\[\]]/;
  3049. var AsYouTypeParser = function() {
  3050. function AsYouTypeParser2(_ref) {
  3051. var defaultCountry = _ref.defaultCountry, defaultCallingCode = _ref.defaultCallingCode, metadata = _ref.metadata, onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;
  3052. _classCallCheck8(this, AsYouTypeParser2);
  3053. this.defaultCountry = defaultCountry;
  3054. this.defaultCallingCode = defaultCallingCode;
  3055. this.metadata = metadata;
  3056. this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;
  3057. }
  3058. _createClass8(AsYouTypeParser2, [{
  3059. key: "input",
  3060. value: function input(text, state) {
  3061. var _extractFormattedDigi = extractFormattedDigitsAndPlus(text), _extractFormattedDigi2 = _slicedToArray2(_extractFormattedDigi, 2), formattedDigits = _extractFormattedDigi2[0], hasPlus = _extractFormattedDigi2[1];
  3062. var digits = parseDigits(formattedDigits);
  3063. var justLeadingPlus;
  3064. if (hasPlus) {
  3065. if (!state.digits) {
  3066. state.startInternationalNumber();
  3067. if (!digits) {
  3068. justLeadingPlus = true;
  3069. }
  3070. }
  3071. }
  3072. if (digits) {
  3073. this.inputDigits(digits, state);
  3074. }
  3075. return {
  3076. digits,
  3077. justLeadingPlus
  3078. };
  3079. }
  3080. /**
  3081. * Inputs "next" phone number digits.
  3082. * @param {string} digits
  3083. * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means "don't format the national phone number at this stage".
  3084. */
  3085. }, {
  3086. key: "inputDigits",
  3087. value: function inputDigits(nextDigits, state) {
  3088. var digits = state.digits;
  3089. var hasReceivedThreeLeadingDigits = digits.length < 3 && digits.length + nextDigits.length >= 3;
  3090. state.appendDigits(nextDigits);
  3091. if (hasReceivedThreeLeadingDigits) {
  3092. this.extractIddPrefix(state);
  3093. }
  3094. if (this.isWaitingForCountryCallingCode(state)) {
  3095. if (!this.extractCountryCallingCode(state)) {
  3096. return;
  3097. }
  3098. } else {
  3099. state.appendNationalSignificantNumberDigits(nextDigits);
  3100. }
  3101. if (!state.international) {
  3102. if (!this.hasExtractedNationalSignificantNumber) {
  3103. this.extractNationalSignificantNumber(state.getNationalDigits(), function(stateUpdate) {
  3104. return state.update(stateUpdate);
  3105. });
  3106. }
  3107. }
  3108. }
  3109. }, {
  3110. key: "isWaitingForCountryCallingCode",
  3111. value: function isWaitingForCountryCallingCode(_ref2) {
  3112. var international = _ref2.international, callingCode = _ref2.callingCode;
  3113. return international && !callingCode;
  3114. }
  3115. // Extracts a country calling code from a number
  3116. // being entered in internatonal format.
  3117. }, {
  3118. key: "extractCountryCallingCode",
  3119. value: function extractCountryCallingCode2(state) {
  3120. var _extractCountryCallin = extractCountryCallingCode("+" + state.getDigitsWithoutInternationalPrefix(), this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number;
  3121. if (countryCallingCode) {
  3122. state.setCallingCode(countryCallingCode);
  3123. state.update({
  3124. nationalSignificantNumber: number
  3125. });
  3126. return true;
  3127. }
  3128. }
  3129. }, {
  3130. key: "reset",
  3131. value: function reset(numberingPlan) {
  3132. if (numberingPlan) {
  3133. this.hasSelectedNumberingPlan = true;
  3134. var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();
  3135. this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);
  3136. } else {
  3137. this.hasSelectedNumberingPlan = void 0;
  3138. this.couldPossiblyExtractAnotherNationalSignificantNumber = void 0;
  3139. }
  3140. }
  3141. /**
  3142. * Extracts a national (significant) number from user input.
  3143. * Google's library is different in that it only applies `national_prefix_for_parsing`
  3144. * and doesn't apply `national_prefix_transform_rule` after that.
  3145. * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539
  3146. * @return {boolean} [extracted]
  3147. */
  3148. }, {
  3149. key: "extractNationalSignificantNumber",
  3150. value: function extractNationalSignificantNumber(nationalDigits, setState) {
  3151. if (!this.hasSelectedNumberingPlan) {
  3152. return;
  3153. }
  3154. var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata), nationalPrefix = _extractNationalNumbe.nationalPrefix, nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode;
  3155. if (nationalNumber === nationalDigits) {
  3156. return;
  3157. }
  3158. this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
  3159. return true;
  3160. }
  3161. /**
  3162. * In Google's code this function is called "attempt to extract longer NDD".
  3163. * "Some national prefixes are a substring of others", they say.
  3164. * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.
  3165. */
  3166. }, {
  3167. key: "extractAnotherNationalSignificantNumber",
  3168. value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {
  3169. if (!this.hasExtractedNationalSignificantNumber) {
  3170. return this.extractNationalSignificantNumber(nationalDigits, setState);
  3171. }
  3172. if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {
  3173. return;
  3174. }
  3175. var _extractNationalNumbe2 = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata), nationalPrefix = _extractNationalNumbe2.nationalPrefix, nationalNumber = _extractNationalNumbe2.nationalNumber, carrierCode = _extractNationalNumbe2.carrierCode;
  3176. if (nationalNumber === prevNationalSignificantNumber) {
  3177. return;
  3178. }
  3179. this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
  3180. return true;
  3181. }
  3182. }, {
  3183. key: "onExtractedNationalNumber",
  3184. value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) {
  3185. var complexPrefixBeforeNationalSignificantNumber;
  3186. var nationalSignificantNumberMatchesInput;
  3187. var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber);
  3188. if (nationalSignificantNumberIndex >= 0 && nationalSignificantNumberIndex === nationalDigits.length - nationalSignificantNumber.length) {
  3189. nationalSignificantNumberMatchesInput = true;
  3190. var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex);
  3191. if (prefixBeforeNationalNumber !== nationalPrefix) {
  3192. complexPrefixBeforeNationalSignificantNumber = prefixBeforeNationalNumber;
  3193. }
  3194. }
  3195. setState({
  3196. nationalPrefix,
  3197. carrierCode,
  3198. nationalSignificantNumber,
  3199. nationalSignificantNumberMatchesInput,
  3200. complexPrefixBeforeNationalSignificantNumber
  3201. });
  3202. this.hasExtractedNationalSignificantNumber = true;
  3203. this.onNationalSignificantNumberChange();
  3204. }
  3205. }, {
  3206. key: "reExtractNationalSignificantNumber",
  3207. value: function reExtractNationalSignificantNumber(state) {
  3208. if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, function(stateUpdate) {
  3209. return state.update(stateUpdate);
  3210. })) {
  3211. return true;
  3212. }
  3213. if (this.extractIddPrefix(state)) {
  3214. this.extractCallingCodeAndNationalSignificantNumber(state);
  3215. return true;
  3216. }
  3217. if (this.fixMissingPlus(state)) {
  3218. this.extractCallingCodeAndNationalSignificantNumber(state);
  3219. return true;
  3220. }
  3221. }
  3222. }, {
  3223. key: "extractIddPrefix",
  3224. value: function extractIddPrefix(state) {
  3225. var international = state.international, IDDPrefix = state.IDDPrefix, digits = state.digits, nationalSignificantNumber = state.nationalSignificantNumber;
  3226. if (international || IDDPrefix) {
  3227. return;
  3228. }
  3229. var numberWithoutIDD = stripIddPrefix(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);
  3230. if (numberWithoutIDD !== void 0 && numberWithoutIDD !== digits) {
  3231. state.update({
  3232. IDDPrefix: digits.slice(0, digits.length - numberWithoutIDD.length)
  3233. });
  3234. this.startInternationalNumber(state, {
  3235. country: void 0,
  3236. callingCode: void 0
  3237. });
  3238. return true;
  3239. }
  3240. }
  3241. }, {
  3242. key: "fixMissingPlus",
  3243. value: function fixMissingPlus(state) {
  3244. if (!state.international) {
  3245. var _extractCountryCallin2 = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(state.digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), newCallingCode = _extractCountryCallin2.countryCallingCode, number = _extractCountryCallin2.number;
  3246. if (newCallingCode) {
  3247. state.update({
  3248. missingPlus: true
  3249. });
  3250. this.startInternationalNumber(state, {
  3251. country: state.country,
  3252. callingCode: newCallingCode
  3253. });
  3254. return true;
  3255. }
  3256. }
  3257. }
  3258. }, {
  3259. key: "startInternationalNumber",
  3260. value: function startInternationalNumber(state, _ref3) {
  3261. var country2 = _ref3.country, callingCode = _ref3.callingCode;
  3262. state.startInternationalNumber(country2, callingCode);
  3263. if (state.nationalSignificantNumber) {
  3264. state.resetNationalSignificantNumber();
  3265. this.onNationalSignificantNumberChange();
  3266. this.hasExtractedNationalSignificantNumber = void 0;
  3267. }
  3268. }
  3269. }, {
  3270. key: "extractCallingCodeAndNationalSignificantNumber",
  3271. value: function extractCallingCodeAndNationalSignificantNumber(state) {
  3272. if (this.extractCountryCallingCode(state)) {
  3273. this.extractNationalSignificantNumber(state.getNationalDigits(), function(stateUpdate) {
  3274. return state.update(stateUpdate);
  3275. });
  3276. }
  3277. }
  3278. }]);
  3279. return AsYouTypeParser2;
  3280. }();
  3281. function extractFormattedPhoneNumber(text) {
  3282. var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART);
  3283. if (startsAt < 0) {
  3284. return;
  3285. }
  3286. text = text.slice(startsAt);
  3287. var hasPlus;
  3288. if (text[0] === "+") {
  3289. hasPlus = true;
  3290. text = text.slice("+".length);
  3291. }
  3292. text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, "");
  3293. if (hasPlus) {
  3294. text = "+" + text;
  3295. }
  3296. return text;
  3297. }
  3298. function _extractFormattedDigitsAndPlus(text) {
  3299. var extractedNumber = extractFormattedPhoneNumber(text) || "";
  3300. if (extractedNumber[0] === "+") {
  3301. return [extractedNumber.slice("+".length), true];
  3302. }
  3303. return [extractedNumber];
  3304. }
  3305. function extractFormattedDigitsAndPlus(text) {
  3306. var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text), _extractFormattedDigi4 = _slicedToArray2(_extractFormattedDigi3, 2), formattedDigits = _extractFormattedDigi4[0], hasPlus = _extractFormattedDigi4[1];
  3307. if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {
  3308. formattedDigits = "";
  3309. }
  3310. return [formattedDigits, hasPlus];
  3311. }
  3312. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js
  3313. function _createForOfIteratorHelperLoose10(o, allowArrayLike) {
  3314. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  3315. if (it)
  3316. return (it = it.call(o)).next.bind(it);
  3317. if (Array.isArray(o) || (it = _unsupportedIterableToArray11(o)) || allowArrayLike && o && typeof o.length === "number") {
  3318. if (it)
  3319. o = it;
  3320. var i = 0;
  3321. return function() {
  3322. if (i >= o.length)
  3323. return { done: true };
  3324. return { done: false, value: o[i++] };
  3325. };
  3326. }
  3327. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3328. }
  3329. function _unsupportedIterableToArray11(o, minLen) {
  3330. if (!o)
  3331. return;
  3332. if (typeof o === "string")
  3333. return _arrayLikeToArray11(o, minLen);
  3334. var n = Object.prototype.toString.call(o).slice(8, -1);
  3335. if (n === "Object" && o.constructor)
  3336. n = o.constructor.name;
  3337. if (n === "Map" || n === "Set")
  3338. return Array.from(o);
  3339. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  3340. return _arrayLikeToArray11(o, minLen);
  3341. }
  3342. function _arrayLikeToArray11(arr, len) {
  3343. if (len == null || len > arr.length)
  3344. len = arr.length;
  3345. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  3346. arr2[i] = arr[i];
  3347. }
  3348. return arr2;
  3349. }
  3350. function getCountryByNationalNumber(nationalPhoneNumber, _ref) {
  3351. var countries = _ref.countries, defaultCountry = _ref.defaultCountry, metadata = _ref.metadata;
  3352. metadata = new Metadata(metadata);
  3353. for (var _iterator = _createForOfIteratorHelperLoose10(countries), _step; !(_step = _iterator()).done; ) {
  3354. var country2 = _step.value;
  3355. metadata.country(country2);
  3356. if (metadata.leadingDigits()) {
  3357. if (nationalPhoneNumber && nationalPhoneNumber.search(metadata.leadingDigits()) === 0) {
  3358. return country2;
  3359. }
  3360. } else if (getNumberType({
  3361. phone: nationalPhoneNumber,
  3362. country: country2
  3363. }, void 0, metadata.metadata)) {
  3364. return country2;
  3365. }
  3366. }
  3367. }
  3368. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js
  3369. var USE_NON_GEOGRAPHIC_COUNTRY_CODE2 = false;
  3370. function getCountryByCallingCode(callingCode, _ref) {
  3371. var nationalPhoneNumber = _ref.nationalNumber, defaultCountry = _ref.defaultCountry, metadata = _ref.metadata;
  3372. if (USE_NON_GEOGRAPHIC_COUNTRY_CODE2) {
  3373. if (metadata.isNonGeographicCallingCode(callingCode)) {
  3374. return "001";
  3375. }
  3376. }
  3377. var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);
  3378. if (!possibleCountries) {
  3379. return;
  3380. }
  3381. if (possibleCountries.length === 1) {
  3382. return possibleCountries[0];
  3383. }
  3384. return getCountryByNationalNumber(nationalPhoneNumber, {
  3385. countries: possibleCountries,
  3386. defaultCountry,
  3387. metadata: metadata.metadata
  3388. });
  3389. }
  3390. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/AsYouType.js
  3391. function _slicedToArray3(arr, i) {
  3392. return _arrayWithHoles3(arr) || _iterableToArrayLimit3(arr, i) || _unsupportedIterableToArray12(arr, i) || _nonIterableRest3();
  3393. }
  3394. function _nonIterableRest3() {
  3395. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3396. }
  3397. function _unsupportedIterableToArray12(o, minLen) {
  3398. if (!o)
  3399. return;
  3400. if (typeof o === "string")
  3401. return _arrayLikeToArray12(o, minLen);
  3402. var n = Object.prototype.toString.call(o).slice(8, -1);
  3403. if (n === "Object" && o.constructor)
  3404. n = o.constructor.name;
  3405. if (n === "Map" || n === "Set")
  3406. return Array.from(o);
  3407. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  3408. return _arrayLikeToArray12(o, minLen);
  3409. }
  3410. function _arrayLikeToArray12(arr, len) {
  3411. if (len == null || len > arr.length)
  3412. len = arr.length;
  3413. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  3414. arr2[i] = arr[i];
  3415. }
  3416. return arr2;
  3417. }
  3418. function _iterableToArrayLimit3(arr, i) {
  3419. var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
  3420. if (_i == null)
  3421. return;
  3422. var _arr = [];
  3423. var _n = true;
  3424. var _d = false;
  3425. var _s, _e;
  3426. try {
  3427. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  3428. _arr.push(_s.value);
  3429. if (i && _arr.length === i)
  3430. break;
  3431. }
  3432. } catch (err) {
  3433. _d = true;
  3434. _e = err;
  3435. } finally {
  3436. try {
  3437. if (!_n && _i["return"] != null)
  3438. _i["return"]();
  3439. } finally {
  3440. if (_d)
  3441. throw _e;
  3442. }
  3443. }
  3444. return _arr;
  3445. }
  3446. function _arrayWithHoles3(arr) {
  3447. if (Array.isArray(arr))
  3448. return arr;
  3449. }
  3450. function _classCallCheck9(instance, Constructor) {
  3451. if (!(instance instanceof Constructor)) {
  3452. throw new TypeError("Cannot call a class as a function");
  3453. }
  3454. }
  3455. function _defineProperties9(target, props) {
  3456. for (var i = 0; i < props.length; i++) {
  3457. var descriptor = props[i];
  3458. descriptor.enumerable = descriptor.enumerable || false;
  3459. descriptor.configurable = true;
  3460. if ("value" in descriptor)
  3461. descriptor.writable = true;
  3462. Object.defineProperty(target, descriptor.key, descriptor);
  3463. }
  3464. }
  3465. function _createClass9(Constructor, protoProps, staticProps) {
  3466. if (protoProps)
  3467. _defineProperties9(Constructor.prototype, protoProps);
  3468. if (staticProps)
  3469. _defineProperties9(Constructor, staticProps);
  3470. Object.defineProperty(Constructor, "prototype", { writable: false });
  3471. return Constructor;
  3472. }
  3473. var USE_NON_GEOGRAPHIC_COUNTRY_CODE3 = false;
  3474. var AsYouType = function() {
  3475. function AsYouType2(optionsOrDefaultCountry, metadata) {
  3476. _classCallCheck9(this, AsYouType2);
  3477. this.metadata = new Metadata(metadata);
  3478. var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry), _this$getCountryAndCa2 = _slicedToArray3(_this$getCountryAndCa, 2), defaultCountry = _this$getCountryAndCa2[0], defaultCallingCode = _this$getCountryAndCa2[1];
  3479. this.defaultCountry = defaultCountry;
  3480. this.defaultCallingCode = defaultCallingCode;
  3481. this.reset();
  3482. }
  3483. _createClass9(AsYouType2, [{
  3484. key: "getCountryAndCallingCode",
  3485. value: function getCountryAndCallingCode(optionsOrDefaultCountry) {
  3486. var defaultCountry;
  3487. var defaultCallingCode;
  3488. if (optionsOrDefaultCountry) {
  3489. if (isObject(optionsOrDefaultCountry)) {
  3490. defaultCountry = optionsOrDefaultCountry.defaultCountry;
  3491. defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;
  3492. } else {
  3493. defaultCountry = optionsOrDefaultCountry;
  3494. }
  3495. }
  3496. if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {
  3497. defaultCountry = void 0;
  3498. }
  3499. if (defaultCallingCode) {
  3500. if (USE_NON_GEOGRAPHIC_COUNTRY_CODE3) {
  3501. if (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {
  3502. defaultCountry = "001";
  3503. }
  3504. }
  3505. }
  3506. return [defaultCountry, defaultCallingCode];
  3507. }
  3508. /**
  3509. * Inputs "next" phone number characters.
  3510. * @param {string} text
  3511. * @return {string} Formatted phone number characters that have been input so far.
  3512. */
  3513. }, {
  3514. key: "input",
  3515. value: function input(text) {
  3516. var _this$parser$input = this.parser.input(text, this.state), digits = _this$parser$input.digits, justLeadingPlus = _this$parser$input.justLeadingPlus;
  3517. if (justLeadingPlus) {
  3518. this.formattedOutput = "+";
  3519. } else if (digits) {
  3520. this.determineTheCountryIfNeeded();
  3521. if (this.state.nationalSignificantNumber) {
  3522. this.formatter.narrowDownMatchingFormats(this.state);
  3523. }
  3524. var formattedNationalNumber;
  3525. if (this.metadata.hasSelectedNumberingPlan()) {
  3526. formattedNationalNumber = this.formatter.format(digits, this.state);
  3527. }
  3528. if (formattedNationalNumber === void 0) {
  3529. if (this.parser.reExtractNationalSignificantNumber(this.state)) {
  3530. this.determineTheCountryIfNeeded();
  3531. var nationalDigits = this.state.getNationalDigits();
  3532. if (nationalDigits) {
  3533. formattedNationalNumber = this.formatter.format(nationalDigits, this.state);
  3534. }
  3535. }
  3536. }
  3537. this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();
  3538. }
  3539. return this.formattedOutput;
  3540. }
  3541. }, {
  3542. key: "reset",
  3543. value: function reset() {
  3544. var _this = this;
  3545. this.state = new AsYouTypeState({
  3546. onCountryChange: function onCountryChange(country2) {
  3547. _this.country = country2;
  3548. },
  3549. onCallingCodeChange: function onCallingCodeChange(callingCode, country2) {
  3550. _this.metadata.selectNumberingPlan(country2, callingCode);
  3551. _this.formatter.reset(_this.metadata.numberingPlan, _this.state);
  3552. _this.parser.reset(_this.metadata.numberingPlan);
  3553. }
  3554. });
  3555. this.formatter = new AsYouTypeFormatter({
  3556. state: this.state,
  3557. metadata: this.metadata
  3558. });
  3559. this.parser = new AsYouTypeParser({
  3560. defaultCountry: this.defaultCountry,
  3561. defaultCallingCode: this.defaultCallingCode,
  3562. metadata: this.metadata,
  3563. state: this.state,
  3564. onNationalSignificantNumberChange: function onNationalSignificantNumberChange() {
  3565. _this.determineTheCountryIfNeeded();
  3566. _this.formatter.reset(_this.metadata.numberingPlan, _this.state);
  3567. }
  3568. });
  3569. this.state.reset({
  3570. country: this.defaultCountry,
  3571. callingCode: this.defaultCallingCode
  3572. });
  3573. this.formattedOutput = "";
  3574. return this;
  3575. }
  3576. /**
  3577. * Returns `true` if the phone number is being input in international format.
  3578. * In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
  3579. * @return {boolean}
  3580. */
  3581. }, {
  3582. key: "isInternational",
  3583. value: function isInternational() {
  3584. return this.state.international;
  3585. }
  3586. /**
  3587. * Returns the "calling code" part of the phone number when it's being input
  3588. * in an international format.
  3589. * If no valid calling code has been entered so far, returns `undefined`.
  3590. * @return {string} [callingCode]
  3591. */
  3592. }, {
  3593. key: "getCallingCode",
  3594. value: function getCallingCode() {
  3595. if (this.isInternational()) {
  3596. return this.state.callingCode;
  3597. }
  3598. }
  3599. // A legacy alias.
  3600. }, {
  3601. key: "getCountryCallingCode",
  3602. value: function getCountryCallingCode2() {
  3603. return this.getCallingCode();
  3604. }
  3605. /**
  3606. * Returns a two-letter country code of the phone number.
  3607. * Returns `undefined` for "non-geographic" phone numbering plans.
  3608. * Returns `undefined` if no phone number has been input yet.
  3609. * @return {string} [country]
  3610. */
  3611. }, {
  3612. key: "getCountry",
  3613. value: function getCountry() {
  3614. var digits = this.state.digits;
  3615. if (digits) {
  3616. return this._getCountry();
  3617. }
  3618. }
  3619. /**
  3620. * Returns a two-letter country code of the phone number.
  3621. * Returns `undefined` for "non-geographic" phone numbering plans.
  3622. * @return {string} [country]
  3623. */
  3624. }, {
  3625. key: "_getCountry",
  3626. value: function _getCountry() {
  3627. var country2 = this.state.country;
  3628. if (USE_NON_GEOGRAPHIC_COUNTRY_CODE3) {
  3629. if (country2 === "001") {
  3630. return;
  3631. }
  3632. }
  3633. return country2;
  3634. }
  3635. }, {
  3636. key: "determineTheCountryIfNeeded",
  3637. value: function determineTheCountryIfNeeded() {
  3638. if (!this.state.country || this.isCountryCallingCodeAmbiguous()) {
  3639. this.determineTheCountry();
  3640. }
  3641. }
  3642. // Prepends `+CountryCode ` in case of an international phone number
  3643. }, {
  3644. key: "getFullNumber",
  3645. value: function getFullNumber(formattedNationalNumber) {
  3646. var _this2 = this;
  3647. if (this.isInternational()) {
  3648. var prefix = function prefix2(text) {
  3649. return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, {
  3650. spacing: text ? true : false
  3651. }) + text;
  3652. };
  3653. var callingCode = this.state.callingCode;
  3654. if (!callingCode) {
  3655. return prefix("".concat(this.state.getDigitsWithoutInternationalPrefix()));
  3656. }
  3657. if (!formattedNationalNumber) {
  3658. return prefix(callingCode);
  3659. }
  3660. return prefix("".concat(callingCode, " ").concat(formattedNationalNumber));
  3661. }
  3662. return formattedNationalNumber;
  3663. }
  3664. }, {
  3665. key: "getNonFormattedNationalNumberWithPrefix",
  3666. value: function getNonFormattedNationalNumberWithPrefix() {
  3667. var _this$state = this.state, nationalSignificantNumber = _this$state.nationalSignificantNumber, complexPrefixBeforeNationalSignificantNumber = _this$state.complexPrefixBeforeNationalSignificantNumber, nationalPrefix = _this$state.nationalPrefix;
  3668. var number = nationalSignificantNumber;
  3669. var prefix = complexPrefixBeforeNationalSignificantNumber || nationalPrefix;
  3670. if (prefix) {
  3671. number = prefix + number;
  3672. }
  3673. return number;
  3674. }
  3675. }, {
  3676. key: "getNonFormattedNumber",
  3677. value: function getNonFormattedNumber() {
  3678. var nationalSignificantNumberMatchesInput = this.state.nationalSignificantNumberMatchesInput;
  3679. return this.getFullNumber(nationalSignificantNumberMatchesInput ? this.getNonFormattedNationalNumberWithPrefix() : this.state.getNationalDigits());
  3680. }
  3681. }, {
  3682. key: "getNonFormattedTemplate",
  3683. value: function getNonFormattedTemplate() {
  3684. var number = this.getNonFormattedNumber();
  3685. if (number) {
  3686. return number.replace(/[\+\d]/g, DIGIT_PLACEHOLDER);
  3687. }
  3688. }
  3689. }, {
  3690. key: "isCountryCallingCodeAmbiguous",
  3691. value: function isCountryCallingCodeAmbiguous() {
  3692. var callingCode = this.state.callingCode;
  3693. var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode);
  3694. return countryCodes && countryCodes.length > 1;
  3695. }
  3696. // Determines the country of the phone number
  3697. // entered so far based on the country phone code
  3698. // and the national phone number.
  3699. }, {
  3700. key: "determineTheCountry",
  3701. value: function determineTheCountry() {
  3702. this.state.setCountry(getCountryByCallingCode(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {
  3703. nationalNumber: this.state.nationalSignificantNumber,
  3704. defaultCountry: this.defaultCountry,
  3705. metadata: this.metadata
  3706. }));
  3707. }
  3708. /**
  3709. * Returns a E.164 phone number value for the user's input.
  3710. *
  3711. * For example, for country `"US"` and input `"(222) 333-4444"`
  3712. * it will return `"+12223334444"`.
  3713. *
  3714. * For international phone number input, it will also auto-correct
  3715. * some minor errors such as using a national prefix when writing
  3716. * an international phone number. For example, if the user inputs
  3717. * `"+44 0 7400 000000"` then it will return an auto-corrected
  3718. * `"+447400000000"` phone number value.
  3719. *
  3720. * Will return `undefined` if no digits have been input,
  3721. * or when inputting a phone number in national format and no
  3722. * default country or default "country calling code" have been set.
  3723. *
  3724. * @return {string} [value]
  3725. */
  3726. }, {
  3727. key: "getNumberValue",
  3728. value: function getNumberValue() {
  3729. var _this$state2 = this.state, digits = _this$state2.digits, callingCode = _this$state2.callingCode, country2 = _this$state2.country, nationalSignificantNumber = _this$state2.nationalSignificantNumber;
  3730. if (!digits) {
  3731. return;
  3732. }
  3733. if (this.isInternational()) {
  3734. if (callingCode) {
  3735. return "+" + callingCode + nationalSignificantNumber;
  3736. } else {
  3737. return "+" + digits;
  3738. }
  3739. } else {
  3740. if (country2 || callingCode) {
  3741. var callingCode_ = country2 ? this.metadata.countryCallingCode() : callingCode;
  3742. return "+" + callingCode_ + nationalSignificantNumber;
  3743. }
  3744. }
  3745. }
  3746. /**
  3747. * Returns an instance of `PhoneNumber` class.
  3748. * Will return `undefined` if no national (significant) number
  3749. * digits have been entered so far, or if no `defaultCountry` has been
  3750. * set and the user enters a phone number not in international format.
  3751. */
  3752. }, {
  3753. key: "getNumber",
  3754. value: function getNumber() {
  3755. var _this$state3 = this.state, nationalSignificantNumber = _this$state3.nationalSignificantNumber, carrierCode = _this$state3.carrierCode, callingCode = _this$state3.callingCode;
  3756. var country2 = this._getCountry();
  3757. if (!nationalSignificantNumber) {
  3758. return;
  3759. }
  3760. if (!country2 && !callingCode) {
  3761. return;
  3762. }
  3763. if (country2) {
  3764. if (country2 === this.defaultCountry) {
  3765. var metadata = new Metadata(this.metadata.metadata);
  3766. metadata.selectNumberingPlan(country2);
  3767. var _callingCode = metadata.numberingPlan.callingCode();
  3768. var ambiguousCountries = this.metadata.getCountryCodesForCallingCode(_callingCode);
  3769. if (ambiguousCountries.length > 1) {
  3770. var exactCountry = getCountryByNationalNumber(nationalSignificantNumber, {
  3771. countries: ambiguousCountries,
  3772. defaultCountry: this.defaultCountry,
  3773. metadata: this.metadata.metadata
  3774. });
  3775. if (exactCountry) {
  3776. country2 = exactCountry;
  3777. }
  3778. }
  3779. }
  3780. }
  3781. var phoneNumber = new PhoneNumber(country2 || callingCode, nationalSignificantNumber, this.metadata.metadata);
  3782. if (carrierCode) {
  3783. phoneNumber.carrierCode = carrierCode;
  3784. }
  3785. return phoneNumber;
  3786. }
  3787. /**
  3788. * Returns `true` if the phone number is "possible".
  3789. * Is just a shortcut for `PhoneNumber.isPossible()`.
  3790. * @return {boolean}
  3791. */
  3792. }, {
  3793. key: "isPossible",
  3794. value: function isPossible() {
  3795. var phoneNumber = this.getNumber();
  3796. if (!phoneNumber) {
  3797. return false;
  3798. }
  3799. return phoneNumber.isPossible();
  3800. }
  3801. /**
  3802. * Returns `true` if the phone number is "valid".
  3803. * Is just a shortcut for `PhoneNumber.isValid()`.
  3804. * @return {boolean}
  3805. */
  3806. }, {
  3807. key: "isValid",
  3808. value: function isValid() {
  3809. var phoneNumber = this.getNumber();
  3810. if (!phoneNumber) {
  3811. return false;
  3812. }
  3813. return phoneNumber.isValid();
  3814. }
  3815. /**
  3816. * @deprecated
  3817. * This method is used in `react-phone-number-input/source/input-control.js`
  3818. * in versions before `3.0.16`.
  3819. */
  3820. }, {
  3821. key: "getNationalNumber",
  3822. value: function getNationalNumber() {
  3823. return this.state.nationalSignificantNumber;
  3824. }
  3825. /**
  3826. * Returns the phone number characters entered by the user.
  3827. * @return {string}
  3828. */
  3829. }, {
  3830. key: "getChars",
  3831. value: function getChars() {
  3832. return (this.state.international ? "+" : "") + this.state.digits;
  3833. }
  3834. /**
  3835. * Returns the template for the formatted phone number.
  3836. * @return {string}
  3837. */
  3838. }, {
  3839. key: "getTemplate",
  3840. value: function getTemplate() {
  3841. return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || "";
  3842. }
  3843. }]);
  3844. return AsYouType2;
  3845. }();
  3846. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js
  3847. var EXTN_PATTERN = new RegExp("(?:" + createExtensionPattern() + ")$", "i");
  3848. function extractExtension(number) {
  3849. var start = number.search(EXTN_PATTERN);
  3850. if (start < 0) {
  3851. return {};
  3852. }
  3853. var numberWithoutExtension = number.slice(0, start);
  3854. var matches = number.match(EXTN_PATTERN);
  3855. var i = 1;
  3856. while (i < matches.length) {
  3857. if (matches[i]) {
  3858. return {
  3859. number: numberWithoutExtension,
  3860. ext: matches[i]
  3861. };
  3862. }
  3863. i++;
  3864. }
  3865. }
  3866. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js
  3867. var PLUS_SIGN = "+";
  3868. var RFC3966_VISUAL_SEPARATOR_ = "[\\-\\.\\(\\)]?";
  3869. var RFC3966_PHONE_DIGIT_ = "([" + VALID_DIGITS + "]|" + RFC3966_VISUAL_SEPARATOR_ + ")";
  3870. var RFC3966_GLOBAL_NUMBER_DIGITS_ = "^\\" + PLUS_SIGN + RFC3966_PHONE_DIGIT_ + "*[" + VALID_DIGITS + "]" + RFC3966_PHONE_DIGIT_ + "*$";
  3871. var RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_ = new RegExp(RFC3966_GLOBAL_NUMBER_DIGITS_, "g");
  3872. var ALPHANUM_ = VALID_DIGITS;
  3873. var RFC3966_DOMAINLABEL_ = "[" + ALPHANUM_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
  3874. var VALID_ALPHA_ = "a-zA-Z";
  3875. var RFC3966_TOPLABEL_ = "[" + VALID_ALPHA_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
  3876. var RFC3966_DOMAINNAME_ = "^(" + RFC3966_DOMAINLABEL_ + "\\.)*" + RFC3966_TOPLABEL_ + "\\.?$";
  3877. var RFC3966_DOMAINNAME_PATTERN_ = new RegExp(RFC3966_DOMAINNAME_, "g");
  3878. var RFC3966_PREFIX_ = "tel:";
  3879. var RFC3966_PHONE_CONTEXT_ = ";phone-context=";
  3880. var RFC3966_ISDN_SUBADDRESS_ = ";isub=";
  3881. function extractPhoneContext(numberToExtractFrom) {
  3882. var indexOfPhoneContext = numberToExtractFrom.indexOf(RFC3966_PHONE_CONTEXT_);
  3883. if (indexOfPhoneContext < 0) {
  3884. return null;
  3885. }
  3886. var phoneContextStart = indexOfPhoneContext + RFC3966_PHONE_CONTEXT_.length;
  3887. if (phoneContextStart >= numberToExtractFrom.length) {
  3888. return "";
  3889. }
  3890. var phoneContextEnd = numberToExtractFrom.indexOf(";", phoneContextStart);
  3891. if (phoneContextEnd >= 0) {
  3892. return numberToExtractFrom.substring(phoneContextStart, phoneContextEnd);
  3893. } else {
  3894. return numberToExtractFrom.substring(phoneContextStart);
  3895. }
  3896. }
  3897. function isPhoneContextValid(phoneContext) {
  3898. if (phoneContext === null) {
  3899. return true;
  3900. }
  3901. if (phoneContext.length === 0) {
  3902. return false;
  3903. }
  3904. return RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(phoneContext) || RFC3966_DOMAINNAME_PATTERN_.test(phoneContext);
  3905. }
  3906. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js
  3907. function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {
  3908. var extractFormattedPhoneNumber2 = _ref.extractFormattedPhoneNumber;
  3909. var phoneContext = extractPhoneContext(numberToParse);
  3910. if (!isPhoneContextValid(phoneContext)) {
  3911. throw new ParseError("NOT_A_NUMBER");
  3912. }
  3913. var phoneNumberString;
  3914. if (phoneContext === null) {
  3915. phoneNumberString = extractFormattedPhoneNumber2(numberToParse) || "";
  3916. } else {
  3917. phoneNumberString = "";
  3918. if (phoneContext.charAt(0) === PLUS_SIGN) {
  3919. phoneNumberString += phoneContext;
  3920. }
  3921. var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);
  3922. var indexOfNationalNumber;
  3923. if (indexOfRfc3966Prefix >= 0) {
  3924. indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;
  3925. } else {
  3926. indexOfNationalNumber = 0;
  3927. }
  3928. var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);
  3929. phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);
  3930. }
  3931. var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);
  3932. if (indexOfIsdn > 0) {
  3933. phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);
  3934. }
  3935. if (phoneNumberString !== "") {
  3936. return phoneNumberString;
  3937. }
  3938. }
  3939. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/parse.js
  3940. var MAX_INPUT_STRING_LENGTH = 250;
  3941. var PHONE_NUMBER_START_PATTERN = new RegExp("[" + PLUS_CHARS + VALID_DIGITS + "]");
  3942. var AFTER_PHONE_NUMBER_END_PATTERN = new RegExp("[^" + VALID_DIGITS + "#]+$");
  3943. var USE_NON_GEOGRAPHIC_COUNTRY_CODE4 = false;
  3944. function parse(text, options, metadata) {
  3945. options = options || {};
  3946. metadata = new Metadata(metadata);
  3947. if (options.defaultCountry && !metadata.hasCountry(options.defaultCountry)) {
  3948. if (options.v2) {
  3949. throw new ParseError("INVALID_COUNTRY");
  3950. }
  3951. throw new Error("Unknown country: ".concat(options.defaultCountry));
  3952. }
  3953. var _parseInput = parseInput(text, options.v2, options.extract), formattedPhoneNumber = _parseInput.number, ext = _parseInput.ext, error = _parseInput.error;
  3954. if (!formattedPhoneNumber) {
  3955. if (options.v2) {
  3956. if (error === "TOO_SHORT") {
  3957. throw new ParseError("TOO_SHORT");
  3958. }
  3959. throw new ParseError("NOT_A_NUMBER");
  3960. }
  3961. return {};
  3962. }
  3963. var _parsePhoneNumber = parsePhoneNumber(formattedPhoneNumber, options.defaultCountry, options.defaultCallingCode, metadata), country2 = _parsePhoneNumber.country, nationalNumber = _parsePhoneNumber.nationalNumber, countryCallingCode = _parsePhoneNumber.countryCallingCode, countryCallingCodeSource = _parsePhoneNumber.countryCallingCodeSource, carrierCode = _parsePhoneNumber.carrierCode;
  3964. if (!metadata.hasSelectedNumberingPlan()) {
  3965. if (options.v2) {
  3966. throw new ParseError("INVALID_COUNTRY");
  3967. }
  3968. return {};
  3969. }
  3970. if (!nationalNumber || nationalNumber.length < MIN_LENGTH_FOR_NSN) {
  3971. if (options.v2) {
  3972. throw new ParseError("TOO_SHORT");
  3973. }
  3974. return {};
  3975. }
  3976. if (nationalNumber.length > MAX_LENGTH_FOR_NSN) {
  3977. if (options.v2) {
  3978. throw new ParseError("TOO_LONG");
  3979. }
  3980. return {};
  3981. }
  3982. if (options.v2) {
  3983. var phoneNumber = new PhoneNumber(countryCallingCode, nationalNumber, metadata.metadata);
  3984. if (country2) {
  3985. phoneNumber.country = country2;
  3986. }
  3987. if (carrierCode) {
  3988. phoneNumber.carrierCode = carrierCode;
  3989. }
  3990. if (ext) {
  3991. phoneNumber.ext = ext;
  3992. }
  3993. phoneNumber.__countryCallingCodeSource = countryCallingCodeSource;
  3994. return phoneNumber;
  3995. }
  3996. var valid = (options.extended ? metadata.hasSelectedNumberingPlan() : country2) ? matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) : false;
  3997. if (!options.extended) {
  3998. return valid ? result(country2, nationalNumber, ext) : {};
  3999. }
  4000. return {
  4001. country: country2,
  4002. countryCallingCode,
  4003. carrierCode,
  4004. valid,
  4005. possible: valid ? true : options.extended === true && metadata.possibleLengths() && isPossibleNumber(nationalNumber, metadata) ? true : false,
  4006. phone: nationalNumber,
  4007. ext
  4008. };
  4009. }
  4010. function _extractFormattedPhoneNumber(text, extract, throwOnError) {
  4011. if (!text) {
  4012. return;
  4013. }
  4014. if (text.length > MAX_INPUT_STRING_LENGTH) {
  4015. if (throwOnError) {
  4016. throw new ParseError("TOO_LONG");
  4017. }
  4018. return;
  4019. }
  4020. if (extract === false) {
  4021. return text;
  4022. }
  4023. var startsAt = text.search(PHONE_NUMBER_START_PATTERN);
  4024. if (startsAt < 0) {
  4025. return;
  4026. }
  4027. return text.slice(startsAt).replace(AFTER_PHONE_NUMBER_END_PATTERN, "");
  4028. }
  4029. function parseInput(text, v2, extract) {
  4030. var number = extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(text, {
  4031. extractFormattedPhoneNumber: function extractFormattedPhoneNumber2(text2) {
  4032. return _extractFormattedPhoneNumber(text2, extract, v2);
  4033. }
  4034. });
  4035. if (!number) {
  4036. return {};
  4037. }
  4038. if (!isViablePhoneNumber(number)) {
  4039. if (isViablePhoneNumberStart(number)) {
  4040. return {
  4041. error: "TOO_SHORT"
  4042. };
  4043. }
  4044. return {};
  4045. }
  4046. var withExtensionStripped = extractExtension(number);
  4047. if (withExtensionStripped.ext) {
  4048. return withExtensionStripped;
  4049. }
  4050. return {
  4051. number
  4052. };
  4053. }
  4054. function result(country2, nationalNumber, ext) {
  4055. var result2 = {
  4056. country: country2,
  4057. phone: nationalNumber
  4058. };
  4059. if (ext) {
  4060. result2.ext = ext;
  4061. }
  4062. return result2;
  4063. }
  4064. function parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata) {
  4065. var _extractCountryCallin = extractCountryCallingCode(parseIncompletePhoneNumber(formattedPhoneNumber), defaultCountry, defaultCallingCode, metadata.metadata), countryCallingCodeSource = _extractCountryCallin.countryCallingCodeSource, countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number;
  4066. var country2;
  4067. if (countryCallingCode) {
  4068. metadata.selectNumberingPlan(countryCallingCode);
  4069. } else if (number && (defaultCountry || defaultCallingCode)) {
  4070. metadata.selectNumberingPlan(defaultCountry, defaultCallingCode);
  4071. if (defaultCountry) {
  4072. country2 = defaultCountry;
  4073. } else {
  4074. if (USE_NON_GEOGRAPHIC_COUNTRY_CODE4) {
  4075. if (metadata.isNonGeographicCallingCode(defaultCallingCode)) {
  4076. country2 = "001";
  4077. }
  4078. }
  4079. }
  4080. countryCallingCode = defaultCallingCode || getCountryCallingCode(defaultCountry, metadata.metadata);
  4081. } else
  4082. return {};
  4083. if (!number) {
  4084. return {
  4085. countryCallingCodeSource,
  4086. countryCallingCode
  4087. };
  4088. }
  4089. var _extractNationalNumbe = extractNationalNumber(parseIncompletePhoneNumber(number), metadata), nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode;
  4090. var exactCountry = getCountryByCallingCode(countryCallingCode, {
  4091. nationalNumber,
  4092. defaultCountry,
  4093. metadata
  4094. });
  4095. if (exactCountry) {
  4096. country2 = exactCountry;
  4097. if (exactCountry === "001") {
  4098. } else {
  4099. metadata.country(country2);
  4100. }
  4101. }
  4102. return {
  4103. country: country2,
  4104. countryCallingCode,
  4105. countryCallingCodeSource,
  4106. nationalNumber,
  4107. carrierCode
  4108. };
  4109. }
  4110. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js
  4111. function ownKeys3(object, enumerableOnly) {
  4112. var keys = Object.keys(object);
  4113. if (Object.getOwnPropertySymbols) {
  4114. var symbols = Object.getOwnPropertySymbols(object);
  4115. enumerableOnly && (symbols = symbols.filter(function(sym) {
  4116. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  4117. })), keys.push.apply(keys, symbols);
  4118. }
  4119. return keys;
  4120. }
  4121. function _objectSpread3(target) {
  4122. for (var i = 1; i < arguments.length; i++) {
  4123. var source = null != arguments[i] ? arguments[i] : {};
  4124. i % 2 ? ownKeys3(Object(source), true).forEach(function(key) {
  4125. _defineProperty3(target, key, source[key]);
  4126. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys3(Object(source)).forEach(function(key) {
  4127. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  4128. });
  4129. }
  4130. return target;
  4131. }
  4132. function _defineProperty3(obj, key, value) {
  4133. if (key in obj) {
  4134. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  4135. } else {
  4136. obj[key] = value;
  4137. }
  4138. return obj;
  4139. }
  4140. function parsePhoneNumberWithError(text, options, metadata) {
  4141. return parse(text, _objectSpread3(_objectSpread3({}, options), {}, {
  4142. v2: true
  4143. }), metadata);
  4144. }
  4145. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/normalizeArguments.js
  4146. function ownKeys4(object, enumerableOnly) {
  4147. var keys = Object.keys(object);
  4148. if (Object.getOwnPropertySymbols) {
  4149. var symbols = Object.getOwnPropertySymbols(object);
  4150. enumerableOnly && (symbols = symbols.filter(function(sym) {
  4151. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  4152. })), keys.push.apply(keys, symbols);
  4153. }
  4154. return keys;
  4155. }
  4156. function _objectSpread4(target) {
  4157. for (var i = 1; i < arguments.length; i++) {
  4158. var source = null != arguments[i] ? arguments[i] : {};
  4159. i % 2 ? ownKeys4(Object(source), true).forEach(function(key) {
  4160. _defineProperty4(target, key, source[key]);
  4161. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys4(Object(source)).forEach(function(key) {
  4162. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  4163. });
  4164. }
  4165. return target;
  4166. }
  4167. function _defineProperty4(obj, key, value) {
  4168. if (key in obj) {
  4169. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  4170. } else {
  4171. obj[key] = value;
  4172. }
  4173. return obj;
  4174. }
  4175. function _slicedToArray4(arr, i) {
  4176. return _arrayWithHoles4(arr) || _iterableToArrayLimit4(arr, i) || _unsupportedIterableToArray13(arr, i) || _nonIterableRest4();
  4177. }
  4178. function _nonIterableRest4() {
  4179. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  4180. }
  4181. function _unsupportedIterableToArray13(o, minLen) {
  4182. if (!o)
  4183. return;
  4184. if (typeof o === "string")
  4185. return _arrayLikeToArray13(o, minLen);
  4186. var n = Object.prototype.toString.call(o).slice(8, -1);
  4187. if (n === "Object" && o.constructor)
  4188. n = o.constructor.name;
  4189. if (n === "Map" || n === "Set")
  4190. return Array.from(o);
  4191. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  4192. return _arrayLikeToArray13(o, minLen);
  4193. }
  4194. function _arrayLikeToArray13(arr, len) {
  4195. if (len == null || len > arr.length)
  4196. len = arr.length;
  4197. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  4198. arr2[i] = arr[i];
  4199. }
  4200. return arr2;
  4201. }
  4202. function _iterableToArrayLimit4(arr, i) {
  4203. var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
  4204. if (_i == null)
  4205. return;
  4206. var _arr = [];
  4207. var _n = true;
  4208. var _d = false;
  4209. var _s, _e;
  4210. try {
  4211. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  4212. _arr.push(_s.value);
  4213. if (i && _arr.length === i)
  4214. break;
  4215. }
  4216. } catch (err) {
  4217. _d = true;
  4218. _e = err;
  4219. } finally {
  4220. try {
  4221. if (!_n && _i["return"] != null)
  4222. _i["return"]();
  4223. } finally {
  4224. if (_d)
  4225. throw _e;
  4226. }
  4227. }
  4228. return _arr;
  4229. }
  4230. function _arrayWithHoles4(arr) {
  4231. if (Array.isArray(arr))
  4232. return arr;
  4233. }
  4234. function normalizeArguments(args) {
  4235. var _Array$prototype$slic = Array.prototype.slice.call(args), _Array$prototype$slic2 = _slicedToArray4(_Array$prototype$slic, 4), arg_1 = _Array$prototype$slic2[0], arg_2 = _Array$prototype$slic2[1], arg_3 = _Array$prototype$slic2[2], arg_4 = _Array$prototype$slic2[3];
  4236. var text;
  4237. var options;
  4238. var metadata;
  4239. if (typeof arg_1 === "string") {
  4240. text = arg_1;
  4241. } else
  4242. throw new TypeError("A text for parsing must be a string.");
  4243. if (!arg_2 || typeof arg_2 === "string") {
  4244. if (arg_4) {
  4245. options = arg_3;
  4246. metadata = arg_4;
  4247. } else {
  4248. options = void 0;
  4249. metadata = arg_3;
  4250. }
  4251. if (arg_2) {
  4252. options = _objectSpread4({
  4253. defaultCountry: arg_2
  4254. }, options);
  4255. }
  4256. } else if (isObject(arg_2)) {
  4257. if (arg_3) {
  4258. options = arg_2;
  4259. metadata = arg_3;
  4260. } else {
  4261. metadata = arg_2;
  4262. }
  4263. } else
  4264. throw new Error("Invalid second argument: ".concat(arg_2));
  4265. return {
  4266. text,
  4267. options,
  4268. metadata
  4269. };
  4270. }
  4271. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError.js
  4272. function parsePhoneNumberWithError2() {
  4273. var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  4274. return parsePhoneNumberWithError(text, options, metadata);
  4275. }
  4276. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js
  4277. function ownKeys5(object, enumerableOnly) {
  4278. var keys = Object.keys(object);
  4279. if (Object.getOwnPropertySymbols) {
  4280. var symbols = Object.getOwnPropertySymbols(object);
  4281. enumerableOnly && (symbols = symbols.filter(function(sym) {
  4282. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  4283. })), keys.push.apply(keys, symbols);
  4284. }
  4285. return keys;
  4286. }
  4287. function _objectSpread5(target) {
  4288. for (var i = 1; i < arguments.length; i++) {
  4289. var source = null != arguments[i] ? arguments[i] : {};
  4290. i % 2 ? ownKeys5(Object(source), true).forEach(function(key) {
  4291. _defineProperty5(target, key, source[key]);
  4292. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys5(Object(source)).forEach(function(key) {
  4293. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  4294. });
  4295. }
  4296. return target;
  4297. }
  4298. function _defineProperty5(obj, key, value) {
  4299. if (key in obj) {
  4300. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  4301. } else {
  4302. obj[key] = value;
  4303. }
  4304. return obj;
  4305. }
  4306. function parsePhoneNumber2(text, options, metadata) {
  4307. if (options && options.defaultCountry && !isSupportedCountry(options.defaultCountry, metadata)) {
  4308. options = _objectSpread5(_objectSpread5({}, options), {}, {
  4309. defaultCountry: void 0
  4310. });
  4311. }
  4312. try {
  4313. return parsePhoneNumberWithError(text, options, metadata);
  4314. } catch (error) {
  4315. if (error instanceof ParseError) {
  4316. } else {
  4317. throw error;
  4318. }
  4319. }
  4320. }
  4321. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/parsePhoneNumber.js
  4322. function parsePhoneNumber3() {
  4323. var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  4324. return parsePhoneNumber2(text, options, metadata);
  4325. }
  4326. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js
  4327. function ownKeys6(object, enumerableOnly) {
  4328. var keys = Object.keys(object);
  4329. if (Object.getOwnPropertySymbols) {
  4330. var symbols = Object.getOwnPropertySymbols(object);
  4331. enumerableOnly && (symbols = symbols.filter(function(sym) {
  4332. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  4333. })), keys.push.apply(keys, symbols);
  4334. }
  4335. return keys;
  4336. }
  4337. function _objectSpread6(target) {
  4338. for (var i = 1; i < arguments.length; i++) {
  4339. var source = null != arguments[i] ? arguments[i] : {};
  4340. i % 2 ? ownKeys6(Object(source), true).forEach(function(key) {
  4341. _defineProperty6(target, key, source[key]);
  4342. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys6(Object(source)).forEach(function(key) {
  4343. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  4344. });
  4345. }
  4346. return target;
  4347. }
  4348. function _defineProperty6(obj, key, value) {
  4349. if (key in obj) {
  4350. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  4351. } else {
  4352. obj[key] = value;
  4353. }
  4354. return obj;
  4355. }
  4356. function isValidPhoneNumber() {
  4357. var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  4358. options = _objectSpread6(_objectSpread6({}, options), {}, {
  4359. extract: false
  4360. });
  4361. var phoneNumber = parsePhoneNumber2(text, options, metadata);
  4362. return phoneNumber && phoneNumber.isValid() || false;
  4363. }
  4364. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/isPossiblePhoneNumber.js
  4365. function ownKeys7(object, enumerableOnly) {
  4366. var keys = Object.keys(object);
  4367. if (Object.getOwnPropertySymbols) {
  4368. var symbols = Object.getOwnPropertySymbols(object);
  4369. enumerableOnly && (symbols = symbols.filter(function(sym) {
  4370. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  4371. })), keys.push.apply(keys, symbols);
  4372. }
  4373. return keys;
  4374. }
  4375. function _objectSpread7(target) {
  4376. for (var i = 1; i < arguments.length; i++) {
  4377. var source = null != arguments[i] ? arguments[i] : {};
  4378. i % 2 ? ownKeys7(Object(source), true).forEach(function(key) {
  4379. _defineProperty7(target, key, source[key]);
  4380. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys7(Object(source)).forEach(function(key) {
  4381. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  4382. });
  4383. }
  4384. return target;
  4385. }
  4386. function _defineProperty7(obj, key, value) {
  4387. if (key in obj) {
  4388. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  4389. } else {
  4390. obj[key] = value;
  4391. }
  4392. return obj;
  4393. }
  4394. function isPossiblePhoneNumber2() {
  4395. var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  4396. options = _objectSpread7(_objectSpread7({}, options), {}, {
  4397. extract: false
  4398. });
  4399. var phoneNumber = parsePhoneNumber2(text, options, metadata);
  4400. return phoneNumber && phoneNumber.isPossible() || false;
  4401. }
  4402. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/validatePhoneNumberLength.js
  4403. function ownKeys8(object, enumerableOnly) {
  4404. var keys = Object.keys(object);
  4405. if (Object.getOwnPropertySymbols) {
  4406. var symbols = Object.getOwnPropertySymbols(object);
  4407. enumerableOnly && (symbols = symbols.filter(function(sym) {
  4408. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  4409. })), keys.push.apply(keys, symbols);
  4410. }
  4411. return keys;
  4412. }
  4413. function _objectSpread8(target) {
  4414. for (var i = 1; i < arguments.length; i++) {
  4415. var source = null != arguments[i] ? arguments[i] : {};
  4416. i % 2 ? ownKeys8(Object(source), true).forEach(function(key) {
  4417. _defineProperty8(target, key, source[key]);
  4418. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys8(Object(source)).forEach(function(key) {
  4419. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  4420. });
  4421. }
  4422. return target;
  4423. }
  4424. function _defineProperty8(obj, key, value) {
  4425. if (key in obj) {
  4426. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  4427. } else {
  4428. obj[key] = value;
  4429. }
  4430. return obj;
  4431. }
  4432. function validatePhoneNumberLength() {
  4433. var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  4434. options = _objectSpread8(_objectSpread8({}, options), {}, {
  4435. extract: false
  4436. });
  4437. try {
  4438. var phoneNumber = parsePhoneNumberWithError(text, options, metadata);
  4439. metadata = new Metadata(metadata);
  4440. metadata.selectNumberingPlan(phoneNumber.countryCallingCode);
  4441. var result2 = checkNumberLength(phoneNumber.nationalNumber, metadata);
  4442. if (result2 !== "IS_POSSIBLE") {
  4443. return result2;
  4444. }
  4445. } catch (error) {
  4446. if (error instanceof ParseError) {
  4447. return error.message;
  4448. } else {
  4449. throw error;
  4450. }
  4451. }
  4452. }
  4453. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/findNumbers/LRUCache.js
  4454. function _defineProperties10(target, props) {
  4455. for (var i = 0; i < props.length; i++) {
  4456. var descriptor = props[i];
  4457. descriptor.enumerable = descriptor.enumerable || false;
  4458. descriptor.configurable = true;
  4459. if ("value" in descriptor)
  4460. descriptor.writable = true;
  4461. Object.defineProperty(target, descriptor.key, descriptor);
  4462. }
  4463. }
  4464. function _createClass10(Constructor, protoProps, staticProps) {
  4465. if (protoProps)
  4466. _defineProperties10(Constructor.prototype, protoProps);
  4467. if (staticProps)
  4468. _defineProperties10(Constructor, staticProps);
  4469. Object.defineProperty(Constructor, "prototype", { writable: false });
  4470. return Constructor;
  4471. }
  4472. function _classCallCheck10(instance, Constructor) {
  4473. if (!(instance instanceof Constructor)) {
  4474. throw new TypeError("Cannot call a class as a function");
  4475. }
  4476. }
  4477. var Node = _createClass10(function Node2(key, value) {
  4478. var next = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
  4479. var prev = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
  4480. _classCallCheck10(this, Node2);
  4481. this.key = key;
  4482. this.value = value;
  4483. this.next = next;
  4484. this.prev = prev;
  4485. });
  4486. var LRUCache = function() {
  4487. function LRUCache2() {
  4488. var limit2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10;
  4489. _classCallCheck10(this, LRUCache2);
  4490. this.size = 0;
  4491. this.limit = limit2;
  4492. this.head = null;
  4493. this.tail = null;
  4494. this.cache = {};
  4495. }
  4496. _createClass10(LRUCache2, [{
  4497. key: "put",
  4498. value: function put(key, value) {
  4499. this.ensureLimit();
  4500. if (!this.head) {
  4501. this.head = this.tail = new Node(key, value);
  4502. } else {
  4503. var node = new Node(key, value, this.head);
  4504. this.head.prev = node;
  4505. this.head = node;
  4506. }
  4507. this.cache[key] = this.head;
  4508. this.size++;
  4509. }
  4510. // Read from cache map and make that node as new Head of LinkedList
  4511. }, {
  4512. key: "get",
  4513. value: function get(key) {
  4514. if (this.cache[key]) {
  4515. var value = this.cache[key].value;
  4516. this.remove(key);
  4517. this.put(key, value);
  4518. return value;
  4519. }
  4520. console.log("Item not available in cache for key ".concat(key));
  4521. }
  4522. }, {
  4523. key: "ensureLimit",
  4524. value: function ensureLimit() {
  4525. if (this.size === this.limit) {
  4526. this.remove(this.tail.key);
  4527. }
  4528. }
  4529. }, {
  4530. key: "remove",
  4531. value: function remove(key) {
  4532. var node = this.cache[key];
  4533. if (node.prev !== null) {
  4534. node.prev.next = node.next;
  4535. } else {
  4536. this.head = node.next;
  4537. }
  4538. if (node.next !== null) {
  4539. node.next.prev = node.prev;
  4540. } else {
  4541. this.tail = node.prev;
  4542. }
  4543. delete this.cache[key];
  4544. this.size--;
  4545. }
  4546. }, {
  4547. key: "clear",
  4548. value: function clear() {
  4549. this.head = null;
  4550. this.tail = null;
  4551. this.size = 0;
  4552. this.cache = {};
  4553. }
  4554. // // Invokes the callback function with every node of the chain and the index of the node.
  4555. // forEach(fn) {
  4556. // let node = this.head;
  4557. // let counter = 0;
  4558. // while (node) {
  4559. // fn(node, counter);
  4560. // node = node.next;
  4561. // counter++;
  4562. // }
  4563. // }
  4564. // // To iterate over LRU with a 'for...of' loop
  4565. // *[Symbol.iterator]() {
  4566. // let node = this.head;
  4567. // while (node) {
  4568. // yield node;
  4569. // node = node.next;
  4570. // }
  4571. // }
  4572. }]);
  4573. return LRUCache2;
  4574. }();
  4575. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/findNumbers/RegExpCache.js
  4576. function _classCallCheck11(instance, Constructor) {
  4577. if (!(instance instanceof Constructor)) {
  4578. throw new TypeError("Cannot call a class as a function");
  4579. }
  4580. }
  4581. function _defineProperties11(target, props) {
  4582. for (var i = 0; i < props.length; i++) {
  4583. var descriptor = props[i];
  4584. descriptor.enumerable = descriptor.enumerable || false;
  4585. descriptor.configurable = true;
  4586. if ("value" in descriptor)
  4587. descriptor.writable = true;
  4588. Object.defineProperty(target, descriptor.key, descriptor);
  4589. }
  4590. }
  4591. function _createClass11(Constructor, protoProps, staticProps) {
  4592. if (protoProps)
  4593. _defineProperties11(Constructor.prototype, protoProps);
  4594. if (staticProps)
  4595. _defineProperties11(Constructor, staticProps);
  4596. Object.defineProperty(Constructor, "prototype", { writable: false });
  4597. return Constructor;
  4598. }
  4599. var RegExpCache = function() {
  4600. function RegExpCache2(size) {
  4601. _classCallCheck11(this, RegExpCache2);
  4602. this.cache = new LRUCache(size);
  4603. }
  4604. _createClass11(RegExpCache2, [{
  4605. key: "getPatternForRegExp",
  4606. value: function getPatternForRegExp(pattern) {
  4607. var regExp = this.cache.get(pattern);
  4608. if (!regExp) {
  4609. regExp = new RegExp("^" + pattern);
  4610. this.cache.put(pattern, regExp);
  4611. }
  4612. return regExp;
  4613. }
  4614. }]);
  4615. return RegExpCache2;
  4616. }();
  4617. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/findNumbers/util.js
  4618. function limit(lower, upper) {
  4619. if (lower < 0 || upper <= 0 || upper < lower) {
  4620. throw new TypeError();
  4621. }
  4622. return "{".concat(lower, ",").concat(upper, "}");
  4623. }
  4624. function trimAfterFirstMatch(regexp, string) {
  4625. var index = string.search(regexp);
  4626. if (index >= 0) {
  4627. return string.slice(0, index);
  4628. }
  4629. return string;
  4630. }
  4631. function startsWith(string, substring) {
  4632. return string.indexOf(substring) === 0;
  4633. }
  4634. function endsWith(string, substring) {
  4635. return string.indexOf(substring, string.length - substring.length) === string.length - substring.length;
  4636. }
  4637. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/findNumbers/utf-8.js
  4638. var _pZ = "   ᠎ - \u2028\u2029   ";
  4639. var pZ = "[".concat(_pZ, "]");
  4640. var PZ = "[^".concat(_pZ, "]");
  4641. var _pN = "0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9";
  4642. var _pNd = "0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9";
  4643. var pNd = "[".concat(_pNd, "]");
  4644. var _pL = "A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
  4645. var pL = "[".concat(_pL, "]");
  4646. var pL_regexp = new RegExp(pL);
  4647. var _pSc = "$¢-¥֏؋৲৳৻૱௹฿៛₠-₹꠸﷼﹩$¢£¥₩";
  4648. var pSc = "[".concat(_pSc, "]");
  4649. var pSc_regexp = new RegExp(pSc);
  4650. var _pMn = "̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ंऺ़ु-ै्॑-ॗॢॣঁ়ু-ৄ্ৢৣਁਂ਼ੁੂੇੈੋ-੍ੑੰੱੵઁં઼ુ-ૅેૈ્ૢૣଁ଼ିୁ-ୄ୍ୖୢୣஂீ்ా-ీె-ైొ-్ౕౖౢౣ಼ಿೆೌ್ೢೣു-ൄ്ൢൣ්ි-ුූัิ-ฺ็-๎ັິ-ູົຼ່-ໍཱ༹༘༙༵༷-ཾྀ-྄྆྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္်ွှၘၙၞ-ၠၱ-ၴႂႅႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧᤨᤲ᤹-᤻ᨘᨗᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀᮁᮢ-ᮥᮨᮩ᯦᮫ᯨᯩᯭᯯ-ᯱᰬ-ᰳᰶ᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᷀-ᷦ᷼-᷿⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〭꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠥꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꨩ-ꨮꨱꨲꨵꨶꩃꩌꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫬꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︦";
  4651. var pMn = "[".concat(_pMn, "]");
  4652. var pMn_regexp = new RegExp(pMn);
  4653. var _InBasic_Latin = "\0-";
  4654. var _InLatin_1_Supplement = "€-ÿ";
  4655. var _InLatin_Extended_A = "Ā-ſ";
  4656. var _InLatin_Extended_Additional = "Ḁ-ỿ";
  4657. var _InLatin_Extended_B = "ƀ-ɏ";
  4658. var _InCombining_Diacritical_Marks = "̀-ͯ";
  4659. var latinLetterRegexp = new RegExp("[" + _InBasic_Latin + _InLatin_1_Supplement + _InLatin_Extended_A + _InLatin_Extended_Additional + _InLatin_Extended_B + _InCombining_Diacritical_Marks + "]");
  4660. function isLatinLetter(letter) {
  4661. if (!pL_regexp.test(letter) && !pMn_regexp.test(letter)) {
  4662. return false;
  4663. }
  4664. return latinLetterRegexp.test(letter);
  4665. }
  4666. function isInvalidPunctuationSymbol(character) {
  4667. return character === "%" || pSc_regexp.test(character);
  4668. }
  4669. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js
  4670. function matchPhoneNumberStringAgainstPhoneNumber(phoneNumberString, phoneNumber, metadata) {
  4671. var phoneNumberStringContainsCallingCode = true;
  4672. var parsedPhoneNumber = parsePhoneNumber3(phoneNumberString, metadata);
  4673. if (!parsedPhoneNumber) {
  4674. phoneNumberStringContainsCallingCode = false;
  4675. parsedPhoneNumber = parsePhoneNumber3(phoneNumberString, {
  4676. defaultCallingCode: phoneNumber.countryCallingCode
  4677. }, metadata);
  4678. }
  4679. if (!parsedPhoneNumber) {
  4680. return "INVALID_NUMBER";
  4681. }
  4682. if (phoneNumber.ext) {
  4683. if (parsedPhoneNumber.ext !== phoneNumber.ext) {
  4684. return "NO_MATCH";
  4685. }
  4686. } else {
  4687. if (parsedPhoneNumber.ext) {
  4688. return "NO_MATCH";
  4689. }
  4690. }
  4691. if (phoneNumberStringContainsCallingCode) {
  4692. if (phoneNumber.countryCallingCode !== parsedPhoneNumber.countryCallingCode) {
  4693. return "NO_MATCH";
  4694. }
  4695. }
  4696. if (phoneNumber.number === parsedPhoneNumber.number) {
  4697. if (phoneNumberStringContainsCallingCode) {
  4698. return "EXACT_MATCH";
  4699. } else {
  4700. return "NSN_MATCH";
  4701. }
  4702. }
  4703. if (phoneNumber.nationalNumber.indexOf(parsedPhoneNumber.nationalNumber) === 0 || parsedPhoneNumber.nationalNumber.indexOf(phoneNumber.nationalNumber) === 0) {
  4704. return "SHORT_NSN_MATCH";
  4705. }
  4706. return "NO_MATCH";
  4707. }
  4708. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/findNumbers/Leniency.js
  4709. function _createForOfIteratorHelperLoose11(o, allowArrayLike) {
  4710. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  4711. if (it)
  4712. return (it = it.call(o)).next.bind(it);
  4713. if (Array.isArray(o) || (it = _unsupportedIterableToArray14(o)) || allowArrayLike && o && typeof o.length === "number") {
  4714. if (it)
  4715. o = it;
  4716. var i = 0;
  4717. return function() {
  4718. if (i >= o.length)
  4719. return { done: true };
  4720. return { done: false, value: o[i++] };
  4721. };
  4722. }
  4723. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  4724. }
  4725. function _unsupportedIterableToArray14(o, minLen) {
  4726. if (!o)
  4727. return;
  4728. if (typeof o === "string")
  4729. return _arrayLikeToArray14(o, minLen);
  4730. var n = Object.prototype.toString.call(o).slice(8, -1);
  4731. if (n === "Object" && o.constructor)
  4732. n = o.constructor.name;
  4733. if (n === "Map" || n === "Set")
  4734. return Array.from(o);
  4735. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  4736. return _arrayLikeToArray14(o, minLen);
  4737. }
  4738. function _arrayLikeToArray14(arr, len) {
  4739. if (len == null || len > arr.length)
  4740. len = arr.length;
  4741. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  4742. arr2[i] = arr[i];
  4743. }
  4744. return arr2;
  4745. }
  4746. var Leniency_default = {
  4747. /**
  4748. * Phone numbers accepted are "possible", but not necessarily "valid".
  4749. */
  4750. POSSIBLE: function POSSIBLE(phoneNumber, _ref) {
  4751. var candidate = _ref.candidate, metadata = _ref.metadata;
  4752. return true;
  4753. },
  4754. /**
  4755. * Phone numbers accepted are "possible" and "valid".
  4756. * Numbers written in national format must have their national-prefix
  4757. * present if it is usually written for a number of this type.
  4758. */
  4759. VALID: function VALID(phoneNumber, _ref2) {
  4760. var candidate = _ref2.candidate, defaultCountry = _ref2.defaultCountry, metadata = _ref2.metadata;
  4761. if (!phoneNumber.isValid() || !containsOnlyValidXChars(phoneNumber, candidate, metadata)) {
  4762. return false;
  4763. }
  4764. return true;
  4765. },
  4766. /**
  4767. * Phone numbers accepted are "valid" and
  4768. * are grouped in a possible way for this locale. For example, a US number written as
  4769. * "65 02 53 00 00" and "650253 0000" are not accepted at this leniency level, whereas
  4770. * "650 253 0000", "650 2530000" or "6502530000" are.
  4771. * Numbers with more than one '/' symbol in the national significant number
  4772. * are also dropped at this level.
  4773. *
  4774. * Warning: This level might result in lower coverage especially for regions outside of
  4775. * country code "+1". If you are not sure about which level to use,
  4776. * email the discussion group libphonenumber-discuss@googlegroups.com.
  4777. */
  4778. STRICT_GROUPING: function STRICT_GROUPING(phoneNumber, _ref3) {
  4779. var candidate = _ref3.candidate, defaultCountry = _ref3.defaultCountry, metadata = _ref3.metadata, regExpCache = _ref3.regExpCache;
  4780. if (!phoneNumber.isValid() || !containsOnlyValidXChars(phoneNumber, candidate, metadata) || containsMoreThanOneSlashInNationalNumber(phoneNumber, candidate) || !isNationalPrefixPresentIfRequired(phoneNumber, {
  4781. defaultCountry,
  4782. metadata
  4783. })) {
  4784. return false;
  4785. }
  4786. return checkNumberGroupingIsValid(phoneNumber, candidate, metadata, allNumberGroupsRemainGrouped, regExpCache);
  4787. },
  4788. /**
  4789. * Phone numbers accepted are "valid" and are grouped in the same way
  4790. * that we would have formatted it, or as a single block.
  4791. * For example, a US number written as "650 2530000" is not accepted
  4792. * at this leniency level, whereas "650 253 0000" or "6502530000" are.
  4793. * Numbers with more than one '/' symbol are also dropped at this level.
  4794. *
  4795. * Warning: This level might result in lower coverage especially for regions outside of
  4796. * country code "+1". If you are not sure about which level to use, email the discussion group
  4797. * libphonenumber-discuss@googlegroups.com.
  4798. */
  4799. EXACT_GROUPING: function EXACT_GROUPING(phoneNumber, _ref4) {
  4800. var candidate = _ref4.candidate, defaultCountry = _ref4.defaultCountry, metadata = _ref4.metadata, regExpCache = _ref4.regExpCache;
  4801. if (!phoneNumber.isValid() || !containsOnlyValidXChars(phoneNumber, candidate, metadata) || containsMoreThanOneSlashInNationalNumber(phoneNumber, candidate) || !isNationalPrefixPresentIfRequired(phoneNumber, {
  4802. defaultCountry,
  4803. metadata
  4804. })) {
  4805. return false;
  4806. }
  4807. return checkNumberGroupingIsValid(phoneNumber, candidate, metadata, allNumberGroupsAreExactlyPresent, regExpCache);
  4808. }
  4809. };
  4810. function containsOnlyValidXChars(phoneNumber, candidate, metadata) {
  4811. for (var index = 0; index < candidate.length - 1; index++) {
  4812. var charAtIndex = candidate.charAt(index);
  4813. if (charAtIndex === "x" || charAtIndex === "X") {
  4814. var charAtNextIndex = candidate.charAt(index + 1);
  4815. if (charAtNextIndex === "x" || charAtNextIndex === "X") {
  4816. index++;
  4817. if (matchPhoneNumberStringAgainstPhoneNumber(candidate.substring(index), phoneNumber, metadata) !== "NSN_MATCH") {
  4818. return false;
  4819. }
  4820. } else {
  4821. var ext = parseDigits(candidate.substring(index));
  4822. if (ext) {
  4823. if (phoneNumber.ext !== ext) {
  4824. return false;
  4825. }
  4826. } else {
  4827. if (phoneNumber.ext) {
  4828. return false;
  4829. }
  4830. }
  4831. }
  4832. }
  4833. }
  4834. return true;
  4835. }
  4836. function isNationalPrefixPresentIfRequired(phoneNumber, _ref5) {
  4837. var defaultCountry = _ref5.defaultCountry, _metadata = _ref5.metadata;
  4838. if (phoneNumber.__countryCallingCodeSource !== "FROM_DEFAULT_COUNTRY") {
  4839. return true;
  4840. }
  4841. var metadata = new Metadata(_metadata);
  4842. metadata.selectNumberingPlan(phoneNumber.countryCallingCode);
  4843. var phoneNumberRegion = phoneNumber.country || getCountryByCallingCode(phoneNumber.countryCallingCode, {
  4844. nationalNumber: phoneNumber.nationalNumber,
  4845. defaultCountry,
  4846. metadata
  4847. });
  4848. var nationalNumber = phoneNumber.nationalNumber;
  4849. var format = chooseFormatForNumber(metadata.numberingPlan.formats(), nationalNumber);
  4850. if (format.nationalPrefixFormattingRule()) {
  4851. if (metadata.numberingPlan.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {
  4852. return true;
  4853. }
  4854. if (!format.usesNationalPrefix()) {
  4855. return true;
  4856. }
  4857. return Boolean(phoneNumber.nationalPrefix);
  4858. }
  4859. return true;
  4860. }
  4861. function containsMoreThanOneSlashInNationalNumber(phoneNumber, candidate) {
  4862. var firstSlashInBodyIndex = candidate.indexOf("/");
  4863. if (firstSlashInBodyIndex < 0) {
  4864. return false;
  4865. }
  4866. var secondSlashInBodyIndex = candidate.indexOf("/", firstSlashInBodyIndex + 1);
  4867. if (secondSlashInBodyIndex < 0) {
  4868. return false;
  4869. }
  4870. var candidateHasCountryCode = phoneNumber.__countryCallingCodeSource === "FROM_NUMBER_WITH_PLUS_SIGN" || phoneNumber.__countryCallingCodeSource === "FROM_NUMBER_WITHOUT_PLUS_SIGN";
  4871. if (candidateHasCountryCode && parseDigits(candidate.substring(0, firstSlashInBodyIndex)) === phoneNumber.countryCallingCode) {
  4872. return candidate.slice(secondSlashInBodyIndex + 1).indexOf("/") >= 0;
  4873. }
  4874. return true;
  4875. }
  4876. function checkNumberGroupingIsValid(number, candidate, metadata, checkGroups, regExpCache) {
  4877. throw new Error("This part of code hasn't been ported");
  4878. var normalizedCandidate = normalizeDigits(
  4879. candidate,
  4880. true
  4881. /* keep non-digits */
  4882. );
  4883. var formattedNumberGroups = getNationalNumberGroups(metadata, number, null);
  4884. if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) {
  4885. return true;
  4886. }
  4887. var alternateFormats = MetadataManager.getAlternateFormatsForCountry(number.getCountryCode());
  4888. var nationalSignificantNumber = util.getNationalSignificantNumber(number);
  4889. if (alternateFormats) {
  4890. for (var _iterator = _createForOfIteratorHelperLoose11(alternateFormats.numberFormats()), _step; !(_step = _iterator()).done; ) {
  4891. var alternateFormat = _step.value;
  4892. if (alternateFormat.leadingDigitsPatterns().length > 0) {
  4893. var leadingDigitsRegExp = regExpCache.getPatternForRegExp("^" + alternateFormat.leadingDigitsPatterns()[0]);
  4894. if (!leadingDigitsRegExp.test(nationalSignificantNumber)) {
  4895. continue;
  4896. }
  4897. }
  4898. formattedNumberGroups = getNationalNumberGroups(metadata, number, alternateFormat);
  4899. if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) {
  4900. return true;
  4901. }
  4902. }
  4903. }
  4904. return false;
  4905. }
  4906. function getNationalNumberGroups(metadata, number, formattingPattern) {
  4907. throw new Error("This part of code hasn't been ported");
  4908. if (formattingPattern) {
  4909. var nationalSignificantNumber = util.getNationalSignificantNumber(number);
  4910. return util.formatNsnUsingPattern(nationalSignificantNumber, formattingPattern, "RFC3966", metadata).split("-");
  4911. }
  4912. var rfc3966Format = formatNumber(number, "RFC3966", metadata);
  4913. var endIndex = rfc3966Format.indexOf(";");
  4914. if (endIndex < 0) {
  4915. endIndex = rfc3966Format.length;
  4916. }
  4917. var startIndex = rfc3966Format.indexOf("-") + 1;
  4918. return rfc3966Format.slice(startIndex, endIndex).split("-");
  4919. }
  4920. function allNumberGroupsAreExactlyPresent(metadata, number, normalizedCandidate, formattedNumberGroups) {
  4921. throw new Error("This part of code hasn't been ported");
  4922. var candidateGroups = normalizedCandidate.split(NON_DIGITS_PATTERN);
  4923. var candidateNumberGroupIndex = number.hasExtension() ? candidateGroups.length - 2 : candidateGroups.length - 1;
  4924. if (candidateGroups.length == 1 || candidateGroups[candidateNumberGroupIndex].contains(util.getNationalSignificantNumber(number))) {
  4925. return true;
  4926. }
  4927. var formattedNumberGroupIndex = formattedNumberGroups.length - 1;
  4928. while (formattedNumberGroupIndex > 0 && candidateNumberGroupIndex >= 0) {
  4929. if (candidateGroups[candidateNumberGroupIndex] !== formattedNumberGroups[formattedNumberGroupIndex]) {
  4930. return false;
  4931. }
  4932. formattedNumberGroupIndex--;
  4933. candidateNumberGroupIndex--;
  4934. }
  4935. return candidateNumberGroupIndex >= 0 && endsWith(candidateGroups[candidateNumberGroupIndex], formattedNumberGroups[0]);
  4936. }
  4937. function allNumberGroupsRemainGrouped(metadata, number, normalizedCandidate, formattedNumberGroups) {
  4938. throw new Error("This part of code hasn't been ported");
  4939. var fromIndex = 0;
  4940. if (number.getCountryCodeSource() !== CountryCodeSource.FROM_DEFAULT_COUNTRY) {
  4941. var countryCode = String(number.getCountryCode());
  4942. fromIndex = normalizedCandidate.indexOf(countryCode) + countryCode.length();
  4943. }
  4944. for (var i = 0; i < formattedNumberGroups.length; i++) {
  4945. fromIndex = normalizedCandidate.indexOf(formattedNumberGroups[i], fromIndex);
  4946. if (fromIndex < 0) {
  4947. return false;
  4948. }
  4949. fromIndex += formattedNumberGroups[i].length();
  4950. if (i == 0 && fromIndex < normalizedCandidate.length()) {
  4951. var region = util.getRegionCodeForCountryCode(number.getCountryCode());
  4952. if (util.getNddPrefixForRegion(region, true) != null && Character.isDigit(normalizedCandidate.charAt(fromIndex))) {
  4953. var nationalSignificantNumber = util.getNationalSignificantNumber(number);
  4954. return startsWith(normalizedCandidate.slice(fromIndex - formattedNumberGroups[i].length), nationalSignificantNumber);
  4955. }
  4956. }
  4957. }
  4958. return normalizedCandidate.slice(fromIndex).contains(number.getExtension());
  4959. }
  4960. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/findNumbers/parsePreCandidate.js
  4961. var SECOND_NUMBER_START_PATTERN = /[\\/] *x/;
  4962. function parsePreCandidate(candidate) {
  4963. return trimAfterFirstMatch(SECOND_NUMBER_START_PATTERN, candidate);
  4964. }
  4965. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/findNumbers/isValidPreCandidate.js
  4966. var SLASH_SEPARATED_DATES = /(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/;
  4967. var TIME_STAMPS = /[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/;
  4968. var TIME_STAMPS_SUFFIX_LEADING = /^:[0-5]\d/;
  4969. function isValidPreCandidate(candidate, offset, text) {
  4970. if (SLASH_SEPARATED_DATES.test(candidate)) {
  4971. return false;
  4972. }
  4973. if (TIME_STAMPS.test(candidate)) {
  4974. var followingText = text.slice(offset + candidate.length);
  4975. if (TIME_STAMPS_SUFFIX_LEADING.test(followingText)) {
  4976. return false;
  4977. }
  4978. }
  4979. return true;
  4980. }
  4981. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/findNumbers/isValidCandidate.js
  4982. var OPENING_PARENS = "(\\[([";
  4983. var CLOSING_PARENS = ")\\])]";
  4984. var NON_PARENS = "[^".concat(OPENING_PARENS).concat(CLOSING_PARENS, "]");
  4985. var LEAD_CLASS = "[".concat(OPENING_PARENS).concat(PLUS_CHARS, "]");
  4986. var LEAD_CLASS_LEADING = new RegExp("^" + LEAD_CLASS);
  4987. var BRACKET_PAIR_LIMIT = limit(0, 3);
  4988. var MATCHING_BRACKETS_ENTIRE = new RegExp("^(?:[" + OPENING_PARENS + "])?(?:" + NON_PARENS + "+[" + CLOSING_PARENS + "])?" + NON_PARENS + "+(?:[" + OPENING_PARENS + "]" + NON_PARENS + "+[" + CLOSING_PARENS + "])" + BRACKET_PAIR_LIMIT + NON_PARENS + "*$");
  4989. var PUB_PAGES = /\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/;
  4990. function isValidCandidate(candidate, offset, text, leniency) {
  4991. if (!MATCHING_BRACKETS_ENTIRE.test(candidate) || PUB_PAGES.test(candidate)) {
  4992. return;
  4993. }
  4994. if (leniency !== "POSSIBLE") {
  4995. if (offset > 0 && !LEAD_CLASS_LEADING.test(candidate)) {
  4996. var previousChar = text[offset - 1];
  4997. if (isInvalidPunctuationSymbol(previousChar) || isLatinLetter(previousChar)) {
  4998. return false;
  4999. }
  5000. }
  5001. var lastCharIndex = offset + candidate.length;
  5002. if (lastCharIndex < text.length) {
  5003. var nextChar = text[lastCharIndex];
  5004. if (isInvalidPunctuationSymbol(nextChar) || isLatinLetter(nextChar)) {
  5005. return false;
  5006. }
  5007. }
  5008. }
  5009. return true;
  5010. }
  5011. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/PhoneNumberMatcher.js
  5012. function _createForOfIteratorHelperLoose12(o, allowArrayLike) {
  5013. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  5014. if (it)
  5015. return (it = it.call(o)).next.bind(it);
  5016. if (Array.isArray(o) || (it = _unsupportedIterableToArray15(o)) || allowArrayLike && o && typeof o.length === "number") {
  5017. if (it)
  5018. o = it;
  5019. var i = 0;
  5020. return function() {
  5021. if (i >= o.length)
  5022. return { done: true };
  5023. return { done: false, value: o[i++] };
  5024. };
  5025. }
  5026. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  5027. }
  5028. function _unsupportedIterableToArray15(o, minLen) {
  5029. if (!o)
  5030. return;
  5031. if (typeof o === "string")
  5032. return _arrayLikeToArray15(o, minLen);
  5033. var n = Object.prototype.toString.call(o).slice(8, -1);
  5034. if (n === "Object" && o.constructor)
  5035. n = o.constructor.name;
  5036. if (n === "Map" || n === "Set")
  5037. return Array.from(o);
  5038. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  5039. return _arrayLikeToArray15(o, minLen);
  5040. }
  5041. function _arrayLikeToArray15(arr, len) {
  5042. if (len == null || len > arr.length)
  5043. len = arr.length;
  5044. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  5045. arr2[i] = arr[i];
  5046. }
  5047. return arr2;
  5048. }
  5049. function _classCallCheck12(instance, Constructor) {
  5050. if (!(instance instanceof Constructor)) {
  5051. throw new TypeError("Cannot call a class as a function");
  5052. }
  5053. }
  5054. function _defineProperties12(target, props) {
  5055. for (var i = 0; i < props.length; i++) {
  5056. var descriptor = props[i];
  5057. descriptor.enumerable = descriptor.enumerable || false;
  5058. descriptor.configurable = true;
  5059. if ("value" in descriptor)
  5060. descriptor.writable = true;
  5061. Object.defineProperty(target, descriptor.key, descriptor);
  5062. }
  5063. }
  5064. function _createClass12(Constructor, protoProps, staticProps) {
  5065. if (protoProps)
  5066. _defineProperties12(Constructor.prototype, protoProps);
  5067. if (staticProps)
  5068. _defineProperties12(Constructor, staticProps);
  5069. Object.defineProperty(Constructor, "prototype", { writable: false });
  5070. return Constructor;
  5071. }
  5072. var USE_NON_GEOGRAPHIC_COUNTRY_CODE5 = false;
  5073. var EXTN_PATTERNS_FOR_MATCHING = createExtensionPattern("matching");
  5074. var INNER_MATCHES = [
  5075. // Breaks on the slash - e.g. "651-234-2345/332-445-1234"
  5076. "\\/+(.*)/",
  5077. // Note that the bracket here is inside the capturing group, since we consider it part of the
  5078. // phone number. Will match a pattern like "(650) 223 3345 (754) 223 3321".
  5079. "(\\([^(]*)",
  5080. // Breaks on a hyphen - e.g. "12345 - 332-445-1234 is my number."
  5081. // We require a space on either side of the hyphen for it to be considered a separator.
  5082. "(?:".concat(pZ, "-|-").concat(pZ, ")").concat(pZ, "*(.+)"),
  5083. // Various types of wide hyphens. Note we have decided not to enforce a space here, since it's
  5084. // possible that it's supposed to be used to break two numbers without spaces, and we haven't
  5085. // seen many instances of it used within a number.
  5086. "[‒-―-]".concat(pZ, "*(.+)"),
  5087. // Breaks on a full stop - e.g. "12345. 332-445-1234 is my number."
  5088. "\\.+".concat(pZ, "*([^.]+)"),
  5089. // Breaks on space - e.g. "3324451234 8002341234"
  5090. "".concat(pZ, "+(").concat(PZ, "+)")
  5091. ];
  5092. var leadLimit = limit(0, 2);
  5093. var punctuationLimit = limit(0, 4);
  5094. var digitBlockLimit = MAX_LENGTH_FOR_NSN + MAX_LENGTH_COUNTRY_CODE;
  5095. var blockLimit = limit(0, digitBlockLimit);
  5096. var punctuation = "[".concat(VALID_PUNCTUATION, "]") + punctuationLimit;
  5097. var digitSequence = pNd + limit(1, digitBlockLimit);
  5098. var PATTERN = "(?:" + LEAD_CLASS + punctuation + ")" + leadLimit + digitSequence + "(?:" + punctuation + digitSequence + ")" + blockLimit + "(?:" + EXTN_PATTERNS_FOR_MATCHING + ")?";
  5099. var UNWANTED_END_CHAR_PATTERN = new RegExp("[^".concat(_pN).concat(_pL, "#]+$"));
  5100. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;
  5101. var PhoneNumberMatcher = function() {
  5102. function PhoneNumberMatcher2() {
  5103. var text = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
  5104. var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  5105. var metadata = arguments.length > 2 ? arguments[2] : void 0;
  5106. _classCallCheck12(this, PhoneNumberMatcher2);
  5107. options = {
  5108. v2: options.v2,
  5109. defaultCallingCode: options.defaultCallingCode,
  5110. defaultCountry: options.defaultCountry && isSupportedCountry(options.defaultCountry, metadata) ? options.defaultCountry : void 0,
  5111. leniency: options.leniency || (options.extended ? "POSSIBLE" : "VALID"),
  5112. maxTries: options.maxTries || MAX_SAFE_INTEGER
  5113. };
  5114. if (!options.leniency) {
  5115. throw new TypeError("`leniency` is required");
  5116. }
  5117. if (options.leniency !== "POSSIBLE" && options.leniency !== "VALID") {
  5118. throw new TypeError('Invalid `leniency`: "'.concat(options.leniency, '". Supported values: "POSSIBLE", "VALID".'));
  5119. }
  5120. if (options.maxTries < 0) {
  5121. throw new TypeError("`maxTries` must be `>= 0`");
  5122. }
  5123. this.text = text;
  5124. this.options = options;
  5125. this.metadata = metadata;
  5126. this.leniency = Leniency_default[options.leniency];
  5127. if (!this.leniency) {
  5128. throw new TypeError('Unknown leniency: "'.concat(options.leniency, '"'));
  5129. }
  5130. this.maxTries = options.maxTries;
  5131. this.PATTERN = new RegExp(PATTERN, "ig");
  5132. this.state = "NOT_READY";
  5133. this.searchIndex = 0;
  5134. this.regExpCache = new RegExpCache(32);
  5135. }
  5136. _createClass12(PhoneNumberMatcher2, [{
  5137. key: "find",
  5138. value: function find() {
  5139. var matches;
  5140. while (this.maxTries > 0 && (matches = this.PATTERN.exec(this.text)) !== null) {
  5141. var candidate = matches[0];
  5142. var offset = matches.index;
  5143. candidate = parsePreCandidate(candidate);
  5144. if (isValidPreCandidate(candidate, offset, this.text)) {
  5145. var match = (
  5146. // Try to come up with a valid match given the entire candidate.
  5147. this.parseAndVerify(candidate, offset, this.text) || this.extractInnerMatch(candidate, offset, this.text)
  5148. );
  5149. if (match) {
  5150. if (this.options.v2) {
  5151. return {
  5152. startsAt: match.startsAt,
  5153. endsAt: match.endsAt,
  5154. number: match.phoneNumber
  5155. };
  5156. } else {
  5157. var phoneNumber = match.phoneNumber;
  5158. var result2 = {
  5159. startsAt: match.startsAt,
  5160. endsAt: match.endsAt,
  5161. phone: phoneNumber.nationalNumber
  5162. };
  5163. if (phoneNumber.country) {
  5164. if (USE_NON_GEOGRAPHIC_COUNTRY_CODE5 && country === "001") {
  5165. result2.countryCallingCode = phoneNumber.countryCallingCode;
  5166. } else {
  5167. result2.country = phoneNumber.country;
  5168. }
  5169. } else {
  5170. result2.countryCallingCode = phoneNumber.countryCallingCode;
  5171. }
  5172. if (phoneNumber.ext) {
  5173. result2.ext = phoneNumber.ext;
  5174. }
  5175. return result2;
  5176. }
  5177. }
  5178. }
  5179. this.maxTries--;
  5180. }
  5181. }
  5182. /**
  5183. * Attempts to extract a match from `substring`
  5184. * if the substring itself does not qualify as a match.
  5185. */
  5186. }, {
  5187. key: "extractInnerMatch",
  5188. value: function extractInnerMatch(substring, offset, text) {
  5189. for (var _iterator = _createForOfIteratorHelperLoose12(INNER_MATCHES), _step; !(_step = _iterator()).done; ) {
  5190. var innerMatchPattern = _step.value;
  5191. var isFirstMatch = true;
  5192. var candidateMatch = void 0;
  5193. var innerMatchRegExp = new RegExp(innerMatchPattern, "g");
  5194. while (this.maxTries > 0 && (candidateMatch = innerMatchRegExp.exec(substring)) !== null) {
  5195. if (isFirstMatch) {
  5196. var _candidate = trimAfterFirstMatch(UNWANTED_END_CHAR_PATTERN, substring.slice(0, candidateMatch.index));
  5197. var _match2 = this.parseAndVerify(_candidate, offset, text);
  5198. if (_match2) {
  5199. return _match2;
  5200. }
  5201. this.maxTries--;
  5202. isFirstMatch = false;
  5203. }
  5204. var candidate = trimAfterFirstMatch(UNWANTED_END_CHAR_PATTERN, candidateMatch[1]);
  5205. var candidateIndexGuess = substring.indexOf(candidate, candidateMatch.index);
  5206. var match = this.parseAndVerify(candidate, offset + candidateIndexGuess, text);
  5207. if (match) {
  5208. return match;
  5209. }
  5210. this.maxTries--;
  5211. }
  5212. }
  5213. }
  5214. /**
  5215. * Parses a phone number from the `candidate` using `parse` and
  5216. * verifies it matches the requested `leniency`. If parsing and verification succeed,
  5217. * a corresponding `PhoneNumberMatch` is returned, otherwise this method returns `null`.
  5218. *
  5219. * @param candidate the candidate match
  5220. * @param offset the offset of {@code candidate} within {@link #text}
  5221. * @return the parsed and validated phone number match, or null
  5222. */
  5223. }, {
  5224. key: "parseAndVerify",
  5225. value: function parseAndVerify(candidate, offset, text) {
  5226. if (!isValidCandidate(candidate, offset, text, this.options.leniency)) {
  5227. return;
  5228. }
  5229. var phoneNumber = parsePhoneNumber3(candidate, {
  5230. extended: true,
  5231. defaultCountry: this.options.defaultCountry,
  5232. defaultCallingCode: this.options.defaultCallingCode
  5233. }, this.metadata);
  5234. if (!phoneNumber) {
  5235. return;
  5236. }
  5237. if (!phoneNumber.isPossible()) {
  5238. return;
  5239. }
  5240. if (this.leniency(phoneNumber, {
  5241. candidate,
  5242. defaultCountry: this.options.defaultCountry,
  5243. metadata: this.metadata,
  5244. regExpCache: this.regExpCache
  5245. })) {
  5246. return {
  5247. startsAt: offset,
  5248. endsAt: offset + candidate.length,
  5249. phoneNumber
  5250. };
  5251. }
  5252. }
  5253. }, {
  5254. key: "hasNext",
  5255. value: function hasNext() {
  5256. if (this.state === "NOT_READY") {
  5257. this.lastMatch = this.find();
  5258. if (this.lastMatch) {
  5259. this.state = "READY";
  5260. } else {
  5261. this.state = "DONE";
  5262. }
  5263. }
  5264. return this.state === "READY";
  5265. }
  5266. }, {
  5267. key: "next",
  5268. value: function next() {
  5269. if (!this.hasNext()) {
  5270. throw new Error("No next element");
  5271. }
  5272. var result2 = this.lastMatch;
  5273. this.lastMatch = null;
  5274. this.state = "NOT_READY";
  5275. return result2;
  5276. }
  5277. }]);
  5278. return PhoneNumberMatcher2;
  5279. }();
  5280. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/legacy/findNumbers.js
  5281. function findNumbers() {
  5282. var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  5283. var matcher = new PhoneNumberMatcher(text, options, metadata);
  5284. var results = [];
  5285. while (matcher.hasNext()) {
  5286. results.push(matcher.next());
  5287. }
  5288. return results;
  5289. }
  5290. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/legacy/searchNumbers.js
  5291. function _defineProperty9(obj, key, value) {
  5292. if (key in obj) {
  5293. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  5294. } else {
  5295. obj[key] = value;
  5296. }
  5297. return obj;
  5298. }
  5299. function searchNumbers() {
  5300. var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  5301. var matcher = new PhoneNumberMatcher(text, options, metadata);
  5302. return _defineProperty9({}, Symbol.iterator, function() {
  5303. return {
  5304. next: function next() {
  5305. if (matcher.hasNext()) {
  5306. return {
  5307. done: false,
  5308. value: matcher.next()
  5309. };
  5310. }
  5311. return {
  5312. done: true
  5313. };
  5314. }
  5315. };
  5316. });
  5317. }
  5318. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/findPhoneNumbersInText.js
  5319. function ownKeys9(object, enumerableOnly) {
  5320. var keys = Object.keys(object);
  5321. if (Object.getOwnPropertySymbols) {
  5322. var symbols = Object.getOwnPropertySymbols(object);
  5323. enumerableOnly && (symbols = symbols.filter(function(sym) {
  5324. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  5325. })), keys.push.apply(keys, symbols);
  5326. }
  5327. return keys;
  5328. }
  5329. function _objectSpread9(target) {
  5330. for (var i = 1; i < arguments.length; i++) {
  5331. var source = null != arguments[i] ? arguments[i] : {};
  5332. i % 2 ? ownKeys9(Object(source), true).forEach(function(key) {
  5333. _defineProperty10(target, key, source[key]);
  5334. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys9(Object(source)).forEach(function(key) {
  5335. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  5336. });
  5337. }
  5338. return target;
  5339. }
  5340. function _defineProperty10(obj, key, value) {
  5341. if (key in obj) {
  5342. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  5343. } else {
  5344. obj[key] = value;
  5345. }
  5346. return obj;
  5347. }
  5348. function findPhoneNumbersInText() {
  5349. var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  5350. var matcher = new PhoneNumberMatcher(text, _objectSpread9(_objectSpread9({}, options), {}, {
  5351. v2: true
  5352. }), metadata);
  5353. var results = [];
  5354. while (matcher.hasNext()) {
  5355. results.push(matcher.next());
  5356. }
  5357. return results;
  5358. }
  5359. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/searchPhoneNumbersInText.js
  5360. function ownKeys10(object, enumerableOnly) {
  5361. var keys = Object.keys(object);
  5362. if (Object.getOwnPropertySymbols) {
  5363. var symbols = Object.getOwnPropertySymbols(object);
  5364. enumerableOnly && (symbols = symbols.filter(function(sym) {
  5365. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  5366. })), keys.push.apply(keys, symbols);
  5367. }
  5368. return keys;
  5369. }
  5370. function _objectSpread10(target) {
  5371. for (var i = 1; i < arguments.length; i++) {
  5372. var source = null != arguments[i] ? arguments[i] : {};
  5373. i % 2 ? ownKeys10(Object(source), true).forEach(function(key) {
  5374. _defineProperty11(target, key, source[key]);
  5375. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys10(Object(source)).forEach(function(key) {
  5376. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  5377. });
  5378. }
  5379. return target;
  5380. }
  5381. function _defineProperty11(obj, key, value) {
  5382. if (key in obj) {
  5383. Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  5384. } else {
  5385. obj[key] = value;
  5386. }
  5387. return obj;
  5388. }
  5389. function searchPhoneNumbersInText() {
  5390. var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  5391. var matcher = new PhoneNumberMatcher(text, _objectSpread10(_objectSpread10({}, options), {}, {
  5392. v2: true
  5393. }), metadata);
  5394. return _defineProperty11({}, Symbol.iterator, function() {
  5395. return {
  5396. next: function next() {
  5397. if (matcher.hasNext()) {
  5398. return {
  5399. done: false,
  5400. value: matcher.next()
  5401. };
  5402. }
  5403. return {
  5404. done: true
  5405. };
  5406. }
  5407. };
  5408. });
  5409. }
  5410. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/getCountries.js
  5411. function getCountries(metadata) {
  5412. return new Metadata(metadata).getCountries();
  5413. }
  5414. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/getExampleNumber.js
  5415. function getExampleNumber(country2, examples, metadata) {
  5416. if (examples[country2]) {
  5417. return new PhoneNumber(country2, examples[country2], metadata);
  5418. }
  5419. }
  5420. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.js
  5421. function formatIncompletePhoneNumber(value, optionsOrDefaultCountry, metadata) {
  5422. if (!metadata) {
  5423. metadata = optionsOrDefaultCountry;
  5424. optionsOrDefaultCountry = void 0;
  5425. }
  5426. return new AsYouType(optionsOrDefaultCountry, metadata).input(value);
  5427. }
  5428. export {
  5429. ParseError,
  5430. WHITESPACE,
  5431. VALID_PUNCTUATION,
  5432. isObject,
  5433. Metadata,
  5434. getExtPrefix,
  5435. getCountryCallingCode,
  5436. isSupportedCountry,
  5437. createExtensionPattern,
  5438. VALID_PHONE_NUMBER_WITH_EXTENSION,
  5439. isViablePhoneNumber,
  5440. DIGITS,
  5441. parseDigits,
  5442. parseIncompletePhoneNumber,
  5443. parsePhoneNumberCharacter,
  5444. isPossiblePhoneNumber,
  5445. getNumberType,
  5446. isValidNumber,
  5447. parseRFC3966,
  5448. formatRFC3966,
  5449. formatNumber2 as formatNumber,
  5450. parse,
  5451. normalizeArguments,
  5452. parsePhoneNumberWithError2 as parsePhoneNumberWithError,
  5453. parsePhoneNumber3 as parsePhoneNumber,
  5454. isValidPhoneNumber,
  5455. isPossiblePhoneNumber2,
  5456. validatePhoneNumberLength,
  5457. parsePreCandidate,
  5458. isValidPreCandidate,
  5459. isValidCandidate,
  5460. PhoneNumberMatcher,
  5461. findNumbers,
  5462. searchNumbers,
  5463. findPhoneNumbersInText,
  5464. searchPhoneNumbersInText,
  5465. DIGIT_PLACEHOLDER,
  5466. AsYouType,
  5467. getCountries,
  5468. getExampleNumber,
  5469. formatIncompletePhoneNumber
  5470. };
  5471. //# sourceMappingURL=chunk-SMXOUF54.js.map