@pega/constellationjs 0.2612.1 → 0.2612.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConstellationJS Engine License.pdf +0 -0
- package/dist/ConstellationJS Engine License.txt +167 -0
- package/dist/bootstrap-shell.js +1 -0
- package/dist/bootstrap-shell.js.br +0 -0
- package/dist/bootstrap-shell.js.gz +0 -0
- package/dist/constellation-core-react-native.js +2 -0
- package/dist/constellation-core-react-native.js.br +0 -0
- package/dist/constellation-core-react-native.js.gz +0 -0
- package/dist/constellation-core-react-native.js.map +1 -0
- package/dist/constellation-core-web.js +2 -0
- package/dist/constellation-core-web.js.LICENSE.txt +124 -0
- package/dist/constellation-core-web.js.br +0 -0
- package/dist/constellation-core-web.js.gz +0 -0
- package/dist/constellation-core-web.js.map +1 -0
- package/dist/constellation-core.797b019a.js +2 -0
- package/dist/constellation-core.797b019a.js.LICENSE.txt +124 -0
- package/dist/constellation-core.797b019a.js.br +0 -0
- package/dist/constellation-core.797b019a.js.gz +0 -0
- package/dist/constellation-core.797b019a.js.map +1 -0
- package/dist/constellation-core.json +1 -0
- package/dist/js/libphonenumber-web.js +2 -0
- package/dist/js/libphonenumber-web.js.br +0 -0
- package/dist/js/libphonenumber-web.js.gz +0 -0
- package/dist/js/libphonenumber-web.js.map +1 -0
- package/dist/js/libphonenumber.c2686009.js +2 -0
- package/dist/js/libphonenumber.c2686009.js.br +0 -0
- package/dist/js/libphonenumber.c2686009.js.gz +0 -0
- package/dist/js/libphonenumber.c2686009.js.map +1 -0
- package/dist/lib_asset.json +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{var e={953:e=>{class t{constructor(e,t,n,r,a){this.converter=c(),this.width=e,this.poly=t,this.xor_in=n,this.reflected_xor_in=l(n,e),this.xor_out=r,this.reflect=a,this.msb_mask=1<<this.width-1,this.mask=this.msb_mask-1<<1|1,this.crc_shift=this.width<8?8-this.width:0,this.shifted_xor_in=this.xor_in<<this.crc_shift;let s=this.gen_table();this.table=s,8!==this.width||this.xor_in||this.xor_out||this.reflect||(this.calculate=function(e){e=this.converter.validate_buffer(e);let t=0;for(let n=0;n<e.length;n++)t=s[t^e[n]];return t})}calculate(e){let t;e=this.converter.validate_buffer(e);let{table:n,width:r,crc_shift:a,mask:s}=this;if(this.reflect){t=this.reflected_xor_in;for(let r=0;r<e.length;r++){t=(n[255&(t^e[r])]^t>>>8)&s}}else{t=this.shifted_xor_in;for(let o=0;o<e.length;o++)t=n[255&(t>>r-8+a^e[o])]<<a^t<<8-a&s<<a;t>>=a}return t^=this.xor_out,t>>>0}calculate_no_table(e){e=this.converter.validate_buffer(e);let t=this.xor_in;for(let n=0;n<e.length;n++){let r=e[n];this.reflect&&(r=l(r,8));for(let e=0;e<8;e++){let n=t&this.msb_mask;r&128>>e&&(n^=this.msb_mask),t<<=1,n&&(t^=this.poly)}t&=this.mask}return this.reflect&&(t=l(t,this.width)),t^=this.xor_out,t>>>0}gen_table(){let e=[];for(let t=0;t<256;t++){let n=t;this.reflect&&(n=l(n,8)),n<<=this.width-8+this.crc_shift;for(let e=0;e<8;e++)0!=(n&this.msb_mask<<this.crc_shift)?(n<<=1,n^=this.poly<<this.crc_shift):n<<=1;this.reflect&&(n=l(n>>this.crc_shift,this.width)<<this.crc_shift),n=n>>this.crc_shift&this.mask,e[t]=n>>>0}return new Int32Array(e)}print_table(){let e=this.table,t=Math.ceil(this.width/4),n=t<4?4:3,r=e.length>>n,a=1<<n,s="";for(let o=0;o<r;o++){let r="";for(let s=0;s<a;s++){let a=e[o<<n|s];a="000000000"+a.toString(16),a=a.substr(a.length-t),r+="0x"+a+", "}s+=" "+r+"\n"}return s="[\n"+s.slice(0,-3)+"\n]",s}}const n="undefined"!=typeof Buffer,r="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,a=void 0!==typeof BigInt&&BigInt(256);class s{validate_buffer(e){switch(typeof e){case"number":{if(!Number.isSafeInteger(e)||e<0)throw Error(`number data must be a nonnegative safe integer, not ${e}`);if(this.fromUInt32&&e<=4294967295)return this.fromUInt32(e);const t=[];for(;e>0||t.length<4;)t.unshift(e%256),e=Math.floor(e/256);return this.fromByteArray(t)}case"string":return this.fromString(e);case"bigint":{if(e<0)throw Error(`bigint data must be nonnegative, not ${e}`);const t=[];for(;e>0||t.length<4;)t.unshift(Number(e%a)),e/=a;return this.fromByteArray(t)}default:if(n&&Buffer.isBuffer(e))return e;if(r){if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e)}throw new Error(`Unrecognized data type ${typeof e}: ${e}`)}}}class o extends s{fromUInt32(e){const t=Buffer.alloc(4);return t.writeUInt32BE(e),t}fromByteArray=Buffer.from.bind(Buffer);fromString=Buffer.from.bind(Buffer)}class i extends s{fromByteArray=Uint8Array.from.bind(Uint8Array);fromString(e){return new TextEncoder("utf-8").encode(e)}}function c(e=!1){if(r&&(e||!n))return new i;if(n)return new o;throw Error("either need TypedArrays or Buffer")}function l(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|1&e,e>>=1;return n}const d={crc1:new t(1,1,0,0,!1),crc6:new t(6,47,0,0,!1),crc8:new t(8,7,0,0,!1),crc10:new t(10,563,0,0,!1),crc16:new t(16,32773,0,0,!0),crc24:new t(24,8801531,11994318,0,!1),crc32:new t(32,79764919,4294967295,4294967295,!0),crc32c:new t(32,517762881,4294967295,4294967295,!0)};function u(e){}e.exports={CRC:t,crc:function(e,n,r,a,s){let o=new t(e,n,r,a,s);return o.calculate.bind(o)},makeBufferConverter:c,models:d,crc1:u,crc6:u,crc8:u,crc10:u,crc16:u,crc24:u,crc32:u,crc32c:u};for(let t in d){let n=d[t];e.exports[t]=n.calculate.bind(n)}},754:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=754,e.exports=t},816:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AsYouType:()=>$a,AsYouTypeCustom:()=>Ra,DIGITS:()=>ee,DIGIT_PLACEHOLDER:()=>Fr,Metadata:()=>Fa,ParseError:()=>A,PhoneNumber:()=>Ga,PhoneNumberMatcher:()=>Rr,PhoneNumberSearch:()=>hs,PhoneNumberSearchCustom:()=>cs,default:()=>wt,findNumbers:()=>fr,findPhoneNumbers:()=>us,findPhoneNumbersCustom:()=>ls,findPhoneNumbersInText:()=>Nr,format:()=>Ya,formatCustom:()=>qa,formatIncompletePhoneNumber:()=>Ba,formatNumber:()=>Ya,formatRFC3966:()=>Be,getCountries:()=>Ma,getCountryCallingCode:()=>La,getCountryCallingCodeCustom:()=>k,getExampleNumber:()=>ka,getExtPrefix:()=>Ua,getNumberType:()=>Qa,getNumberTypeCustom:()=>za,getPhoneCode:()=>La,getPhoneCodeCustom:()=>k,isPossibleNumber:()=>Xa,isPossiblePhoneNumber:()=>qt,isSupportedCountry:()=>xa,isValidNumber:()=>es,isValidNumberCustom:()=>Za,isValidNumberForRegion:()=>ns,isValidPhoneNumber:()=>kt,parse:()=>Ha,parseCustom:()=>Wa,parseDigits:()=>ne,parseIncompletePhoneNumber:()=>se,parseNumber:()=>Ha,parsePhoneNumber:()=>Pt,parsePhoneNumberCharacter:()=>oe,parsePhoneNumberFromString:()=>wt,parsePhoneNumberWithError:()=>Pt,parseRFC3966:()=>Ve,searchNumbers:()=>Er,searchPhoneNumbers:()=>ps,searchPhoneNumbersCustom:()=>ds,searchPhoneNumbersInText:()=>vr,validatePhoneNumberLength:()=>Xt});const r={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[2-467])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[024-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-7]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]|50"]],["(\\d{8})","$1",["[5-7]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|3[01]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","(?:400|[5-9]\\d\\d)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-9]"]]]],ET:["251","00","(?:11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","[235]\\d{8}|800\\d{5,6}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2358]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[48]\\d{8}|[2-9]\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|4(?:[0-35]|4[16-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[48]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|80[6-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1(?:05|[2-9]))","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]"],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["11|2[16]"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-37-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85[02-46-9]"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[013]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|9[2-9]"]],["(\\d)(\\d{7})","$1 $2",["[267]|904"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[346-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-9]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[3689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["826"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["83"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["82"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[25]0|37|49|8[09]"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-478])|7[1-9]","[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024","20240"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["20[0-35-7]|4(?:6[45]|[7-9])|[7-9]","20(?:[0135-7]|2[5-9])|4(?:6[45]|[7-9])|[7-9]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[2-4]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:472[2-47-9]|983[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[02469]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}",[7,8,9,10],[["(\\d{4})(\\d{4,6})","$1 $2",["1(?:2[02]|[89])"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[26]|6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","(?:13|8\\d{4})\\d{5}|[235-8]\\d{8}|[2-689]\\d{6}",[7,9,10],[["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|29|58)|67[0-46-9]|(?:55|68)[0-69]"],"0$1"],["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|[27]|48)|37|675|(?:55|68)[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["548"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[256]|39|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["3"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function a(e,t){var n=Array.prototype.slice.call(t);return n.push(r),e.apply(this,n)}var s=2,o=17,i=3,c="0-90-9٠-٩۰-۹",l=" ",d="".concat("-‐-―−ー-").concat("//").concat("..").concat(l).concat("()()[]\\[\\]").concat("~⁓∼~"),u="++";function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e,t){if("object"!=p(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==p(t)?t:t+""}function g(e,t,n){return t=I(t),function(e,t){if(t&&("object"==p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,y()?Reflect.construct(t,n||[],I(e).constructor):t.apply(e,n))}function m(e){var t="function"==typeof Map?new Map:void 0;return m=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(y())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&E(a,n.prototype),a}(e,arguments,I(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),E(n,e)},m(e)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}function E(e,t){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},E(e,t)}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},I(e)}var A=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=g(this,t,[e]),Object.setPrototypeOf(n,t.prototype),n.name=n.constructor.name,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&E(e,t)}(t,e),n=t,r&&h(n.prototype,r),a&&h(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,a}(m(Error));function C(e,t){e=e.split("-"),t=t.split("-");for(var n=e[0].split("."),r=t[0].split("."),a=0;a<3;a++){var s=Number(n[a]),o=Number(r[a]);if(s>o)return 1;if(o>s)return-1;if(!isNaN(s)&&isNaN(o))return 1;if(isNaN(s)&&!isNaN(o))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}var S={}.constructor;function _(e){return null!=e&&e.constructor===S}var N=/^\d+$/;function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,D(r.key),r)}}function O(e,t,n){return t&&P(e.prototype,t),n&&P(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function D(e){var t=function(e,t){if("object"!=b(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==b(t)?t:t+""}var v=" ext. ",R=function(){return O((function e(t){T(this,e),U(t),this.metadata=t,B.call(this,t)}),[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter((function(e){return"001"!==e}))}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){var n,r,a;if(e&&(a=e,N.test(a)?r=e:n=e),t&&(r=t),n&&"001"!==n){var s=this.getCountryMetadata(n);if(!s)throw new Error("Unknown country: ".concat(n));this.numberingPlan=new $(s,this)}else if(r){if(!this.hasCallingCode(r))throw new Error("Unknown calling code: ".concat(r));this.numberingPlan=new $(this.getNumberingPlanMetadata(r),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var n=this.nonGeographic()[e];if(n)return n}else{var r=this.countryCallingCodes()[e];if(r&&1===r.length&&"001"===r[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}])}(),$=function(){return O((function e(t,n){T(this,e),this.globalMetadataObject=n,this.metadata=t,B.call(this,n.metadata)}),[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"_getDefaultCountryMetadataForThisCallingCode",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this._getDefaultCountryMetadataForThisCallingCode()}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this,t=this._getFormats(this.metadata)||this._getFormats(this._getDefaultCountryMetadataForThisCallingCode())||[];return t.map((function(t){return new x(t,e)}))}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(e){if(this.hasTypes()&&L(this.types(),e))return new M(L(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?v:this.metadata[13]||v}}])}(),x=function(){return O((function e(t,n){T(this,e),this._format=t,this.metadata=n}),[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||w.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])}(),w=/^\(?\$1\)?$/,M=function(){return O((function e(t,n){T(this,e),this.type=t,this.metadata=n}),[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])}();function L(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}function U(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!_(e)||!_(e.countries))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(_(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+F(e)+": "+e,"."))}var F=function(e){return b(e)};function j(e,t){var n=new R(t);return n.hasCountry(e)?n.selectNumberingPlan(e).ext():v}function k(e,t){var n=new R(t);if(n.hasCountry(e))return n.selectNumberingPlan(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function V(e,t){return t.countries.hasOwnProperty(e)}function B(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===C(t,"1.2.0")?this.v2=!0:-1===C(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}var G=function(e){return"([".concat(c,"]{1,").concat(e,"})")};function W(e){var t="[ \\t,]*",n="[:\\..]?[ \\t,-]*",r="#?",a="[ \\t]*";return";ext="+G("20")+"|"+(t+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+n+G("20")+r)+"|"+(t+"(?:[xx##~~]|int|int)"+n+G("9")+r)+"|"+("[- ]+"+G("6")+"#")+"|"+(a+"(?:,{2}|;)"+n+G("15")+r)+"|"+(a+"(?:,)+"+n+G("9")+r)}var H="["+c+"]{"+s+"}",q="[++]{0,1}(?:["+d+"]*["+c+"]){3,}["+d+c+"]*",Y=new RegExp("^[++]{0,1}(?:["+d+"]*["+c+"]){1,2}$","i"),z=q+"(?:"+W()+")?",K=new RegExp("^"+H+"$|^"+z+"$","i");function Q(e){return e.length>=s&&K.test(e)}var J=new RegExp("(?:"+W()+")$","i");function X(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Z(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Z(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ee={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function te(e){return ee[e]}function ne(e){for(var t,n="",r=X(e.split(""));!(t=r()).done;){var a=te(t.value);a&&(n+=a)}return n}function re(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ae(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ae(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function se(e){for(var t,n="",r=re(e.split(""));!(t=r()).done;){n+=oe(t.value,n)||""}return n}function oe(e,t,n){return"+"===e?t?void("function"==typeof n&&n("end")):"+":te(e)}function ie(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ce(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ce(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function le(e,t,n){return de(e,void 0,t,n)}function de(e,t,n,r){n&&(r=new R(r.metadata)).selectNumberingPlan(n);var a=r.type(t),s=a&&a.possibleLengths()||r.possibleLengths();if(!s)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===t){if(!r.type("FIXED_LINE"))return de(e,"MOBILE",n,r);var o=r.type("MOBILE");o&&(s=function(e,t){for(var n,r=e.slice(),a=ie(t);!(n=a()).done;){var s=n.value;e.indexOf(s)<0&&r.push(s)}return r.sort((function(e,t){return e-t}))}(s,o.possibleLengths()))}else if(t&&!a)return"INVALID_LENGTH";var i=e.length,c=s[0];return c===i?"IS_POSSIBLE":c>i?"TOO_SHORT":s[s.length-1]<i?"TOO_LONG":s.indexOf(i,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function ue(e,t,n){void 0===t&&(t={});var r=new R(n);if(t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.country||e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return pe(e.phone||e.nationalNumber,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function pe(e,t){return"IS_POSSIBLE"===le(e,void 0,t)}function he(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function fe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ge(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ge(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var me=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function ye(e,t,n){if(t=t||{},e.country||e.countryCallingCode){var r=new R(n);r.selectNumberingPlan(e.country||e.countryCallingCode);var a=t.v2?e.nationalNumber:e.phone;if(he(a,r.nationalNumberPattern())){if(Ee(a,"FIXED_LINE",r))return r.type("MOBILE")&&""===r.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":r.type("MOBILE")?Ee(a,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var s,o=fe(me);!(s=o()).done;){var i=s.value;if(Ee(a,i,r))return i}}}}function Ee(e,t,n){var r=n.type(t);return!(!r||!r.pattern())&&(!(r.possibleLengths()&&r.possibleLengths().indexOf(e.length)<0)&&he(e,r.pattern()))}function Ie(e,t,n){t=t||{};var r=new R(n);return r.selectNumberingPlan(e.country||e.countryCallingCode),r.hasTypes()?void 0!==ye(e,t,r.metadata):he(t.v2?e.nationalNumber:e.phone,r.nationalNumberPattern())}var Ae=/^[A-Z]{2}$/;function Ce(e,t){var n,r,a,s=new R(t);return a=e,Ae.test(a)?(n=e,s.selectNumberingPlan(n),r=s.countryCallingCode()):r=e,{country:n,callingCode:r}}function Se(e,t,n){var r=new R(n).getCountryCodesForCallingCode(e);return r?r.filter((function(e){return function(e,t,n){var r=new R(n);return r.selectNumberingPlan(t),r.numberingPlan.possibleLengths().indexOf(e.length)>=0}(t,e,n)})):[]}var _e=new RegExp("(["+c+"])");function Ne(e,t,n,r){if(t){var a=new R(r);a.selectNumberingPlan(t||n);var s=new RegExp(a.IDDPrefix());if(0===e.search(s)){var o=(e=e.slice(e.match(s)[0].length)).match(_e);if(!(o&&null!=o[1]&&o[1].length>0&&"0"===o[1]))return e}}}function be(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(e);if(r){var a,s,o,i=r.length-1,c=i>0&&r[i];if(t.nationalPrefixTransformRule()&&c)a=e.replace(n,t.nationalPrefixTransformRule()),i>1&&(s=r[1]);else{var l=r[0];a=e.slice(l.length),c&&(s=r[1])}if(c){var d=e.indexOf(r[1]);e.slice(0,d)===t.numberingPlan.nationalPrefix()&&(o=t.numberingPlan.nationalPrefix())}else o=r[0];return{nationalNumber:a,nationalPrefix:o,carrierCode:s}}}return{nationalNumber:e}}function Te(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Pe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pe(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oe(e,t,n){for(var r,a=new R(n),s=Te(t);!(r=s()).done;){var o=r.value;if(a.selectNumberingPlan(o),a.leadingDigits()){if(e&&0===e.search(a.leadingDigits()))return o}else if(ye({phone:e,country:o},void 0,a.metadata))return o}}var De=!1;function ve(e,t){var n=t.nationalNumber,r=t.metadata;if(De&&r.isNonGeographicCallingCode(e))return"001";var a=r.getCountryCodesForCallingCode(e);return a?1===a.length?a[0]:Oe(n,a,r.metadata):void 0}function Re(e,t,n){var r=be(e,n),a=r.carrierCode,s=r.nationalNumber;if(s!==e){if(!function(e,t,n){if(he(e,n.nationalNumberPattern())&&!he(t,n.nationalNumberPattern()))return!1;return!0}(e,s,n))return{nationalNumber:e};if(n.numberingPlan.possibleLengths()&&(t||(t=ve(n.numberingPlan.callingCode(),{nationalNumber:s,metadata:n})),!function(e,t,n){switch(le(e,t,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(s,t,n)))return{nationalNumber:e}}return{nationalNumber:s,carrierCode:a}}function $e(e,t,n,r,a){if(!(t||n||r))return{number:e};var s=t||n?k(t||n,a):r;if(0===e.indexOf(s)){var o=new R(a);o.selectNumberingPlan(t||n||r);var i=e.slice(s.length),c=Re(i,void 0,o).nationalNumber,l=Re(e,void 0,o).nationalNumber;if(!he(l,o.nationalNumberPattern())&&he(c,o.nationalNumberPattern())||"TOO_LONG"===le(l,void 0,o))return{countryCallingCode:s,number:i}}return{number:e}}function xe(e,t,n,r,a){if(!e)return{};var s;if("+"!==e[0]){var o=Ne(e,t||n,r,a);if(!o||o===e){if(t||n||r){var c=$e(e,t,n,r,a),l=c.countryCallingCode,d=c.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:d}}return{number:e}}s=!0,e="+"+o}if("0"===e[1])return{};for(var u=new R(a),p=2;p-1<=i&&p<=e.length;){var h=e.slice(1,p);if(u.hasCallingCode(h))return u.selectNumberingPlan(h),{countryCallingCodeSource:s?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:h,number:e.slice(p)};p++}return{}}function we(e){return e.replace(new RegExp("[".concat(d,"]+"),"g")," ").trim()}var Me=/(\$\d)/;function Le(e,t,n){var r=n.useInternationalFormat,a=n.withNationalPrefix,s=(n.carrierCode,n.metadata,e.replace(new RegExp(t.pattern()),r?t.internationalFormat():a&&t.nationalPrefixFormattingRule()?t.format().replace(Me,t.nationalPrefixFormattingRule()):t.format()));return r?we(s):s}var Ue=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function Fe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,o,i=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return i}}(e,t)||je(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(e,t){if(e){if("string"==typeof e)return ke(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ke(e,t):void 0}}function ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ve(e){for(var t,n,r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=je(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}((e=e.replace(/^tel:/,"tel=")).split(";"));!(r=a()).done;){var s=Fe(r.value.split("="),2),o=s[0],i=s[1];switch(o){case"tel":t=i;break;case"ext":n=i;break;case"phone-context":"+"===i[0]&&(t=i+t)}}if(!Q(t))return{};var c={number:t};return n&&(c.ext=n),c}function Be(e){var t=e.number,n=e.ext;if(!t)return"";if("+"!==t[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(n?";ext="+n:"")}var Ge={formatExtension:function(e,t,n){return"".concat(e).concat(n.ext()).concat(t)}};function We(e,t,n,r){n=n?function(){for(var e=1,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(;e<n.length;){if(n[e])for(var a in n[e])n[0][a]=n[e][a];e++}return n[0]}({},Ge,n):Ge;var a=new R(r);if(e.country&&"001"!==e.country){if(!a.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));a.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)return e.phone||"";a.selectNumberingPlan(e.countryCallingCode)}var s,o=a.countryCallingCode(),i=n.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return i?Ye(s=He(i,e.carrierCode,"NATIONAL",a,n),e.ext,a,n.formatExtension):"";case"INTERNATIONAL":return i?(s=He(i,null,"INTERNATIONAL",a,n),Ye(s="+".concat(o," ").concat(s),e.ext,a,n.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(i);case"RFC3966":return Be({number:"+".concat(o).concat(i),ext:e.ext});case"IDD":if(!n.fromCountry)return;var c=function(e,t,n,r,a){var s=k(r,a.metadata);if(s===n){var o=He(e,t,"NATIONAL",a);return"1"===n?n+" "+o:o}var i=function(e,t,n){var r=new R(n);return r.selectNumberingPlan(e||t),r.defaultIDDPrefix()?r.defaultIDDPrefix():Ue.test(r.IDDPrefix())?r.IDDPrefix():void 0}(r,void 0,a.metadata);if(i)return"".concat(i," ").concat(n," ").concat(He(e,null,"INTERNATIONAL",a))}(i,e.carrierCode,o,n.fromCountry,a);if(!c)return;return Ye(c,e.ext,a,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function He(e,t,n,r,a){var s=qe(r.formats(),e);return s?Le(e,s,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!a||!1!==a.nationalPrefix,carrierCode:t,metadata:r}):e}function qe(e,t){return function(e,t){var n=0;for(;n<e.length;){if(t(e[n]))return e[n];n++}}(e,(function(e){if(e.leadingDigitsPatterns().length>0){var n=e.leadingDigitsPatterns()[e.leadingDigitsPatterns().length-1];if(0!==t.search(n))return!1}return he(t,e.pattern())}))}function Ye(e,t,n,r){return t?r(e,t,n):e}function ze(e){return ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ze(e)}function Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(n),!0).forEach((function(t){Je(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Je(e,t,n){return(t=Ze(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ze(r.key),r)}}function Ze(e){var t=function(e,t){if("object"!=ze(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ze(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ze(t)?t:t+""}var et=function(){return e=function e(t,n,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new TypeError("First argument is required");if("string"!=typeof t)throw new TypeError("First argument must be a string");if("+"===t[0]&&!n)throw new TypeError("`metadata` argument not passed");if(_(n)&&_(n.countries)){r=n;var a=t;if(!tt.test(a))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var s=xe(a,void 0,void 0,void 0,r);if(t=s.countryCallingCode,!(n=s.number))throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if("string"!=typeof n)throw new TypeError("`nationalNumber` argument must be a string");U(r);var o=Ce(t,r),i=o.country,c=o.callingCode;this.country=i,this.countryCallingCode=c,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}},(t=[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Se(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return ue(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return Ie(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new R(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return ye(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return We(this,e,t?Qe(Qe({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}])&&Xe(e.prototype,t),n&&Xe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),tt=/^\+\d+$/,nt="+",rt="(["+c+"]|[\\-\\.\\(\\)]?)",at=new RegExp("^\\"+nt+rt+"*["+c+"]"+rt+"*$","g"),st=new RegExp("^("+("["+c+"]+((\\-)*["+c+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+c+"])*")+"\\.?$","g"),ot="tel:",it=";phone-context=",ct=";isub=";function lt(e,t){var n,r=t.extractFormattedPhoneNumber,a=function(e){var t=e.indexOf(it);if(t<0)return null;var n=t+it.length;if(n>=e.length)return"";var r=e.indexOf(";",n);return r>=0?e.substring(n,r):e.substring(n)}(e);if(!function(e){return null===e||0!==e.length&&(at.test(e)||st.test(e))}(a))throw new A("NOT_A_NUMBER");if(null===a)n=r(e)||"";else{n="",a.charAt(0)===nt&&(n+=a);var s,o=e.indexOf(ot);s=o>=0?o+ot.length:0;var i=e.indexOf(it);n+=e.substring(s,i)}var c=n.indexOf(ct);if(c>0&&(n=n.substring(0,c)),""!==n)return n}var dt=250,ut=new RegExp("[++"+c+"]"),pt=new RegExp("[^"+c+"#]+$"),ht=!1;function ft(e,t,n){t=t||{};var r=new R(n);if(t.defaultCountry&&!r.hasCountry(t.defaultCountry)){if(t.v2)throw new A("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(t.defaultCountry))}var a=function(e,t,n){var r=lt(e,{extractFormattedPhoneNumber:function(e){return function(e,t,n){if(!e)return;if(e.length>dt){if(n)throw new A("TOO_LONG");return}if(!1===t)return e;var r=e.search(ut);if(r<0)return;return e.slice(r).replace(pt,"")}(e,n,t)}});if(!r)return{};if(!Q(r))return function(e){return Y.test(e)}(r)?{error:"TOO_SHORT"}:{};var a=function(e){var t=e.search(J);if(t<0)return{};for(var n=e.slice(0,t),r=e.match(J),a=1;a<r.length;){if(r[a])return{number:n,ext:r[a]};a++}}(r);if(a.ext)return a;return{number:r}}(e,t.v2,t.extract),i=a.number,c=a.ext,l=a.error;if(!i){if(t.v2){if("TOO_SHORT"===l)throw new A("TOO_SHORT");throw new A("NOT_A_NUMBER")}return{}}var d=function(e,t,n,r){var a,s=xe(se(e),void 0,t,n,r.metadata),o=s.countryCallingCodeSource,i=s.countryCallingCode,c=s.number;if(i)r.selectNumberingPlan(i);else{if(!c||!t&&!n)return{};t?(a=t,r.selectNumberingPlan(t),i=r.numberingPlan.callingCode()):(r.selectNumberingPlan(n),i=n,ht&&r.isNonGeographicCallingCode(i)&&(a="001"))}if(!c)return{countryCallingCodeSource:o,countryCallingCode:i};var l=Re(se(c),void 0,r),d=l.nationalNumber,u=l.carrierCode,p=ve(i,{nationalNumber:d,metadata:r});p&&(a=p,"001"===p||r.selectNumberingPlan(a));return{country:a,countryCallingCode:i,countryCallingCodeSource:o,nationalNumber:d,carrierCode:u}}(i,t.defaultCountry,t.defaultCallingCode,r),u=d.country,p=d.nationalNumber,h=d.countryCallingCode,f=d.countryCallingCodeSource,g=d.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new A("INVALID_COUNTRY");return{}}if(!p||p.length<s){if(t.v2)throw new A("TOO_SHORT");return{}}if(p.length>o){if(t.v2)throw new A("TOO_LONG");return{}}if(t.v2){var m=new et(h,p,r.metadata);return u&&(m.country=u),g&&(m.carrierCode=g),c&&(m.ext=c),m.__countryCallingCodeSource=f,m}var y=!!(t.extended?r.hasSelectedNumberingPlan():u)&&he(p,r.nationalNumberPattern());return t.extended?{country:u,countryCallingCode:h,carrierCode:g,valid:y,possible:!!y||!(!0!==t.extended||!r.possibleLengths()||!pe(p,r)),phone:p,ext:c}:y?function(e,t,n){var r={country:e,phone:t};n&&(r.ext=n);return r}(u,p,c):{}}function gt(e){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gt(e)}function mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mt(Object(n),!0).forEach((function(t){Et(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Et(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=gt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=gt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==gt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function It(e,t,n){return ft(e,yt(yt({},t),{},{v2:!0}),n)}function At(e){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(e)}function Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function St(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=At(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=At(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==At(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,o,i=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Nt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bt(e){var t,n,r,a=_t(Array.prototype.slice.call(e),4),s=a[0],o=a[1],i=a[2],c=a[3];if("string"!=typeof s)throw new TypeError("A text for parsing must be a string.");if(t=s,o&&"string"!=typeof o){if(!_(o))throw new Error("Invalid second argument: ".concat(o));i?(n=o,r=i):r=o}else c?(n=i,r=c):(n=void 0,r=i),o&&(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ct(Object(n),!0).forEach((function(t){St(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({defaultCountry:o},n));return{text:t,options:n,metadata:r}}function Tt(){var e=bt(arguments);return It(e.text,e.options,e.metadata)}function Pt(){return a(Tt,arguments)}function Ot(e){return Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ot(e)}function Dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dt(Object(n),!0).forEach((function(t){Rt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Ot(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ot(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ot(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $t(e,t,n){t&&t.defaultCountry&&!V(t.defaultCountry,n)&&(t=vt(vt({},t),{},{defaultCountry:void 0}));try{return It(e,t,n)}catch(e){if(!(e instanceof A))throw e}}function xt(){var e=bt(arguments);return $t(e.text,e.options,e.metadata)}function wt(){return a(xt,arguments)}function Mt(e){return Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mt(e)}function Lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ut(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lt(Object(n),!0).forEach((function(t){Ft(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ft(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Mt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Mt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Mt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jt(){var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=$t(t,n=Ut(Ut({},n),{},{extract:!1}),r);return a&&a.isValid()||!1}function kt(){return a(jt,arguments)}function Vt(e){return Vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vt(e)}function Bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bt(Object(n),!0).forEach((function(t){Wt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Vt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Vt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Vt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ht(){var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=$t(t,n=Gt(Gt({},n),{},{extract:!1}),r);return a&&a.isPossible()||!1}function qt(){return a(Ht,arguments)}function Yt(e){return Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yt(e)}function zt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zt(Object(n),!0).forEach((function(t){Qt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Yt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Yt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Yt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jt(){var e=bt(arguments),t=e.text,n=e.options,r=e.metadata;n=Kt(Kt({},n),{},{extract:!1});try{var a=It(t,n,r),s=new R(r);s.selectNumberingPlan(a.country||a.countryCallingCode);var o=le(a.nationalNumber,void 0,s);if("IS_POSSIBLE"!==o)return o}catch(e){if(e instanceof A)return e.message;throw e}}function Xt(){return a(Jt,arguments)}function Zt(e){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(e)}function en(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nn(r.key),r)}}function tn(e,t,n){return t&&en(e.prototype,t),n&&en(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nn(e){var t=function(e,t){if("object"!=Zt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Zt(t)?t:t+""}function rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var an=tn((function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;rn(this,e),this.key=t,this.value=n,this.next=r,this.prev=a})),sn=function(){return tn((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;rn(this,e),this.size=0,this.limit=t,this.head=null,this.tail=null,this.cache={}}),[{key:"put",value:function(e,t){if(this.ensureLimit(),this.head){var n=new an(e,t,this.head);this.head.prev=n,this.head=n}else this.head=this.tail=new an(e,t);this.cache[e]=this.head,this.size++}},{key:"get",value:function(e){if(this.cache[e]){var t=this.cache[e].value;return this.remove(e),this.put(e,t),t}console.log("Item not available in cache for key ".concat(e))}},{key:"ensureLimit",value:function(){this.size===this.limit&&this.remove(this.tail.key)}},{key:"remove",value:function(e){var t=this.cache[e];null!==t.prev?t.prev.next=t.next:this.head=t.next,null!==t.next?t.next.prev=t.prev:this.tail=t.prev,delete this.cache[e],this.size--}},{key:"clear",value:function(){this.head=null,this.tail=null,this.size=0,this.cache={}}}])}();function on(e){return on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},on(e)}function cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ln(r.key),r)}}function ln(e){var t=function(e,t){if("object"!=on(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=on(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==on(t)?t:t+""}var dn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cache=new sn(t)},(t=[{key:"getPatternForRegExp",value:function(e){var t=this.cache.get(e);return t||(t=new RegExp("^"+e),this.cache.put(e,t)),t}}])&&cn(e.prototype,t),n&&cn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function un(e,t){if(e<0||t<=0||t<e)throw new TypeError;return"{".concat(e,",").concat(t,"}")}function pn(e,t){var n=t.search(e);return n>=0?t.slice(0,n):t}var hn=" - \u2028\u2029 ",fn="[".concat(hn,"]"),gn="[^".concat(hn,"]"),mn="[".concat("0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9","]"),yn="A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",En="[".concat(yn,"]"),In=new RegExp(En),An="[".concat("$¢-¥֏؋৲৳৻૱௹฿៛₠-₹꠸﷼﹩$¢£¥₩","]"),Cn=new RegExp(An),Sn="[".concat("̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ंऺ़ु-ै्॑-ॗॢॣঁ়ু-ৄ্ৢৣਁਂ਼ੁੂੇੈੋ-੍ੑੰੱੵઁં઼ુ-ૅેૈ્ૢૣଁ଼ିୁ-ୄ୍ୖୢୣஂீ்ా-ీె-ైొ-్ౕౖౢౣ಼ಿೆೌ್ೢೣു-ൄ്ൢൣ්ි-ුූัิ-ฺ็-๎ັິ-ູົຼ່-ໍཱ༹༘༙༵༷-ཾྀ-྄྆྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္်ွှၘၙၞ-ၠၱ-ၴႂႅႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧᤨᤲ᤹-᤻ᨘᨗᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀᮁᮢ-ᮥᮨᮩ᯦᮫ᯨᯩᯭᯯ-ᯱᰬ-ᰳᰶ᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᷀-ᷦ᷼-᷿⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〭꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠥꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꨩ-ꨮꨱꨲꨵꨶꩃꩌꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫬꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︦","]"),_n=new RegExp(Sn),Nn=new RegExp("[\0--ÿĀ-ſḀ-ỿƀ-ɏ̀-ͯ]");function bn(e){return!(!In.test(e)&&!_n.test(e))&&Nn.test(e)}function Tn(e){return"%"===e||Cn.test(e)}function Pn(e,t,n){var r=!0,a=xt(e,n);if(a||(r=!1,a=xt(e,{defaultCallingCode:t.countryCallingCode},n)),!a)return"INVALID_NUMBER";if(t.ext){if(a.ext!==t.ext)return"NO_MATCH"}else if(a.ext)return"NO_MATCH";return r&&t.countryCallingCode!==a.countryCallingCode?"NO_MATCH":t.number===a.number?r?"EXACT_MATCH":"NSN_MATCH":0===t.nationalNumber.indexOf(a.nationalNumber)||0===a.nationalNumber.indexOf(t.nationalNumber)?"SHORT_NSN_MATCH":"NO_MATCH"}const On={POSSIBLE:function(e,t){t.candidate,t.metadata;return!0},VALID:function(e,t){var n=t.candidate,r=(t.defaultCountry,t.metadata);return!(!e.isValid()||!Dn(e,n,r))},STRICT_GROUPING:function(e,t){var n=t.candidate,r=t.defaultCountry,a=t.metadata,s=t.regExpCache;return!(!e.isValid()||!Dn(e,n,a)||Rn(e,n)||!vn(e,{defaultCountry:r,metadata:a}))&&$n(e,n,a,wn,s)},EXACT_GROUPING:function(e,t){var n=t.candidate,r=t.defaultCountry,a=t.metadata,s=t.regExpCache;return!(!e.isValid()||!Dn(e,n,a)||Rn(e,n)||!vn(e,{defaultCountry:r,metadata:a}))&&$n(e,n,a,xn,s)}};function Dn(e,t,n){for(var r=0;r<t.length-1;r++){var a=t.charAt(r);if("x"===a||"X"===a){var s=t.charAt(r+1);if("x"===s||"X"===s){if(r++,"NSN_MATCH"!==Pn(t.substring(r),e,n))return!1}else{var o=ne(t.substring(r));if(o){if(e.ext!==o)return!1}else if(e.ext)return!1}}}return!0}function vn(e,t){t.defaultCountry;var n=t.metadata;if("FROM_DEFAULT_COUNTRY"!==e.__countryCallingCodeSource)return!0;var r=new R(n);r.selectNumberingPlan(e.countryCallingCode);e.country||ve(e.countryCallingCode,{nationalNumber:e.nationalNumber,metadata:r});var a=e.nationalNumber,s=qe(r.numberingPlan.formats(),a);return!s.nationalPrefixFormattingRule()||(!!r.numberingPlan.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||(!s.usesNationalPrefix()||Boolean(e.nationalPrefix)))}function Rn(e,t){var n=t.indexOf("/");if(n<0)return!1;var r=t.indexOf("/",n+1);return!(r<0)&&(!("FROM_NUMBER_WITH_PLUS_SIGN"===e.__countryCallingCodeSource||"FROM_NUMBER_WITHOUT_PLUS_SIGN"===e.__countryCallingCodeSource)||ne(t.substring(0,n))!==e.countryCallingCode||t.slice(r+1).indexOf("/")>=0)}function $n(e,t,n,r,a){throw new Error("This part of code hasn't been ported")}function xn(e,t,n,r){throw new Error("This part of code hasn't been ported")}function wn(e,t,n,r){throw new Error("This part of code hasn't been ported")}var Mn=/[\\/] *x/;function Ln(e){return pn(Mn,e)}var Un=/(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/,Fn=/[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/,jn=/^:[0-5]\d/;function kn(e,t,n){if(Un.test(e))return!1;if(Fn.test(e)){var r=n.slice(t+e.length);if(jn.test(r))return!1}return!0}var Vn="(\\[([",Bn=")\\])]",Gn="[^".concat(Vn).concat(Bn,"]"),Wn="[".concat(Vn).concat(u,"]"),Hn=new RegExp("^"+Wn),qn=un(0,3),Yn=new RegExp("^(?:[(\\[([])?(?:"+Gn+"+["+Bn+"])?"+Gn+"+(?:["+Vn+"]"+Gn+"+["+Bn+"])"+qn+Gn+"*$"),zn=/\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/;function Kn(e,t,n,r){if(Yn.test(e)&&!zn.test(e)){if("POSSIBLE"!==r){if(t>0&&!Hn.test(e)){var a=n[t-1];if(Tn(a)||bn(a))return!1}var s=t+e.length;if(s<n.length){var o=n[s];if(Tn(o)||bn(o))return!1}}return!0}}function Qn(e){return Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qn(e)}function Jn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Xn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,er(r.key),r)}}function er(e){var t=function(e,t){if("object"!=Qn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Qn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Qn(t)?t:t+""}var tr=W(),nr=["/+(.*)","(\\([^(]*)","(?:".concat(fn,"-|-").concat(fn,")").concat(fn,"*(.+)"),"[‒-―-]".concat(fn,"*(.+)"),"\\.+".concat(fn,"*([^.]+)"),"".concat(fn,"+(").concat(gn,"+)")],rr=un(0,2),ar=un(0,4),sr=o+i,or=un(0,sr),ir="[".concat(d,"]")+ar,cr=mn+un(1,sr),lr="(?:"+Wn+ir+")"+rr+cr+"(?:"+ir+cr+")"+or+"(?:"+tr+")?",dr=new RegExp("[^".concat("0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9").concat(yn,"#]+$")),ur=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,pr=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n={v2:n.v2,defaultCallingCode:n.defaultCallingCode,defaultCountry:n.defaultCountry&&V(n.defaultCountry,r)?n.defaultCountry:void 0,leniency:n.leniency||(n.extended?"POSSIBLE":"VALID"),maxTries:n.maxTries||ur},!On[n.leniency])throw new TypeError('Unknown leniency: "'.concat(n.leniency,'"'));if("POSSIBLE"!==n.leniency&&"VALID"!==n.leniency)throw new TypeError('Invalid `leniency`: "'.concat(n.leniency,'". Supported values: "POSSIBLE", "VALID".'));if(n.maxTries<0)throw new TypeError("`maxTries` must be `>= 0`");this.text=t,this.options=n,this.metadata=r,this.leniency=On[n.leniency],this.maxTries=n.maxTries,this.PATTERN=new RegExp(lr,"ig"),this.INNER_MATCHES=nr.map((function(e){return new RegExp(e,"g")})),this.state="NOT_READY",this.searchIndex=0,this.regExpCache=new dn(32)},t=[{key:"find",value:function(e){var t;for(this.PATTERN.lastIndex=e;this.maxTries>0&&null!==(t=this.PATTERN.exec(this.text));){var n=t[0],r=t.index;if(kn(n=Ln(n),r,this.text)){var a=this.parseAndVerify(n,r,this.text)||this.extractInnerMatch(n,r,this.text);if(a){if(this.options.v2)return{startsAt:a.startsAt,endsAt:a.endsAt,number:a.phoneNumber};var s=a.phoneNumber,o={startsAt:a.startsAt,endsAt:a.endsAt,phone:s.nationalNumber};return s.country?o.country=s.country:o.countryCallingCode=s.countryCallingCode,s.ext&&(o.ext=s.ext),o}}this.maxTries--}}},{key:"extractInnerMatch",value:function(e,t,n){for(var r,a=Jn(this.INNER_MATCHES);!(r=a()).done;){var s=r.value;s.lastIndex=0;for(var o=!0,i=void 0;this.maxTries>0&&null!==(i=s.exec(e));){if(o){var c=pn(dr,e.slice(0,i.index)),l=this.parseAndVerify(c,t,n);if(l)return l;this.maxTries--,o=!1}var d=pn(dr,i[1]),u=e.indexOf(d,i.index),p=this.parseAndVerify(d,t+u,n);if(p)return p;this.maxTries--}}}},{key:"parseAndVerify",value:function(e,t,n){if(Kn(e,t,n,this.options.leniency)){var r=xt(e,{extended:!0,defaultCountry:this.options.defaultCountry,defaultCallingCode:this.options.defaultCallingCode},this.metadata);if(r&&r.isPossible())return this.leniency(r,{candidate:e,defaultCountry:this.options.defaultCountry,metadata:this.metadata,regExpCache:this.regExpCache})?{startsAt:t,endsAt:t+e.length,phoneNumber:r}:void 0}}},{key:"hasNext",value:function(){return"NOT_READY"===this.state&&(this.lastMatch=this.find(this.searchIndex),this.lastMatch?(this.searchIndex=this.lastMatch.endsAt,this.state="READY"):this.state="DONE"),"READY"===this.state}},{key:"next",value:function(){if(!this.hasNext())throw new Error("No next element");var e=this.lastMatch;return this.lastMatch=null,this.state="NOT_READY",e}}],t&&Zn(e.prototype,t),n&&Zn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function hr(){for(var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=new pr(t,n,r),s=[];a.hasNext();)s.push(a.next());return s}function fr(){return a(hr,arguments)}function gr(e){return gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gr(e)}function mr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=gr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=gr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==gr(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yr(){var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=new pr(t,n,r);return mr({},Symbol.iterator,(function(){return{next:function(){return a.hasNext()?{done:!1,value:a.next()}:{done:!0}}}}))}function Er(){return a(yr,arguments)}function Ir(e){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ir(e)}function Ar(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ar(Object(n),!0).forEach((function(t){Sr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ar(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Ir(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ir(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _r(){for(var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=new pr(t,Cr(Cr({},n),{},{v2:!0}),r),s=[];a.hasNext();)s.push(a.next());return s}function Nr(){return a(_r,arguments)}function br(e){return br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},br(e)}function Tr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tr(Object(n),!0).forEach((function(t){Or(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Or(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=br(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=br(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==br(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dr(){var e=bt(arguments),t=e.text,n=e.options,r=e.metadata,a=new pr(t,Pr(Pr({},n),{},{v2:!0}),r);return Or({},Symbol.iterator,(function(){return{next:function(){return a.hasNext()?{done:!1,value:a.next()}:{done:!0}}}}))}function vr(){return a(Dr,arguments)}function Rr(e,t){return pr.call(this,e,t,r)}function $r(e){return $r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$r(e)}function xr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wr(r.key),r)}}function wr(e){var t=function(e,t){if("object"!=$r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=$r(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==$r(t)?t:t+""}Rr.prototype=Object.create(pr.prototype,{}),Rr.prototype.constructor=Rr;var Mr=function(){return e=function e(t){var n=t.onCountryChange,r=t.onCallingCodeChange;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onCountryChange=n,this.onCallingCodeChange=r},(t=[{key:"reset",value:function(e){var t=e.country,n=e.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(t,n)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberIsModified=!1,this.nationalPrefix=void 0,this.carrierCode=void 0,this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix=void 0}},{key:"update",value:function(e){for(var t=0,n=Object.keys(e);t<n.length;t++){var r=n[t];this[r]=e[r]}}},{key:"initCountryAndCallingCode",value:function(e,t){this.setCountry(e),this.setCallingCode(t)}},{key:"setCountry",value:function(e){this.country=e,this.onCountryChange(e)}},{key:"setCallingCode",value:function(e){this.callingCode=e,this.onCallingCodeChange(e,this.country)}},{key:"startInternationalNumber",value:function(e,t){this.international=!0,this.initCountryAndCallingCode(e,t)}},{key:"appendDigits",value:function(e){this.digits+=e}},{key:"appendNationalSignificantNumberDigits",value:function(e){this.nationalSignificantNumber+=e}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])&&xr(e.prototype,t),n&&xr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function Lr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ur(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ur(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Fr="x",jr=new RegExp(Fr);function kr(e,t){if(t<1)return"";for(var n="";t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function Vr(e,t){return")"===e[t]&&t++,function(e){var t=[],n=0;for(;n<e.length;)"("===e[n]?t.push(n):")"===e[n]&&t.pop(),n++;var r=0,a="";t.push(e.length);for(var s=0,o=t;s<o.length;s++){var i=o[s];a+=e.slice(r,i),r=i+1}return a}(e.slice(0,t))}function Br(e,t,n){var r=n.metadata,a=n.shouldTryNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(e.nationalSignificantNumber))return function(e,t,n){var r=n.metadata,a=n.shouldTryNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix;e.nationalSignificantNumber,e.international,e.nationalPrefix,e.carrierCode;if(a(t)){var o=Gr(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:s,metadata:r});if(o)return o}return Gr(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:s,metadata:r})}(e,t,{metadata:r,shouldTryNationalPrefixFormattingRule:a,getSeparatorAfterNationalPrefix:s})}function Gr(e,t,n){var r=n.metadata,a=n.useNationalPrefixFormattingRule,s=n.getSeparatorAfterNationalPrefix,o=Le(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:a,metadata:r});if(a||(e.nationalPrefix?o=e.nationalPrefix+s(t)+o:e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix&&(o=e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix+" "+o)),function(e,t){return ne(e)===t.getNationalDigits()}(o,e))return o}function Wr(e){return Wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wr(e)}function Hr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qr(r.key),r)}}function qr(e){var t=function(e,t){if("object"!=Wr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Wr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Wr(t)?t:t+""}var Yr=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"parse",value:function(e){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(e),1!==this.context.length)throw new Error("Non-finalized contexts left when pattern parse ended");var t=this.context[0],n=t.branches,r=t.instructions;if(n)return{op:"|",args:n.concat([Jr(r)])};if(0===r.length)throw new Error("Pattern is required");return 1===r.length?r[0]:r}},{key:"startContext",value:function(e){this.context.push(e)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(e){if(!e)throw new Error("Pattern is required");var t=e.match(Qr);if(t){var n=t[1],r=e.slice(0,t.index),a=e.slice(t.index+n.length);switch(n){case"(?:":r&&this.parsePattern(r),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(r&&this.parsePattern(r),0===this.getContext().instructions.length)throw new Error('No instructions found after "|" operator in an "or" group');var s=this.getContext().branches;s.push(Jr(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:s});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(r&&this.parsePattern(r),!this.getContext().branches){if(1!==this.context.length)throw new Error('"branches" not found in an "or" group context');this.getContext().branches=[]}this.getContext().branches.push(Jr(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":r&&this.parsePattern(r),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:zr(r)});break;default:throw new Error("Unknown operator: ".concat(n))}a&&this.parsePattern(a)}else{if(Kr.test(e))throw new Error("Illegal characters found in a pattern: ".concat(e));this.getContext().instructions=this.getContext().instructions.concat(e.split(""))}}}])&&Hr(e.prototype,t),n&&Hr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function zr(e){for(var t=[],n=0;n<e.length;){if("-"===e[n]){if(0===n||n===e.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(e));for(var r=e[n-1].charCodeAt(0)+1,a=e[n+1].charCodeAt(0)-1,s=r;s<=a;)t.push(String.fromCharCode(s)),s++}else t.push(e[n]);n++}return t}var Kr=/[\(\)\[\]\?\:\|]/,Qr=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function Jr(e){return 1===e.length?e[0]:e}function Xr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Zr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ea(e){return ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ea(e)}function ta(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,na(r.key),r)}}function na(e){var t=function(e,t){if("object"!=ea(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ea(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ea(t)?t:t+""}var ra=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.matchTree=(new Yr).parse(t)},t=[{key:"match",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowOverflow;if(!e)throw new Error("String is required");var n=aa(e.split(""),this.matchTree,!0);if(n&&n.match&&delete n.matchedChars,!n||!n.overflow||t)return n}}],t&&ta(e.prototype,t),n&&ta(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function aa(e,t,n){if("string"==typeof t){var r=e.join("");return 0===t.indexOf(r)?e.length===t.length?{match:!0,matchedChars:e}:{partialMatch:!0}:0===r.indexOf(t)?n&&e.length>t.length?{overflow:!0}:{match:!0,matchedChars:e.slice(0,t.length)}:void 0}if(Array.isArray(t)){for(var a=e.slice(),s=0;s<t.length;){var o=aa(a,t[s],n&&s===t.length-1);if(!o)return;if(o.overflow)return o;if(!o.match){if(o.partialMatch)return{partialMatch:!0};throw new Error("Unsupported match result:\n".concat(JSON.stringify(o,null,2)))}if(0===(a=a.slice(o.matchedChars.length)).length)return s===t.length-1?{match:!0,matchedChars:e}:{partialMatch:!0};s++}return n?{overflow:!0}:{match:!0,matchedChars:e.slice(0,e.length-a.length)}}switch(t.op){case"|":for(var i,c,l=Xr(t.args);!(c=l()).done;){var d=aa(e,c.value,n);if(d){if(d.overflow)return d;if(d.match)return{match:!0,matchedChars:d.matchedChars};if(!d.partialMatch)throw new Error("Unsupported match result:\n".concat(JSON.stringify(d,null,2)));i=!0}}return i?{partialMatch:!0}:void 0;case"[]":for(var u,p=Xr(t.args);!(u=p()).done;){var h=u.value;if(e[0]===h)return 1===e.length?{match:!0,matchedChars:e}:n?{overflow:!0}:{match:!0,matchedChars:[h]}}return;default:throw new Error("Unsupported instruction tree: ".concat(t))}}function sa(e){return sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sa(e)}function oa(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ia(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ia(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ia(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ca(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,la(r.key),r)}}function la(e){var t=function(e,t){if("object"!=sa(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=sa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==sa(t)?t:t+""}var da=kr("9",15),ua=/[- ]/,pa=function(){return/\[([^\[\]])*\]/g},ha=function(){return/\d(?=[^,}][^,}])/g},fa=new RegExp("["+d+"]*\\$1["+d+"]*(\\$\\d["+d+"]*)*$"),ga=function(){return e=function e(t){t.state;var n=t.metadata;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metadata=n,this.resetFormat()},t=[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(e,t){this.resetFormat(),e?(this.isNANP="1"===e.callingCode(),this.matchingFormats=e.formats(),t.nationalSignificantNumber&&this.narrowDownMatchingFormats(t)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(e,t){var n,r,a=this;if(n=t.nationalSignificantNumber,r=this.metadata,"IS_POSSIBLE"===le(n,void 0,r))for(var s,o=oa(this.matchingFormats);!(s=o()).done;){var i=s.value,c=Br(t,i,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(e){return a.shouldTryNationalPrefixFormattingRule(e,{international:t.international,nationalPrefix:t.nationalPrefix})},getSeparatorAfterNationalPrefix:function(e){return a.getSeparatorAfterNationalPrefix(e)}});if(c)return this.resetFormat(),this.chosenFormat=i,this.setNationalNumberTemplate(c.replace(/\d/g,Fr),t),this.populatedNationalNumberTemplate=c,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(Fr),c}return this.formatNationalNumberWithNextDigits(e,t)}},{key:"formatNationalNumberWithNextDigits",value:function(e,t){var n=this.chosenFormat,r=this.chooseFormat(t);if(r)return r===n?this.formatNextNationalNumberDigits(e):this.formatNextNationalNumberDigits(t.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(e){var t=this,n=e.nationalSignificantNumber,r=e.nationalPrefix,a=e.international,s=n,o=s.length-3;o<0&&(o=0),this.matchingFormats=this.matchingFormats.filter((function(e){return t.formatSuits(e,a,r)&&t.formatMatches(e,s,o)})),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(e,t,n){return!(n&&!e.usesNationalPrefix()&&!e.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!t&&!n&&e.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(e,t,n){var r=e.leadingDigitsPatterns().length;if(0===r)return!0;n=Math.min(n,r-1);var a=e.leadingDigitsPatterns()[n];if(t.length<3)try{return void 0!==new ra(a).match(t,{allowOverflow:!0})}catch(e){return console.error(e),!0}return new RegExp("^(".concat(a,")")).test(t)}},{key:"getFormatFormat",value:function(e,t){return t?e.internationalFormat():e.format()}},{key:"chooseFormat",value:function(e){for(var t,n=this,r=function(){var r=t.value;return n.chosenFormat===r?0:fa.test(n.getFormatFormat(r,e.international))?n.createTemplateForFormat(r,e)?(n.chosenFormat=r,0):(n.matchingFormats=n.matchingFormats.filter((function(e){return e!==r})),1):1},a=oa(this.matchingFormats.slice());!(t=a()).done&&0!==r(););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(e,t){if(!(e.pattern().indexOf("|")>=0)){var n=this.getTemplateForFormat(e,t);return n?(this.setNationalNumberTemplate(n,t),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(e){return this.isNANP||e&&e.nationalPrefixFormattingRule()&&ua.test(e.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(e,t){var n=e.IDDPrefix,r=e.missingPlus;return n?t&&!1===t.spacing?n:n+" ":r?"":"+"}},{key:"getTemplate",value:function(e){if(this.template){for(var t=-1,n=0,r=e.international?this.getInternationalPrefixBeforeCountryCallingCode(e,{spacing:!1}):"";n<r.length+e.getDigitsWithoutInternationalPrefix().length;)t=this.template.indexOf(Fr,t+1),n++;return Vr(this.template,t+1)}}},{key:"setNationalNumberTemplate",value:function(e,t){this.nationalNumberTemplate=e,this.populatedNationalNumberTemplate=e,this.populatedNationalNumberTemplatePosition=-1,t.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(t).replace(/[\d\+]/g,Fr)+kr(Fr,t.callingCode.length)+" "+e:this.template=e}},{key:"getTemplateForFormat",value:function(e,t){var n=t.nationalSignificantNumber,r=t.international,a=t.nationalPrefix,s=t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,o=e.pattern();o=o.replace(pa(),"\\d").replace(ha(),"\\d");var i=da.match(o)[0];if(!(n.length>i.length)){var c=new RegExp("^"+o+"$"),l=n.replace(/\d/g,"9");c.test(l)&&(i=l);var d,u=this.getFormatFormat(e,r);if(this.shouldTryNationalPrefixFormattingRule(e,{international:r,nationalPrefix:a})){var p=u.replace(Me,e.nationalPrefixFormattingRule());if(ne(e.nationalPrefixFormattingRule())===(a||"")+ne("$1")&&(u=p,d=!0,a))for(var h=a.length;h>0;)u=u.replace(/\d/,Fr),h--}var f=i.replace(new RegExp(o),u).replace(new RegExp("9","g"),Fr);return d||(s?f=kr(Fr,s.length)+" "+f:a&&(f=kr(Fr,a.length)+this.getSeparatorAfterNationalPrefix(e)+f)),r&&(f=we(f)),f}}},{key:"formatNextNationalNumberDigits",value:function(e){var t=function(e,t,n){for(var r,a=Lr(n.split(""));!(r=a()).done;){var s=r.value;if(e.slice(t+1).search(jr)<0)return;t=e.search(jr),e=e.replace(jr,s)}return[e,t]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);if(t)return this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],Vr(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(e,t){var n=t.international,r=t.nationalPrefix;if(e.nationalPrefixFormattingRule()){var a=e.usesNationalPrefix();if(a&&r||!a&&!n)return!0}}}],t&&ca(e.prototype,t),n&&ca(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function ma(e){return ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ma(e)}function ya(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,o,i=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ea(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ea(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ia(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Aa(r.key),r)}}function Aa(e){var t=function(e,t){if("object"!=ma(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ma(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ma(t)?t:t+""}var Ca=new RegExp("^"+("["+d+c+"]+")+"$","i"),Sa="(?:[++]["+d+c+"]*|["+d+c+"]+)",_a=new RegExp("[^"+d+c+"]+.*$"),Na=/[^\d\[\]]/,ba=function(){return e=function e(t){var n=t.defaultCountry,r=t.defaultCallingCode,a=t.metadata,s=t.onNationalSignificantNumberChange;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defaultCountry=n,this.defaultCallingCode=r,this.metadata=a,this.onNationalSignificantNumberChange=s},(t=[{key:"input",value:function(e,t){var n,r=function(e){var t=function(e){var t=function(e){var t,n=e.search(Sa);if(!(n<0))return"+"===(e=e.slice(n))[0]&&(t=!0,e=e.slice(1)),e=e.replace(_a,""),t&&(e="+"+e),e}(e)||"";return"+"===t[0]?[t.slice(1),!0]:[t]}(e),n=ya(t,2),r=n[0],a=n[1];return Ca.test(r)||(r=""),[r,a]}(e),a=ya(r,2),s=a[0],o=a[1],i=ne(s);return o&&(t.digits||(t.startInternationalNumber(void 0,void 0),i||(n=!0))),i&&this.inputDigits(i,t),{digits:i,justLeadingPlus:n}}},{key:"inputDigits",value:function(e,t){var n=t.digits,r=n.length<3&&n.length+e.length>=3;if(t.appendDigits(e),r&&this.extractIddPrefix(t),this.isWaitingForCountryCallingCode(t)){if(!this.extractCountryCallingCode(t))return}else t.appendNationalSignificantNumberDigits(e);t.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(t.getNationalDigits(),(function(e){return t.update(e)}))}},{key:"isWaitingForCountryCallingCode",value:function(e){var t=e.international,n=e.callingCode;return t&&!n}},{key:"extractCountryCallingCode",value:function(e){var t=xe("+"+e.getDigitsWithoutInternationalPrefix(),e.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),n=t.countryCallingCode,r=t.number;if(n)return e.setCallingCode(n),e.update({nationalSignificantNumber:r}),!0}},{key:"reset",value:function(e){if(e){this.hasSelectedNumberingPlan=!0;var t=e._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=t&&Na.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(e,t){if(this.hasSelectedNumberingPlan){var n=be(e,this.metadata),r=n.nationalPrefix,a=n.nationalNumber,s=n.carrierCode;if(a!==e)return this.onExtractedNationalNumber(r,s,a,e,t),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(e,t,n){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(e,n);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var r=be(e,this.metadata),a=r.nationalPrefix,s=r.nationalNumber,o=r.carrierCode;if(s!==t)return this.onExtractedNationalNumber(a,o,s,e,n),!0}}},{key:"onExtractedNationalNumber",value:function(e,t,n,r,a){var s,o=!1,i=r.lastIndexOf(n);if(i<0||i!==r.length-n.length)o=!0;else{var c=r.slice(0,i);c&&c!==e&&(s=c)}a({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:n,nationalSignificantNumberIsModified:o,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:s}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(e){return!!this.extractAnotherNationalSignificantNumber(e.getNationalDigits(),e.nationalSignificantNumber,(function(t){return e.update(t)}))||(this.extractIddPrefix(e)||this.fixMissingPlus(e)?(this.extractCallingCodeAndNationalSignificantNumber(e),!0):void 0)}},{key:"extractIddPrefix",value:function(e){var t=e.international,n=e.IDDPrefix,r=e.digits;if(e.nationalSignificantNumber,!t&&!n){var a=Ne(r,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==a&&a!==r?(e.update({IDDPrefix:r.slice(0,r.length-a.length)}),this.startInternationalNumber(e,{country:void 0,callingCode:void 0}),!0):void 0}}},{key:"fixMissingPlus",value:function(e){if(!e.international){var t=$e(e.digits,e.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata).countryCallingCode;if(t)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:t}),!0}}},{key:"startInternationalNumber",value:function(e,t){var n=t.country,r=t.callingCode;e.startInternationalNumber(n,r),e.nationalSignificantNumber&&(e.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(e){this.extractCountryCallingCode(e)&&this.extractNationalSignificantNumber(e.getNationalDigits(),(function(t){return e.update(t)}))}}])&&Ia(e.prototype,t),n&&Ia(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function Ta(e){return Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ta(e)}function Pa(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,s,o,i=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){l=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Oa(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oa(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Da(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,va(r.key),r)}}function va(e){var t=function(e,t){if("object"!=Ta(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ta(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ta(t)?t:t+""}var Ra=function(){return e=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metadata=new R(n);var r=Pa(this.getCountryAndCallingCode(t),2),a=r[0],s=r[1];this.defaultCountry=a,this.defaultCallingCode=s,this.reset()},t=[{key:"getCountryAndCallingCode",value:function(e){var t,n;return e&&(_(e)?(t=e.defaultCountry,n=e.defaultCallingCode):t=e),t&&!this.metadata.hasCountry(t)&&(t=void 0),[t,n]}},{key:"input",value:function(e){var t=this.parser.input(e,this.state),n=t.digits;if(t.justLeadingPlus)this.formattedOutput="+";else if(n){var r;if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(r=this.formatter.format(n,this.state)),void 0===r&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var a=this.state.getNationalDigits();a&&(r=this.formatter.format(a,this.state))}this.formattedOutput=r?this.getFullNumber(r):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var e=this;return this.state=new Mr({onCountryChange:function(t){e.country=t},onCallingCodeChange:function(t,n){e.metadata.selectNumberingPlan(n||t),e.formatter.reset(e.metadata.numberingPlan,e.state),e.parser.reset(e.metadata.numberingPlan)}}),this.formatter=new ga({state:this.state,metadata:this.metadata}),this.parser=new ba({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){e.determineTheCountryIfNeeded(),e.formatter.reset(e.metadata.numberingPlan,e.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){if(this.state.digits)return this._getCountry()}},{key:"_getCountry",value:function(){var e=this.state.country;return e}},{key:"determineTheCountryIfNeeded",value:function(){this.state.country&&!this.isCountryCallingCodeAmbiguous()||this.determineTheCountry()}},{key:"getFullNumber",value:function(e){var t=this;if(this.isInternational()){var n=function(e){return t.formatter.getInternationalPrefixBeforeCountryCallingCode(t.state,{spacing:!!e})+e},r=this.state.callingCode;return n(r?e?"".concat(r," ").concat(e):r:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return e}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var e=this.state,t=e.nationalSignificantNumber,n=e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,r=e.nationalPrefix,a=t,s=n||r;return s&&(a=s+a),a}},{key:"getNonFormattedNumber",value:function(){var e=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(e?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var e=this.getNonFormattedNumber();if(e)return e.replace(/[\+\d]/g,Fr)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var e=this.state.callingCode,t=this.metadata.getCountryCodesForCallingCode(e);return t&&t.length>1}},{key:"determineTheCountry",value:function(){var e=ve(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata});e!==this.state.country&&(this.state.setCountry(e),e&&this.metadata.selectNumberingPlan(e))}},{key:"getNumberValue",value:function(){var e=this.state,t=e.digits,n=e.callingCode,r=e.country,a=e.nationalSignificantNumber;if(t)return this.isInternational()?n?"+"+n+a:"+"+t:r||n?"+"+(r?this.metadata.countryCallingCode():n)+a:void 0}},{key:"getNumber",value:function(){var e=this.state,t=e.nationalSignificantNumber,n=e.carrierCode,r=e.callingCode;if(t){var a=this._getCountry();if(a||r){if(a&&a===this.defaultCountry){var s=function(e,t,n){var r=n.getCountryCodesForCallingCode(e);if(r.length>1)return Oe(t,r,n.metadata)}(this.metadata.numberingPlan.callingCode(),t,this.metadata);s&&(a=s)}var o=new et(a||r,t,this.metadata.metadata);return n&&(o.carrierCode=n),o}}}},{key:"isPossible",value:function(){var e=this.getNumber();return!!e&&e.isPossible()}},{key:"isValid",value:function(){var e=this.getNumber();return!!e&&e.isValid()}},{key:"validateLength",value:function(){var e=this.state,t=e.digits,n=e.nationalSignificantNumber;if(!t)return"NOT_A_NUMBER";if(!this.metadata.numberingPlan)return"INVALID_COUNTRY";if(!n)return"TOO_SHORT";var r=le(n,void 0,this.metadata);return"IS_POSSIBLE"!==r?r:void 0}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}],t&&Da(e.prototype,t),n&&Da(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function $a(e){return Ra.call(this,e,r)}function xa(){return a(V,arguments)}function wa(e){return new R(e).getCountries()}function Ma(){return a(wa,arguments)}function La(){return a(k,arguments)}function Ua(){return a(j,arguments)}function Fa(){return R.call(this,r)}function ja(e,t,n){if(t[e])return new et(e,t[e],n)}function ka(){return a(ja,arguments)}function Va(e,t,n){return n||(n=t,t=void 0),new Ra(t,n).input(e)}function Ba(){return a(Va,arguments)}function Ga(e){return et.call(this,e,r)}function Wa(){var e=bt(arguments);return ft(e.text,e.options,e.metadata)}function Ha(){return a(Wa,arguments)}function qa(){var e=function(e){var t,n,r,a,s=e[0],o=e[1],i=e[2],c=e[3],l=e[4];if("string"==typeof s)if("string"==typeof i)n=i,l?(r=c,a=l):a=c,t=ft(s,{defaultCountry:o,extended:!0},a);else{if("string"!=typeof o)throw new Error("`format` argument not passed to `formatNumber(number, format)`");n=o,c?(r=i,a=c):a=i,t=ft(s,{extended:!0},a)}else{if(!_(s))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");t=s,n=o,c?(r=i,a=c):a=i}"International"===n?n="INTERNATIONAL":"National"===n&&(n="NATIONAL");return{input:t,format:n,options:r,metadata:a}}(arguments);return We(e.input,e.format,e.options,e.metadata)}function Ya(){return a(qa,arguments)}function za(){var e=Ka(arguments),t=e.input,n=e.options,r=e.metadata;if(t.phone)return ye(t,n,r)}function Ka(e){var t,n,r=e[0],a=e[1],s=e[2],o=e[3],i={};if("string"==typeof r)_(a)?(s?(i=a,n=s):n=a,t=Q(r)?ft(r,void 0,n):{}):(o?(i=s,n=o):n=s,t=Q(r)?ft(r,{defaultCountry:a},n):{});else{if(!_(r))throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");t=r,s?(i=a,n=s):n=a}return{input:t,options:i,metadata:n}}function Qa(){return a(za,arguments)}function Ja(){var e=Ka(arguments),t=e.input,n=e.options,r=e.metadata;return!!(t.phone||n&&n.v2)&&ue(t,n,r)}function Xa(){return a(Ja,arguments)}function Za(){var e=Ka(arguments),t=e.input,n=e.options,r=e.metadata;return!!t.phone&&Ie(t,n,r)}function es(){return a(Za,arguments)}function ts(e,t,n){if("string"!=typeof e)throw new TypeError("number must be a string");if("string"!=typeof t)throw new TypeError("country must be a string");return function(e,t,n,r){return n=n||{},e.country===t&&Ie(e,n,r)}(Q(e)?ft(e,{defaultCountry:t},n):{},t,void 0,n)}function ns(){return a(ts,arguments)}function rs(e){return rs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rs(e)}function as(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ss(r.key),r)}}function ss(e){var t=function(e,t){if("object"!=rs(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=rs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rs(t)?t:t+""}$a.prototype=Object.create(Ra.prototype,{}),$a.prototype.constructor=$a,Fa.prototype=Object.create(R.prototype,{}),Fa.prototype.constructor=Fa,Ga.prototype=et.prototype,Ga.prototype.constructor=Ga;var os=new RegExp("^["+l+"]+"),is=new RegExp("["+d+"]+$"),cs=function(){return e=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.text=t,this.options=n||{},this.metadata=r,this.state="NOT_READY",this.regexp=new RegExp(z,"ig")},t=[{key:"find",value:function(){var e=this.regexp.exec(this.text);if(e){var t=e[0],n=e.index;t=t.replace(os,""),n+=e[0].length-t.length,t=Ln(t=t.replace(is,""));var r=this.parseCandidate(t,n);return r||this.find()}}},{key:"parseCandidate",value:function(e,t){if(kn(e,t,this.text)&&Kn(e,t,this.text,this.options.extended?"POSSIBLE":"VALID")){var n=ft(e,this.options,this.metadata);if(n.phone)return n.startsAt=t,n.endsAt=t+e.length,n}}},{key:"hasNext",value:function(){return"NOT_READY"===this.state&&(this.last_match=this.find(),this.last_match?this.state="READY":this.state="DONE"),"READY"===this.state}},{key:"next",value:function(){if(!this.hasNext())throw new Error("No next element");var e=this.last_match;return this.last_match=null,this.state="NOT_READY",e}}],t&&as(e.prototype,t),n&&as(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();W();function ls(){var e=bt(arguments);return function(e,t,n){void 0===t&&(t={});for(var r=new cs(e,t,n),a=[];r.hasNext();)a.push(r.next());return a}(e.text,e.options,e.metadata)}function ds(){var e=bt(arguments);return function(e,t,n){void 0===t&&(t={});var r=new cs(e,t,n),a={};return a[Symbol.iterator]=function(){return{next:function(){return r.hasNext()?{done:!1,value:r.next()}:{done:!0}}}},a}(e.text,e.options,e.metadata)}function us(){return a(ls,arguments)}function ps(){return a(ds,arguments)}function hs(e,t){cs.call(this,e,t,r)}hs.prototype=Object.create(cs.prototype,{}),hs.prototype.constructor=hs}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};n.r(e),n.d(e,{buildContextName:()=>Hr,buildModalContext:()=>Kr,buildTransientContextName:()=>qr,getContainerIdFromContext:()=>Jr,getParentContext:()=>Qr,getParentContextName:()=>Wr,getTargetFromContext:()=>zr,getTransientContext:()=>Yr});var t={};n.r(t),n.d(t,{getResolvedTargetName:()=>js,getRoutingInfo:()=>ks,getSemanticURLFromRoutingInfo:()=>Vs});var r={};n.r(r),n.d(r,{evaluate:()=>Io,handleChange:()=>yo,hasDeclareExpression:()=>mo,updateDeclareExpressions:()=>Eo});var a={};n.r(a),n.d(a,{hasBrowserEnv:()=>ic,hasStandardBrowserEnv:()=>lc,hasStandardBrowserWebWorkerEnv:()=>dc,navigator:()=>cc,origin:()=>uc});var s={};n.r(s),n.d(s,{publishExpressions:()=>Qp,publishMetadata:()=>Kp,publishResponse:()=>Jp});var o={};n.r(o),n.d(o,{doesRestApiExist:()=>rh,getCancelTokenSource:()=>ah,getCaseApi:()=>ih,getHeaderProcessor:()=>eh,invokeCustomRestApi:()=>nh,invokeRestApi:()=>th,isRequestCanceled:()=>sh,registerInterceptor:()=>oh});var i={};n.r(i),n.d(i,{fetchViewResources:()=>im,refreshViewByName:()=>dm,updateViewResources:()=>om});var c={};n.r(c),n.d(c,{CONTAINER_NAMES:()=>mI,CONTAINER_TYPES:()=>gI,addRootContainerItem:()=>XI,areContainerItemsPresent:()=>NI,cleanupTransientContainer:()=>oA,clearContainerItems:()=>cA,clearTransientData:()=>aA,closeContainerItem:()=>JI,getActiveContainerItemContext:()=>LI,getActiveContainerItemIDFromRoutingInfo:()=>EA,getActiveContainerItemName:()=>$I,getActiveContext:()=>fA,getChildContainerItemId:()=>AI,getChildContainerItems:()=>UI,getChildContainers:()=>FI,getChildContainersContexts:()=>jI,getContainerAPI:()=>lA,getContainerAccessOrder:()=>_I,getContainerData:()=>II,getContainerItemByKey:()=>DI,getContainerItemData:()=>CI,getContainerItemName:()=>PI,getContainerItems:()=>SI,getContainerLimit:()=>WI,getContainerParentContext:()=>yA,getContainerType:()=>RI,getContextByTargetAndKey:()=>mA,getDataContextName:()=>MI,getFlowContainer:()=>AA,getLeastRecentlyUsedNonDirtyContainerItemID:()=>KI,getParentContainerItem:()=>IA,getRootContainerName:()=>hA,getSuggestionContexts:()=>kI,getTargetFromContainerItemID:()=>QI,getTransientItems:()=>tA,hasContainerItems:()=>GI,isContainerDirty:()=>zI,isContainerInitialized:()=>vI,isContainerItemActive:()=>xI,isContainerItemContextBeingUsedInOtherContainers:()=>eA,isContainerItemExists:()=>bI,isContainerItemExistsWithoutKey:()=>TI,isContainerLimitReached:()=>qI,isContainerMultipleMode:()=>BI,isContainerSingleMode:()=>VI,purgeTransientData:()=>sA,removeContainer:()=>dA,replaceTransientData:()=>rA,resetContainersPayload:()=>YI,setContainerLimit:()=>HI,updateCaseContextEtag:()=>pA,updateParentLastUpdateTime:()=>gA,updateRelatedContextEtag:()=>uA,updateTransientData:()=>nA});var l={};n.r(l),n.d(l,{beginDesignerRefresh:()=>pC,endDesignerRefresh:()=>hC,getAIAgent:()=>PC,getAdditionalInfo:()=>$C,getDataPageKeys:()=>DC,getDataPageMetadata:()=>IC,getDesignerViewStoreVersion:()=>uC,getEditableFieldConfigUtil:()=>wC,getEmbeddedPropertyMetadata:()=>lC,getFieldParameters:()=>_C,getFieldsByClassName:()=>SC,getFormat:()=>bC,getGenAICoach:()=>TC,getInsight:()=>CC,getLocaleUtilsForLanguage:()=>iC,getLocalizationServiceFromStore:()=>cC,getLookUpDataPage:()=>vC,getLookUpDataPageInfo:()=>RC,getParagraph:()=>NC,getPersonalizationMetadata:()=>AC,getPropertyMetadata:()=>oC,getResolvedFieldMetadata:()=>xC,getSavableDataPage:()=>OC,isViewExists:()=>yC,mergeStore:()=>sC,resolveNavigation:()=>EC,resolveView:()=>mC,updateNavigationStore:()=>fC,updateStores:()=>gC,updateViewStore:()=>dC});var d={};n.r(d),n.d(d,{dispatch:()=>VC,doesContextExist:()=>nS,getActionType:()=>zC,getContextValue:()=>qC,getDataObject:()=>BC,getReferenceTokens:()=>FC,getSharedDataObject:()=>GC,getStore:()=>kC,getValue:()=>HC,isMergeable:()=>QC,lookupContextValue:()=>YC,mergeDeep:()=>XC,performReplaceAndRearrange:()=>JC,removeItem:()=>KC,replaceValue:()=>eS,resetStore:()=>tS,setStore:()=>jC,updateValue:()=>ZC});var u={};n.r(u),n.d(u,{activateContainerItem:()=>xS,addContainerItem:()=>_S,addMessages:()=>wS,addSharedData:()=>WS,addTransientItem:()=>NS,addWork:()=>IS,clearTransientData:()=>TS,createWork:()=>hS,error:()=>GS,finishAssignment:()=>jS,initContainers:()=>CS,listAction:()=>qS,loadView:()=>yS,mergeData:()=>gS,openAssignment:()=>kS,openWorkByHandle:()=>AS,postProcess:()=>BS,purgeTransientData:()=>OS,removeAllTransientItems:()=>LS,removeContainerItem:()=>MS,removeSharedData:()=>HS,removeTransientItem:()=>US,replaceContainerItem:()=>FS,replaceTransientData:()=>PS,resetContainers:()=>SS,resetLoading:()=>RS,setLoading:()=>vS,setSharedProperty:()=>zS,setStateProperty:()=>KS,showCasePreview:()=>YS,showHarness:()=>mS,showHistory:()=>VS,showPage:()=>ES,upMergeAndRemoveContainerItem:()=>$S,updateContainerItem:()=>DS,updateTransientData:()=>bS});var p={};n.r(p),n.d(p,{buildResizeMessage:()=>qD,mashup:()=>YD});const h=function(){this.__data__=[],this.size=0};const f=function(e,t){return e===t||e!=e&&t!=t};const g=function(e,t){for(var n=e.length;n--;)if(f(e[n][0],t))return n;return-1};var m=Array.prototype.splice;const y=function(e){var t=this.__data__,n=g(t,e);return!(n<0)&&(n==t.length-1?t.pop():m.call(t,n,1),--this.size,!0)};const E=function(e){var t=this.__data__,n=g(t,e);return n<0?void 0:t[n][1]};const I=function(e){return g(this.__data__,e)>-1};const A=function(e,t){var n=this.__data__,r=g(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function C(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}C.prototype.clear=h,C.prototype.delete=y,C.prototype.get=E,C.prototype.has=I,C.prototype.set=A;const S=C;const _=function(){this.__data__=new S,this.size=0};const N=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const b=function(e){return this.__data__.get(e)};const T=function(e){return this.__data__.has(e)};const P="object"==typeof global&&global&&global.Object===Object&&global;var O="object"==typeof self&&self&&self.Object===Object&&self;const D=P||O||Function("return this")();const v=D.Symbol;var R=Object.prototype,$=R.hasOwnProperty,x=R.toString,w=v?v.toStringTag:void 0;const M=function(e){var t=$.call(e,w),n=e[w];try{e[w]=void 0;var r=!0}catch(e){}var a=x.call(e);return r&&(t?e[w]=n:delete e[w]),a};var L=Object.prototype.toString;const U=function(e){return L.call(e)};var F=v?v.toStringTag:void 0;const j=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?M(e):U(e)};const k=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const V=function(e){if(!k(e))return!1;var t=j(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const B=D["__core-js_shared__"];var G,W=(G=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"";const H=function(e){return!!W&&W in e};var q=Function.prototype.toString;const Y=function(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var z=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,J=K.toString,X=Q.hasOwnProperty,Z=RegExp("^"+J.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const ee=function(e){return!(!k(e)||H(e))&&(V(e)?Z:z).test(Y(e))};const te=function(e,t){return null==e?void 0:e[t]};const ne=function(e,t){var n=te(e,t);return ee(n)?n:void 0};const re=ne(D,"Map");const ae=ne(Object,"create");const se=function(){this.__data__=ae?ae(null):{},this.size=0};const oe=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var ie=Object.prototype.hasOwnProperty;const ce=function(e){var t=this.__data__;if(ae){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ie.call(t,e)?t[e]:void 0};var le=Object.prototype.hasOwnProperty;const de=function(e){var t=this.__data__;return ae?void 0!==t[e]:le.call(t,e)};const ue=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ae&&void 0===t?"__lodash_hash_undefined__":t,this};function pe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pe.prototype.clear=se,pe.prototype.delete=oe,pe.prototype.get=ce,pe.prototype.has=de,pe.prototype.set=ue;const he=pe;const fe=function(){this.size=0,this.__data__={hash:new he,map:new(re||S),string:new he}};const ge=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const me=function(e,t){var n=e.__data__;return ge(t)?n["string"==typeof t?"string":"hash"]:n.map};const ye=function(e){var t=me(this,e).delete(e);return this.size-=t?1:0,t};const Ee=function(e){return me(this,e).get(e)};const Ie=function(e){return me(this,e).has(e)};const Ae=function(e,t){var n=me(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ce(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ce.prototype.clear=fe,Ce.prototype.delete=ye,Ce.prototype.get=Ee,Ce.prototype.has=Ie,Ce.prototype.set=Ae;const Se=Ce;const _e=function(e,t){var n=this.__data__;if(n instanceof S){var r=n.__data__;if(!re||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Se(r)}return n.set(e,t),this.size=n.size,this};function Ne(e){var t=this.__data__=new S(e);this.size=t.size}Ne.prototype.clear=_,Ne.prototype.delete=N,Ne.prototype.get=b,Ne.prototype.has=T,Ne.prototype.set=_e;const be=Ne;const Te=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const Pe=function(e){return this.__data__.has(e)};function Oe(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Se;++t<n;)this.add(e[t])}Oe.prototype.add=Oe.prototype.push=Te,Oe.prototype.has=Pe;const De=Oe;const ve=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const Re=function(e,t){return e.has(t)};const $e=function(e,t,n,r,a,s){var o=1&n,i=e.length,c=t.length;if(i!=c&&!(o&&c>i))return!1;var l=s.get(e),d=s.get(t);if(l&&d)return l==t&&d==e;var u=-1,p=!0,h=2&n?new De:void 0;for(s.set(e,t),s.set(t,e);++u<i;){var f=e[u],g=t[u];if(r)var m=o?r(g,f,u,t,e,s):r(f,g,u,e,t,s);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!ve(t,(function(e,t){if(!Re(h,t)&&(f===e||a(f,e,n,r,s)))return h.push(t)}))){p=!1;break}}else if(f!==g&&!a(f,g,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p};const xe=D.Uint8Array;const we=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const Me=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var Le=v?v.prototype:void 0,Ue=Le?Le.valueOf:void 0;const Fe=function(e,t,n,r,a,s,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new xe(e),new xe(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return f(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var i=we;case"[object Set]":var c=1&r;if(i||(i=Me),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var d=$e(i(e),i(t),r,a,s,o);return o.delete(e),d;case"[object Symbol]":if(Ue)return Ue.call(e)==Ue.call(t)}return!1};const je=function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e};const ke=Array.isArray;const Ve=function(e,t,n){var r=t(e);return ke(e)?r:je(r,n(e))};const Be=function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[a++]=o)}return s};const Ge=function(){return[]};var We=Object.prototype.propertyIsEnumerable,He=Object.getOwnPropertySymbols;const qe=He?function(e){return null==e?[]:(e=Object(e),Be(He(e),(function(t){return We.call(e,t)})))}:Ge;const Ye=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const ze=function(e){return null!=e&&"object"==typeof e};const Ke=function(e){return ze(e)&&"[object Arguments]"==j(e)};var Qe=Object.prototype,Je=Qe.hasOwnProperty,Xe=Qe.propertyIsEnumerable;const Ze=Ke(function(){return arguments}())?Ke:function(e){return ze(e)&&Je.call(e,"callee")&&!Xe.call(e,"callee")};const et=function(){return!1};var tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,nt=tt&&"object"==typeof module&&module&&!module.nodeType&&module,rt=nt&&nt.exports===tt?D.Buffer:void 0;const at=(rt?rt.isBuffer:void 0)||et;var st=/^(?:0|[1-9]\d*)$/;const ot=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&st.test(e))&&e>-1&&e%1==0&&e<t};const it=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ct={};ct["[object Float32Array]"]=ct["[object Float64Array]"]=ct["[object Int8Array]"]=ct["[object Int16Array]"]=ct["[object Int32Array]"]=ct["[object Uint8Array]"]=ct["[object Uint8ClampedArray]"]=ct["[object Uint16Array]"]=ct["[object Uint32Array]"]=!0,ct["[object Arguments]"]=ct["[object Array]"]=ct["[object ArrayBuffer]"]=ct["[object Boolean]"]=ct["[object DataView]"]=ct["[object Date]"]=ct["[object Error]"]=ct["[object Function]"]=ct["[object Map]"]=ct["[object Number]"]=ct["[object Object]"]=ct["[object RegExp]"]=ct["[object Set]"]=ct["[object String]"]=ct["[object WeakMap]"]=!1;const lt=function(e){return ze(e)&&it(e.length)&&!!ct[j(e)]};const dt=function(e){return function(t){return e(t)}};var ut="object"==typeof exports&&exports&&!exports.nodeType&&exports,pt=ut&&"object"==typeof module&&module&&!module.nodeType&&module,ht=pt&&pt.exports===ut&&P.process,ft=function(){try{var e=pt&&pt.require&&pt.require("util").types;return e||ht&&ht.binding&&ht.binding("util")}catch(e){}}();var gt=ft&&ft.isTypedArray;const mt=gt?dt(gt):lt;var yt=Object.prototype.hasOwnProperty;const Et=function(e,t){var n=ke(e),r=!n&&Ze(e),a=!n&&!r&&at(e),s=!n&&!r&&!a&&mt(e),o=n||r||a||s,i=o?Ye(e.length,String):[],c=i.length;for(var l in e)!t&&!yt.call(e,l)||o&&("length"==l||a&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ot(l,c))||i.push(l);return i};var It=Object.prototype;const At=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||It)};const Ct=function(e,t){return function(n){return e(t(n))}};const St=Ct(Object.keys,Object);var _t=Object.prototype.hasOwnProperty;const Nt=function(e){if(!At(e))return St(e);var t=[];for(var n in Object(e))_t.call(e,n)&&"constructor"!=n&&t.push(n);return t};const bt=function(e){return null!=e&&it(e.length)&&!V(e)};const Tt=function(e){return bt(e)?Et(e):Nt(e)};const Pt=function(e){return Ve(e,Tt,qe)};var Ot=Object.prototype.hasOwnProperty;const Dt=function(e,t,n,r,a,s){var o=1&n,i=Pt(e),c=i.length;if(c!=Pt(t).length&&!o)return!1;for(var l=c;l--;){var d=i[l];if(!(o?d in t:Ot.call(t,d)))return!1}var u=s.get(e),p=s.get(t);if(u&&p)return u==t&&p==e;var h=!0;s.set(e,t),s.set(t,e);for(var f=o;++l<c;){var g=e[d=i[l]],m=t[d];if(r)var y=o?r(m,g,d,t,e,s):r(g,m,d,e,t,s);if(!(void 0===y?g===m||a(g,m,n,r,s):y)){h=!1;break}f||(f="constructor"==d)}if(h&&!f){var E=e.constructor,I=t.constructor;E==I||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof I&&I instanceof I||(h=!1)}return s.delete(e),s.delete(t),h};const vt=ne(D,"DataView");const Rt=ne(D,"Promise");const $t=ne(D,"Set");const xt=ne(D,"WeakMap");var wt="[object Map]",Mt="[object Promise]",Lt="[object Set]",Ut="[object WeakMap]",Ft="[object DataView]",jt=Y(vt),kt=Y(re),Vt=Y(Rt),Bt=Y($t),Gt=Y(xt),Wt=j;(vt&&Wt(new vt(new ArrayBuffer(1)))!=Ft||re&&Wt(new re)!=wt||Rt&&Wt(Rt.resolve())!=Mt||$t&&Wt(new $t)!=Lt||xt&&Wt(new xt)!=Ut)&&(Wt=function(e){var t=j(e),n="[object Object]"==t?e.constructor:void 0,r=n?Y(n):"";if(r)switch(r){case jt:return Ft;case kt:return wt;case Vt:return Mt;case Bt:return Lt;case Gt:return Ut}return t});const Ht=Wt;var qt="[object Arguments]",Yt="[object Array]",zt="[object Object]",Kt=Object.prototype.hasOwnProperty;const Qt=function(e,t,n,r,a,s){var o=ke(e),i=ke(t),c=o?Yt:Ht(e),l=i?Yt:Ht(t),d=(c=c==qt?zt:c)==zt,u=(l=l==qt?zt:l)==zt,p=c==l;if(p&&at(e)){if(!at(t))return!1;o=!0,d=!1}if(p&&!d)return s||(s=new be),o||mt(e)?$e(e,t,n,r,a,s):Fe(e,t,c,n,r,a,s);if(!(1&n)){var h=d&&Kt.call(e,"__wrapped__"),f=u&&Kt.call(t,"__wrapped__");if(h||f){var g=h?e.value():e,m=f?t.value():t;return s||(s=new be),a(g,m,n,r,s)}}return!!p&&(s||(s=new be),Dt(e,t,n,r,a,s))};const Jt=function e(t,n,r,a,s){return t===n||(null==t||null==n||!ze(t)&&!ze(n)?t!=t&&n!=n:Qt(t,n,r,a,e,s))};const Xt=function(e,t){return Jt(e,t)};let Zt,en,tn;const nn=e=>{e&&(Zt=e=e||{"base-server":"http://localhost:1080/prweb/","data-end-point":"api/v1/stream/data","action-end-point":"api/v1/stream/action"},Zt.BASEURL=e.server,Zt.ACTIONURL=e["action-end-point"],Zt.DATAURL=e["data-end-point"],tn=e.reAuthUrl)},rn=()=>tn,an=()=>Zt.BASEURL,sn=e=>fetch(`${Zt.BASEURL}${Zt.ACTIONURL}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),on=e=>{en=e},cn=()=>en;var ln=n(953);const dn=function(e){return"symbol"==typeof e||ze(e)&&"[object Symbol]"==j(e)};var un=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pn=/^\w*$/;const hn=function(e,t){if(ke(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!dn(e))||(pn.test(e)||!un.test(e)||null!=t&&e in Object(t))};function fn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],s=n.cache;if(s.has(a))return s.get(a);var o=e.apply(this,r);return n.cache=s.set(a,o)||s,o};return n.cache=new(fn.Cache||Se),n}fn.Cache=Se;const gn=fn;const mn=function(e){var t=gn(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t};var yn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,En=/\\(\\)?/g;const In=mn((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(yn,(function(e,n,r,a){t.push(r?a.replace(En,"$1"):n||e)})),t}));const An=function(e,t){for(var n=-1,r=null==e?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a};var Cn=v?v.prototype:void 0,Sn=Cn?Cn.toString:void 0;const _n=function e(t){if("string"==typeof t)return t;if(ke(t))return An(t,e)+"";if(dn(t))return Sn?Sn.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n};const Nn=function(e){return null==e?"":_n(e)};const bn=function(e,t){return ke(e)?e:hn(e,t)?[e]:In(Nn(e))};const Tn=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};const Pn=function(e){if("string"==typeof e||dn(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};const On=function(e,t){for(var n=0,r=(t=bn(t,e)).length;null!=e&&n<r;)e=e[Pn(t[n++])];return n&&n==r?e:void 0};const Dn=function(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(a);++r<a;)s[r]=e[r+t];return s};const vn=function(e,t){return t.length<2?e:On(e,Dn(t,0,-1))};var Rn=Object.prototype.hasOwnProperty;const $n=function(e,t){var n=-1,r=(t=bn(t,e)).length;if(!r)return!0;for(;++n<r;){var a=Pn(t[n]);if("__proto__"===a&&!Rn.call(e,"__proto__"))return!1;if(("constructor"===a||"prototype"===a)&&n<r-1)return!1}var s=vn(e,t);return null==s||delete s[Pn(Tn(t))]};const xn=function(e,t){return null==e||$n(e,t)};var wn=Object.prototype.hasOwnProperty;const Mn=function(e,t){return null!=e&&wn.call(e,t)};const Ln=function(e,t,n){for(var r=-1,a=(t=bn(t,e)).length,s=!1;++r<a;){var o=Pn(t[r]);if(!(s=null!=e&&n(e,o)))break;e=e[o]}return s||++r!=a?s:!!(a=null==e?0:e.length)&&it(a)&&ot(o,a)&&(ke(e)||Ze(e))};const Un=function(e,t){return null!=e&&Ln(e,t,Mn)};const Fn=function(e,t,n){var r=null==e?void 0:On(e,t);return void 0===r?n:r};const jn=function(){try{var e=ne(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const kn=function(e,t,n){"__proto__"==t&&jn?jn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var Vn=Object.prototype.hasOwnProperty;const Bn=function(e,t,n){var r=e[t];Vn.call(e,t)&&f(r,n)&&(void 0!==n||t in e)||kn(e,t,n)};const Gn=function(e,t,n,r){if(!k(e))return e;for(var a=-1,s=(t=bn(t,e)).length,o=s-1,i=e;null!=i&&++a<s;){var c=Pn(t[a]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(a!=o){var d=i[c];void 0===(l=r?r(d,c,i):void 0)&&(l=k(d)?d:ot(t[a+1])?[]:{})}Bn(i,c,l),i=i[c]}return e};const Wn=function(e,t,n){return null==e?e:Gn(e,t,n)};const Hn=function(e,t,n){(void 0!==n&&!f(e[t],n)||void 0===n&&!(t in e))&&kn(e,t,n)};const qn=function(e){return function(t,n,r){for(var a=-1,s=Object(t),o=r(t),i=o.length;i--;){var c=o[e?i:++a];if(!1===n(s[c],c,s))break}return t}}();var Yn="object"==typeof exports&&exports&&!exports.nodeType&&exports,zn=Yn&&"object"==typeof module&&module&&!module.nodeType&&module,Kn=zn&&zn.exports===Yn?D.Buffer:void 0,Qn=Kn?Kn.allocUnsafe:void 0;const Jn=function(e,t){if(t)return e.slice();var n=e.length,r=Qn?Qn(n):new e.constructor(n);return e.copy(r),r};const Xn=function(e){var t=new e.constructor(e.byteLength);return new xe(t).set(new xe(e)),t};const Zn=function(e,t){var n=t?Xn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const er=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var tr=Object.create;const nr=function(){function e(){}return function(t){if(!k(t))return{};if(tr)return tr(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const rr=Ct(Object.getPrototypeOf,Object);const ar=function(e){return"function"!=typeof e.constructor||At(e)?{}:nr(rr(e))};const sr=function(e){return ze(e)&&bt(e)};var or=Function.prototype,ir=Object.prototype,cr=or.toString,lr=ir.hasOwnProperty,dr=cr.call(Object);const ur=function(e){if(!ze(e)||"[object Object]"!=j(e))return!1;var t=rr(e);if(null===t)return!0;var n=lr.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&cr.call(n)==dr};const pr=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};const hr=function(e,t,n,r){var a=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var i=t[s],c=r?r(n[i],e[i],i,n,e):void 0;void 0===c&&(c=e[i]),a?kn(n,i,c):Bn(n,i,c)}return n};const fr=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var gr=Object.prototype.hasOwnProperty;const mr=function(e){if(!k(e))return fr(e);var t=At(e),n=[];for(var r in e)("constructor"!=r||!t&&gr.call(e,r))&&n.push(r);return n};const yr=function(e){return bt(e)?Et(e,!0):mr(e)};const Er=function(e){return hr(e,yr(e))};const Ir=function(e,t,n,r,a,s,o){var i=pr(e,n),c=pr(t,n),l=o.get(c);if(l)Hn(e,n,l);else{var d=s?s(i,c,n+"",e,t,o):void 0,u=void 0===d;if(u){var p=ke(c),h=!p&&at(c),f=!p&&!h&&mt(c);d=c,p||h||f?ke(i)?d=i:sr(i)?d=er(i):h?(u=!1,d=Jn(c,!0)):f?(u=!1,d=Zn(c,!0)):d=[]:ur(c)||Ze(c)?(d=i,Ze(i)?d=Er(i):k(i)&&!V(i)||(d=ar(c))):u=!1}u&&(o.set(c,d),a(d,c,r,s,o),o.delete(c)),Hn(e,n,d)}};const Ar=function e(t,n,r,a,s){t!==n&&qn(n,(function(o,i){if(s||(s=new be),k(o))Ir(t,n,i,r,e,a,s);else{var c=a?a(pr(t,i),o,i+"",t,n,s):void 0;void 0===c&&(c=o),Hn(t,i,c)}}),yr)};const Cr=function(e){return e};const Sr=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var _r=Math.max;const Nr=function(e,t,n){return t=_r(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=_r(r.length-t,0),o=Array(s);++a<s;)o[a]=r[t+a];a=-1;for(var i=Array(t+1);++a<t;)i[a]=r[a];return i[t]=n(o),Sr(e,this,i)}};const br=function(e){return function(){return e}};const Tr=jn?function(e,t){return jn(e,"toString",{configurable:!0,enumerable:!1,value:br(t),writable:!0})}:Cr;var Pr=Date.now;const Or=function(e){var t=0,n=0;return function(){var r=Pr(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Tr);const Dr=function(e,t){return Or(Nr(e,t,Cr),e+"")};const vr=function(e,t,n){if(!k(n))return!1;var r=typeof t;return!!("number"==r?bt(n)&&ot(t,n.length):"string"==r&&t in n)&&f(n[t],e)};const Rr=function(e){return Dr((function(t,n){var r=-1,a=n.length,s=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(a--,s):void 0,o&&vr(n[0],n[1],o)&&(s=a<3?void 0:s,a=1),t=Object(t);++r<a;){var i=n[r];i&&e(t,i,r,s)}return t}))}((function(e,t,n,r){Ar(e,t,n,r)}));var $r=Object.prototype.hasOwnProperty;const xr=function(e){if(null==e)return!0;if(bt(e)&&(ke(e)||"string"==typeof e||"function"==typeof e.splice||at(e)||mt(e)||Ze(e)))return!e.length;var t=Ht(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(At(e))return!Nt(e).length;for(var n in e)if($r.call(e,n))return!1;return!0};class wr{static setNamespaceSupport=(e=!1)=>{wr.namespaceEnabled=e};static isNamespaceEnabled=()=>wr.namespaceEnabled??!1;static getNamespaceList=()=>{const e=globalThis.PCore,t=e?.getEnvironmentInfo?.();if(t&&"function"==typeof t.getFeatureMap)return t.getFeatureMap()?.namespaceList};static getQualifiedName=(e,t)=>{if(!wr.isNamespaceEnabled())return e;const n=wr.getNamespaceList();if(Array.isArray(n)){if(n.some((t=>{const n=`${t}__`;return e.startsWith(n)})))return e}return`${t}__${e}`};static getDefaultQualifiedName=e=>wr.getQualifiedName(e,"PegaPlatform");static namespacePrefixedRuleName(e,t){return t?wr.getQualifiedName(e,t):wr.getDefaultQualifiedName(e)}static getQualifiedNameForComplexRuleReferences(e,t){const{namespace:n,marker:r}=t??{},a=`${r??"caseInfo.content"}.`,s=e.lastIndexOf(a);if(-1!==s){return e.slice(0,s+a.length)+e.slice(s+a.length).split(".").map((e=>wr.namespacePrefixedRuleName(e,n))).join(".")}if(e.includes(".")){const t=e.startsWith("."),r=(t?e.slice(1):e).split(".").filter(Boolean).map((e=>wr.namespacePrefixedRuleName(e,n))).join(".");return t?`.${r}`:r}return wr.namespacePrefixedRuleName(e,n)}}const Mr=wr;const Lr=new class{constructor(){this.needsMapping=!1}getNeedsMapping(){return this.needsMapping}setNeedsMapping(e){this.needsMapping=e}map(e){return this.needsMapping?this.replacer(e):e}transformObjectToCase(e){let t,n=!1;try{const n=this.replaceToCase(JSON.stringify(e));t=JSON.parse(n)}catch(e){console.error("not a Valid JSON",e),n=!0}return n?e:t}transformCaseData(e){const t=e?.data?.caseInfo,n=e?.uiResources;return{data:{objectInfo:{content:{...t?.content}}},uiResources:{...n}}}analyseResponse(e){e?.data?.objectInfo&&window?.PCore?.getEnvironmentInfo()?.isUnifiedObject()?this.setNeedsMapping(!0):this.setNeedsMapping(!1)}replacer(e){return this.needsMapping&&(e=e.replace("caseInfo","objectInfo").replace("caseTypeName","objectTypeName").replace("caseTypeID","objectTypeID")),e}replaceToCase(e){return e.replace("objectInfo","caseInfo").replace("objectTypeName","caseTypeName").replace("objectTypeID","caseTypeID")}},Ur={APP:{APP:"app",ROOT:"root",INFINITY_RUNTIME:"Infinity",PXREQUESTOR:"pxRequestor",PXUSERNAME:".pxUserName",OPERATORID:"OperatorID",USERNAME:"pxRequestor.pxUserName",PXUSERIDENTIFIER:".pxUserIdentifier",USERIDENTIFIER:"pxRequestor.pxUserIdentifier",PYIMAGEINSKEY:".pyImageInsKey",OPERATORID_IMG_INSKEY:"OperatorID.pyImageInsKey",OPERATORID_LOCALE:"OperatorID.pyUseLocale",APPLICATION_LABEL:"Application.pyLabel",APPLICATION_RULE_NAME:"Application.pyRuleName"},RESOURCE_TYPES:{ASSIGNMENT:"ASSIGNMENT",CASE:"CASE",DATA:"DATA",PAGE:"PAGE",OBJECT:"OBJECT"},RESOURCE_STATUS:{CREATE:"CREATE",UPDATE:"UPDATE",OPEN_FLOW_ACTION:"OPEN_FLOW_ACTION"},VIEW_NAMES:{PY_CASE_TAB:Mr.getDefaultQualifiedName("pyCaseTab"),DATA_OBJECT_CREATE_VIEW:Mr.getDefaultQualifiedName("Create"),DATA_OBJECT_EDIT_VIEW:Mr.getDefaultQualifiedName("pyEdit"),PY_DATA_PREVIEW:Mr.getDefaultQualifiedName("pyDataPreview"),PY_DETAILS:Mr.getDefaultQualifiedName("pyDetails"),OBJECT_CREATE_VIEW:"Create",SUBSCRIPT_CREATE_VIEW:Mr.getDefaultQualifiedName("SubscriptView")},CONTAINERS:{ROOT_CONTAINER:"RootContainer",VIEW_CONTAINER:"ViewContainer",FLOW_CONTAINER:"FlowContainer",MODAL_VIEW_CONTAINER:"ModalViewContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",HYBRID_VIEW_CONTAINER:"HybridViewContainer"},WORK_BASKET:{MY_WORK_LIST:"myWorkList",REPORTEE:"reportee",WORK_QUEUE:"workQueue",DATA_PAGES:{D__PY_GET_USER_WORK_LIST_BY_USER_ID:Mr.getDefaultQualifiedName("D_pyGetUserWorkListByUserId"),D__WORK_BASKET:Mr.getDefaultQualifiedName("D_WorkBasket"),D__PY_MY_WORK_LIST:Mr.getDefaultQualifiedName("D_pyMyWorkList"),D__PY_ASSIGNMENTS_DATA:"D_pyAssignmentsData"}},CONTEXT_TREE_NODE_TYPES:{VIEW:"VIEW",FIELD:"FIELD",DECLARATIVE_TARGET:"DECLARATIVE_TARGET",WHEN:"WHEN",CONTEXT:"CONTEXT",PAGELIST:"PAGELIST"},WORKLIST:"worklist",WAIT:"wait",TODO:"todo",STANDARD_FLOW:"Standard",CASE:"CASE",ASSIGNMENT:"ASSIGNMENT",FIX_BROKEN_ASSIGNMENTS:"FixBrokenAssignments",PAGE:"PAGE",PZINSKEY:".pzInsKey",CREATE_DETAILS_VIEW_NAME:Mr.getDefaultQualifiedName("pzCreateDetails"),PREVIEW_VIEW_NAME:Mr.getDefaultQualifiedName("pyCasePreview"),CASESUMMARY_VIEW_NAME:"pyCaseSummary",APPSHELL_ACTIVE_CASES:"appshell-activecases",TRACE_ID:"x-b3-traceid",LOAD_VIEW_STRING:"View",PRIMARY:"primary",DEFER_UPDATE_CASESUMMARY_VIEW:"deferUpdateCaseSummaryView",NEXT_ASSIGNMENT_INFO_ID:"nextAssignmentInfo.ID",WORKCLASS:"Work-",DATA_INFO:{DATA_INFO:"dataInfo",DATA_INFO_CONTENT:"dataInfo.content",DATA_INFO_CONTEXT_KEY:"dataInfo.contextKey"},OBJECT_INFO:{OBJECT_INFO:"objectInfo",OBJECT_INFO_ID:"objectInfo.ID",OBJECT_INFO_CONTENT:"objectInfo.content",ACTIVE_ACTION_ID:"objectInfo.activeActionID",OBJECT_INFO_CONTENT_CLASS_ID:"objectInfo.content.classID"},CASE_INFO:{CASE_INFO:"caseInfo",CASE_INFO_COLLABORATORS:"caseInfo.collaborators",CASE_INFO_CONTENT:"caseInfo.content",CASE_INFO_ENCRYPTED_CONTENT:"caseInfo.encryptedContent",CASE_INFO_NAME:"caseInfo.name",CASE_INFO_ID:"caseInfo.ID",CASE_INFO_CLASSID:"caseInfo.content.classID",CASE_INFO_CLASSNAME:"caseInfo.className",CASE_TYPE_ID:"caseInfo.caseTypeID",CASE_TYPE_NAME:"caseInfo.caseTypeName",CASE_INFO_PZINSKEY:Mr.getQualifiedNameForComplexRuleReferences("caseInfo.content.pzInsKey"),CASE_INFO_ACTIONS:"caseInfo.availableActions",VIEW_NAME:Mr.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyViewName"),ACTION_BUTTONS:"caseInfo.actionButtons",ACTIVE_ACTION_ID:"caseInfo.activeActionID",ASSIGNMENT_LABEL:"caseInfo.assignments[0].name",ASSIGNMENT_ID:"caseInfo.assignments[0].ID",ASSIGNMENTS:"caseInfo.assignments",INSTRUCTIONS:"caseInfo.assignments[0].instructions",NAVIGATION:"caseInfo.navigation",STAGES:"caseInfo.stages",STAGEID:"caseInfo.stageID",CASECLASS:"caseInfo.caseClass",AVAILABLEACTIONS:"caseInfo.availableActions",AVAILABLEPROCESSES:"caseInfo.availableProcesses",D_CASE_ASSIGNMENTS_RESULTS:"caseInfo.assignments",CHILD_ASSIGNMENTS:"caseInfo.childCases",ASSIGNMENTACTION_ID:"caseInfo.assignments[0].actions[0].ID",ISINCREATESTAGE:"caseInfo.isInCreateStage",APPROVALFLAG:Mr.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyApprovalResult"),DUPLICATECASEFLAG:Mr.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateCaseActions"),DUPLICATECASEID:Mr.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateID"),DUPLICATECASEINSKEY:Mr.getQualifiedNameForComplexRuleReferences("caseInfo.content.pyDuplicateCaseReference.pzInsKey"),HEADERS:"caseInfo.headers",PARENTCASEINFO:"caseInfo.parentCaseInfo",REMOTESYSTEMID:"caseInfo.headers.RemoteSystemID",CASE_RELATED_CASE_TYPES:"caseInfo.relatedCaseTypes",CASES:"caseInfo.cases",IS_ASSIGNMENT:"caseInfo.isAssignment",GETNEXTWORK:"caseInfo.confirmationLinks.getNextWork",ACTION_REFRESH_CONDITIONS:"caseInfo.assignments[0].actions[0].refreshConditions",IS_LOCAL_ACTION:"caseInfo.isLocalAction",BUSINESS_ID:"caseInfo.businessID",IS_FIRST_ASSIGNMENT:"caseInfo.isFirstAssignment",CASE_INFO_ATTACHMENTS:"caseInfo.attachments"},ACTIONS:{ACTION_ID:"actionID",ACTIONS:"availableActions",DELETEAVIALACTIONS:"deleteAvailActions",FLOWACTION:"FlowAction",DATA_PAGES:{D_PY_ADDITIONAL_CASE_ACTIONS:Mr.getDefaultQualifiedName("D_pyAdditionalCaseActions")}},PROCESS:{FLOWPROBLEMS:"FlowProblems"},PAGE_TYPES:{PAGE:"page",LANDINGPAGE:"landingpage",LISTPAGE:"listpage"},LOCAL_ACTION_TYPE:{CASE_WIDE:"case",EXPRESS:"express",ASSIGNMENT:"Assignment",LOCAL_ACTION:"LocalAction"},LOCAL_ACTIONS:{TRANSFER_ASSIGNMENT:Mr.getDefaultQualifiedName("pyTransferAssignment")},CONTENT:"content",MODAL:"modal",ACTIONAREA:"actionarea",STOPMERGEACTIONS:"stopMergeActions",IS_CREATE_DATA_OBJECT:"isCreateDataObject",SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME:Mr.getQualifiedNameForComplexRuleReferences("context_data.caseInfo.content.summary_of_assignment__.lastSubmitTime"),SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME:Mr.getQualifiedNameForComplexRuleReferences("context_data.caseInfo.content.summary_of_attachments__.lastRefreshTime"),CONTEXT_DATA_ASSIGNMENTID:"context_data.assignmentID",BANNER_VARIANT_SUCCESS:"success",BANNER_VARIANT_WARNING:"warning",BANNER_VARIANT_URGENT:"urgent",BANNER_VARIANT_INFO:"info",INVALID_INPUTS:"Invalid inputs",VALIDATION_FAIL:"Validation fail",MESSAGES:{MESSAGES_TYPE_SUCCESS:"success",MESSAGES_TYPE_INFO:"info",MESSAGES_TYPE_ERROR:"error"},PUB_SUB_EVENTS:{EVENT_RENDER_APP:"renderApp",EVENT_UNMOUNT_APP:"unmountApp",EVENT_REAUTH:"reAuth",EVENT_FULL_REAUTH:"fullReAuth",EVENT_CUSTOM_REAUTH:"customReAuth",EVENT_CLOSE_REAUTH_MODAL:"closeReAuthModal",EVENT_CANCEL:"cancel",EVENT_MINIMIZE:"minimize",EVENT_EXPRESS_LOCALACTION:"expressLocalActionSubmit",EVENT_BULKACTION:"bulkActionSubmit",EVENT_FINISH_ASSIGNMENT_DONE:"finishAssignmentDone",EVENT_SHOW_CANCEL_ALERT:"showCancelAlert",EVENT_SHOW_DELETE_ALERT:"showDeleteAlert",EVENT_DASHBOARD_FILTER_CHANGE:"dashboardFilterChange",EVENT_DASHBOARD_FILTER_CLEAR_ALL:"dashboardFilterClearAll",EVENT_PROMOTED_FILTERS_CHANGE:"promotedFiltersChange",EVENT_LOCALACTION_SUBMISSION:"localActionSubmit",EVENT_PREVIEW_DISMISS:"previewDismiss",EVENT_LOGOFF:"Logoff",EVENT_TRANSIENT_ITEMS:{UPDATE_PROMOTED_FILTERS:"updatePromotedFilters"},UI_EVENTS:{INSPECTOR:"inspector",INSPECTOR_SHOW_ALL:"inspectorShowAll",UI_DESIGNER:"uiDesigner",UI_DESIGNER_TOOLBAR_EXPANDED:"uiDesignerToolbarExpanded",SHOW_PAGE_INIT:"showPageInit",SHOW_PAGE_DONE:"showPageDone",SHOW_PAGE_STARTED:"showPageStarted",THEME_CHANGE:"themeChange",THEME_MODE_CHANGE:"themeModeChange",NAV_ORIENTATION_CHANGE:"navOrientationChange",CASE_VIEW_TEMPLATE_CHANGE:"caseViewTemplateChange",MULTI_STEP_NAV_DISPLAY_CHANGE:"multiStepNavDisplayChange",CASE_STAGE_DISPLAY_CHANGE:"caseStageDisplayChange"},CASE_EVENTS:{CASE_ATTACHMENTS_UPDATED_FROM_CASEVIEW:"caseAttachmentsUpdateFromCaseview",CASE_FOLLOWER_UPDATED_BY_OPERATOR_FROM_CASEVIEW:"caseFollowerUpdateByOperatorFromCaseview",CASE_FOLLOWER_UPDATE_BY_OPERATOR_FROM_WIDGET:"caseFollowerUpdateByOperatorFromWidget",CASE_CREATED:"caseCreated",CREATE_STAGE_DONE:"caseCreatedDone",CREATE_STAGE_CANCELLED:"caseCancelled",CREATE_STAGE_SAVED:"caseSaved",CREATE_STAGE_DELETED:"caseDeleted",ASSIGNMENT_SUBMISSION:"assignmentSubmission",END_OF_ASSIGNMENT_PROCESSING:"endOfAssignmentProcessing",CLOSE_CONFIRM_VIEW:"closeConfirmView",CASE_OPENED:"caseOpened",CASE_VIEW_OPENED_AFTER_CREATE:"caseViewOpenedAfterCreate",CASE_CLOSED:"caseClosed",ASSIGNMENT_OPENED:"assignmentOpened",CASE_PREVIEW:"casePreview",CURRENT_ASSIGNMENT_UPDATED:"currentAssignmentUpdated",CASE_LOCK_EVENT:"caseLockEvent",GET_NEXT_WORK:"getNextWork",SAVE_ASSIGNMENT_COMPLETE:"saveAssignmentComplete",CASE_LOAD:"caseLoad",CASE_UNLOAD:"caseUnload",CASE_EDIT_OPEN:"caseEditOpen",CASE_EDIT_CLOSE:"caseEditClose",CREATE_CASE_MODAL_OPEN:"createCaseModalOpen",CREATE_CASE_MODAL_CLOSE:"createCaseModalClose"},ASSIGNMENT_EVENTS:{ASSIGNMENT_LOAD:"assignmentLoad",ASSIGNMENT_UNLOAD:"assignmentUnload"},WORK_EVENTS:{WORK_DELETED:"workDeleted"},BOOTSTRAP_SHELL_EVENTS:{CONSTELLATION_LOADED:"CONSTELLATION_LOADED"},CONTAINER_EVENTS:{CLOSE_CONTAINER_ITEM:"CLOSE_CONTAINER_ITEM",CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM:"CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM"},DISPLAY_CASE_CREATED_TOASTER:"displayCaseCreatedToaster",DISPLAY_CASE_SUBMITTED_TOASTER:"displayCaseSubmittedToaster",DATA_EVENTS:{DATA_OBJECT_CREATED:"dataObjectCreated",DATA_OBJECT_DELETED:"dataObjectDeleted",DATA_OBJECT_UPDATED:"dataObjectUpdated"},FETCH_SUCCESS:"fetchSuccess",FETCH_FAILURE:"fetchFailure",REVERSE_COEXISTENCE_EVENTS:{HANDLE_DISCARD:"handleDiscard",CHECK_IS_FORM_DIRTY:"checkIsFormDirty"},TIMEOUT_REMINDER:"sessionAboutToTimeout",RESET_TIMER:"resetInactivityTimer",PEGA_EMBED_CUSTOM:"pegaEmbedCustom",SUGGESTION_PROCESSED:"suggestion_processed",ERROR_ON_FINISH_ASSIGNMENT:"errorOnFinishAssignment",URL_NAVIGATION:"urlNavigation",ON_REFRESH_START:"onRefreshStart",ON_REFRESH_COMPLETE:"onRefreshComplete",ON_REFRESH_ERROR:"onRefreshError",EVENT_LOCALE_CHANGED:"localeChanged"},ERROR_TYPE:{CLIENT:"client",SERVER:"server"},CONTAINER_TYPE:{MULTIPLE:"multiple",SINGLE:"single",HYBRID:"HybridViewContainer"},REMOTE_SYSTEM_ID:"RemoteSystemID",LIST_SELECTION_MODE:{MULTI:"multi",SINGLE:"single",MULTI_ON_HOVER:"multi_on_hover"},SUBMISSION_FAILURE_TYPE:{FORM_VALIDATION_ERROR:"formValidationError"},USER_SETTINGS:{UTILITY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.utilityPanelExpanded",SUMMARY_PANEL_USER_STATE_PATH:"presentation.templates.CaseView.summaryPanelExpanded",ASSIGNMENT_COLLAPSED_STATE_PATH:"presentation.templates.CaseView.assignmentWidgetCollapsed",CASE_VIEW_PATH:"presentation.templates.CaseView",PORTAL_AGENT_SPLIT_VIEW_PATH:"presentation.templates.GenAICoach",PORTAL_AGENT_WIDTH_PATH:"presentation.templates.GenAICoach.agentPanelWidth"},PROMISE_VALUE:{RESOLVE:"resolve",REJECT:"reject"},APP_TYPE:{UIKIT:"uikit",THEME_COSMOS:"themecosmos"},PORTAL_TYPE:{WSS:"wss"},VIEW_TYPE:{PY_EMBEDASSIGNMENT:Mr.getDefaultQualifiedName("pyEmbedAssignment"),PY_DETAILS:Mr.getDefaultQualifiedName("pyDetails")},ACTION:"action",CONTEXT_DATA_MODAL_VIEW:{CONTEXT_DATA_MODAL_VIEW:"context_data.modalView",IS_MULTI_RECORD_DATA:"context_data.modalView.isMultiRecordData",VIEW_NAME:"context_data.modalView.viewName",PARENT_CONTEXT:"context_data.modalView.parentContext",INTERESTPAGE:"context_data.modalView.interestPage",EDIT_TYPE:"context_data.modalView.editType",ACTION_ID:"context_data.modalView.actionID"},FEED:{MESSAGE_VIEW_REFERENCE:Mr.getDefaultQualifiedName("messageViewReference"),PARENT_MESSAGE_ID:Mr.getDefaultQualifiedName("parentMessageID"),PX_RESULTS:Mr.getDefaultQualifiedName("pxResults"),NAME:Mr.getDefaultQualifiedName("name"),POSTED_BY_USER:Mr.getDefaultQualifiedName("postedByUser"),UPDATED_TIME:Mr.getDefaultQualifiedName("updatedTime"),POST_MESSAGE:Mr.getDefaultQualifiedName("PostMessage"),PZ_INS_KEY:Mr.getDefaultQualifiedName("pzInsKey"),PZ_PRIVATE_POST_DETAILS:Mr.getDefaultQualifiedName("pzPrivatePostDetails"),PY_SELECTED:Mr.getDefaultQualifiedName("pySelected"),PY_LABEL:Mr.getDefaultQualifiedName("pyLabel"),PY_RECIPIENTS:Mr.getDefaultQualifiedName("pyRecipients"),MENTIONS:Mr.getDefaultQualifiedName("mentions"),PY_IS_DELETE_ENABLED:Mr.getDefaultQualifiedName("pyIsDeleteEnabled"),TAGS:Mr.getDefaultQualifiedName("tags"),PZ_POST_DETAILS:Mr.getDefaultQualifiedName("pzPostDetails"),PY_FEED_SOURCE_REFERENCE:Mr.getDefaultQualifiedName("pyFeedSourceReference"),IS_EDITED:Mr.getDefaultQualifiedName("isEdited"),PY_LIKES:Mr.getDefaultQualifiedName("pyLikes"),PY_POST_TYPE:Mr.getDefaultQualifiedName("pyPostType"),POSTED_TIME:Mr.getDefaultQualifiedName("postedTime"),PY_MESSAGE_VIEW_REFERENCE:Mr.getDefaultQualifiedName("pyMessageViewReference"),ID:Mr.getDefaultQualifiedName("ID"),PY_COMMENT_CONTEXT:Mr.getDefaultQualifiedName("pyCommentContext"),PX_LIKE_COUNT:Mr.getDefaultQualifiedName("pxLikeCount"),MESSAGE:Mr.getDefaultQualifiedName("message")},CASE_VIEW_MODE:{PERFORM:"perform",REVIEW:"review",CONFIRM:"confirm"}},Fr={CONTEXT:"context",AJAXCONTAINER:"primary",VIEW_CONTAINER:"ViewContainer",APP_SHELL:"AppShell",ROOT_CONTAINER:"RootContainer",HYBRID:"hybrid",HYBRID_VIEW_CONTAINER:"HybridViewContainer",HYRBID_ROOT_CONTAINERNAME:"hybridRootContainerName",MODAL_VIEW_CONTAINER:"ModalViewContainer",FLOW_CONTAINER:"FlowContainer",PREVIEW_VIEW_CONTAINER:"PreviewViewContainer",OBJECT_PAGE:"ObjectPage",CASE_CREATE_STAGE:"CaseCreateStage",CASE_VIEW:"CaseView",RULE_VIEW:"RuleView",SELF_SERVICE_CASE_VIEW:"SelfServiceCaseView",VIEW:"view",CASE_PREVIEW:"CasePreview",RULE_PREVIEW:"RulePreview",CASE_STAGES:"Stages",CASEMESSAGES:"caseMessages",SUGGESTION:"suggestion",PREVIEW:"preview",TERTIARY:"tertiary",DEFAULT:"default",ACPRIMARY:"primary",ACTERTIARY:"tertiary",PERFORM_MODE:"perform",CASE_VIEW_MODE_PROP:".caseViewMode",REVIEW_MODE:"review",WORKAREA:"workarea",OBJECTACTIONCONTAINER:"ObjectActionContainer",ACPRIMARY_NAME:"ACPRIMARY",ACTERTIARY_NAME:"ACTERTIARY",THREADNAMESEPARATOR:"/",JOINCHARACTER:"_",FORWARD_SLASH_STRING:"/",UNDERSCORE_STRING:"_",DOUBLE_UNDERSCORE_STRING:"__",WORK_ID:"WORK_ID",EMPTY_STRING:"",PROPERTY_MESSAGES:"propertyMessages__",CONTEXT_MESSAGES:"contextMessages__",HTTP_MESSAGES:"httpMessages__",PAGE_MESSAGES:"pageMessages__",SUMMARY_OF_LISTS:"summary_of_lists__",SUMMARY_OF_GROUPS:"summary_of_groups__",SUMMARY_OF_MESSAGES:"summary_of_messages__",SUMMARY_OF_FIELD_VALUES:"summary_of_field_values__",SUMMARY_OF_WHEN_CONDITIONS:"summary_of_when_conditions__",SUMMARY_OF_DYNAMIC_WHENS:"summary_of_dynamic_whens__",SUMMARY_OF_EXPRESSIONS:"summary_of_expressions__",SUMMARY_OF_ASSOCIATED_LISTS:"summary_of_associated_lists__",CONTEXT_DATA:"context_data",TABLE:e=>`Table[${e}]`,HTTP:"HTTP",PROPERTY:"PROPERTY",PAGE_ERRORS:"page_level_errors",CUSTOM_ERROR:"custom error",NO_MESSAGES:"No messages existing",PULSE_REFERENCE:"pulse.messages",IS_LOADING:"isLoading",APPROVED:"Approved",REJECTED:"Rejected",DUPLICATE:"Duplicate",IGNORE:"Ignore",PARAGRAPH:"PARAGRAPH",X_ORIGIN_CHANNEL:"x-origin-channel",AUTHORING_PREVIEW_CONTAINER:"root/authoring-preview",EMBED:"EMBED",ERROR_FIELD_IN_PAGE:"erroneousInputOutputFieldInPage",ERROR_IN_PAGE_IDENTIFIER:"erroneousInputOutputIdentifier",ON_REFRESH_ERROR:"onRefreshError",UI_RESOURCES:"uiResources",UI_RESOURCES_CONTEXT_DATA:"uiResources.context_data",ACTION_BUTTONS:"uiResources.actionButtons",RESOURCES:"uiResources.resources",ROOT:"uiResources.root",CASE_INFO_IS_LOCAL_ACTION:"caseInfo.isLocalAction",OBJECT_INFO_IS_LOCAL_ACTION:"objectInfo.isObjectWideAction",DATA:"data",OPTIONS:"options",VIEWS:"uiResources.resources.views",NAVIGATIONS:"uiResources.resources.navigations",COMPONENTS:"uiResources.components",UI_RESOURCES_ROOT_CONTEXT:"uiResources.root.config.context",LOCALE_REFERENCES:"uiResources.localeReferences",STATIC_SERVER_URL:"staticServer",APPLICATION_DATA:"data.Application",REFERENCED_USERS:"referencedUsers",CASE_INFO_REFRESH_CONDITIONS:"caseInfo.refreshConditions",FIELD_LEVEL_SUCCESS:"success",FIELD_LEVEL_WARNING:"warning",FIELD_LEVEL_ERROR:"error",HASH_DELIMITER:"~^|^~",NULL_STRING:"null",DATA_PAGE:"DataPage",DECISION:"Decision",RULE_REFERENCE:"RuleReference",GET_PAGE_DATA:"getPageData",PROPERTY_ANNOTATION:"@P",FIELD_LABEL_ANNOTATION:"@FL",ATTACHMENT_ANNOTATION:"@ATTACHMENT",PARAGRAPH_ANNOTATION:"@PARAGRAPH",FORMAT_ANNOTATION:"@FORMAT",ASSOCIATED_PROPERTY_ANNOTATION:"@ASSOCIATED",CLASS_ASSOCIATION_ANNOTATION:"@CA",FILTERED_LIST_ANNOTATION:"@FILTERED_LIST",CLASS_ANNOTATION:"@CLASS",ASSOCIATED:"associated",CLASS_ID:".classID",CLASSID:"classID",READONLY:"readonly",SHARED:"shared",RELOAD_IF_OLDER_THAN:"reloadIfOlderThan",RELOAD_ONCE_PER_INTERACTION:"reloadOncePerInteraction",PY_DETAILS:Mr.getDefaultQualifiedName("pyDetails"),PY_CONFIRM:Mr.getDefaultQualifiedName("pyConfirm"),LIST_ACTIONS:{ADD:"ADD",INSERT:"INSERT",UPDATE:"UPDATE",DELETE:"DELETE",DELETE_ALL:"DELETE ALL",MOVE:"MOVE",SELECT:"SELECT",DESELECT:"DESELECT",REPLACE:"REPLACE",DELETEPAGE:"DELETEPAGE"},LIST_ACTIONS_TYPE:{SELECT_DESELECT:"SELECT_DESELECT",DESELECT_ALL:"DESELECT_ALL"},ENV_INFO_KEYS:{APPLICATION_NAME:"APPLICATION_NAME",APPLICATION_DESC:"APPLICATION_DESC",APPLICATION_ID:"APPLICATION_ID",ACCESS_GROUP:"ACCESS_GROUP",USER_NAME:"USER_NAME",USER_ID:"USER_ID",USER_IMAGE:"USER_IMAGE",LOCALE:"LOCALE",TIMEZONE:"TIMEZONE",WORK_GROUP:"WORK_GROUP"},ID:"ID",SCALARLIST:"ScalarList",COREHEADERS:"coreHeaders",SKIPCOREHEADERS:"skipCoreHeaders",COREHEADER_APP_DEBUG_ID:"X-Pega-App-Debug-ID",COREHEADER_APP_DEBUG_LEVELS:"X-Pega-App-Debug-Levels",EMBEDDED_DATA_MODAL:{SHOW_ROW:"showRow",SUBMIT_ROW:"submitRow",EDIT_TYPE:"editType",ACTION_NAME:"actionName",REFRESH_CONDITIONS:"caseInfo.refreshConditions"},LOCALIZATION_V2:2,DATA_CLASS_NOT_FOUND:"Data object class not found",PRIORITY:{CRITICAL:100,HIGH:500,MEDIUM:1e3,LOW:2e3,TRIVIAL:3e3,PING:6500},...Ur,getProperty:e=>Lr.map(e),getDefaultQualifiedName:e=>Mr.getDefaultQualifiedName(e)},jr=Mr.getDefaultQualifiedName("pyRemoteCaseDetails");class kr{static remoteCaseMapping={};static setRemoteCaseMapping=e=>{this.remoteCaseMapping=e,this.setAdditionalParameters()};static getRemoteCaseMapping=()=>this.remoteCaseMapping;static getRemoteCase=e=>this.remoteCaseMapping?.[e];static isRemoteCase=e=>!!(e&&this.remoteCaseMapping&&this.remoteCaseMapping[e]);static getRemoteHeaderByContext=e=>cS.getProperty(".RemoteSystemID",Fr.CASE_INFO.HEADERS,e);static getRemoteHeader=e=>this.remoteCaseMapping[e]?.RemoteSystemID;static injectRemoteCaseHeader=(e,t,n)=>{if(e&&e.RemoteSystemID)return;const r=this.getRemoteHeaderByContext(n);r?e.RemoteSystemID=r:t&&this.isRemoteCase(t.caseTypeID)&&(e.RemoteSystemID=this.getRemoteHeader(t.caseTypeID))};static isTraditionalRemoteCase=(e="")=>"Traditional"===kr.getRemoteCase(e)?.RemoteApplicationType;static setAdditionalParameters=()=>{const e=PA.environmentInfoObject?.pyRemoteCaseTypeList;e?.forEach((e=>{const t=this.getRemoteCase(e.pyWorkTypeImplementationClassName);t&&(t.name=e.pyWorkTypeName)}))};static getRemoteAppPlatformVersion=e=>{if(!e)return;const t=PA.environmentInfoObject?.pyRemoteAppPlatformVersion;if(t){return JSON.parse(t)[e]}};static isRemoteCaseVersionDifferent=e=>{if(!this.isRemoteCase(e))return!1;const t=this.getRemoteHeader(e);if(!t)return!1;const n=this.getRemoteAppPlatformVersion(t);return Boolean(n)};static getRemoteHeaderFromSourceClass=e=>{const t=Object.values(this.remoteCaseMapping).find((t=>t.RemoteClassName===e));return t?.RemoteSystemID};static getRemoteCaseClassBySourceClass=e=>{if(e)for(const[t,n]of Object.entries(this.remoteCaseMapping))if(n.RemoteClassName===e)return t}}const Vr=kr,Br={},Gr=new Map,Wr=e=>{let t=Fr.EMPTY_STRING;return t=e&&e.includes(Fr.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},Hr=(e,t,n=!1)=>{let r=Fr.EMPTY_STRING;if(t&&e){let a=`${t}${Fr.FORWARD_SLASH_STRING}${e}`;const s=II(a);if(s||t!==Fr.APP.APP&&t!==Fr.APP.ROOT)if(s){if(n&&Br[a])return r=`${a}${Fr.UNDERSCORE_STRING}${Br[a]}`,r;Br[a]?Br[a]+=1:Br[a]=1,r=`${a}${Fr.UNDERSCORE_STRING}${Br[a]}`}else r=Hr(e,Wr(t));else a=`${t}${Fr.FORWARD_SLASH_STRING}${Fr.PRIMARY}`,Br[a]?Br[a]+=1:Br[a]=1,r=`${a}${Fr.UNDERSCORE_STRING}${Br[a]}`}return r},qr=(e,t)=>{if(e&&t){const n=(Gr[t]?.[e]??0)+1;return Gr[t]||(Gr[t]={}),Gr[t][e]=n,`${t}${Fr.FORWARD_SLASH_STRING}${e}_${n}`}return""},Yr=(e,t)=>{if(e&&t){const n=Gr[t]?.[e];return n?`${t}${Fr.FORWARD_SLASH_STRING}${e}_${n}`:qr(e,t)}return""},zr=e=>{let t=Fr.EMPTY_STRING;return e&&(t=e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("_")).toLowerCase()),t},Kr=(e,t)=>{if(null===e)return t;const[,n]=t.split(Fr.FORWARD_SLASH_STRING);return e+Fr.FORWARD_SLASH_STRING+n},Qr=e=>{const t=e.indexOf(Fr.FORWARD_SLASH_STRING),n=e.lastIndexOf(Fr.FORWARD_SLASH_STRING);return t===n?e:e.substring(0,n)},Jr=e=>{const t=e.split(Fr.FORWARD_SLASH_STRING);return 2===t.length?e:t[0]+Fr.FORWARD_SLASH_STRING+t[2]},Xr="SET_PROPERTY",Zr="REPLACE_PROPERTY",ea="FIELD_CHANGE",ta="LOAD_VIEW",na="SHOW_PAGE",ra="SHOW_DATA",aa="SHOW_INSIGHT",sa="SHOW_DASHBOARD",oa="SET_LOADING",ia="RESET_LOADING",ca="APP_OFFLINE",la="APP_ONLINE",da="SET_SHARED_PROPERTY",ua="CREATE_WORK",pa="OPEN_WORK_BY_HANDLE",ha="UPDATE_DOCUMENT",fa="FINISH_ASSIGNMENT",ga="SAVE_AND_CLOSE",ma="CANCEL_ASSIGNMENT",ya="OPEN_ASSIGNMENT",Ea="NAVIGATE_TO_STEP",Ia="OPEN_LOCAL_ACTION",Aa="OPEN_PROCESS_ACTION",Ca="MERGE_DATA",Sa="REMOVE_ITEM",_a="GET_DATAOBJECT_ACTIONS",Na="SHOW_HISTORY",ba="ERROR",Ta="INIT_CONTAINERS",Pa="RESET_CONTAINERS",Oa="ADD_CONTAINER_ITEM",Da="REMOVE_CONTAINER_ITEM",va="ADD_TRANSIENT_ITEM",Ra="UPDATE_TRANSIENT_DATA",$a="REMOVE_TRANSIENT_ITEM",xa="REMOVE_ALL_TRANSIENT_ITEMS",wa="CLEAR_TRANSIENT_DATA",Ma="PURGE_TRANSIENT_DATA",La="REPLACE_TRANSIENT_DATA",Ua="ACTIVATE_CONTAINER_ITEM",Fa="UPDATE_CONTAINER_ITEM",ja="UPMERGE_AND_REMOVE_CONTAINER_ITEM",ka="REPLACE_CONTAINER_ITEM",Va="ACTIVATE_MODAL_CONTAINER_ITEM",Ba="REMOVE_CONTAINER",Ga="ADD_SUGGESTION_CONTEXT",Wa="showView",Ha="showData",qa="showInsight",Ya="showDashboard",za="openWorkByHandle",Ka="openAssignment",Qa="createNewWork",Ja="finishAssignment",Xa="SHOW_CANCEL_ALERT",Za="deleteCaseInCreateStage",es="openLocalAction",ts="openProcessAction",ns="caseWideActions",rs="executeCaseWideActions",as="openBulkAction",ss="performBulkAction",os="launchAssignment",is="ADD_MESSAGES",cs="CLEAR_MESSAGES",ls="RESET_STORE",ds="FETCH_DATAPAGE",us="ADD_SHARED_DATA",ps="REMOVE_SHARED_DATA",hs="LIST_ACTION",fs="DELETE_CASE_SUMMARY",gs="ALTER_BLOCKING_ACTION_COUNT",ms="SET_APP_LOCALE",ys="CREATE_DATA_OBJECT",Es="DELETE_DATA_OBJECT",Is="VIEW_DATA_OBJECT",As="UPDATE_DATA_OBJECT",Cs="OPEN_DATA_OBJECT_ACTION",Ss="SUBMIT_DATA_OBJECT_ACTION",_s="OPEN_EMBEDDED_DATA_MODAL",Ns="GET_EMBEDDED_DATA_VIEW",bs="SUBMIT_EMBEDDED_DATA_MODAL",Ts="SUBMIT_SUBSCRIPT",Ps="FILL_FORM_WITH_AI",Os="createWork",Ds="openAssignment",vs="openCase",Rs="EXECUTE_OBJECT_WIDE_ACTION",$s="CREATE_EXTERNAL_CASE",xs="DELETE_WORK",ws="createObject",Ms="getObject",Ls="getObjectWideAction",Us="createExternalObject",Fs="retrieveActionViewForNewCase",js=(e,t)=>{if(!e||!t)return null;let n,r=Fr.EMPTY_STRING;return t&&(r=`${t}${Fr.FORWARD_SLASH_STRING}${e}`,n=II(r),n||t.includes("/")?n||(r=js(e,Wr(t))):r=`${t}${Fr.FORWARD_SLASH_STRING}${e}`),r},ks=(e,t)=>{const n=js(e,t);return n&&II(n)?II(n):{}},Vs=(e,t)=>bA.getSemanticURL(Wa,{page:e},t);class Bs{constructor(e,t,n){this._grammar=e,this._state="expectOperand",this._exprStr=t||"",this._endState=n||{},this._subParser=null}static _setParent(e,t){Object.defineProperty(e,"_parent",{value:t,writable:!0})}_addToken(e){const t=Js[this._state],n=this._exprStr;if(this._exprStr+=e.element,t.subHandler){this._subParser||this._startSubExpression(n);const t=this._subParser?._addToken(e);t&&(this._endSubExpression(),this._state=t)}else{if(!t.operatorTypes?.[e.tokenType]){if(this._endState[e.tokenType])return this._endState[e.tokenType];throw new Error(`Token ${e.element} (${e.tokenType}) unexpected in expression: ${this._exprStr}`)}{const n=t.operatorTypes[e.tokenType],r=Qs[e.tokenType];r&&r.call(this,e),n.toState&&(this._state=n.toState)}}return!1}addTokens(e){e.forEach(this._addToken,this)}buildAst(){return this._subParser&&this._endSubExpression(),this._state="complete",this._position?this._tree:null}_startSubExpression(e){const{endStates:t}=Js[this._state];this._subParser=new Bs(this._grammar,e,t)}_endSubExpression(){Js[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,Bs._setParent(e,this._position)):this._tree=e,this._position=e}}const Gs=Bs,Ws="identifier",Hs={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>"object"!=typeof e&&"object"!=typeof t&&(e&&t)},qs={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>"object"!=typeof e&&"object"!=typeof t&&(e||t)},Ys=(e,t,n)=>{const r=""===e,a=""===t||null==t;if(r&&a)return n;if("boolean"==typeof t){const a=!!(!r&&"false"!==e&&"0"!==e)&&Boolean(e);return n?a===t:a!==t}return r!==a?!n:n?e===t:e!==t},zs={">":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e>t},">=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e>=t},"<":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e<t},"<=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>e<=t},"==":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>"object"!=typeof e&&"object"!=typeof t&&Ys(e,t,!0)},"!=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>"object"==typeof e||"object"==typeof t||Ys(e,t,!1)},"!":{operatorType:"unaryOperator",precedence:999,evaluate:e=>{const t="object"==typeof e?e.value:e;return"true"===t||"false"===t?"true"!==t:!t}},"(":{operatorType:"openParenthesis"},")":{operatorType:"closeParenthesis"},"&&":Hs,AND:Hs,and:Hs,"||":qs,OR:qs,or:qs,CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).includes(String(t))},NOT_CONTAINS:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).includes(String(t))},STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).startsWith(String(t))},NOT_STARTS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).startsWith(String(t))},ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(e).endsWith(String(t))},NOT_ENDS_WITH:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(e).endsWith(String(t))},IS_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!e},IS_NOT_NULL:{operatorType:"binaryOperator",precedence:2,evaluate:e=>!!e},IS_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>String(t).split(",").includes(String(e))},IS_NOT_IN_LIST:{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>!String(t).split(",").includes(String(e))}},Ks={BinaryExpression:function(e){const t=[],n=e.right,r=e.operator??"",a=e.left;if(!a)return!1;let s="boolean"==typeof a.value?"True-False":"";t[0]=this.evaluateAST(a),s||a.operationType!==Ws||(s=((e,t,n)=>{if("string"!=typeof e.value)return"";const r=e.value.substring(1),a=t?.getFieldMetadata(r)?.type??"";if(a)return a;const{pageReference:s,context:o}=n??{};if(!s||!o)return"";const i=cS.resolveClassID(e.value,s,o),c=oC(r,i);return c&&!Array.isArray(c)?c.type??"":""})(a,this._context,this._contextTreeNodeContext)),t[1]=n?this.evaluateAST(n,s):"";const o=this._grammar[r];return!!o?.evaluate&&o.evaluate(t[0],t[1])},identifier:function(e){const t="string"==typeof e.value?e.value:"";if(this._localDataObject)return aS.getIn(this._localDataObject,t?t.substring(1).split("."):[])??"";if(this._contextTreeNodeContext)return cS.getLitePropertyValue(this._contextTreeNodeContext,t)??"";if(!this._context)return"";const n=this._context.getFieldMetadata(t)?.type??"",r=this._context.getValue(t)??"";if("Decimal"===n&&"string"==typeof r){const e=parseFloat(r);return Number.isNaN(e)?"":e}return r},literal:function(e,t){return!(void 0===t||""===t||"True-False"===t)||"true"!==e.value&&"false"!==e.value?e.value??"":"true"===e.value},UnaryExpression:function(e){const t=e.operator,n=e.right;if(!t||!n)return!1;const r=this._grammar[t];return!!r?.evaluate&&r.evaluate(n)}},Qs={unaryOperator:function(e){this.setPositionInAST({operationType:"UnaryExpression",operator:String(e.value)})},binaryOperator:function(e){const t=String(e.value),{precedence:n}=this._grammar[t];let r=this._position._parent;const a=r?r.operator:null,s=a?this._grammar[a]:null,o=s?s.precedence:null;if(o&&n)for(;r?.operator&&o>=n;)this._position=r,r=r._parent;const i={operationType:"BinaryExpression",operator:t,left:this._position};Gs._setParent(this._position,i),r?(this._position=r,this.setPositionInAST(i)):(this._tree=i,this._position=i)},identifier:function(e){const t={operationType:Ws,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){var t;"object"==typeof(t=e)&&null!==t&&"operationType"in t&&this.setPositionInAST(e)}},Js={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:Ws},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:Qs.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},Xs=["binaryOperator","unaryOperator","openParenthesis"],Zs=/^\s*$/,eo=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,to=/\\\\/,no=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],ro=["[a-zA-Z_.$][a-zA-Z0-9_.$]*(?:\\(\\d+\\))?(?:\\.[a-zA-Z0-9_.$]+)*","[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}|[0-9]{4}-[0-9]{2}-[0-9]{2}","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],ao=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class so{constructor(e){this._grammar=e}static _isNegative(e){return Xs.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(Zs)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(eo)&&(e=`\\b${e}\\b`),e}static _unquote(e){const[t]=e,n=new RegExp(`\\\\${t}`,"g");return e.substr(1,e.length-2).replace(n,t).replace(to,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>so._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[no.join("|"),e.join("|"),ro.join("|")].join("|")})`)}return this._splitRegex}_splitExpression(e){const t=this._getSplitRegex();return e.split(t).filter((e=>e.trim()))}_createToken(e){const t={tokenType:"literal",value:e,element:e};return e.startsWith('"')||e.startsWith("'")?t.value=so._unquote(e):e.match(ao)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match(eo)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let r=0;r<e.length;r+=1)so._isWhitespace(e[r])?t.length&&(t[t.length-1].element+=e[r]):"-"===e[r]&&so._isNegative(t)?n=!0:(n&&(e[r]=`-${e[r]}`,n=!1),t.push(this._createToken(e[r])));return t}tokenize(e){const t=this._splitExpression(e);return this._getTokens(t)}}const oo=so;const io=class{constructor(e,t){this._grammar={...zs},this._expression=e,this._ast=null,this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new oo(this._grammar).tokenize(this._expression),t=new Gs(this._grammar);return t.addTokens(e),this._ast=t.buildAst(),this}evaluate(e,t){return this._context=e,this._contextTreeNodeContext=t,this.evaluateAST(this._ast)}evaluateAST(e,t){return ho(e.operationType,Ks)&&Ks[e.operationType].call(this,e,t)}},co=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new io(n,t)},lo=e=>!e||e.buildAST(),uo=(e,t,n)=>!e||e.evaluate(t,n),po=(e,t,n)=>{const r=co(e,t),a=lo(r);return uo(a,n)},ho=(e,t)=>e in t;const fo=class{static handleExpression(e,t,n,r){const a=this.getContext(e,r);sn({actionObject:{action:"decexp",params:{source:e,value:t,targets:n},context:a}}).then((e=>e.json())).then((e=>{this.updateState(e,r)})).catch((e=>window.console.log(e)))}static getContext(e,t){const n=e.substring(0,e.indexOf("."));return{name:n,class:cS.getPropertyValue(`${n}.${Mr.getDefaultQualifiedName("pxObjClass")}`,null,t)||cS.getPropertyValue(`${n}.${Mr.getDefaultQualifiedName("pyClassName")}`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>VC({type:Xr,payload:{context:t,reference:n,value:e[n]}})))}},go={},mo=(e,t)=>go[t]&&Object.hasOwn(go[t],e),yo=e=>{const{context:t}=e;mo(e.reference,t)&&fo.handleExpression(e.reference,e.value,go[t][e.reference],t)},Eo=(e={})=>{aS.copy(e,go)},Io=(e,t,n)=>po(e,t,n?.pConnect.getPConnect());const Ao=new class{constructor(){this._dataSourceMap={}}hasContextName(e){return e in this._dataSourceMap}addContextName(e,t){t&&Object.keys(t).length>0?this._dataSourceMap[e]=t:this._dataSourceMap[e]={}}getContextObjectByName(e){return e in this._dataSourceMap?this._dataSourceMap[e]:null}deleteContextName(e){this.hasContextName(e)&&delete this._dataSourceMap[e]}addOrUpdatePropertyInContext(e,t,n){if(this.hasContextName(e)){const r=this.getContextObjectByName(e);if(r)if(Array.isArray(n))r[t]=n;else{const e=r[t];r[t]=[...new Set([...e,n])]}}else{const r={};Array.isArray(n)?r[t]=n:r[t]=[n],this.addContextName(e,r)}}deletePropertyInContext(e,t){if(this.hasContextName(e)){const n=this.getContextObjectByName(e);n&&t in n&&delete n[t]}}getPropertyFromContext(e,t){if(this.hasContextName(e)){const n=this.getContextObjectByName(e);if(n&&t in n)return n[t]}return[]}getDependencies(e,t){const n=this.getPropertyFromContext(e,t),r=new Set(n);return n.forEach((e=>{r.add(e)})),[...r]}};const Co=new class{constructor(){this.componentMap={},this.overrideMap={},this.lazyMap={},this.customComponentLazyMap={}}register(e,t){this.componentMap[e]=t}registerLazyMap(e,t){this.lazyMap[e]=t}registerCustomComponentLazyMap(e,t){this.customComponentLazyMap[e]=t}getComponent(e){return this.componentMap[e]}getLazyComponent(e){return this.lazyMap[e]}getCustomComponent(e){return this.customComponentLazyMap[e]}mergeComponentsMap(e={}){aS.copy(e,this.componentMap)}mergeOverrideMap(e={}){aS.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const So=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}},_o=/^@\w+\s+(.+)$/s;const No=class{static handleAnnotation(e,t,n){const r=e.indexOf(" "),a=-1===r?e:e.substring(0,r),s=So.getHandler(a);if(!s)return e;const o=e.match(_o);return s((o?o[1]:"").trim(),t,n)}static trimAnnotation(e){if("string"!=typeof e)return e;const t=e.indexOf(" "),n=e.substring(0,t),r=e.substring(t+1);return So.getHandler(n)?r:e}static handleComponentMapping(e,t,n){const r=Co.getComponent(t.type);if(!r?.mapping)return;const a=r.mapping(t.config);if(a&&a["@map"]){const t=a["@map"],{source:r}=t;if(!r)return;const s=n.getValue(r);if("function"==typeof t.advanced)t.advanced(e,s);else{const n=t.inputs_map;e[t.output_property]=[];const r=e[t.output_property];s.forEach((e=>{const t={};Object.keys(n).forEach((r=>{let a=n[r];a?.startsWith(".")?(a=a.substring(1),t[r]=e[a]):t[r]=a})),r.push(t)}))}}}static getPropertyName(e=""){if(e&&aS.isString(e)){const t=e.startsWith(Fr.PROPERTY_ANNOTATION)||e.startsWith(Fr.ATTACHMENT_ANNOTATION)||e.startsWith(Fr.ASSOCIATED_PROPERTY_ANNOTATION)||e.startsWith(Fr.CLASS_ASSOCIATION_ANNOTATION)||e.startsWith(Fr.FILTERED_LIST_ANNOTATION),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getLeafPropertyName(e){if(aS.isString(e)&&!!e?.startsWith(Fr.PROPERTY_ANNOTATION)){const t=this.getPropertyName(e),n=t.split(".");return n.length<2?t:n.pop()}return e}static isProperty(e){return aS.isString(e)&&!!e?.startsWith(Fr.PROPERTY_ANNOTATION)}};function bo(e,t){return function(){return e.apply(t,arguments)}}const{toString:To}=Object.prototype,{getPrototypeOf:Po}=Object,{iterator:Oo,toStringTag:Do}=Symbol,vo=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ro=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),$o=(e,t,n)=>e===Object.prototype||!n&&null===t,xo=(e,t)=>{let n=e;const r=[];for(;null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);const a=Po(n);if($o(n,a,n===e))return!1;if(vo(n,t))return!0;n=a}return!1},wo=(Mo=Object.create(null),e=>{const t=To.call(e);return Mo[t]||(Mo[t]=t.slice(8,-1).toLowerCase())});var Mo;const Lo=e=>(e=e.toLowerCase(),t=>wo(t)===e),Uo=e=>t=>typeof t===e,{isArray:Fo}=Array,jo=Uo("undefined");function ko(e){return null!==e&&!jo(e)&&null!==e.constructor&&!jo(e.constructor)&&Go(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Vo=Lo("ArrayBuffer");const Bo=Uo("string"),Go=Uo("function"),Wo=Uo("number"),Ho=e=>null!==e&&"object"==typeof e,qo=e=>{if(!Ho(e))return!1;const t=Po(e);return!(null!==t&&t!==Object.prototype&&null!==Po(t)||xo(e,Do)||xo(e,Oo))},Yo=Lo("Date"),zo=Lo("File"),Ko=Lo("Blob"),Qo=Lo("FileList"),Jo=Lo("Set");const Xo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Zo=void 0!==Xo.FormData?Xo.FormData:void 0,ei=Lo("URLSearchParams"),[ti,ni,ri,ai]=["ReadableStream","Request","Response","Headers"].map(Lo);function si(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,a;if("object"!=typeof e&&(e=[e]),Fo(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(ko(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),s=a.length;let o;for(r=0;r<s;r++)o=a[r],t.call(null,e[o],o,e)}}function oi(e,t){if(ko(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,a=n.length;for(;a-- >0;)if(r=n[a],t===r.toLowerCase())return r;return null}const ii="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ci=e=>!jo(e)&&e!==ii;const li=(di="undefined"!=typeof Uint8Array&&Po(Uint8Array),e=>di&&e instanceof di);var di;const ui=Lo("HTMLFormElement"),{propertyIsEnumerable:pi}=Object.prototype,hi=Lo("RegExp"),fi=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};si(n,((n,a)=>{let s;!1!==(s=t(n,a,e))&&(r[a]=s||n)})),Object.defineProperties(e,r)};const gi=Lo("AsyncFunction"),mi=(yi="function"==typeof setImmediate,Ei=Go(ii.postMessage),yi?setImmediate:Ei?(Ii=`axios@${Math.random()}`,Ai=[],ii.addEventListener("message",(({source:e,data:t})=>{e===ii&&t===Ii&&Ai.length&&Ai.shift()()}),!1),e=>{Ai.push(e),ii.postMessage(Ii,"*")}):e=>setTimeout(e));var yi,Ei,Ii,Ai;const Ci="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ii):"undefined"!=typeof process&&process.nextTick||mi,Si=e=>null!=e&&Go(e[Oo]),_i={isArray:Fo,isArrayBuffer:Vo,isBuffer:ko,isFormData:e=>{if(!e)return!1;if(Zo&&e instanceof Zo)return!0;const t=Po(e);if(!t||t===Object.prototype)return!1;if(!Go(e.append))return!1;const n=wo(e);return"formdata"===n||"object"===n&&Go(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Vo(e.buffer),t},isString:Bo,isNumber:Wo,isBoolean:e=>!0===e||!1===e,isObject:Ho,isPlainObject:qo,isEmptyObject:e=>{if(!Ho(e)||ko(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ti,isRequest:ni,isResponse:ri,isHeaders:ai,isUndefined:jo,isDate:Yo,isFile:zo,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:Ko,isRegExp:hi,isFunction:Go,isStream:e=>Ho(e)&&Go(e.pipe),isURLSearchParams:ei,isTypedArray:li,isFileList:Qo,forEach:si,merge:function e(...t){const{caseless:n,skipUndefined:r}=ci(this)&&this||{},a={},s=(t,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const o=n&&"string"==typeof s&&oi(a,s)||s,i=vo(a,o)?a[o]:void 0;qo(i)&&qo(t)?a[o]=e(i,t):qo(t)?a[o]=e({},t):Fo(t)?a[o]=t.slice():r&&jo(t)||(a[o]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||ko(n))continue;if(si(n,s),"object"!=typeof n||Fo(n))continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];pi.call(n,t)&&s(n[t],t)}}return a},extend:(e,t,n,{allOwnKeys:r}={})=>(si(t,((t,r)=>{n&&Go(t)?Object.defineProperty(e,r,{__proto__:null,value:bo(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let a,s,o;const i={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),s=a.length;s-- >0;)o=a[s],r&&!r(o,e,t)||i[o]||(t[o]=e[o],i[o]=!0);e=!1!==n&&Po(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:wo,kindOfTest:Lo,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Fo(e))return e;let t=e.length;if(!Wo(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Oo]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ui,hasOwnProperty:vo,hasOwnProp:vo,hasOwnInPrototypeChain:xo,getSafeProp:(e,t)=>null!=e&&xo(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=Po(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every((t=>{if(Ro(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable}))})(e))return e;const n=Object.create(null),r=Object.create(null),a=[];let s=e;for(;null!=s&&-1===a.indexOf(s);){a.push(s);const o=s===e?t:Po(s);if($o(s,o,s===e))break;const i=Object.getOwnPropertyNames(s);Object.getOwnPropertySymbols&&i.push(...Object.getOwnPropertySymbols(s));for(const t of i)Ro(t)||vo(r,t)||(n[t]=e[t],r[t]=!0);s=o}return n},reduceDescriptors:fi,freezeMethods:e=>{fi(e,((t,n)=>{if(Go(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];Go(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return Fo(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:oi,global:ii,isContextDefined:ci,isSpecCompliantForm:function(e){return!!(e&&Go(e.append)&&"FormData"===e[Do]&&e[Oo])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(Ho(e)){if(t.has(e))return;if(ko(e))return e;if(!("toJSON"in e)){let r;if(t.add(e),Jo(e)){r=[];for(const t of e){const e=n(t);!jo(e)&&r.push(e)}}else r=Fo(e)?[]:{},si(e,((e,t)=>{const a=n(e);!jo(a)&&(r[t]=a)}));return t.delete(e),r}}return e};return n(e)},isAsyncFn:gi,isThenable:e=>e&&(Ho(e)||Go(e))&&Go(e.then)&&Go(e.catch),setImmediate:mi,asap:Ci,isIterable:Si,isSafeIterable:e=>null!=e&&xo(e,Oo)&&Si(e)},Ni=_i.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const bi=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Ti=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Pi(e,t){return _i.isArray(e)?e.map((e=>Pi(e,t))):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Oi(e){const t=Object.create(null);return _i.forEach(e.toJSON(),((e,n)=>{t[n]=(e=>Pi(e,Ti))(e)})),t}const Di=Symbol("internals");function vi(e){return e&&String(e).trim().toLowerCase()}function Ri(e){return!1===e||null==e?e:_i.isArray(e)?e.map(Ri):(e=>Pi(e,bi))(String(e))}const $i=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function xi(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function wi(e,t,n,r,a){return _i.isFunction(r)?r.call(this,t,n):(a&&(t=n),_i.isString(t)?_i.isString(r)?-1!==t.indexOf(r):_i.isRegExp(r)?r.test(t):void 0:void 0)}class Mi{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function a(e,t,n){const a=vi(t);if(!a)return;const s=_i.findKey(r,a);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Ri(e))}const s=(e,t)=>_i.forEach(e,((e,n)=>a(e,n,t)));if(_i.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(_i.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),n=e.substring(0,a).trim().toLowerCase(),r=e.substring(a+1).trim();const s=_i.hasOwnProp(t,n);!n||s&&_i.hasOwnProp(Ni,n)||("set-cookie"===n?s?t[n].push(r):t[n]=[r]:t[n]=s?t[n]+", "+r:r)})),t})(e),t);else if(_i.isObject(e)&&_i.isSafeIterable(e)){let n,r,a=Object.create(null);for(const t of e){if(!_i.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],_i.hasOwnProp(a,r)?(n=a[r],a[r]=_i.isArray(n)?[...n,t[1]]:[n,t[1]]):a[r]=t[1]}s(a,t)}else null!=e&&a(t,e,n);return this}get(e,t){if(e=vi(e)){const n=_i.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(_i.isFunction(t))return t.call(this,e,n);if(_i.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=vi(e)){const n=_i.findKey(this,e);return!(!n||void 0===this[n]||t&&!wi(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function a(e){if(e=vi(e)){const a=_i.findKey(n,e);!a||t&&!wi(0,n[a],a,t)||(delete n[a],r=!0)}}return _i.isArray(e)?e.forEach(a):a(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const a=t[n];e&&!wi(0,this[a],a,e,!0)||(delete this[a],r=!0)}return r}normalize(e){const t=this,n={};return _i.forEach(this,((r,a)=>{const s=_i.findKey(n,a);if(s)return t[s]=Ri(r),void delete t[a];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(a):String(a).trim();o!==a&&delete t[a],t[o]=Ri(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return _i.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&_i.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){const e=this.get("set-cookie");return _i.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let r=0,a=!1,s=!1;function o(e){const a=xi(n.slice(r,e)),s=a.indexOf("=");if(s<1)return;const o=xi(a.slice(0,s));if(!$i.test(o))return;const i=o.toLowerCase();if("__proto__"===i||"constructor"===i||"prototype"===i)return;const c=xi(a.slice(s+1));t[i]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let r=1;r<t;r++){const a=e.charCodeAt(r);if(34===a)return e;if(92===a&&(r+=1,r>=t))return e;n+=e[r]}return n}(c)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);a?s?s=!1:92===t?s=!0:34===t&&(a=!1):34===t?a=!0:44!==t&&59!==t||(o(e),r=e+1)}return o(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Di]=this[Di]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=vi(e);t[r]||(!function(e,t){const n=_i.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,a){return this[r].call(this,t,e,n,a)},configurable:!0})}))}(n,e),t[r]=!0)}return _i.isArray(e)?e.forEach(r):r(e),this}}Mi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),_i.reduceDescriptors(Mi.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),_i.freezeMethods(Mi);const Li=Mi,Ui="[REDACTED ****]";function Fi(e,t){const n=new Set(t.map((e=>String(e).toLowerCase()))),r=[],a=e=>{if(null===e||"object"!=typeof e)return e;if(_i.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof Li&&(e=e.toJSON()),r.push(e),_i.isArray(e))t=[],e.forEach(((e,n)=>{const r=a(e);_i.isUndefined(r)||(t[n]=r)}));else{if(!_i.isPlainObject(e)&&function(e){if(_i.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(_i.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,s]of Object.entries(e)){const e=n.has(r.toLowerCase())?Ui:a(s);_i.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return a(e)}function ji(e){try{return String(e)}catch(e){return""}}class ki extends Error{static from(e,t,n,r,a,s){let o=e.message;!o&&_i.isArray(e.errors)&&e.errors.length&&(o=function(e){return e.errors.map((e=>{try{return e&&e.message?ji(e.message):ji(e)}catch(e){return""}})).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const i=new ki(o,t||e.code,n,r,a);return Object.defineProperty(i,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),i.name=e.name,null!=e.status&&null==i.status&&(i.status=e.status),s&&Object.assign(i,s),i}constructor(e,t,n,r,a){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status)}toJSON(){const e=this.config,t=e&&_i.hasOwnProp(e,"redact")?e.redact:void 0,n=_i.isArray(t)&&t.length>0?Fi(e,t):_i.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}ki.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ki.ERR_BAD_OPTION="ERR_BAD_OPTION",ki.ECONNABORTED="ECONNABORTED",ki.ETIMEDOUT="ETIMEDOUT",ki.ECONNREFUSED="ECONNREFUSED",ki.ERR_NETWORK="ERR_NETWORK",ki.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ki.ERR_DEPRECATED="ERR_DEPRECATED",ki.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ki.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ki.ERR_CANCELED="ERR_CANCELED",ki.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ki.ERR_INVALID_URL="ERR_INVALID_URL",ki.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Vi=ki,Bi=null;function Gi(e){return _i.isPlainObject(e)||_i.isArray(e)}function Wi(e){return _i.endsWith(e,"[]")?e.slice(0,-2):e}function Hi(e,t,n){return e?e.concat(t).map((function(e,t){return e=Wi(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const qi=_i.toFlatObject(_i,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Yi=function(e,t,n){if(!_i.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(e,t)=>{const r=_i.getSafeProp(n,e);return _i.isUndefined(r)?t:r},a=r("metaTokens",!0),s=r("visitor")||f,o=r("dots",!1),i=r("indexes",!1),c=r("Blob")||"undefined"!=typeof Blob&&Blob,l=r("maxDepth",100),d=c&&_i.isSpecCompliantForm(t),u=[];if(!_i.isFunction(s))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(_i.isDate(e))return e.toISOString();if(_i.isBoolean(e))return e.toString();if(!d&&_i.isBlob(e))throw new Vi("Blob is not supported. Use a Buffer instead.");if(_i.isArrayBuffer(e)||_i.isTypedArray(e)){if(d&&"function"==typeof c)return new c([e]);throw new Vi("Blob is not supported. Use a Buffer instead.",Vi.ERR_NOT_SUPPORT)}return e}function h(e){if(e>l)throw new Vi("Object is too deeply nested ("+e+" levels). Max depth: "+l,Vi.ERR_FORM_DATA_DEPTH_EXCEEDED)}function f(e,n,r){let s=e;if(_i.isReactNative(t)&&_i.isReactNativeBlob(e))return t.append(Hi(r,n,o),p(e)),!1;if(e&&!r&&"object"==typeof e)if(_i.endsWith(n,"{}"))n=a?n:n.slice(0,-2),e=function(e,t){if(l===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,(function(e,r){if(!_i.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),h(t+n.length-1),r}))}(e,1);else if(_i.isArray(e)&&function(e){return _i.isArray(e)&&!e.some(Gi)}(e)||(_i.isFileList(e)||_i.endsWith(n,"[]"))&&(s=_i.toArray(e)))return n=Wi(n),s.forEach((function(e,r){!_i.isUndefined(e)&&null!==e&&t.append(!0===i?Hi([n],r,o):null===i?n:n+"[]",p(e))})),!1;return!!Gi(e)||(t.append(Hi(r,n,o),p(e)),!1)}const g=Object.assign(qi,{defaultVisitor:f,convertValue:p,isVisitable:Gi});if(!_i.isObject(e))throw new TypeError("data must be an object");return function e(n,r,a=0){if(!_i.isUndefined(n)){if(h(a),-1!==u.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));u.push(n),_i.forEach(n,(function(n,o){!0===(!(_i.isUndefined(n)||null===n)&&s.call(t,n,_i.isString(o)?o.trim():o,r,g))&&e(n,r?r.concat(o):[o],a+1)})),u.pop()}}(e),t};function zi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function Ki(e,t){this._pairs=[],e&&Yi(e,this,t)}const Qi=Ki.prototype;Qi.append=function(e,t){this._pairs.push([e,t])},Qi.toString=function(e){const t=e?t=>e.call(this,t,zi):zi;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ji=Ki;function Xi(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Zi(e,t,n){if(!t)return e;e=e||"";const r=_i.isFunction(n)?{serialize:n}:n,a=_i.getSafeProp(r,"encode")||Xi,s=_i.getSafeProp(r,"serialize");let o;if(o=s?s(t,r):_i.isURLSearchParams(t)?t.toString():new Ji(t,r).toString(a),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const ec=Symbol("internals");function tc(e){return e?e.length:0}function nc(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function rc(e,t){const n=e.handlers,r=tc(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach((function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)})):t.handlerEntries.clear()),t.handlersLength=r}const ac=class{constructor(){this.handlers=[],this[ec]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const r={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},a=this[ec];null==this.handlers&&(this.handlers=[]),rc(this,a);const s=a.nextId++;return this.handlers.push(r),a.handlerEntries.set(s,{handler:r,index:this.handlers.length-1}),a.handlersLength=this.handlers.length,s}eject(e){const t=this[ec];rc(this,t);const n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(nc(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],rc(this,this[ec]))}forEach(e){const t=this[ec];rc(this,t),t.iterationDepth++;try{_i.forEach(this.handlers,(function(t){null!==t&&e(t)}))}finally{--t.iterationDepth||(rc(this,t),nc(this.handlers),t.handlersLength=tc(this.handlers))}}},sc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},oc={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ji,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ic="undefined"!=typeof window&&"undefined"!=typeof document,cc="object"==typeof navigator&&navigator||void 0,lc=ic&&(!cc||["ReactNative","NativeScript","NS"].indexOf(cc.product)<0),dc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,uc=ic&&window.location.href||"http://localhost",pc={...a,...oc};const hc=100;function fc(e){if(e>hc)throw new Vi("FormData field is too deeply nested ("+e+" levels). Max depth: "+hc,Vi.ERR_FORM_DATA_DEPTH_EXCEEDED)}const gc=function(e){function t(e,n,r,a){fc(a);let s=e[a++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),i=a>=e.length;if(s=!s&&_i.isArray(r)?r.length:s,i)return _i.hasOwnProp(r,s)?r[s]=_i.isArray(r[s])?r[s].concat(n):[r[s],n]:r[s]=n,!o;_i.hasOwnProp(r,s)&&_i.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],a)&&_i.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const a=n.length;let s;for(r=0;r<a;r++)s=n[r],t[s]=e[s];return t}(r[s])),!o}if(_i.isFormData(e)&&_i.isFunction(e.entries)){const n={};return _i.forEachEntry(e,((e,r)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;null!==(r=n.exec(e));)fc(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)})),n}return null},mc=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),yc=(e,t)=>null!=e&&_i.hasOwnProp(e,t)?e[t]:void 0;const Ec={transitional:sc,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=_i.isObject(e);a&&_i.isHTMLForm(e)&&(e=new FormData(e));if(_i.isFormData(e))return r?JSON.stringify(gc(e)):e;if(_i.isArrayBuffer(e)||_i.isBuffer(e)||_i.isStream(e)||_i.isFile(e)||_i.isBlob(e)||_i.isReadableStream(e))return e;if(_i.isArrayBufferView(e))return e.buffer;if(_i.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(a){const t=yc(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Yi(e,new pc.classes.URLSearchParams,{visitor:function(e,t,n,r){return pc.isNode&&_i.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((s=_i.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=yc(this,"env"),r=n&&n.FormData;return Yi(s?{"files[]":e}:e,r&&new r,t)}}return a||r?(t.setContentType("application/json",!1),function(e,t,n){if(_i.isString(e))try{return(t||JSON.parse)(e),_i.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=yc(this,"transitional")||Ec.transitional,n=t&&t.forcedJSONParsing,r=yc(this,"responseType"),a="json"===r;if(_i.isResponse(e)||_i.isReadableStream(e))return e;if(e&&_i.isString(e)&&(n&&!r||a)){const n=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,yc(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Vi.from(e,Vi.ERR_BAD_RESPONSE,this,null,yc(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pc.classes.FormData,Blob:pc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_i.forEach(mc,(e=>{Ec.headers[e]={}}));const Ic=Ec;function Ac(e,t){const n=this||Ic,r=t||n,a=Li.from(r.headers);let s=r.data;return _i.forEach(e,(function(e){s=e.call(n,s,a.normalize(),t?t.status:void 0)})),a.normalize(),s}function Cc(e){return!(!e||!e.__CANCEL__)}const Sc=class extends Vi{constructor(e,t,n){super(null==e?"canceled":e,Vi.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function _c(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Vi("Request failed with status code "+n.status,n.status>=400&&n.status<500?Vi.ERR_BAD_REQUEST:Vi.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Nc=/[\t\n\r]/g;function bc(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(Nc,"")}function Tc(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const Pc=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a,s=0,o=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),l=r[o];a||(a=c),n[s]=i,r[s]=c;let d=o,u=0;for(;d!==s;)u+=n[d++],d%=e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-a<t)return;const p=l&&c-l;return p?Math.round(1e3*u/p):void 0}};const Oc=function(e,t){let n,r,a=0,s=1e3/t;const o=(t,s=Date.now())=>{a=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-a;i>=s?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),s-i)))},()=>n&&o(n),(...e)=>o(e)]},Dc=(e,t,n=3)=>{let r=0;const a=Pc(50,250);return Oc((n=>{if(!n||!_i.isNumber(n.loaded))return;const s=n.loaded,o=n.lengthComputable?n.total:void 0,i=Math.max(0,null!=o?Math.min(s,o):s),c=Math.max(0,i-r),l=a(c);r=Math.max(r,i);e({loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-i)/l:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},vc=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Rc=(e,t=_i.asap)=>(...n)=>t((()=>e(...n))),$c=pc.hasStandardBrowserEnv?(xc=new URL(pc.origin),wc=pc.navigator&&/(msie|trident)/i.test(pc.navigator.userAgent),e=>(e=new URL(e,pc.origin),xc.protocol===e.protocol&&xc.host===e.host&&(wc||xc.port===e.port))):()=>!0;var xc,wc;const Mc=pc.hasStandardBrowserEnv?{write(e,t,n,r,a,s,o){if("undefined"==typeof document)return;const i=[`${e}=${encodeURIComponent(t)}`];_i.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),_i.isString(r)&&i.push(`path=${r}`),_i.isString(a)&&i.push(`domain=${a}`),!0===s&&i.push("secure"),_i.isString(o)&&i.push(`SameSite=${o}`),document.cookie=i.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),a=r.indexOf("=");if(-1!==a&&r.slice(0,a)===e)try{return decodeURIComponent(r.slice(a+1))}catch(e){return r.slice(a+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const Lc=/^https?:(?!\/\/)/i;function Uc(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Ui}@`),n=t.indexOf("#"),r=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Ui}`);return-1===n?r:`${r}#${a=t.slice(n+1),a?a.replace(/(^|&)([^=&]*=)?[^&]+/g,((e,t,n="")=>`${t}${n}${Ui}`)):a}`;var a}function Fc(e,t){if("string"==typeof e){const n=bc(e);if(Lc.test(n))throw new Vi(`Invalid URL ${JSON.stringify(Uc(n))}: missing "//" after protocol`,Vi.ERR_INVALID_URL,t)}}function jc(e,t,n,r){Fc(t,r);let a=!("string"==typeof(s=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s));var s;return e&&(a||!1===n)?(Fc(e,r),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const kc=e=>e instanceof Li?{...e}:e,Vc=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter((t=>Object.getOwnPropertyDescriptor(e,t).enumerable))):Object.keys(e);function Bc(e,t){e=e||{},t=t||{};const n=Object.create(null);function r(e,t,n,r){return _i.isPlainObject(e)&&_i.isPlainObject(t)?_i.merge.call({caseless:r},e,t):_i.isPlainObject(t)?_i.merge({},t):_i.isArray(t)?t.slice():t}function a(e,t,n,a){return _i.isUndefined(t)?_i.isUndefined(e)?void 0:r(void 0,e,0,a):r(e,t,0,a)}function s(e,t){if(!_i.isUndefined(t))return r(void 0,t)}function o(e,t){return _i.isUndefined(t)?_i.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(n,a,s){return _i.hasOwnProp(t,s)?r(n,a):_i.hasOwnProp(e,s)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutErrorMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:i,headers:(e,t,n)=>a(kc(e),kc(t),0,!0)};return _i.forEach(Vc({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=_i.hasOwnProp(c,r)?c[r]:a,o=s(_i.hasOwnProp(e,r)?e[r]:void 0,_i.hasOwnProp(t,r)?t[r]:void 0,r);_i.isUndefined(o)&&s!==i||(n[r]=o)})),_i.hasOwnProp(t,"validateStatus")&&_i.isUndefined(t.validateStatus)&&!1===function(n){const r=_i.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!_i.isUndefined(r)){if(!_i.isPlainObject(r))return;if(_i.hasOwnProp(r,n))return r[n]}const a=_i.hasOwnProp(e,"transitional")?e.transitional:void 0;if(_i.isPlainObject(a)&&_i.hasOwnProp(a,n))return a[n]}("validateStatusUndefinedResolves")&&(_i.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const Gc=["content-type","content-length"];const Wc=function(e){const t=Bc({},e),n=e=>_i.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let a=n("withXSRFToken");const s=n("xsrfHeaderName"),o=n("xsrfCookieName");let i=n("headers");const c=n("auth"),l=n("baseURL"),d=n("allowAbsoluteUrls"),u=n("url");if(t.headers=i=Li.from(i),t.url=Zi(jc(l,u,d,t),n("params"),n("paramsSerializer")),c){const t=_i.getSafeProp(c,"username")||"",n=_i.getSafeProp(c,"password")||"";try{i.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))):"")))}catch(t){throw Vi.from(t,Vi.ERR_BAD_OPTION_VALUE,e)}}if(_i.isFormData(r)){const e=_i.getSafeProp(r,"getHeaders");pc.hasStandardBrowserEnv||pc.hasStandardBrowserWebWorkerEnv||_i.isReactNative(r)?i.setContentType(void 0):_i.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((([t,n])=>{Gc.includes(t.toLowerCase())&&e.set(t,n)})):e.set(t)}(i,e.call(r),n("formDataHeaderPolicy"))}if(pc.hasStandardBrowserEnv){_i.isFunction(a)&&(a=a(t));if(!0===a||null==a&&$c(t.url)){const e=s&&o&&Mc.read(o);e&&i.set(s,e)}}return t},Hc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Wc(e);let a=r.data;const s=Li.from(r.headers).normalize();let o,i,c,l,d,u,{responseType:p,onUploadProgress:h,onDownloadProgress:f}=r;function g(){l&&l(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function y(a){if(!m)return;if(!(0!==m.status||"file"===(Tc(bc(r.url))||Tc(pc.origin))||m.responseURL&&m.responseURL.startsWith("file:")))return n(new Vi("Request aborted",Vi.ECONNABORTED,e,m)),g(),void(m=null);try{a?u&&u(a):d&&d()}catch(e){setTimeout((()=>{throw e}))}if(!m)return;const s=Li.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());_c((function(e){t(e),g()}),(function(e){n(e),g()}),{data:p&&"text"!==p&&"json"!==p?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:s,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(y)},m.onabort=function(){m&&(n(new Vi("Request aborted",Vi.ECONNABORTED,e,m)),g(),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",a=new Vi(r,Vi.ERR_NETWORK,e,m);a.event=t||null,n(a),g(),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const a=r.transitional||sc;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Vi(t,a.clarifyTimeoutError?Vi.ETIMEDOUT:Vi.ECONNABORTED,e,m)),g(),m=null},void 0===a&&s.setContentType(null),"setRequestHeader"in m&&_i.forEach(Oi(s),(function(e,t){m.setRequestHeader(t,e)})),_i.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),p&&"json"!==p&&(m.responseType=r.responseType),f&&([c,d,u]=Dc(f,!0),m.addEventListener("progress",c)),h&&m.upload&&([i,l]=Dc(h),m.upload.addEventListener("progress",i),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(o=t=>{m&&(n(!t||t.type?new Sc(null,e,m):t),m.abort(),g(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const E=Tc(r.url);if(E&&!pc.protocols.includes(E))return n(new Vi("Unsupported protocol "+E+":",Vi.ERR_BAD_REQUEST,e)),void g();m.send(a||null)}))},qc=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const a=function(e){if(!r){r=!0,o();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Vi?t:new Sc(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,a(new Vi(`timeout of ${t}ms exceeded`,Vi.ETIMEDOUT))}),t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)})),e=null)};e.forEach((e=>{r||(e.aborted?a.call(e):e.addEventListener("abort",a,{once:!0}))}));const{signal:i}=n;return i.unsubscribe=()=>_i.asap(o),i},Yc=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,a=0;for(;a<n;)r=a+t,yield e.slice(a,r),a=r},zc=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Kc=(e,t,n,r)=>{const a=async function*(e,t){for await(const n of zc(e))yield*Yc(n,t)}(e,t);let s,o=0,i=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await a.next();if(t)return i(),void e.close();let s=r.byteLength;if(n){let e=o+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw i(e),e}},cancel:e=>(i(e),a.return())},{highWaterMark:2})},Qc=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Jc=(e,t,n)=>t+2<n&&Qc(e.charCodeAt(t+1))&&Qc(e.charCodeAt(t+2)),Xc=e=>e<=57?e-48:(223&e)-55,Zc=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,el=e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},tl=e=>{const t=e.length;let n=0,r=0,a=!1;for(let o=0;o<t;o++){let i=e.charCodeAt(o);37===i&&Jc(e,o,t)&&(i=16*Xc(e.charCodeAt(o+1))+Xc(e.charCodeAt(o+2)),o+=2),9!==(s=i)&&10!==s&&12!==s&&13!==s&&32!==s&&(61!==i?!Zc(i)||r>0?a=!0:n++:r++)}var s;return a||r>2||r>0&&(n+r)%4!=0||n%4==1?el(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)},nl=(e,t)=>{if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const r=e.slice(5,n),a=e.slice(n+1);if(/;base64/i.test(r))return t(a);let s=0;for(let e=0,t=a.length;e<t;e++){const n=a.charCodeAt(e);if(37===n&&Jc(a,e,t))s+=1,e+=2;else if(n<128)s+=1;else if(n<2048)s+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=a.charCodeAt(e+1);t>=56320&&t<=57343?(s+=4,e++):s+=3}else s+=3}return s};const rl="1.20.0",al={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:sl}=_i,ol=e=>{if(!_i.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},il=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cl=e=>{const t=void 0!==_i.global&&null!==_i.global?_i.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=_i.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:a,Request:s,Response:o}=e,i=a?sl(a):"function"==typeof fetch,c=sl(s),l=sl(o);if(!i)return!1;const d=i&&sl(n),u=i&&("function"==typeof r?(p=new r,e=>p.encode(e)):async e=>new Uint8Array(await new s(e).arrayBuffer()));var p;const h=c&&d&&il((()=>{let e=!1;const t=new s(pc.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),f=l&&d&&il((()=>_i.isReadableStream(new o("").body))),g={stream:f&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!g[e]&&(g[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Vi(`Response type '${e}' is not supported`,Vi.ERR_NOT_SUPPORT,n)})}));const m=async e=>{if(null==e)return 0;if(_i.isBlob(e))return e.size;if(_i.isSpecCompliantForm(e)){const t=new s(pc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return _i.isArrayBufferView(e)||_i.isArrayBuffer(e)?e.byteLength:(_i.isURLSearchParams(e)&&(e+=""),_i.isString(e)?(await u(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:i,signal:l,cancelToken:u,timeout:p,onDownloadProgress:y,onUploadProgress:E,responseType:I,headers:A,withCredentials:C="same-origin",fetchOptions:S,maxContentLength:_,maxBodyLength:N,maxRedirects:b}=Wc(e);const T=_i.isNumber(_)&&_>-1,P=_i.isNumber(N)&&N>-1;let O=a||fetch;I=I?(I+"").toLowerCase():"text";let D=qc([l,u&&u.toAbortSignal()],p),v=null;const R=D&&D.unsubscribe&&(()=>{D.unsubscribe()});let $,x=null;const w=()=>new Vi("Request body larger than maxBodyLength limit",Vi.ERR_BAD_REQUEST,e,v);try{let a;const l=(L="auth",_i.hasOwnProp(e,L)?e[L]:void 0);if(l){const e=_i.getSafeProp(l,"username")||"";a={username:e,password:_i.getSafeProp(l,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,pc.origin);if(!a&&(e.username||e.password)){const t=ol(e.username);a={username:t,password:ol(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(a&&(A.delete("authorization"),A.set("Authorization","Basic "+btoa((M=(a.username||"")+":"+(a.password||""),encodeURIComponent(M).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))))))),T&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){const t="string"==typeof e?e.indexOf("#"):-1;return nl(-1===t?e:e.slice(0,t),tl)}(t);if(n>_)throw new Vi("maxContentLength size of "+_+" exceeded",Vi.ERR_BAD_RESPONSE,e,v)}if(P&&"get"!==n&&"head"!==n){const e=await m(i);if("number"==typeof e&&isFinite(e)&&($=e,e>N))throw w()}const u=P&&(_i.isReadableStream(i)||_i.isStream(i)),p=(e,t,n)=>Kc(e,65536,(e=>{if(P&&e>N)throw x=w();t&&t(e)}),n);if(h&&"get"!==n&&"head"!==n&&(E||u)){if($=null==$?await(async(e,t)=>{const n=_i.toFiniteNumber(e.getContentLength());return null==n?m(t):n})(A,i):$,0!==$||u){let e,n=new s(t,{method:"POST",body:i,duplex:"half"});if(_i.isFormData(i)&&(e=n.headers.get("content-type"))&&A.setContentType(e),n.body){const[e,t]=E&&vc($,Dc(Rc(E)))||[];i=p(n.body,e,t)}}}else if(u&&!c&&d&&"get"!==n&&"head"!==n)i=p(i);else if(u&&c&&!h&&"get"!==n&&"head"!==n)throw new Vi("Stream request bodies are not supported by the current fetch implementation",Vi.ERR_NOT_SUPPORT,e,v);_i.isString(C)||(C=C?"include":"omit");const U=c&&"credentials"in s.prototype;if(_i.isFormData(i)){const e=A.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&A.delete("content-type")}A.set("User-Agent","axios/"+rl,!1);const F=null==S?S:Object.assign(Object.create(null),S);F&&(delete F.body,delete F.headers,delete F.method,delete F.signal,delete F.duplex,delete F.credentials);const j=Object.assign(Object.create(null),F,{signal:D,method:n.toUpperCase(),headers:Oi(A.normalize()),body:i,duplex:"half",credentials:U?C:void 0});c&&(_i.forEach(al,((e,t)=>{void 0===j[t]&&(j[t]=e)})),void 0===j.signal&&(j.signal=null),void 0===j.body&&(j.body=null)),0===b&&(j.redirect="manual",F&&(F.redirect="manual")),v=c&&new s(t,j);let k=await(c?O(v,F):O(t,j));const V=Li.from(k.headers);if(T){const t=_i.toFiniteNumber(V.getContentLength());if(null!=t&&t>_)throw new Vi("maxContentLength size of "+_+" exceeded",Vi.ERR_BAD_RESPONSE,e,v)}const B=f&&("stream"===I||"response"===I);if(f&&k.body&&(y||T||B&&R)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=k[e]}));const n=_i.toFiniteNumber(V.getContentLength()),[r,a]=y&&vc(n,Dc(Rc(y),!0))||[];let s=0;const i=t=>{if(T&&(s=t,s>_))throw new Vi("maxContentLength size of "+_+" exceeded",Vi.ERR_BAD_RESPONSE,e,v);r&&r(t)};k=new o(Kc(k.body,65536,i,(()=>{a&&a(),R&&R()})),t)}I=I||"text";let G=await g[_i.findKey(g,I)||"text"](k,e);if(T&&!f&&!B){let t;if(null!=G&&("number"==typeof G.byteLength?t=G.byteLength:"number"==typeof G.size?t=G.size:"string"==typeof G&&(t="function"==typeof r?(new r).encode(G).byteLength:G.length)),"number"==typeof t&&t>_)throw new Vi("maxContentLength size of "+_+" exceeded",Vi.ERR_BAD_RESPONSE,e,v)}return!B&&R&&R(),await new Promise(((t,n)=>{_c(t,n,{data:G,headers:Li.from(k.headers),status:k.status,statusText:k.statusText,config:e,request:v})}))}catch(t){if(R&&R(),D&&D.aborted&&D.reason instanceof Vi){const n=D.reason;throw n.config=e,v&&(n.request=v),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(x)throw v&&!x.request&&(x.request=v),x;if(t instanceof Vi)throw v&&!t.request&&(t.request=v),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new Vi("Network Error",Vi.ERR_NETWORK,e,v,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw Vi.from(t,t&&t.code,e,v,t&&t.response)}var M,L}},ll=new Map,dl=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,s=[r,a,n];let o,i,c=s.length,l=ll;for(;c--;)o=s[c],i=l.get(o),void 0===i&&l.set(o,i=c?new Map:cl(t)),l=i;return i},ul=(dl(),{http:Bi,xhr:Hc,fetch:{get:dl}});_i.forEach(ul,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const pl=e=>`- ${e}`,hl=e=>_i.isFunction(e)||null===e||!1===e;const fl={getAdapter:function(e,t){e=_i.isArray(e)?e:[e];const{length:n}=e;let r,a;const s={};for(let o=0;o<n;o++){let n;if(r=e[o],a=r,!hl(r)&&(a=ul[(n=String(r)).toLowerCase()],void 0===a))throw new Vi(`Unknown adapter '${n}'`);if(a&&(_i.isFunction(a)||(a=a.get(t))))break;s[n||"#"+o]=a}if(!a){const e=Object.entries(s).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map(pl).join("\n"):" "+pl(e[0]):"as no adapter specified";throw new Vi("There is no suitable adapter to dispatch the request "+t,Vi.ERR_NOT_SUPPORT)}return a},adapters:ul};function gl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Sc(null,e)}function ml(e){const t=_i.toSafeFlatObject(e);gl(t),t.headers=Li.from(_i.getSafeProp(t,"headers")),t.data=Ac.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return fl.getAdapter(t.adapter||Ic.adapter,t)(t).then((function(e){gl(t),t.response=e;try{e.data=Ac.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=Li.from(e.headers),e}),(function(e){if(!Cc(e)&&(gl(t),e&&e.response)){t.response=e.response;try{e.response.data=Ac.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=Li.from(e.response.headers)}return Promise.reject(e)}))}const yl={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{yl[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const El={};yl.transitional=function(e,t,n){function r(e,t){return"[Axios v"+rl+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,s)=>{if(!1===e)throw new Vi(r(a," has been removed"+(t?" in "+t:"")),Vi.ERR_DEPRECATED);return t&&!El[a]&&(El[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,s)}},yl.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Il={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new Vi("options must be an object",Vi.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const s=r[a],o=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(o){const t=e[s],n=void 0===t||o(t,s,e);if(!0!==n)throw new Vi("option "+s+" must be "+n,Vi.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Vi("Unknown option "+s,Vi.ERR_BAD_OPTION)}},validators:yl},Al=Il.validators;class Cl{constructor(e){this.defaults=e||{},this.interceptors={request:new ac,response:new ac}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack;let r="";if("string"==typeof n){const e=n.indexOf("\n");r=-1===e?"":n.slice(e+1)}if(e.stack){if(r){const t=r.indexOf("\n"),n=-1===t?-1:r.indexOf("\n",t+1),a=-1===n?"":r.slice(n+1);String(e.stack).endsWith(a)||(e.stack+="\n"+r)}}else e.stack=r}catch(e){}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Bc(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:a}=t;void 0!==n&&Il.assertOptions(n,{silentJSONParsing:Al.transitional(Al.boolean),forcedJSONParsing:Al.transitional(Al.boolean),clarifyTimeoutError:Al.transitional(Al.boolean),legacyInterceptorReqResOrdering:Al.transitional(Al.boolean),advertiseZstdAcceptEncoding:Al.transitional(Al.boolean),validateStatusUndefinedResolves:Al.transitional(Al.boolean)},!1),null!=r&&(_i.isFunction(r)?t.paramsSerializer={serialize:r}:Il.assertOptions(r,{encode:Al.function,serialize:Al.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Il.assertOptions(t,{baseUrl:Al.spelling("baseURL"),withXsrfToken:Al.spelling("withXSRFToken")},!0),t.method=(_i.getSafeProp(t,"method")||_i.getSafeProp(this.defaults,"method")||"get").toLowerCase();let s=a&&_i.merge(a.common,a[t.method]);a&&_i.forEach(mc.concat("common"),(e=>{delete a[e]})),t.headers=Li.concat(s,a);const o=[];let i=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;i=i&&e.synchronous;const n=t.transitional||sc;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,u=0;if(!i){const e=[ml.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let p=t;for(;u<d;){const e=o[u++],t=o[u++];try{p=e?e(p):p}catch(e){if(!t){l=Promise.reject(e);break}try{const n=t.call(this,e);_i.isThenable(n)&&(l=Promise.resolve(n).then((()=>ml.call(this,p))))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=ml.call(this,p)}catch(e){l=Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return Zi(jc((e=Bc(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}_i.forEach(["delete","get","head","options"],(function(e){Cl.prototype[e]=function(t,n){return this.request(Bc(n||{},{method:e,url:t,data:n&&_i.hasOwnProp(n,"data")?n.data:void 0}))}})),_i.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,a){return this.request(Bc(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Cl.prototype[e]=t(),"query"!==e&&(Cl.prototype[e+"Form"]=t(!0))}));const Sl=Cl;class _l{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,a){n.reason||(n.reason=new Sc(e,r,a),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new _l((function(t){e=t})),cancel:e}}}const Nl=_l;const bl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(bl).forEach((([e,t])=>{void 0===bl[t]&&(bl[t]=e)}));const Tl=bl;const Pl=function e(t){const n=new Sl(t),r=bo(Sl.prototype.request,n);return _i.extend(r,Sl.prototype,n,{allOwnKeys:!0}),_i.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Bc(t,n))},r}(Ic);Pl.Axios=Sl,Pl.CanceledError=Sc,Pl.CancelToken=Nl,Pl.isCancel=Cc,Pl.VERSION=rl,Pl.toFormData=Yi,Pl.AxiosError=Vi,Pl.Cancel=Pl.CanceledError,Pl.all=function(e){return Promise.all(e)},Pl.spread=function(e){return function(t){return e.apply(null,t)}},Pl.isAxiosError=function(e){return _i.isObject(e)&&!0===e.isAxiosError},Pl.mergeConfig=Bc,Pl.AxiosHeaders=Li,Pl.formToJSON=e=>gc(_i.isHTMLForm(e)?new FormData(e):e),Pl.getAdapter=fl.getAdapter,Pl.HttpStatusCode=Tl,Pl.default=Pl;const Ol=Pl;function Dl(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var vl=Dl((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var Rl=function(e,t){return Rl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Rl(e,t)};function $l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Rl(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function xl(e,t,n,r){return new(n||(n=Promise))((function(a,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function i(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,i)}c((r=r.apply(e,t||[])).next())}))}function wl(e,t){var n,r,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=i(0),o.throw=i(1),o.return=i(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(s=0)),s;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){s.label=i[1];break}if(6===i[0]&&s.label<a[1]){s.label=a[1],a=i;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(i);break}a[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}Object.create;function Ml(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ll(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(a)throw a.error}}return o}function Ul(e,t,n){if(n||2===arguments.length)for(var r,a=0,s=t.length;a<s;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}function Fl(e){return this instanceof Fl?(this.v=e,this):new Fl(e)}function jl(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,a=n.apply(e,t||[]),s=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",(function(e){return function(t){return Promise.resolve(t).then(e,l)}})),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){a[e]&&(r[e]=function(t){return new Promise((function(n,r){s.push([e,t,n,r])>1||i(e,t)}))},t&&(r[e]=t(r[e])))}function i(e,t){try{(n=a[e](t)).value instanceof Fl?Promise.resolve(n.value.v).then(c,l):d(s[0][2],n)}catch(e){d(s[0][3],e)}var n}function c(e){i("next",e)}function l(e){i("throw",e)}function d(e,t){e(t),s.shift(),s.length&&i(s[0][0],s[0][1])}}function kl(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Ml(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,a){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,a,(t=e[n](t)).done,t.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError;var Vl=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function Bl(e){return"function"==typeof e}function Gl(e){return Bl(null==e?void 0:e.then)}var Wl=Dl((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function Hl(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var ql=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,r,a;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var o=Ml(s),i=o.next();!i.done;i=o.next()){i.value.remove(this)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else s.remove(this);var c=this.initialTeardown;if(Bl(c))try{c()}catch(e){a=e instanceof Wl?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var d=Ml(l),u=d.next();!u.done;u=d.next()){var p=u.value;try{Kl(p)}catch(e){a=null!=a?a:[],e instanceof Wl?a=Ul(Ul([],Ll(a)),Ll(e.errors)):a.push(e)}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}if(a)throw new Wl(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Kl(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Hl(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Hl(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),Yl=ql.EMPTY;function zl(e){return e instanceof ql||e&&"closed"in e&&Bl(e.remove)&&Bl(e.add)&&Bl(e.unsubscribe)}function Kl(e){Bl(e)?e():e.unsubscribe()}var Ql={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Jl={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=Jl.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,Ul([e,t],Ll(n))):setTimeout.apply(void 0,Ul([e,t],Ll(n)))},clearTimeout:function(e){var t=Jl.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Xl(e){Jl.setTimeout((function(){var t=Ql.onUnhandledError;if(!t)throw e;t(e)}))}function Zl(){}var ed=td("C",void 0,void 0);function td(e,t,n){return{kind:e,value:t,error:n}}var nd=null;function rd(e){if(Ql.useDeprecatedSynchronousErrorHandling){var t=!nd;if(t&&(nd={errorThrown:!1,error:null}),e(),t){var n=nd,r=n.errorThrown,a=n.error;if(nd=null,r)throw a}}else e()}var ad=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,zl(t)&&t.add(n)):n.destination=ud,n}return $l(t,e),t.create=function(e,t,n){return new cd(e,t,n)},t.prototype.next=function(e){this.isStopped?dd(function(e){return td("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?dd(td("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?dd(ed,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(ql),sd=Function.prototype.bind;function od(e,t){return sd.call(e,t)}var id=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){ld(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){ld(e)}else ld(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){ld(e)}},e}(),cd=function(e){function t(t,n,r){var a,s,o=e.call(this)||this;Bl(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&Ql.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},a={next:t.next&&od(t.next,s),error:t.error&&od(t.error,s),complete:t.complete&&od(t.complete,s)}):a=t;return o.destination=new id(a),o}return $l(t,e),t}(ad);function ld(e){var t;Ql.useDeprecatedSynchronousErrorHandling?(t=e,Ql.useDeprecatedSynchronousErrorHandling&&nd&&(nd.errorThrown=!0,nd.error=t)):Xl(e)}function dd(e,t){var n=Ql.onStoppedNotification;n&&Jl.setTimeout((function(){return n(e,t)}))}var ud={closed:!0,next:Zl,error:function(e){throw e},complete:Zl},pd="function"==typeof Symbol&&Symbol.observable||"@@observable";function hd(e){return e}function fd(e){return 0===e.length?hd:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var gd=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,a=this,s=(r=e)&&r instanceof ad||function(e){return e&&Bl(e.next)&&Bl(e.error)&&Bl(e.complete)}(r)&&zl(r)?e:new cd(e,t,n);return rd((function(){var e=a,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?a._subscribe(s):a._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=md(t))((function(t,r){var a=new cd({next:function(t){try{e(t)}catch(e){r(e),a.unsubscribe()}},error:r,complete:t});n.subscribe(a)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[pd]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fd(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=md(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function md(e){var t;return null!==(t=null!=e?e:Ql.Promise)&&void 0!==t?t:Promise}function yd(e){return Bl(e[pd])}function Ed(e){return Symbol.asyncIterator&&Bl(null==e?void 0:e[Symbol.asyncIterator])}function Id(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Ad="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Cd(e){return Bl(null==e?void 0:e[Ad])}function Sd(e){return jl(this,arguments,(function(){var t,n,r;return wl(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Fl(t.read())];case 3:return n=a.sent(),r=n.value,n.done?[4,Fl(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Fl(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function _d(e){return Bl(null==e?void 0:e.getReader)}function Nd(e){if(e instanceof gd)return e;if(null!=e){if(yd(e))return a=e,new gd((function(e){var t=a[pd]();if(Bl(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Vl(e))return r=e,new gd((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(Gl(e))return n=e,new gd((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Xl)}));if(Ed(e))return bd(e);if(Cd(e))return t=e,new gd((function(e){var n,r;try{for(var a=Ml(t),s=a.next();!s.done;s=a.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}e.complete()}));if(_d(e))return bd(Sd(e))}var t,n,r,a;throw Id(e)}function bd(e){return new gd((function(t){(function(e,t){var n,r,a,s;return xl(this,void 0,void 0,(function(){var o,i;return wl(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=kl(e),c.label=1;case 1:return[4,n.next()];case 2:if((r=c.sent()).done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i=c.sent(),a={error:i},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(s=n.return)?[4,s.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function Td(e,t,n,r,a){void 0===r&&(r=0),void 0===a&&(a=!1);var s=t.schedule((function(){n(),a?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(s),!a)return s}function Pd(e){return function(t){if(function(e){return Bl(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function Od(e,t,n,r,a){return new Dd(e,t,n,r,a)}var Dd=function(e){function t(t,n,r,a,s,o){var i=e.call(this,t)||this;return i.onFinalize=s,i.shouldUnsubscribe=o,i._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,i._error=a?function(e){try{a(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,i._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,i}return $l(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(ad);function vd(e,t){return void 0===t&&(t=0),Pd((function(n,r){n.subscribe(Od(r,(function(n){return Td(r,e,(function(){return r.next(n)}),t)}),(function(){return Td(r,e,(function(){return r.complete()}),t)}),(function(n){return Td(r,e,(function(){return r.error(n)}),t)})))}))}function Rd(e,t){return void 0===t&&(t=0),Pd((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function $d(e,t){if(!e)throw new Error("Iterable cannot be null");return new gd((function(n){Td(n,t,(function(){var r=e[Symbol.asyncIterator]();Td(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function xd(e,t){if(null!=e){if(yd(e))return function(e,t){return Nd(e).pipe(Rd(t),vd(t))}(e,t);if(Vl(e))return function(e,t){return new gd((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if(Gl(e))return function(e,t){return Nd(e).pipe(Rd(t),vd(t))}(e,t);if(Ed(e))return $d(e,t);if(Cd(e))return function(e,t){return new gd((function(n){var r;return Td(n,t,(function(){r=e[Ad](),Td(n,t,(function(){var e,t,a;try{t=(e=r.next()).value,a=e.done}catch(e){return void n.error(e)}a?n.complete():n.next(t)}),0,!0)})),function(){return Bl(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(_d(e))return function(e,t){return $d(Sd(e),t)}(e,t)}throw Id(e)}function wd(e,t){return t?xd(e,t):Nd(e)}function Md(e){return Pd((function(t,n){var r,a=null,s=!1;a=t.subscribe(Od(n,void 0,void 0,(function(o){r=Nd(e(o,Md(e)(t))),a?(a.unsubscribe(),a=null,r.subscribe(n)):s=!0}))),s&&(a.unsubscribe(),a=null,r.subscribe(n))}))}class Ld{constructor(e,t,n={}){this.type=e,this.name=t,this.parent=null,this.children=[],this.eventSubscribers=[],this.value="",this.previousValue="|~#-old-#~|",this.props=n,this.references=new Map}addReference(e,t){this.references.set(e,t)}getReference(e){return e?this.references.get(e):void 0}getNode(e,t,n){return this.children.find((r=>r.type===e&&r.name===t&&r.props.index===n))}addNode(e,t,n={}){let r=this.getNode(e,t,n.index);return r?r.props=n:(r=new Ld(e,t,n),r.parent=this,this.children.push(r)),r}addEventListener(e){this.eventSubscribers.push(e)}triggerEvent(e,t=!1){this.eventSubscribers.forEach((t=>{t(e)})),!t&&this.parent&&this.parent.triggerEvent(e)}setPreviousDefaultValue(){"|~#-old-#~|"===this.previousValue&&(this.previousValue=this.value)}removeReference(e,t){const n=this.references.get(e);n?.props?.index===t&&this.references.delete(e)}removeChildNode(e){const t=this.children.findIndex((t=>t.name.startsWith(e)));-1!==t&&this.children.splice(t,1)}removeChildren(){this.children.splice(0,this.children.length)}removeNode(e,t){for(let n=this.children.length-1;n>=0;n-=1){const r=this.children[n];if(r.props.index===t&&r.name===e){this.children.splice(n,1);break}}}}const Ud=Ld;const Fd=class{constructor(e,t,n,r={}){this.type=Ur.CONTEXT_TREE_NODE_TYPES.WHEN,this.subType=e,this.referenceName=t,this.name=n,this.props=r}},jd=/(([^.]+)\[\d+\])/g,kd=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match(jd);if(!t)return[e];let n,r=t[t.length-1];return e=e?.split(r)[0],e=e?.substring(0,e.length-1),[r,n]=r.split("["),n=n?.split("]")[0],[e,r,n]},Vd=(e,t)=>{if(!e.startsWith(t))return-1;const n=e.slice(t.length).match(/\[([0-9]+)\]/);return n?parseInt(n[1],10):-1},{FIELD:Bd,WHEN:Gd,DECLARATIVE_TARGET:Wd,PAGELIST:Hd}=Fr.CONTEXT_TREE_NODE_TYPES;let qd;const Yd=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[Bd,new Map],[Gd,new Map],[Wd,new Map]])}addReference(e,t){if(this.references.has(t.type)){const n=this.references.get(t.type);n.set(e,t),this.references.set(t.type,n)}else{if(t.type===Hd){const n=this.references.get(Bd);n.set(e,t),this.references.set(Bd,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const r=Vd(n.name,e);return-1!==r&&+r>=t}));n.length>0&&n.forEach((e=>{this.removeChildNode(e.name,t)}))}removeChildNode(e,t){const n=this.children.findIndex((t=>t.name.startsWith(e)));if(-1!==n){const[t]=this.children.splice(n,1),r=t?.parent;r?.removeChildNode(e)}const r=this.references.get(Bd),a=this.references.get(Wd);[...r.keys(),...a.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=kd(e);return+n>=t})).forEach((e=>{const t=r.get(e),n=t?.parent;n?.removeChildren(),r.delete(e)}))}getReference(e,t){if(this.references.has(t))return this.references.get(t)?.get(e)}getNode(e,t,n){return this.children.find((r=>r.type===e&&r.name===t&&r.props.index===n))}addNode(e,t,n={}){let r=this.getNode(e,t,n.index);return r?r.props=n:(r=new Ud(e,t,n),r.parent=this,this.children.push(r)),r}addEventListener(e){this.eventSubscribers.push(e)}triggerEvent(e){this.eventSubscribers.forEach((t=>{t(e)}))}removeReference(e,t,n){const r=this.references.get(t),a=r?.get(e);if(a?.props?.index===n){const n=a?.props?.context;t===Bd&&n&&qd?.(n,e),r.delete(e)}}removeNode(e,t){for(let n=this.children.length-1;n>=0;n-=1){const r=this.children[n];if(r.props.index===t&&r.name===e){this.children.splice(n,1);break}}}addWhen(e,t,n,r,a){if(!(n&&r&&e&&t))return;n.startsWith(".")&&(n=n.substring(1));const s=`${e}.${n}.${r}`,o=new Fd(t,n,r,a),i=this.references.get("WHEN");i?.set(s,o)}},{VIEW:zd,FIELD:Kd,CONTEXT:Qd,DECLARATIVE_TARGET:Jd,WHEN:Xd}=Ur.CONTEXT_TREE_NODE_TYPES;const Zd=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new Yd(Qd,e);this.rootNodes[e]=t}return this.rootNodes[e]}getContextNode(e){return e?this.rootNodes[e]:void 0}addPageNode(e,t){return this.addContextNode(e).addNode("PAGE",t)}_addParentViewNode(e,t,n){const r=this.addContextNode(e).addNode("PAGE",t);let a=r.getReference(n);return a||(a=r.addNode("VIEW",n),r.addReference(n,a)),a}pushChildPageNodeToParentView(e,t,n){const r=e.children;let a=!1;if(r)for(let e=0;e<r.length;e+=1)if(r[e].name===n){a=!0;break}a||r.push(t),t.parent=e}addViewNode(e,t,n,r,a={}){const s=this.addContextNode(e).addNode("PAGE",t);let o=null;if(r&&n!==r){o=this._addParentViewNode(e,t,r).addNode("VIEW",n,a)}else o=s.addNode("VIEW",n,a);s.addReference(n,o);const i=t.split(".");for(;i.length>0;){i.pop();const n=i.join("."),a=this.getContextNode(e)?.getNode("PAGE",n),o=a?.getReference(r);if(o){this.pushChildPageNodeToParentView(o,s,t);break}}return o}getViewNode(e,t,n){return this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n)}addPageListNode(e,t,n,r,a){if(!r)return;r.startsWith(".")&&(r=r.substring(1));const s=this.addContextNode(e),o=s.addNode("PAGE",t)?.getReference(n)?.addNode("PAGELIST",`${t}.${r}`,a);return o&&s.addReference(`${t}.${r}`,o),o}updatePageListNode(e,t,n,r){if(!n)return;n.startsWith(".")&&(n=n.substring(1));this.addContextNode(e).removePageListNodes(`${t}.${n}`,r)}removeFieldNode(e,t,n,r,a){const s=this.getContextNode(e);s?.getNode("PAGE",t)?.getReference(n)?.removeNode(`${t}${r}`,a),s?.removeReference(`${t}${r}`,Kd,a),s?.removeReference(`${t}${r}`,Jd,a)}removeViewNode(e,t,n,r,a={}){const s=this.getContextNode(e),o=s?.getNode("PAGE",t),i=o?.getReference(n);if("visibility"in a&&i?.props&&"visibility"in i.props&&a.visibility!==i.props.visibility)return;this.removeChildViewNodes(e,t,n,r);const c=i?.parent?.children?.findIndex((e=>e.name===n))??-1;c>-1&&i?.parent?.children.splice(c,1)}removeChildViewNodes(e,t,n,r){const a=this.getContextNode(e),s=a?.getNode("PAGE",t),o=s?.getReference(n);o?.children.forEach((s=>{"PAGE"===s.type?this.removeViewNode(e,s.name,n,r):s.type===zd?this.removeChildViewNodes(e,t,s.name,r):(a.removeReference(s.name,Kd,s.props.index),a.removeReference(s.name,Jd,s.props.index),"PAGELIST"!==s.type&&"Address"!==s.props?.componentName||this.deleteAllListNodes(e,s.name))})),s?.references.delete(n)}deleteAllListNodes(e,t,n=!0){const r=r=>{const a=this.getContextNode(e),s=a?.references?.get(r);if(s)for(const[e]of s)(n&&e===t||e.startsWith(`${t}.`)||e.startsWith(`${t}[`))&&a?.references?.get(r)?.delete(e)};r(Kd),r(Jd)}deleteListNode(e,t,n){const r=r=>{const a=this.getContextNode(e),s=a?.references?.get(r);if(s)for(const[e]of s)e.includes(`${t.join(".")}[${n}]`)&&a?.references?.get(r)?.delete(e)};r(Kd),r(Jd)}getPageListNode(e,t,n,r){const a=this.getContextNode(e)?.getNode("PAGE",t)?.getReference(n);return a?.children.find((e=>"PAGELIST"===e.type&&e.name===`${t}.${r}`))}getFieldNode(e,t,n,r){return this.getViewNode(e,t,n)?.getNode(Kd,r)}_findViewNode(e,t,n,r){let a=r.addNode("PAGE",t)?.getReference(n);if(a)return a;const s=t.split(".");for(;s.length>0;){s.pop();const e=s.join(".");if(a=r.addNode("PAGE",e)?.getReference(n),a)return a}return this.addViewNode(e,t,n)}addFieldNode(e,t,n,r,a,s={}){const o=this.addContextNode(e),i=this._findViewNode(e,t,n,o),c=this.createFieldNode(i,t,r,s);return c&&this.updateFieldNode(o,i,c,e,t,r,a),c}createFieldNode(e,t,n,r){const{isDeclarativeTarget:a}=r;return a?e.addNode(Jd,`${t}${n}`,r):e.addNode(Kd,`${t}${n}`,r)}updateFieldNode(e,t,n,r,a,s,o){const i=`${a}${s}`;"Address"===n.props?.componentName&&this.deleteAllListNodes(r,n.name),e.addReference(i,n),n.value=o,n.setPreviousDefaultValue(),n.props.isInsideList&&this.handleFieldInsideList(e,t,r,a,s)}handleFieldInsideList(e,t,n,r,a){const s=QI(n),o=CI(s,n)||{},i=`${r}${a}`;let c=null;if(o?.subscriptFieldName||o?.isPageGroup)c=r.substring(0,r.lastIndexOf(`.${o?.index??""}`))||i.substring(0,i.lastIndexOf(`.${o?.index}`)),this.createListNodeIfNotExist(e,t,c);else{const n=r.substring(0,r.lastIndexOf("["))||i.substring(0,i.lastIndexOf("["));this.createListNodeIfNotExist(e,t,n)}}createListNodeIfNotExist(e,t,n){let r=e.getReference(n,Kd);r||(r=t.addNode(Kd,n,{}),e.addReference(n,r))}removeContextTreeNode(e){delete this.rootNodes[e]}onViewMutate(e,t,n,r){this.getViewNode(e,t,n)?.addEventListener(r)}mutateField(e,t,n,r){const a=this.getContextNode(e),[s,o,i]=kd(t);n.startsWith(".")&&(n=n.substring(1)),o&&this.mutatePageList(e,s,o,{...r,rowIndex:i});const c=a?.getReference(`${t}.${n}`,Kd);c&&c instanceof Ud&&c.triggerEvent(r)}onPageListMutate(e,t,n,r,a){this.getPageListNode(e,t,n,r)?.addEventListener(a)}mutatePageList(e,t,n,r,a=!1){const s=this.getContextNode(e),o=s?.getReference(`${t}.${n}`,Kd);o&&o instanceof Ud&&o.triggerEvent(r,a)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(Kd)}getFieldReferenceForProperty(e,t){let n=this.getContextNode(e)?.references?.get(Kd)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Jd)?.get(t)),n}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(Kd)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(Jd)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const r=this.getContextNode(e)?.references?.get(Kd)?.get(t);r instanceof Ud&&r&&(r.previousValue=r.value,void 0===r.value&&(r.previousValue=n),r.value=n)}getContextReferences(e){if(!this.getContextNode(e))return;const t=this.getContextReferencesByType(e,Kd),n=this.getContextReferencesByType(e,Jd);return new Map([...t.entries(),...n.entries()])}getContextReferencesByType(e,t){return this.getContextNode(e)?.references.get(t)||new Map}isFieldExists(e,t){return!!this.getContextReferencesByType(e,Kd)?.get(t)||!!this.getContextReferencesByType(e,Jd)?.get(t)}addWhenNode(e,t,n,r,a,s){const o=this.getContextNode(e);o?.addWhen(t,n,r,a,s)}getDeclarativeTargets(e){const t=this.getContextNode(e),n=t?.references?.get(Jd)||new Map,r=[];return n.forEach((e=>{const t=e?.props||{},{propertyName:n=""}=t,a=t.pageReference??Ur.CASE_INFO.CASE_INFO_CONTENT;r.push({pageReference:a,name:n})})),r}getWhens(e){const t=this.getContextNode(e),n=t?.references?.get(Xd)||new Map,r=[];return n.forEach((e=>{const t=e.subType,n=e.referenceName,a=e.name,s=e?.props?.pageReference??Ur.CASE_INFO.CASE_INFO_CONTENT;r.push({name:a,pageReference:s,referenceName:n,type:t})})),r}},eu={CONTENT_FIELDS_PATH:[Fr.CONTEXT_DATA,Fr.CASE_INFO.CASE_INFO,Fr.CONTENT],DATA_OBJECT_CONTENT_FIELDS_PATH:[Fr.CONTEXT_DATA,Fr.DATA_INFO.DATA_INFO,Fr.CONTENT],OBJECT_CONTENT_FIELDS_PATH:[Fr.CONTEXT_DATA,Fr.OBJECT_INFO.OBJECT_INFO,Fr.CONTENT],FIELD_MESSAGES_PATH:[Fr.CONTEXT_DATA,Fr.CASE_INFO.CASE_INFO,Fr.CONTENT,Fr.SUMMARY_OF_MESSAGES,Fr.PROPERTY_MESSAGES],DATA_OBJECT_FIELD_MESSAGES_PATH:[Fr.CONTEXT_DATA,Fr.DATA_INFO.DATA_INFO,Fr.CONTENT,Fr.SUMMARY_OF_MESSAGES,Fr.PROPERTY_MESSAGES],OBJECT_FIELD_MESSAGES_PATH:[Fr.CONTEXT_DATA,Fr.OBJECT_INFO.OBJECT_INFO,Fr.CONTENT,Fr.SUMMARY_OF_MESSAGES,Fr.PROPERTY_MESSAGES],PAGE_MESSAGES_PATH:[Fr.CONTEXT_DATA,Fr.SUMMARY_OF_MESSAGES,Fr.PAGE_MESSAGES],HTTP_MESSAGES_PATH:[Fr.CONTEXT_DATA,Fr.SUMMARY_OF_MESSAGES,Fr.HTTP_MESSAGES],CASE_MESSAGE_PATH:[Fr.CASEMESSAGES]},tu=(e="",t="",n,r)=>{let a=[],s=[];null!==e&&(s=(e=>e?.startsWith(".")?e.substring(1).split("."):e.split("."))(e));const o=t&&t.startsWith(".")?t.substr(1):t;if(n===Fr.PROPERTY&&e||e){a=[Fr.CONTEXT_DATA,...o.split(".")];for(let e=0;e<s.length-1;e+=1)a.push(s[e]);a.push(Fr.SUMMARY_OF_MESSAGES,Fr.PROPERTY_MESSAGES,s[s.length-1])}else n===Ur.PAGE?a=[...eu.PAGE_MESSAGES_PATH]:n===Fr.HTTP?a=[...eu.HTTP_MESSAGES_PATH]:n===Fr.CASEMESSAGES?a=[...eu.CASE_MESSAGE_PATH]:r&&(a=[Fr.CONTEXT_DATA,...o.split(".")]);return a.filter(Boolean)},nu=(e,t,n)=>{const r={content:{}},a=`${t.split(".").slice(2).join(".")}[${n}]`,s=aS.getIn(e?.content,a.split("."));return s&&aS.setIn(r.content,a.split("."),{...s}),r},ru=(e,t,n,r,a,s,o={})=>{const i=((e,t,n)=>t<n?e.filter((e=>parseInt(e.match(/\d+/)?.[0],10)>t&&parseInt(e.match(/\d+/)?.[0],10)<=n)):e.filter((e=>parseInt(e.match(/\d+/)?.[0],10)<t&&parseInt(e.match(/\d+/)?.[0],10)>=n)))(n,r,a),c=r>a?"up":"down";i&&i?.length>0&&i?.forEach((n=>{const r=parseInt(n.match(/\d+/)?.[0],10),a=`${s}[${r}]`;o[`${s}[${r+("up"===c?1:-1)}]`]=aS.getIn(e[t],[Fr.CONTEXT_DATA,...a.split(".")]),aS.deleteIn(e[t],[Fr.CONTEXT_DATA,...a.split(".")])}));const l=Object.keys(o);l.length>0&&l.forEach((n=>{aS.setIn(e[t],[Fr.CONTEXT_DATA,...n.split(".")],o[n])}))},au=(e,t,n,r,a)=>{const s=aS.deepClone(aS.getIn(e,[`${t}`])),o=aS.getIn(s,[Fr.CONTEXT_DATA,Fr.CASE_INFO.CASE_INFO]);if(!o)return;const i=(e=>{const t=[];let n=0;for(;n<e.length;)n+1<e.length&&!Number.isNaN(parseInt(e[n+1],10))?(t.push(`${e[n]}[${e[n+1]}]`),n+=2):(t.push(e[n]),n+=1);return t.join(".")})(n.split(".")),c=i.substring(0,i.lastIndexOf(".")),l=((e,t,n)=>{const r=aS.getIn(e,[Fr.CONTEXT_DATA,...n.split(".")],{});return Object.keys(r).filter((e=>e.includes(`${t}[`)))})(s,i.substring(i.lastIndexOf(".")+1),c);if(0===l.length)return;const d=nu(o,i,r).content;if(d&&Object.keys(d).length>0){const n={},o=`${i}[${r}]`,c=aS.getIn(s,[Fr.CONTEXT_DATA,...o.split(".")]);n[`${i}[${a}]`]=c,aS.deleteIn(e[t],[Fr.CONTEXT_DATA,...o.split(".")]),ru(e,t,l,r,a,i,n)}else ru(e,t,l,r,a,i)},su=e=>{const{type:t,property:n,category:r,context:a,pageReference:s}=e;let o;n&&(o=n.slice(1));const i=BC(a);let c=[];const l=aS.getIn(i,tu(o,s,r));return t&&"all"!==t?(l&&Array.isArray(l)&&l.length>0&&(c=l.filter((e=>e.type===t))),t===Ur.MESSAGES.MESSAGES_TYPE_ERROR&&c.length>0&&n&&Zd.mutateField(a,s,n,{messages:[...c],type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:n}),c):l},ou=e=>{const{property:t,pageReference:n,category:r,context:a,type:s,subType:o,isListEntry:i,clearContextMessages:c,deletingIndex:l}=e,d={context:a,type:s,subType:o};t&&!i?(Zd.mutateField(a,n,t,{type:cs,fieldName:t}),d.property=t,d.pageReference=n):i?(d.pageReference=n,d.isListEntry=i,d.deletingIndex=l):d.category=r,VC(c?{type:cs,payload:{stateObj:e.stateObj,context:a}}:{type:cs,payload:d})},iu=e=>{const{messages:t,property:n,pageReference:r,category:a,context:s}=e,o={messages:t,context:s};n?(o.property=n,o.pageReference=r):o.category=a,VC({type:is,payload:o})},cu=(e,t,n)=>{for(const r of Object.keys(e)){if(t.push(r),r===Fr.SUMMARY_OF_MESSAGES)n.push([...t]);else{"object"===typeof e[r]&&cu(e[r],t,n)}t.pop()}return n},lu=(e,t)=>{let n=su({context:Fr.APP.ROOT,category:"HTTP"});if(PA.getRenderingMode()===Fr.EMBED){const e=su({context:Fr.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=su({context:t,category:"HTTP"});n?e&&(n=n.concat(su({context:t,category:"HTTP"}))):n=su({context:t,category:"HTTP"})}return n},du=e=>{let t=null;t=FI(e)[0]?$I(FI(e)[0]):e,t&&ou({context:t,stateObj:BC(t),clearContextMessages:!0})},uu=e=>(aS.getIn(BC(e),eu.PAGE_MESSAGES_PATH)??[]).some((e=>e.subType===Fr.CUSTOM_ERROR)),pu={addMessages:iu,getValidationErrorMessages:(e,t)=>{const n=BC(e),r=(e=>{let t=eu.CONTENT_FIELDS_PATH;e?.objectInfo?t=zy.isObjectCaseType(e?.objectInfo?.objectTypeID)?eu.OBJECT_CONTENT_FIELDS_PATH:t:e?.dataInfo?.content&&(t=eu.DATA_OBJECT_CONTENT_FIELDS_PATH);return t})(n),a=aS.getIn(n,[...r])||{},s=[];return cu(a,[],[]).forEach((e=>{const n=aS.getIn(a,[...e,Fr.PROPERTY_MESSAGES]);n&&Object.keys(n).forEach((e=>{n[e].forEach((e=>{if(e.type===Fr.MESSAGES.MESSAGES_TYPE_ERROR){const n=t?.getLocalizedMessage(e.message)??e.message;e.fieldLabel?s.push({label:`${e.fieldLabel}:`,description:n}):s.push(n)}}))}))})),s},getMessages:su,clearMessages:ou,getRootContainerHttpMessages:lu,clearContextMessagesInActiveWorkArea:du,clearContextMessages:e=>{const{context:t}=e;VC({type:cs,payload:{clearAll:!0,context:t}})},isCustomPageErrorExist:uu};const hu=class{constructor(e,t,n,r){this.eventType=e,this.callback=n,this.contextName=r,this.id=t}};const fu=new class{constructor(){this.subscribers={}}publish(e,t){(this.subscribers[e]||[]).slice().forEach((e=>{e.callback(t)}))}unsubscribe(e,t,n){const r=this.subscribers[e]||[];let a=0,s=-1;r.forEach((e=>{e.id===t&&e.contextName===n&&(s=a),a+=1})),-1!==s&&r.splice(s,1)}unsubscribeAllWithEventType(e){this.subscribers[e]=[]}subscribe(e,t,n,r,a){this.subscribers[e]=this.subscribers[e]||[];let s=!1;if(a&&this.subscribers[e].forEach((e=>{s=e.id===t&&e.contextName===r})),!s){const a=new hu(e,t,n,r);this.subscribers[e].push(a)}}clearContext(e){const t=this.subscribers;Object.keys(t).forEach((t=>{const n=this.subscribers[t],r=[];n.forEach((t=>{t.contextName!==e&&r.push(t)})),this.subscribers[t]=r}))}};const gu=class{static subscribe(e,t,n,r=!1,a="app"){fu.subscribe(e,n,t,a,r)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){fu.publish(e,t)}static unsubscribe(e,t,n="app"){fu.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){fu.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){fu.clearContext(e)}};const mu=new class{override=null;discoveredOffline=!1;subscribers=new Set;constructor(){"function"==typeof globalThis.addEventListener&&(globalThis.addEventListener("online",this.handleOnline),globalThis.addEventListener("offline",this.handleOffline))}isOnline(){return null!==this.override?this.override:!this.discoveredOffline&&("undefined"==typeof navigator||!("onLine"in navigator)||navigator.onLine)}setOnlineOverride(e){const t=this.isOnline();this.override=e;const n=this.isOnline();n!==t&&this.notifyAll(n)}onStatusChange(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}reportNetworkFailure(){null===this.override&&(this.discoveredOffline||(this.discoveredOffline=!0,this.notifyAll(!1)))}reportNetworkRecovery(){null===this.override&&this.discoveredOffline&&(this.discoveredOffline=!1,this.notifyAll(!0))}handleOnline=()=>{null===this.override&&(this.discoveredOffline=!1,this.notifyAll(!0))};handleOffline=()=>{null===this.override&&this.notifyAll(!1)};notifyAll(e){VC({type:e?la:ca,payload:{context:"app"}}),this.subscribers.forEach((t=>{t(e)}))}};const yu=new class{#e;#t;#n;#r;constructor(){this.#e="undefined"!=typeof localStorage&&"true"===localStorage.getItem("inspectorFlag"),this.#t=!1,this.#n=!1,this.#r=!1,this.isPreview=!1,this.debugLevels="vcv=1;tracer=0;log=0;metric=1"}#a(){return this.#n&&this.#r}toggleXRay(e){console.warn("The toggleXRay method is deprecated. Please use the toggleInspector method going forward."),e&&!this.inspectorEnabled&&this.toggleInspector(),!e&&this.inspectorEnabled&&this.toggleInspector()}get inspectorEnabled(){return this.#e}get inspectorShowAll(){return this.#t}toggleInspector(){const e="undefined"!=typeof localStorage?localStorage:null,t="true"===e?.getItem("inspectorFlag");!t&&this.#a()||(this.#e=!t,e?.setItem("inspectorFlag",this.#e.toString()),gu.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR,this.#e))}disableInspectorIfEnabled(){if(!this.#e)return;this.#e=!1;const e="undefined"!=typeof localStorage?localStorage:null;e?.setItem("inspectorFlag",this.#e.toString()),gu.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR,this.#e)}toggleInspectorShowAll(){this.#t=!this.#t,gu.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.INSPECTOR_SHOW_ALL,this.#t)}get uiDesignerEnabled(){return this.#n}setDesignerToolbarExpanded(e){this.#r=e,gu.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER_TOOLBAR_EXPANDED,e)}get uiDesignerToolbarExpanded(){return this.#r}toggleUIDesigner(){this.#n=!this.#n,this.#n||(this.#r=!1),gu.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER,this.#n),gu.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.UI_DESIGNER_TOOLBAR_EXPANDED,this.#r)}setPreviewMode(){this.isPreview=!0}getPreviewMode(){return this.isPreview}enableTracer=()=>{this.debugLevels="vcv=1;tracer=1;log=0;metric=1"};disableTracer=()=>{this.debugLevels="vcv=1;tracer=0;log=0;metric=1"};getDebugLevels=()=>this.debugLevels};class Eu{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new Eu(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):Ju(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=Xu()}async buildAuthorizeUrl(e){e=e||window.btoa(window.location.origin);let{sessionIndex:t}=this.config;const{password:n}=this.config,r=this.config.clientId?this.config.clientId:this.config.client_id,a=this.config.redirectUri?this.config.redirectUri:this.config.redirect_uri,s=this.config.authorizeUri?this.config.authorizeUri:this.config.endPoints?.authorize,o=this.config.authService?this.config.authService:this.config.authentication_service||"pega",i=this.config.appAlias?this.config.appAlias:bA.getApplicationAlias(),c=this.config.userIdentifier?this.config.userIdentifier:this.config.user_identifier;t=t||this.config.tokenInfo?.session_index;let l="";t?l=`&session_index=${t}`:`${c}`?l=`&UserIdentifier=${c}`:n&&(l=`&Password=${window.atob(n)}`);const d=new Uint8Array(64);window.crypto?.getRandomValues(d),this.config.codeVerifier=this.base64UrlSafeEncode(d),this.updateConfig(this.config,!1);const u=i?`+app.alias.${i.replace(/^app\//,"")}`:"";return this.getCodeChallenge(this.config.codeVerifier)?.then((t=>`${s}?client_id=${r}&response_type=code&redirect_uri=${a}&scope=openid${u}&state=${e}&code_challenge=${t}&code_challenge_method=S256&authentication_service=${o}&enable_psyncId=true${l}`))?.catch((()=>null))}getTokenAndFinish=e=>{window.removeEventListener("message",this.authMessageHandler,!1),this.getToken(e,!1).then((()=>{})).catch((e=>{console.log(e)}))};authMessageHandler=e=>{if(e.origin!==this.getRedirectUriOrigin())return;if(!e.data||!e.data.type||"PegaAuth"!==e.data.type)return;const t=e.data.code.toString();this.getTokenAndFinish(t)};getRedirectUriOrigin=()=>{let{redirectUri:e}=this.config;e=e||this.config.redirect_uri||"";const t=e.indexOf("//"),n=e.indexOf("/",t+2);return-1!==n?e.substring(0,n):e};getToken(e,t){this.reloadConfig(t);const n=this.config.clientId?this.config.clientId:this.config.client_id,r=this.config.clientSecret?this.config.clientSecret:this.config.client_secret,a=this.config.redirectUri?this.config.redirectUri:this.config.redirect_uri,s=this.config.tokenUri?this.config.tokenUri:this.config.endPoints?.token,{codeVerifier:o}=this.config,i=window.location.search,c=new URLSearchParams(i),l=e||c.get("code"),d=new URLSearchParams;return n&&d.append("client_id",n),r&&d.append("client_secret",r),d.append("grant_type","authorization_code"),d.append("code",l),a&&d.append("redirect_uri",a),o&&d.append("code_verifier",o),this.config?.secureCookie&&d.append("send_token_as_cookie","true"),Wu(s,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:d.toString()}).then((e=>e.data)).then((e=>{e.eA=Date.now()+1e3*e.expires_in;let n=!1;if(this.config.codeVerifier&&(delete this.config.codeVerifier,n=!0),e.session_index&&(this.config.session_index=e.session_index,n=!0),n){this.updateConfig(this.config,t),this.config?.secureCookie?Ku({pzCTkn:e?.csrf}):(Qu({tokenInfo:e}),Ku({Authorization:`${e?.token_type} ${e?.access_token}`}));const{onTokenRetrieval:n}=this.config;n&&"function"==typeof n&&n(e),window.postMessage("oAuthSuccess")}return e})).catch((()=>null))}sha256Hash(e){return window.crypto?.subtle?.digest("SHA-256",(new TextEncoder).encode(e))}encode64(e){return window.btoa(new Uint8Array(e).reduce(((e,t)=>e+String.fromCharCode(t)),""))}base64UrlSafeEncode(e){return this.encode64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}getCodeChallenge(e){return this.sha256Hash(e)?.then((e=>this.base64UrlSafeEncode(e))).catch((e=>{console.log(e)})).finally((()=>null))}}const Iu=Eu,Au=async()=>new Promise((async(e,t)=>{const n=Zu();if(!("tokenInfo"in n)||!n?.tokenInfo)return void t(new Error("Missing token information."));const{access_token:r,refresh_token:a=null}=n.tokenInfo,s=n.endPoints?.revoke,{client_id:o="",client_secret:i="",secureCookie:c,serverType:l}=n,d="launchpad"===l,u={"content-type":"application/x-www-form-urlencoded"};i&&!d&&(u.authorization=`Basic ${window.btoa(`${o}:${i}`)}`);const p=new URLSearchParams;i?d&&(p.append("client_id",o),p.append("client_secret",i)):p.append("client_id",o),c&&p.append("send_token_as_cookie","true");const h=a?"refresh_token":"access_token",f="access_token"===h?r:a;!c&&f&&p.append("token",f),p.append("token_type_hint",h),s&&await Wu(s,{method:"POST",headers:u,withCredentials:c,body:p.toString(),withoutDefaultHeaders:!0}),Ku({Authorization:null}),Qu({tokenInfo:null}),e()})),Cu=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new Iu(e,!1);t.reauthUrl=await n.buildAuthorizeUrl(),t.redirectOrigin=n.getRedirectUriOrigin(),window.addEventListener("message",n.authMessageHandler,!1)}else t.reauthUrl=an()+(rn()?`${rn()}`:"/?reAuth=true");return t},Su=(e,t)=>{Cu(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};gu.publish(Ur.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},_u=e=>{let t="",n={},r={},a=!0;if("OAuth2.0"===e?.authType){t=e.endPoints.token;const s=new URLSearchParams;(!e.tokenInfo.refresh_token||e.tokenInfo.refresh_token&&e.tokenInfo.refresh_token.length<=0)&&(a=!1),s.append("client_id",e.client_id),s.append("grant_type","refresh_token"),e.client_secret&&s.append("client_secret",e.client_secret),e.secureCookie&&s.append("send_token_as_cookie","true"),e.tokenInfo?.refresh_token&&s.append("refresh_token",e.tokenInfo.refresh_token),n={method:"POST",body:s.toString(),headers:{"content-type":"application/x-www-form-urlencoded"}},r={success:t=>{const{data:n}=t,r={access_token:n?.access_token,refresh_token:n?.refresh_token};Qu({tokenInfo:{...e.tokenInfo,...r}}),e.secureCookie?Ku({pzCTkn:n?.csrf}):Ku({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:a}=e;a&&"function"==typeof a&&a(n)},failure:t=>{if(e.popupReauth)return Su(t,e);gu.publish(Ur.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${an()}/updateSession`,n={method:"GET",headers:{}},r={failure:Su};return{url:t,config:n,callback:r,isRefreshTokenPresent:a}},Nu=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),bu=e=>{const{config:t}=e,n=t.headers&&t.headers.context;return t.data&&(t.body=t.data),{url:t.url,config:t,context:n}},Tu=e=>{const{url:t,config:n,callback:r}=_u(e);return Wu(t,n).then((e=>{r?.success?.(e),gu.publish("updateSession",{updateStatus:"success"}),gu.publish("OnUpdateSession",{})})).catch((e=>{throw e}))},Pu=(e,t,n)=>{const{config:r}=e,{url:a,config:s,callback:o,isRefreshTokenPresent:i}=_u(n),c=r?.headers&&r.headers.context;r?.data&&(r.body=r.data);const l=Hu(r.url,r,c,t);return i?Wu(a,s).then((e=>new Promise(((n,a)=>{setTimeout((()=>{t.setUpdateSessionStatus(!1),t.latestUpdateSessionTimeStamp=Date.now(),o?.success?.(e,r),gu.publish("updateSession",{updateStatus:"success"}),gu.publish("OnUpdateSession",{}),l.then((e=>{n(e)})).catch((e=>{a(e)}))}),0)})))).catch((e=>e&&e.config&&Nu(e.config.url,n)?(o?.failure?.(r.url,n),l):Promise.reject(e))):(o?.failure?.(r.url,n),l)},Ou=new Set(["resource is stale","resource is locked","resource in the wrong state","resource not found"]),Du=e=>"object"==typeof e&&null!==e,vu=(e,t)=>{if(!(e=>!!e&&Ou.has(e.toLowerCase()))(t))return e;if(e&&e.includes("/workarea")&&!e.includes("/modal")){const t=e.lastIndexOf("/workarea");if(-1!==t)return e.slice(0,t)}return e},Ru=(e,t,n,r)=>{if(e.config&&Nu(e.config.url,n))return Promise.reject(e);if(e.response&&e.response.status&&401===e.response.status&&!e.config.isExternalUrl&&!t.getUpdateSessionStatus()&&e.config.fetchTimeStamp>t.latestUpdateSessionTimeStamp){if(gu.unsubscribeAllWithEventType(wu),t.setUpdateSessionStatus(!0),"custom"===n?.authType){gu.publish(Ur.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:r,context:a}=bu(e);return Hu(n,r,a,t)}return Pu(e,t,n)}if(e.response&&e.response.status&&401===e.response.status&&!e.config.isExternalUrl&&t.getUpdateSessionStatus()){const{url:t,config:n,context:r}=bu(e);return Wu(t,n,r)}const a=(e=>{if(e instanceof ArrayBuffer)try{const t=(new TextDecoder).decode(e),n=JSON.parse(t);return Du(n)?n:{}}catch{return{}}return Du(e)?e:{}})(e.response?.data);if(e.response&&e.response.status&&422!==e.response.status&&424!==e.response.status&&(400!==e.response.status||a.errorClassification!==Ur.INVALID_INPUTS)&&e.config.headers.context&&e.response.data&&!r){const t=a.errorDetails&&a.errorDetails.map((t=>((e,t)=>t[Ur.TRACE_ID]?{type:"error",message:e.localizedValue||e.message,correlationID:t[Ur.TRACE_ID]}:{type:"error",message:e.localizedValue||e.message})(t,e.response.headers))),n=vu(e.config.headers.context,a.errorClassification);return iu({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const $u=class{constructor(){this.updateSessionInProgress=!1,this.latestUpdateSessionTimeStamp=Date.now()}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const xu=new class{constructor(){this.externalHeaders={},this.defaultHeaders={},this.SPECIAL_CHARS={SLASH:"/"}}registerHeader(e,t){return!this.defaultHeaders[e]&&(this.externalHeaders[e]=t,!0)}unRegisterHeader(e){this.externalHeaders[e]&&delete this.externalHeaders[e]}getRegisteredHeaders(){return this.externalHeaders}setDefaultHeaders(e){e?.Prefer&&this.defaultHeaders.Prefer&&(e.Prefer=`${this.defaultHeaders.Prefer},${e.Prefer}`),this.defaultHeaders={...this.defaultHeaders,...e}}setRequestContext(e){if(!e||0===e.length)return;const t=new URLSearchParams(window.location.search),n=this.buildHeaderMapFromRequestContext(e,t);this.registerHeadersFromMap(n)}buildHeaderMapFromRequestContext(e,t){const n={};return e?.forEach((e=>{Array.isArray(e.IncludeInHeaders)&&e.IncludeInHeaders.forEach((r=>{const a=r.Value,s=t.get(e.Key);s&&(n[a]||(n[a]=[]),n[a].push(`${e.Key}=${s}`))}))})),n}registerHeadersFromMap(e){Object.entries(e).forEach((([e,t])=>{t.length>0&&this.registerHeader(e,t.join("; "))}))}getDefaultHeaders(){return this.defaultHeaders}addDebugHeaders(e={}){return{[Fr.COREHEADER_APP_DEBUG_ID]:e.debugId,[Fr.COREHEADER_APP_DEBUG_LEVELS]:yu.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=cS.getProperty(Fr.COREHEADERS,"",e);return t?{...t,debugInfo:yu.getPreviewMode()&&{...t.debugInfo,[Fr.COREHEADER_APP_DEBUG_LEVELS]:yu.getDebugLevels()}}:(e=e.substr(0,e.lastIndexOf(this.SPECIAL_CHARS.SLASH)),this.getCoreHeadersFromContext(e))}processCoreHeaders(e,t,n){const r=this.getCoreHeadersFromContext(n);if(r){const t=Object.keys(e);if(t.includes(Fr.SKIPCOREHEADERS))return void delete e[Fr.SKIPCOREHEADERS];const n=Object.assign({},...Object.values(r));Object.keys({...n}).forEach((r=>{t.includes(r)||(e[r]=n[r])}))}}injectCoreAdditionalHeaders(e,t,n,r){r?.includeRemoteSystemIdIfPresent&&Vr.injectRemoteCaseHeader(e,t,n),this.processCoreHeaders(e,t,n)}};const wu="updateSession",Mu={},Lu=new $u,Uu=new class{constructor(){this.timerID=void 0,this.expiryBuffer=45,this.timeoutWarned=!1}setTimerID=e=>{this.timerID=e};getTimerID=()=>this.timerID;resetInactiveTimeout=e=>{const t=window.PCore?.getEnvironmentInfo().getInactivityTimeout();if(this.timeoutWarned&&(gu.unsubscribe(Ur.PUB_SUB_EVENTS.RESET_TIMER,"resetCallback"),this.timeoutWarned=!1),t)return e&&clearTimeout(e),this.startInactivityTimeout(t>60?t:60)};startInactivityTimeout=e=>{const t=setTimeout((()=>{gu.publish(Ur.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),gu.subscribe(Ur.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let Fu={},ju={},ku={},Vu="";const Bu=e=>(e=>"ERR_NETWORK"===e.code||"ECONNABORTED"===e.code||"Network Offline"===e.message||!0===e.isOffline)(e)?(BC(e.config?.headers?.context)?.isLoading&&VC({type:ia,payload:{context:e.config?.headers?.context}}),mu.reportNetworkFailure(),Promise.reject(new Error("Network Offline"))):((e=>"Network Offline"!==e.message&&Boolean(BC(Fr.APP.APP)?.context_data?.isOffline))(e)&&mu.reportNetworkRecovery(),!e.response&&e.cause?.response&&(e.response=e.cause.response),(e=>Boolean(e.response&&401===e.response.status&&!e.config?.isExternalUrl&&(!e.config||!Nu(e.config.url,ju))))(e)&&gu.subscribe(wu,(e=>{Lu.setUpdateSessionStatus(!e.updateStatus)}),wu),Ru(e,Lu,ju,(e=>e.response&&e.response.status&&e.response.status===Number(Vu)?Vu:null)(e))),Gu=e=>{if("OAuth2.0"===e?.authType&&e.secureCookie||e.customCookies)return!0},Wu=(e,t,n="root",r={})=>{const{doNotMergeHttpMessagesForStatusCode:a=null,cancelContext:s=n,includeRemoteSystemIdIfPresent:o=!0}=r;Vu=a,null===e&&window.console.error("Error: url passed to Service Broker fetch is null (or) undefined");const{body:i,signal:c,responseType:l,adapter:d,withoutDefaultHeaders:u=!1,...p}=t,{Authorization:h,pzCTkn:f,...g}=t.headers||{};u||xu.injectCoreAdditionalHeaders(g,t.body,n,{includeRemoteSystemIdIfPresent:o}),s&&Mu[s]>=0?Mu[s]+=1:s&&void 0===Mu[s]&&(Mu[s]=1);let m=u?{...g}:{...xu.getDefaultHeaders(),...xu.getRegisteredHeaders(),...g,context:n};if(p.isExternalUrl=(e=>!e?.startsWith(an()||""))(e||""),p.fetchTimeStamp=Date.now(),e&&Nu(e,ju)&&Lu.getUpdateSessionStatus()||!Lu.getUpdateSessionStatus()||p.isExternalUrl){Nu(e,ju)&&"OAuth2.0"===ju?.authType&&(m={...g});const{restApi:t}=bA.doesRestApiExist("Logout")&&bA.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&Uu.setTimerID(Uu.resetInactiveTimeout(Uu.getTimerID())),function(e,t){var n="object"==typeof t;return new Promise((function(r,a){var s,o=!1;e.subscribe({next:function(e){s=e,o=!0},error:a,complete:function(){o?r(s):n?r(t.defaultValue):a(new vl)}})}))}(wd(Ol({context:n,...p,url:e,data:i,...c&&void 0===c.aborted&&{cancelToken:c},...c&&void 0!==c.aborted&&{signal:c},responseType:l,adapter:d,headers:m,withCredentials:Gu(ju)})).pipe((A=Bl(y=()=>{const e=xu.getCoreHeadersFromContext(m.context);var t;e&&(t={...e},gu.publish(Fr.PUB_SUB_EVENTS.FETCH_SUCCESS,t))})||E||I?{next:y,error:E,complete:I}:y)?Pd((function(e,t){var n;null===(n=A.subscribe)||void 0===n||n.call(A);var r=!0;e.subscribe(Od(t,(function(e){var n;null===(n=A.next)||void 0===n||n.call(A,e),t.next(e)}),(function(){var e;r=!1,null===(e=A.complete)||void 0===e||e.call(A),t.complete()}),(function(e){var n;r=!1,null===(n=A.error)||void 0===n||n.call(A,e),t.error(e)}),(function(){var e,t;r&&(null===(e=A.unsubscribe)||void 0===e||e.call(A)),null===(t=A.finalize)||void 0===t||t.call(A)})))})):hd,Md((e=>{const t=m,n=!!t?.[Fr.COREHEADER_APP_DEBUG_ID]?{debugInfo:{[Fr.COREHEADER_APP_DEBUG_ID]:t?.[Fr.COREHEADER_APP_DEBUG_ID],[Fr.COREHEADER_APP_DEBUG_LEVELS]:yu.getDebugLevels()}}:xu.getCoreHeadersFromContext(m.context);var r;throw n&&(r={...n,error:e},gu.publish(Fr.PUB_SUB_EVENTS.FETCH_FAILURE,r)),e}))))}var y,E,I,A;return Hu(e,t,n,Lu)},Hu=(e,t,n,r)=>new Promise(((a,s)=>{gu.subscribe(wu,(o=>{r.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?Wu(e,t,n).then((e=>a(e))).catch((e=>s(e))):s(o.updateStatus.error)}),wu)})),qu=e=>{Mu[e]>0&&(Mu[e]-=1,0===Mu[e]&&delete Mu[e])};Ol.interceptors.request.use((e=>mu.isOnline()?(Fu?.request&&(e=Fu.request(e)),e):(BC(e.context)?.isLoading&&VC({type:ia,payload:{context:e.context}}),VC({type:ca,payload:{context:"app"}}),Promise.reject(new Error("Network Offline")))),(e=>Promise.reject(e))),Ol.interceptors.response.use((e=>{if(202===e.status&&e.config.headers.context&&e.data?.caseInfo&&"object"==typeof e.data.caseInfo&&"errorMessage"in e.data.caseInfo){const t=[{type:"error",message:String(e.data.caseInfo.errorMessage)}];let n=e.config.headers.context;return n&&n.includes("/workarea")&&(n=n.substring(0,n.lastIndexOf("/workarea"))),iu({messages:t,category:"HTTP",context:n}),Promise.reject(e)}if(e.config.headers&&e.config.headers.context){if(!e.config.skipClearErrorMessages){su({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&ou({type:"error",category:"HTTP",context:e.config.headers.context}),su({type:"error",category:e.config.headers.context===Fr.APP.APP?"PAGE":"",context:e.config.headers.context}).length>0&&ou({type:"error",category:"PAGE",context:e.config.headers.context});e.config.headers.context.slice(e.config.headers.context.lastIndexOf("/")+1).startsWith("primary")&&(su({type:"error",category:"HTTP",context:Fr.APP.APP}).length>0&&ou({type:"error",category:"HTTP",context:Fr.APP.APP}),su({type:"error",category:"PAGE",context:Fr.APP.APP}).length>0&&ou({type:"error",category:"PAGE",context:Fr.APP.APP}))}qu(e.config.headers.context)}return Fu?.response&&(e=Fu.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&qu(e.config.headers.context),Fu?.error?Promise.resolve(Fu.error(e)).then((t=>((e,t)=>{if("boolean"==typeof t)return t?Bu(e):Promise.reject(e);if((n=t)&&"object"==typeof n&&("continueWithDefaultErrorHandler"in n||"error"in n)){const n=t.error??e;return t.continueWithDefaultErrorHandler??1?Bu((e=>!(!e||"object"!=typeof e)&&"isAxiosError"in e&&"config"in e)(n)?n:e):Promise.reject(n)}var n;return Bu(e)})(e,t))):Bu(e))));const Yu=()=>Ol.CancelToken.source(),zu=e=>Ol.isCancel(e),Ku=e=>{xu.setDefaultHeaders(e)},Qu=e=>{ju={...ju,...e}},Ju=e=>{ku={...ku,...e}},Xu=()=>({...ku}),Zu=()=>({...ju});const ep=class{static formatPageReference(e){const t=e?.split(".").map((e=>{if(e.includes("[")){const t=e.indexOf("["),n=e.indexOf("]"),r=e.substring(t+1,n),a=Number(r)+1;return`${e.substring(0,t)}(${a})${e.substring(n+1)}`}return e}));return t.join(".")}static formatePageReferenceToArrayIndex(e){const t=e?.split(".").map((e=>{if(e.includes("(")){const t=e.indexOf("("),n=e.indexOf(")"),r=e.substring(t+1,n),a=Number(r);if(!Number.isNaN(a)){const r=a-1;return`${e.substring(0,t)}[${r}]${e.substring(n+1)}`}}return e}));return t.join(".")}static getFieldLabel(e){let t=e?.label;if(!t&&e?.inheritedProps){const n=e?.inheritedProps;(n.showLabel??1)&&(t=n.label)}return t}};const tp=class{static execute(e,t,n,r){const a=!PA.isInfinityRuntime(),s={};Object.hasOwn(n,"nonFormProperties")&&(n.nonFormProperties.forEach((e=>{s[e]=n[e],delete n[e]})),delete n.nonFormProperties);const o={instruction:"string"==typeof t?"ADD":"INSERT",content:{...aS.unflatten(n)}},i=JSON.parse(JSON.stringify(o)),c=i.content.classID||i.content["@class"];delete i.content.classID;return{instruction:{target:aS.buildInstructionPageReference(r,e),content:{...a&&c?{"@class":c}:{},...i.content},["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"string"==typeof t?"ADD":"INSERT"},actionPayload:o,displayPropertPayload:s}}};const np=class{static execute(e,t,n,r,a,s,o,i){const c=!PA.isInfinityRuntime(),l="string"==typeof n?`${t}(${n})`:`${t}[${n-1}]`,d=HC(".classID",`${a}${l}`,e)||HC(".@class",`${a}${l}`,e),u={instruction:"UPDATE",content:{...aS.unflatten(r)},isDefault:i},p={content:{...c&&d?{"@class":d}:{},...u.content},target:aS.buildInstructionPageReference(a,t),["string"==typeof n?"groupIndex":"listIndex"]:n,instruction:"UPDATE"};return s||VC(qS({...u,["string"==typeof n?"groupIndex":"listIndex"]:"string"==typeof n?n:n-1,context:e,referenceList:`${a}${t}`,skipDirtyValidation:o})),p}};const rp=class{static execute(e,t,n){return{target:aS.buildInstructionPageReference(n,e),["string"==typeof t?"groupIndex":"listIndex"]:t,instruction:"DELETE"}}};const ap=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:aS.buildInstructionPageReference(e,t)}}static execute(e,t,n,r){r||VC(qS({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const sp=class{static execute(e,t,n,r){return{target:aS.buildInstructionPageReference(r,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const op=class{static execute(e,t,n){const r=!PA.isInfinityRuntime(),a={instruction:"REPLACE",content:{...aS.unflatten(t)}},s=a.content.classID||a.content["@class"];delete a.content.classID;return{instruction:{target:aS.buildInstructionPageReference(n,e),content:{...r&&s?{"@class":s}:{},...a.content},instruction:"REPLACE"},actionPayload:a}}};const ip=class{static execute(e,t){return{target:aS.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const cp=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const lp=class{constructor(e,t,n){this.target=e,this.pageReference=t,this.contextName=n,this.root=null,this.current=null,this.changeList={},this.hasEncryptedContent=!1,this.targetPageReference=t+e,this.children=[],this.visibility=!0}addChild(e){null===this.current&&this.insertNode({}),this.current.childrenStateMachines.push(e)}insertNode(e){const t=new cp(e);null===this.root&&(this.root=t),null!==this.current&&(t.previous=this.current,this.current.next=t),this.current=t}applyEncryptedContent(e){void 0!==e&&(this.current.instruction.encryptedContent=e)}buildChildSumbitPageInstructions(e,t){let n=[];return e.childrenStateMachines.forEach((e=>{e.visibility&&(n=n.concat(e.buildSubmitPageInstructions(t)))})),n}buildSubmitPageInstructions(e=!1){let t=this.root,n=[];for(;t;)!t.instruction.instruction||e&&t.automatic||n.push(t.instruction),n=[...n,...this.buildChildSumbitPageInstructions(t,e)],t=t.next;return n}initPageInstructions(e,t,n){const r=e.getValue(this.target)||[];if(Array.isArray(r)){if(t)return void r.forEach(((e,r)=>{t.forEach((t=>{const a=xy(t),s={};let o=!0;n&&(s[xy(n)]=crypto.randomUUID(),o=!1);const i={[a]:aS.getIn(e,a),...s};this.update(i,r+1,o,{isDefault:!0,skipDirtyValidation:!0})}))}));r.forEach(((e,t)=>{if(n&&!e[xy(n)]){const e={};e[xy(n)]=crypto.randomUUID(),this.update(e,t+1,!1,{isDefault:!0,skipDirtyValidation:!0})}}))}t&&r&&"object"==typeof r&&!Array.isArray(r)&&Object.keys(r).length>0&&this.processObjectRows(r,t,n)}processObjectRows(e,t,n){Object.keys(e).forEach((r=>{const a=e[r];t.forEach((e=>{const t=xy(e),s={};let o=!0;n&&(s[xy(n)]=crypto.randomUUID(),o=!1);const i={[`${t}`]:aS.getIn(a,t),...s};this.update(i,r,o,{isDefault:!0})}))}))}getChangeList(){return this.changeList}initChangeList(e){this.changeList[this.targetPageReference]=this.changeList[this.targetPageReference]||[],this.changeList[this.targetPageReference][e]=this.changeList[this.targetPageReference][e]||{}}update(e,t,n,r){const{isDefault:a=!1,skipPageinstruction:s,skipDirtyValidation:o=!1,encryptedContent:i}=r,c=np.execute(this.contextName,this.target,t,e,this.pageReference,n,o,a);if(!s){if("string"==typeof t?this.initChangeList(t):this.initChangeList(t-1),!a){const n=this.changeList?.[this.targetPageReference]?.["string"==typeof t?t:t-1].content;this.changeList[this.targetPageReference]["string"==typeof t?t:t-1]=XC(aS.deepClone(n),e,r)}if(this.current?.automatic===a&&(this.current?.instruction?.groupIndex===t||this.current?.instruction?.listIndex===t)&&"UPDATE"===this.current?.instruction.instruction){const t=this.current.instruction.content;return this.current.instruction.content=XC(aS.deepClone(t),aS.unflatten(e),r),void this.applyEncryptedContent(i)}this.insertNode(c),this.applyEncryptedContent(i),a&&(this.current.automatic=!0)}}delete(e,t){const n=rp.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||VC(qS({instruction:"DELETE",listIndex:"string"==typeof e?e:e-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}insert(e,t,n,r){const{instruction:a,actionPayload:s={content:{}},displayPropertPayload:o={}}=tp.execute(this.target,t,e,this.pageReference),{isDefault:i=!1,encryptedContent:c,skipDirtyValidation:l=!1}=r;if(this.initChangeList("string"==typeof t?t:t-1),!i){const n=this.changeList?.[this.targetPageReference]?.["string"==typeof t?t:t-1].content;this.changeList[this.targetPageReference]["string"==typeof t?t:t-1]=XC(aS.deepClone(n),e,r)}this.root&&!this.root.instruction?.instruction&&this.current&&!this.current.instruction?.instruction?this.root.instruction=a:this.insertNode(a),this.applyEncryptedContent(c),n||(s.content={...s.content,...o},VC(qS({...s,["string"==typeof t?"groupIndex":"listIndex"]:"string"==typeof t?t:t-1,c11nEnv:r.c11nEnv,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,skipDirtyValidation:l}))),i&&(this.current.automatic=!0)}replacePage(e,t,n,r,a){const s=r??this.pageReference,o=n??this.target,{instruction:i,actionPayload:c}=op.execute(o,e,s);this.insertNode(i),this.applyEncryptedContent(a),t||VC(qS({...c,context:this.contextName,referenceList:`${s}${aS.convertClipboardPageToPageRefNotation(o)}`}))}deletePage(e){const t=ip.execute(this.target,this.pageReference);this.insertNode(t),e||VC(qS({instruction:"DELETEPAGE",context:this.contextName,referenceList:`${this.pageReference}${this.target}`}))}move(e,t){const n=this.changeList[this.targetPageReference]?.splice(e-1,1);this.changeList[this.targetPageReference]?.splice(t-1,0,n[0]);const r=sp.execute(this.target,e,t,this.pageReference);this.insertNode(r),VC(qS({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=ap.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),ap.execute(this.contextName,this.target,this.pageReference,e)}updatePage(e){if(!this.current?.instruction||!e)return;const t=this.current.instruction.content||{};this.current.instruction.content=XC(aS.deepClone(t),e)}},dp={},up={},pp={},hp=(e,t,n)=>{dp[e]||(dp[e]={}),dp[e][t]||(dp[e][t]={content:[]}),up[e]||(up[e]=[],pp[e]=[]),Ry.isStateMachineExist(e,n,t)||Ry.setStateMachine(e,t,n,new lp(t,n,e))},fp=e=>ep.formatPageReference(e),gp=(e,t)=>{const n=up[e],r=pp[e],a=xy(t),s=a?.substring(0,a.indexOf("["));r?.indexOf(s)<0&&pp[e].push(s),n?.indexOf(a)<0&&up[e].push(a)},mp=e=>{delete up[e]},yp=e=>Ry.buildPageInstructionsByContext(e),Ep=e=>{Ry.clearStateMachines(e),delete dp[e]},Ip=(e,t,n,r)=>{let[,a]=t.split(`${e}[${r}]`);""!==a&&void 0!==a&&(a=a.startsWith(".")?a.substring(1):a,Object.keys(n).forEach((e=>{n[`${a}.${e}`]=n[e],delete n[e]})))},Ap=(e,t,n,r,a)=>{const{skipStateUpdate:s=!1,insertIfEmpty:o=!1,skipDirtyValidation:i=!1}=a||{},c=n.getContextName(),l=n.getReferenceList(),d=r||n.getPageReference(),u=fp(l);hp(c,u,d),gp(c,`${l}[${t}]`),Ip(l,d,e,t);const p={instruction:Fr.LIST_ACTIONS.INSERT,content:{...aS.unflatten(e)}};delete JSON.parse(JSON.stringify(p)).content.classID;const h=Ry.getStateMachine(c,d,u);o&&h?.root||h.insert(e,t+1,s,{c11nEnv:n,skipDirtyValidation:i})},Cp=(e,t,n=0,r={})=>{const{skipStateUpdate:a=!0,pageRef:s}=r,o=t.getContextName();let i=t.getReferenceList();const c=s||t.getPageReference();i||(i=((e,t)=>{const n=e.indexOf(Ur.CONTENT)+Ur.CONTENT.length,r=e.lastIndexOf(`[${t}]`);return e.substring(n,r)})(c,n));const l=fp(i);hp(o,l,c),gp(o,`${i}[${n}]`),Ip(i,c,e,n);Ry.getStateMachine(o,c,l).update(e,n+1,a,r)},Sp=(e,t)=>{const[,n]=e.split("."),r=t?.split(".").pop();return n===r},_p=e=>{const t=aS.getPropertyName(e),n=t.indexOf(".");return n>=0?t.slice(n+1):t},Np=(e,t,n)=>{const r={};return Object.values(e).forEach((e=>{if(Sp(e,n)){const n=_p(e).split(".");if(n.length>1){let e=aS.getIn(t,n)??"";if(!e){const r=`!P!${n.join(":")}`;e=aS.getIn(t,r)??""}aS.setIn(r,n,e)}else{const e=aS.getIn(t,n)??"";r[n[n.length-1]]=e}}})),r},bp=(e,t,n,r,a)=>{const s=e.getValue(t)||{};n&&Object.keys(s).length>0&&e.clearErrorMessages({property:r?a:e.getStateProps().value})},Tp=(e,t,n)=>new Promise((r=>{const{skipPageInstructions:a=!1}=n,{selectionMode:s,selectionList:o,required:i}=t.getConfigProps(),c=s===Fr.LIST_SELECTION_MODE.MULTI,l=t.getContextName();let d=t.getPageReference(),u=((e,t,n)=>e?n.substring(1):t.substring(t.lastIndexOf(".")+1))(c,d,o);const p=t.getRawMetadata();let h=null;const f=(e=>e?.config?.dataRelationshipContext&&"SimpleTableSelect"===e.type&&"single"===e.config?.selectionMode)(p);f&&(u=p?.config?.dataRelationshipContext,h=d.concat(".").concat(u),d=h);const g=((e,t,n)=>e?`${t}${n}`:t)(c,d,o),m=((e,t,n,r)=>t?e.getFieldMetadata(`${n}`):e.getCurrentPageFieldMetadata(r))(t,c,u,h),{datasource:{parameters:y={}}}=m,E={...y};if(((e,t,n)=>{t?.descriptors?.length&&!n&&t.descriptors.forEach((t=>{e[_p(t)]=t}))})(E,m,c),c){let n=o;n=fp(n);const r=t.getValue(g)||[];hp(t.getContextName(),n,d);const s=[];let i=r.length;e.forEach((e=>{const t=Np(y,e,u),o={};if(Object.hasOwn(e,"displayProperty")){const t=e.displayProperty;o[t]=e[t]}const c=Object.entries(t);let p=r.findIndex((e=>c.every((([t,n])=>e[t]===n))));if(-1===p?(p=i,e.$selected&&(i+=1)):i=i?i-1:0,!a){const r=Ry.getStateMachine(l,d,n);e.$selected?r.insert(t,p+1,!0,{}):r.delete(p+1,!0)}s.push({instruction:e.$selected?Fr.LIST_ACTIONS.SELECT:Fr.LIST_ACTIONS.DESELECT,listIndex:p,content:{...t,...o}})})),VC(qS({instruction:Fr.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${d}.${u}`,actions:s}))}else{const n=Np(E,e[0],u),r=((e,t)=>{const{selectionKey:n,renderMode:r,referenceList:a,value:s}=e.getRawConfigProps()??{};let o=s;if(n?o=n:"Editable"===r&&(o=a),!o||"string"!=typeof o)return;const i=xy(aS.getPropertyName(o));return i.trim()?i.startsWith(`${t}.`)?`.${i.substring(t.length+1)}`:`.${i}`:void 0})(t,u),a={...f?{contextPageReference:d}:{},...r?{associatedProperty:r}:{}},s=p?.config?.compositeKeys||[];if(t.getRawConfigProps().onlyAllowRefreshOnCompositeKeys&&s.length){const r=s?.reduce(((e,t)=>(e[_p(t)]=t,e)),{})||{},o=Np(r,e[0],u);Object.keys(o).forEach((e=>{delete n[e],t.getActionsApi().updateFieldValue(`.${e}`,o[e],a),t.getActionsApi().triggerFieldChange(`.${u}.${e}`,o[e])}));const i=(e=>e.length>1&&e.pop()||"")(d.split(/\[\d+\]/gm));t.getActionsApi().updateFieldValue(i,n,a),t.getActionsApi().triggerFieldChange(i,n)}else Object.keys(n).forEach((e=>{t.getActionsApi().updateFieldValue(`.${e}`,n[e],a),t.getActionsApi().triggerFieldChange(`.${u}.${e}`,n[e])}))}bp(t,g,i,c,u),r()})),Pp=e=>{if(!e)return!1;const t=(n=e,Ry.buildPageInstructionsByContext(n,!0));var n;return Array.isArray(t)&&t.length>0};const Op=(e,t,n={})=>{const{skipStateUpdate:r=!1}=n,a=e.getPageReference(),s=fp(t);hp(e.getContextName(),t,a);Ry.getStateMachine(e.getContextName(),a,s).deleteAll(r);const o=Ry.getUnConnectedStateMachines(e.getContextName())||{};Object.keys(o).forEach((e=>{e.includes(`${a}${s}`)&&e!==`${a}${s}`&&(o[e]=null)}))},Dp=e=>({insert:(t,n,r,a)=>Ap(t,n,e,r,a),update:(t,n,r)=>Cp(t,e,n,r),updateProperty:(t,n,r)=>((e,t,n,r={})=>{const a=n.getPageReference(),{stateMachineTarget:s}=Ry.getStateMachineObjByPath(`${a}${e}`,n.getContextName(),`${a}${e}`.endsWith("]"));if(!s){let e=a.substring(0,a.lastIndexOf("["));e||(e=a.substring(0,a.lastIndexOf(".")));const t=e.substring(e.lastIndexOf("."));e=e.substring(0,e.lastIndexOf(".")),e&&t&&hp(n.getContextName(),t,e)}Ry.executeStateMachine(n.getContextName(),`${a}${e}`,t,!0,r)})(t,n,e,r),deleteEntry:(t,n,r)=>((e,t,n,r)=>{const{skipStateUpdate:a=!1}=r||{},s=t.getContextName(),o=t.getReferenceList(),i=n||t.getPageReference(),c=`${i+o}[${e}]`,l=fp(o);ou({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:c,context:s,isListEntry:!0,deletingIndex:e}),hp(s,l,i),gp(s,`${o}[${e}]`);const d=Ry.getStateMachine(s,i,l);"string"==typeof e?d.delete(e,a):d.delete(e+1,a);const u=Ry.getUnConnectedStateMachines(s)||{};Object.keys(u).forEach((e=>{e.includes(`${i}${l}`)&&e!==`${i}${l}`&&(u[e]=null)}))})(t,e,n,r),reorder:(t,n)=>((e,t,n)=>{const r=n.getContextName(),a=n.getReferenceList(),s=n.getPageReference(),o=fp(a);hp(r,o,s),Zd.deleteAllListNodes(r,`${s}${o}`,!1),gp(r,`${a}[${t}]`),Ry.getStateMachine(r,s,o).move(e+1,t+1);const i=Ry.getUnConnectedStateMachines(r)||{};Object.keys(i)?.forEach((e=>{e.includes(`${s}${o}`)&&e!==`${s}${o}`&&delete i[e]}))})(t,n,e),setSelectedRows:(t,n={skipPageInstructions:!1})=>Tp(t,e,n),getSelectedRows:(t=!1)=>((e,t)=>{const{selectionMode:n,selectionList:r}=t.getConfigProps(),a=[];let s=t.getPageReference();const o=n===Fr.LIST_SELECTION_MODE.MULTI;let i=o?r.substring(1):s.substring(s.lastIndexOf(".")+1);const c=t.getRawMetadata();let l=null;c?.config?.dataRelationshipContext&&"SimpleTableSelect"===c.type&&"single"===c.config?.selectionMode&&(i=c.config.dataRelationshipContext,l=s.concat(".").concat(i),s=l);const d=o?`${s}${r}`:s;let u=t.getValue(d)||[];if(Array.isArray(u)||(u=[u]),e)return Promise.resolve(u);const{datasource:{parameters:p={}}={}}=o?t.getFieldMetadata(`${i}`):t.getCurrentPageFieldMetadata(l);return u.forEach((e=>{const t=Object.values(p).reduce(((t,n)=>{const r=n.substring(n.lastIndexOf(".")+1);return Sp(n,i)&&e[r]?`${t}${e[r]}`:t}),"");t.trim()&&a.push(t.trim())})),Promise.resolve(a)})(t,e),clearSelectedRows:()=>function(e){const{selectionList:t,required:n}=e.getConfigProps(),r=e.getContextName(),a=e.getPageReference(),s=t,o=`${a}${t}`;return new Promise((t=>{let i=s;i=fp(i),hp(r,i,a),Ry.getStateMachine(r,a,i).deleteAll(),bp(e,o,n,!0,s),t()}))}(e),setVisibility:t=>((e,t=!0)=>{const n=e.getContextName(),{selectionMode:r,selectionList:a,renderMode:s,referenceList:o}=e.getComponentConfig();let i;if(r===Fr.LIST_SELECTION_MODE.MULTI&&a?i=a:"Editable"===s&&o&&(i=e.getStateProps().referenceList),i){i=fp(i);const r=Ry.getStateMachine(n,"",`${e.getPageReference()}${i}`);r&&(r.visibility=t)}})(e,t),initDefaultPageInstructions:(t,n,r)=>((e,t,n,r)=>{const a=e.getContextName(),s=e.getPageReference(),o=fp(t);hp(a,o,s),Ry.getStateMachine(a,s,o).initPageInstructions(e,n,r)})(e,t,n,r),deleteAll:(t,n)=>Op(e,t,n),replacePage:(t,n,r)=>((e,t,n,r)=>{const{skipStateUpdate:a=!1}=r||{},s=e.getPageReference(),o=e.getContextName();hp(o,t,s),gp(o,aS.buildInstructionPageReference(s,t)),Ry.getStateMachine(o,s,t).replacePage(n,a)})(e,t,n,r),deletePage:(t,n)=>((e,t,n)=>{const{skipStateUpdate:r=!1}=n||{},a=e.getPageReference(),s=e.getContextName();hp(s,t,a),gp(s,aS.buildInstructionPageReference(a,t)),Ry.getStateMachine(s,a,t).deletePage(r)})(e,t,n)});const vp=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?aS.mergeDeep(e,this.fieldDefaults):aS.copy(e,this.fieldDefaults))}setFieldDefault(e,t,n){e&&t&&(this.fieldDefaults[e]=this.fieldDefaults[e]||{},"object"==typeof this.fieldDefaults[e]&&null!==this.fieldDefaults[e]&&(this.fieldDefaults[e][t]=n))}getDefaultsforType(e){return this.fieldDefaults[e]}},Rp="downloadAttachment",$p={};function xp(e,t){const n=Mr.getDefaultQualifiedName(t);return n!==t&&n in e?e[n]:e[t]}const wp=e=>{const t=Yu();return $p[e]=t,t};function Mp(e){const t=new URL(e,window.location.origin),n=PA.environmentInfoObject?.encCSRFToken;return n&&t.searchParams.set("pzencv1zzz",n),t.searchParams.set("mode","stream"),t.toString()}async function Lp(e){const t=function(){if("undefined"!=typeof window&&"showSaveFilePicker"in window)return window.showSaveFilePicker}();if(!t)return null;try{const n=await t({suggestedName:e}),r=await n.createWritable();return{fh:n,writable:r}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return null;throw e}}async function Up(e,t,n){const r=await Lp(t);if(r)try{const t=await async function(e,t){let n;await Wu(e,{method:"GET",adapter:async e=>(n=e,{data:null,status:204,statusText:"No Content",headers:{},config:e}),withoutDefaultHeaders:!1},t,{includeRemoteSystemIdIfPresent:!0});const r={};return Object.entries(n?.headers??{}).forEach((([e,t])=>{"string"==typeof t&&(r[e]=t)})),r}(e,n),a=await fetch(e,{method:"GET",headers:t});if(!a.ok)throw new Error(`Download failed: ${a.status}`);if(!a.body)throw new Error("Download response has no body");await a.body.pipeTo(r.writable)}catch(e){throw await r.writable.abort().catch((()=>{})),e}}const Fp=e=>{let t="document-doc";if(!e)return t;if(e.startsWith("audio"))t="audio";else if(e.startsWith("video"))t="video";else if(e.startsWith("image"))t="picture";else if(e.includes("pdf"))t="document-pdf";else{const[,n]=e.split("/"),r=e=>e.some((e=>n.includes(e)));r(["excel","spreadsheet"])?t="document-xls":r(["zip","compressed","gzip","rar","tar"])&&(t="document-compress")}return t},jp=e=>{const t=xp(e,"pyCategoryLabel"),n=xp(e,"pyCategoryName"),r=xp(e,"Category"),a=xp(e,"pxCreateOpName"),s=xp(e,"pxCreateOperator"),o=e.CreateUser,i=xp(e,"pyFileName"),c=xp(e,"FileName"),l=xp(e,"FileExtension"),d=xp(e,"pyAttachName"),u=xp(e,"pyMimeFileExtension"),p=xp(e,"MimeType"),h=xp(e,"pzInsKey"),f=xp(e,"ID"),g=xp(e,"pyAttachmentLink"),m=xp(e,"AttachmentURL"),y=xp(e,"pxAttachmentCreateTime"),E=xp(e,"pxCreateDateTime"),I=xp(e,"CreateDateTime"),A=xp(e,"pxStorageType"),C=xp(e,"pyFileSize"),S=xp(e,"error"),_=xp(e,"thumbnail"),N=xp(e,"pyIsLargeAttachment"),b=xp(e,"IsLargeAttachment");let T,P,O,D;return T=t?`${t},`:n?`${n},`:r,P=a||(s||o?.Name||""),O=i||(l&&""!==l&&c?.endsWith(l)?c.substring(0,c.lastIndexOf(l)-1):c),D=d&&i?d.startsWith(i)&&d.split(".").length-1===i.split(".").length?d.split(".").pop():"":l??"",{props:{meta:`${T} ${P}`,name:d??c??"",icon:Fp(u??p??""),error:S??null,thumbnail:_??null},responseProps:{fileName:d??c??"",name:O??"",category:n??r??"",extension:D,ID:h??f??"",mimeType:u??p??"",attachmentURL:g??m??"",createUser:P??"",createDateTime:y??E??I??"",responseType:e.responseType??(f?"binary":null),localAttachment:!!e.localAttachment,storageType:A??void 0,fileSize:C??void 0,isLargeAttachment:void 0!==N?"true"===N:b}}},kp=e=>{let t=[],n=!1;if(e&&Object.hasOwn(e,Mr.getDefaultQualifiedName("pyCount"))){n=!0;const r=xp(e,"pxResults");t=Array.isArray(r)?r.filter((e=>!!xp(e,"pzInsKey"))).map((e=>jp(e))):[]}else if(e&&"object"==typeof e){let n;n=Array.isArray(e)?e:[e],t=n?.filter((e=>xp(e,"ID")&&xp(e,"FileName")||xp(e,"pzInsKey"))).map(jp)}else t=[];const r=e?xp(e,"pyCategoryName"):void 0;return{hasUploadedFiles:t.length>0,categoryName:("string"==typeof r?r:"")||t?.[0]?.responseProps?.category||"",attachments:t,isOldAttachment:n}},Vp={uploadAttachment:(e,t,n,r,a,s)=>{const o=new FormData;o.append("appendUniqueIdToFileName","true"),o.append("file",e),a&&o.append("contextID",a),s&&o.append("category",s);const{restApi:i,reqType:c}=i_("uploadAttachment",{}),l={"Content-Type":"multipart/form-data"};return Boolean(PA?.environmentInfoObject?.pyFeatures?.pyEnableStreamingForRepositories)&&(l["x-pega-stream-support"]="repository-stream"),Wu(i,{method:c,headers:l,body:o,onUploadProgress:t,signal:wp(e.ID).token},r).then((t=>({type:"File",category:e.category||"File",ID:t.data.ID,clientFileID:e.ID,filename:e.name}))).catch(n?n(zu,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete $p[e.ID]))},linkAttachmentsToCase:(e,t,n,r)=>{const a={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,n&&(a.signal=wp(n).token)}const{restApi:s,reqType:o}=i_("linkCaseAttachment",{caseID:e});return Wu(s,{...a,body:{attachments:t},method:o},r)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:r,reqType:a}=i_("getCaseAttachments",{caseID:e,includeThumbnail:n});return Wu(r,{method:a},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:r,reqType:a}=i_("getAttachmentCategories",{caseID:e,type:t});return Wu(r,{method:a},n).then((e=>e.data))},downloadAttachment:(e,t,n,r,a)=>{e=e.replace(/\//g,"_");const{restApi:s,reqType:o}=i_(Rp,{attachmentID:e}),i=a&&s?(()=>{const e=new URL(s,window.location.origin);return e.searchParams.set("encoding",a),e.toString()})():s;return function(e){const t=PA.environmentInfoObject;return!(!t?.pyFeatures?.pyEnableStreamingForRepositories||"repository"!==e?.toLowerCase()||"EMBED"===t?.renderingMode&&!PA.isPegaMobile())}(r)&&s?async function(e){return await Tu(Zu()),{data:Mp(e)}}(s):Wu(i,{method:o,..."binary"===n&&!a&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:r,reqType:a}=i_("editAttachment",{attachmentID:e});return Wu(r,{method:a,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:r}=i_("deleteAttachment",{attachmentID:e});return Wu(n,{method:r},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:r}=i_("downloadDocument",{documentID:e});return Wu(n,{method:r},t)},deleteDocument:(e,t,n)=>{const{restApi:r,reqType:a}=i_("deleteDocument",{caseID:e,documentID:t});return Wu(r,{method:a},n)},getDocumentURL:e=>{const t=PCore.getEnvironmentInfo().getDocumentUrlDP()||Mr.getDefaultQualifiedName("D_pxGetDocumentURL");return PCore.getDataPageUtils().getPageDataAsync(t,e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getDocumentURL API : ",t.response)}))},cancelRequest:e=>{$p[e]&&($p[e].cancel(),delete $p[e])},buildFilePropsFromResponse:jp,getAttachmentURL:e=>{const{restApi:t}=i_(Rp,{attachmentID:e});return t},prepareAttachmentData:kp,validateAttachments:(e,t)=>{let n=e;if((e=>null!==e&&"object"==typeof e&&"hasUploadedFiles"in e&&"boolean"==typeof e.hasUploadedFiles)(t)){const{attachments:e}=t;0===e.length&&(n="")}else{const{attachments:e}=kp(t);0===e.length&&(n="")}return n},streamDownloadAttachment:async(e,t,n)=>{if(!PA.environmentInfoObject?.pyFeatures?.pyEnableStreamingForRepositories)return;e=e.replace(/\//g,"_");const{restApi:r}=i_(Rp,{attachmentID:e});r&&(await Tu(Zu()),await Up(Mp(r),t,n))}};let Bp=!1;const Gp=e=>{Bp=e},Wp=new Map,Hp=(e,t)=>{Wp.set(e,t)},qp=e=>{Wp.delete(e)};class Yp{constructor(){this.validators={}}static messageDispatcher(e,t,n,r,a,s){if(r){const o=[];o.push({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,fieldLabel:a,message:r,...s??{}}),iu({messages:o,property:e,pageReference:t,context:n})}}register(e,t){this.validators[e]=t}getValidator(e){return this.validators[e]}validateRequired(e,t,n,r,a,s){const{required:o,value:i}=s;let c=null;if(!("true"!==o&&!0!==o)){let o=r;switch(e){case"radiobuttons":o=i;break;case"attachment":o=Vp.validateAttachments(r,i);break;case"checkbox":o&&"false"!==o||(o="");break;default:"string"==typeof o&&(o=o.trim())}c=this.getValidator("required")(o),Yp.messageDispatcher(t,n,a,c,ep.getFieldLabel(s),{subType:"required"})}return c}validateType(e,t,n,r,a,s){let o=null;const i={pageReference:n,context:a,property:t,...s};let c=vp.getDefaultsforType(s?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(o=this.getValidator(e)(r,i),(""!==r||vp.getDefaultsforType(s?.componentName||"")?.showErrorWhenEmpty)&&Yp.messageDispatcher(t,n,a,o,s?.label));const l=s?.validationType;return c=l&&vp.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(o=this.getValidator(l)(r,i),Yp.messageDispatcher(t,n,a,o,s?.label)),o}validate(e,t,n,r={}){const{context:a,disabled:s,readOnly:o,pageReference:i,skipRequiredValidation:c}=r;let l=null;return s||o||(c||Bp||(l=this.validateRequired(e,t,i,n,a,r)),l||(l=this.validateType(e,t,i,n,a,r))),{message:l}}isValidatorExist(e){return!!e.validatetype}}const zp=new Yp,Kp=e=>{e&&gC(e)},Qp=(e,t)=>{e.DeclareExpressions&&t.context&&Eo({[t.context]:e.DeclareExpressions})},Jp=(e,t,n=!1)=>{const r=aS.getIn(e,Fr.RESOURCES);r&&(Kp(r),Qp(r,t)),n||g_({...e,options:t})};class Xp{static createCase(e,t){const{caseInfo:n,startingFields:r,flowType:a,viewType:s=ty.PAGE,pageName:o,context:i=Fr.APP.APP,debugInfo:c,headers:l,theType:d,retrieveActionViewForNewObject:u=!1}=t;let p={};n&&n.content&&(p=n.content);const{content:h={},pageInstructions:f}=Xp.getExternalCaseOrObjectContent(e,u,i);let g={[Xp.getKeyBasedOnWorkType(e)]:e,content:{...p,...r,...h}};if(g={...g,...f&&{pageInstructions:f},...!zy.isObjectCaseType(e)&&{processID:a}},"CREATE_EXTERNAL_CASE"===d){const e=BC(i)?.caseInfo?.content;if(e){const t=aS.pruneKeys(e,new Set(["pxObjClass",Mr.getDefaultQualifiedName("pxObjClass"),"EmbedListUUID__",Mr.getDefaultQualifiedName("EmbedListUUID__")]),!1);g.content[Fr.getDefaultQualifiedName("pyAddCaseContextPage")]=t}}const m=Xp.getObjectTypeViewPayload(u,e);return th(zy.getRouteKeyForCreateWork(e,u),{body:g,queryPayload:{...m,...zy.isExternalCaseType(e)?{casetypeID:e}:{caseClassName:e},viewType:s,params:{pageName:o}},headers:{...l,...c&&{...xu.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:g,headers:ry(t.headers,e,l)})))}static getObjectTypeViewPayload=(e,t)=>e?zy.shouldUseUnifiedHandling()?{casetypeID:t,actionID:Fr.getDefaultQualifiedName(Fr.VIEW_NAMES.OBJECT_CREATE_VIEW)}:{objectTypeID:t,actionID:Fr.getDefaultQualifiedName(Fr.VIEW_NAMES.OBJECT_CREATE_VIEW)}:{};static getExternalCaseOrObjectContent=(e,t,n)=>{const r=zy.isExternalObject(e),a=zy.isExternalCaseType(e);if((a||r)&&!t){const e=ay(n,{isExternalObject:Boolean(!a&&r)}),{content:t,pageInstructions:s}=e.content;return{content:t,pageInstructions:s}}return{}};static getKeyBasedOnWorkType=e=>zy.shouldUseUnifiedHandling()?"caseTypeID":zy.isObjectCaseType(e)?"objectTypeID":"caseTypeID"}const Zp=Xp,eh=()=>({registerHeader:(...e)=>xu.registerHeader(...e),unRegisterHeader:(...e)=>xu.unRegisterHeader(...e),getRegisteredHeaders:()=>xu.getRegisteredHeaders()}),th=(e,{body:t={},queryPayload:n={},cancelTokenSource:r,headers:a={},responseType:s},o,i)=>{const{restApi:c,reqType:l}=i_(e,n),d={method:l,headers:a,body:t,...s&&{responseType:s}};r&&(d.signal=r.token);const u="createWork"===e?zy.appendExcludeQueryParamToUrl(c):c;return Wu(u,d,o,i??{})},nh=(e,{method:t="GET",body:n={},headers:r={},withoutDefaultHeaders:a=!1},s)=>{e.startsWith("http:")||e.startsWith("https:")||(e=an()+e);return Wu(e,{method:t,headers:r,body:n,withoutDefaultHeaders:a},s)},rh=e=>bA.doesRestApiExist(e),ah=()=>Yu(),sh=e=>zu(e),oh=e=>{Fu=e},ih=()=>Zp,ch=new Set;function lh(e){try{const t=new URL(e);"https:"!==t.protocol&&"http:"!==t.protocol||ch.add(t.origin)}catch{}}function dh(e){let t,n;try{t=new URL(e,window.location.href).origin}catch{throw new Error("Blocked: malformed URL")}try{n=window.location.origin??new URL(window.location.href).origin}catch{n=""}if(t!==n&&!ch.has(t))throw new Error(`Blocked: untrusted script origin "${t}"`)}const uh="getCustomComponent",ph="text/javascript";function hh(e){let t;try{t=new URL(e).protocol}catch{throw new Error("Component fetch blocked: malformed dev server URL")}if("http:"!==t&&"https:"!==t)throw new Error(`Component fetch blocked: unsupported dev server URL scheme "${t}"`)}const fh=new class{getTypes={SCRIPT:"script",STYLE:"link"};constructor(){this.loaderObj={},this.staticServerURL="",this.appStaticUrl=null,this.pegaOnlyUrl=!1,this.loadedAssets={},this.componentsConfig=null,this.appAlias="",this.b2sJWT=null,this.ccV2LibId="",this.imageBlobUrlCache={}}getStaticServerUrl(){return this.staticServerURL}setCCV2LibId(e){this.ccV2LibId=e}getCCV2LibId(){return this.ccV2LibId}async getThemeSchemaJSON(){const e=`${this.staticServerURL}themeOverrides.schema.json`;return fetch(e).then((e=>e.json()))}getConstellationServiceUrl(){return this.staticServerURL?.endsWith("/")?this.staticServerURL.substring(0,this.staticServerURL.length-1):this.staticServerURL}setAppAlias(e){this.appAlias=e}getAppAlias(){return this.appAlias}async getSvcComponentsConfig(e,t={}){let n="",r=0;return e.forEach((e=>{n+=`${0===r?"?":"&"}field${r}=${e.field}&value${r}=${e.value}`,r+=1})),this.pegaOnlyUrl?this.getSvcComponentsConfigSeparatedUrls(e,n,t):this.getSvcComponentsConfigCombinedUrl(e,n,t)}async getSvcComponentsConfigSeparatedUrls(e,t,n){const r=PA.getBuiltOnAppNames(),a=this.loadAndFilterPegaComponentsConfig(e,r);let s=Promise.resolve([]);!0!==n.skipLoadCustomerComponents&&(s=this.loadAndCustomerComponentsConfig(t,e));const o=[],i=PA.environmentInfoObject?.pyInfinityStaticService;if(i){const e=[],t=await Promise.all([a,s]),[n,r]=t,i=[];for(const t of r)!0===t.isSdkOverridden?e.push(t.componentDefinition):i.push(t.componentDefinition);const c=this.mergeComponentList([n,i,e]);o.push(...c)}else{const e=this.fetchSDKComponent(t);await Promise.all([a,s,e]).then((e=>{const t=this.mergeComponentList(e);o.push(...t)}))}if(n.alternateDesignSystemURL&&1===o.length){const r=await this.getSvcComponentsConfigADS(e,t,n);o[0].alternateDesignSystemConfig=r}return{data:{components:o}}}mergeComponentList=e=>{const[t=[],n=[],r=[]]=e,a=[...t,...n];return this.appStaticUrl?a.map((e=>{const{name:t,type:n,subtype:a}=e,s=r.reduce(((e,r)=>(t===r.name&&n===r.type&&a===r.subtype&&(e=r),e)),{});return Object.keys(s).length>0?{...e,alternateDesignSystemConfig:{...s}}:e})):a};async fetchSDKComponent(e){if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const t=`${this.appStaticUrl}v102/${this.appAlias}/componentslist-ext${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}return Promise.resolve([])}async loadAndFilterPegaComponentsConfig(e,t){return this.loadPegaComponentsConfig().then((()=>{const n=[];return this.componentsConfig&&this.componentsConfig.forEach((r=>{let a=!0;e.forEach((e=>{Array.isArray(r[e.field])?r[e.field].includes(e.value)||(a=!1):r[e.field]!==e.value&&(a=!1)})),a&&this.checkForBuiltOnSupport(t,r.allowedApplications)&&n.push(r)})),n}))}async loadPegaComponentsConfig(){let e=null;if(null===this.componentsConfig){const t=`${this.staticServerURL}components/componentsconfig.json?v=${(new Date).getTime()}`;e=fetch(t,{method:"GET"}).then((e=>e.json())).then((async e=>{this.componentsConfig=e,this.ccV2LibId&&await this.loadLibraryComponentsConfig(this.ccV2LibId).then((e=>{e&&e.length>0&&(this.componentsConfig=(this.componentsConfig||[]).concat(e))})).catch((e=>{console.error(`Exception while appending custom component config from library ${this.ccV2LibId} : ${e}`)}))})).catch()}else e=Promise.resolve();return e}async loadLibraryComponentsConfig(e){let t=null;return t=fetch(`${this.appStaticUrl}v100/componentlib/componentsconfig/${e}?v=${Date.now()}`,{headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>{if(!e.ok)throw console.error("Error while fetching custom component config/library component config"),new Error(e.statusText);return e})).then((e=>e.json())).then((e=>Promise.resolve(e))).catch((t=>(console.error(`Exception while fetching custom component config from library ${e} : ${t}`),{error:t.message}))),t}async loadAndCustomerComponentsConfig(e,t){let n=null;const r=PA.environmentInfoObject?.pyInfinityStaticService;if(r){const e={};t.forEach(((t,n)=>{e[`field${n}`]=t.field,e[`value${n}`]=t.value})),n=PCore.getDataPageUtils().getDataAsync(Mr.getDefaultQualifiedName("D_pzGetComponentsConfig"),"",e).then((e=>e.data.map((e=>({componentDefinition:JSON.parse(e.pxComponentDefinition),isSdkOverridden:void 0!==e.pyIsSDKOverridden&&e.pyIsSDKOverridden})))))}else if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const t=`${this.appStaticUrl}v103/${this.appAlias}/componentslist${e}`;n=fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}else n=Promise.resolve([]);return n}checkForBuiltOnSupport(e,t){if(!e||!t||0===e.length||0===t.length)return!0;const n=e.split(",");return 0===n.length||n.some((e=>t.includes(e)))}async getSvcComponentsConfigCombinedUrl(e,t,n){const r=`${this.staticServerURL}v102/${this.appAlias}/componentslist${t}`,a=await fetch(r,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>({data:e})));if(!0===n.skipLoadCustomerComponents&&a?.data?.components?.length>0&&(a.data.components=a.data.components.filter((e=>void 0===e.componentKey))),n.alternateDesignSystemURL&&1===a?.data?.components?.length){const r=await this.getSvcComponentsConfigADS(e,t,n);a.data.components[0].alternateDesignSystemConfig=r}return a}getSvcComponentsConfigADS(e,t,n){const r=`${n.alternateDesignSystemURL}${n.alternateDesignSystemURL?.endsWith("/")?"":"/"}components/${e[0].value}/config-ext.json`;return fetch(r,{method:"GET"}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)})).catch((e=>({error:e.message})))}getSvcImage(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).catch()}getSvcImageUrl(e){try{const t=PA.environmentInfoObject?.pyInfinityStaticService,{callUrlKey:n,queryPayload:r,callUrl:a}=this.buildImageRequest(e,t);return this.imageBlobUrlCache[a]||(this.imageBlobUrlCache[a]=this.fetchImage(n,r,a,t)),this.imageBlobUrlCache[a]}catch(e){return Promise.resolve(null)}}buildImageRequest(e,t){let n,r="getBinaryFile",a=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;if(t){const t=/DATA-CONTENT-IMAGE\s([^!]*)!.*\/OPERATORIMAGES\//i,s=e.match(t);if(s){const e=s[1]?.trim();if(!e)throw console.warn("AssetLoader.buildImageRequest: operator image key is missing user id"),new Error("AssetLoader.buildImageRequest: operator image key is missing user id");r="getOperatorImage",n={user_ID:e.toLowerCase()}}else n={fileID:e};a=i_(r,n)?.restApi||a}return{callUrlKey:r,queryPayload:n,callUrl:a}}fetchImage(e,t,n,r){return r?th(e,{queryPayload:t}).then((e=>{const n=this.decodeBase64ToByteArray(e.data),r=this.getMimeTypeFromKey(t?.fileID||t?.user_ID||""),a=new Blob([n],{type:r});return window.URL.createObjectURL(a)})).catch((e=>{throw console.error("Error fetching image:",e),e})):fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).then((e=>window.URL.createObjectURL(e))).catch()}decodeBase64ToByteArray(e){const t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e+=1)r[e]=t.charCodeAt(e);return r}getMimeTypeFromKey(e){const t={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"},n=e.toLowerCase().split("!").pop()||"";return t[n]?t[n]:"application/octet-stream"}getSvcLocale(e,t){const n=`${this.appStaticUrl}v102/${this.appAlias}/locales/${e}/${t}`;return fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}})}getSvcAvailableLocales(){const e=`${this.appStaticUrl}v102/app/${this.appAlias}/locales/getLocaleCodes`;return fetch(e,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).catch((()=>[]))}async getSvcComponent(e){try{const t=PA.environmentInfoObject?.pyC11nDXCBDevURL;if(t){const e=t.replace(/\/+$/,"");hh(e);const n=await fetch(`${e}/index.js`);if(!n.ok)throw new Error(n.statusText);return await n.text()}const n=PA.environmentInfoObject?.pyInfinityStaticService;if(n){const t=PA.environmentInfoObject?.pxApplication?.pxUpdateDateTime,n=t?aS.parsePegaDateTimeToTimestamp(t):null,r=`${e}${n?`?v=${n}`:""}`;return(await th(uh,{queryPayload:{componentName:r}})).data}const r=await fetch(`${this.appStaticUrl}v102/${this.appAlias}/component/${e}`,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}});if(!r.ok)throw new Error(r.statusText);return await r.text()}catch(e){throw console.error("Error fetching service component:",e),e}}async importCustomComponentMap(e,t){try{const n=PA.environmentInfoObject?.pyInfinityStaticService,r=PA.environmentInfoObject?.pyC11nDXCBDevURL;let a=`${this.appStaticUrl}v100/componentlib/componentsmap/${e}`;if(r){hh(r);const e=r.replace(/\/+$/,"");a=`${e}/index.js`}if(n&&!r){const n=PA.environmentInfoObject?.pxApplication?.pxUpdateDateTime,r=aS.parsePegaDateTimeToTimestamp(n),a=aS.parsePegaDateTimeToTimestamp(t),s=[];r&&s.push(`v=${r}`),a&&s.push(`libV=${a}`);const o=s.length?`${e}?${s.join("&")}`:e,i=await th(uh,{queryPayload:{componentName:o}});return void await this.appendCustomScriptToHead(i.data)}if(n||r){if("undefined"==typeof document)return;return void await new Promise(((e,t)=>{const n=document.createElement("script");n.src=a,n.type="text/javascript";const r=setTimeout((()=>{t(new Error(`Timed out waiting for custom component script to load: ${a}`))}),3e4);n.onload=()=>{clearTimeout(r),e()},n.onerror=()=>{clearTimeout(r),t(new Error("Error while appending custom component map"))},document.head.appendChild(n)}))}const s=await fetch(a,{headers:{Authorization:`Bearer ${this.b2sJWT}`}});s.ok||console.error("Error while fetching custom component map");const o=await s.text();this.setCCV2LibId(e),await this.appendCustomScriptToHead(o)}catch(e){console.error("Exception while appending custom component map (or load blocked):",e)}}async appendCustomScriptToHead(e){if("undefined"!=typeof document)try{await new Promise(((t,n)=>{const r=document.createElement("script");r.src=window.URL.createObjectURL(new Blob([e],{type:ph}));const a=setTimeout((()=>{n(new Error("Timed out waiting for custom component script to load"))}),3e4);r.onload=()=>{clearTimeout(a),t()},r.onerror=()=>{clearTimeout(a),n(new Error("Error while appending custom component map"))},document.head.appendChild(r)}))}catch(e){console.error("Exception appendCustomScriptToHead:",e)}}loadSvcComponent(e){return new Promise(((t,n)=>{this.getSvcComponent(e).then((r=>{if("undefined"==typeof document)return void n(e);const a=document.createElement("script");a.src=window.URL.createObjectURL(new Blob([r],{type:ph})),a.onload=()=>t(e),a.onerror=()=>n(e),document.head.appendChild(a)})).catch((()=>{n(e)}))}))}initServer(e,t,n){console.log(`asset-loader.initServer(${e}, ${t})`),this.appStaticUrl=null,this.staticServerURL=null,this.pegaOnlyUrl=!1,this.componentsConfig=null,ch.clear(),e&&t&&"no-appstatic"!==t&&"no-cdn"!==t?(this.appStaticUrl=t.endsWith("/")?t:`${t}/`,this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.pegaOnlyUrl=!0,lh(this.staticServerURL),lh(this.appStaticUrl)):e&&t&&"no-appstatic"===t?(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,this.pegaOnlyUrl=!0,lh(this.staticServerURL)):e&&t&&"no-cdn"===t&&(this.staticServerURL=e.endsWith("/")?e:`${e}/`,this.appStaticUrl=this.staticServerURL,lh(this.staticServerURL)),console.log(`asset-loader.initServer() staticServerURL=${this.staticServerURL}, appStaticUrl=${this.appStaticUrl}, pegaOnlyUrl=${this.pegaOnlyUrl})`),this.b2sJWT=n}register(e,t){this.loaderObj[e]=t}getLoader(e){let t;const n=(e,t)=>new Promise(((n,r)=>{if("undefined"==typeof document)return void r(e);const a=document.createElement(t);if("script"===t){const t=a;t.onload=()=>{n(e)},t.onerror=()=>{r(e)},t.type=ph,t.charset="UTF-8",t.async=!1,t.src=e}else{const t=a;t.type="text/css",t.rel="stylesheet",t.href=e}document.head.appendChild(a)})).catch((e=>{console.log(e)}));return t=e?this.loaderObj[e]:n,t}loadAssets(e,t){const{isDevServerMode:n}=t;if(!e)return Promise.resolve();const r=[];return e.forEach((e=>{const t=Object.keys(e)[0];let a=n?Object.values(e)[0]:this.getStaticServerUrl();a=a.endsWith("/")?a:`${a}/`,this.loadedAssets[t]||(t.includes(".js")?r.push(this.getLoader()(a+t,this.getTypes.SCRIPT)):t.includes(".css")&&this.getLoader()(a+t,this.getTypes.STYLE),this.loadedAssets[t]=!0)})),Promise.all(r)}getAssetsFromIsolations(e){const t=this.b2sJWT?.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")||"",r=decodeURIComponent(n.g.atob(t).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")),a=JSON.parse(r),s=a?.tenant_id,{restApi:o,reqType:i}=o_("getAssetsFromIsolations",{isolationID:s,assetPath:e})||{},c=`${this.appStaticUrl}${o}`;return fetch(c,{method:i,credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob()))}},gh="component-loader",mh={},yh=async(e,t)=>{if(!e?.length||!1===window.PCore?.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();const n=fh.getLoader(),r=t||fh.staticServerURL;if(fh.getLoader(gh))return fh.getLoader(gh)(e,r);const a=new Set(Object.keys(mh)),s=e.flatMap((e=>{if(a.has(e))return[];const t=Co.getComponent(e);if(!t){const t=`${fh.getConstellationServiceUrl()}/v860/${fh.getAppAlias()}/component/${e}.js`;return a.add(e),[n(t,fh.getTypes.SCRIPT)]}const s=(t.scripts||[]).map((e=>n(e.startsWith("http")?e:`${r}${e}`,fh.getTypes.SCRIPT))),o=(t.styles||[]).map((e=>n(`${r}${e}`,fh.getTypes.STYLE)));return a.add(e),[...s,...o]}));return Promise.all(s.map((e=>e.catch((e=>console.error("Error loading asset:",e))))))},Eh="component-state-lru-index";function Ih(e){return"object"==typeof e&&null!==e&&"key"in e&&"accessedAt"in e&&"string"==typeof e.key&&"number"==typeof e.accessedAt}function Ah(){try{const e=sessionStorage.getItem(Eh);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(Ih):[]}catch{return[]}}function Ch(e){try{sessionStorage.setItem(Eh,JSON.stringify(e))}catch{}}function Sh(e){const t=Ah().filter((t=>t.key!==e));t.unshift({key:e,accessedAt:Date.now()}),Ch(t)}const _h=()=>"undefined"!=typeof sessionStorage?sessionStorage:null;const Nh=new class{#s;constructor(){this.userSettings={},this.componentCache={},this.contextMapToClearOnCancel={},this.#s=!1}getNormalizedKey(e){return e?.toString().trim().replace(/\s/g,"-").toLowerCase()}setComponentState=(e,t,n)=>{_h()?n?.managed&&"FULL_PORTAL"!==PA.getRenderingMode()||(_h()?.setItem(this.getNormalizedKey(e),JSON.stringify(t)),n?.managed&&(Sh(this.getNormalizedKey(e)),function(e){const t=Ah();if(t.length<=100)return[];const n=[],r=t.slice(0,100),a=t.slice(100);for(const t of a){try{e(t.key)}catch{}n.push(t.key)}Ch(r)}((e=>{_h()?.removeItem(e)})))):console.error("Session Storage not found")};getComponentState=(e,t)=>{if(t?.managed&&"FULL_PORTAL"!==PA.getRenderingMode())return;const n=_h()?.getItem(this.getNormalizedKey(e))??null,r=n?aS.isValidJson(n):void 0;return t?.managed&&null!=(r??n)&&Sh(this.getNormalizedKey(e)),r||n};removeComponentState=(e,t)=>{t?.managed&&"FULL_PORTAL"!==PA.getRenderingMode()||(_h()?.removeItem(this.getNormalizedKey(e)),t?.managed&&function(e){const t=Ah(),n=t.filter((t=>t.key!==e));n.length!==t.length&&Ch(n)}(this.getNormalizedKey(e)))};fetchUserSettings=async()=>{if(rh("getUserSettings")){const{restApi:e,reqType:t}=i_("getUserSettings");Wu(e,{method:t,headers:{}}).then((e=>{if(200!==e.status||!e.data)throw new Error("something went wrong while fetching getUserSettings");this.userSettings=e.data})).catch((e=>console.error(e)))}};init=()=>{PA.getUserSettings()?this.userSettings=PA.getUserSettings():this.fetchUserSettings()};getUserSettings=e=>{if(!e)throw new Error("path is required parameter");if("string"!=typeof e)throw new TypeError("path must be string");return aS.getIn(this.userSettings,e,{})};setUserSettings=async(e,t)=>{if(!e)return Promise.reject(new Error("path is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("path must be string"));if(null==t||""===t)return Promise.reject(new Error("value is required parameter"));let n;if(!rh("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=i_("updateUserSettings");const{restApi:r,reqType:a}=n;return Wu(r,{method:a,body:aS.setIn({},e,t)}).then((e=>{if(200!==e.status||!e.data)throw new Error("something went wrong");this.userSettings=e.data})).catch((e=>{console.error(e)}))};setComponentCache(e,t,n={}){if("string"!=typeof e||!e?.trim())return;const r=n.clearOnCancelForContext;if(r&&(Object.hasOwn(this.contextMapToClearOnCancel,r)?this.contextMapToClearOnCancel[r].add(this.getNormalizedKey(e)):this.contextMapToClearOnCancel[r]=new Set([this.getNormalizedKey(e)])),this.componentCache[this.getNormalizedKey(e)]=t,!this.#s){this.#s=!0;const e=e=>{const{context:t}=e||{};(this.contextMapToClearOnCancel[t]||new Set).forEach((e=>{this.resetComponentCache(e)})),delete this.contextMapToClearOnCancel[t]};gu.subscribe(Fr.PUB_SUB_EVENTS.EVENT_CANCEL,e,"RESET_COMPONENT_CACHE")}}getComponentCache(e){return"string"==typeof e&&e?.trim()?Object.hasOwn(this.componentCache,this.getNormalizedKey(e))?this.componentCache[this.getNormalizedKey(e)]:void 0:null}getURLParam(e,t){let n=new URL(globalThis.location.href).searchParams.get(e);return n?(n=t?atob(n):n,n):null}setURLParam(e,t,n){if(!PA.shouldUseURLParams())return;const r=new URL(globalThis.location.href);if(t=n?btoa(t):t,r.searchParams.get(e)===t)return;r.searchParams.set(e,t);globalThis.history.pushState({type:"ui-navigation"},"",r)}setURLParams(e){const t=new URL(globalThis.location.href);Object.entries(e).forEach((([e,n])=>{t.searchParams.set(e,n)}));globalThis.history.pushState({type:"update-history"},"",t)}resetComponentCache(e){return!("string"!=typeof e||!e?.trim())&&(!!Object.hasOwn(this.componentCache,this.getNormalizedKey(e))&&(delete this.componentCache[this.getNormalizedKey(e)],!0))}};const bh=new class{constructor(){this.contextArray={},this.pauseDuration=2e3,this.waitingToPutUpIndicator=!1}getLoadingContext(e){let t=null;return e&&(({context:t}=e),t||(t=e.containerItemID),t||(t=e.contextName)),t}enableLoadingIndicator(e,t=!0){const n=this.getLoadingContext(e);n&&(this.addToContextArray(n),this.waitingToPutUpIndicator||(this.waitingToPutUpIndicator=!0,this.pauseBeforeShowing(n).then((e=>{mu.isOnline()&&t&&void 0!==this.contextArray[e]&&this.contextArray[e]>0&&VC({type:oa,payload:{context:e}})}))))}pauseBeforeShowing=e=>new Promise((t=>{setTimeout((()=>t(e)),this.pauseDuration)}));disableLoadingIndicator(e,t=!0){const n=this.getLoadingContext(e);n&&(this.waitingToPutUpIndicator=!1,this.removeFromContextArray(n),t&&void 0!==this.contextArray[n]&&0===this.contextArray[n]&&VC({type:ia,payload:{context:n}}))}addToContextArray=e=>{void 0===this.contextArray[e]&&(this.contextArray[e]=0),this.contextArray[e]+=1};removeFromContextArray=e=>{void 0!==this.contextArray[e]&&this.contextArray[e]>0&&(this.contextArray[e]-=1)}};const Th=new class{constructor(){this.counterActionMgrId=0,this.actionMgrActions={}}getNextActionMgrId(){return this.counterActionMgrId+=1,this.counterActionMgrId.toString()}register(e,t,n,r,a="unknown",s,o=!0){if(void 0!==this.actionMgrActions[e])return null;const i={actionType:a,promise:t,resolve:n,reject:r,actionPayload:s};return this.actionMgrActions[e]=i,o&&bh.enableLoadingIndicator(i.actionPayload),e}actionManagerPromise=(e,t="")=>{let n,r;""===t&&(t=this.getNextActionMgrId());const a=new Promise(((e,t)=>{n=e,r=t}));if(!n||!r)throw new Error("resolveFn or rejectFn is not defined.");return this.register(t,a,n,r,e),{actionMgrID:t,promise:a}};resolveActionByID(e,t,n=!0){const r=this.actionMgrActions[e];let a=e;return r?(setTimeout((()=>{r.resolve(t)}),0),bh.disableLoadingIndicator(r.actionPayload,n)):a=null,a}rejectActionByID(e,t=!0,n){const r=this.actionMgrActions[e];let a=e;return r?(r.reject(n),bh.disableLoadingIndicator(r.actionPayload,t)):a=null,a}setRemoteCaseHeaderByContext(e,t){t&&(e.headers=e.headers||{},e.headers.RemoteSystemID=t)}setTraditionalRemoteCaseParams(e,t){return e.className=t.className,e.isTraditionalRemoteCase=Vr.isTraditionalRemoteCase(t.className),e.remoteClassName=t.remoteClassName,e.action=t.action,e.viewName=jr,e.gadgetId=t.gadgetId??zy.getUniqueGadgetId(),e.name=t.name,e.isRemoteCase=!0,e.skipSemanticUrl=!0,na}};class Ph{static actionsTargetMap=new Map;static getTargetViewContainerName=e=>{if(e){const t=e.toLowerCase();let n="primary";return this.actionsTargetMap.has(t)&&(n=this.actionsTargetMap.get(t)),n}return""};static buildActionTargetMap=e=>{e&&Object.keys(e).forEach((t=>{const n=e[t];n&&n.actions&&n.actions.forEach((e=>{this.actionsTargetMap.set(e.toLowerCase(),t)}))}))}}const Oh=Ph,Dh=(e,t,n,r)=>bA.getResolvedSemanticURL(e,t,n,r),vh={getResolvedSemanticURL:Dh,getActions:()=>({ACTION_OPENWORKBYHANDLE:za,ACTION_SHOWDATA:Ha,ACTION_SHOWVIEW:Wa,ACTION_GETOBJECT:Ms,ACTION_SHOWINSIGHT:qa,ACTION_SHOWDASHBOARD:Ya}),updateSemanticURLAndDocumentTitle:(e,t)=>bA.updateSemanticURLAndDocumentTitle(e,t),getSemanticURLForToaster:(e,t,n=!1,r)=>Dh(n?Ms:za,{caseClassName:e},{[n?"objectID":"workID"]:t},r)},Rh={CASE_INFO:`${Fr.DATA}.${Fr.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${Fr.DATA}.${Fr.CASE_INFO.CASE_TYPE_ID}`,CASE_TYPE_NAME:`${Fr.DATA}.${Fr.CASE_INFO.CASE_TYPE_NAME}`,CASE_INFO_ID:`${Fr.DATA}.${Fr.CASE_INFO.CASE_INFO_ID}`,BUSINESS_ID:`${Fr.DATA}.${Fr.CASE_INFO.BUSINESS_ID}`},$h=e=>aS.getIn(e,Fr.getProperty(Rh.CASE_CLASS_NAME),Fr.EMPTY_STRING),xh=e=>aS.getIn(e,Fr.getProperty(Rh.CASE_INFO_ID),Fr.EMPTY_STRING),wh=(e,t)=>{const n=xh(t);aS.setIn(e,"key",n)},Mh=e=>aS.getIn(e,Fr.getProperty(Rh.CASE_INFO),{}),Lh=e=>{const t=kC();if(!e)return!1;const n=Wr(e),r=QI(n),a=QI(e);if(!r||!a)return!1;const s=CI(r,n),o=CI(a,e);if(!s||!o)return!1;const{key:i}=s;let{key:c}=o;return c||(c=t?.getState().data?.[e]?.objectInfo?.ID),i&&c&&i===c},Uh=e=>{const t=xh(e),n=aS.getIn(e,Fr.getProperty(Rh.BUSINESS_ID),Fr.EMPTY_STRING),r=t.toLowerCase().includes(n.toLowerCase())?n:t,a=$h(e),s=(o=e,aS.getIn(o,Fr.getProperty(Rh.CASE_TYPE_NAME),Fr.EMPTY_STRING));var o;return{businessID:n,caseType:a,resolvedURL:vh.getSemanticURLForToaster(a,r,zy.isObjectCaseType(a)),caseTypeName:s}};const Fh=class{constructor(e){this.c11nEnv=e}validate(e,t){const{value:n}=this.c11nEnv.getStateProps();if(!t&&!(t=n)){const e=this.c11nEnv.getComponentConfig(),n=this.c11nEnv.getStateProps();t="multi"===e.selectionMode?n.selectionList:"Editable"===e.renderMode?n.referenceList:"single"===e.selectionMode?n.selectionKey:n.value}const r=By(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:a}=zp.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,r);return a?{status:!1,message:a}:{status:!0}}validateEmail(e,t={}){const n=zp.getValidator("email");if(!n)return{status:"success"};const r=n(e,t);return r?{status:"failure",message:r}:{status:"success"}}},jh="OPEN_PROCESS_ACTION",kh="OPEN_ASSIGNMENT",Vh="DELETE_CASE_IN_CREATE_STAGE",Bh="SAVE_AND_CLOSE",Gh=e=>({type:Bh,payload:e}),Wh="DELETE_WORK",Hh=e=>({type:Wh,payload:e});const qh=class{static getSavableDataPage(e){return OC(e)}static getLookUpDataPage(e){return vC(e)}static getLookUpDataPageInfo(e){return RC(e)}static getDataPageKeys(e){return DC(e)}};const Yh=class{static getPropertyName(e){return No.getPropertyName(e)}static isProperty(e){return No.isProperty(e)}static getLeafPropertyName(e){return No.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};class zh{static createContainerPConnect(e,t,n,r=!1){const{accessedOrder:a,items:s}=e;if(a&&s){const e=a[a.length-1];if(s[e]?.view&&Object.keys(s[e].view).length>0){const a=s[e],o=e.substring(0,e.lastIndexOf("_")),{view:i,context:c}=a,{viewName:l,viewContext:d}=this.processRootViewDetails(i,a,t);if(!l)return null;return Cm({meta:i,options:{context:c,pageReference:d||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:r||n===mI.WORKAREA||n===mI.MODAL||l===Fr.CREATE_DETAILS_VIEW_NAME,target:o}}).getPConnect}}return null}static processRootViewDetails(e,t,n){const{config:{context:r,name:a}={}}=e,{context:s}=t;let o=a,i=r;const c=Yh.isProperty(a),l=Yh.isProperty(r);if(l){const e=Yh.getPropertyName(r);i=HC(`.${e}`,e.startsWith(".")?n:"",s)}if(i||(i=n),c){const e=Yh.getPropertyName(a);o=HC(`.${e}`,i,s)}return c&&l&&""!==o&&(o=a,i=r),{viewName:o,viewContext:i}}static addFlowContainerItem(e){const t=e.getContainerManager(),n=e.getContextName();let r,a;if("review"!==e.getValue("context_data.caseViewMode")){const e=n.substring(0,n.lastIndexOf("_")),t=$I(e),s=CI(e,t);s&&({key:r,flowName:a}=s)}t.addContainerItem({semanticURL:"",key:r,flowName:a,caseViewMode:"perform",resourceType:"ASSIGNMENT",data:e.getDataObject(n)})}static hasContainerItems=e=>{const t=e.getContextName(),n=e.getContainerName();return PCore.getContainerUtils().hasContainerItems(`${t}/${n}`)};static hasGetNextWorkLinks=e=>e.getValue(Fr.CASE_INFO.GETNEXTWORK);static getActiveCaseActionName=e=>{const t=e.getValue(Fr.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(Fr.CASE_INFO.ACTIVE_ACTION_ID),r=t.find((e=>e.ID===n));return r?.name||""};static getFirstCaseActionName=e=>{const t=e.getValue(Fr.CASE_INFO.CASE_INFO_ACTIONS);return t[0]?.name||""};static hasNotificationMessages=e=>!!e.getValue("caseMessages");static isCaseWideLocalAction=e=>{const t=e.getValue(Fr.CASE_INFO.ACTIVE_ACTION_ID),n=e.getValue(Fr.CASE_INFO.CASE_INFO_ACTIONS);if(n&&t){const e=n.find((e=>e.ID===t));return"Case"===e?.type}return!1};static getChildCaseAssignments=e=>{const t=e.getValue(Fr.CASE_INFO.CHILD_ASSIGNMENTS);let n=[];return t&&t.length>0&&t.forEach((({assignments:e=[],Name:t,caseTypeID:r})=>{const a=e.map((e=>({...e,caseName:t,caseTypeID:r})));n=n.concat(a)})),n};static hasAssignments=e=>{const t=e.getValue(Fr.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS),n=zh.getChildCaseAssignments(e);return!!(Array.isArray(n)&&n.length>0||Array.isArray(t)&&t.length>0||zh.isCaseWideLocalAction(e))};static showBanner=e=>{const t=e();return zh.hasNotificationMessages(t)||!zh.hasAssignments(t)};static showTodo=e=>"perform"!==e.getValue("context_data.caseViewMode");static isRenderWithToDoWrapper=(e,t)=>{const n=e(),{showWithToDo:r}=t;return r&&(!zh.isCaseWideLocalAction(n)||zh.showTodo(n))};static getToDoAssignments=e=>{const t=e.getValue(Fr.CASE_INFO.CASE_INFO_ACTIONS),n=e.getValue(Fr.CASE_INFO.ASSIGNMENT_LABEL),r=e.getValue(Fr.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)||[],a=zh.getChildCaseAssignments(e)||[];let s=JSON.parse(JSON.stringify(a));s=s.map((e=>(e.isChild=!0,e)));const o=[...r,...s];let i=JSON.parse(JSON.stringify(o));return t&&!zh.showTodo(e)&&(i=i.map((t=>(t.name=zh.getActiveCaseActionName(e)||t?.name||n,t)))),i}}const Kh=zh;const Qh=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=Th.getNextActionMgrId();let n,r;const a=new Promise(((e,t)=>{n=e,r=t}));if(!n||!r)throw new Error("resolveFn or rejectFn is not defined.");return Th.register(t,a,n,r,e),{actionMgrID:t,promise:a}};initializeContainers(e){const t=Ta,n=this.c11nEnv,r={context:n.getContextName(),name:n.getContainerName(),type:Fr.CONTAINER_TYPE.SINGLE},{actionMgrID:a,promise:s}=this.containerManagerPromise(t),o={...r,...e,actionMgrID:a};return VC(CS(o)),s}addContainerItem(e){const t=Oa,n=this.c11nEnv,r=n.getMetadata(),{children:a}=r||{};let s;Array.isArray(a)&&a.length>0&&([s]=a);const o=n.getContextName(),i=n.getContainerName(),c=Hr(i,o,e?.containerType===Fr.CONTAINER_TYPE.SINGLE),l=js(i,o),d={root:{...s,config:{...s?.config,context:s?.config?.context||n.getPageReference?.()}},containerItemID:c,context:c,target:l,containerName:i};e=JSON.parse(JSON.stringify(e)),[Fr.WORKAREA].includes(i)&&delete e.data?.coreHeaders;const{actionMgrID:u,promise:p}=this.containerManagerPromise(t),h={...d,...e,actionMgrID:u};return VC(_S(h)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=Fa,n={context:MI(e.containerItemID),target:QI(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return VC(DS(s)),a}activateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("activateContainerItem : containerItemID is required in containerInfo object"));const t=Ua,n={target:QI(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return VC(xS(s)),a}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=Da,n={context:MI(e.containerItemID),target:QI(e.containerItemID)},{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return VC(MS(s)),a}resetContainers(e){if(!e?.context||!e?.name)return Promise.reject(new Error("resetContainers : context and name are required in containerInfo object"));const t=Pa,n=YI(e),{actionMgrID:r,promise:a}=this.containerManagerPromise(t),s={...n,...e,actionMgrID:r};return VC(SS(s)),a}addTransientItem(e){const{id:t,data:n,sourceContainerItemId:r}=e,a=this.c11nEnv.getContextName(),s=Yr(t,a),o=tA(a);if(s&&o.includes(s))return s;let i=n;if(r){const e=BC(r);if(!e)throw new Error(`addTransientItem: source container item "${r}" not found in store`);i=aS.deepClone(e)}return VC(NS({transientItemID:s,contextName:a,target:QI(a),data:i})),s}updateTransientData(e){const{transientItemID:t,data:n}=e,r=this.c11nEnv.getContextName();if(t){if(!tA(r).includes(t))return;VC(bS({transientItemID:t,data:n}))}}removeTransientItem(e){const t=this.c11nEnv.getContextName(),{target:n=this.c11nEnv.getTarget(),containerItemID:r,transientItemID:a}=e;if(a&&r){if(!tA(t).includes(a))return;VC(US({target:n,containerItemID:r,transientItemID:a}))}}createContainerPConnect(e,t,n,r=!1){Kh.createContainerPConnect(e,t,n,r)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return GI(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return vI(e,t)}};function Jh(e,t){return Pd((function(n,r){var a=null,s=0,o=!1,i=function(){return o&&!a&&r.complete()};n.subscribe(Od(r,(function(n){null==a||a.unsubscribe();var o=0,c=s++;Nd(e(n,c)).subscribe(a=Od(r,(function(e){return r.next(t?t(n,e,c,o++):e)}),(function(){a=null,i()})))}),(function(){o=!0,i()})))}))}function Xh(e,t){return Pd((function(n,r){var a=0;n.subscribe(Od(r,(function(n){r.next(e.call(t,n,a++))})))}))}function Zh(e,t,n){return void 0===n&&(n=1/0),Bl(t)?Zh((function(n,r){return Xh((function(e,a){return t(n,e,r,a)}))(Nd(e(n,r)))}),n):("number"==typeof t&&(n=t),Pd((function(t,r){return function(e,t,n,r,a,s,o,i){var c=[],l=0,d=0,u=!1,p=function(){!u||c.length||l||t.complete()},h=function(e){return l<r?f(e):c.push(e)},f=function(e){s&&t.next(e),l++;var i=!1;Nd(n(e,d++)).subscribe(Od(t,(function(e){null==a||a(e),s?h(e):t.next(e)}),(function(){i=!0}),void 0,(function(){if(i)try{l--;for(var e=function(){var e=c.shift();o?Td(t,o,(function(){return f(e)})):f(e)};c.length&&l<r;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(Od(t,h,(function(){u=!0,p()}))),function(){null==i||i()}}(t,r,e,n)})))}function ef(e){return e&&Bl(e.schedule)}function tf(e){return e[e.length-1]}function nf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return ef(tf(e))?e.pop():void 0}(e);return wd(e,n)}var rf=Dl((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),af=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return $l(t,e),t.prototype.lift=function(e){var t=new sf(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new rf},t.prototype.next=function(e){var t=this;rd((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var a=Ml(t.currentObservers),s=a.next();!s.done;s=a.next()){s.value.next(e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;rd((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;rd((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,a=n.isStopped,s=n.observers;return r||a?Yl:(this.currentObservers=null,s.push(e),new ql((function(){t.currentObservers=null,Hl(s,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,a=t.isStopped;n?e.error(r):a&&e.complete()},t.prototype.asObservable=function(){var e=new gd;return e.source=this,e},t.create=function(e,t){return new sf(e,t)},t}(gd),sf=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return $l(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:Yl},t}(af),of=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return $l(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(af);function cf(e,t){return Pd((function(n,r){var a=0;n.subscribe(Od(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}class lf extends of{constructor(e,t){super(t)}}const df=(...e)=>cf((t=>e.includes(t.type)));var uf=new gd((function(e){return e.complete()}));function pf(e){return e?function(e){return new gd((function(t){return e.schedule((function(){return t.complete()}))}))}(e):uf}const hf=(e,t,n)=>Md((r=>("ERR_CANCELED"!==r?.code&&console.error(e,r),nf(GS(e,r,t,null,n))))),ff=(e,t)=>n=>new gd((r=>{let a={},s=0;return n.pipe(Zh((n=>{const r=Date.now();let o;return o=t||Xt,o&&o(n,a)&&r-s<e?pf():(a=n,s=r,nf(n))}))).subscribe(r)})),gf=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:a}=e,s={data_view_ID:t},{restApi:o,reqType:i}=i_("createDataObject",s),{content:c}=ay(a);return wd(Wu(o,{method:i,headers:r,body:{data:c.content,pageInstructions:c?.pageInstructions}},a)).pipe(Xh((t=>({response:t.data,actionInPayload:e}))),hf("Error occurred during ajax call at createDataObject Epic",n))},mf=e=>{const{dataLookUp:t,context:n,headers:r,viewName:a,requestPayload:s}=e,o={data_view_ID:t,view_ID:a},{restApi:i,reqType:c}=i_("readDataObject",o);return wd(Wu(i,{method:c,headers:r,body:{dataViewParameters:s}},n)).pipe(Xh((t=>({response:t.data,headers:ry(t.headers),actionInPayload:e}))),hf("Error occurred during ajax call at getDataObjectView Epic",n))},yf=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:a,key:s}=e,o={data_view_ID:t},{restApi:i,reqType:c}=i_("updateDataObject",o),{content:l}=ay(a);return wd(Wu(i,{method:c,headers:{...r,"if-match":e?.etag},body:{data:{...l.content,...s},pageInstructions:l.pageInstructions||[]}},a)).pipe(Xh((t=>({response:t.data,actionInPayload:e}))),hf("Error occurred during ajax call at updateDataObject Epic",n))},Ef=e=>{const{lookupDatapage:t,context:n,headers:r,actionID:a,dataViewParameters:s}=e,o={data_view_ID:t,action_ID:a},{restApi:i,reqType:c}=i_("openDataObjectAction",o);return wd(Wu(i,{method:c,headers:r,body:{dataViewParameters:s}},n)).pipe(Xh((t=>({response:t.data,headers:ry(t.headers),actionInPayload:e}))),hf("Error occurred during ajax call at getDataObjectView Epic",n))},If=e=>{const{savableDatapage:t,context:n,headers:r,actionID:a,keys:s,containerItemID:o,jsActionQueryParams:i}=e,c={data_view_ID:t,action_ID:a};let{restApi:l}=i_("submitDataObjectAction",c);const{reqType:d}=i_("submitDataObjectAction",c),{content:u}=ay(o);return l=oE(i,l),wd(Wu(l,{method:d,headers:{...r,"if-match":e?.etag},body:{data:{...u?.content,...s},pageInstructions:u?.pageInstructions||[]}},n)).pipe(Xh((t=>({response:t.data,actionInPayload:e}))),hf("Error occurred during ajax call at getDataObjectView Epic",n))};const Af=new class{constructor(){this.components={}}_checkComponent(e,t){return!!this.components[t]?.[e]}start(e,t,n,r,a){const s={viewName:e,pageReference:n,contextName:r,isInProgress:!0,active:!0,caseKey:t};this.components[r]=this.components[r]||{},this.components[r][a]=s}stop(e,t){this._checkComponent(e,t)&&(this.components[t][e].isInProgress=!1)}remove(e,t){this._checkComponent(e,t)&&delete this.components[t][e]}removeContext(e){delete this.components[e]}enableCascade(e){this.components[e]&&Object.values(this.components[e]).forEach((e=>{e.isInProgress&&(e.cascade=!0)}))}activate(e,t){this._checkComponent(e,t)&&(this.components[t][e].active=!0)}deactivate(e,t){this._checkComponent(e,t)&&(this.components[t][e].active=!1)}refreshActiveComponents(e){e&&this.components[e]&&Object.keys(this.components[e]).forEach((t=>{this.refreshComponent(t,e)}))}refreshComponent(e,t){if(!this._checkComponent(e,t))return;const n=this.components[t][e];if(n.active&&n.cascade){const{caseKey:e,viewName:r,pageReference:a}=n;uE(e,r,t,a,{})}}},Cf="postDataViewMetadata",Sf={getData:(e,t,n,r)=>((e,t,n,r={})=>{const a={dataViewName:e},{skipClearErrorMessages:s,signal:o,doNotMergeMessagesForStatusCode:i}=r,{restApi:c,reqType:l}=i_("getListData",a);return Wu(c,{method:l,body:t,...o&&{signal:o},...s&&{skipClearErrorMessages:s}},n,i)})(e,t,n,r),getListCount:(e,t,n)=>{const r={dataViewName:e},{restApi:a,reqType:s}=i_("getListDataCount",r);return Wu(a,{method:s,body:t},n)},getDataViewMetadata:(e,t,n,r)=>{const a=!!n,s=!!r,o=bA.doesRestApiExist(Cf),i=(a||s)&&o?Cf:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:d}=i_(i,c);if(o){if(a)return Wu(l,{method:d,body:{associationFilter:n}},t);if(s)return Wu(l,{method:d,body:{propertyFilter:r}},t)}return Wu(l,{method:d},t)},getDataObjectView:(e,t,n,r,a={})=>{const{skipClearErrorMessages:s,signal:o,doNotMergeMessagesForStatusCode:i}=a,c={data_view_ID:e,view_ID:t},l={dataViewParameters:n},{restApi:d,reqType:u}=i_("readDataObject",c);return Wu(d,{method:u,body:l,...o&&{signal:o},...s&&{skipClearErrorMessages:s}},r,i)},getCaseEditMetadata:(e,t)=>zy.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>zy.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,r)=>zy.updateCaseEditFieldsData(e,t,n,r),moveListRecords:(e,t)=>{const{sourceID:n,destinationID:r,context:a,listClass:s,viewName:o,viewClassName:i}=e,c={viewName:o,viewClassName:i},{restApi:l,reqType:d}=i_("moveListRecords",c);return Wu(l,{method:d,body:{content:{sourceID:n,destinationID:r,context:a,listClass:s}}},t)},isTimeElapsed:(e,t,n="")=>{if(t){if(e&&n===Fr.RELOAD_IF_OLDER_THAN)return new Date(e).setSeconds(t)<Date.now();if(e&&n===Fr.RELOAD_ONCE_PER_INTERACTION)return!0}return!0},getAppCacheKey:e=>void 0!==FI("root").find((e=>e.includes("authoring-preview")))?`${Fr.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${fh.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=PA.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}},_f=/{(.*?)}/i,Nf=/{(.*?)}/g,bf=e=>null!==e.match(_f),Tf=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),Pf=e=>{const t=e[e.length-1],n=e[e.length-2];if("y"!==t.toLowerCase())return`${e}s`;switch(n.toLowerCase()){case"a":case"e":case"i":case"o":case"u":return`${e}s`;default:return`${e=e.substring(0,e.length-1)}ies`}},Of=e=>e.replaceAll("+","%20"),Df=["portal","noPortal","debug","activeTab","contextParam","lang"],vf=e=>{if(e.indexOf("?")>0){const[t,n]=e.split("?"),r=new URLSearchParams(n),a=new Map;for(const[e,t]of r)Df.includes(e)||a.set(e,t);const s=Of(new URLSearchParams(Array.from(a.entries())).toString());return s?`${t}?${s}`:t}return e},Rf=(e,t)=>e.includes("/assignments")?((e,t)=>{const n=e.split("/"),r=n.indexOf("assignments"),a=n.slice(r-2).join("/"),s=n[n.length-1],o=o_(Ka,{assignmentID:s});return{routeEndpoint:o?.restApi,requestType:o?.reqType,payload:{assignmentID:s},options:t,routeKey:os,urlPath:a}})(e,t):bA.getEndPointInfo(e),$f=()=>{const e=PA.environmentInfoObject?.pyExecutionRuntimeName;return"Infinity"===e};const xf=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const wf=class{constructor(){this.users={},this.connected=!1,this.connectionsCount=1}_handleUserPresence({message:e}){const{state:t,updateById:n}=e,r=this.users[n];r&&(r.state=t,Object.keys(r.subscribers).forEach((e=>{r.subscribers[e]?.callback({state:r.state})})))}_getAutoGenId(){return this.connectionsCount+=1,`${Date.now()}_${this.connectionsCount}`}subscribe(e,t,n){const r=this._getAutoGenId(),a=this.users[e];if(a)return a.subscribers[r]={callback:t,contextName:n},r;this.users[e]={subscribers:{[r]:{callback:t,contextName:n}}};const s={matcher:"PRESENCE",criteria:{userId:e}};return ag.subscribe(s,this._handleUserPresence.bind(this)),r}unsubscribe(e,t){const n={matcher:"PRESENCE",unsubscribeUsers:{users:[e]}};this.users[e]&&this.users[e].subscribers&&(delete this.users[e].subscribers[t],0===Object.keys(this.users[e].subscribers).length&&(delete this.users[e],ag.publishMessage(n)))}getUserState(e){return this.users[e]&&this.users[e].state}clearContext(e){Object.keys(this.users).forEach((t=>{Object.keys(this.users[t].subscribers).forEach((n=>{this.users[t].subscribers[n].contextName===e&&this.unsubscribe(t,n)}))}))}};const Mf=function(e,t,n,r){for(var a=e.length,s=n+(r?1:-1);r?s--:++s<a;)if(t(e[s],s,e))return s;return-1};const Lf=function(e){return e!=e};const Uf=function(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1};const Ff=function(e,t,n){return t==t?Uf(e,t,n):Mf(e,Lf,n)};const jf=function(e,t){return!!(null==e?0:e.length)&&Ff(e,t,0)>-1};const kf=function(e,t,n){for(var r=-1,a=null==e?0:e.length;++r<a;)if(n(t,e[r]))return!0;return!1};const Vf=function(e,t,n,r){var a=-1,s=jf,o=!0,i=e.length,c=[],l=t.length;if(!i)return c;n&&(t=An(t,dt(n))),r?(s=kf,o=!1):t.length>=200&&(s=Re,o=!1,t=new De(t));e:for(;++a<i;){var d=e[a],u=null==n?d:n(d);if(d=r||0!==d?d:0,o&&u==u){for(var p=l;p--;)if(t[p]===u)continue e;c.push(d)}else s(t,u,r)||c.push(d)}return c};var Bf=v?v.isConcatSpreadable:void 0;const Gf=function(e){return ke(e)||Ze(e)||!!(Bf&&e&&e[Bf])};const Wf=function e(t,n,r,a,s){var o=-1,i=t.length;for(r||(r=Gf),s||(s=[]);++o<i;){var c=t[o];n>0&&r(c)?n>1?e(c,n-1,r,a,s):je(s,c):a||(s[s.length]=c)}return s};const Hf=Dr((function(e,t){return sr(e)?Vf(e,Wf(t,1,sr,!0)):[]}));const qf=class{constructor(e,t){this.atomicSubscribers={},this.connectionsCount=0,this.connected=!1,this.matcher=e,this.criteria=t,this.messagingServiceSubscriptionID=""}_handleAtomicMessage({message:e}){Object.keys(this.atomicSubscribers).forEach((t=>{const n=this.atomicSubscribers[t];if(!n)return;const r=Object.keys(n.criteria),a=Object.keys(e);0===Hf(r,a).length&&n.callback(e)}))}_getAutoGenId(){return this.connectionsCount+=1,`${Date.now()}_${this.connectionsCount}`}subscribe(e,t){const n=this._getAutoGenId();if(!this.messagingServiceSubscriptionID){this.messagingServiceSubscriptionID=n;const e={matcher:this.matcher,criteria:this.criteria},t=ag.subscribe(e,this._handleAtomicMessage.bind(this),void 0,n);this.messagingServiceSubscriptionID=t||n,this.connected=!0}return this.atomicSubscribers[n]={criteria:e,callback:t},n}unsubscribe(e){delete this.atomicSubscribers[e],0===Object.keys(this.atomicSubscribers).length&&(this.connected=!1,this.messagingServiceSubscriptionID&&(ag.unsubscribe(this.messagingServiceSubscriptionID),this.messagingServiceSubscriptionID=""))}};const Yf=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new qf("CASE",t)}return this.subscriptions[e]}};const zf=class{static transformReference(e){return e.replace(/^[^.]*\./,"caseInfo.content.")}static extractReferenceParts(e){const t=e.split("."),n=t.pop()||"";return{pageReference:t.join("."),propertyName:n}}static getContextPath(e){return e.includes("workarea")?e:LI(`${e}/workarea`)||""}static publishCaseValuesUpdate(e,t){const n=this.getContextPath(t.actionInContext);Object.entries(e.message).forEach((([e,t])=>{const r=this.transformReference(e),{pageReference:a,propertyName:s}=this.extractReferenceParts(r);e.match(/\.\w+\[\d+\]\.\w+/)&&Ry.executeStateMachine(n,r,t,!0,{skipStateUpdate:!0});VC([{type:Xr,payload:{reference:r,value:t,context:n}},{type:ea,payload:{reference:r,value:t,context:n,pageReference:a,propertyName:s}}])}))}},{RESOURCE_TYPES:Kf}=Ur;const Qf=class{static openCase(e,t,n,r={}){const a={insKey:e,acTargetName:n,actionMgrID:Th.getNextActionMgrId(),context:t,...r},s=pa;r&&r.channelName?a.headers={[Fr.X_ORIGIN_CHANNEL]:r.channelName}:PA.isWSSPortal()&&(a.headers={[Fr.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Th.actionManagerPromise(s,a.actionMgrID);return VC({type:s,payload:a}),o}static openAssignment(e,t,n,r={}){const a={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:Th.getNextActionMgrId(),context:t,...r},s=ya;r&&r.channelName?a.headers={[Fr.X_ORIGIN_CHANNEL]:r.channelName}:PA.isWSSPortal()&&(a.headers={[Fr.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Th.actionManagerPromise(s,a.actionMgrID);return VC({type:s,payload:{...a}}),o}static createCase(e,t,n,r={}){const a=ua,s={class:e,acTargetName:n,actionMgrID:Th.getNextActionMgrId(),context:t,...r};r&&r.channelName?s.headers={[Fr.X_ORIGIN_CHANNEL]:r.channelName}:PA.isWSSPortal()&&(s.headers={[Fr.X_ORIGIN_CHANNEL]:"WSS"});const{promise:o}=Th.actionManagerPromise(a,s.actionMgrID);return VC({type:a,payload:{...s}}),o}static getNextWork(e,t,n={}){const r=ya,a={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:Th.getNextActionMgrId(),context:e,...n},{promise:s}=Th.actionManagerPromise(r,a.actionMgrID);return VC({type:r,payload:{...a}}),s}static getOpenedCaseItems(e){const t=[],n=II(e);if(n){const{items:r={}}=n,a=Object.keys(r),s=$I(e);a.forEach((n=>{if(r[n]&&(r[n].resourceType===Kf.CASE||r[n].resourceType===Kf.ASSIGNMENT||r[n].resourceType===Kf.OBJECT)){const{key:a="",context:o}=r[n],i=r[n],c=a.substring(a.indexOf(" ")+1),l=HC(".caseTypeID",Fr.CASE_INFO.CASE_INFO,o),d=s===n;t.push({...i,key:a,workID:a,caseID:c,className:l,context:o,containerItemID:n,target:e,active:d})}}))}return t}static getCaseDetails=(e,t)=>{if(!e)return Promise.reject(new Error("Case ID is required"));const n={caseID:e},{restApi:r,reqType:a}=i_(za,n),s={},o=Vr.getRemoteHeaderFromSourceClass(t??"");return o&&(s.RemoteSystemID=o),Wu(r,{method:a,headers:s})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=i_("getBulkActions"),r=e.map((e=>({ID:e}))),a=r.length,s=a/5,o={},i=[];for(let e=0;e<a;e+=s)o.cases=r.slice(e,e+s),o.cases.length&&i.push(Wu(t,{method:n,body:o}));const c=await Promise.all(i);let l=[];for(let e=0;e<c.length;e+=1)0===e?l=c[e].data.availableActions:l.length&&(l=l.filter((t=>c[e].data.availableActions.some((e=>t.ID===e.ID)))));return l};static getCaseBulkActionsByCaseTypeID=async e=>{const t={casetypeID:e},{restApi:n,reqType:r}=i_("getCaseBulkActions",t),a=await Wu(n,{method:r});let s=[];return a.data?.availableActions?.length&&(s=a.data.availableActions),s};static getAssignmentBulkActions=async e=>{const{restApi:t,reqType:n}=i_("getAssignmentBulkActions"),r={assignments:e.map((e=>({ID:e})))},a=await Wu(t,{method:n,body:r});return a.data?.availableActions??[]}};class Jf{static CLOSE_CONTAINER_ITEM_EVENT=Ur.PUB_SUB_EVENTS.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM;static objectRedirectionSubIds={};static truncateNamespace(e){let t=e;return!Mr.isNamespaceEnabled()&&e&&e.includes("__")&&(t=e.substring(e.indexOf("__")+2)),t}static handleOpenObject(e){const{ObjectID:t}=e;let n;({ActionName:n}=e),n=this.truncateNamespace(n);const r=Nh.getComponentCache("lastActionID")||"";if("string"==typeof r&&r?.toLowerCase()!==n?.toLowerCase())return;let a=!1;const s=$I("app/modal");s&&(a=CI("app/modal",s)?.isMinimizable??!1),!s||a?Qf.openCase(t,Fr.APP.APP,Fr.PRIMARY,{isAutoRedirection:!0}):gu.subscribe(this.CLOSE_CONTAINER_ITEM_EVENT,(e=>{e?.containerItemID===s&&(gu.unsubscribe(this.CLOSE_CONTAINER_ITEM_EVENT,"closeContainerItemForRedirection"),Qf.openCase(t,Fr.APP.APP,Fr.PRIMARY,{isAutoRedirection:!0}))}),"closeContainerItemForRedirection",!0)}static handleRefreshObject(e){Qf.openCase(e,Fr.APP.APP,Fr.PRIMARY,{forceRefresh:!0})}static handleObjectRedirection(e,t){const{message:n,filter:r}=e,{caseId:a,currUserID:s}=t;if(r?.criteria?.CurrentObjectID!==a||r?.criteria?.UserID?.toLowerCase()!==s?.toLowerCase())return;const{RedirectionType:o}=n||{};switch(o){case"OpenObject":this.handleOpenObject(n);break;case"RefreshObject":this.handleRefreshObject(a)}}static subscribeToRedirection(e){const t=PA.getOperatorIdentifier()||"",n={matcher:"REDIRECTION",criteria:{CurrentObjectID:e,UserID:t?.toLowerCase()}},r=ag.subscribe(n,(n=>{this.handleObjectRedirection(n,{caseId:e,currUserID:t})}));this.objectRedirectionSubIds[e]=r}static unsubscribeToRedirection(e){ag.unsubscribe(this.objectRedirectionSubIds[e]),delete this.objectRedirectionSubIds[e]}static subscribeToEvent(e,t){let n=null;if(e===Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD?n=e=>{const{caseId:t}=e;this.objectRedirectionSubIds[t]||this.subscribeToRedirection(t)}:e===Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD&&(n=e=>{const{caseId:t}=e;this.objectRedirectionSubIds[t]&&this.unsubscribeToRedirection(t)}),!n)throw new Error(`Unhandled eventKey: ${e}`);gu.subscribe(e,n,t)}static unsubscribeToEvent(e,t){gu.unsubscribe(e,t)}static subscribeToCaseEvents(){this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_open_for_redirection"),this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_close_for_redirection")}static unsubscribeToCaseEvents(){this.unsubscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_open_for_redirection"),this.unsubscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_close_for_redirection")}}const Xf=Jf,Zf=e=>{if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}},eg=()=>{const e=PA.getFeatureMap()?.pyMessageSequencingDelayInMS;if("number"!=typeof e&&"string"!=typeof e)return 100;const t=Number(e);return Number.isFinite(t)&&t>0&&t<=3e3?t:100};class tg{streams=new Map;arrivalCounter=0;enqueue(e,t,n){const{sequenceStreamId:r}=e,a={sequenceNumber:Zf(e.sequenceNumber),timestamp:Zf(e.timestamp),arrival:this.arrivalCounter,data:t};this.arrivalCounter+=1;const s=this.streams.get(r);if(s)return s.entries.push(a),void(s.entries.length>=20&&(console.warn(`SequencingBuffer: stream "${r}" reached 20 held messages; delivering now, later messages may arrive out of order`),this.flushStream(r)));this.streams.set(r,{entries:[a],dispatch:n,timer:setTimeout((()=>this.flushStream(r)),eg())})}flushAll(){Array.from(this.streams.keys()).forEach((e=>this.flushStream(e)))}flushStream(e){const t=this.streams.get(e);t&&(clearTimeout(t.timer),this.streams.delete(e),tg.sortEntries(e,t.entries),t.entries.forEach((n=>{try{t.dispatch(n.data)}catch(t){console.error(`SequencingBuffer: delivering a message of stream "${e}" failed`,t)}})))}static sortEntries(e,t){t.every((e=>void 0!==e.sequenceNumber))?t.sort(tg.compareBySequenceNumber):t.every((e=>void 0!==e.timestamp))?t.sort(tg.compareByTimestamp):console.warn(`SequencingBuffer: stream "${e}" delivered in receiving order because ${tg.describeViolation(t)}`)}static describeViolation(e){return e.some((e=>void 0===e.sequenceNumber&&void 0===e.timestamp))?"a message has no ordering key":"messages mix sequenceNumber-only and timestamp-only ordering keys"}static compareBySequenceNumber(e,t){return e.sequenceNumber!==t.sequenceNumber?(e.sequenceNumber??0)-(t.sequenceNumber??0):e.timestamp!==t.timestamp?void 0===e.timestamp?1:void 0===t.timestamp?-1:e.timestamp-t.timestamp:e.arrival-t.arrival}static compareByTimestamp(e,t){return e.timestamp!==t.timestamp?(e.timestamp??0)-(t.timestamp??0):e.arrival-t.arrival}}const ng=new tg;class rg{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new wf;static refreshB2SOffset=10;static agentSubscribeIdMap=new Map;static filterKeyToSubscriberIdMap=new Map;static get offlineEnabled(){return"undefined"!=typeof navigator&&(navigator.userAgent||"").includes("pxUsesOffline")}static isAuthenticated=!1;static initConnection(e){if(!e)return;const{messagingService:t}=e;if(!t||t&&t.length<=6)return;const n=fh.b2sJWT;if(!n||n.length<4)return;this.webSocket&&(ng.flushAll(),this.webSocket.close(),this.cleanSocketListeners());const r=t.endsWith("/")?t+"ws":t+"/ws";try{const e=new WebSocket(`${r}`);this.webSocket=e,this.boundHandleOnOpen=this.handleOnOpen.bind(this),this.boundHandleOnMessage=this.handleOnMessage.bind(this),this.boundHandleOnError=this.handleOnError.bind(this),this.boundHandleOnClose=this.handleOnClose.bind(this),e.addEventListener("open",this.boundHandleOnOpen),e.addEventListener("message",this.boundHandleOnMessage),e.addEventListener("error",this.boundHandleOnError),e.addEventListener("close",this.boundHandleOnClose)}catch(e){console.log(e)}}static handleOnError(e){this.getTokenExpiryTime()<=0&&(clearInterval(this.reInitInterval),this.reInitInterval=void 0,this.isAuthenticated=!1),console.error("web socket error - readyState:",this.webSocket?.readyState,"| isTrusted:",e?.isTrusted)}static handleOnClose(e){ng.flushAll(),null!==this.serviceAliveHandler&&(clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=null),this.isAuthenticated=!1,console.debug("web socket closed - code:",e?.code,"| wasClean:",e?.wasClean),e&&4001===e.code||this.connectionConfig?.disableReInit||this.reInitInterval||this.getTokenExpiryTime()<=0||this.reInitialization()}static handleOnOpen(){if(clearInterval(this.reInitInterval),this.reInitInterval=void 0,null!==this.webSocket&&1===this.webSocket.readyState){const e=fh.b2sJWT;if(!e||e.length<4)return;this.publishMessage({token:e})}}static unsubscribeAgentMessageCaseValues(e){if(e.assignmentID){const t=rg.agentSubscribeIdMap.get(e.assignmentID);rg.unsubscribe(t??""),rg.agentSubscribeIdMap.delete(e.assignmentID)}}static subscribeAgentMessageCaseValues(e){const t={matcher:"COACH_UPDATE",criteria:{caseId:e.caseKey,assignmentId:e.assignmentID}},n=rg.subscribe(t,(t=>{zf.publishCaseValuesUpdate(t,e)}));rg.agentSubscribeIdMap.set(e.assignmentID,n)}static handleOnMessage(e){if(null!==e&&"ALIVE"===e.data)null===this.isServiceAlive&&this.checkLiveliness(Fr.PRIORITY.PING),this.isServiceAlive=!0;else{let t=null;try{t=JSON.parse(e.data)}catch(t){console.error("Invalid data received from messaging service",e.data)}if(t&&t.msgId&&this.webSocket?.send(`{"ack":"${t.msgId}"}`),(e=>!!e?.filter)(t))"string"==typeof t.sequencing?.sequenceStreamId&&""!==t.sequencing.sequenceStreamId?ng.enqueue(t.sequencing,t,(e=>this.dispatchMessage(e,!0))):(t.sequencing&&console.warn("Message has a sequencing block without a usable sequenceStreamId; delivering it without ordering"),this.dispatchMessage(t));else if(t?.tokenExpiryTime){gu.subscribe(Fr.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_LOAD,rg.subscribeAgentMessageCaseValues),gu.subscribe(Fr.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_UNLOAD,rg.unsubscribeAgentMessageCaseValues),this.isAuthenticated=!0,this.setTokenExpiryTime({tokenExpiryTime:t.tokenExpiryTime});const e=1e3*(this.getTokenExpiryTime()-this.refreshB2SOffset);setTimeout((()=>this.refreshB2STokenReInit()),e),this.inProgressSubscriptions.forEach((({messageSubscriber:e,id:t})=>{this.subscribeToSocket(e,t)})),this.inProgressSubscriptions=[],this.inProgressMessages.forEach((e=>{this.publishMessage(e)})),this.inProgressMessages=[]}else console.error("filter missing from received data from messaging service",e.data)}}static dispatchMessage(e,t=!1){const{matcher:n,criteria:r}=e.filter;delete r.environmentID,r.productionLevel&&delete r.productionLevel,this.dispatchToSubscribers(n,r,e,t)}static dispatchToSubscribers(e,t,n,r=!1){Object.keys(this.subscribers).forEach((a=>{const s=this.subscribers[a];if(s?.filter&&s.filter.matcher===e&&aS.isEqual(s.filter.criteria,t)){if(!r)return void s.messageHandler(n);try{s.messageHandler(n)}catch(e){console.error(`Subscriber "${a}" failed while handling a sequenced message`,e)}}}))}static reInitialization(e){this.reInitInterval||(Object.keys(this.subscribers).forEach((e=>{this.unsubscribe(e,!0)})),Object.keys(this.subscribers).forEach((e=>{this.inProgressSubscriptions.push({messageSubscriber:this.subscribers[e],id:e})})),e?this.initConnection(this.connectionConfig):this.reInitInterval=setInterval((()=>{this.initConnection(this.connectionConfig)}),5500))}static checkLiveliness(e){!1===this.isServiceAlive?this.reInitialization(!0):this.isServiceAlive=!1,null!==this.serviceAliveHandler&&clearTimeout(this.serviceAliveHandler),this.serviceAliveHandler=setTimeout((()=>{this.checkLiveliness(e)}),e)}static setConnectionConfig(e){this.connectionConfig=e}static cleanSocketListeners(){null!==this.webSocket&&(this.webSocket.removeEventListener("open",this.boundHandleOnOpen),this.webSocket.removeEventListener("message",this.boundHandleOnMessage),this.webSocket.removeEventListener("error",this.boundHandleOnError),this.webSocket.removeEventListener("close",this.boundHandleOnClose))}static disconnect(){null!==this.webSocket&&(this.cleanSocketListeners(),ng.flushAll(),this.webSocket.close(),this.webSocket=null)}static getFilterKey(e){return`${e.matcher}:${JSON.stringify(e.criteria)}`}static findExistingSubscriberId(e){return this.filterKeyToSubscriberIdMap.get(this.getFilterKey(e))}static subscribe(e,t,n,r){this.connectionsCount+=1;const a=r||`${Date.now()}_${this.connectionsCount}`;if("COACH_UPDATE"===e.matcher){const t=this.findExistingSubscriberId(e);if(t)return t}const s=new xf(e,t,n);return null!==this.webSocket&&1===this.webSocket.readyState&&this.isAuthenticated?(this.subscribeToSocket(s,a),a):(this.inProgressSubscriptions.push({messageSubscriber:s,id:a}),e&&this.filterKeyToSubscriberIdMap.set(this.getFilterKey(e),a),this.offlineEnabled&&(this.subscribers[a]=s),null===this.webSocket&&this.initConnection(this.connectionConfig),a)}static subscribeToSocket(e,t){this.subscribers[t]=e,e.filter&&this.filterKeyToSubscriberIdMap.set(this.getFilterKey(e.filter),t);if(Object.keys(this.subscribers).filter((t=>this.subscribers[t]===e)).length>1)return;const n={filter:e.filter,subscribe:{id:t}};this.webSocket?.send(JSON.stringify(n))}static unsubscribe(e,t){if(this.subscribers[e]){if(!t){const t=this.subscribers[e].filter;t&&this.filterKeyToSubscriberIdMap.delete(this.getFilterKey(t)),delete this.subscribers[e]}const n={unsubscribe:{id:e}};null!==this.webSocket&&1===this.webSocket.readyState&&this.webSocket.send(JSON.stringify(n))}this.offlineEnabled&&!t&&this.removeFromInProgressSubscriptions(e)}static removeFromInProgressSubscriptions(e){const t=this.inProgressSubscriptions.findIndex((t=>t.id===e));if(-1!==t){const e=this.inProgressSubscriptions[t].messageSubscriber.filter;e&&this.filterKeyToSubscriberIdMap.delete(this.getFilterKey(e)),this.inProgressSubscriptions.splice(t,1)}}static publishMessage(e){null!==this.webSocket?null===this.webSocket||1!==this.webSocket.readyState?this.inProgressMessages.push(e):this.webSocket.send(JSON.stringify(e)):console.error("Web socket not initialized.")}static getUserPresence=()=>this.userPresence;static dispatchLocalMessage(e){const{matcher:t,criteria:n,message:r={}}=e,{environmentID:a,productionLevel:s,...o}=n,i={msgId:`local_${Date.now()}`,filter:{matcher:t,criteria:o},message:r};this.dispatchToSubscribers(t,o,i)}static getCaseSubscription=e=>Yf.getOrCreateSubscription(e);static initObjectRedirectionSubscription=()=>Xf.subscribeToCaseEvents();static refreshB2STokenReInit=async()=>{if($f()){const e={body:{B2SToken:fh.b2sJWT}};th("refreshB2S",e).then((e=>{const{newB2SToken:t}=e.data;t&&t.length>30?(fh.b2sJWT=t,this.setTokenExpiryTime({tokenExpiryTime:Math.round(Date.now()/1e3)+60}),this.webSocket?.close()):console.log("refreshB2S: invalid b2s length")})).catch((e=>{console.log(`refreshB2S: error occurred while fetching: ${e}`)}))}else if(!rh("refreshB2S")){nh("/uas/api/v1/isolations/token/websocket-ticket",{method:"GET",withoutDefaultHeaders:!1},"").then((e=>{const{token:t}=e.data;t&&(fh.b2sJWT=t,this.setTokenExpiryTime({tokenExpiryTime:Math.round(Date.now()/1e3)+60}),this.webSocket?.close())})).catch((e=>{console.error(`websocket-ticket: error occurred while fetching: ${e}`)}))}};static getTokenExpiryTime=()=>{const e=Math.round(Date.now()/1e3);return this.tokenExpiryTime-e};static setTokenExpiryTime=e=>{this.tokenExpiryTime=e.tokenExpiryTime};static clearContext(e){Object.keys(this.subscribers).forEach((t=>{this.subscribers[t].contextName===e&&this.unsubscribe(t)})),this.userPresence.clearContext(e)}}const ag=rg;const sg=class{constructor(){this.records=[],this.maxRecords=0,this.isDirty=!1}getRecords(e){if(Number.isInteger(e?.pageNumber)&&Number.isInteger(e?.pageSize)){const t=[],{pageNumber:n,pageSize:r}=e,a=n*r;let s=a-r;for(;s<a;s+=1){if(!this.records[s])return this.maxRecords===s?t:[];t.push(this.records[s])}return t}return this.records}mergeRecords(e,t){if(Number.isInteger(t?.pageNumber)&&Number.isInteger(t?.pageSize)){const{pageNumber:n,pageSize:r}=t,a=n*r;let s=0;for(let t=a-r+1-1;t<a;t+=1)this.records[t]=e[s],s+=1;if(e.length<r){const t=(n-1)*r+e.length;this.setMaxRecordsCount(t)}}else e||(e=[]),Array.isArray(this.records)&&Array.isArray(e)&&(this.records=XC(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const og=new class{SUBSCRIPTION_STATUS_FAILED="FAILED";SUBSCRIPTION_STATUS_SUCCESS="SUCCESS";DATAPAGE_NOT_CACHED="Data Page Not Cached";DUPLICATE_SUBSCRIPTION_ID="Duplicate Subscription Id";MISSING_MANDATORY_FIELD="Missing Mandatory Field(s)";constructor(){this.dataStore={},this.dataStoreMeta={},this.subscribers={},this.dataPageSubscribers={},this.isCacheEnabled=!0,this.subscribedDataPageNames=new Map}getDataViewParameters(e,t){if(!e||!t)return e;if(!t.parameters)return{};const n=Array.isArray(t.parameters)?t.parameters:[t.parameters],r=new Set(n.map((e=>e.name))),a={};return Object.keys(e).forEach((t=>{r.has(t)&&(a[t]=e[t])})),a}resolveParameterValue(e,t,n,r,a){return aS.resolveParameterValue(e,t,n,r,a)}formatParameterValue(e,t,n,r,a){return aS.formatParameterValue(e,t,n,r,a)}resolveAndFormatParameters(e,t,n,r,a){return aS.resolveAndFormatParameters(e,t,n,r,a)}getData(e,t,n,r){const a=this.generateHash(e,t,r);if(this.dataStore[e]&&this.dataStore[e][a]){const t=this.dataStore[e][a];return t.isDirty?[]:t.getRecords(n)}return[]}async getDataAsync(e,t,n={},r,a,s={}){const o=IC(e),i=this.getDataViewParameters(n,o);s.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e));const c={skipClearErrorMessages:!0,...s};if(!this.isCacheable(e,a)||s.invalidateCache){const n=await this.fetchData(e,i,r,a,t,c);return{...n.data,data:this.isCacheable(e,a)?this.mergeDataStore(e,i,r,a,n):n.data?.data??[],pageNumber:n?.data?.pageNumber,pageSize:n?.data?.pageSize,queryStats:n?.data?.queryStats,status:n?.status}}const l=this.getData(e,i,r,a);if(l.length>0)return Promise.resolve({data:l});const d=await this.fetchData(e,i,r,a,t,c);return{...d.data,data:this.mergeDataStore(e,i,r,a,d),pageNumber:d?.data?.pageNumber,pageSize:d?.data?.pageSize,queryStats:d?.data?.queryStats,status:d?.status}}async getPageDataAsync(e,t,n={},r={}){const a=this.generateHash(e,n,null);if(r.purgeDataPageCache&&(this.dataStore[e]={},this._removeDataStoreMetaEntry(e)),this.isCacheable(e)&&this.dataStore[e]&&this.dataStore[e][a]){if(!r?.invalidateCache)return Promise.resolve(this.dataStore[e][a]);delete this.dataStore[e][a],this._removeDataStoreMetaEntry(e,n,a)}const{restApi:s,reqType:o}=i_(Fr.GET_PAGE_DATA,{dataViewName:e,dataViewParameters:encodeURIComponent(JSON.stringify(n))}),i={method:o,...r.skipClearErrorMessages&&{skipClearErrorMessages:r.skipClearErrorMessages}};if(r.enableStreaming){const e=r.streamOptions||{};Object.assign(i,{responseType:"stream",adapter:"fetch",headers:{Accept:"text/event-stream"},...e})}const c=s&&n&&0===Object.keys(n).length?s.split("?")[0]:s;return Wu(c,i,t).then((t=>(this.isCacheable(e)&&(this.dataStore[e]={...this.dataStore[e],[a]:t.data},this._addDataStoreMetaEntry(e,n,a)),r.enableStreaming?t:t.data)))}subscribeToDataPageUpdates(e,t,n,r={}){if(!e||!t||!n)return!1;const a=this.generateHash(n,r,null);this.dataPageSubscribers[n]??={};const s=this.dataPageSubscribers[n];s[a]??={};const o=s[a];return this.subscribeToMessageService(n,e),!o[e]&&(o[e]??=t,!0)}unsubscribeToDataPageUpdates(e,t,n={}){if(!e||!t)return!1;const r=this.generateHash(t,n,null);delete this.dataPageSubscribers[t]?.[r]?.[e];const a=this.subscribedDataPageNames.get(t)??0;return a<=1?(this.subscribedDataPageNames.delete(t),e&&ag.unsubscribe(e)):this.subscribedDataPageNames.set(t,a-1),!0}unsubscribeToDatapageUpdates(e,t,n={}){return this.unsubscribeToDataPageUpdates(e,t??"",n)}_isDataPageCached(e,t){if(t&&aS.isObjectEmpty(t))return!!this.dataStore[e];const n=this.generateHash(e,t,null);return!!this.dataStoreMeta[e]?.[n]?.length}updateDataPageStore(e={}){Object.keys(e).forEach((t=>{this.dataStore[t]||(this.dataStore[t]={});const n=e[t],r=Mr.getDefaultQualifiedName("pxResults");Object.keys(n).forEach((n=>{if(this.dataStore[t][n]){this.dataStore[t][n].mergeRecords(e[t][n][r])}else{const a=new sg;this.dataStore[t][n]=a,a.mergeRecords(e[t][n][r]||[])}}))}))}_addDataStoreMetaEntry(e,t,n){const r=this.generateHash(e,t,null);this.dataStoreMeta[e]??={};const a=this.dataStoreMeta[e];a[r]??=[];const s=a[r];s.includes(n)||s.push(n)}_removeDataStoreMetaEntry(e,t,n){if(!e||t||n||(this.dataStoreMeta[e]={}),e&&t&&n){const r=this.generateHash(e,t,null);this.dataStoreMeta[e][r]=this.dataStoreMeta[e][r].filter((e=>e!==n))}}mergeDataStore(e,t,n,r,a){const s=this.generateHash(e,t,r),o=a?.data?.data;if(!o||0===o.length)return[];this.dataStore[e]||(this.dataStore[e]={}),this.dataStore[e][s]||(this.dataStore[e][s]=new sg);const i=this.dataStore[e][s];return i.mergeRecords(o,n),i.isDirty=!1,this._addDataStoreMetaEntry(e,t,s),i.getRecords(n)}isDataPage(e=""){return e.startsWith("D_")||e.startsWith("Declare_")||e.startsWith(Mr.getDefaultQualifiedName("D_"))||e.startsWith(Mr.getDefaultQualifiedName("Declare_"))}subscribeToUpdate(e,t,n,r,a,s){this.subscribers[e]=this.subscribers[e]||{},this.subscribers[e].callback=this.subscribers[e].callback||{},s&&!this.subscribers[e].callback?.[s]&&(this.subscribers[e].callback[s]=a),this.subscribeToCascadeUpdates(e,t,n,r,s)}unsubscribe(e,t,n,r,a){delete this.subscribers[e]?.callback?.[a],t&&t.length>0&&LC.unRegisterFields(n,r,t,a)}handleMessage(e){const{msgId:t,message:n}=e,{datapage:r,parameters:a=""}=n,s=this.subscribers[r];this.markDataInstanceDirty(r,""===a?null:JSON.parse(a)),t&&this._executeDataPageSubscriptions(e),!t&&s?.callback&&Object.keys(s.callback).forEach((t=>{s.callback?.[t](e.message)}))}markDataInstanceDirty(e,t){let n,r;if((!t||(n=this.generateHash(e,t,null),r=this.dataStoreMeta[e]?.[n],r?.push(this.generateHash(e,null)),r))&&this.dataStore[e]){Object.keys(this.dataStore[e]).filter((e=>!t||!r||r.includes(e))).forEach((t=>{this.dataStore[e][t].isDirty=!0}))}}_executeDataPageSubscriptions(e){const{message:t}=e,{datapage:n,parameters:r}=t,a=r?JSON.parse(r):null;if(this.dataPageSubscribers[n])if(a){const t=[];t.push(this.generateHash(n,a,null)),t.push(this.generateHash(n,null,null)),t.forEach((t=>{const r=this.dataPageSubscribers[n]?.[t]??{};Object.keys(r).forEach((t=>{r[t](e.message)}))}))}else{const t=this.dataPageSubscribers[n];Object.keys(t).forEach((n=>{const r=t[n];Object.keys(r).forEach((r=>{t[n][r](e.message)}))}))}}isPerInteraction(e){const t=IC(e);return!t||"reloadOncePerInteraction"===t.refreshStrategy?.type}disableCache(e){this.isCacheEnabled=!e}generateHash(e,t,n){const r=IC(e);let a=[];r||(a=Object.keys(t||{}).map((e=>({name:e}))));const s=r?.parameters||a;let o="",i=e;const c=[];return Array.isArray(s)&&s.forEach((e=>{t?.[e.name]?c.push(t[e.name]):c.push(e.defaultValue??Fr.NULL_STRING)})),n&&c.push(JSON.stringify(n)),c.join(Fr.HASH_DELIMITER)&&(o=aS.getHashedString(c.join(Fr.HASH_DELIMITER)),i=e+Fr.UNDERSCORE_STRING+o),i}async fetchData(e,t,n,r,a,s){const{additionalApiParams:{useExtendedTimeout:o=!1,includeTotalCount:i=!1}={},...c}=s,l={dataViewParameters:t};return i&&(l.includeTotalCount=!0),o&&(l.useExtendedTimeout=!0),n&&(l.paging=n),r&&(l.query=r),Sf.getData(e,l,a,c)}handleCascadeUpdate(){const{dataPageName:e,scope:t}=this;t.handleMessage({message:{datapage:e,parameters:""}})}subscribeToCascadeUpdates(e,t,n,r,a){t&&t.length>0&&LC.registerFields(n,r,t,this.handleCascadeUpdate.bind({dataPageName:e,scope:this}),a)}subscribeToMessageService(e,t){if(e&&this.subscribedDataPageNames.has(e)){const t=this.subscribedDataPageNames.get(e)??0;return void this.subscribedDataPageNames.set(e,t+1)}const n={matcher:"DATAPAGE_UPDATED",criteria:{datapage:e}};ag.subscribe(n,this.handleMessage.bind(this),void 0,t),this.subscribedDataPageNames.set(e,1)}isCacheable(e,t){return!(this.isPerInteraction(e)||!this.isCacheEnabled)&&!(t&&Object.keys(t).length>1)}};const ig=class{constructor(e,t,n,r,a=100,s=500){this.finalDataViewCall=e,this.combiner=t,this.comparator=n,this.separator=r,this.maxtime=a,this.maxsize=s,this.groupedDataViewArray=[]}findCombinableDataViewCall(e){return this.groupedDataViewArray.find((t=>this.comparator(t,e)))}dequeueAllDataViewCalls(){for(this.groupedDataViewArray.reverse();this.groupedDataViewArray.length>0;){const e=this.groupedDataViewArray.pop();this.finalDataViewCall(e).then((t=>{this.separator(e,t)}))}clearTimeout(this.timeoutId)}dequeueDataViewCallOnSizeExceed(e){const t=this.groupedDataViewArray.findIndex((t=>this.comparator(t,e)));this.groupedDataViewArray[t]&&(this.groupedDataViewArray.splice(t,1),this.finalDataViewCall(e).then((t=>{this.separator(e,t)})))}queueDataViewCall(e,t){let n,r,a=this.findCombinableDataViewCall(e);return n=new Promise((e=>{r=e})),a&&!a.dataViewCallMap[t]?(this.combiner(a,e),a.dataViewCallMap[t]={promise:n,resolve:r}):a?n=a.dataViewCallMap[t].promise:(a={...e,dataViewCallMap:{[t]:{promise:n,resolve:r}}},this.groupedDataViewArray.push({...e,dataViewCallMap:{[t]:{promise:n,resolve:r}}})),Object.keys(a.dataViewCallMap).length===this.maxsize?this.dequeueDataViewCallOnSizeExceed(a):(clearTimeout(this.timeoutId),this.timeoutId=setTimeout((()=>this.dequeueAllDataViewCalls()),this.maxtime)),n}};const cg=class{constructor(){this.bufferedDataQueues={}}getBufferedDataQueueForDataPage(e){return this.bufferedDataQueues[e]}addBufferedDataQueueForDataPage(e,t,n,r,a,s,o){return this.getBufferedDataQueueForDataPage(e)||(this.bufferedDataQueues[e]=new ig(t,n,a,r,s,o)),this.bufferedDataQueues[e]}},lg=(e,t)=>((e,t)=>1===Object.keys(e).length&&Object.keys(e).length===Object.keys(t).length)(e,t)&&((e,t)=>"EQ"===t.F0.comparator&&(e.F0.comparator===t.F0.comparator||"IN"===e.F0.comparator))(e,t)&&e.F0.ignoreCase===t.F0.ignoreCase,dg=e=>e.map((e=>e.field)),ug=(e,t)=>{const n=(e.query?.filter).filterConditions,r=(t.query?.filter).filterConditions;let a=(t.query?.filter).logic;const s=Object.keys(n).length;lg(n,r)?("EQ"===n.F0.comparator&&(e=>{const t=e?.F0.rhs?.value;e.F0.rhs={values:[t]},e.F0.comparator="IN"})(n),(n.F0.rhs?.values).push(r.F0.rhs?.value)):(Object.keys(r).forEach(((e,t)=>{const o=`F${s+t}`;n[o]=r[e],a=a.replace(e,o)})),(e.query?.filter).logic+=` OR ${a}`);const o=dg(e.query?.select);dg(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},pg=(e,t)=>((e,t)=>Object.keys(e.filterConditions).length%Object.keys(t.filterConditions).length==0&&!Object.keys(t.filterConditions).some((n=>e.filterConditions[n].lhs.field!==t.filterConditions[n]?.lhs.field)))(e.query?.filter,t.query?.filter)&&(((e,t)=>e.dataViewParameters&&t.dataViewParameters&&Object.keys(t.dataViewParameters).length===Object.keys(e.dataViewParameters).length&&!Object.keys(e.dataViewParameters).some((n=>"string"==typeof t.dataViewParameters?.[n]?e.dataViewParameters?.[n]!==t.dataViewParameters?.[n]:!aS.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),hg=(e,t)=>{const{data:n}=t,{dataViewCallMap:r,filterDataOnClient:a}=e;Object.keys(r).forEach((e=>{r[e].resolve({data:a(e,n)})}))},fg=e=>({combiner:ug,comparator:pg,separator:hg,...e}),gg=(e,t)=>{if("undefined"!=typeof window)try{window.sessionStorage.setItem(e,t)}catch(e){}},mg=(e,t="",n="IS_NULL")=>({comparator:n,lhs:{field:e},...t&&{rhs:{value:t}}}),yg=e=>null!=e&&"object"==typeof e&&!("then"in e);class Eg{constructor(e,t){this.isInitialised=!1,this.isQueryable=!0,this.dataSourceMetaData={},this.nonQueryableData=[],this.fetchedNQData=!1,this.previousSearchText=null,this.totalRecordCount=0,this.fetchedRecordCount=0,this.cache=new Map,this.keyCache=new Map,this.pageNumber=0,this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null,this.dataSource="",this.bufferInitialized=!1,e&&(this.listType=e.listType,this.dataSource=e.dataSource,e.enablePagination?(this.enablePagination=e.enablePagination,this.pageSize=e.pageSize):this.maxResultsDisplay=e.maxResultsDisplay,this.parameters=e.parameters,this.columns=e.columns,this.matchPosition=e.matchPosition,this.ignoreCase=!1!==e.ignoreCase,this.dataSourceMetaData=e.dataSourceMetaData,this.context=t)}static searchResultsCache={};static init(e,t){return new Promise(((n,r)=>{const a=[...e.columns.map((e=>e.value)),...Object.entries(e.parameters).map((([e,t])=>`${e}+${t}`)),e.matchPosition,e.maxResultsDisplay].join(Fr.HASH_DELIMITER),s=aS.getHashedString(a),o=`${e.dataSource}_${s}`,i=`__dataviewmetadata__${e.dataSource}`,c=Sf.getAppCacheKey(i);if("undefined"!=typeof window&&window.sessionStorage.getItem(c)){const a=JSON.parse(`${window.sessionStorage.getItem(c)}`);if(t&&Eg.searchResultsCache?.[t]?.[o])n(Eg.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&Eg.searchResultsCache?.persisted?.[o])n(Eg.searchResultsCache.persisted[o]);else{const s=new Eg(e,t);JSON.stringify(a.associationFilter)===JSON.stringify(e.associationFilter)?(s.dataSourceMetaData=a.dataSourceMetaData,s.isQueryable=a.isQueryable,s.isInitialised=a.isInitialised,s.associationFilter=a.associationFilter,Eg.initializeCache(t,e,o,s),n(s)):(s.associationFilter=e.associationFilter,s.propertyFilter=e.propertyFilter,s.fetchMetaData(t).then((r=>{gg(c,JSON.stringify({isQueryable:r.data.isQueryable,dataSourceMetaData:r.data,isInitialised:!0,associationFilter:e.associationFilter})),s.isQueryable=r.data.isQueryable,s.dataSourceMetaData=r.data,s.isInitialised=!0,Eg.initializeCache(t,e,o,s),n(s)})).catch((e=>{s.isInitialised=!1,r(e)})))}}else if(e.deferDatasource&&IC(e.dataSource)){const r=new Eg(e,t),a=IC(e.dataSource);r.isQueryable=!!a?.isQueryable,r.isInitialised=!0,r.dataSourceMetaData=a,gg(c,JSON.stringify({isQueryable:a?.isQueryable,dataSourceMetaData:a,isInitialised:!0})),r.context=t,Eg.initializeCache(t,e,o,r),n(r)}else{const a=new Eg(e,t);a.associationFilter=e.associationFilter,a.propertyFilter=e.propertyFilter,a.fetchMetaData(t).then((r=>{gg(c,JSON.stringify({isQueryable:r.data.isQueryable,dataSourceMetaData:r.data,isInitialised:!0,associationFilter:e.associationFilter})),a.isQueryable=r.data.isQueryable,a.dataSourceMetaData=r.data,a.isInitialised=!0,Eg.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,r(e)}))}}))}static bufferedDataView=new cg;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(fg(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Eg.searchResultsCache[e]}static initializeCache(e,t,n,r){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Eg.searchResultsCache[e]&&(Eg.searchResultsCache[e]={}),Eg.searchResultsCache[e][n]=r):(void 0===Eg.searchResultsCache.persisted&&(Eg.searchResultsCache.persisted={}),Eg.searchResultsCache.persisted[n]=r)}fetchMetaData(e){return Sf.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Eg.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>og.getDataAsync(this.dataSource,this.context,e.dataViewParameters,e.paging,e.query)),e.combiner,e.separator,e.comparator,e.waitTime,e.maxSize)}buildSchemaForQueryableBufferDP(e){return{...this.buildSchemaForQueryableDP(e),paging:void 0,filterDataOnClient:this.filterDataOnClient.bind(this)}}buildQueryWithKeys=(e,t,n)=>{const r=this.buildSelect(n),a=((e=[],t={},n="")=>{if(!e.length||!Object.keys(t))return;const r={};return e.forEach(((e,n)=>{const a=t[e];let s;s=a?mg(e,a,"EQ"):mg(e),r[`T${n+1}`]=s})),{logic:Object.keys(r).join(` ${n} `),filterConditions:r}})(e,t,"AND");return{select:r,...a&&{filter:a},...Sf.isDistinctResultsOnly(r)&&{distinctResultsOnly:"true"}}};buildSchemaForQueryableDPWithKeys=(e,t,n)=>({dataViewParameters:this.parameters,query:this.buildQueryWithKeys(e,t,n),paging:this.buildPageOptions()});getRowDataByKeys=async(e,t,n)=>this.memoizedGetRowDataByKeys(e,t,n);buildKeyCacheKey(e,t,n){const r=e.map((e=>[e,t[e]??""])),a=n?.columns?.map((e=>e.value));return JSON.stringify({filterEntries:r,columns:a,pageNumber:this.pageNumber})}memoizedGetRowDataByKeys(e,t,n){const r=this.buildKeyCacheKey(e,t,n);(n?.invalidateCache||n?.purgeDataPageCache)&&this.keyCache.delete(r);const a=this.keyCache.get(r);if(a)return a;const s=this.isQueryable?this.buildSchemaForQueryableDPWithKeys(e,t,n):this.buildSchemaForNonQueryableDP(),o=og.getDataAsync(this.dataSource,this.context,s.dataViewParameters,this.isQueryable?s.paging:void 0,this.isQueryable?s.query:void 0,{...n}).catch((e=>(this.keyCache.delete(r),Promise.reject(e))));return this.keyCache.set(r,o),o}getData(e,t){if(this.isQueryable){if(this.bufferInitialized)try{const t=this.buildSchemaForQueryableBufferDP(e);return Eg.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return og.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return og.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query,{...t})}return this.fetchNonQueryableResults(e,t)}getCachedResult(e,t){if(this.enablePagination&&yg(t)&&t.has(this.pageNumber))return t.get(this.pageNumber);const n=this.cache.get(e);return this.enablePagination||!n||yg(n)?void 0:n}handleCacheError(e,t){if(this.enablePagination){const t=this.cache.get(e);t&&yg(t)&&t.delete(this.pageNumber)}else this.cache.delete(e);return Promise.reject(t)}storeCacheResult(e,t){if(this.enablePagination){let n=this.cache.get(e);n&&yg(n)||(n=new Map,this.cache.set(e,n)),n.set(this.pageNumber,t)}else this.cache.set(e,t)}isResultCached(e){if(!this.isInitialised||!this.isValidDatasource()||this.context&&!nS(this.context))return!1;const t=e.toLowerCase(),n=this.cache.get(t);return!!n&&(!this.enablePagination||yg(n)&&n.has(this.pageNumber))}memoizedGetData(e,t){const n=e?.toLowerCase(),r=this.cache.get(n);if(this.isResultCached(e)&&r){const e=this.getCachedResult(n,r);if(e)return e}const a=this.getData(e,t).catch((e=>this.handleCacheError(n,e)));return this.storeCacheResult(n,a),a}fetchData(e,t=!1,n){return this.isValidDatasource()?this.context&&!nS(this.context)?Promise.resolve({data:[]}):this.isInitialised?(this.pageNumber=t?this.pageNumber:1,this.memoizedGetData(e??"",n)):Promise.reject(new Error):Promise.reject(new Error)}fetchPaginatedData(e){return this.pageNumber+=1,this.fetchData(e,!0)}fetchNonQueryableResults(e,t){if(void 0===e)return Promise.resolve({data:[]});if(this.fetchedNQData)return Promise.resolve({data:this.filterDataOnClient(e,this.nonQueryableData,t)});if(this.isNQDataFetchInProgress&&this.fetchNQDataPromise)return this.fetchNQDataPromise.then((()=>({data:this.filterDataOnClient(e,this.nonQueryableData,t)}))).catch((e=>Promise.reject(e)));if(this.dataSourceMetaData&&"structure"in this.dataSourceMetaData&&"list"===this.dataSourceMetaData.structure?.toLowerCase()){const n=this.buildSchemaForNonQueryableDP();return this.fetchNQDataPromise=og.getDataAsync(this.dataSource,this.context,n.dataViewParameters,void 0,void 0,t),this.isNQDataFetchInProgress=!0,new Promise(((n,r)=>{this.fetchNQDataPromise?.then((r=>(this.nonQueryableData=[...r.data],this.fetchedNQData=!0,n({data:this.filterDataOnClient(e,this.nonQueryableData,t)})))).catch((e=>r(e))).finally((()=>{this.isNQDataFetchInProgress=!1,this.fetchNQDataPromise=null}))}))}return Promise.resolve(null)}filterDataOnClient(e,t,n){const r=(n?.columns??this.columns)?.filter((e=>e.useForSearch)).map((e=>e.value));return t.reduce(((t,a)=>{const s=r?.some((t=>{const r=Eg.resolveEmbeddedPath(t),s=aS.getIn(a,r);return null!=s&&this.positionMatches(`${s}`,e,n)}));return s&&t.push({...a}),t}),[])}static resolveEmbeddedPath(e){return e.startsWith("!P!")||e.startsWith("!PL!")?e.substring(e.lastIndexOf("!")+1).replace(/:/g,"."):e}positionMatches(e,t,n){const r=n?.ignoreCase??this.ignoreCase,a=r?e.toLowerCase():e,s=r?t.toLowerCase():t;switch(n?.matchPosition??this.matchPosition){case"start":return a.startsWith(s);case"contains":return a.includes(s);case"equals":return a===s;default:return!1}}buildSelect(e){const t=[],n=[];return(e?.columns??this.columns)?.forEach((e=>{if(!n.includes(e.value)){n.push(e.value);const r={field:e.value};t.push(r)}})),t}buildFilters(e,t){const n=t?.matchPosition??this.matchPosition,r=t?.ignoreCase??this.ignoreCase,a={};let s=0;(t?.columns??this.columns)?.forEach((t=>{if(t.useForSearch){const o=`F${s}`;s+=1;const i={field:t.value},c={value:e};let l="CONTAINS";"start"===n?l="STARTS_WITH":"equals"===n&&(l="EQ");const d={...`${parseFloat(e)}`!==e==!0&&{ignoreCase:r?"true":"false"},lhs:i,rhs:c,comparator:l};a[o]=d}}));const o=Object.keys(a).join(" OR ");return{filterConditions:a,logic:o}}buildQuery(e,t){const n=this.buildSelect(t);return e?{select:n,filter:this.buildFilters(e,t),...Sf.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...Sf.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}}buildPageOptions(){return this.enablePagination?{pageNumber:this.pageNumber,pageSize:this.pageSize}:{maxResultsToFetch:this.maxResultsDisplay}}buildSchemaForQueryableDP(e,t){return{dataViewParameters:this.parameters,query:this.buildQuery(e,t),paging:this.buildPageOptions()}}buildSchemaForNonQueryableDP(){return{dataViewParameters:this.parameters}}isValidDatasource(){return!!this.dataSource}}const Ig=Eg;class Ag{constructor(){this.refreshMap={},this.propChangeRefreshMap={}}static initializeRefreshCache(e,t,n,r,a){void 0===e[t]&&(e[t]={}),e[t][n]=[{uniqueHash:r,callback:a}]}registerForRefresh(e,t,n,r,a){n=aS.convertClipboardPageToPageRefNotation(n);const s=r.split("/").join(Fr.HASH_DELIMITER),o=aS.getHashedString(s);if("PROP_CHANGE"===e)if(this.propChangeRefreshMap?.[a]?.[n]){this.propChangeRefreshMap[a][n].some((e=>e.uniqueHash===o))||this.propChangeRefreshMap[a][n].push({uniqueHash:o,callback:t})}else Ag.initializeRefreshCache(this.propChangeRefreshMap,a,n,o,t);else if(this.refreshMap?.[a]?.[`${e}-${n}`]){this.refreshMap[a][`${e}-${n}`].some((e=>e.uniqueHash===o))||this.refreshMap[a][`${e}-${n}`].push({uniqueHash:o,callback:t})}else Ag.initializeRefreshCache(this.refreshMap,a,`${e}-${n}`,o,t)}triggerPropChangeRefresh(e,t){const n=this.propChangeRefreshMap?.[t];if(!n)return!1;const r=cS.getPropertyValue(Fr.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,e,t),{interestPage:a=""}=r||{},s=e=>aS.convertPageRefToClipboardPageNotation(e).replace(`${Fr.CASE_INFO?.CASE_INFO_CONTENT}${a}`,"");if(n[e]){const t=s(e);return n[e].forEach((e=>e.callback(t))),!0}const o=Zd.getContextReferences(t)?.get(e),i=o&&cS.resolveContextTreeNodeProps(o.props)||{},{contextPageRef:c}=i;if(c&&n[c]){const e=s(c);return n[c].forEach((t=>t.callback(e))),!0}for(const t of Object.keys(n)){let r;if(aS.segmentsMatch(t,e)?r=e:c&&aS.segmentsMatch(t,c)&&(r=c),r){const e=s(r);return n[t].forEach((t=>t.callback(e))),!0}}return!1}triggerRefreshForType(e,t,n){return"PROP_CHANGE"===e?this.triggerPropChangeRefresh(t,n):!!this.refreshMap?.[n]?.[`${e}-${t}`]&&(this.refreshMap[n][`${e}-${t}`].forEach((e=>e.callback())),!0)}deRegisterForRefresh(e){delete this.propChangeRefreshMap[e],delete this.refreshMap[e]}}const Cg=new Ag;const Sg=class{static cleanCaches(e){LC.purgeCascadeFields(e),Af.removeContext(e),Ig.clearContextedCache(e),gu.cleanContextSubscribers(e),wy(e),Zd.removeContextTreeNode(e),ag.clearContext(e),Cg.deRegisterForRefresh(e)}},_g="GET_DESCENDANTS",Ng={REFRESH_DATA:"REFRESH_DATA",WHENS:"WHENS",DECLARE_EXPRESSIONS:"DECLARE_EXPRESSIONS",REFRESH:"refresh",REFRESH_CASE_DATA:"refreshCaseData",REFRESH_ASSIGNMENT_DATA:"refreshAssignmentData",REFRESH_CASE_VIEW:"refreshCaseView",RECALCULATE:"recalculate",RECALCULATE_CASE_DATA:"recalculateCaseData",RECALCULATE_ASSIGNMENT_DATA:"recalculateAssignmentData",REFRESH_EXTERNAL_OBJECT:"refreshExternalObjectData",REFRESH_EXTERNAL_CASE_DATA:"refreshExternalCaseData"};const bg=new class{constructor(){this.runtimeParams={},this.runtimeParamsMap={}}setRuntimeParams(e){this.runtimeParams=e}getRuntimeParams(){return this.runtimeParams}setRuntimeParam(e,t){this.runtimeParamsMap[e]=t}getRuntimeParam(e){return this.runtimeParamsMap[e]}},Tg=e=>{gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},Pg=e=>{gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING,e)},Og=e=>{gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,e),gu.publish(Fr.PUB_SUB_EVENTS.EVENT_PREVIEW_DISMISS,e)},Dg=e=>{gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,e)},vg=e=>{gu.publish(Fr.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_LOAD,e)},Rg=e=>{gu.publish(Fr.PUB_SUB_EVENTS.ASSIGNMENT_EVENTS.ASSIGNMENT_UNLOAD,e)};const $g=new class{MISSING_CONTEXT_PARAM="context is required parameter";INVALID_CONTEXT_DETAILS="Invalid Context";INVALID_CONTEXT_OPERATION="Invalid Operation on Given Context";schedulePendingActionOnCompletion(e,t){const n=[],r=t.context_data?.blocking_action_counter??0,a=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let s=t.context_data?.is_deferred_action_in_progress??!1;if(r<=0){if(s)n.push({type:Ca,payload:{context:e,data:{context_data:{is_deferred_action_in_progress:!1}}}});else{if(!(a.length>0))return;{const t=a.shift();s=!s,n.push({type:Ca,payload:{context:e,data:{context_data:{deferred_action_queue:a,blocking_action_counter:r,is_deferred_action_in_progress:s}}}}),t&&n.push(t)}}VC(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=BC(e?.payload?.context);if(t){const n=[],r=t.context_data?.blocking_action_counter??0,a=t.context_data?.deferred_action_queue?[...t.context_data.deferred_action_queue]:[];let s=t.context_data?.is_deferred_action_in_progress??!1;return a.length<=0&&!s&&(r<=0?(n.push(e),s=!s):a.push(e),n.unshift({type:Ca,payload:{context:e.payload.context,data:{context_data:{deferred_action_queue:a,blocking_action_counter:r,is_deferred_action_in_progress:s}}}}),VC(n)),Promise.resolve()}return Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}handleDeferredActionCompletion(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t=BC(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(VC({type:Ca,payload:{context:e,data:{context_data:{is_deferred_action_in_progress:!1}}}}),this.schedulePendingActionOnCompletion(e,t),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}registerBlockingAction(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));return BC(e)?(VC({type:gs,payload:{context:e,isInitiateBlockingAction:!0}}),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_DETAILS))}deRegisterBlockingAction(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t={...BC(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(VC({type:gs,payload:{context:e,isInitiateBlockingAction:!1}}),t.context_data.blocking_action_counter-=1,this.schedulePendingActionOnCompletion(e,t),Promise.resolve()):Promise.reject(new Error(this.INVALID_CONTEXT_OPERATION))}cancelDeferredActionsOnError(e){if(!e)return;const t=BC(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&aS.rejectPendingActions(n.context_data.deferred_action_queue)&&(n.context_data.deferred_action_queue=[]),n.context_data?.blocking_action_counter&&(n.context_data.blocking_action_counter=0),n.context_data?.is_deferred_action_in_progress&&(n.context_data.is_deferred_action_in_progress=!1),VC({type:Ca,payload:{context:e,data:{...n}}}),bh.disableLoadingIndicator({context:e})}}isDeferredActionInProgress(e){if(!e)return Promise.reject(new Error(this.MISSING_CONTEXT_PARAM));const t=BC(e);return!(!t||!0!==t.context_data?.is_deferred_action_in_progress)}},xg=(e,t)=>{const n={},r=qh.getLookUpDataPage(e),a=qh.getDataPageKeys(r);if(a)for(const e of a)n[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];return{dataViewParameters:n,dataPageID:r,dataPageKeys:a}},wg=(e,t)=>{const n=qh.getSavableDataPage(e),r=qh.getDataPageKeys(n);return r?.forEach((e=>{e.isAlternateKeyStorage&&(e.keyName===e.linkedField||Object.keys(t).includes(e.linkedField))?e.keyName=t[e.linkedField]:e.isAlternateKeyStorage&&Object.keys(t).includes(e.keyName)&&e.keyName!==e.linkedField?(t[e.linkedField]=t[e.keyName],delete t[e.keyName]):e.keyName=t[e.keyName]})),{keys:t,dataPageID:n,dataPageKeys:r}},Mg=e=>{gu.publish(Ur.PUB_SUB_EVENTS.EVENT_CANCEL,e)},Lg=(e,t,n)=>zy.shouldUseUnifiedHandling()||(e=>{if(e.includes(Fr.ACTIONAREA))return!0;const t=IA(e),n=$I(`${t}/${Fr.ACTIONAREA}`);return Boolean(n?.includes(Fr.ACTIONAREA))})(e)?fa:aE(t,n??!1),Ug=(e,t,n)=>{const{callbacks:r}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?r?.cancel?.():r?.submit?.()}))},Fg=(e,t,n)=>n||t!==Fr.ACTION?e.getValue(Ur.CASE_INFO.ACTIVE_ACTION_ID):e.getValue(Ur.CASE_INFO.ASSIGNMENTACTION_ID),jg=(e,t)=>{t&&(e.remoteCaseMeta=t)};const kg=class{MSG_CLASSNAME_REQUIRED="className is required parameter";MSG_CLASSNAME_STRING="className must be a string";MSG_ACTION_ID_REQUIRED="actionID is required parameter";MSG_ACTION_ID_STRING="actionID must be a string";MSG_ACTION_NAME_REQUIRED="actionName is required parameter";MSG_ACTION_NAME_STRING="actionName must be a string";MSG_KEY_PROPERTIES_REQUIRED="keyProperties is required parameter";MSG_DATAVIEWID_REQUIRED="dataViewID is required parameter";MSG_DATAVIEWID_STRING="dataViewID must be a string";MSG_CONTAINERITEMID_REQUIRED="containerItemID is required parameter";MSG_CONTAINERITEMID_STRING="containerItemID must be a string";MSG_PAGENAME_REQUIRED="pageName is required parameter";MSG_PAGENAME_STRING="pageName must be string";MSG_INSIGHTID_REQUIRED="insightID is required parameter";MSG_DASHBOARDID_REQUIRED="DashboardID is required parameter";MSG_ACTIVE_SUGGESTION_UNATTENDED="You must accept or decline autofilled fields.";MSG_CASE_ID_REQUIRED="caseID is required parameter";MSG_CONTEXT_STRING="context must be string";MSG_SUBSCRIPT_VIEW_REQUIRED="subscriptView is required";constructor(e){this.c11nEnv=e}shouldDeleteCaseInCreateStage=(e,t,n)=>!e&&t||n;getCaseID=e=>e.caseID||this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID))||e?.links?.open?.href?.split("/")?.[2];getSaveActionPayload=(e,t=!1,n=!1)=>{const r=e,a=r&&r.includes(Fr.MODAL),s=this.c11nEnv.getValue(Ur.CASE_INFO.CASE_INFO_ID),o=this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),i=this.c11nEnv.getValue(Ur.CASE_INFO.ACTIVE_ACTION_ID)?this.c11nEnv.getValue(Ur.CASE_INFO.ACTIVE_ACTION_ID):this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENTACTION_ID),c=this.c11nEnv.getContainerName(),l=this.c11nEnv.getValue(Ur.CASE_INFO.CASE_TYPE_ID),d=t?void 0:Gy(this.c11nEnv.getContextName()),u=this.c11nEnv.getValue("isProcessAction","isProcessAction");return uS.buildActionObject({context:r,containerItemID:e,assignmentID:o,actionID:i,caseID:s,containerName:c,caseType:l,isModalAction:a,isFormValid:d,isProcessAction:u,saveOnly:t,autosave:n},this.c11nEnv)};actionsApiPromise=(e,t,n=!0)=>{let r,a,s="";s=t&&null!==t.actionMgrID?t.actionMgrID||"":Th.getNextActionMgrId();const o=new Promise(((e,t)=>{r=e,a=t}));if(!r||!a)throw new Error("resolveFn or rejectFn is not defined.");return Th.register(s,o,r,a,e,t,n),{actionMgrID:s,promise:o}};showDataObjectCreateView(e,t=Ur.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=uS.buildActionObject({viewName:t,className:e},this.c11nEnv),r=na,{promise:a}=this.actionsApiPromise(r,n);return VC({type:r,payload:{...n,containerName:Ur.MODAL,skipSemanticUrl:!0,isCreateDataObject:!0}}),a}cancelDataObject(e){if(!e)return Promise.reject(new Error("containerItemId is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=e;if(!cI(t)){return new Qh(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=Xa,r=uS.buildActionObject({containerItemID:e,context:t},this.c11nEnv),a=t&&t.includes(Fr.MODAL);VC({type:n,payload:{...r,isModalAction:a,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:s}=this.actionsApiPromise(n,r);return s.then((()=>{Mg({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=kC()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(Fr.DATA_CLASS_NOT_FOUND));if(mC(Ur.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW)){const t=this.handleSubscript.call(this,e,this.c11nEnv);if(t)return t}const r=qh.getSavableDataPage(n),a=ys,s=!!e&&e.includes(Fr.MODAL),o=uS.buildActionObject({containerItemID:e,dataPageID:r},this.c11nEnv),{promise:i}=this.actionsApiPromise(a,o);return VC({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:s,isFormValid:Gy(e)}}),i}deleteDataObject(e,t){if(!e)return Promise.reject(new Error("className is required parameter"));if(!t)return Promise.reject(new Error("keys is required parameter"));const n=Es,r=qh.getSavableDataPage(e),a=qh.getDataPageKeys(r),s={};if(a)for(const e of a)s[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const o=uS.buildActionObject({dataViewName:r,dataViewParameters:s},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o);return VC({type:"DELETE_DATA_OBJECT",payload:{...o}}),i}getDataObjectView(e,t,n={viewName:"",readOnly:!1,actionName:""}){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(!t)return Promise.reject(new TypeError(this.MSG_KEY_PROPERTIES_REQUIRED));if("object"!=typeof t)return Promise.reject(new TypeError("keyProperties must be a object"));const r=Is,{dataPageID:a,dataViewParameters:s}=xg(e,t),o=uS.buildActionObject({dataLookUp:a,keyProperties:t,requestPayload:s,viewName:n.viewName||Ur.VIEW_NAMES.DATA_OBJECT_EDIT_VIEW,containerName:Fr.MODAL,readOnly:n.readOnly,actionName:n.actionName},this.c11nEnv),{promise:i}=this.actionsApiPromise(r,o);return VC({type:"VIEW_DATA_OBJECT",payload:{...o}}),i}updateDataObject(e,t){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if(!t)return Promise.reject(new Error("keys is required parameter"));const{data:n}=kC()?.getState()||{},r=n[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(Fr.DATA_CLASS_NOT_FOUND));const{dataPageID:a,keys:s}=wg(r,t),o=As,i=e&&e.includes(Fr.MODAL),c=uS.buildActionObject({containerItemID:e,dataPageID:a,key:s},this.c11nEnv),l=n[e]?.caseInfo?.headers?.etag,{promise:d}=this.actionsApiPromise(o,c);return VC({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:Gy(e),etag:l}}),d}openDataObjectAction(e,t,n,r){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(!t)return Promise.reject(new TypeError(this.MSG_KEY_PROPERTIES_REQUIRED));if("object"!=typeof t)return Promise.reject(new TypeError("keyProperties must be a object"));if(!n)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if(!r)return Promise.reject(new Error(this.MSG_ACTION_NAME_REQUIRED));const a=Cs,{dataViewParameters:s,dataPageID:o,dataPageKeys:i}=xg(e,t),c=uS.buildActionObject({actionID:n,actionName:r,dataViewParameters:s,lookupDatapage:o,containerName:Fr.MODAL,dataViewPayload:i,context:this.c11nEnv.getContextName()},this.c11nEnv),{promise:l}=this.actionsApiPromise(a,c);return VC({type:a,payload:{...c}}),l}submitDataObjectAction(e,t,n,r){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));if(!t)return Promise.reject(new Error(this.MSG_KEY_PROPERTIES_REQUIRED));if(!n)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));const{data:a}=kC()?.getState()||{},s=a[e]?.dataInfo?.content?.classID;if(!s)return Promise.reject(new Error(Fr.DATA_CLASS_NOT_FOUND));const o=r?.jsActionQueryParams,i=IA(e),c=QI(i),l=CI(c,i)||{},{resourceType:d="",key:u=""}=l,p=Ss,{dataPageID:h,keys:f}=wg(s,t),g=uS.buildActionObject({containerItemID:e,actionID:n,resourceType:d,key:u,keys:f,savableDatapage:h,containerName:Fr.MODAL,context:e,jsActionQueryParams:o},this.c11nEnv);g.context=e;const m=a[e]?.caseInfo?.headers?.etag,{promise:y}=this.actionsApiPromise(p,g);return VC({type:p,payload:{...g,isFormValid:Gy(e),etag:m}}),y}createWork(e,t={flowType:"",containerName:"",openCaseViewAfterCreate:!1,modalOptions:{dockable:!1},startingFields:Object,remoteCaseMeta:{},channelName:""}){if(!e)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(e=Vr.getRemoteCaseClassBySourceClass(e)??e,window.pms?.plugins?.c11n?.createWork)return window.pms.plugins.c11n.createWork(e,Mr.getDefaultQualifiedName("pyStartCase"),t);const{dockable:n=!1}=t?.modalOptions||{};let r=t.theType?t.theType:(e=>{const t=zy.shouldUseUnifiedHandling();return zy.isExternalCaseType(e)?$s:zy.isExternalObject(e)?t?$s:"CREATE_EXTERNAL_OBJECT":t?ua:zy.isObjectCaseType(e)?"CREATE_OBJECT":ua})(e);const a=uS.buildActionObject({class:e,flowType:Mr.getDefaultQualifiedName("pyStartCase"),containerName:Fr.PRIMARY,openCaseViewAfterCreate:!0,...t,theType:r,modalOptions:{isDockable:n}},this.c11nEnv);jg(a,t.remoteCaseMeta);const{promise:s}=this.actionsApiPromise(r,a);if(a.headers={...a.headers},t.channelName?a.headers[Fr.X_ORIGIN_CHANNEL]=t.channelName:PA.isWSSPortal()&&(a.headers[Fr.X_ORIGIN_CHANNEL]="WSS"),r=this.handleRemoteCaseForCreateWork(e,a,r),yu.getPreviewMode()){a.debugInfo={debugId:aS.generateUniqueID()};const e=xu.getCoreHeadersFromContext(a?.context||""),t=String(e?.debugInfo?.[Fr.COREHEADER_APP_DEBUG_ID]||"");t&&r!==ua&&(a.debugInfo={debugId:t})}return VC({type:r,payload:{...a}}),s}handleRemoteCaseForCreateWork(e,t,n){if(Vr.isRemoteCase(e)){const{RemoteClassName:n,RemoteSystemID:r,name:a}=Vr.getRemoteCase(e);if(t.className=e,t.class=n,Th.setRemoteCaseHeaderByContext(t,r),Vr.isTraditionalRemoteCase(e)||Vr.isRemoteCaseVersionDifferent(e)){const r={className:e,name:a,action:Os,remoteClassName:n};return Th.setTraditionalRemoteCaseParams(t,r)}}return n}createCase(e,t={}){return this.createWork(e,{...t,theType:"CREATE_WORK"})}getDataObjectActions(e,t){if(!e)return Promise.reject(new Error(this.MSG_DATAVIEWID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_DATAVIEWID_STRING));const n=_a,r=uS.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:a}=this.actionsApiPromise(n,r);return VC({type:n,payload:{...r}}),a}getDescendants(e,t){if(!e)return Promise.reject(new Error(this.MSG_CASE_ID_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CONTEXT_STRING));const n=t||this.c11nEnv.getContextName(),r=uS.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:a}=this.actionsApiPromise("GET_DESCENDANTS",r),s=(o={...r,context:n},{type:_g,payload:o});var o;return VC(s),a}openWorkByHandle(e,t,n={}){if(!e)return Promise.reject(new Error("workID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("workID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(t=Vr.getRemoteCaseClassBySourceClass(t)??t,window.pms?.plugins?.c11n?.openWorkByHandle)return window.pms.plugins.c11n.openWorkByHandle(e,t);const r={insKey:e,acTargetName:n.targetContainer||Fr.PRIMARY,containerName:n.targetContainer||Fr.PRIMARY};let a=zy.shouldUseUnifiedHandling()||!zy.isObjectCaseType(t)?pa:"GET_OBJECT";const s=uS.buildActionObject(r,this.c11nEnv);jg(s,n.remoteCaseMeta);const{promise:o}=this.actionsApiPromise(a,s);return s.headers={...s.headers},n.channelName?s.headers[Fr.X_ORIGIN_CHANNEL]=n.channelName:PA.isWSSPortal()&&(s.headers[Fr.X_ORIGIN_CHANNEL]="WSS"),s.className=t,Vr.isRemoteCase(t)&&(a=this.setRemoteCaseParamsForOpenCase(s,t,a,n.remoteCaseMeta)),yu.getPreviewMode()&&n.targetContainer!==Fr.WORKAREA&&(s.debugInfo={debugId:aS.generateUniqueID()}),VC({type:a,payload:{...n,...s}}),o}setRemoteCaseParamsForOpenCase(e,t,n,r={}){const{RemoteSystemID:a,RemoteClassName:s,name:o}=Vr.getRemoteCase(t);if(Th.setRemoteCaseHeaderByContext(e,a),e.isRemoteCase=!0,e.remoteCaseClass=t,e.remoteCaseMeta=r,Vr.isTraditionalRemoteCase(t)||Vr.getRemoteAppPlatformVersion(a??"")){const n={className:t,name:o,action:vs,remoteClassName:s};return Th.setTraditionalRemoteCaseParams(e,n)}return n}openAssignment(e,t,n={isActionFromToDoList:!1,isChild:!1,context:"",viewType:"",skipBrowserSemanticUrlUpdate:!1,containerName:"",channelName:"",remoteCaseMeta:{}}){if(!e)return Promise.reject(new Error("assignmentID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("assignmentID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(t=Vr.getRemoteCaseClassBySourceClass(t)??t,window.pms?.plugins?.c11n?.openAssignment)return window.pms.plugins.c11n.openAssignment(e,t);const r={assignmentID:e,doDeleteCaseSummary:!0,containerName:n.containerName,isActionFromToDoList:n.isActionFromToDoList,isChild:!1,...void 0!==n.renderInline&&{renderInline:n.renderInline},...void 0!==n.pageName&&{pageName:n.pageName}};n.isChild&&(r.containerName=Fr.PRIMARY,r.isChild=n.isChild);let a=kh;const s=uS.buildActionObject(r,this.c11nEnv);jg(s,n.remoteCaseMeta);const{promise:o}=this.actionsApiPromise(a,s);if(s.headers=s.headers||{},n.channelName?s.headers[Fr.X_ORIGIN_CHANNEL]=n.channelName:PA.isWSSPortal()&&(s.headers[Fr.X_ORIGIN_CHANNEL]="WSS"),Vr.isRemoteCase(t)){const{RemoteClassName:e,RemoteSystemID:r,name:o}=Vr.getRemoteCase(t);if(Th.setRemoteCaseHeaderByContext(s,r),s.remoteCaseMeta=n.remoteCaseMeta,Vr.isTraditionalRemoteCase(t)||Vr.getRemoteAppPlatformVersion(r??"")){const n={className:t,name:o,action:Ds,remoteClassName:e};a=Th.setTraditionalRemoteCaseParams(s,n)}}s.className=t,s.activeItemCaseViewMode=this.c11nEnv.getValue("context_data.caseViewMode"),yu.getPreviewMode()&&![Fr.WORKAREA].includes(n.containerName)&&(s.debugInfo={debugId:aS.generateUniqueID()});const i={context:s.context||n.context,containerName:s.containerName||n.containerName,targetContainerName:s.containerName||n.containerName,viewType:s.viewType||n.viewType,skipBrowserSemanticUrlUpdate:n.skipBrowserSemanticUrlUpdate};return VC({type:a,payload:{...s,...i}}),o}finishAssignment(e,t={outcomeID:"",jsActionQueryParams:{}}){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));e.endsWith(Fr.ACTIONAREA)&&(e=$I(e)||e);const n=MI(e);let r=n;if(n?.includes(`/${Fr.WORKAREA}`)&&(r=n.substring(0,r?.lastIndexOf(`/${Fr.WORKAREA}`))),Wy(n)){const e=[{type:"error",message:this.c11nEnv.getLocalizationService().getLocalizedMessage(this.MSG_ACTIVE_SUGGESTION_UNATTENDED)}];return iu({messages:e,context:r,category:Ur.PAGE}),Promise.reject({type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR})}const a=t?.isTriggeredFromDifferentContext,{caseID:s,assignments:o,localActionID:i,caseActions:c,caseInfo:l,businessID:d,caseTypeID:u,caseTypeName:p}=sE(e,this.c11nEnv,{isTriggeredFromDifferentContext:a}),h=Qy(l);let f,g=!1;const m=c?.find((e=>e.ID===i));m?g="Case"===m?.type:f=BC(n);let{assignmentID:y}=sE(e,this.c11nEnv,{isTriggeredFromDifferentContext:a});f?.context_data?.actionType&&(g=f.context_data.actionType===Fr.CASE,y=y||f.context_data.assignmentID);const E=rE(o,y,i,l?.activeActionID),[I,A]=s.split(" "),C={class:I,actionID:E,assignmentID:y,caseID:s,workID:A,containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:g,doDeleteCaseSummary:!0,isInCreateStage:h,businessID:d,caseTypeID:u,caseTypeName:p};e?.includes(Fr.MODAL)&&(C.containerName=Fr.MODAL,C.isModalAction=!0),C.outcome=t.outcomeID,C.jsActionQueryParams=t.jsActionQueryParams,l?.isLocalAction&&(C.viewType=ty.FORM);const S=Lg(e,u,l?.isObjectWideAction),_=uS.buildActionObject(C,this.c11nEnv),{promise:N}=this.actionsApiPromise(S,_);return _.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||BC(n).context_data.isProcessAction,_.headers??={},PA.isWSSPortal()&&(_.headers[Fr.X_ORIGIN_CHANNEL]="WSS"),$g.executeOrQueueDeferredAction({type:S,payload:{..._,context:n}}),N}getNextWork(){if("HYBRID"===PA.getRenderingMode())return gu.publish(Ur.PUB_SUB_EVENTS.CASE_EVENTS.GET_NEXT_WORK,{userIdentifier:PA.getOperatorIdentifier()}),Promise.resolve();const e=kh,t=uS.buildActionObject({containerName:Fr.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return VC({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=kh,n=this.c11nEnv.getValue(Ur.CASE_INFO.CASE_INFO_ID),r=this.c11nEnv.getCaseSummary().headers,a=uS.buildActionObject({containerName:this.c11nEnv.getContainerName(),isOpenStage:!0,stageID:e},this.c11nEnv),{promise:s}=this.actionsApiPromise(t,a),o={type:t,payload:{...a,caseID:n,headers:r}};return VC(o),s}submitBulkAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t="SUBMIT_BULK_ACTION",n=this.c11nEnv.getValue(Ur.CASE_INFO.CASES),r=this.c11nEnv.getValue(Ur.CASE_INFO.ACTIVE_ACTION_ID),a=this.c11nEnv.getValue(Ur.CASE_INFO.IS_ASSIGNMENT),s={containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1};e&&e.includes(Fr.MODAL)&&(s.containerName=Fr.MODAL,s.isModalAction=!0);const o=uS.buildActionObject(s,this.c11nEnv),{promise:i}=this.actionsApiPromise(t,o),c=MI(e);return VC({type:t,payload:{...o,context:c,cases:n,actionID:r,isAssignment:a,isFormValid:Gy(c),classID:this.c11nEnv.getCurrentClassID()}}),i}submitBulkActionAsync(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t="SUBMIT_BULK_ACTION_ASYNC",n=this.c11nEnv.getValue(Ur.CASE_INFO.CASES),r=this.c11nEnv.getValue(Ur.CASE_INFO.ACTIVE_ACTION_ID),a={containerName:e.includes(Fr.MODAL)?Fr.MODAL:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1,isModalAction:e.includes(Fr.MODAL)},s=uS.buildActionObject(a,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,s),i=MI(e);return VC({type:t,payload:{...s,context:i,cases:n,actionID:r,isFormValid:Gy(i),classID:this.c11nEnv.getCurrentClassID()}}),o}openBulkAction(e,t){if(!e)return Promise.reject(new Error("actionID is required parameter for openBulkAction"));if("string"!=typeof e)return Promise.reject(new TypeError("actionID must be a string openBulkAction"));if(window.pms?.plugins?.c11n?.openBulkAction){const{callbacks:n}=t;return t.callbacks=null,window.pms.plugins.c11n.openBulkAction(e,t).then((e=>{"cancel"===e?n?.cancel?.():n?.submit?.()}))}const{selectedList:n,runningMode:r}=t,a=t.type,s={selectedList:n,vcName:t.target,actionName:t?.name,actionID:e,doDeleteCaseSummary:!0,localActionType:a,runningMode:r,...t},o="OPEN_BULK_ACTION",i=uS.buildActionObject(s,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return VC({type:o,payload:{...i}}),c}cancelBulkAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));return new Qh(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(VC({type:Xr,payload:{reference:Ur.CASE_INFO.APPROVALFLAG,value:Fr.APPROVED,context:e}}),this.finishAssignment(e)):Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED))}rejectCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(VC({type:Xr,payload:{reference:Ur.CASE_INFO.APPROVALFLAG,value:Fr.REJECTED,context:e}}),this.finishAssignment(e)):Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED))}resolveDuplicateCase(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const[,t]=this.c11nEnv.getValue(Ur.CASE_INFO.DUPLICATECASEINSKEY).split(" "),n={type:Xr,payload:{reference:Ur.CASE_INFO.DUPLICATECASEFLAG,value:Fr.DUPLICATE,context:e}},r={type:Xr,payload:{reference:Ur.CASE_INFO.DUPLICATECASEID,value:t,context:e}};return VC([n,r]),this.finishAssignment(e)}ignoreDuplicateCase(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t={type:Xr,payload:{reference:Ur.CASE_INFO.DUPLICATECASEFLAG,value:Fr.IGNORE,context:e}},n={type:Xr,payload:{reference:Ur.CASE_INFO.DUPLICATECASEID,value:"",context:e}},r={type:Xr,payload:{reference:Ur.CASE_INFO.DUPLICATECASEINSKEY,value:"",context:e}};return VC([t,n,r]),this.finishAssignment(e)}openLocalAction(e,t){if(!e)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_ACTION_ID_STRING));const n=this.getCaseID(t);if(window.pms?.plugins?.c11n?.openLocalAction)return t.caseID=n,Ug(window.pms.plugins.c11n.openLocalAction,e,t);const r=t.assignKey||this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),a=t.type,s={caseID:n,assignmentID:r,vcName:t.target,actionName:t?.name,assignKey:r,actionID:e,doDeleteCaseSummary:!0,localActionType:a,...t},o=t.containerName===Fr.ACTIONAREA?Ia:(e=>zy.shouldUseUnifiedHandling()||"Object"!==e.type&&!zy.isObjectCaseType(e?.caseClassName||"")&&!window.location.href.includes("/objects/")?Ia:"OPEN_OBJECT_ACTION")(t),i=uS.buildActionObject(s,this.c11nEnv);t.containerName!==Fr.ACTIONAREA&&t.containerName!==Fr.WORKAREA||(i.skipMergeAssignmentsAndActions=!1);const{promise:c}=this.actionsApiPromise(o,i),l=this.c11nEnv.getContextName(),d=FI(l)[0];let u;if(u=$I(d),u?.includes("actionarea")&&o===Ia)return VC({type:o,payload:{...i}}),c;if("Object"===t.type)return VC({type:o,payload:{...i}}),c;const p=$I(d),h=n!==this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID))&&p&&Vr.getRemoteHeaderByContext(p)||Vr.getRemoteHeaderByContext(l);if(Th.setRemoteCaseHeaderByContext(i,h),!d)return u=l,VC({type:o,payload:{...i,contextName:l,continueExecution:!1}}),c;const{continueExecution:f,containerItemID:g}=AI(l,n,d);if(u=g,!f||u&&"review"===kC()?.getState()?.data[u]?.context_data?.caseViewMode)return VC({type:o,payload:{...i,contextName:l,continueExecution:f}}),c;const m=u,y=m&&m.includes(Fr.MODAL),E=t.assignKey||this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),I=BC(u),A=I?.caseInfo?.assignments?I.caseInfo.assignments[0]?.actions[0]?.ID:void 0,C=this.c11nEnv.getContainerName(),S=this.c11nEnv.getValue(Ur.CASE_INFO.CASE_TYPE_ID),_=this.c11nEnv.getValue("isProcessAction","isProcessAction"),N=uS.buildActionObject({context:m,containerItemID:u,assignmentID:E,actionID:A,caseID:n,containerName:C,caseType:S,isModalAction:y,isFormValid:!0,isProcessAction:_},this.c11nEnv);N.context=u;const b=MI(u),T=this.c11nEnv.getCaseSummary(),P=Qy(T),O=uS.buildActionObject({caseID:n,containerItemID:u,cancelContext:b},this.c11nEnv);let D={};return y?(O.acTargetName=Fr.MODAL,O.isInCreateStage=P,O.isModalAction=y,D={...O}):D={...O,acName:js(this.c11nEnv.getContainerName(),O.context)},VC({type:o,payload:{...i,contextName:l,saveActionPayload:N,cancelActionPayload:D,continueExecution:f}}),c}openProcessAction(e,t){if(!e)return Promise.reject(new Error(this.MSG_ACTION_ID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_ACTION_ID_STRING));const n=this.c11nEnv.getValue(Ur.CASE_INFO.CASE_INFO_ID)||t.caseID;if(window.pms?.plugins?.c11n?.openProcessAction)return t.caseID=n,Ug(window.pms.plugins.c11n.openProcessAction,e,t);const r=this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID)||t.assignKey,a=t.type,s={caseID:n,assignmentID:r,vcName:t.target,actionName:t?.name,assignKey:r,actionID:e,doDeleteCaseSummary:!0,processActionType:a,isProcessAction:!0,...t},o=jh,i=uS.buildActionObject(s,this.c11nEnv),c=this.c11nEnv.getContextName(),l=FI(c)[0];let d=Vr.getRemoteHeaderByContext(c);if(!d&&l){const e=II(l);e?.accessedOrder.forEach((r=>{(t.caseID||n)===e.items[r].key&&(d=Vr.getRemoteHeaderByContext(e.items[r].context))}))}Th.setRemoteCaseHeaderByContext(i,d);const{promise:u}=this.actionsApiPromise(o,i),{containerItemID:p}=AI(c,n,l);return VC({type:o,payload:{...i,saveContainerItemID:p}}),u}navigateToStep(e,t){if(!e)return Promise.reject(new Error("stepID is required parameter"));if("string"!=typeof e)return Promise.reject(new TypeError("stepID must be a string"));if(!t)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n=Ea,r=this.c11nEnv.getValue(Ur.NEXT_ASSIGNMENT_INFO_ID)?this.c11nEnv.getValue(Ur.NEXT_ASSIGNMENT_INFO_ID):this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),a=Qy(this.c11nEnv.getCaseSummary()),s=this.c11nEnv.getValue(Ur.CASE_INFO.CASE_INFO_ID),o={ID:r,stepID:e,acTargetName:this.c11nEnv.getContainerName(),targetContainerName:this.c11nEnv.getContainerName(),containerItemID:t,doDeleteCaseSummary:!0,isInCreateStage:a,caseID:s};t&&t.includes(Fr.MODAL)&&(o.acTargetName=Fr.MODAL);const i=uS.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(n,i),l=MI(t);return VC({type:n,payload:{...i,containerItemID:t,context:l}}),c}cancelAssignment(e,t){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:n}=Ur,r=ma,a=MI(e),s=e&&e.includes(Fr.MODAL),o=this.c11nEnv.getCaseSummary(),i=Qy(o),c=this.c11nEnv.getValue(Fr.getProperty(n.CASE_INFO_ID)),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),d=uS.buildActionObject({caseID:c,containerItemID:e,context:a},this.c11nEnv);let u={};s?(d.acTargetName=Fr.MODAL,d.isInCreateStage=i,d.isModalAction=s,u={...d}):u={...d,acName:js(this.c11nEnv.getContainerName(),d.context)};const{promise:p}=this.actionsApiPromise(r,d);return VC({type:r,payload:u}),p.then((()=>{t||Mg({caseID:c,assignmentID:l,context:this.c11nEnv.getContextName()})}))}cancelLocalAction(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:t}=Ur,n=e,r=Xa,a=e&&e.includes(Fr.MODAL),s=this.c11nEnv.getValue(t.CASE_INFO_ID),o=uS.buildActionObject({caseID:s,containerItemID:e,context:n},this.c11nEnv);if(!cI(n)){return new Qh(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{Dg(s),Mg({caseID:s,context:this.c11nEnv.getContextName()})}))}VC({type:r,payload:{...o,isModalAction:a}});const{promise:i}=this.actionsApiPromise(r,o);return i}cancelCreateStageAssignment(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const{CASE_INFO:t}=Ur,n=Xa,r=e,a=r&&r.includes(Fr.MODAL),s=this.c11nEnv.getCaseSummary(),o=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_TYPE_ID)),i=Qy(s),c=this.c11nEnv.getValue(Fr.getProperty(t.CASE_INFO_ID)),l=uS.buildActionObject({caseID:c,containerItemID:e,context:r},this.c11nEnv),d=this.c11nEnv.getValue("isProcessAction","isProcessAction"),u=PA.isCoexistenceAppOfType(Fr.APP_TYPE.UIKIT);l.isProcessAction=d;const p=PA.getRenderingMode();if(i&&(a||u||"EMBED"===p)&&!Ky(s)){const t=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.IS_FIRST_ASSIGNMENT)),c=cI(r);if(this.shouldDeleteCaseInCreateStage(c,t,u)){const t=!0===Boolean(zy.isExternalObject(o));return this.deleteCaseInCreateStage(e,t)}VC({type:n,payload:{...l,isModalAction:a,isChildCase:tE(s),isInCreateStage:i}})}const{promise:h}=this.actionsApiPromise(n,l);return h.then((()=>{}))}saveAssignment(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=Bh,n=this.getSaveActionPayload(e,!0),{promise:r}=this.actionsApiPromise(t,n);return $g.executeOrQueueDeferredAction(Gh(n)),r}saveAndClose(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=Bh,n=this.getSaveActionPayload(e),{promise:r}=this.actionsApiPromise(t,n);return VC(Gh(n)),r}deleteCaseInCreateStage(e,t=!1){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const n=Vh,r=e,a=r&&r.includes(Fr.MODAL),s=this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID)),o=this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_TYPE_ID)),i=uS.buildActionObject({caseID:s,caseType:o,containerItemID:e,context:r,ignoreCaseDeletion:t},this.c11nEnv),c=this.c11nEnv.getValue("isProcessAction","isProcessAction"),l=this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.PARENTCASEINFO));i.isProcessAction=c,i.parentCaseInfo=l;const d=`${Fr.APP.APP}/${mI.PRIMARY}`,u=hy(d,mI.PRIMARY);i.parentContext=u,a&&(i.targetName=Fr.MODAL,i.containerName=mI.MODAL,i.isModalAction=a),VC((e=>({type:Vh,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{Mg({caseID:s,context:this.c11nEnv.getContextName()})}))}getRecents(e){if(!e)return Promise.reject(new Error("maxResultsToFetch is required parameter"));if("number"!=typeof e)return Promise.reject(new TypeError("maxResultsToFetch must be number"));let{restApi:t}=bA.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=an()+t;return Wu(n,{method:"GET",headers:{}})}updateRecents(e,t,n,r){const{restApi:a}=bA.getRestEndPoint("updateRecents")||{},s=`${an()}${a}`;return Wu(s,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:r}})}logout(){const{restApi:e}=bA.getRestEndPoint("Logout")||{},t=`${an()}${e}`;return Wu(t,{method:"GET",headers:{}}).then((e=>(Object.keys(Zd.rootNodes).forEach((e=>{Sg.cleanCaches(e)})),Zd.rootNodes={},sessionStorage.clear(),tS(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return Wu(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,Mr.getDefaultQualifiedName("pyCasePreview"),{container:mI.PREVIEW,containerName:mI.PREVIEW,context:Ur.APP.APP,...t})}showDataPreview(e,t,n){return e?"string"!=typeof e?Promise.reject(new TypeError("dataContext must be string")):t?"object"!=typeof t?Promise.reject(new TypeError("dataContextParameters must be an object")):this.showData(Mr.getDefaultQualifiedName("pyDataPreview"),e,t,{container:mI.PREVIEW,containerName:mI.PREVIEW,context:Ur.APP.APP,...n||{},skipSemanticUrl:!0}):Promise.reject(new Error("dataContextParameters is required parameter")):Promise.reject(new Error("dataContext is required parameter"))}loadView(e,t,n){let r=uS.buildActionObject({caseId:e,viewName:t,caseClassName:this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_TYPE_ID)),RemoteSystemID:Vr.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv);n||(n={containerName:this.c11nEnv.getContainerName(),updateData:!1}),n&&"object"==typeof n?(Object.hasOwn(n,"container")&&!Object.hasOwn(n,"containerName")&&(n.containerName=n.container),r={...r,...n}):r={...r,containerName:this.c11nEnv.getContainerName()};const a=ta,{promise:s}=this.actionsApiPromise(a,r,!1);return VC({type:a,payload:{...r}}),s}showPage(e,t,n={containerName:"",skipSemanticUrl:""}){if(!e)return Promise.reject(new Error(this.MSG_PAGENAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_PAGENAME_STRING));if(!t)return Promise.reject(new Error(this.MSG_CLASSNAME_REQUIRED));if("string"!=typeof t)return Promise.reject(new TypeError(this.MSG_CLASSNAME_STRING));if(window.pms?.plugins?.c11n?.showPage)return window.pms.plugins.c11n.showPage(e,t,n);const r=uS.buildActionObject({viewName:e,className:t},this.c11nEnv),a=na,{promise:s}=this.actionsApiPromise(a,r);return yu.getPreviewMode()&&(r.debugInfo={debugId:aS.generateUniqueID()}),VC({type:a,payload:{...r,...n,containerName:n.containerName||this.c11nEnv.getContainerName(),skipSemanticUrl:n.skipSemanticUrl}}),s}showInsight(e,t={}){if(!e)return Promise.reject(new Error(this.MSG_INSIGHTID_REQUIRED));const n=uS.buildActionObject({},this.c11nEnv),r=aa,{promise:a}=this.actionsApiPromise(r,n);return VC({type:r,payload:{...n,containerName:this.c11nEnv.getContainerName(),skipSemanticUrl:t.skipSemanticUrl||!1,insightID:e}}),a}showDashboard(e,t={}){if(!e)return Promise.reject(new Error(this.MSG_DASHBOARDID_REQUIRED));const n=uS.buildActionObject({},this.c11nEnv),r=sa,{promise:a}=this.actionsApiPromise(r,n);return VC({type:r,payload:{...n,containerName:this.c11nEnv.getContainerName(),skipSemanticUrl:t.skipSemanticUrl||!1,dashboardID:e}}),a}showData(e,t,n,r={containerName:"",skipSemanticUrl:!1}){if(!e)return Promise.reject(new Error(this.MSG_PAGENAME_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_PAGENAME_STRING));if(!t)return Promise.reject(new Error("dataContext is required parameter"));if("string"!=typeof t)return Promise.reject(new TypeError("dataContext must be string"));const a=uS.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:Vr.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),s=ra;r?.containerName||(r.containerName="HYBRID"===PA.getRenderingMode()?bg.getRuntimeParam(Fr.HYRBID_ROOT_CONTAINERNAME):Oh.getTargetViewContainerName(s));const{promise:o}=this.actionsApiPromise(s,a);return VC({type:s,payload:{...a,...r,skipSemanticUrl:Boolean(r.skipSemanticUrl)}}),o}changeHandler(e,t){uS.changeHandler(e,t)}eventHandler(e,t){uS.eventHandler(e,t)}triggerFieldChange(e,t,n=!1,r={skipDirtyValidation:!1,skipPageInstructionGeneration:!1}){const a=this.c11nEnv.getContextName(),s=this.c11nEnv.getPageReference(),o=cS.getContextPath(s,e);n||this.c11nEnv.getValidationApi().validate(t),this.c11nEnv.isInsideList()&&!r.skipPageInstructionGeneration&&this.c11nEnv.getListActions().updateProperty(e,t,r);let i=this.c11nEnv.getValue(Fr.CLASS_ID);const c=e?e.split(".").filter((e=>!!e)):[];c.length>1&&(c.pop(),i=HC(`.${c.join(".")}.classID`,s,a)),e=aS.trimDotForProperty(e),VC({type:ea,payload:{reference:o,value:t,context:a,pageReference:this.c11nEnv.getPageReference(),propertyName:e||this.c11nEnv.getComponentConfig().value,classID:i}})}updateFieldValue(e,t,n={}){const{removePropertyFromChangedList:r=!1,isArrayDeepMerge:a=!0,contextPageReference:s="",isListEntry:o=!1,skipDirtyValidation:i=!1,associatedProperty:c,skipPageInstructionGeneration:l=!1}=n,d=this.c11nEnv.getContextName();let u=this.c11nEnv.getPageReference();const p=s?.startsWith(u)?s.replace(u,""):s;u=s||u;const h=cS.getContextPath(u,e);let f=!1;this.c11nEnv.isInsideList()&&!l&&this.c11nEnv.getListActions().updateProperty(p?`${p}${e}`:e,t,{isArrayDeepMerge:a,skipDirtyValidation:i}),this.c11nEnv.isBulkAction()&&(f=!0),e||(e=this.c11nEnv.getStateProps().value),ou({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,property:e,pageReference:u,context:d,isListEntry:o}),VC({type:Xr,payload:{reference:h,value:t,context:d,isArrayDeepMerge:a,skipDirtyValidation:i,...f&&{isStrictTracking:f},...r&&{removePropertyFromChangedList:r},...c&&{associatedProperty:`${u}${c}`}}})}activateModalContainerItem(e){const t=Va,{context:n}=e,r=n&&n.includes(Fr.MODAL),a=uS.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);r&&(a.containerName=Fr.MODAL,a.isModalAction=r),VC({type:t,payload:a});const{promise:s}=this.actionsApiPromise(t,a);return s}refreshCaseView(e,t,n,r={}){const{promise:a,actionMgrID:s}=this.actionsApiPromise("REFRESH_DATA"),{autoDetectRefresh:o,propertyName:i,preserveClientChanges:c,classID:l,context:d,optionalPayload:u,isArrayDeepMerge:p}=r,h={actionMgrID:s,caseViewAction:!0,preserveClientChanges:c,propertyName:i,classID:l,isArrayDeepMerge:p,optionalPayload:u};r.refreshFor&&(h.refreshFor=r?.refreshFor),r.resetForm&&(h.resetForm=r?.resetForm),r.skipPayloadGeneration&&(h.skipPayloadGeneration=r?.skipPayloadGeneration);const f=d||this.c11nEnv.getContextName(),g=this.c11nEnv.getPageReference(),m=this.c11nEnv.getValue(Fr.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW),{isMultiRecordData:y,editType:E}=m||{};if(o&&y&&E===Fr.ACTION){const t=this.c11nEnv.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),{actionID:n,interestPage:r,interestPageActionID:a,isLocalAction:s}=m;pE(e,t,n,f,r,a,s,y,E,h)}else!y&&o&&(eE(f,g)||Xy(f,g))?IE(f,n,h):uE(e,t,f,n,h);return a}refreshEmbeddedDataWithAction(e,t,n,r,a,s,o,i,c={}){const{promise:l}=this.actionsApiPromise(Ng.REFRESH_DATA),d=this.c11nEnv.getContextName();return pE(e,t,n,d,r||this.c11nEnv.getPageReference(),a,s,o,i,c),l}openEmbeddedDataModal(e,t,n,r,a,s,o,i,c=!1,l=Ur.MODAL){const d=_s;let u=t.getCaseInfo().getKey();const p=t.getValue(Ur.CASE_INFO.IS_LOCAL_ACTION),h=t.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),f=Fg(t,o,p),g=t.getPageReference();let m="string"==typeof r?`${t.getPageReference().replace(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),"")}${n}.${r}`:`${t.getPageReference().replace(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),"")}${n}[${r}]`;g.startsWith(Ur.OBJECT_INFO.OBJECT_INFO)&&!u&&(u=t.getCaseInfo().getObjectKey(),m=`${t.getPageReference().replace(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT,"")}${n}[${r}]`);const y=t.getMetadata(),E=Array.isArray(y?.config?.children)&&y.config.children[0]?.children||[],I={readOnly:c,targetProperty:n,index:r,viewID:e,ID:u,actionType:a,interestPage:aS.convertPageRefToClipboardPageNotation(m),heading:s,editType:o,interestPageActionID:o===Fr.ACTION?i:void 0,actionID:f,isLocalAction:p,operationFlag:Fr.EMBEDDED_DATA_MODAL.SHOW_ROW,isPageGroup:"string"==typeof r,assignmentID:p||o!==Fr.ACTION?void 0:h,columns:E},A=uS.buildActionObject(I,this.c11nEnv);if(o===Fr.ACTION){const e=aS.getETag(A.context);A.headers={"If-Match":e}}const{promise:C}=this.actionsApiPromise(d,A);return PA.getFeatureMap().granularUIRefresh&&E.forEach((e=>{const n=No.trimAnnotation(e.config.value),r=oC(n.startsWith(".")?n.replace(".",""):n,e.config.classID);r&&!Array.isArray(r)&&r.isDeclarativeTarget&&Zd.addFieldNode(t.getContextName(),g+m,t.viewName??"",n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:g+m})})),VC({type:d,payload:{...A,containerName:l,skipSemanticUrl:!0}}),C}getEmbeddedDataView(e,t,n,r,a,s="",o="",i=!1,c=""){const l=Ns;let d=t.getCaseInfo().getKey();const u=t.getValue(Ur.CASE_INFO.IS_LOCAL_ACTION),p=t.getValue(Ur.CASE_INFO.ASSIGNMENT_ID),h=Fg(t,s,u),f=t.getPageReference();let g="string"==typeof r?`${t.getPageReference().replace(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),"")}${n}.${r}`:`${t.getPageReference().replace(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),"")}${n}[${r}]`;f.startsWith(Ur.OBJECT_INFO.OBJECT_INFO)&&!d&&(d=t.getCaseInfo().getObjectKey(),g=`${t.getPageReference().replace(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT,"")}${n}[${r}]`);const m={readOnly:i,targetProperty:n,index:r,viewID:e,ID:d,actionType:a,interestPage:aS.convertPageRefToClipboardPageNotation(g),editType:s,interestPageActionID:s===Fr.ACTION?o:void 0,actionID:h,isLocalAction:u,operationFlag:Fr.EMBEDDED_DATA_MODAL.SHOW_ROW,isPageGroup:"string"==typeof r,assignmentID:u||s!==Fr.ACTION?void 0:p,containerName:c},y=uS.buildActionObject(m,this.c11nEnv);if(s===Fr.ACTION){const e=aS.getETag(y.context);y.headers={"If-Match":e}}const{promise:E}=this.actionsApiPromise(l,y);return VC({type:l,payload:{...y,skipSemanticUrl:!0}}),E}submitEmbeddedDataModal(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=bs;let n=this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID));const r=this.c11nEnv.getValue(Fr.getProperty(Ur.CASE_INFO.ASSIGNMENT_ID));let a=this.c11nEnv.getPageReference().replace(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),"");const s=MI(e),o=this.c11nEnv.getValue(Fr.getProperty(Fr.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW)),{interestPageActionID:i,editType:c,isLocalAction:l,actionID:d,viewName:u,parentContext:p}=o;a.startsWith(Ur.OBJECT_INFO.OBJECT_INFO)&&!n&&(n=this.c11nEnv.getValue(Ur.OBJECT_INFO.OBJECT_INFO_ID),a=this.c11nEnv.getPageReference().replace(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT,"")),ou({context:s,stateObj:BC(s),clearContextMessages:!0});const h={containerItemID:e,containerName:this.c11nEnv.getContainerName(),doDeleteCaseSummary:!0,isInCreateStage:!1,ID:n,viewID:u,isFormValid:Gy(s),interestPage:aS.convertPageRefToClipboardPageNotation(a),parentContext:p,isModalAction:!1,target:this.c11nEnv.getTarget(),editType:c,actionID:d,operationFlag:Fr.EMBEDDED_DATA_MODAL.SUBMIT_ROW,interestPageActionID:i,isLocalAction:l,assignmentID:r};e&&e.includes(Fr.MODAL)&&(h.containerName=Fr.MODAL,h.isModalAction=!0);const f=uS.buildActionObject(h,this.c11nEnv);if(c===Fr.ACTION){const e=aS.getETag(f.context);f.headers={"If-Match":e}}const{promise:g}=this.actionsApiPromise(t,f);if(cI(s)){const[e,t,n]=kd(this.c11nEnv.getPageReference());Zd.mutatePageList(p,e,t,{type:cs,rowIndex:n}),VC({type:cs,payload:{pageReference:this.c11nEnv.getPageReference(),context:p,isListEntry:!0}})}return $g.executeOrQueueDeferredAction({type:t,payload:{...f,context:s}}),g}fillFormWithAI(e){if(!e)return Promise.reject(new Error(this.MSG_CONTAINERITEMID_REQUIRED));if("string"!=typeof e)return Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING));const t=MI(e),n=this.c11nEnv.getPageReference(),{promise:r,actionMgrID:a}=this.actionsApiPromise(Ps);return IE(t,n,{actionMgrID:a,isFillFormWithAI:!0,preserveClientChanges:!1}),r}handleSubscript(e,t){if(!mC(Ur.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW))return Promise.reject(new Error(this.MSG_SUBSCRIPT_VIEW_REQUIRED));const n=Ts,r=uS.buildActionObject({containerItemID:e},t);VC({type:n,payload:{...r,isDataObject:!0,skipReleaseLockRequest:!0,isFormValid:Gy(e),context:e}});const{promise:a}=this.actionsApiPromise(n,r);return a}showSubscriptCreateView(e,t,n,r=Ur.VIEW_NAMES.SUBSCRIPT_CREATE_VIEW){const a=uS.buildActionObject({viewName:r,className:e,referenceListStr:t,subscriptName:n},this.c11nEnv),s=na,{promise:o}=this.actionsApiPromise(s,a);return VC({type:s,payload:{...a,containerName:Ur.MODAL,skipSemanticUrl:!0,isCreateDataObject:!0}}),o}deleteWork(e,t,n){if(!e)return Promise.reject(new Error("workId is required parameter"));const r=xs,a=zy.isExternalCaseType(t),s=uS.buildActionObject({workId:e,caseTypeID:t,isExternalCase:a,...n?.skipDeleteConfirmation&&{skipDeleteConfirmation:!0},...n?.enableBackNavigation&&{enableBackNavigation:!0}},this.c11nEnv),{promise:o}=this.actionsApiPromise(r,s);return VC(Hh({...s})),o}deleteDataRecord(e,t){if(!e)return Promise.reject(new Error("className is required parameter"));if(!t)return Promise.reject(new Error("keys is required parameter"));const n=xs,r=uS.buildActionObject({className:e,keys:t},this.c11nEnv),{promise:a}=this.actionsApiPromise(n,r);return VC(Hh({...r})),a}};const Vg=class{constructor(e){this.c11nEnv=e}buildRemoteCaseHeaders(e,t){const n={};if(e){const r=Vr.getRemoteCaseClassBySourceClass(e)??e;Vr.injectRemoteCaseHeader(n,{caseTypeID:r},t)}return n}async getCaseStages(e,t,n){const r={caseID:e},{restApi:a,reqType:s}=i_("getCaseStages",r),{caseTypeID:o}=n||{},i=this.buildRemoteCaseHeaders(o,t);return(await Wu(a,{method:s,headers:i},t)).data.stages}async getCaseActions(e,t,n){const r={caseID:e},{restApi:a,reqType:s}=i_("getActions",r),{caseTypeID:o}=n||{},i=this.buildRemoteCaseHeaders(o,t);return(await Wu(a,{method:s,headers:i},t)).data}getCaseTypeName(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_TYPE_NAME))}getName(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_NAME))}getClassName(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_TYPE_ID))}getAvailableProcesses(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.AVAILABLEPROCESSES))}getKey(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_ID))}getObjectKey(){return this.c11nEnv.getValue(Fr.OBJECT_INFO.OBJECT_INFO_ID)}getID(){const e=this.getKey();if(e){const[,t]=e.split(" ");return t||e}}getAssignmentID(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ASSIGNMENT_ID))}getActions(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTION_BUTTONS))}getActiveFlowActionID(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTIVE_ACTION_ID))||this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ASSIGNMENTACTION_ID))}getParentCaseInfo(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.PARENTCASEINFO))}isPerform(){return this.c11nEnv.getValue(`${Fr.CONTEXT_DATA}${Fr.CASE_VIEW_MODE_PROP}`)===Fr.PERFORM_MODE}isReview(){return this.c11nEnv.getValue(`${Fr.CONTEXT_DATA}${Fr.CASE_VIEW_MODE_PROP}`)===Fr.REVIEW_MODE}isAssignmentInCreateStage(){const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO));return Qy(e)}isReviewAfterCreateStage(){if(!this.isReview())return!1;const e=this.c11nEnv.getContextName(),t=jI(e)[0];if(!t)return!1;const n=kC()?.getState().data[t]?.caseInfo?.stages;if(!Array.isArray(n))return!1;const r=[...n].reverse().find((e=>"object"==typeof e&&null!==e&&"visited_status"in e&&"transitionType"in e&&"completed"===e.visited_status));return"create"===r?.transitionType}isLocalAction(){const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO));return Ky(e)}getCurrentAssignmentViewName(){let e=null,t=!1;if(this.c11nEnv.getValue("context_data.caseViewMode")===Fr.PERFORM_MODE){if(this.isLocalAction())return e;if(this.isAssignmentInCreateStage())t=!0;else{const t=this.c11nEnv.getTarget(),n=this.c11nEnv.getContextName(),r=CI(t,n),{config:a}=t&&n?r&&r.view:this.c11nEnv.getMetadata();e=a?.type===Fr.VIEW?a?.name:null}(e&&e.startsWith(Fr.PROPERTY_ANNOTATION)||t)&&(e=this.c11nEnv.getValue(Mr.getQualifiedNameForComplexRuleReferences(Fr.getProperty(Fr.CASE_INFO.VIEW_NAME))))}return e}getValueByPath(e,t){let n=e;if((t=t.replace("@P ","").trim()).includes(Mr.getDefaultQualifiedName("pyViewContext"))){const t=e.caseInfo?.content??{},r=t[Mr.getDefaultQualifiedName("pyViewContext")];if(!r)return n.caseInfo.content;if("string"==typeof r&&r.includes("(")&&r.includes(")")){const e=r.substring(1,r.indexOf("(")),n=parseInt(r.substring(r.indexOf("(")+1,r.indexOf(")")),10)-1;if(Array.isArray(t[e]))return t[e][n];const a=e.split(".").reduce(((e,t)=>e?.[t]),t);if(Array.isArray(a))return a[n]}}const r=t.split(/[.[\]]/).filter((e=>e));for(const e of r)if("object"==typeof n&&null!==n&&e in n)n=n[e];else{if(!Array.isArray(n)||Number.isNaN(Number(e)))return;n=n[parseInt(e,10)-1]}return n}getCurrentAssignmentViewClassName(){const e=this.c11nEnv.getTarget(),t=this.c11nEnv.getContextName(),n=CI(e,t),{config:r}=e&&t&&n?n.view:this.c11nEnv.getMetadata(),a=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO)),s=r?.type===Fr.VIEW?r.context:null;if(s){const e=this.getValueByPath({caseInfo:a},s);if("object"==typeof e&&null!==e&&"classID"in e)return e.classID}return null}getActionRefreshConditions(){if(this.c11nEnv.getValue(Fr.getProperty(Fr.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)))return this.c11nEnv.getValue(Fr.getProperty(Fr.EMBEDDED_DATA_MODAL.REFRESH_CONDITIONS));const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTIVE_ACTION_ID)),t=Wr(this.c11nEnv.getContextName());let n;t&&(n=BC(t));const r=n?.caseInfo?.availableActions,a=BC(this.c11nEnv.getContextName()),s=a?.caseInfo?.refreshConditions;if(e){if(r){const t=r.find((t=>t.ID===e));return t?t.refreshConditions:s}return s}return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTION_REFRESH_CONDITIONS))}getBusinessID(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.BUSINESS_ID))}getAssignments(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO))?.assignments}getChildAssignments(){return this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO))?.childCases?.[0]?.assignments}isCaseWideLocalAction=()=>{const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTIVE_ACTION_ID)),t=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_ACTIONS));if(t&&e){const n=t.find((t=>t.ID===e));return"Case"===n?.type}return!1};getAllAssignments(){const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ASSIGNMENT_LABEL)),n=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS))||[],r=this.getChildAssignments()||[];let a=JSON.parse(JSON.stringify(r));a=a.map((e=>(e.isChild=!0,e)));const s=[...n,...a];let o=JSON.parse(JSON.stringify(s));return e&&!this.isPerform()&&(o=o.map((e=>(e.name=this.getActiveCaseActionName()||e?.name||t,e)))),o}getActiveCaseActionName(){const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_ACTIONS)),t=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.ACTIVE_ACTION_ID)),n=e.find((e=>e.ID===t));return n?.name||""}getFirstCaseActionName(){const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_ACTIONS));return e[0]?.name||""}hasAssignments(){const e=this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS)),t=this.getChildAssignments();return!!(e||t||this.isCaseWideLocalAction())}hasMessages=()=>!!this.c11nEnv.getValue("caseMessages");hasGetNextWorkLinks(){return!!this.c11nEnv.getValue(Fr.getProperty(Fr.CASE_INFO.GETNEXTWORK))}isObjectWideAction(){const e=this.c11nEnv.getValue(Fr.OBJECT_INFO.OBJECT_INFO);return Ky(e)}getCaseCollaborators=(e=!0)=>{const t=this.c11nEnv.getValue(Fr.CASE_INFO.CASE_INFO_COLLABORATORS)||[];if(e){const e=PA.getOperatorIdentifier();return t.filter((t=>t.ID!==e))}return t}};const Bg=class{constructor(e){this.c11nEnv=e}getContextKey(){return this.c11nEnv.getValue(Fr.getProperty(Fr.DATA_INFO.DATA_INFO_CONTEXT_KEY))}};class Gg{constructor(e){Gg._instance=this,this.context=`${e}/${Fr.SUGGESTION}`,kC()?.getState().data?.[this.context]||VC({type:Ga,payload:{context:this.context,data:{}}})}getField(e){return HC(e,"",this.context)}setField(e,t){VC({type:Xr,payload:{reference:e,value:t,context:this.context}})}removeField(e,t={}){VC({type:Sa,payload:{reference:e,context:this.context,...t}}),gu.publish(Fr.PUB_SUB_EVENTS.SUGGESTION_PROCESSED,{reference:e,context:this.context,...t})}setState(e){VC(gS({context:this.context,data:e,isArrayDeepMerge:!0}))}}const Wg=Gg;const Hg=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=GC();return n?aS.getIn(n,t):null}static setSharedState(e,t){e&&VC(zS({key:e,value:t}))}static updateState(e,t,n,r={}){const{isArrayDeepMerge:a=!0,pageReference:s,removePropertyFromChangedList:o=!1,skipDirtyValidation:i=!1}=r;if(!e||!t)return;VC(KS({context:e,reference:s?`${s}.${t}`:t,value:n,isArrayDeepMerge:a,removePropertyFromChangedList:o,skipDirtyValidation:i}))}static getSuggestionsContext(e){return new Wg(e)}static triggerRefresh(e,t){AE({context:e,pageReference:t})}};class qg{static getParagraphStream(e,t,n){return((e,t,n)=>{if(!e)return e;const r=(new DOMParser).parseFromString(e,"text/html"),a=r.querySelectorAll("pega-reference");for(const e of a){const n=e.getAttribute("data-rule-id");if(n){const a=t.getValue(n),s=r.createTextNode(a??"");e.replaceWith(s),t.registerAdditionalProps({[n]:`@P ${n}`})}else e.replaceWith("")}let s;return s="simple"===n?aS.decodeHtmlEntities(r?.body?.textContent||""):r?.body?.innerHTML||"",/^(<p>)\s*(<\/p>)$/.test(s)?null:s})(e,t,n)}static isDecisionParagraph(e,t){const n=NC(e,t);return!!n?.useDecision}static processParagraph(e,t){const n=t.getCurrentClassID(),r=NC(e,n);let a;if(r?.useDecision){const n=r.dynamicContents.length;for(let s=0;s<n-1;s+=1)if(cS.resolveWhen(r.dynamicContents[s].when,t)){a=r.dynamicContents[s],e=`${e}#${a.when}`;break}a||(a=r.dynamicContents.pop())}else a=r;const s=r?.definedOnClassID,o=$A().getParagraphLocaleValue(s||n,e);return o?qg.getParagraphStream(o.content,t,o?.category||a?.category||r?.category):a?.content?qg.getParagraphStream(a.content,t,a?.category||r?.category):null}static processBannerDecisionParagraph(e,t){const n=t.getCurrentClassID(),r=NC(e,n);let a;if(r?.useDecision){const n=r.dynamicContents.length;for(let s=0;s<n-1;s+=1)if(cS.resolveWhen(r.dynamicContents[s].when,t)){a=r.dynamicContents[s],e=`${e}#${a.when}`;break}a||(a=r.dynamicContents.pop())}else a=r;const s=r?.definedOnClassID,o=$A().getParagraphLocaleValue(s||n,e);let i=null;return o?i=qg.getParagraphStream(o.content,t,o.category||a?.category||r?.category):a?.content&&(i=qg.getParagraphStream(a.content,t,a?.category||r?.category)),{htmlContent:i,messageType:a?.messageType,dismissBanner:a?.dismissBanner,isBanner:a?.isBanner}}static getParagraphProperties(e,t){const n=t.getCurrentClassID(),r=NC(e,n);return{useDecision:r?.useDecision,isBanner:r?.isBanner,messageType:r?.messageType,dismissBanner:r?.dismissBanner}}static isADecisionParagraph(e,t){return this.getParagraphProperties(e,t).useDecision}static isBanner(e,t){return this.getParagraphProperties(e,t).isBanner}static getParagraphMessageType(e,t){return this.getParagraphProperties(e,t).messageType}static isDismissibleBanner(e,t){return this.getParagraphProperties(e,t).dismissBanner}static hasDecisionBannerContent(e,t){const n=t.getCurrentClassID(),r=NC(e,n);return!(!r?.useDecision||!r?.dynamicContents)&&r.dynamicContents.some((e=>e.isBanner))}}const Yg=qg;class zg{constructor(e){this.fieldType=e}applyFallback(e){const t=vp.getDefaultsforType(this.fieldType);e.currencyISOCode=e.currencyISOCode||t?.currencyISOCode||"USD"}}class Kg{static getStrategy(e){switch(e){case"Currency":case"Decimal":case"Integer":case"Percentage":return new zg(e);default:return}}}const Qg="DATAPAGE",Jg="VIEW",Xg="FIELD",Zg="CASE",em="PARAGRAPH",tm=(e,t,n,r)=>{const a=[Jg,Xg,em],s=[Qg,em].includes(e)&&r?`#${r}`:"",o=e===Qg?"@BASECLASS":n;return e===Qg||a.includes(e)?`${o}!${e}!${t}${s}`.toUpperCase():`${e}!${t}${s}`.toUpperCase()};class nm{static COMMON_LABELS="COMMONLABELS";static MESSAGES="MESSAGES";static COMPONENT_FIELDS="COMPONENTFIELDS";lookupList=[];constructor(e,t){this.localeReference=t,this.locale=e}getLocalizedText(e,t){const n=[...this.localeReference?[this.localeReference.toUpperCase()]:[],...this.lookupList,nm.COMPONENT_FIELDS,nm.COMMON_LABELS],r=this.#o(e,n)||e;return(t?this.#i(r,t):r)||e}getLocalizedMessage(e,t){const n=this.#o(e,[nm.MESSAGES,nm.COMMON_LABELS])??e;return(t?this.#i(n,t):n)||e}getLocalizedDataPage(e,t,n,r){if(!t||!n||!e)return e;const a=[tm(Qg,t,void 0,n),nm.COMMON_LABELS,...this.lookupList],s=this.#o(e,a)??e;return(r?this.#i(s,r):s)||e}#i(e,t){return 0===t.length?e:e.replace(/\{(\d+)\}/g,((e,n)=>t[""+(Number(n)-1)]??e))}#o(e,t=this.lookupList){if(0===t.length)return;const n=iC(this.locale);for(const r of t){const t=this.#c(e,n.localeStore[r]);if(t)return t}}#c(e,t={}){const n=t[e];if("string"==typeof n)return n}setLookupList(e){Array.isArray(e)&&(this.lookupList=e)}}const rm=e=>Lr.getNeedsMapping()||e?.info===Ur.OBJECT_INFO.OBJECT_INFO?Ur.OBJECT_INFO.OBJECT_INFO:Ur.CASE_INFO.CASE_INFO,am=(e,t)=>{const n=rm(t);e.data=e.data??{};const{assignments:r,availableActions:a=[]}=e.data[n]??{};if(r&&Array.isArray(r)&&r.length>0&&r[0].actions&&Array.isArray(r[0].actions)&&!t?.stopMergeActions){r[0].actions.forEach((e=>{"Assignment"!==e.type&&"LocalAction"!==e.type||a.push(e)})),e.data[n]=e.data[n]??{},e.data[n].availableActions=a}},sm=(e,t)=>{const n=rm(t),r=zm();if(e.confirmationLinks&&(e.data=e.data??{},e.data[n]=e.data[n]??{},e.data[n].confirmationLinks=e.confirmationLinks),!e.uiResources&&e.confirmationNote){let t=e;const{confirmationNote:n}=t;return void 0===r||r||am(t),t=((e,t)=>{const n=[e];return t.data=t.data??{},t.data.caseMessages=n,t})(n,t),t}if(!e.uiResources||!e.data||!e?.uiResources?.root)return e;const a=e,{uiResources:{actionButtons:s,navigation:o,settings:i},nextAssignmentInfo:c}=a;if(s&&s.main&&(s.main=s.main.map((e=>"createWork"===e.jsAction?{...e,jsAction:"createCase"}:e))),a.data&&a.data[n]&&(s&&(a.data[n].actionButtons=s),o&&(a.data[n].navigation=o),i&&(a.data[n].settings=i),t&&t[Ur.ACTIONS.DELETEAVIALACTIONS]&&delete a.data[n].availableActions,void 0===r||r||am(a,t),e.confirmationNote)){const{confirmationNote:e}=a,t=[e];a.data.caseMessages=t}return t&&t.isCreateDataObject&&(a.data=a.data??{},a.data.dataInfo={},a.data.dataInfo.content=a.data.pyPortal,a.uiResources.root.config.context="dataInfo.content",a.uiResources.context_data.dataInfo=a.uiResources.context_data.dataInfo??{},a.uiResources.context_data.dataInfo.content=a.uiResources.context_data.dataInfo.content??{},a.uiResources.context_data.dataInfo.content=a.uiResources.context_data?.pyPortal,delete a.data.pyPortal,delete a.key),c&&(a.data=a.data??{},a.data.nextAssignmentInfo=c),a},om=async e=>{const t=sm(e),n=aS.getIn(t,Fr.COMPONENTS);Jp(t,{},!0),await yh(n)},im=(e,t,n)=>cS.resolveView(e,t,n),cm=(e,t,n,r)=>{const a=e[t];if(!a)return!1;const s=aS.getIn(a,Ur.CASE_INFO.CASE_INFO_CLASSID);return aS.getIn(a,Fr.CASE_INFO.VIEW_NAME)===n&&(!r||s===r)},lm=e=>{const{accessedOrder:t,items:n}=e;if(!t||!n)return null;const r=t[t.length-1];return r?n[r]?.context??null:null},dm=(e,t="",n="")=>{let r=n||null;if(!r){const n=`${Ur.APP.APP}/primary`;r=((e,t)=>{const n=kC();if(!n)return null;const r=n.getState(),{data:a,containers:s}=r;if(!s||!a)return null;const o=`${Ur.APP.APP}/primary`;if(s[o]){const n=lm(s[o]);if(n&&cm(a,n,e,t))return n}for(const n of Object.keys(s)){if(n===o)continue;const r=lm(s[n]);if(r&&cm(a,r,e,t))return r}return null})(e,t),r||(r=LI(n))}if(!r)return Promise.reject(new Error(`Unable to find an active context for view "${e}".`));const a=BC(r);if(!a)return Promise.reject(new Error(`No data found for context "${r}".`));const s=aS.getIn(a,Ur.CASE_INFO.CASE_INFO_ID)||"",o=Cm({options:{context:r,pageReference:Ur.CASE_INFO.CASE_INFO_CONTENT}});return pC(),o.getPConnect().getActionsApi().refreshCaseView(s,e,"",{autoDetectRefresh:!0,preserveClientChanges:!1}).finally((()=>{hC()}))};let um=function(e){return e.CURRENCY="Currency",e.PERCENTAGE="Percentage",e.DECIMAL="Decimal",e.INTEGER="Integer",e.TEXT_SINGLE_LINE="Text (single line)",e.TEXT_PARAGRAPH="Text (paragraph)",e.EMAIL="Email",e.URL="URL",e.PHONE="Phone",e.PICKLIST="Picklist",e.USER_REFERENCE="User Reference",e.BOOLEAN="Boolean",e.DATE_AND_TIME="Date & time",e.DATE_ONLY="Date only",e.TIME_ONLY="Time only",e.IDENTIFIER="Identifier",e.DOUBLE="Double",e.TEXT_ENCRYPTED="Text Encrypted",e.PASSWORD="Password",e}({});const pm=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=cS.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=cS.getContextPath(this.datasource,this.index);return this.index+=1,Cm({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class hm{constructor(e,t){this.children=e,this.index=0,this.options=t}hasNext(){return this.index<this.children.length}next(){if(!this.hasNext())throw new Error("No Children");const e=this.index,t=this.children[e];this.index+=1;const n=t?._relativePath??`${this.options?.relativePath??""}.children[${e}]`;return Cm({meta:t,index:this.index,options:{...this.options,relativePath:n}})}resetIndex(){this.index=0}}const fm=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new pm(e,e.context||"",t);if(n){const n=YC(`${t.context}.${Fr.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new pm(e.children[0],n||e.context,t)}return e?.children?new hm(e.children,t):void 0};class gm{static allowedComponetsForBulkProcessing={Currency:!0,TextInput:!0,Phone:!0,Percentage:!0,Email:!0,Integer:!0,Decimal:!0,URL:!0,SemanticLink:!0,Checkbox:!0,RadioButtons:!0,DateTime:!0,Date:!0,Time:!0,Text:!0,TextArea:!0,RichText:!0,Dropdown:!0,Search:!0,Location:!0,Attachment:!0,AutoComplete:!0,MultiSelect:!0,UserReference:!0,Region:!0,TextContent:!0,View:{Forms:!0,DefaultForm:!0,OneColumn:!0,TwoColumn:!0,ThreeColumn:!0}};static getItemView(e,t){const n=[];if(e&&["portal","view"].includes(t)){const{accessedOrder:t,items:r}=e;if(t&&r){const e=t[t.length-1];r[e]&&r[e].view&&Object.keys(r[e].view).length>0&&n.push(r[e])}}return n}static getDependentProperties=e=>{let t=[];return e._rawConfig?.config?.parameters?t=Object.values(e._rawConfig?.config?.parameters||{}):e.getFieldMetadata(e.getStateProps()?.value)?.datasource?.parameters&&(t=(e.getFieldMetadata(e.getStateProps()?.value)?.datasource?.parameters||[]).map((e=>e?.value))),t.filter((e=>Yh.isProperty(e))).map((e=>Yh.getPropertyName(e)))}}const mm=new gm;let ym;Object.freeze(mm);const Em=(e,t,n)=>{e&&(Object.keys(e).forEach((r=>{if("children"!==r){const a=e[r],s=No.trimAnnotation(a);if("string"!=typeof s&&"string"!=typeof a||!(aS.isValidAnnotation(a)&&aS.isPropertyRef(s)||a.startsWith("@W ")||a.startsWith("@DW ")||a.startsWith("@E ")||a.startsWith("@PARAGRAPH ")||a.startsWith("@ATTACHMENT "))){if(Array.isArray(s))s.forEach(((e,n)=>{const a={parentStateObj:t,parentKey:r,isObjHasValue:!!t[r]};t[r]=t[r]||[],t[r][n]=Object.create({}),Em(e,t[r][n],a)}));else if(s&&"object"==typeof s&&"exp"!==s.type){const e={parentStateObj:t,parentKey:r,isObjHasValue:!!t[r]};t[r]=t[r]||{},Em(s,t[r],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),a.startsWith("@PARAGRAPH ")?t[r]=a:t[r]=s}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},Im=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...aS.deepClone(t.inheritedProps)]};class Am{constructor(e){const{meta:t,isRoot:n,options:r={},useCustomContext:a}=e;this.meta=t,this._isRoot=n,this.options=r,this.useCustomContext=a,this._rawConfig=t?.config,this._isExpressionExist=!1,this._isWhenExist=!1,this._isValidatorExist=!1,this._pageReference="",this._referenceContext="",this._contextName="",this._stateProps={},this._actions={},this._children="",this._additionalRegisteredProps={},this._caseInfo=null,this._dataInfo=null,this.viewName=r.viewName,this.parentViewName=r.viewName??"",this._referenceList=r.referenceList||"",this._isInsideList=r.isInsideList||!1,this._inheritedConfig={},this._localeRuleName=r.localeReference,this._containerTarget=r.target,this._readOnly=t?.config?.readOnly||r.readOnly,this._hasSuggestions=!1,this._actionsApi=null,this._classID=null,this.index=e.index,this.categoryName=r.categoryName||"",this._relativePath=r.relativePath??"",r.inheritedConfig&&(this._inheritedConfig=aS.deepClone(r.inheritedConfig)),t?.config?.inheritedProps&&Im(this._inheritedConfig,t?.config),this.meta?.config?.value&&"string"==typeof this.meta?.config?.value&&this.meta?.config?.value?.startsWith("@P ")&&this.meta?.config?.value?.includes("(")&&(this.meta.config.value=ep.formatePageReferenceToArrayIndex(this.meta.config.value)),Em(this._rawConfig,this._stateProps),this._isState=!aS.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=aS.isExpressionExist(this._rawConfig.config),this._isWhenExist=aS.isWhenExist(this._rawConfig.config),this._isValidatorExist=zp.isValidatorExist(this._rawConfig.config)),this._isRoot?this._contextName=Ur.APP.APP:this._contextName=this.meta?.config?.contextName||this.options.context||"",this._type=this.meta?.type;let s=this.options.pageReference;this.options.pageReference&&(s=No.handleAnnotation(this.options.pageReference,this)),this._pageReference=cS.getContextPath(s||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t);const o="reference"===this._type&&aS.isWhenExist({visibility:this.meta?.config?.visibility}),i=this._checkAndSetDecisionParagraph("instructions",this._rawConfig?.instructions);let c=!1;if("reference"!==this._type&&t&&(this._rawConfig=cS.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=No.trimAnnotation(e.localeReference)||r.localeReference,this._isExpressionExist=aS.isExpressionExist(e),this._isWhenExist=aS.isWhenExist(e),this._isValidatorExist=zp.isValidatorExist(e),c=this._checkAndSetDecisionParagraph("label",e?.label)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===Fr.VIEW&&this._rawConfig.name&&(this.viewName=No.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&yE(this)}(o||i||c)&&hE(this.viewName,this._contextName,this._pageReference)}_checkAndSetDecisionParagraph(e,t){let n=!1;if(t&&t.startsWith(Fr.PARAGRAPH_ANNOTATION)){const r=No.trimAnnotation(t);n=Yg.isDecisionParagraph(r,this.getCurrentClassID()),n&&this.setStateProps({[e]:t})}return n}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=No.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=No.trimAnnotation(this.getPropertyName());return""===this._pageReference&&e.startsWith(".")?e.substring(1,e.length):e}addFieldNode(){const e=this._getPropertyName(),{value:t,contextPage:n,label:r,required:a,readOnly:s,disabled:o,visibility:i,validationType:c,caption:l,allowMultiple:d,useRFC822Validation:u}=this.getRawConfigProps();if(this.getValue(this._pageReference)||""===this._pageReference){const p="Address"===this._type&&this._rawConfig?.config?.associatedView?No.trimAnnotation(this._rawConfig.config.associatedView):"",h=r||l,f=this._rawConfig?.type,g={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:No.trimAnnotation(t),label:h?.startsWith("@")?No.handleAnnotation(h,this,void 0):h,required:a,readOnly:s,disabled:o,visibility:i||this.options?.visibility,skipRequiredValidation:this.options?.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:t,validationType:c,...n&&{contextPageRef:`${this._pageReference}${No.trimAnnotation(n)}`},componentName:f,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),index:this.index,allowMultiple:d,isDeclarativeTarget:this.isDeclarativeTarget(),...this._type===um.EMAIL&&{useRFC822Validation:u}};Zd.addFieldNode(this._contextName,this._pageReference,(p||this.categoryName||this.viewName)??"",e,this.getValue(e),g)}}removeNode(){if(Object.hasOwn(this._rawConfig?.config??{},"value")&&"Address"!==this._type)Zd.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",No.trimAnnotation(this.getPropertyName()),this.index);else if("Address"===this._type&&this._rawConfig?.config?.associatedView)Zd.removeViewNode(this._contextName,this._pageReference,No.trimAnnotation(this._rawConfig.config.associatedView),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference,t={visibility:this.options?.visibility??this._rawConfig?.config?.visibility??this._rawConfig?.config?.referenceVisibility};Zd.removeViewNode(this._contextName,e,this._rawConfig?.config?.name||this._rawConfig?.config?.id||"",this.index,t)}}addViewNode(){if(!this.isReadOnly()){if(this._rawConfig?.type?.toLowerCase()===Fr.VIEW&&this._rawConfig.name&&this.viewName){const e={visibility:this.options?.visibility??this._rawConfig.config?.visibility??this._rawConfig.config?.referenceVisibility};Zd.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName,e)}"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&Zd.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&Zd.addViewNode(this._contextName,this._pageReference,No.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&Zd.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}}addWhenNode(){let e="",t="";const n=aS.getWhenNames(this._rawConfig?.config),r=this.getRawConfigProps();if(r?.type&&r?.type?.toLowerCase()===Fr.VIEW)t=Fr.CONTEXT_TREE_NODE_TYPES.VIEW,e=this.getCurrentView();else{t=Fr.CONTEXT_TREE_NODE_TYPES.FIELD;const n=this.getPropertyName();e=No.isProperty(n)?No.trimAnnotation(n):""}e&&n.forEach((n=>{Zd.addWhenNode(this.getContextName(),this.getPageReference(),t,e,n,{pageReference:this.getPageReference(),context:this.getContextName()})}))}updateContextTree(){if(this.isVisible()&&(this.addViewNode(),this._rawConfig?.config&&Object.hasOwn(this._rawConfig.config,"value")&&"DISPLAY_ONLY"!==this._inheritedConfig.displayMode&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode&&this.addFieldNode(),(this._rawConfig?.type?.toLowerCase()!==Fr.VIEW||"Editable"===this._rawConfig.config?.renderMode)&&this._rawConfig?.config?.referenceList&&"DISPLAY_ONLY"!==this._rawConfig.config?.displayMode)){const{value:e,label:t,required:n,contextPage:r,readOnly:a,disabled:s,visibility:o,validationType:i,selectionMode:c,selectionList:l,selectionKey:d,referenceList:u,renderMode:p,caption:h,uniqueField:f}=this.getRawConfigProps(),g=t||h;let m=[];["Multiselect","Checkbox"].includes(this._rawConfig.type)&&(m=this.getSelfReferencingDatapageKeys()),Zd.addPageListNode(this._contextName,this._pageReference,this.viewName??"",No.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:No.trimAnnotation(this.getPropertyName()),label:g?.startsWith("@")?No.handleAnnotation(g,this,void 0):g,required:n,readOnly:a,disabled:s,...r&&{contextPageRef:`${this._pageReference}${No.trimAnnotation(r)}`},visibility:o||this.options.visibility,skipRequiredValidation:this.options.isBulkAction,inheritedProps:this.getInheritedProps(),useCustomContext:this.useCustomContext,value:e,validationType:i,componentName:this._rawConfig.type,type:this._rawConfig.config?.type,hasSuggestions:this._hasSuggestions,isInsideList:this.isInsideList(),selectionMode:c,selectionList:l,renderMode:p,referenceList:u,selectionKey:d,index:this.index,uniqueField:f,selfReferencingDatapageKeys:["Multiselect","Checkbox"].includes(this._rawConfig.type)?m:void 0});const y=this.getValue(No.trimAnnotation(this.getPropertyName()),this._pageReference)||[];Zd.updatePageListNode(this._contextName,this._pageReference,No.trimAnnotation(this.getPropertyName()),y.length)}this.isWhenExist()&&this.addWhenNode(),this.isVisible()||this.removeNode()}getStateProps(){return this._stateProps}setStateProps(e){aS.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getSharedDataPageForReferenceList(){const e=this.getCaseInfo().getClassName(),t=this.getCurrentView();if(!t||!e)return;const n=im(t,this,e);if(!n)return;const r=this.getRawMetadata()?.config?.referenceList;if(!r)return;let a={};"object"==typeof n.config?.parameters&&null!==n.config.parameters&&(a=n.config.parameters);const s=aS.generateDataPageHashWithParameters(a,r,this),o=GC(),i=o?o[r]?.[s]:{};return Array.isArray(i?.[Mr.getDefaultQualifiedName("pxResults")])?i[Mr.getDefaultQualifiedName("pxResults")]:void 0}getCaseInfo(){return this._caseInfo||(this._caseInfo=new Vg(this)),this._caseInfo}getDataInfo(){return this._dataInfo||(this._dataInfo=new Bg(this)),this._dataInfo}getCaseLocaleReference(e){const t=this.getRawConfigProps(),n=e||this.getValue(Fr.getProperty(Fr.CASE_INFO.CASE_TYPE_ID))||this.getValue(Fr.CLASS_ID,Fr.getProperty(Fr.DATA_INFO.DATA_INFO_CONTENT))||t?.referenceClass||t?.className;return n?tm(Zg,n):null}getListActions(){return Dp(this)}getReferenceList(){return this._referenceList}isInsideList(){return this._isInsideList||/\[\d+\]/g.test(this.getPageReference())||/\[\d+\]/g.test(this.getPropertyName())}getRawMetadata(){return this.getMetadata()}setReferenceList(e){this._referenceList=e}getComponentConfig(){return this.getMetadata()?.config||{}}isExpressionExist(){return this._isExpressionExist}isWhenExist(){return this._isWhenExist}isConditionExist(){return this.isExpressionExist()||this.isWhenExist()}isBoundToState(){return this._isState}getPageReference(){return this._pageReference}getPropertyName(){const e=this.getComponentConfig();let t;return t="multi"===e.selectionMode?"selectionList":"single"===e.selectionMode&&e.selectionKey?"selectionKey":"Editable"===e.renderMode?"referenceList":"Address"===this._type?"addressProp":"value",this.getComponentConfig()[t]}getFullReference(){const e=this.getPageReference(),t=this.getPropertyName();return cS.getContextPath(e,t)}getContextName(){return this._contextName}getContainerName(){const{type:e}=this.getMetadata()||{},t=[Fr.CONTAINERS.ROOT_CONTAINER,Fr.CONTAINERS.VIEW_CONTAINER,Fr.CONTAINERS.FLOW_CONTAINER,Fr.CONTAINERS.MODAL_VIEW_CONTAINER,Fr.CONTAINERS.PREVIEW_VIEW_CONTAINER,Fr.CONTAINERS.HYBRID_VIEW_CONTAINER],{acTargetName:n=mI.PRIMARY,name:r,routingInfo:a}=this.getComponentConfig();return(e&&t.includes(e)||"@ROUTING_INFO"===a)&&r?r:this.options.containerName||n}getTarget(){return this._containerTarget}getCurrentView(){return this.viewName}populateSuggestionProps(e){if(this._rawConfig?.config&&Object.hasOwn(this._rawConfig.config,"value")&&this.getStateProps()?.value&&this.options.hasForm){const t=d?.getStore()?.getState()?.data[`${this.getContextName()}/${Fr.SUGGESTION}`],n=this.getStateProps()?.value,r=cS.getContextPath(this.getPageReference(),n),a=t?Hg.getSuggestionsContext(this.getContextName()).getField(r):void 0;this._hasSuggestions=!!a,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...vp.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig},n=Kg.getStrategy(this._type);return n?.applyFallback(t),this.populateSuggestionProps(t),this.resolveConfigProps(t,e),aS.resolveStringBooleans(e)}getLocalizationService(e){const t=this.getComponentName(),n=e||("View"===t?this._rawConfig?.config?.template:t),r=PA.getLocale()??"en-US",a=new nm(r,n),s=this.getCaseLocaleReference();return a.setLookupList(["APP!APPLICATION"]),s&&a.setLookupList([s]),a}getRawConfigProps(){const{_deepProps:e,...t}={...vp.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(t),t}resolveConfigProps(e,t={}){return e&&(cS.resolveProps(e,t,this),No.handleComponentMapping(t,{type:this.getComponentName()||"",config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),Em(e,this._stateProps),this.resolveConfigProps(this._additionalRegisteredProps)}deRegisterAdditionalProps(e=[]){return e.forEach((e=>{delete this._additionalRegisteredProps[e]})),!0}populateAdditionalProps(e){const t=e=>e?.map((e=>({...e,message:this.getLocalizationService()?.getLocalizedMessage(e.message)??e.message}))),n=this.getComponentName(),r=this.getComponentConfig(),a=n===Fr.ROOT_CONTAINER&&"portal"!==e.renderingMode;if(n===Fr.MODAL_VIEW_CONTAINER||n===Fr.CASE_CREATE_STAGE||n===Fr.OBJECTACTIONCONTAINER){const n=$I(`${Fr.APP.APP}/${this.getContainerName()}`),r=su({context:n,category:Ur.PAGE});e.pageMessages=t(r),this._stateProps.pageMessages=e.pageMessages}if(this.isEditable()){let{value:t}=this.getStateProps();void 0===t&&"multi"===this.getComponentConfig()?.selectionMode?t=this.getStateProps().selectionList||No.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=su({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:Ur.MESSAGES.MESSAGES_TYPE_ERROR}),r=su({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:Ur.MESSAGES.MESSAGES_TYPE_INFO});if(n&&n[0]){e.validatemessage=n.map((e=>this.getLocalizationService().getLocalizedMessage(e.message).replace(/\.$/,""))).join(". ")+(n[n.length-1].message.endsWith(".")?".":""),e.status=Fr.FIELD_LEVEL_ERROR,this._stateProps.validatemessage=e.validatemessage,this._stateProps.status=e.status;const r=n?.find((e=>"error"===e.type&&"required"===e.subType));r&&!e.required&&this.isVisible()&&this.clearErrorMessages({property:t,subType:"required"})}r&&r[0]&&(e.infoMessage=r[0].message,e.status=Fr.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(n===Fr.ROOT_CONTAINER){const n=lu(a,$I(`${Fr.APP.APP}/${this.getContainerName()}`));e.httpMessages=Array.isArray(n)?t(n):n,this._stateProps.httpMessages=e.httpMessages;const r=Hg.getSharedState("isLoggedOut");e.isLoggedOut=r,this._stateProps.isLoggedOut=r;const s=su({context:Fr.APP.ROOT,category:"PAGE"});e.pageMessages=t(s),this._stateProps.pageMessages=e.pageMessages}if(n===Fr.HYBRID_VIEW_CONTAINER){const n=su({context:Fr.APP.APP,category:Fr.HTTP});e.httpMessages=t(n),this._stateProps.httpMessages=n}if(n===Fr.APP_SHELL&&e.portalDocMode===Fr.CONTAINER_TYPE.MULTIPLE&&(e.activeCases=Qf.getOpenedCaseItems(`${Ur.APP.APP}/${Fr.PRIMARY}`),this._stateProps.activeCases=e.activeCases),n===Fr.APP_SHELL){const n=Fr.APP.APP,r=$I(`${n}/${this.getContainerName()}`),a=[...su({context:n,category:"PAGE"})||[],...su({context:r,category:"PAGE"})||[]],s=a.length>0?a:void 0;e.pageMessages=s&&t(s),this._stateProps.pageMessages=e.pageMessages}if(e.value&&n===Fr.SCALARLIST&&(this._stateProps.value=e.value),n===Fr.APP_SHELL||n===Fr.MODAL_VIEW_CONTAINER||n===Fr.CASE_CREATE_STAGE||r.template===Fr.CASE_PREVIEW||r.template===Fr.RULE_PREVIEW){let t=su({context:Fr.APP.APP,category:"HTTP"});const n="HYBRID"===PA.getRenderingMode()?`${this.getContextName()}/${this.getContainerName()}`:`${Fr.APP.APP}/${this.getContainerName()}`,r=su({context:$I(n),category:"HTTP"});t?r&&(t=t.concat(su({context:$I(n),category:"HTTP"}))):t=su({context:$I(n),category:"HTTP"}),e.httpMessages=t?t.map((e=>this.getLocalizationService().getLocalizedMessage(e.message))):t,this._stateProps.httpMessages=e.httpMessages,t?.forEach((t=>{t.errorDetails&&(e.errorDetails=e.errorDetails?e.errorDetails.push(...t.errorDetails):t.errorDetails,this._stateProps.errorDetails=e.errorDetails),t.correlationID&&(e.correlationID=t.correlationID)}))}if(n===Fr.VIEW_CONTAINER||n===Fr.FLOW_CONTAINER||n===Fr.MODAL_VIEW_CONTAINER||n===Fr.PREVIEW_VIEW_CONTAINER||n===Fr.ROOT_CONTAINER||n===Fr.OBJECTACTIONCONTAINER){if(e.routingInfo=ks(this.getContainerName(),this._contextName),n===Fr.ROOT_CONTAINER&&(e.rootConfig=gm.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,n===Fr.FLOW_CONTAINER||n===Fr.OBJECTACTIONCONTAINER){const n=su({context:this.getContextName(),category:Fr.CASEMESSAGES}),r=this.getContextName();e.caseMessages=n,this._stateProps.caseMessages=e.caseMessages,e.caseViewMode=this.getValue("context_data.caseViewMode"),this._stateProps.caseViewMode=e.caseViewMode;const a=FI(r)[0];if(a){const n=$I(a),r=d?.getStore()?.getState()?.data;r&&n&&(e.lastUpdateTime=r[n]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=r[n]?.caseInfo?.lastUpdateTime);const s=su({context:n,category:Ur.PAGE}),o=su({context:n,category:"HTTP"});e.httpMessages=t(o),e.pageMessages=t(s),this._stateProps.pageMessages=e.pageMessages,this._stateProps.httpMessages=e.httpMessages,o?.forEach((t=>{t.errorDetails&&(e.errorDetails=e.errorDetails?e.errorDetails.push(...t.errorDetails):t.errorDetails,this._stateProps.errorDetails=e.errorDetails),t.correlationID&&(e.correlationID=t.correlationID)}))}}if(e.loadingInfo=this.getLoadingStatus(this.getContextName()),e.isAppOffline=BC(Fr.APP.APP).context_data?.isOffline,e.assignmentNames=this.getCaseInfo().getAssignments()?.map((e=>e.name)),e.childAssignmentNames=this.getCaseInfo().getChildAssignments()?.map((e=>e.name)),n===Fr.MODAL_VIEW_CONTAINER){const t=e.routingInfo?.accessedOrder||[],n=t[t.length-1];n&&(e.loadingInfo=this.getLoadingStatus(n))}this._stateProps.loadingInfo=e.loadingInfo,this._stateProps.isAppOffline=e.isAppOffline,this._stateProps.assignmentNames=e.assignmentNames,this._stateProps.childAssignmentNames=e.childAssignmentNames}else r.template===Fr.CASE_VIEW||r.template===Fr.RULE_VIEW||r.template===Fr.SELF_SERVICE_CASE_VIEW||r.template===Fr.CASE_PREVIEW||r.template===Fr.RULE_PREVIEW||r.template===Fr.OBJECT_PAGE?(e.caseInfo=this.getCaseSummary(),this._stateProps.caseInfo=e.caseInfo):n===Fr.CASE_STAGES&&(e.stages=this.getCaseStages(),e.stageID=this.getStageID(),this._stateProps.stages=e.stages,this._stateProps.stageID=e.stageID);const s=this.getInheritedProps()?.shouldAutoRefresh;s&&this.meta?.config?.value?.includes("@P")&&void 0===this.meta.config._autoRefresh_&&(this.meta.config._autoRefresh_=`@REFRESH ${this.meta.config?.value.split("@P ")[1]}`),this.populateFieldMetadata(e),this.updateContextTree()}populateFieldMetadata(e){const{value:t,datasource:n,listType:r}=this.getComponentConfig(),{propertyValue:a,propertyAnnotation:s}=this.getPropertyDetails(r,n,t);if(a&&"string"==typeof a&&(a.includes(s)||a.includes(Fr.ATTACHMENT_ANNOTATION))){const t=No.getPropertyName(a),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=$C(`${this._pageReference}.${t}`,this._contextName);if(e?.additionalInformation&&this.setStateProps({additionalInformation:n}),!Array.isArray(e)){e.additionalInformation=n;const{inputFormat:t}=e;if("string"==typeof t&&t.startsWith("@")){const n=No.handleAnnotation(t,this);"object"==typeof n&&null!==n&&"pattern"in n&&"string"==typeof n.pattern?e.inputFormat={pattern:n.pattern}:e.inputFormat=null}}return e}getFieldMetadata(e){if(!e)return null;const t=e.split(".");if(t.length<2){let t=this.getValue(Fr.CLASS_ID);return!t&&this._rawConfig&&this._rawConfig.config&&this._rawConfig.config.ruleClass&&(t=this._rawConfig.config.ruleClass),this.resolvePropertyMetadata(oC(e,t),e)}const n=t.pop(),r=t.join(".")?".":"";let a=this.getValue(`${r}${t.join(".")}${Fr.CLASS_ID}`);return a||(a=aS.resolvePageClass(e,this.getCurrentClassID())),this.resolvePropertyMetadata(oC(n,a),e)}getCurrentPageFieldMetadata(e=null){let t=this.getPageReference().split(".");null!==e&&(t=e.split("."));const n=t.pop();return this.resolvePropertyMetadata(oC(n,this.getValue(`${t.join(".")}${Fr.CLASS_ID}`)))}getCurrentClassID(){return this._classID??this.getValue(Fr.CLASS_ID)}getCaseSummary(){const e={...this.getDataObject()[Fr.getProperty(Ur.CASE_INFO.CASE_INFO)]};return e.CaseID=e.CaseID||this.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_PZINSKEY)),{...e,isCaseWideAction:()=>Xy(this.getContextName(),this.getPageReference())}}getReferencedUser(e){const t=this.getValue("referencedUsers");if(Array.isArray(t)){const n=t.find((t=>t.UserID===e));if(n)return{userId:n.UserID,UserName:n.UserName}}return t&&t[e]?t[e]:null}getCaseStages(){return this.getDataObject()[Ur.CASE_INFO.CASE_INFO].stages}getStageID(){return this.getDataObject()[Ur.CASE_INFO.CASE_INFO].stageID}getActions(){return this._actions}isRoot(){return this._isRoot}getRelativePath(){return this._relativePath}resolveContextProps(e){const{value:t}=this.getStateProps();t&&(e.error=this.getContextDataValue(`${this.getPageReference()+t}.error`),e.validatemessage=this.getContextDataValue(`${this.getPageReference()+t}.validatemessage`))}isValidatorExist(){return!!this._isValidatorExist}getValidationApi(){return new Fh(this)}isEditable(){return!(!this._rawConfig||!this._rawConfig.config||this._inheritedConfig&&this._inheritedConfig.readOnly||!(Object.hasOwn(this._rawConfig.config,"value")||this._rawConfig.config.selectionList||"Editable"===this._rawConfig.config.renderMode&&this._rawConfig.config.referenceList)||"string"==typeof this._rawConfig.config?.value&&this._rawConfig.config.value.includes("@FILTERED_LIST")||Object.hasOwn(this._rawConfig.config,"readOnly")&&("true"===this._rawConfig.config.readOnly||!0===this._rawConfig.config.readOnly)||Object.hasOwn(this._rawConfig.config,"disabled")&&!0===this._rawConfig.config.disabled)}isVisible(){return this._rawConfig?.config&&Object.hasOwn(this._rawConfig?.config,"visibility")&&"string"==typeof this._rawConfig?.config?.visibility?No.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||No.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||"string"==typeof this._readOnly&&!0===No.handleAnnotation(this._readOnly,this))}hasChildren(){return!!this._children}getComputedVisibility(e=[]){const t="reference"===this._type&&!!this.getReferencedView(),n=t?this.getReferencedViewPConnect().getPConnect():this;if(t){const t=`${this.getRawMetadata()?.config?.name}!${this._ruleClass}`;if(e.includes(t))return!1;e.push(t)}if(!1===this.getConfigProps().visibility)return!1;if(!1===n.getConfigProps().requiresVisibleChildren||!1===this.getConfigProps().requiresVisibleChildren)return!0;const r=n.getConfigProps(),a={includeTypes:["Group","Region","View"],excludeTemplates:["ListView","SimpleTable","StudioTable"]};let s=n._type&&a.includeTypes.includes(n._type)&&!a.excludeTemplates.includes(r.template);if(!!r.highlightedData&&r.highlightedData.length&&r.showHighlightedData&&(s=!1),!s)return!0;const o=n.getChildren();return!!o&&o.some((t=>t.getPConnect().getComputedVisibility(e)))}getChildrenIterator(){return this._children.setContext(this.getPageReference()),this._children}setAction(e,t){this._actions[e]=t}getComponentName(){return this._rawConfig&&this._rawConfig.type}isComponentRefreshable(){return!(!this._rawConfig||!this._rawConfig.isRefreshable)}getDataObject(e){return BC(e||this.getContextName())}getImagePath(e){return`${fh.getConstellationServiceUrl()}/v860/${fh.getAppAlias()}/image/${e}?org=${bA.getOrganizationName()}`}skipRequiredValidation(){return this.options.isBulkAction}isBulkAction(){return this.options.isBulkAction}getChildren(){if(this._children&&this._children.length){const e=this.options?.inheritedProps?.find((e=>"shouldAutoRefresh"===e?.prop));e&&(this._inheritedConfig._inheritedProps=[...this._inheritedConfig._inheritedProps||[],e]);const t=fm(this._rawConfig,{pageReference:this._pageReference,context:this._contextName,localeReference:this._localeRuleName,hasForm:this.options.hasForm,isBulkAction:this.options.isBulkAction,containerName:this.getContainerName(),containerItemName:this.options.containerItemName,viewName:this.viewName,inheritedConfig:this._inheritedConfig,target:this._containerTarget,readOnly:this._readOnly,categoryName:"Group"===this._type?this._rawConfig?.config?.id:null,relativePath:this._relativePath}),n=[];for(;t?.hasNext();){const e=t.next();this.isBulkAction()&&this.#l(e)||n.push(e)}return t?.resetIndex(),n}return[]}setInheritedProp(e,t,n=!1){this._inheritedConfig[e]=t;const r=Object.hasOwn(this._inheritedConfig._deepProps??{},e);(n||r)&&(this._inheritedConfig._deepProps={...this._inheritedConfig._deepProps,[e]:t})}getDeepInheritedProps(){return{...this._inheritedConfig?._deepProps}}getDeepInheritedConfig(){const e=this.getDeepInheritedProps();return Object.keys(e).length>0?{...e,_deepProps:e}:void 0}#d(e){const t=this.getDeepInheritedConfig();return t?{...e,inheritedConfig:{...e.inheritedConfig,...t}}:e}getLocaleRuleName(){return this._localeRuleName}getLocalizedValue(e,t,n){const r=n||this.getLocaleRuleName(),a=r&&t?`${r}#${t}`:r,s=this.getLocalizationService(a).getLocalizedText(e);return s===e?this.getLocalizationService().getLocalizedText(e):s}getLocaleRuleNameFromKeys(e,t,n){return`${e}!${t}!${n}`}getValue(e,t){return e=e?.replace(/\((\d+)\)/g,((e,t)=>`[${parseInt(t,10)-1}]`)),this.useCustomContext?(e=e.startsWith?.(".")?e.substring(1):e,e.split?.(".").reduce(((e,t)=>e?.[t]??void 0),this.useCustomContext)):this._hasSuggestions&&this.getStateProps()?.value===e?cS.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${Fr.SUGGESTION}`):cS.getPropertyValue(e,t||this.getPageReference(),this._contextName)}setInheritedConfig(e){if(!e)return;const{readOnly:t,displayMode:n,referenceType:r,hideLabel:a}=e;a&&(this._inheritedConfig.hideLabel=a),r&&(this._inheritedConfig.referenceType=r),n&&(this._inheritedConfig.displayMode=n),(this._inheritedConfig.readOnly||t)&&(this._inheritedConfig.readOnly=t),e.inheritedProps&&(e.inheritedProps?.forEach((e=>{"required"===e.prop&&(this._inheritedConfig[e.prop]=e.value)})),Im(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),cS.resolveProps(t,e,this),e}setValue(e,t,n,r=!1,a={}){if(!aS.isValidPropertyReference(e))return;let s,o;const{isArrayDeepMerge:i}=a;this.isInsideList()&&this.getListActions().updateProperty(e,t),this.isBulkAction()&&(s=!0,t||(o=!0)),VC({type:"SET_PROPERTY",payload:{reference:cS.getContextPath(this.getPageReference(),e),value:t,initialValue:n,isImplicit:r,context:this.getContextName(),...void 0!==i&&{isArrayDeepMerge:i},...s&&{isStrictTracking:s},...o&&{removePropertyFromChangedList:o}}})}updateDirtyCheckChangeList(e,t){const n={reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName()};iI(n)}getContextDataValue(e,t){return qC(t||this.getPageReference(),e,this._contextName)}updateState(e){const t=this._pageReference.indexOf(Fr.CASE_INFO.CASE_INFO_CONTENT),n=this._pageReference.indexOf(".");let r=Fr.CASE_INFO.CASE_INFO_CONTENT;0!==t&&(r=n>0?this._pageReference.substring(n):this._pageReference),VC(gS({context:this._contextName,data:e,rootPageReference:r}))}replaceState(e,t,n={}){if(!aS.isValidPropertyReference(e))return;const{skipDirtyValidation:r=!1}=n;VC({type:"REPLACE_PROPERTY",payload:{reference:cS.getContextPath(this.getPageReference(),e),value:t,context:this.getContextName(),skipDirtyValidation:r}})}reportError(e,t,n){VC(GS(e,t||{},n,t?.formFields))}getComponent(){return ym({getPConnect:()=>this})}createComponent(e,t,n,r){let a=this._pageReference;if(t){const e=YC(`${this.getPageReference()}.${Fr.SUMMARY_OF_LISTS}`,t,this._contextName);a=cS.getContextPath(e||t,n)||t}else if(r&&r.pageReference){let e=r.pageReference;e=No.handleAnnotation(e,this),a=cS.getContextPath(this._pageReference,e)||""}return ym(Cm({meta:e,index:this.index,options:this.#d({containerName:this.getContainerName(),hasForm:this.options.hasForm,...e.options,pageReference:a,context:this._contextName,target:this._containerTarget,readOnly:this._readOnly||this._inheritedConfig?.readOnly,viewName:this.viewName}),useCustomContext:this.useCustomContext}),r)}getReferencedView(){if(this.meta)return cS.resolveReference(this.resolveConfigProps(this.meta),this)}_resolvePageRef(e){return this.getPageReference().includes(e)||e.startsWith(Fr.CLASS_ANNOTATION)?this.getPageReference():`${this.getPageReference()}${e}`}getReferencedViewPConnect(e=!1){const t={...this.getComponentConfig()},n=this.options?.inheritedConfig?._inheritedProps?.find((e=>"shouldAutoRefresh"===e.prop));return n&&!t?.inheritedProps?.some((e=>"shouldAutoRefresh"===e.prop))&&t?.inheritedProps?.push(n),delete t?.name,delete t?.type,Cm({meta:this.getReferencedView(),options:this.#d({...e?this.options:void 0,...t,context:this.getContextName(),pageReference:t.context?this._resolvePageRef(t.context):this.getPageReference(),viewName:this.viewName})})}getContainerManager(){return new Qh(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new kg(this)),this._actionsApi}getActionManager(){return Th}doesContextExist(e){return nS(e??this.getContextName())}getGoogleMapsAPIKey(){return cn()}getServerURL(){return an()}getLoadingStatus(e){let t=null;return e?(t=BC(e),t=t?t.context_data:null):t=this.getDataObject().context_data,!!t&&(!!t.isLoading&&t.isLoading)}clearErrorMessages(e){e?.property?ou({type:"error",property:e.property,pageReference:this.getPageReference(),context:this.getContextName(),...e.subType&&{subType:e.subType}}):e?.context?ou({type:"error",...e}):(ou({type:"error",...e,context:Fr.APP.APP}),ou({type:"error",...e,context:$I(`${Fr.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return YC(`${this.getPageReference()}.${Fr.SUMMARY_OF_LISTS}`,e,this.getContextName())||e}removeFormField(){}addFormField(){}setPageValue(e,t,n){delete e?.classID,this.replaceState(t,e),n?((e,t,n)=>{const r=(e,t)=>{Object.entries(e).forEach((([e,a])=>{if(Array.isArray(a)){const r=PCore.createPConnect({options:{pageReference:n.getPageReference(),context:n.getContextName(),referenceList:`${t}.${e}`}}).getPConnect();Op(r,`${t}.${e}`,{skipStateUpdate:!0});for(let e=0;e<a.length;e+=1)Ap(a[e],e,r,void 0,{})}else"object"==typeof a&&r(a,`${t}.${e}`)}))};r(e,t)})(e,t,this):My(this.getContextName(),`${this.getPageReference()}${t}`,this.getStateProps()?.value??"")}acceptSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=Hg.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,r=cS.getContextPath(this.getPageReference(),n),a=t.getField(r);this._hasSuggestions=!1,this.getActionsApi().updateFieldValue(n,a),this.getActionsApi().triggerFieldChange(n,a),t.removeField(r,{actionPerformed:"accepted"})}}ignoreSuggestion(e){if(this.getStateProps()?.value&&this.options.hasForm&&this._hasSuggestions){const t=this.getStateProps()?.value||e,n=cS.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,Hg.getSuggestionsContext(this.getContextName()).removeField(n,{actionPerformed:"ignored"});const r=Ao.getDependencies(this._contextName,n);r?.forEach((e=>{Hg.getSuggestionsContext(this.getContextName()).removeField(e,{actionPerformed:"ignored"})}))}}getSelfReferencingDatapageKeys(){const e=[],t=this.getPropertyName(),n=this.getFieldMetadata(t),{datasource:{parameters:r={}}={}}=n||{};return Object.values(r).forEach((n=>{const[,r]=n.split("."),a=t?.split(".").pop();r===a&&e.push(n.substring(n.lastIndexOf(".")+1))})),e}isReadOnlyField(){const{value:e,datasource:t,listType:n}=this.getComponentConfig(),{propertyValue:r,propertyAnnotation:a}=this.getPropertyDetails(n,t,e);if(!r||"string"!=typeof r||!r.includes(a)&&!r.includes(Fr.ATTACHMENT_ANNOTATION))return!1;const s=No.getPropertyName(r),o=this.getFieldMetadata(s);if(!o)return!1;const i={...this.getComponentConfig(),fieldMetadata:o,template:this._rawConfig?.config?.template};return this.#u(i,s)}#u(e,t){const n=Yh.isPropertyInternal(t),r=e.datasource,a=this.getComponentConfig().isSearchField,{isClassKey:s,isSpecial:o,isDeclarativeTarget:i}=e.fieldMetadata??{},c="DataReference"===e.template||"ObjectReference"===this.meta?.type,l=e.listType!==Fr.ASSOCIATED;return!a&&!!(i||n||!r&&(s&&!c||o)&&l)}getPropertyDetails(e,t,n){return e===Fr.ASSOCIATED?{propertyValue:t,propertyAnnotation:Fr.ASSOCIATED_PROPERTY_ANNOTATION}:{propertyValue:n,propertyAnnotation:Fr.PROPERTY_ANNOTATION}}updateConfigData(e,t,n){e.fieldMetadata=t,t.additionalInformation&&(e.additionalInformation=t?.additionalInformation),t.inputFormat&&"string"!=typeof t.inputFormat&&(e.inputFormat=t.inputFormat),this.#u(e,n)&&(e.readOnly=!0,this._stateProps.readOnly=e.readOnly,e.fieldMetadata.isDeclarativeTarget&&this.registerAdditionalProps({readOnly:!0})),e.fieldMetadata?.isReadOnly&&(e.readOnly=!0,this.registerAdditionalProps({readOnly:!0}))}#l(e){const t=e.getPConnect().getComponentName(),n=e.getPConnect().getConfigProps().template;return!(!0===gm.allowedComponetsForBulkProcessing[t]||!0===gm.allowedComponetsForBulkProcessing[t]?.[n])}}function Cm(e){const t=new Am(e);return{getPConnect:()=>t}}function Sm(e){ym=e}const _m={CASE_INFO:`${Fr.DATA}.${Fr.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${Fr.DATA}.${Fr.CASE_INFO.CASE_TYPE_ID}`,NEXT_ASSIGNMENT_INFO_ID:`${Fr.DATA}.${Fr.NEXT_ASSIGNMENT_INFO_ID}`,ASSIGNMENTS:`${Fr.DATA}.${Fr.CASE_INFO.ASSIGNMENTS}`,CASE_INFO_ID:`${Fr.DATA}.${Fr.CASE_INFO.CASE_INFO_ID}`,CASE_FIRST_FLOW_ACTION_NAME:`${Fr.DATA}.${Fr.CASE_INFO.ASSIGNMENTACTION_ID}`,CASE_FIRST_ASSIGNMENT_ID:`${Fr.DATA}.${Fr.CASE_INFO.ASSIGNMENT_ID}`},Nm=(e,t)=>{const{vcName:n,containerName:r}=t;return r||n||Oh.getTargetViewContainerName(e)},bm=e=>{const t=e.lastIndexOf(Fr.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(Fr.UNDERSCORE_STRING);return e.substring(t,n)},Tm=e=>e===mI.WORKAREA,Pm=e=>e===mI.MODAL,Om=e=>e===Ua,Dm=e=>e===ba,vm=e=>e&&e.find((e=>e.type===ba)),Rm=e=>aS.getIn(e,_m.CASE_INFO,{}),$m=e=>e?e.split(" ").pop():void 0,xm=e=>aS.getIn(e,_m.CASE_CLASS_NAME,Fr.EMPTY_STRING),wm=(e,t=!1)=>{const n=t?Mh(e):Rm(e);return Qy(n)&&Jy(PA.getOperatorIdentifier(),n)},Mm=e=>aS.getIn(e,_m.CASE_INFO_ID,Fr.EMPTY_STRING),Lm=e=>aS.getIn(e,_m.CASE_FIRST_ASSIGNMENT_ID,Fr.EMPTY_STRING),Um=(e,t)=>{const{removeActionPayload:n,target:r}=t;if(n&&n.containerItemID){const{containerItemID:t,context:a}=n;e.push(BS(MS,{containerItemID:t,context:a||MI(t),target:r}))}},Fm=e=>{const t=e.context;if(zy.shouldUseUnifiedHandling()){const e=QI(t),{accessedOrder:n=[],type:r}=II(e),a=n.filter((e=>e!==t));VC(MS({containerItemID:t,context:t,target:e,containerInfo:{newAccessedOrder:a,containerType:r}}))}else JI(t,{skipDirtyCheck:!0})},jm=e=>{const t=kC();if(!e)return!1;const n=Wr(e),r=QI(n),a=QI(e);if(!r||!a)return!1;const s=CI(r,n),o=CI(a,e);if(!s||!o)return!1;const{key:i}=s||{};let{key:c}=o||{};return c||(c=t?.getState().data?.[e]?.caseInfo?.ID),i&&c&&i===c},km=(e,t,n={})=>{const{skipFlowNameUpdate:r}=n,a=Mm(t);aS.setIn(e,"key",a);const s=Qy(Rm(t));if(!r&&(e=>{const t=aS.getIn(e,_m.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=Lm(t),[,r]=n.split("!");o={assignmentID:n,isInCreateStage:s},gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,o),aS.setIn(e,"flowName",r)}var o},Vm=(e,t)=>{const{attachmentsExist:n}=t;n&&aS.setIn(e,Ur.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),aS.setIn(e,Ur.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},Bm=(e,t,n)=>{let r=Fr.PROMISE_VALUE.RESOLVE;return vm(e)?(r=Fr.PROMISE_VALUE.REJECT,n?Th.rejectActionByID(t,!0,n):Th.rejectActionByID(t)):Th.resolveActionByID(t),r},Gm=e=>zy.isCoexistenceCase(e),Wm=()=>"true"===PA?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,Hm=(e,t,n,r)=>{const{containerItemID:a}=t;if(a){const{caseClassName:s,skipAssignmentsUpdate:o}=r,i=Wr(a),c=QI(i),l=c&&II(c),d=c&&$I(c),u=zr(i),p=n?.data?.caseInfo?.ID;d&&l?.items?.[d]?.key===t?.caseID&&e.push(BS(yS,{containerItemID:i,context:i,container:u,containerName:u,caseId:p,viewName:Fr.getDefaultQualifiedName(Ur.CASESUMMARY_VIEW_NAME),updateData:!0,viewLoadingContainer:{context:i},caseClassName:s,...void 0!==o&&{skipAssignmentsUpdate:o}}))}},qm=async(e,t)=>{const{context:n,containerItemID:r,shouldUpdateCaseActionsInParentContext:a}=e,s=t?.data?.caseInfo?.ID?Mm(t):void 0;if(!n||!s)return;const o=s?`${s}_actionsLoading`:"actionsLoading";try{const i=new Am({}),c=new Vg(i);Nh.setComponentCache(o,!0);const l=t?.data?.caseInfo?.caseTypeID?xm(t):void 0,d=await c.getCaseActions(s,n,{caseTypeID:l});am(t);const u=aS.getIn(t.data,Fr.getProperty(Fr.CASE_INFO.CASE_INFO_ACTIONS)),p=Array.isArray(d.availableProcesses)&&d.availableProcesses.length>0?{availableProcesses:d.availableProcesses}:[],h=d?.availableActions,f=["pyUpdateCaseDetails"],g=Array.isArray(h)&&h.find((e=>f.includes(e.ID))),m={data:{caseInfo:{availableActions:[...d.availableActions,...void 0!==u?u:[]],...p,editActions:g?[g]:[]}}};Nh.setComponentCache(o,!1),VC(BS(gS,{context:n,...m})),!0===a&&r&&(async(e,t)=>{const{containerItemID:n,caseID:r}=t;if(n){const t=Wr(n),a=QI(t),s=a&&II(a),o=a&&$I(a);o&&s?.items?.[o]?.key===r&&VC(BS(gS,{context:t,...e}))}})(m,e)}catch(e){Nh.setComponentCache(o,!1),console.error("Error fetching case actions:",e)}},Ym=(e,t)=>{const n=xm(e?.response),r=Rm(e?.response),{caseTypeID:a}=r,s=PA.getFeatureMap();(s?.deferUpdateCaseSummaryView??!Object.hasOwn(s,Fr.DEFER_UPDATE_CASESUMMARY_VIEW))&&a&&Hm(t,e?.actionInPayload,e?.response,{caseClassName:n,skipAssignmentsUpdate:!e?.actionInPayload?.context?.includes(Fr.PREVIEW)})},zm=()=>PA.isOptimizedCaseLoadingEnabled(),Km=(e,t)=>{zm()&&qm(t,e)},Qm=e=>BC(e)?.context_data?.caseViewMode,Jm=e=>!(!Nh.getComponentCache("redirectionInProgress")||!e)&&(Bm([],e),!0);const Xm=new class{confirmHandler=null;registerConfirmHandler(e){this.confirmHandler=e||null}confirm(e){return this.confirmHandler?this.confirmHandler(e):Promise.resolve(window.confirm(e))}},Zm=Xm,{RESOURCE_TYPES:ey}=Ur,ty={PAGE:"page",FORM:"form"},ny={[ey.CASE]:[Qa,za,Ka],[ey.OBJECT]:[ws,Ms,Us],[ey.PAGE]:[Wa,qa],[ey.DATA]:[Ha],ASSIGNMENT:[os]},ry=(e,t,n={})=>{if(!e)return{};const r={etag:e.etag},{RemoteSystemID:a}=n;return e[Ur.REMOTE_SYSTEM_ID]||e[Ur.REMOTE_SYSTEM_ID.toLowerCase()]||a?r.RemoteSystemID=e[Ur.REMOTE_SYSTEM_ID]||e[Ur.REMOTE_SYSTEM_ID.toLowerCase()]||a:t&&Vr.isRemoteCase(t)&&(r.RemoteSystemID=Vr.getRemoteHeader(t)),r},ay=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:r=!1,skipUUID:a=!0,isTransientContext:s=!1,includeDisabledFields:o=!1,isObjectWideAction:i,isExternalObject:c}=t;let l={};l=Vy(e,{isTransientContext:s,includeDisabledFields:o,isObjectWideAction:i,isExternalObject:c}),n&&(delete l?.caseInfo?.content,s&&(l={}));const d=tI(e,!1),u=BC(e),p=Fn(u,Fr.CASE_INFO.CASE_INFO_ENCRYPTED_CONTENT),h=void 0!==p;!s&&r&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,r])=>{const a=BC(t),s=Fn(a,Ur.CASE_INFO.CASE_INFO_CLASSID),o=oC(n,s);("True-False"===o?.type&&!r||""===r)&&delete e.caseInfo.content[n]}))})(l,e);const f=Rr(d,l);let g={};({content:g}=((e,t,n=!1,r=!1)=>{let a={};const s=zy.shouldUseUnifiedHandling()||!n&&!r?t?.caseInfo:t?.objectInfo;return(e||s)&&(a=e?{...t}:{...s}),{content:a}})(s,f,i,c));const m=[...yp(e)];if(a){const e=Mr.getDefaultQualifiedName("EmbedListUUID__");m.forEach((t=>{delete t.content?.EmbedListUUID__,delete t.content?.[e]}))}g.pageInstructions=m;if((up[e]||[]).forEach((e=>{if(g?.content){const t=e?.replace(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_CONTENT),"");aS.deleteIn(g.content,(e=>{if(!e)return"";const t=e.split(".");let n,r="";for(n of t)if(n){if(n.includes("[")&&n.includes("]"))return r+=`['${n.substring(0,n.lastIndexOf("["))}']`,r;r+=`['${n}']`}return r})(t))}})),h&&(g.encryptedContent=p),!s&&f?.dataInfo)return g={...f.dataInfo,pageInstructions:g.pageInstructions},{content:g};const y=HC(Mr.getQualifiedNameForComplexRuleReferences(".pzAdditionalPayload"),Fr.CASE_INFO.CASE_INFO_CONTENT,e);return g.content&&y&&(g.content[Mr.getDefaultQualifiedName("pzAdditionalPayload")]=y),{content:g}},sy=(e,t)=>{let n,r,a={};const s=aS.getIn(e,Fr.UI_RESOURCES),o=aS.getIn(e,"confirmationNote");s?(n=aS.getIn(e,Fr.UI_RESOURCES_CONTEXT_DATA),r=aS.getIn(e,Fr.ROOT),a=aS.getIn(e,Fr.ACTION_BUTTONS)):o&&!t.isActiveWorkAreaPrimaryAndWorkareaAbsent&&(r={});const{data:i={},Errors:c,flowName:l}=e;let{semanticURL:d,key:u}=e;const p=i?.objectInfo?.ID;p&&(u=u||p,d=d||`objects/${p}`);const h=aS.getIn(e,"nextAssignmentInfo",null),f=aS.getIn(e,"nextAssignmentInfo.context",""),g=aS.getIn(e,"confirmationLinks",null),{isInCreateStage:m,openCaseViewAfterCreate:y,debugInfo:E,isExternalObjectCreationFlow:I,isExternalCaseCreationFlow:A}=t;return{data:{...i,key:u,flowName:l,coreHeaders:E&&{debugInfo:{[Fr.COREHEADER_APP_DEBUG_ID]:E.debugId}},[Fr.getProperty(Fr.CASE_INFO.CASE_INFO)]:{...i[Fr.getProperty(Fr.CASE_INFO.CASE_INFO)],actionButtons:a,headers:t.headers},[Fr.CONTEXT_DATA]:m?{...i[Fr.CONTEXT_DATA],...n,openCaseViewAfterCreate:y,errors:c,...I&&{isExternalObjectCreationFlow:I},...A&&{isExternalCaseCreationFlow:A}}:{...i[Fr.CONTEXT_DATA],...n,errors:c}},semanticURL:d,nextAssignmentInfo:h,assignmentContext:f,confirmationLinks:g,key:u,root:r,...t}},oy=async(e,t,n,r=!1,a=!1)=>{const s=aS.getIn(e,Fr.COMPONENTS);if(s)try{await yh(s)}catch(e){console.error(e)}const o={actionConfig:t,...n};r?g_({...e,options:o,directUrlUpdation:!0}):Jp(e,o,a)},iy=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},cy=e=>{if(e){const[,t]=e.split("!");return{key:iy(e),flowName:t}}return{}},ly=(e,t,n,r)=>{switch(!0){case Boolean(e[Fr.ERROR_IN_PAGE_IDENTIFIER]&&e[Fr.ERROR_FIELD_IN_PAGE]):{const a=`${e[Fr.ERROR_FIELD_IN_PAGE]}`.replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`)),s=`${a}${e[Fr.ERROR_IN_PAGE_IDENTIFIER]}`,o=aS.deepClone(e);o[Fr.ERROR_FIELD_IN_PAGE]=a,t.includes(s.slice(1))||t.includes(s.substring(s.indexOf(".")+1,s.indexOf("[")))||t.includes(s.substring(s.indexOf(".")+1,s.indexOf("(")))?r.push(o):n.push(e);break}case Boolean(e[Fr.ERROR_IN_PAGE_IDENTIFIER]&&!e[Fr.ERROR_FIELD_IN_PAGE]):{const a=e[Fr.ERROR_IN_PAGE_IDENTIFIER].slice(1);t.includes(a)?r.push(e):n.push(e);break}default:n.push(e)}},dy=e=>{const{payload:t}=e,{err:n,context:r,actionMgrID:a}=t,s=n&&n.response?n.response.data:"",o=Hy(r);return a&&Th.rejectActionByID(a,!0,n),BS(GS,"Error action triggered",s,r,o)},uy=(e,t)=>VI(e)&&GI(e)?BS(FS,t):BS(_S,t),py=(e,t)=>{t&&e.caseInfo?.content&&(e.caseInfo.content.remoteCaseMeta=t)},hy=(e,t,n=Fr.APP.APP,r={})=>{let a=null;const{buildNew:s=!0}=r;return VI(e)?a=GI(e)?$I(e):Hr(t,n):BI(e)&&(GI(e)&&!s?a=LI(e):GI(e)&&!s||(a=Hr(t,n))),a},fy=e=>e&&e.type===Oa,gy=e=>{let t=!1;const n=jI(e);for(let e=0;e<n.length;e+=1){const r=n[e];if(r&&cI(r)){t=!0;break}}return t},my=async(e,t={})=>{let n=!1,r=!1,a={},s=!0,o=!1,i=!1;const{showConfirmDialogForMaxDocumentLimitReached:c=!1,dirtyMessage:l,skipChildDirtyState:d=!1,loadingContext:u}=t,p=$A();if(VI(e)){const t=$I(e);if(!t)return{continueExecution:s,removeActionPayload:a};const r=MI(t);cI(r)&&(n=!0),d||n||(n=gy(t))}else if(BI(e)&&qI(e)){let t=KI(e);t||(t=$I(e),r=!0),a.containerItemID=t,a.context=MI(t)}if(n){const t={context:u||e};bh.disableLoadingIndicator(t);const n=l||ZE;o=await Zm.confirm(p.getLocaleValue(n,"Messages")),bh.enableLoadingIndicator(t)}if(!o&&n&&(a={},s=!1),r){const t={context:u||e};bh.disableLoadingIndicator(t);const n=p.getLocaleValue(eI,"Messages");c?i=await Zm.confirm(n):(await Zm.confirm(n),s=!1),bh.enableLoadingIndicator(t)}return!i&&r&&(a={},s=!1),{continueExecution:s,removeActionPayload:a}},yy=(e,t)=>{let n=!1;const r=PA.isCoexistenceAppOfType(Fr.APP_TYPE.UIKIT),{insKey:a,isParallelCall:s,skipFlowNameCheck:o}=t;if(!a)return{};const[,i]=a.split("!")||"",c=o?a:iy(a),l=PI(e,c);let d={},u=!1;if(l&&!r&&((e,t)=>{const n=CI(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,d=CI(e,l),!o)){let e=d?.flowName;const t=bm(l),r=UI(l);if(r.length){const n=((e,t)=>e?.includes(Fr.WORKAREA)?Fr.WORKAREA:t)(r[0],t),a=js(n,r[0]);e=CI(a,r[0])?.flowName}else n=e===i;(e!==i||s)&&(u=!0)}return n=((e,t)=>!t&&e)(n,t.forceRefresh),{activate:n,activateContainerActionPayload:{target:e,isParallelAssignment:u,containerItemID:l,semanticURL:d.semanticURL,insKey:a}}},Ey=(e,t,n)=>e===ey.PAGE?((e,t={})=>{let n=!1;const{semanticURL:r}=t,a=PI(e,r);return a&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:a,semanticURL:r}}})(t,n):e===ey.ASSIGNMENT?yy(t,{...n,type:e}):e===ey.CASE||e===ey.OBJECT?yy(t,{...n,skipFlowNameCheck:!0,type:e}):{},Iy=e=>{if(e){const t=(e=>{const t=SI(e);if(!t)return null;for(const[e,n]of Object.entries(t))if(!n.key&&n.resourceType===Ur.PAGE)return e;return null})(e);if(t)return{activate:!0,activateContainerActionPayload:{target:e,containerItemID:t,semanticURL:""}}}return{activate:!1}},Ay=(e,t,n)=>{const{semanticURL:r,isDefaultNavPage:a}=((e,t)=>{const n=s_(Wa,{page:e,pageClass:t}),r=kC()?.getState()?.data?.app?.pyPortal?.pyPrimaryNavPages,a=Array.isArray(r)?r[0]:void 0;return{semanticURL:n,isDefaultNavPage:!(a?.pyRuleName!==e||a?.pyClassName!==t)}})(e,t);if(n&&r&&!a){const e=Ey(ey.PAGE,n,{semanticURL:r});if(e.activate)return{semanticURL:r,activate:!0,activateContainerActionPayload:e.activateContainerActionPayload}}if(a){const e=Iy(n);return e.activate?{semanticURL:r,...e}:{semanticURL:"",activate:!1}}return{semanticURL:r,activate:!1}},Cy=(e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e),Sy=(e=[])=>{GI(`${Fr.APP.APP}/${Fr.PREVIEW}`)&&e.push(BS(SS,YI({context:Ur.APP.APP,name:Fr.PREVIEW})))},_y=e=>{let t;for(const n of Object.keys(ny))if(ny[n].includes(e)){t=n;break}return t},Ny=(e,t,n="",r={})=>{const{data:a={},context:s,caseViewMode:o,skipMergeAssignmentsAndActions:i=!0}=e,c={data:{...a},caseViewMode:o,context:Wr(s)};aS.deleteIn(c.data,"shared"),aS.setIn(c.data,["context_data","caseViewMode"],o),t.push({type:fs,payload:{context:c.context,skipMergeAssignmentsAndActions:i}});const l=n&&![Ur.CASE_INFO.CASE_INFO_CONTENT,Ur.DATA_INFO.DATA_INFO_CONTENT].includes(n),{propertiesToReplace:d=[]}=r;t.push(BS(gS,{...c,...l&&{uiRootReference:n}},...d.length>0?[{propertiesToReplace:d}]:[]))},by=e=>{if(Array.isArray(e)&&e.length>0){const t=(e=>{const t=e[0];for(const t of e)if("other"===t?.payload?.nextAssignmentInfo?.context||"remote"===t?.payload?.nextAssignmentInfo?.context)return t;return t})(e),n=aS.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const r=aS.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:aS.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:aS.getIn(t,["payload","context"]),context:aS.getIn(t,["payload","context"])},r={type:ma,payload:{...n}};e.push(r),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),VC(e),e=e.filter((e=>e.type!==ma))}const a=((e,t,n)=>({assignmentID:e,vcName:Fr.PRIMARY,targetContainerName:aS.getIn(t,["payload","target"]),context:aS.getIn(t,["payload","context"]),..."other"===n&&{isChild:!0},isProcessAction:t?.payload?.isProcessAction,..."remote"===n&&{isRemote:!0},..."remote"===n&&{remoteClassName:t.payload.nextAssignmentInfo.className}}))(r,t,n);VI(a.targetContainerName)||t?.payload?.containerName!==Fr.WORKAREA||(a.isMultiDoc=!0,e=[]);const s={type:ya,payload:{...a}};e.push(s),VC(e)}else VC(e)}},Ty=(e,t)=>Rr(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),Py=e=>{let t={},n=yA(e);for(;n;){const e=ay(n);t=Ty(e.content,t),n=yA(n)}return t},Oy=e=>{e?.containerItemID&&Hg.updateState(e.containerItemID,"traditionalGadgetId",zy.getUniqueGadgetId(),{skipDirtyValidation:!0})};class Dy{static getChanges(e){return{...tI(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:r=!1,onlyChangedData:a=!1}=t||{},{content:s}=ay(e,{isTransientContext:n,includeDisabledFields:r,onlyChangedData:a});return s}static isStateModified(e){return cI(e)}static hasUnsavedChanges(e){return cI(e)||Pp(e??null)}static resetComplexObjectDirtyStatus(e){return aI(e)}static isFormValid(e,t){return Gy(e,t)}static clearChangedProperties(e){return Ep(e),mp(e),dI(e)}static getEditableFields(e){return qy(e)}static setCustomValidator(e,t){zp.register(e,t)}static isPropertyEditable(e,t){return Dy.getEditableFields(e).some((e=>e.name===t))}}const vy=Dy;const Ry=new class{constructor(){this.states={},this.unConnectedStates={}}getStateMachine(e,t,n){return this.states?.[e]?.[`${t}${n}`]||this.unConnectedStates?.[e]?.[`${t}${n}`]}getAllStateMachines(e,t,n){return{states:this.states?.[e]?.[`${t}${n}`],unConnectedStates:this.unConnectedStates?.[e]?.[`${t}${n}`]}}getAllStateMachinesByContext(e){return{states:this.states?.[e],unConnectedStates:this.unConnectedStates?.[e]}}isStateMachineExist(e,t,n){return!!this.states?.[e]?.[`${t}${n}`]||!!this.unConnectedStates?.[e]?.[`${t}${n}`]}getUnConnectedStateMachines(e){return this.unConnectedStates?.[e]}setStateMachine(e,t,n,r){const a=`${n}${t}`,{stateMachine:s}=this.getStateMachineObjByPath(a,e,!0,!0),o=(t,n,r=!1)=>{const a=r?this.states:this.unConnectedStates;a[e]||(a[e]={}),a[e][t]||(a[e][t]={}),a[e][t]=n};if(s&&s.targetPageReference!==r.targetPageReference)return s.addChild(r),void o(a,r);const i=Object.entries(this.states[e]||{}).filter((([e])=>{if(e.includes(a)){const t=e.substring(0,a.length).length;return e.substring(t).startsWith("[")||e.substring(t).startsWith(".")}return!1})).reduce(((e,[t,n])=>({...e,[t]:n})),{});Object.keys(i)?.length?(Object.entries(i).forEach((([t,n])=>{delete this.states[e][t],r.addChild(n),o(t,n)})),this.states[e][a]=r):o(a,r,!0)}buildPageInstructionsByContext(e,t){const n=this.getStateMachinesByContext(e)||{},r=[];return Object.keys(n).sort().forEach((a=>{const s=Zd.getContextReferences(e)?.get(a),o=s&&cS.resolveContextTreeNodeProps(s.props)||{},i=n[a];if(s&&!0!==o.readOnly){const e=i.buildSubmitPageInstructions(t);r.push(...e)}else if(i.hasEncryptedContent){const e=i.buildSubmitPageInstructions(t).filter((e=>void 0!==e.encryptedContent));r.push(...e)}else s||this.setStateMachineEmpty(e,a)})),r}buildClientChangeList(e){const t=this.getStateMachinesByContext(e)||{};let n={};const r={};return Object.keys(t).forEach((e=>{const r=t[e].getChangeList();n={...n,...r}})),aS.flatten(n,"",r),r}getStateMachinesByContext(e){return e?this.states?.[e]:void 0}clearStateMachines(e){this.states[e]={},this.unConnectedStates[e]={}}setStateMachineEmpty(e,t){const n=this.getStateMachine(e,t,"");n.root=null,n.current=null,n.hasEncryptedContent=!1;const r=this.getUnConnectedStateMachines(e)||{};Object.keys(r).forEach((e=>{e.includes(t)&&delete r[e]}))}removeStateMachine(e,t){delete this.states[e]?.[t]}createStateMachine(e,t){let n=e.substring(0,e.lastIndexOf("["));const r=n.substring(n.lastIndexOf("."));n=n.substring(0,n.lastIndexOf(".")),n&&r&&hp(t,r,n)}getStateMachineObjByPath(e,t,n,r=!1){const a=/\[\d+\]$/gm,s=e;let o;for(;e&&!this.isStateMachineExist(t,"",e);){const i=QI(t),c=CI(i,t)||{},l=c?.isPageGroup||c?.subscriptFieldName||"string"==typeof c?.index;if(o=null,n&&e.endsWith("]")){if(o=e.match(a),o=o?.[o.length-1]?.substring(1,o[o.length-1].length-1),[e]=e.split(a),!r&&!this.isStateMachineExist(t,"",e)){this.createStateMachine(s,t);break}}else{if(c?.index&&e.includes(c.index)&&l){const t=e.split(".");o=t[3],e=t.slice(0,3).join(".");break}e=e.substring(0,e.lastIndexOf("."))}}return e?{stateMachineTarget:e,stateMachine:this.getStateMachine(t,"",e),index:o}:{}}executeStateMachine(e,t,n,r=!0,a={}){const{stateMachineTarget:s,index:o}=this.getStateMachineObjByPath(t,e,r);if(!s)return!1;const i=QI(e),c=CI(i,e)||{};let[,l]=t.split(s);if(!l)return!1;const d=c?.subscriptFieldName&&t.includes(c?.index)||c?.isPageGroup;null!==o&&([,l]=d?l.split(/(?=\.\w+)/):l.split(/^\[\d+\]/gm));const u={[xy(l)]:n},p=this.getStateMachine(e,"",s);if(null!==o)if(d){const t=yp(e);"CREATE"===c?.resourceStatus&&t.forEach((e=>{"UPDATE"!==e.instruction||e.groupIndex!==c.index||e.content[c.subscriptFieldName]||p.update({[c.subscriptFieldName]:c.index},o,a.skipStateUpdate??!0,a)})),p?.update(u,o,a.skipStateUpdate??!0,a)}else p?.update(u,Number(o)+1,a.skipStateUpdate??!0,a);else p?.updatePage(aS.unflatten(u));return!0}setUniqueField(e,t,n){const r=Zd.getContextReferences(e)?.get(n)?.props?.uniqueField;r&&(t.content||(t.content={}),t.content[xy(r)]=crypto.randomUUID())}getBasePageReference(e){return HC(Ur.DATA_INFO.DATA_INFO_CONTENT,"",e)?Ur.DATA_INFO.DATA_INFO_CONTENT:Ur.CASE_INFO.CASE_INFO_CONTENT}mergeServerPageInstructions(e,t){t.forEach((t=>{if(t.target){const n=aS.convertClipboardPageToPageRefNotation(t.target),r=`${this.getBasePageReference(e)}${n}`;if(!this.isStateMachineExist(e,r,"")){const t=r.substring(r.lastIndexOf(".")),n=r.substring(0,r.lastIndexOf("."));hp(e,t,n)}const a=this.getStateMachine(e,r,"");"INSERT"===t.instruction&&this.setUniqueField(e,t,r),void 0!==t.encryptedContent&&a&&(a.hasEncryptedContent=!0),a?.insertNode(t)}}))}registerForServerChanges(){LC.registerForListChanges(((e,t,n)=>{setTimeout((()=>{this.generatePageInstructions(e,t,n)}),0)}))}registerForServerChangesSync(){LC.registerForListChanges(((e,t,n)=>{this.generatePageInstructions(e,t,n)}))}generatePageInstructions(e,t,n){const r="].";if(!t.includes(".classID")&&vy.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(r)){const a=t.substring(0,t.lastIndexOf("[")),s=vy.getEditableFields(e);if(["multiselect","checkbox"].includes(s.find((e=>e.name===a))?.type)){const s=Zd.getContextReferences(e),o=s?.get(a),i=t.substring(t.lastIndexOf(r)+2);o?.props.selfReferencingDatapageKeys?.includes(i)&&this.executeStateMachine(e,t,n)}}}unRegisterForServerChanges(){LC.unRegisterForListChanges()}},$y={},xy=e=>e.startsWith(".")?e.substring(1):e,wy=e=>{delete $y[e]},My=(e,t,n)=>{const r=xy(t);$y[e]?$y[e].fieldOrder[r]=n:$y[e]={fieldOrder:{[r]:n}}},Ly=(e,t={})=>{const{includeDisabledFields:n=!1}=t,r=cS.resolveContextTreeNodeProps(e),a=!0!==r.readOnly&&!1!==r.visibility&&(n||!0!==r.disabled),s="string"==typeof e?.value&&e?.value.includes("@FILTERED_LIST"),o=(e=>e.selectionList||e.selectionKey||"Editable"===e.renderMode&&e.referenceList)(e);return(e?.value||o)&&!s&&a},Uy=(e,t,n,r,a)=>(Ry.executeStateMachine(e,r,cS.getLitePropertyValue(n,t))||a.push(r),a),Fy=(e,t,n)=>{const r=t.isInsideList,{ignoreFieldsInsideList:a=!0}=n;return(!r||r&&!a)&&!Array.isArray(cS.getLitePropertyValue(t,e))&&!(t.componentName&&["Address","Attachment"].includes(t.componentName))},jy=(e,t={})=>{let n=[];const r=[],a=Zd.getContextReferences(e);return a?(({editableFormFieldsReferenceList:n}=((e,t,n)=>{const{includeDisabledFields:r=!1}=n;let a=[];for(const[s,o]of e){const e=cS.resolveContextTreeNodeProps(o.props),i=e.propertyName;Ly(o.props,{includeDisabledFields:r})&&Fy(s,e,n)&&(a=Uy(t,i,e,s,a))}return{editableFormFieldsReferenceList:a}})(a,e,t)),$y[e]&&r.push(...Object.keys($y[e].fieldOrder??{})),{formInputs:n,formPageFields:r}):{formInputs:n,formPageFields:r}},ky=e=>{let t=[];const n=Zd.getContextReferences(e);if(n)for(const[e,r]of n){const n=r?.props;if(Ly(n)&&"Attachment"===n?.componentName){const r="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:r,fullPath:e}]}}return t},Vy=(e,t={})=>{const n={},r=BC(e),{ignoreFieldsInsideList:a=!0,isTransientContext:s=!1,includeDisabledFields:o=!1,isObjectWideAction:i=!1,isExternalObject:c=!1}=t,l=((e,t,n)=>zy.shouldUseUnifiedHandling()||!e&&!t?n?.caseInfo:n?.objectInfo)(i,c,r);if(s||l){const{formInputs:t,formPageFields:i}=jy(e,{ignoreFieldsInsideList:a,includeDisabledFields:o});((e,t,n)=>{e.forEach((e=>{let r=aS.getIn(t,e);"object"==typeof r&&(r=aS.deepClone(r),delete r?.classID),aS.buildObject(e,n,r)}))})(i,r,n),t&&t.length>0?t.forEach((e=>{aS.buildObject(e,n,aS.getIn(r,e))})):s||aS.buildObject(Ur.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!s&&r?.dataInfo?.content){const{formInputs:t}=jy(e,{ignoreFieldsInsideList:a});t.forEach((e=>{aS.buildObject(e,n,aS.getIn(r,e))}))}return n},By=(e,t,n)=>{const r=""===t&&n?.startsWith(".")?n.substring(1,n.length):n,a=Zd.getContextReferences(e)?.get(`${t}${r}`)?.props;return a?cS.resolveContextTreeNodeProps(a):a},Gy=(e,t)=>{const n=Zd.getContextReferences(e);let r=!0;if(!n)return r;for(const[e,a]of n){const n=cS.resolveContextTreeNodeProps(a.props);if(Ly(a.props)&&(!t||e.includes(t))){const e=zp.validate(n.componentName?.toLowerCase(),n.propertyName,cS.getLitePropertyValue(n,n.propertyName),n);r&&(r=!e.message)}}return r},Wy=e=>{const t=Zd.getContextReferences(e);if(t)for(const[,e]of t){if(cS.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0}return!1},Hy=(e,t=!1)=>{const n=Zd.getContextReferences(e),r=[];if(n)for(const[e,a]of n){if(!1!==cS.resolveContextTreeNodeProps(a.props).visibility){const n=8,a=t?e:e.substring(e.indexOf("content")+n);r.push(a)}}return r},qy=e=>{const t=[],n=Zd.getContextReferences(e);if(n)for(const[e,r]of n){const n=cS.resolveContextTreeNodeProps(r.props);Ly(r.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};class Yy{static getCaseInlineEditAction(e){return e?PA.getInlineEditActions(e):[]}static isCaseActive(e,t){if(!e||!t)return!1;const n=II(t);if(n){const r=$I(t),{items:a={}}=n;return!(!r||!a[r]||a[r].key!==e)}return!1}static getCaseEditMetadata=(e,t)=>{const n={caseID:e,viewID:Mr.getDefaultQualifiedName("pyEdit")},{restApi:r,reqType:a}=i_("loadView",n);return Wu(r,{method:a},t)};static getCaseView=(e,t,n,r={})=>{const{signal:a}=r,s={caseID:e,viewID:t},{restApi:o,reqType:i}=i_("loadView",s);return Wu(o,{method:i,...a&&{signal:a}},n)};static isExternalCaseType=e=>{let t;return this.shouldUseUnifiedHandling()?(t=PA.getCaseTypeList()?.find((t=>t.DisplayMandatoryInputsForObject&&t.pyWorkTypeImplementationClassName===e)),!!t):(t=PA.getCaseTypeList()?.find((t=>"Case"===t.objectType&&t.DisplayMandatoryInputsForObject&&t.pyWorkTypeImplementationClassName===e)),!!t)};static getCaseEditLock=(e,t,n)=>{const r={caseID:e,actionID:this.getCaseInlineEditAction(n)[0]??Mr.getDefaultQualifiedName("pyUpdateCaseDetails")},{restApi:a,reqType:s}=i_(ns,r);return Wu(`${a}?viewType=page`,{method:s},t)};static updateCaseEditFieldsData=(e,t,n,r,a)=>{const s=this.getCaseInlineEditAction(a),o=s.length?s:[Mr.getDefaultQualifiedName("pyUpdateCaseDetails")],i=t[e],c=(t,n)=>{const[a,...s]=t;return((t,n)=>{const a={caseID:e,actionID:t},{restApi:s}=i_(ns,a);return Wu(`${s}?viewType=form`,{method:"PATCH",body:{content:{...i}},headers:{"if-match":n}},r)})(a,n).then((e=>s.length>0?c(s,e.headers.etag):e))};return c(o,n)};static getCaseMessages=e=>BC(e)?.caseMessages;static getPropertiesToReplace=e=>(ky(e)||[]).map((e=>({path:e.fullPath,allowMultiple:e.allowMultiple})));static getPropertiesToReArrange=e=>(ky(e)||[]).filter((e=>e.allowMultiple)).map((e=>e.fullPath));static getUniqueGadgetId=()=>aS.generateUniqueID().substring(0,5);static getRemoteCaseMapping=()=>Vr.getRemoteCaseMapping();static isTraditionalRemoteCase=e=>Vr.isTraditionalRemoteCase(e);static isCoexistenceCase=e=>!!e&&(PA.getCaseTypeList()?.some((t=>t.pyWorkTypeImplementationClassName===e&&"true"===t.pyIsTraditionalUICase))??!1);static isRemoteCase=e=>Vr.isRemoteCase(e);static isRemoteCaseVersionDifferent=e=>Vr.isRemoteCaseVersionDifferent(e);static getRemoteCaseKey=(e,t)=>{let n=t;try{e&&(n=e.slice(e.indexOf(" ")+1,e.indexOf("!")))}catch{}return n};static isObjectCaseType=e=>{const t=PA.getCaseTypeList()?.filter((t=>t.pyWorkTypeImplementationClassName===e));return t&&t.length>0&&"Object"===t[0].objectType};static isExternalObject=e=>{const t=PA.getCaseTypeList()?.filter((t=>t.pyWorkTypeImplementationClassName===e)),{DisplayMandatoryInputsForObject:n,objectType:r}=t?.[0]||{};return t&&t.length>0&&n&&"Object"===r};static getRouteKeyForCreateWork=(e,t=!1)=>this.isExternalCaseType(e)&&t?Fs:this.isExternalObject(e)&&t?this.shouldUseUnifiedHandling()?Fs:"retrieveActionViewForNewObject":this.shouldUseUnifiedHandling()?Os:this.isObjectCaseType(e)?ws:Os;static shouldUseUnifiedHandling=()=>!0;static shouldAppendExcludeQueryParam=()=>PA.isOptimizedCaseLoadingEnabled();static appendExcludeQueryParamToUrl=e=>{if(!e)return e;if(!this.shouldAppendExcludeQueryParam())return e;let t=e;if(t.includes("excludeAdditionalActions=true"))return t=t.replace("excludeAdditionalActions=true","exclude=availableActions,availableProcesses,assignments"),t;const n=t.includes("?")?"&":"?";return`${t}${n}exclude=availableActions,availableProcesses`};static setTraditionalGadgetId=e=>{e.traditionalGadgetId=Yy.getUniqueGadgetId()}}const zy=Yy,Ky=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},Qy=e=>{if(zy.shouldUseUnifiedHandling()&&zy.isObjectCaseType(String(e?.caseTypeID))&&!Ky(e))return!0;if(zy.isObjectCaseType(String(e?.objectTypeID))&&!Ky(e))return!0;if(e){const{stageID:t,stages:n=[]}=e,r=n.length;for(let e=0;e<r;e+=1){if(n[e].ID===t)return"create"===n[e].transitionType&&"active"===n[e].visited_status}}return!1},Jy=(e,t)=>{if(e&&t){const n=aS.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:r,type:a}=n;return"worklist"===a?.toLowerCase()&&r===e}return!1},Xy=(e,t)=>{const n=cS.getPropertyValue(Ur.CASE_INFO.ACTIVE_ACTION_ID,t,e),r=cS.getPropertyValue(Ur.CASE_INFO.AVAILABLEACTIONS,t,e);let a=!1;if(r&&n){const e=r.find((e=>e.ID===n));e&&(a=e.type.toLowerCase()===Ur.LOCAL_ACTION_TYPE.CASE_WIDE.toLowerCase())}if(e&&!r){const t=BC(e);a=t?.context_data?.actionType===Fr.CASE}return a},Zy=e=>qC(null,Fr.CASE_VIEW_MODE_PROP,e)===Fr.PERFORM_MODE&&(e.includes(Fr.WORKAREA)||e.includes(Fr.MODAL)||e.includes(Fr.ACTIONAREA)),eE=(e,t)=>Zy(e)&&!Xy(e,t),tE=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},nE=(e,t,n)=>{let r;const a=e?.find((e=>e.ID===t))?.actions,s=a?.filter((e=>e.ID===Fr.FIX_BROKEN_ASSIGNMENTS))||[];return r=n&&s?.length>0?s[0].ID:n||((e,t)=>{if(!Array.isArray(e)||!t)throw new Error("Invalid parameters passed to getAssignmentActionID API");return e.find((e=>e.ID===t))?.actions?.[0]?.ID})(e,t),r},rE=(e,t,n,r)=>{let a;return a=e?nE(e,t,n):r||Mr.getDefaultQualifiedName("Create"),a},aE=(e,t)=>zy.shouldUseUnifiedHandling()?fa:zy.isObjectCaseType(e)||t?Rs:fa,sE=(e,t,n)=>{let r,a,s,o,i,c,l,d,u;const p=BC(e),h=p?.caseInfo?.caseTypeID||p?.objectInfo?.objectTypeID,f=zy.shouldUseUnifiedHandling();return n?.isTriggeredFromDifferentContext||e.includes(Fr.ACTIONAREA)?(r=e.includes(Fr.ACTIONAREA)?void 0:p.caseInfo?.assignments?.[0]?.ID,a=p.caseInfo.ID,s=p.caseInfo.assignments,o=p.caseInfo.activeActionID,i=p.caseInfo.availableActions,c=p.caseInfo,l=p.caseInfo.businessID,d=p.caseInfo.caseTypeID,u=p.caseInfo.caseTypeName):!f&&p?.objectInfo&&zy.isObjectCaseType(h)?(a=p.objectInfo.ID,o=p.objectInfo.activeActionID,i=p.objectInfo.availableActions,c=p.objectInfo,l=p.objectInfo.businessID,d=p.objectInfo.objectTypeID,u=p.objectInfo.objectTypeName):(r=t.getValue(Fr.getProperty(Ur.CASE_INFO.ASSIGNMENT_ID)),a=t.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID)),s=t.getValue(Fr.getProperty(Ur.CASE_INFO.ASSIGNMENTS)),o=t.getValue(Fr.getProperty(Ur.CASE_INFO.ACTIVE_ACTION_ID)),i=t.getValue(Fr.getProperty(Ur.CASE_INFO.AVAILABLEACTIONS)),c=t.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO)),l=t.getValue(Fr.getProperty(Ur.CASE_INFO.BUSINESS_ID)),d=t.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_TYPE_ID)),u=t.getValue(Fr.getProperty(Ur.CASE_INFO.CASE_TYPE_NAME))),{assignmentID:r,caseID:a,assignments:s,localActionID:o,caseActions:i,caseInfo:c,businessID:l,caseTypeID:d,caseTypeName:u}},oE=(e,t)=>{if(Object.keys(e??{}).length>0&&t?.startsWith("http")){const n=new URL(t),r=new URLSearchParams(n.search);return Object.keys(e).forEach((t=>{r.append(t,String(e[t]))})),n.search=r.toString(),n.toString()}return t},iE=(e,t="case")=>{const n=e?.payload?.err?.response?.data?.displayButtonsOnErrors||[],r=e?.payload?.err?.response?.status;if(Array.isArray(n)&&n.length>0&&424===r){n.forEach((e=>{e.isErrorButton=!0}));const r=e.payload.context,a=BC(r),s=((e,t)=>(e.forEach((e=>{!0!==e.isErrorButton||t.some((t=>t.actionID===e.actionID))||(t=[...t,e])})),t))(n,a?.caseInfo?.actionButtons?.secondary||[]),o={data:{["dataObject"===t?Ur.DATA_INFO.DATA_INFO:Ur.CASE_INFO.CASE_INFO]:{actionButtons:{secondary:s}}},target:QI(r),context:r};VC({type:Ca,payload:o})}},cE=e=>({type:Ng.REFRESH_DATA,payload:e}),lE={},dE=(e,t,n,r,a,s,o,i,c,l)=>{if(!(e&&r&&t))return;const d=l.actionMgrID||Th.getNextActionMgrId(),u={ID:e,actionID:t,objectTypeID:n,context:r,caseWideAction:a,isObjectType:s,isExternalObject:o,isExternalCase:i,casetypeID:c,options:{...l,actionMgrID:d}};l.isFillFormWithAI?VC((e=>({type:Ps,payload:e}))(u)):VC(cE(u))},uE=(e,t,n,r,a)=>{if(!(e&&n&&t))return;r&&(r=aS.convertPageRefToClipboardPageNotation(r));VC(cE({ID:e,viewID:t,context:n,options:a,caseViewAction:!0,interestPage:r}))},pE=(e,t,n,r,a,s,o,i,c,l={})=>{if(!((e||t)&&r&&n&&a))return;a&&(a=aS.convertPageRefToClipboardPageNotation(a));const d={ID:o||c!==Fr.ACTION?e:t,actionID:n,context:r,options:l,interestPage:a,interestPageActionID:s,isLocalAction:o,isMultiRecordData:i,editType:c};VC(cE(d))},hE=(e,t,n)=>{lE[t]||(lE[t]={}),e&&!lE[t][e]&&(lE[t][e]={pageReference:n})},fE=(e,t,n)=>{const r={pageName:(a=t.substring(t.lastIndexOf(" ")+1)).substring(0,a.lastIndexOf(".")),propertyName:a.substring(a.lastIndexOf(".")+1)};var a;const s=oC(r.propertyName,n||e.getValue(Fr.CLASS_ID,r.pageName));return!!s?.isDeclarativeTarget},gE=(e,t,n)=>{const r=n||e.getRawMetadata()?.config?.value;let a=!1;if(r){const n=No.trimAnnotation(r);let s;s=t?aS.resolvePageClass(n,t):cS.resolveClassID(r,e.getPageReference(),e.getContextName());const o=oC(No.getLeafPropertyName(r),s);if(a=!!o?.isDeclarativeTarget,!a&&o?.additionalInformation){const e=No.trimAnnotation(o?.additionalInformation);a=Yg.isDecisionParagraph(e,o.classID)}!a&&o?.datasource?.parameters&&(a=((e,t,n)=>{let r=!1;if(Array.isArray(t)){const a=t=>{const a=t.value;return a.startsWith("@P")&&(r=fE(e,a,n)),r};t.some(a)}else if("object"==typeof t)for(const a of Object.keys(t))if(t[a].startsWith("@P")&&(r=fE(e,t[a],n),r))break;return r})(e,o?.datasource?.parameters,t)),a||(a=o?.datasource?.tableType===Fr.DECISION)}return a},mE=(e,t)=>{const n=n=>(e=>"string"==typeof e&&e.startsWith(Fr.PROPERTY_ANNOTATION))(n)&&gE(e,t,n),r=e=>!(!e||"object"!=typeof e)&&Object.values(e).some((e=>n(e)||r(e)));return r(e.getRawMetadata()?.config)},yE=e=>{(e.isWhenExist()||mE(e))&&hE(e.getCurrentView(),e.getContextName(),e.getPageReference())},EE=e=>{if(!e)return!1;const t=kC()?.getState()?.data?.[e],n=t?.caseInfo?.caseTypeID||t?.objectInfo?.objectTypeID;return zy.isObjectCaseType(n)},IE=(e,t,n)=>{const r=Xy(e,t);let a,s,o="",i="";const c=n=>cS.getPropertyValue(n,t,e)||"",l=zy.shouldUseUnifiedHandling(),d=c(Ur.CASE_INFO.CASE_INFO_CLASSID)||c(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID)||n?.classID||"",u=zy.isObjectCaseType(d)||t.startsWith(Fr.OBJECT_INFO.OBJECT_INFO),p=zy.isExternalCaseType(c(Ur.CASE_INFO.CASE_INFO_CLASSID)),h=zy.isExternalObject(d),f=c(Fr.getProperty(Ur.CASE_INFO.BUSINESS_ID));if(u&&EE(e)&&!p)o=d,n.isObjectWideAction=!0,a=c(l?Ur.CASE_INFO.ACTIVE_ACTION_ID:Ur.OBJECT_INFO.ACTIVE_ACTION_ID),a||(a=Fr.getDefaultQualifiedName(Fr.VIEW_NAMES.OBJECT_CREATE_VIEW)),s=c(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID))||o;else if(p&&!f)a=Fr.getDefaultQualifiedName(Fr.VIEW_NAMES.OBJECT_CREATE_VIEW),s=c(Ur.CASE_INFO.CASE_INFO_CLASSID),i=c(Ur.CASE_INFO.CASE_TYPE_ID);else if(a=c(Ur.CASE_INFO.ACTIVE_ACTION_ID)||c(Ur.CASE_INFO.ASSIGNMENTACTION_ID),r)s=c(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID));else{s=c(Fr.getProperty(Ur.CASE_INFO.ASSIGNMENT_ID))||c(Fr.getProperty(Ur.CONTEXT_DATA_ASSIGNMENTID))}dE(s,a,o,e,r,u,h,p,i,n)},AE=e=>{const{context:t,pageReference:n}=e,r=(e=>lE[e]&&Object.keys(lE[e]).length>0&&Zy(e))(t);if(!r)return;const a=cS.getPropertyValue(Fr.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,n,t),{isMultiRecordData:s,editType:o}=a||{};if(s){const e=cS.getPropertyValue(Ur.CASE_INFO.CASE_INFO_ID,n,t),r=cS.getPropertyValue(Ur.CASE_INFO.ASSIGNMENT_ID,n,t),{interestPage:i,interestPageActionID:c,actionID:l,isLocalAction:d,viewName:u}=a;o===Fr.ACTION?pE(e,r,l,t,i,c,d,s,o):uE(e,u,t,i,{})}else IE(t,n,{})},CE=(e,t)=>{const{requestType:n}=e;if(e?.options?.refreshFor&&"refresh"===n){t+=`?refreshFor=${e.options.refreshFor.replace(/\[(\d+)\]/g,((e,t)=>`(${parseInt(t,10)+1})`))}`}return e?.options?.isFillFormWithAI&&"refresh"===n&&(t+="?fillFormWithAI=true"),t},SE=(e,t)=>{const n=e.url===t.url,r=e.interestPage===t.interestPage;return n&&r},_E=(e,t)=>{const n=e.url?.includes("/refresh?refreshFor="),r=t.url?.includes("/refresh?refreshFor="),a=e.url?.endsWith("/refresh")&&!n,s=t.url?.endsWith("/refresh")&&!r;if(a&&s)return SE(e,t);if(a&&r)return!0;if(n){if(s)return"CANCEL_REFRESH";if(r)return SE(e,t)}return!1},NE=e=>{const t=(e=>{const t=[];return Zd.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const r=n.split(".");r.shift();let a=r.join(".");e&&a&&(a=aS.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a}))})),t})(e),n=(e=>{const t=[];return Zd.getWhens(e).forEach((({name:e,type:n,pageReference:r})=>{const a=r.split(".");a.shift();let s=a.join(".");e&&s&&(s=aS.convertPageRefToClipboardPageNotation(s),t.push({name:e,context:s,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}};const bE=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}},TE={IDLE:"idle",SAVING:"saving",SKIPPED:"skipped",ERROR:"error"},PE='input[type="text"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], input[type="password"], input[type="date"], input[type="time"], input[type="month"], input[type="week"], input[type="datetime-local"], input:not([type])',OE=`${PE}, textarea, [contenteditable="true"]`,DE=new Map,vE=new Map,RE=new Set,$E=new Map,xE=new Map,wE=new Set,ME=(e,t)=>{$E.get(e)?.forEach((e=>e(t)))},LE=(e,t)=>{const n=vE.get(e);void 0!==n&&clearTimeout(n),vE.set(e,setTimeout((()=>{vE.delete(e),t()}),(()=>{const e=Number(PA.getFeatureMap()?.pyAutoSaveDurationInMS);return e>0?e:5e3})()))},UE=e=>{const t=Wr(e),n=QI(t);return!n||!BI(n)||$I(n)===t},FE=async e=>{if(RE.has(e))return;if(wE.has(e))return;const t=DE.get(e);if(!t)return;if(!UE(e))return;const n="undefined"!=typeof document?document.activeElement:null;if(n&&n===(e=>Wp.get(e)??null)(e)&&n.matches(PE))return void LE(e,(()=>FE(e).catch((()=>{}))));(e=>{const t=xE.get(e);if(t&&0!==t.size){for(const[n,r]of t)Ry.executeStateMachine(e,n,r,!0,{skipStateUpdate:!1,skipDirtyValidation:!1})||VC(KS({reference:n,value:r,context:e,isImplicit:!1,skipDirtyValidation:!1}));xE.delete(e)}})(e);let r=!1;Gp(!0);try{if(!vy.hasUnsavedChanges(e))return;r=vy.isFormValid(e)}finally{Gp(!1)}if(r){RE.add(e),ME(e,TE.SAVING);try{await((e,t)=>{const n=e,r=n.includes(Fr.MODAL),a=HC(Ur.CASE_INFO.CASE_INFO_ID,null,n),s=HC(Ur.CASE_INFO.ASSIGNMENT_ID,null,n),o=HC(Ur.CASE_INFO.ACTIVE_ACTION_ID,null,n)||HC(Ur.CASE_INFO.ASSIGNMENTACTION_ID,null,n),i=HC(Ur.CASE_INFO.CASE_TYPE_ID,null,n),c=HC("isProcessAction","isProcessAction",n),l=Th.getNextActionMgrId(),d={context:n,containerItemID:e,assignmentID:s,actionID:o,caseID:a,containerName:t,caseType:i,isModalAction:r,isFormValid:void 0,isProcessAction:c,saveOnly:!0,autosave:!0,actionMgrID:l};let u,p;const h=new Promise(((e,t)=>{u=e,p=t}));if(!u||!p)throw new Error("Promise executor did not synchronously assign resolveFn/rejectFn.");return Th.register(l,h,u,p,Bh,d,!0),$g.executeOrQueueDeferredAction(Gh(d)),h})(e,t.containerName),vy.clearChangedProperties(e),ME(e,TE.IDLE)}catch{ME(e,TE.ERROR)}finally{RE.delete(e)}}else ME(e,TE.SKIPPED)},jE=()=>{if("undefined"==typeof document)return;const e=document.activeElement;if(e?.matches(OE))for(const e of DE.keys())vE.has(e)&&UE(e)&&LE(e,(()=>FE(e).catch((()=>{}))))},kE=jE,VE=e=>{"Tab"===e.key&&jE()},BE=e=>{const{target:t}=e;if("undefined"!=typeof Element&&t instanceof Element&&t.matches(PE))for(const e of DE.keys())vE.has(e)&&UE(e)&&(Hp(e,t),LE(e,(()=>FE(e).catch((()=>{})))))},GE=e=>DE.has(e),WE=e=>{const t=vE.get(e);void 0!==t&&clearTimeout(t),vE.delete(e),RE.delete(e),DE.delete(e),wE.delete(e),xE.delete(e),qp(e),0===DE.size&&"undefined"!=typeof document&&(document.removeEventListener("pointerdown",kE),document.removeEventListener("keydown",VE),document.removeEventListener("input",BE,{capture:!0}))},HE=e=>{const t=`${e}/`;for(const e of[...DE.keys()])e.startsWith(t)&&WE(e)},qE=e=>{const t=vE.get(e);void 0!==t&&(clearTimeout(t),vE.delete(e))},YE=e=>{DE.has(e)&&(wE.has(e)||LE(e,(()=>FE(e).catch((()=>{})))))},zE=e=>{wE.delete(e),vy.hasUnsavedChanges(e)&&YE(e)},{APP:KE}=Fr;let QE={},JE={},XE={};const ZE="You will lose unsaved changes. Do you want to continue?",eI="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",tI=(e=KE.APP,t,n)=>{let r=[],a=[];t||(r=Hy(e,!0)),n||(a=(e=>{const t=Zd.getContextReferences(e),n=[];if(t)for(const[e,r]of t)!0===cS.resolveContextTreeNodeProps(r.props).readOnly&&n.push(e);return n})(e));const s={};((e,t,n)=>{const r=JE[t]||{};Object.keys(r).forEach((t=>{const a=r[t].associatedProperty;Object.hasOwn(r,t)&&(void 0===a||n.includes(a))&&aS.buildObject(t,e,r[t].value)}))})(s,e,r);const o=QE[e]||{};return Object.keys(o).forEach((e=>{const n=!t&&r.includes(e)||t;Object.hasOwn(o,e)&&n&&!a.includes(e)&&aS.buildObject(e,s,o[e].value)})),s},nI=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete QE[t]?.[n],delete JE[t]?.[n]};qd=(e,t)=>{nI({context:e,reference:t});const n=t.lastIndexOf(".");n<1||n===t.length-1||ou({type:Fr.MESSAGES.MESSAGES_TYPE_ERROR,context:e,pageReference:t.slice(0,n),property:t.slice(n)})};const rI=e=>e&&XE[e],aI=e=>{e&&XE[e]&&(XE[e]=!1)},sI=(e,t)=>{const{context:n,initialValue:r="",isStrictTracking:a,associatedProperty:s}=t,o=t.reference.startsWith(".")?t.reference.substr(1):t.reference;e[o]?e[o].previousValue=HC(t.reference,null,n):(e[o]={initialValue:r||HC(t.reference,null,n)},e[o].previousValue=e[o].initialValue),e[o].value=t.value,s&&(e[o].associatedProperty=s),a&&e[o].value===e[o].initialValue&&nI(t)},oI=e=>{const{payload:t}=e,{context:n}=t,r=t.reference.startsWith(".")?t.reference.substr(1):t.reference;Zd.isFieldExists(n,r)||(JE[n]=JE[n]||{},sI(JE[n],t)),QE[n]=QE[n]||{},sI(QE[n],t)},iI=({value:e,context:t,reference:n})=>{const r=QI(t),a=CI(r,t)||{};if(bE.isPageInstruction(n)||a?.subscriptFieldName)return;const s=n?.startsWith(".")?n?.substr(1):n;QE[t]=QE[t]||{};QE[t][s]||(QE[t][s]={initialValue:HC(s,null,t)}),QE[t][s].value=e},cI=e=>e&&QE[e]&&Object.keys(QE[e]).some((t=>QE[e][t].initialValue!==QE[e][t].value))||!!rI(e),lI=(e,t)=>{if(!e||!t)return!1;const n=QE[e]&&QE[e][t];return!!n&&n.previousValue!==n.value},dI=e=>{e&&QE[e]?(QE[e]={},JE[e]={}):"all"===e&&(QE={},JE={},XE={}),XE[e]&&(XE[e]=!1),qp(e)},uI=(e,t,n=new Set)=>{if(n.has(t))return;n.add(t);[...Ao.getDependencies(e,t),...LC.getResetDependencies(e,t)].forEach((t=>{const r=aS.getPropertyNameFromDependency(t);if("object"==typeof t&&"multiRecord"===t.mode){const t=r.split("."),n=`.${t.pop()}`,a=t.join(".");if(Ry.isStateMachineExist(e,a,n)){Ry.getStateMachine(e,a,n).deleteAll()}else if(GE(e)){Ry.setStateMachine(e,n,a,new lp(n,a,e));const t=Ry.getStateMachine(e,a,n);t?.deleteAll(!1)}}else bE.isPageInstruction(r)&&Ry.executeStateMachine(e,r,""),VC({type:Xr,payload:{reference:r,value:"",context:e,isArrayDeepMerge:!0,isImplicit:!0}});uI(e,r,n)}))},pI={propertyChangeMiddleware:()=>e=>t=>{const{type:n,payload:r={}}=t||{};if(n===ea&&(yo(r),(e=>{const{context:t,pageReference:n,value:r,reference:a}=e;LC.triggerCascade(t,a,r);const s=Ao.getDependencies(t,a),o={context:t,datapages:{}};uI(t,a),s.forEach((r=>{let a=n;r.startsWith(n)||(a="");const s=r.replace(`${a}`,"").split(".").filter((e=>!!e));s.pop();const i=s.join("."),c=HC(`.${i}`,a,t)?.classID||e.classID,l=oC(r.split(".").pop(),c),{datasource:d}=l,u={},p=[];d.parameters.forEach((e=>{e?.value?(u[e.name]=Yh.isProperty(e.value)?HC(`.${aS.getFullPropertyReference([i,aS.getPropertyName(e.value)])}`,a,t):e.value,void 0===u[e.name]||null===u[e.name]||""===u[e.name]?(u[e.name]="",p.push(Fr.NULL_STRING)):p.push(u[e.name])):(u[e.name]="",p.push(Fr.NULL_STRING))}));const h=d.name.concat(Fr.UNDERSCORE_STRING,aS.getHashedString(p.join(Fr.HASH_DELIMITER))),{name:f}=d,g=IC(f);o.datapages[h]={mode:d.mode,propertyName:r,name:d.name,dataViewParameters:u,refreshStrategy:g?.refreshStrategy}})),s.length&&VC({type:ds,payload:o})})(r),$g.registerBlockingAction(r.context).catch((()=>{})),setTimeout((()=>{(lI(r.context,r.reference)||Pp(r.context))&&AE(r),Cg.triggerRefreshForType("PROP_CHANGE",r.reference,r.context),$g.deRegisterBlockingAction(r.context).catch((()=>{}))}),0)),n===hs&&!r?.isDefault){const{context:e,referenceList:t,c11nEnv:n,listIndex:a,instruction:s,skipDirtyValidation:o=!1}=r;0===a&&"INSERT"===s&&n&&(e=>{let t=!1;const n=e?.getRawMetadata()?.config;n?.type&&"multirecordlist"===n.type&&n?.contextClass&&(t=function e(t,n){for(const r of n){const n=Cm({meta:r}).getPConnect();if(n.isWhenExist()||mE(n,t))return!0;if(r.children&&e(t,r.children))return!0}return!1}(n.contextClass,n.children??[])),t&&hE(e.getCurrentView(),e.getContextName(),e.getPageReference())})(n),setTimeout((()=>{Cg.triggerRefreshForType("PROP_CHANGE",t,e)||AE({context:e,pageReference:t})}),0),o||(XE[`${e}`]=!0)}if(n===Xr||n===Zr){const{reference:e,isImplicit:n,context:a,skipDirtyValidation:s=!1}=r;Zd.updateFieldNodeValue(a,e,r.value),bE.isPageInstruction(e)||s?s||(XE[`${a}`]=!0):oI(t),(r.removePropertyFromChangedList||n)&&nI(r)}if(n===wa||n===Ma){const{transientItemID:e,data:t}=r;aS.iterateLeafNodes(t,(t=>{nI({context:e,reference:t.join(".")})}))}if(n&&[Fa,Da,ka,xa].includes(n)){dI(r.context),LC.purgeResetDependencies(r.context),(a=r.context)&&lE[a]&&delete lE[a];(r.childContainersContexts||[]).forEach((e=>{dI(e)}));(r.transientItems||[]).forEach((e=>{dI(e)}))}var a;e(t)},getChanges:tI,recordChange:oI,isDirty:()=>Object.keys(QE).some((e=>cI(e))),isPropertyDirty:lI,isContextDirty:cI,resetChangedProperties:dI,deleteRecordedChange:nI,isComplexObjectMerged:rI,resetComplexObjectDirtyStatus:aI};const hI=new class{getCoreheaders(e){const t=`${Ur.APP.APP}${Fr.FORWARD_SLASH_STRING}${Fr.PRIMARY}`,n=$I(t),r=MI(n),a=cS.getProperty(Fr.COREHEADERS,"",r);if(a&&e in a)return a[e]}},fI={defaultLimit:16},gI={SINGLE:"single",MULTIPLE:"multiple"},mI={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},yI=()=>kC()?.getState()?.containers;function EI(e){return"string"==typeof e&&""!==e.trim()}const II=e=>EI(e)?kC()?.getState().containers[e]:null,AI=(e,t,n)=>{if(!n)return{continueExecution:!1,containerItemID:e};const r=II(n);let a=!1,s=e;return r?.accessedOrder.forEach((e=>{t===r.items[e].key&&(a=!0,s=r.items[e].context)})),{continueExecution:a,containerItemID:s}},CI=(e,t)=>{if(!EI(e)||!EI(t))return null;const n=yI(),r=n?.[e];return r&&r.items&&r.items[t]||null},SI=e=>EI(e)?kC()?.getState().containers[e]?.items:null,_I=e=>EI(e)&&kC()?.getState().containers[e]?.accessedOrder||[],NI=e=>EI(e)&&_I(e)?.length>0||!1,bI=(e,t,n)=>{if(!EI(e)||!EI(t))return!1;const r=yI(),a=r?.[e],s=a&&a.items||null,o=n||((e,t)=>e===t);if(t&&s)for(const e of Object.keys(s))if(o(t,s[e].key))return!0;return!1},TI=e=>{const{containers:t}=kC()?.getState()||{};return!(!t||!EI(e))&&Object.keys(t).some((n=>t[n]?.accessedOrder?.includes(e)))},PI=(e,t,n)=>{if(!EI(e)||!EI(t))return null;const r=yI(),a=r?.[e],s=a&&a.items||null,o=n||((e,t)=>e?.toLowerCase()===t?.toLowerCase());if(t&&s)for(const e of Object.keys(s))if(o(t,s[e].key))return e;return null},OI=(e,t)=>{if(e&&t)for(const a of Object.keys(t))if(n=e,r=t[a].key,n?.toLowerCase()===r?.toLowerCase())return t[a];var n,r;return null},DI=e=>{if(!EI(e))return null;const t=yI()??{};for(const n of Object.keys(t))if(t[n]){const r=t[n].items??null,a=OI(e,r);if(a)return a}return null},vI=(e,t)=>{if(!EI(e)||!EI(t))return!1;const n=yI();return n&&Object.hasOwn(n,`${e}/${t}`)},RI=(e,t)=>{if(!EI(e)||!EI(t))return null;const n=yI(),r=n?.[`${e}/${t}`];return r&&r.type},$I=e=>{if(!EI(e))return null;let t=null;const n=yI();if(n&&n[e]){const r=n[e],{accessedOrder:a}=r;t=a&&a.length>0?a[a.length-1]:null}return t},xI=(e,t,n)=>{if(!EI(e)||!EI(t))return!1;const r=PI(e,t,n);return!!r&&r===$I(e)},wI=(e,t)=>{let n=null;const r=yI();if(!r)return null;for(const a of Object.keys(r))if(r[a].items){const s=r[a].items[e];if(n=s?s[t]:null,n)break}return n},MI=e=>EI(e)?wI(e,"context"):null,LI=e=>{if(!EI(e))return null;let t=null;const n=yI();if(n&&n[e]){const r=n[e],{accessedOrder:a}=r,s=a&&a.length>0?a[a.length-1]:null;t=MI(s)}return t},UI=e=>{if(!EI(e))return[];const t=e.endsWith("/")?e:`${e}/`;let n=[],r=!1;const a=yI();if(!a)return[];const s=n=>{const a=[];return Object.keys(n).forEach((n=>{n.startsWith(t)&&n!==t&&a.push(n),n===e&&(r=!0)})),a};for(const e of Object.keys(a))if(a[e].items){const t=s(a[e].items);t&&t.length>0&&(n=n.concat(t)),n=n.sort()}return r?n:[]},FI=e=>{if(!EI(e))return[];const t=[],n=yI();if(!n)return[];const r=`${e}${Fr.FORWARD_SLASH_STRING}`;for(const e of Object.keys(n))e.startsWith(r)&&t.push(e);return t},jI=e=>{if(!EI(e))return[];const t=[],n=yI();if(!n)return[];const r=`${e}${Fr.FORWARD_SLASH_STRING}`;for(const a of Object.keys(n))if(a.startsWith(r)){(_I(a)||[]).forEach((n=>{MI(n)!==e&&t.push(MI(n))}))}return t},kI=e=>{const t=[...jI(e),e],n=[],r=kC()?.getState().data||{};return t.forEach((e=>{Object.hasOwn(r,`${e}/${Fr.SUGGESTION}`)&&n.push(`${e}/${Fr.SUGGESTION}`)})),n},VI=e=>EI(e)?e&&II(e)&&II(e).type===gI.SINGLE:null,BI=e=>EI(e)?e&&II(e)&&II(e).type===gI.MULTIPLE:null,GI=e=>EI(e)&&II(e)&&II(e).items&&Object.keys(II(e)?.items).length>0||!1,WI=e=>e&&fI[e]?fI[e]:fI.defaultLimit,HI=(e,t=fI.defaultLimit)=>{EI(e)&&(fI[e]=t)},qI=e=>{if(!EI(e))return!1;let t=!1;const n=II(e),{items:r={}}=n,a=Object.keys(r),s=WI(e);return a&&a.length>0&&a.length>=s&&(t=!0),t},YI=e=>{if(!e||!EI(e.name)||!EI(e.context))return null;const t=e?.name,n=II(`${e?.context}/${t}`),r=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],a=FI(`${Fr.APP.APP}/${Fr.PREVIEW}`),s=jI(`${Fr.APP.APP}/${Fr.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...r,...s],childContainers:a}},zI=e=>{if(!EI(e))return!1;const t=MI(e);return cI(t)||gy(e)},KI=e=>{if(!EI(e))return null;let t;const n=II(e),{accessedOrder:r=[]}=n;for(let e=0;e<r.length;e+=1){const n=r[e];if(!zI(n)){t=n;break}}return t},QI=e=>{if(!EI(e))return null;const{containers:t}=kC()?.getState()||{};if(t)for(const n of Object.keys(t))if(t[n]?.accessedOrder?.includes(e))return n;const n=e.lastIndexOf(Fr.UNDERSCORE_STRING);return e.slice(0,n)},JI=async(e,t={})=>{if(!EI(e))return Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=QI(e),r=MI(e),{skipDirtyCheck:a}=t;let s=!0,o=[];if(zI(e)&&!a&&(bh.disableLoadingIndicator({context:r}),s=await Zm.confirm($A().getLocaleValue(ZE,"Messages")),bh.enableLoadingIndicator({context:r})),s){const{accessedOrder:a=[],items:s={},type:i}=II(n);o=a.filter((t=>t!==e));const c=o[o.length-1],l=s[c]||{},{semanticURL:d=Fr.FORWARD_SLASH_STRING,context:u}=l;o.length>0&&d&&d!==Fr.FORWARD_SLASH_STRING?g_({directUrlUpdation:!0,semanticURL:d,options:{containerItemID:c,context:u}}):g_({directUrlUpdation:!0,semanticURL:Fr.FORWARD_SLASH_STRING,options:{}});VC(MS({containerItemID:e,context:r,target:n,containerInfo:{newAccessedOrder:o,containerType:i},...void 0!==t.eventName?{eventName:t.eventName}:{}}))}return{newAccessedOrder:o,removeItem:s}},XI=(e,t,n,r)=>{const a="root",s=Hr(t,a,!0),o=js(t,a),i={data:n,context:r?"app":s},c=[_S({root:e,containerItemID:s,context:r?"app":s,target:o,containerName:t})];c.push(gS(i)),VC(c)},ZI=(e,t,n)=>{let r=_I(e);r=r.filter((e=>e!==t));let a=!1;for(let e=0;e<r.length;e+=1){if(MI(r[e])===n){a=!0;break}}return a},eA=e=>{if(!EI(e))return!1;const t=yI(),n=MI(e),r=t?Object.keys(t):[];let a=!1;for(let t=0;t<r.length&&(a=ZI(r[t],e,n),!a);t+=1);return a},tA=e=>{Array.isArray(e)||(e=[e]);const t=yI()||{};return e.map((e=>{const n=QI(e);return aS.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},nA=e=>{const{transientItemID:t,data:n,options:r}=e,a=aS.deepClone(kC()?.getState().data[t]);r?.reset&&aS.iterateLeafNodes(a,(e=>{"classID"!==e[e.length-1]&&aS.setIn(a,e,"")})),VC(bS({transientItemID:t,data:aS.mergeDeep(n,a)}))},rA=e=>{const{transientItemID:t,data:n}=e;VC(PS({transientItemID:t,data:n}))},aA=e=>{const t=aS.deepClone(kC()?.getState().data[e]);aS.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&aS.setIn(t,e,"")})),VC(TS({transientItemID:e,data:t}))},sA=e=>{const t=aS.deepClone(kC()?.getState().data[e]);aS.iterateLeafNodes(t,(e=>aS.setIn(t,e,""))),VC(OS({transientItemID:e,data:t}))},oA=e=>{kC()?.getState().data[e]&&sA(e);const t=e.lastIndexOf("/"),n=t>0?e.substring(0,t):e,r=QI(n);VC(US({transientItemID:e,containerItemID:n,target:r}))};class iA{static addContainerItems(e){this.items=e}static getContainerItems(){return this.items}static deleteContainerItem(e){const t=this?.items?.indexOf(e);void 0!==t&&-1!==t&&this.items.splice(t,1)}}const cA=(e,t={})=>{if(!EI(e))return;const n=II(e),r=Array.isArray(n?.accessedOrder)?n.accessedOrder:[];if(0===r.length)return;const{remove:a,keep:s}=t;let o;if(void 0!==s){const e=new Set(s);o=r.filter((t=>!e.has(t)))}else if(void 0!==a){const e=new Set(a);o=r.filter((t=>e.has(t)))}else o=[...r];for(const t of o){const n=MI(t),r=tA(t);VC(MS({containerItemID:t,context:n,target:e,...r.length>0&&{transientItems:r}}))}},lA=()=>iA,dA=e=>{const t={containerName:e};t.childContainers=FI(e),VC({type:Ba,payload:t})},uA=(e,t)=>{const n=UI(e),{key:r}=CI(QI(e),e),a=[];n.forEach((e=>{const{key:n}=CI(QI(e),e);if(n===r){const n={data:{caseInfo:{headers:{etag:t}}},target:QI(e),context:e};a.push({type:Ca,payload:n})}})),a.length&&VC(a)},pA=(e,t)=>{const n=[],r={data:{caseInfo:{headers:{etag:t}}},target:QI(e),context:e};n.push({type:Ca,payload:r}),n.length&&VC(n)},hA=()=>PA.isPortalLoaded?"app":"root",fA=()=>hI,gA=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:QI(e),context:e};VC({type:Ca,payload:n})},mA=(e,t)=>{const n=PI(e,t),r=PI(`${n}/workarea`,t);return MI(r)},yA=e=>EI(e)?wI(e,"parentContext"):null,EA=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},IA=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},AA=()=>Kh,CA=()=>"undefined"==typeof window?"":Tf(window.location.pathname),SA=()=>"undefined"==typeof window?"":Tf(window.location.pathname+window.location.search),_A=(e,t,n)=>{switch(n){case"warning":t?console.warn(e,t):console.warn(e);break;case"error":t?console.error(e,t):console.error(e);break;default:t?console.log(e,t):console.error(e)}};const NA=new class{staticRoutesList=[];constructor(){this.staticRoutesList=[],this.dynamicRoutesList=[],this.reqContextName="",this.defaultViewUrlPath="",this.staticRoutePage="",this.defaultClassName="",this.portalName=""}init=(e,t)=>{e&&e.routes&&e.routesMeta?(this.routingInfo=e,this.appRoutes=e.routes,this.appRoutesMeta=e.routesMeta,this.reqContextName=e.reqContextName,this.reqServletPath=e.reqServletPath,this.appName=e.appName,this.appAlias=e.appAlias,this.orgName=e.orgName,this.defaultViewUrlPath=t,this.defaultClassName="",this._createStaticDynamicRoutesList(this.appRoutes),this.appDelimeter=e.appDelimeter,this.reqServletNameReal=e.pxReqServletNameReal,this.bDefaultPortal=e.isDefaultPortal,this.portalName=e.portalName,this.ignoreFromEndPoint=["reactMode=dev","reactMode=prod"]):console.error("Routing info is not appropriate. Missing routes and routesMeta objects in routingInfo",JSON.stringify(e))};addRoutes=e=>{e?.routes&&e.routesMeta&&(this.appRoutes={...this.appRoutes,...e.routes},this.appRoutesMeta={...this.appRoutesMeta,...e.routesMeta},this.routingInfo&&(this.routingInfo.routes={...this.routingInfo.routes,...e.routes},this.routingInfo.routesMeta={...this.routingInfo.routesMeta,...e.routesMeta}),this._createStaticDynamicRoutesList(e.routes))};setDefaultRoute=e=>{this.defaultViewUrlPath=e};setStaticRoutePage=e=>{this.staticRoutePage=e};getStaticRoutePage=()=>this.staticRoutePage||"";setDefaultClassName=e=>{this.defaultClassName=e};_createStaticDynamicRoutesList=e=>{Object.keys(e).forEach((t=>{bf(t)?this.dynamicRoutesList?.push(t):this.staticRoutesList?.push({[t]:e[t]})}))};_getDynamicKeyName=e=>{const t=e.indexOf("{")+1,n=e.lastIndexOf("}");return e.slice(t,n)};isDefaultPortal=()=>"false"!=`${this.bDefaultPortal}`;getPortalName=()=>this.portalName;getApplicationPath=()=>Tf(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>Tf(this.reqContextName);getRoutingInfo=()=>this.routingInfo;processUrl=(e,t)=>{t&&(e=e.toLowerCase()),e&&(e=decodeURIComponent(e));const n=new RegExp(this.getApplicationPath(),"i");return(e=e.replace(n,"")).startsWith("/")&&$f()&&"PREVIEW"!==PA.getRenderingMode()&&this.setDefaultClassName(""),Tf(e)};stripIgnoredParams(e){return this.ignoreFromEndPoint?.forEach((t=>{e.includes(t)&&(e=e.substring(0,e.indexOf(t)))})),e}getRouteDetails=(e,t)=>{if(!t)return this.appRoutes[e];let n="",r={caseClassName:"",caseID:"",RemoteSystemID:void 0,page:""};return Object.keys(this.appRoutes||{}).forEach((t=>{const a=this.appRoutes[t];a&&a.payload&&a.payload.page===e&&(n=a.routeKey,r={...a.payload})})),!n&&this.appRoutes&&this.appRoutes[e]&&(n=this.appRoutes[e].routeKey,r={...this.appRoutes[e].payload}),{routeKey:n,payload:r}};transformRemoteCasePayload(e){const{caseClassName:t,caseID:n}=e;if(!Vr.isRemoteCase(t))return e;const{RemoteClassGroup:r,RemoteSystemID:a}=Vr.getRemoteCase(t??"");return{...e,caseID:n?.replace(t??"",r?.toUpperCase()),RemoteSystemID:a}}getEndPointInfo=e=>{e=this.stripIgnoredParams(e);const t=$f();let n=this.processUrl(e,!0),r=this._getMatchedRouteInRoutingTable(n,t?this.defaultClassName:void 0);r||(n=this.processUrl(this.defaultViewUrlPath,!t),r=this._getMatchedRouteInRoutingTable(n,t?this.defaultClassName:void 0)||"");const{routeKey:a,payload:s}=this.getRouteDetails(r,t);if(!this.appRoutesMeta?.[a]?.restApi)return null;const{reqType:o,endPoint:i,params:c}=this.appRoutesMeta[a].restApi,l={routeKey:a,requestType:o,routeEndpoint:i,payload:{...c,...this.transformRemoteCasePayload(s)}};return this._resolveRoute(l,this.processUrl(e,!1),r)};getSemanticURL(e,t,n){return this.buildSemanticURL(e,t,n)}getResolvedSemanticURL(e,t,n={},r){const a=this.getSemanticURL(e,t,n);let s=a;if(bf(a)){const e=a.match(Nf);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(s=s.replace(e,String(n[t])))}))}const o=f_(s,r),i=new URL(o);return this.isDefaultPortal()||!this.getPortalName()||i.searchParams.toString().includes("portal=")||i.searchParams.append("portal",this.getPortalName()),r&&!i.searchParams.has("lang")&&i.searchParams.append("lang",r),Of(i.toString())}buildDocumentTitle(e,t,n){const r=n??"";return PA.getCaseLabelFirstInTitle()?e&&t?`${e} (${t}) - ${r}`:r:e&&t?`${t}: ${e} - ${r}`:r}updateSemanticURLAndDocumentTitle(e,t){const{key:n,actionName:r,caseClassName:a,isRemoteCase:s,name:o}=e;if(s&&!a)return;const i=this.getSemanticURL(r,{caseClassName:a}).replace(/{.+?}/,String($m(n))),c=`${Ur.APP.APP}${Fr.FORWARD_SLASH_STRING}${Ur.PRIMARY}`,l={semanticURL:i,directUrlUpdation:!0,options:{acName:c,context:LI(c)}},d=CA();i&&!d.includes(i)&&h_(l,t);const u=n.substring(n.lastIndexOf(" ")+1),p=PA.environmentInfoObject?.pxApplication?.pyLabel,h=this.buildDocumentTitle(o,u,p);__(h)}buildSemanticURL(e,t,n){const{urlPattern:r}=this.appRoutesMeta?.[e]||{},a=r?.split("/").length,s=r?.split("/");this.setDefaultClassName(t?.pageClass||this.defaultClassName);const o=Object.keys(this.appRoutes).filter((e=>a===e.split("/").length)).filter((e=>{const t=e.split("?")[0].split("/");return s?.every(((e,n)=>e.startsWith("{")||e===t[n]))}));if(1===o.length)return this._getQueryParamsResolvedURL(o[0],n);if(0===Object.keys(t).length)return"";const i=o.find((e=>{const r=this.appRoutes[e].payload,a={...n};delete a.dataViewName,delete a.dataContext;const s=r.dataViewKeys||r.dataContextParameters||{},o=Object.keys(t).every((e=>t[e]===r[e]));return!!o&&(aS.isEmpty(s)||aS.isEmpty(a)?o:Object.keys(a).every((e=>Object.hasOwn(s,e))))}));return i?this._getQueryParamsResolvedURL(i,n):o.includes("cases/{id}")&&n?.id?"cases/{id}":""}_getQueryParamsResolvedURL(e,t,n=!1){const[r,a]=e.includes("?")?e.split("?"):[e];if(a&&t&&Object.keys(t).length>0){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;const s=new URLSearchParams(a),o={};for(const[r,a]of s.entries())if("string"==typeof a&&bf(a)){const s=this._getDynamicKeyName(a),i=s.toLowerCase(),c=n?e:t,l=n?t[s]??c[i]:c[s];null!=l&&(o[r]=l)}else"string"==typeof a&&(o[r]=a);const i=new URLSearchParams(Object.entries(o).map((([e,t])=>[e,String(t??"")])));return`${r}?${Of(i.toString())}`}return r}_getQueryParamsObject(e){const t={};if(!e)return t;for(const n of e.split("&")){const e=n.indexOf("=");if(-1!==e){const r=n.slice(0,e),a=n.slice(e+1);try{t[decodeURIComponent(r)]=decodeURIComponent(a)}catch{t[r]=a}}}return t}getRestEndPoint(e,t){try{return this._buildRestApi(e,t)}catch(e){return console.error(e),null}}_buildRestApi(e,t){if(e&&this.appRoutesMeta?.[e]){const{reqType:n,body:r}=this.appRoutesMeta[e].restApi;let{endPoint:a}=this.appRoutesMeta[e].restApi;t?.params&&t.params.pageName&&(a=`${a}&pageName=${t.params.pageName}`);const s=a.match(Nf);if(s)for(let e=0;e<s.length;e+=1){const n=s[e].replace("{","").replace("}",""),r=new RegExp(s[e],"g");a=a.replace(r,t?.[n])}if(r){let e={};return Object.keys(r).forEach((n=>{if(t&&this._isSpecialInstruction(n)){const a=r[n];Array.isArray(a)&&a.every((e=>"string"==typeof e))&&(e={...e,...this._processInstruction(n,a,t)})}})),{restApi:a,reqType:n,body:e}}return{restApi:a,reqType:n}}throw new Error(`Cannot find route metadata for the routeKey: ${e}.`)}_isSpecialInstruction(e){return e&&e.startsWith("@")}_processInstruction(e,t,n){const r={};return"@COPY"===e&&t.forEach((e=>{r[e]=n?.[e]})),r}doesRestApiExist(e){return!(!this.appRoutesMeta||!this.appRoutesMeta[e])}_resolveMatchedRouteQueryParams=(e,t,n,r)=>{if(!e)return;const a=t.indexOf("?"),s=-1!==a?t.substring(a+1):void 0;if(s){const e=`${n.join("/")}?${s}`;return this._getQueryParamsResolvedURL(e,r,!0)}};_resolveRoute=(e,t,n)=>{const r=[],[a,s]=t.includes("?")?t.split("?"):[t],[o,i]=n.includes("?")?n.split("?"):[n],c=a.split("/"),l=o.split("/"),d={};for(let e=0;e<l.length;e+=1)if(r[e]=l[e],bf(l[e])){d[this._getDynamicKeyName(l[e])]=c[e],r[e]=c[e]}const u=this._getQueryParamsObject(i),p=this._getQueryParamsObject(s),h={};for(const[e,t]of Object.entries(p))h[e.toLowerCase()]=t;for(const e of Object.keys(u))bf(u[e])?d[e]=p[e]||h[e.toLowerCase()]:d[e]=u[e];const f=this._resolveMatchedRouteQueryParams(s,n,r,p),g=this._resolvePayload(e,d,n);return{...this._resolveRouteEndPoint(g,n),urlPath:f||r.join("/")}};_resolveRouteEndPoint=(e,t)=>{let{routeEndpoint:n}=e;if(!bf(n))return e;const r={};if(r[t]=e,void 0!==e.payload){const t=n.match(Nf);for(let a=0;a<t.length;a+=1){const s=t[a],o=this._getDynamicKeyName(s);if(void 0!==e.payload[o]){const t=e.payload[o];n=n.replace(s,t)}else this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${o}} in routeEndpoint- ${o} is missing in payload`,r)}}else this._sendWarningAndErrorMessages("Unable to resolve dynamic token(s) in routeEndpoint- payload is missing in routing table for-",r);return{...e,routeEndpoint:n}};_resolvePayload=(e,t,n)=>{if(void 0===e.payload)return e;const r={...e.payload,...this._resolvePayloadRecursive(e.payload,t)};return{...e,payload:r}};_resolvePayloadRecursive(e,t){if(Array.isArray(e))return e.map((e=>this._resolvePayloadRecursive(e,t))).flat();const n={};for(const r of Object.keys(e)){let a=e[r];if("string"==typeof a&&bf(a)){const e=a.match(Nf)??[];for(const n of e){const e=this._getDynamicKeyName(n);void 0!==t[e]?a=a.replace(n,t[e]):this._sendWarningAndErrorMessages(`Unable to resolve dynamic token {${e}} in payload - {${e}} is missing in semantic url construct`)}n[r]=a}else n[r]=a&&"object"==typeof a?this._resolvePayloadRecursive(a,t):a}return n}_getMatchedRouteInRoutingTable=(e,t)=>{const[n]=e.includes("?")?e.split("?"):[e];let r=this._findMatchedRouteInStaticList(n,t);return void 0!==r?r:(r=this._findMatchedRouteInDynamicList(e),void 0!==r?r:void 0)};_findMatchedRouteInStaticList=(e,t)=>{if(!this.staticRoutesList||!e)return;const n=e.toLowerCase(),r=t?.toLowerCase();if($f()){const e=this._findMatchingRouteByClass(n,r);if(!e)return;const t=Object.values(e)[0],a=t?.payload?.page||"";return this.setStaticRoutePage(a),Object.keys(e)[0]}return this._findInStaticList(n)};_findMatchingRouteByClass=(e,t)=>{if(this.staticRoutesList)return this.staticRoutesList.find((n=>Object.entries(n).some((([n,r])=>{if(!r)return!1;const a=r.payload?.page?.toLowerCase(),s=r.payload?.pageClass?.toLowerCase(),o=a===e||n.toLowerCase()===e;return t?o&&s===t:o}))))};_findInStaticList=e=>{if(!this.staticRoutesList)return;const t=this.staticRoutesList.find((t=>Object.keys(t)[0].toLowerCase()===e));return t?Object.keys(t)[0]:void 0};_findMatchedRouteInDynamicList=e=>{const[t,n]=e.includes("?")?e.split("?"):[e],r=t.split("/");return this.dynamicRoutesList?.find((e=>{const[t,a]=e.includes("?")?e.split("?"):[e],s=t.split("/");if(s.length!==r.length)return!1;let o=0;for(o=0;o<s.length;o+=1){const e=s[o].toLowerCase();if(!bf(e)&&e!==r[o]&&Pf(e)!==r[o])return!1}if(a){const e=new URLSearchParams(n.toLowerCase()),t=new URLSearchParams(a.toLowerCase()),r=new Set,s=new Set,o=/\{[a-zA-Z]+\}/;for(const t of e.keys())r.add(t);for(const e of t.keys())s.add(e);if(s.size!==r.size)return!1;for(const n of r){if(!s.has(n))return!1;const r=t.get(n);if(e.get(n)!==r&&!o.test(r??""))return!1}}return!0}))};_sendWarningAndErrorMessages=(e,t)=>{_A(e,t,"warning"),_A("Error in Generated Routing Table",null,"error"),_A("Back | Forward for this page may NOT work as intended",null,"warning"),_A("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},bA=NA;const TA=new class{constructor(){this.languagePacks=[]}getLocalizationBundles(e=PA.getLocale()){return(this.languagePacks.find((t=>t.pyLangCode===e))?.pyBundles??this.languagePacks.find((e=>e.pyLangCode===Fr.DEFAULT.toUpperCase()))?.pyBundles??[]).sort(((e,t)=>e.pyOrder-t.pyOrder))}async loadLocaleBundle(e){const t=e.map((e=>og.getPageDataAsync("D_pzBundlesForLocalization","",{locale:e,onlyApp:"false"},{invalidateCache:!0}))),n=(await Promise.allSettled(t)).filter((e=>"fulfilled"===e.status)).flatMap((e=>e.value.pyLanguagePacks));this.setLanguagePack(n)}setLanguagePack(e){e.forEach((e=>{const t=this.languagePacks.findIndex((t=>t.pyLangCode===e.pyLangCode));-1!==t?this.languagePacks[t]=e:this.languagePacks.push(e)}))}};const PA=new class{constructor(){this.environmentInfoObject=null,this.isPortalLoaded=!1,this.pageName=null,this.KeyMapping={},this.isAssignmentHeaderHidden=!1,this.coexistenceMeta={appType:"",isCoexistence:!1},this.brandingInfo=null,this.cookieComplianceMethod="none",this.isExtraCallRequiredForDefaultHome="false",this.enablePriorityAndUrgencyImprovements=!1}setEnvironmentInfo(e){const t=e?.pxOperator?.pyUserName,n=t?aS.decodeHtmlEntities(t):void 0,r={...e,pxOperator:e.pxOperator?{...e.pxOperator,...n?{pyUserName:n}:{}}:e.pxOperator};this.environmentInfoObject=r;const a=this.environmentInfoObject?.features||aS.convertObjectWithStringToBoolean(this.environmentInfoObject?.pyFeatures)||{granularUIRefresh:!1};this.environmentInfoObject.features={...a,granularUIRefresh:a.granularUIRefresh||a.pyEnableGranularUIRefresh||!1},this.environmentInfoObject.pyGenAIEnabled=!!this.environmentInfoObject.pyGenAIEnabled,Mr.setNamespaceSupport(this.getFeatureMap()?.isNamespaceEnabled);const s=e.requestContext;if(Array.isArray(s)&&s.length>0){const e=s.filter((e=>e.IncludeInURL)).map((e=>e.Key));e.length>0&&N_(e)}TA.setLanguagePack(this.environmentInfoObject.pyLanguagePacks||[])}getOperatorName(){return this.environmentInfoObject?.pxOperator?.pyUserName}getOperatorWorkGroup(){return this.environmentInfoObject?.pxOperator?.pyWorkGroup}getOperatorIdentifier(){return this.environmentInfoObject?.pxOperator?.pyUserIdentifier}getOperatorImageInsKey(){return this.environmentInfoObject?.pxOperator?.pyImageInsKey}getApplicationLabel(){return this.environmentInfoObject?.pxApplication?.pyLabel}getPortalName(){return bA.getPortalName()}setCaseLabelFirstInTitle(e=!0){this.caseLabelFirstInTitle=e}getCaseLabelFirstInTitle(){return this.caseLabelFirstInTitle}getApplicationName(){return this.environmentInfoObject?.pxApplication?.pyRuleName}getUseLocale(){return this.environmentInfoObject?.pxLocale?.pyUseLocale}getAccessGroup(){return this.environmentInfoObject?.pxOperator?.pyAccessGroup}getApplicationID(){return this.environmentInfoObject?.pxApplication?.pyRuleId}getTimeZone(){return this.environmentInfoObject?.pxLocale?.pyTimeZone?.trim()||void 0}getTheme(e){return"dark"===e?.type?this.darkThemeOverrides:this.themeOverrides}setTheme(e,t){return"dark"===t?.type?this.darkThemeOverrides=e:this.themeOverrides=e,gu.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.THEME_CHANGE,e),"dark"===t?.type?this.darkThemeOverrides:this.themeOverrides}getNavOrientation(){return this.navOrientation??this.environmentInfoObject?.pyNavOrientation}setNavOrientation(e){return this.navOrientation=e,gu.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.NAV_ORIENTATION_CHANGE,e),this.navOrientation}setIsWebEmbed(e){return this.isWebEmbed=e,this.isWebEmbed}isWSSPortal(){return this.environmentInfoObject?.pyPortalTemplate===Fr.PORTAL_TYPE.WSS}isDefaultWSSPortal(){return this.isWSSPortal()&&!this.environmentInfoObject?.pyFullObjectDisplayTemplate}isInfinityRuntime(){return"Infinity"===this.environmentInfoObject?.pyExecutionRuntimeName}isGenAIEnabled(){return!!this.environmentInfoObject?.pyGenAIEnabled}getRewriteGenAIDP(){return this.environmentInfoObject?.pyRewriteGenAIDP}isBlueprintExperience(){return!!this.environmentInfoObject?.features?.fromBlueprintExperience}getBrandingInfo(e){return"dark"===e?.type?this.brandingInfoDark:this.brandingInfo}setBrandingInfo(e,t){return"dark"===t?.type?this.brandingInfoDark=e:this.brandingInfo=e,this.brandingInfo}getCookieComplianceMethod(){return this.cookieComplianceMethod}setCookieComplianceMethod(e){this.cookieComplianceMethod=e}setLocale(e){const t=e.replaceAll("-","_").split("_").slice(0,2);this.locale=t.join("-"),this.environmentInfoObject?.pxLocale&&(this.environmentInfoObject.pxLocale.pyUseLocale=this.locale)}getLocale=()=>this.locale;getEnvironmentKeys(){return Object.keys(Fr.ENV_INFO_KEYS)}getMaxAttachmentSize(){return this.environmentInfoObject?.pxApplication?.pyMaxAttachmentSize}getDefaultOperatorDP(){return this.environmentInfoObject?.pxApplication?.pyDefaultOperatorDP}getDocumentUrlDP(){return this.environmentInfoObject?.pxApplication?.pyDocumentUrlDP}getCaseInstanceListDP(){return this.environmentInfoObject?.pxApplication?.pyCaseInstanceListDP}getBaseLocale(){return this.environmentInfoObject?.pxApplication?.pyBaseLocale||"en-US"}getRenderingMode(){return this.environmentInfoObject?.renderingMode}isPegaMobile(){return!!window.pms?.plugins?.c11n_spa||!!window.pms?.plugins?.c11n}isOfflineEnabled(){return"undefined"!=typeof navigator&&(navigator.userAgent||"").includes("pxUsesOffline")}shouldUseURLParams(){return"FULL_PORTAL"===this.environmentInfoObject?.renderingMode&&this.getFeatureMap()?.pyUseURLParams}getBuiltOnAppNames(){return this.environmentInfoObject?.pxApplication?.pyBuiltOnApplications}setPreviewMode(){yu.setPreviewMode()}setDefaultCasePage(e){this.pageName=e}getDefaultCasePage(){return this.pageName}disableAssignmentHeader(e){this.isAssignmentHeaderHidden=e}isAssignmentHeaderDisabled(){return this.isAssignmentHeaderHidden}getDefaultPortal(){return this.environmentInfoObject?.pxOperator?.pyDefaultPortal}updateFeatureMap(e){const t=this.environmentInfoObject?.features;return this.environmentInfoObject&&e&&(this.environmentInfoObject?.features?this.environmentInfoObject.features={...t,...e}:this.environmentInfoObject.features={...e}),this.getFeatureMap()}getFeatureMap(){return this.environmentInfoObject?.features||{}}setKeyMapping(e){return this.KeyMapping=e,this.KeyMapping}getKeyMapping(e){const t=this.KeyMapping[e];return void 0!==t?t:null}setCoexistenceMeta(e){return e&&(this.coexistenceMeta=e),this.getCoexistenceMeta()}getCoexistenceMeta(){return this.coexistenceMeta}isCoexistenceAppOfType(e){return!(!this.coexistenceMeta.isCoexistence||this.coexistenceMeta.appType!==e)}isOptimizedCaseLoadingEnabled(){return this.getFeatureMap().pyEnableOptimizedCaseLoading||this.getFeatureMap().optimizedCaseLoading||!1}isOpenCasePageAfterCreateInMultiDocEnabled(){return this.getFeatureMap().pyOpenCasePageAfterCreateInMultiDoc??!0}getCaseTypeList(){return this.environmentInfoObject&&this.environmentInfoObject?.pyCaseTypeList||[]}getClassesAccessList(){return this.environmentInfoObject?.pyClassesAccessList?.pxResults??[]}getUserSettings(){return this.environmentInfoObject?.pyUserSettings||null}getLocalizationVersion(){const e=this.getFeatureMap().pyLocalizationVersion,t=this.getFeatureMap().localizationVersion;return void 0!==t?t:void 0!==e?parseInt(e,10):1}getLocalizationBundles(e=this.locale){return TA.getLocalizationBundles(e)}getAvailableLocalePacks(){return this.getFeatureMap()?.availableLanguagePacks||void 0}getIsExtraCallRequiredForDefaultHome(){return this.isExtraCallRequiredForDefaultHome}setIsExtraCallRequiredForDefaultHome(e){this.isExtraCallRequiredForDefaultHome=e}getEnablePriorityAndUrgencyImprovements(){return this.enablePriorityAndUrgencyImprovements}setEnablePriorityAndUrgencyImprovements(e){this.enablePriorityAndUrgencyImprovements=e}getInactivityTimeout(){const e=this.environmentInfoObject?.pxOperator?.pyAuthenticationTimeout;return e?Number(e):e}isUnifiedObject(){return this.environmentInfoObject?.features?.isUnifiedObject||!1}getRuntime(){return"undefined"!=typeof window&&window.document?"Browser":"Native"}getInlineEditActions(e){return this.environmentInfoObject?.pyInlineEditActions?.filter((t=>t.pyClassName===e)).map((e=>e.pyActionName))??[]}getInlineEditActionViews(e){return this.environmentInfoObject?.pyInlineEditActions?.filter((t=>t.pyClassName===e)).map((e=>e.pyViewName))??[]}getFullObjectDisplayTemplate(){return this.environmentInfoObject?.pyFullObjectDisplayTemplate??void 0}setFullObjectDisplayTemplate(e){this.environmentInfoObject&&(this.environmentInfoObject.pyFullObjectDisplayTemplate=e),gu.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.CASE_VIEW_TEMPLATE_CHANGE,e)}getMultiStepNavDisplay(){return this.environmentInfoObject?.pyMultiStepNavDisplay??void 0}setMultiStepNavDisplay(e){this.environmentInfoObject&&(this.environmentInfoObject.pyMultiStepNavDisplay=e),gu.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.MULTI_STEP_NAV_DISPLAY_CHANGE,e)}getCaseStageDisplay(){return this.environmentInfoObject?.pyCaseStageDisplay??void 0}setCaseStageDisplay(e){this.environmentInfoObject&&(this.environmentInfoObject.pyCaseStageDisplay=e),gu.publish(Fr.PUB_SUB_EVENTS.UI_EVENTS.CASE_STAGE_DISPLAY_CHANGE,e)}},OA=e=>"fulfilled"===e.status,DA=async(e=PA.getLocale())=>{try{await(async e=>{const t=PA.getAvailableLocalePacks(),n=PA.getLocalizationBundles(e);let r;if(e&&t&&t.includes(e)?r=[th("getLocalizationPack",{queryPayload:{locale:e}})]:n.length>0&&(r=n.map((e=>th("getLocalizationPack",{queryPayload:{version:e.pyBundleVersion,bundle:e.pyBundleName}})))),!r||0===r.length)return;const a=200,s=201,o=await Promise.allSettled(r),i=iC(e??"en-US");o.filter(OA).forEach((({value:e})=>{if([a,s].includes(e.status)&&e.data){const t=e.data;Object.keys(t).forEach((e=>{i.setLocaleForRule(t[e],e)}))}}))})(e)}catch(e){console.warn(e)}};const vA=class{static regex=/\{@P[^}]*\s*:\s*[^}]*\}/g;static subRegex=/:'[a-zA-Z0-9!@#$&()\\-`.+,/\s"]*'/;static keyMap={};static formatLocaleKey(e){let t=0,n="";for(;t<=e.length;){const r=e.indexOf("{@P ",t);if(-1===r){n+=e.substring(t,e.length);break}n+=e.substring(t,r);const a=e.indexOf("}",t),s=e.substring(r,a+1),[o,i]=this.getKeyAndValue(s);this.addKeyToMap(o,i),n+=`${s.split(":")[0]}}`,t=a+1}return n}static getKeyAndValue(e){const t=e.indexOf(":"),n=e.indexOf("}");return[`${e.substring(0,t)}}`,e.substring(t+1,n)]}static addKeyToMap(e,t){this.keyMap[e]=t}static replaceWithValue(e){let t=0,n="";for(;t<=e.length;){const r=e.indexOf("{@P ",t);if(-1===r){n+=e.substring(t,e.length);break}n+=e.substring(t,r);const a=e.indexOf("}",t),s=e.substring(r,a+1);n+=this.keyMap[s],t=a+1}return n}};class RA{GENERIC_BUNDLE_KEY="@BASECLASS!GENERIC!PYGENERICFIELDS";FIELD_LABELS_BUNDLE_KEY="@BASECLASS!LABEL!PYFIELDLABELS";GENERIC_BUNDLE_KEY_LP="GENERIC!GENERICFIELDS";MESSAGE_BUNDLE_KEY="@BASECLASS!MESSAGE!PYMESSAGES";BASE_CLASS="@BASECLASS";DATA_PAGE_LOCALECONTEXT="datapage";constructor(){this.localeStore={},this.getLocaleValue=this.getLocaleValue.bind(this)}setLocaleForRule=(e,t)=>{const n=e.LocaleContent,r=t.toUpperCase();r.startsWith("@BASECLASS!DATAPAGE!")&&r.split(/[!#]/).length<4?Object.entries(n).forEach((([e,t])=>{null!==t&&"object"==typeof t&&"fields"in t&&this.updateLocaleStore(t,`${r}#${e}`.toUpperCase())})):"GENERIC!GENERICFIELDS"===r?Object.entries(n).forEach((([e,t])=>{null!==t&&"object"==typeof t&&this.sanitizeLocaleField(t,e.toUpperCase())})):this.sanitizeLocaleField(n,r)};updateLocaleStore=(e,t)=>{const n=e.fields||e,r=this.localeStore[t];r?aS.mergeDeep(n,r):n&&"object"==typeof n&&(this.localeStore[t]=n)};sanitizeLocaleField=(e,t)=>{["DASHBOARDSMANAGER","DATAEXPLORER","INSIGHT"].includes(t.toUpperCase())&&Object.entries(e).forEach((([,e])=>{null!==e&&"object"==typeof e&&"fields"in e&&this.updateLocaleStore(e,t)})),this.updateLocaleStore(e,t)};getLocaleForRule(e){return this.localeStore[e]}resetLocaleStore=()=>{this.localeStore={}};getLocaleValue(e,t,n,r){const a=this.#p(n,t),s=this.#h(e);s&&(e=vA.formatLocaleKey(e));const o=a?this.localeStore[a.toUpperCase()]??{}:{},i=r?this.localeStore[r.toUpperCase()]??{}:{};return"MESSAGES"===n?.toUpperCase()&&"string"==typeof e?this.getLocalizedErrorMessage(o,e)||e:s?vA.replaceWithValue(o[e]||i[e]||e):o[e]||i[e]||e}#p(e,t){return e?.toUpperCase().startsWith("@BASECLASS!DATAPAGE!")?t?`${e}#${t}`:e:e||t}getParagraphLocaleValue(e,t){const n=`${e}!${Fr.PARAGRAPH}!${t}`,r=this.localeStore[n.toUpperCase()];return r?{category:r.category,content:decodeURIComponent(atob(r.content).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join(""))}:null}getPortalLocaleReference(e){return 2!==PA.getLocalizationVersion()?"":e?`PORTAL!${e}`.toUpperCase():`PORTAL!${PA.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return 2}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=PA.getUseLocale(),n=[],r=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!r[e]))).map((e=>e.toUpperCase()))).length>0){const r=e.map((e=>({localeRuleKey:e,promise:fh.getSvcLocale(t,`${e}.json`)}))),a=await Promise.allSettled(r.map((e=>e.promise)));await Promise.all(a.map((async(e,t)=>{if("fulfilled"===e.status){const a=r[t];let s;try{s=await e.value.json()}catch{s=null}s&&n.push({localeRuleKey:a.localeRuleKey,jsonData:s})}})))}return n}async loadLocaleResources(e){await TA.loadLocaleBundle(e),await Promise.all(e.map((e=>DA(e))))}setTimezone(e){this.timezone=e}getTimeZoneInUse(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return this.timezone||e}matchPatternWithText(e,t){let n=t;const r=[];for(let t=0;t<e.length;){const a=e[t];if(0!==a.length){const e=n.indexOf(a);if(-1===e)return null;if(t>0){const t=n.slice(0,e);r.push(t)}n=n.slice(e+a.length)}t+=1}return n&&r.push(n),r}getLocalizedErrorMessage(e,t){let n="";if(e[t])return e[t];for(const r of Object.keys(e)){const a=r.split(/\{\d+\}/),s=this.matchPatternWithText(a,t);if(s){const t=e[r];if(n=this.replacePlaceHolders(s,t),n)return n}}return n}replacePlaceHolders(e,t){for(let n=0;n<e.length;){if(!t.includes(`{${n+1}}`))return"";t=t.replace(`{${n+1}}`,e[n]),n+=1}return t}async isCurrentLocalePackAvailable(){const e=PA.getLocale();return this.availableLangPacks||(this.availableLangPacks=await fh.getSvcAvailableLocales()),e&&this.availableLangPacks.includes(e)}getBaseComponentLabels=()=>this.getLocaleForRule("COSMOSFIELDS");#h(e){let t=!1;return e&&"string"==typeof e&&(t=e.includes("@P ")),t}}const $A=e=>{const t=e??PA.getLocale()??"en-US";return iC(t)};So.registerHandler("@L",((e,t)=>t?t.getLocalizationService(t.getLocaleRuleName()).getLocalizedText(e):e)),So.registerHandler("@P",((e,t,n)=>n?cS.getLitePropertyValue(n):t.getValue(e))),So.registerHandler("@E",((e,t,n)=>{try{const r=co(e),a=lo(r);return uo(a,t,n)}catch(e){}return!0})),So.registerHandler("@W",((e,t,n)=>{let r;if(n){const{pageReference:t,context:a}=n;r=qC(t,`.${Fr.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,a)}else r=t.getContextDataValue(`.${Fr.SUMMARY_OF_WHEN_CONDITIONS}.${e}`);return!0===r||"true"===r})),So.registerHandler("@ASSOCIATED",((e,t)=>{let n={};const r=[];let a="",s="";const o=t.getPageReference();if(e.startsWith(".")){a=`${o}.${e.substring(1)}`;const r=e.split(".").filter((e=>!!e));r.length>1&&(r.pop(),s=r.join(".")),n=t.getFieldMetadata(e.substring(1))}else n=t.getFieldMetadata(e),a=e;const i=n?.datasource?.tableType,c=n?.datasource?.mode===Fr.READONLY,l=n?.datasource?.name||"",d=t.getComponentConfig();if(d&&d.deferDatasource&&("object"==typeof d.datasourceMetadata&&null!==d.datasourceMetadata||(d.datasourceMetadata=`@FIELD_META ${e}`,t.setStateProps({datasourceMetadata:d.datasourceMetadata})),i===Fr.DATA_PAGE))return null;if(i===Fr.DECISION||i===Fr.RULE_REFERENCE)return function(e,t){const n=No.getPropertyName(e?.propertyForDisplayText??""),r=No.getPropertyName(e?.propertyForValue??""),a=t.getContextDataValue(`.${Fr.SUMMARY_OF_EXPRESSIONS}.${e?.name}`)||[];return a?.map((e=>({key:e[r]||e[`.${r}`],value:e[n]||e[`.${n}`]})))}(n?.datasource,t);if(i!==Fr.DATA_PAGE){const e=t.getLocalizationService(n?.localeReference);return n?.datasource?.records?.map((t=>({key:t.key,value:e.getLocalizedText(t.value)})))}const u=No.getPropertyName(n?.datasource?.propertyForDisplayText),p=No.getPropertyName(n?.datasource?.propertyForValue),h=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],f=t.getContextName(),g=[];if(h.forEach((e=>{if(No.isProperty(e?.value)){let t=HC(`.${aS.getFullPropertyReference([s,No.getPropertyName(e.value)])}`,o,f);g.push(aS.getFullPropertyReference([o,s,No.getPropertyName(e?.value)])),null!=t&&""!==t||(t=Fr.NULL_STRING),r.push(t)}else r.push(e?.value||Fr.NULL_STRING)})),f){const e=Ao.getContextObjectByName(f)||{};g.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,a])]}else e[t]=[a]})),Ao.addContextName(f,e)}const m=function(e,t,n,r){let a="",s=n;if(t.join(Fr.HASH_DELIMITER)&&(a=aS.getHashedString(t.join(Fr.HASH_DELIMITER)),s=n+Fr.UNDERSCORE_STRING+a),r){const e=GC(),t=e?e[n]?.[s]:{};return Array.isArray(t?.[Mr.getDefaultQualifiedName("pxResults")])?t[Mr.getDefaultQualifiedName("pxResults")]:[]}const o=e.getDataObject(),i=o?.[n]||{},c=i?.[s]||{};return Array.isArray(c?.[Mr.getDefaultQualifiedName("pxResults")])?c[Mr.getDefaultQualifiedName("pxResults")]:[]}(t,r,l,c),y=t.getLocalizationService();return m.map((e=>{let t=e[u]||e[`.${u}`];var n;return"string"==typeof t&&(n=t,t=y.getLocalizedDataPage(n,l,u)),{key:e[p]||e[`.${p}`],value:t}}))})),So.registerHandler("@ROUTING_INFO",((e,t)=>ks(t.getContainerName(),t.getContextName()))),So.registerHandler("@ENV",((e,t)=>{switch(e){case Fr.ENV_INFO_KEYS.APPLICATION_NAME:return PA.getApplicationName();case Fr.ENV_INFO_KEYS.ACCESS_GROUP:return PA.getAccessGroup();case Fr.ENV_INFO_KEYS.APPLICATION_ID:return PA.getApplicationID()||PA.getApplicationName();case Fr.ENV_INFO_KEYS.USER_NAME:return PA.getOperatorName();case Fr.ENV_INFO_KEYS.USER_ID:return PA.getOperatorIdentifier();case Fr.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizationService().getLocalizedText(PA.getApplicationLabel()||"");case Fr.ENV_INFO_KEYS.USER_IMAGE:return PA.getOperatorImageInsKey();case Fr.ENV_INFO_KEYS.LOCALE:return PA.getUseLocale();case Fr.ENV_INFO_KEYS.TIMEZONE:return PA.getTimeZone();case Fr.ENV_INFO_KEYS.WORK_GROUP:return PA.getOperatorWorkGroup();default:return e}})),So.registerHandler("@DATASOURCE",((e,t)=>{const n=t.getSharedDataPageForReferenceList()||t.getValue(e)||[],r=t.getComponentConfig(),a=Object.keys(r).find((t=>r[t]?.source?.includes(e)));if(a){const{fields:e,copyAll:t,filterDownloadedFields:s}=r[a],o=[];return n.forEach((n=>{const r={};t||s?Object.keys(n).forEach((e=>{const t=No.getPropertyName(e);r[t]=n[t]})):Object.keys(e).forEach((t=>{const a=No.getPropertyName(e[t]);r[t]=n[a]})),o.push(r)})),o}return[]})),So.registerHandler("@FIELD_META",((e,t)=>{let n,r={};if(r=e.startsWith(".")?t.getFieldMetadata(e.substring(1)):t.getFieldMetadata(e),r&&r.datasource&&r.datasource.parameters){let a="";const s=e.split(".").filter((e=>!!e));if(s.length>1&&(s.pop(),a=`.${s.join(".")}`),Array.isArray(r.datasource.parameters)){const e=[];r.datasource.parameters.forEach((n=>{const r={},{name:s,value:o}=n;r.name=s,"string"==typeof o&&o.startsWith("@P")?r.value=`@P ${a}${o.substring(3)}`:r.value=o,e.push(t.resolveConfigProps(r))})),n=e}else n=t.resolveConfigProps(r.datasource.parameters);r={...r,datasource:{...r.datasource,parameters:n}}}return r})),So.registerHandler("@USER",((e,t,n)=>{const r=n?cS.getLitePropertyValue(n,e):t.getValue(e),a=n?cS.getReferencedUser(r,n):t.getReferencedUser(r);return{userId:r,userName:a?a.UserName:null}})),So.registerHandler("@ACTIVE_CASES",((e,t)=>Qf.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),So.registerHandler("@LR",(e=>e)),So.registerHandler("@CASE",((e,t)=>e===Fr.ID?t.getCaseInfo().getKey():e)),So.registerHandler("@SHARED",(e=>Hg.getSharedState(e))),So.registerHandler("@PARAGRAPH",((e,t)=>{const{useDecision:n,isBanner:r,messageType:a,dismissBanner:s}=Yg.getParagraphProperties(e,t),o=Yg.hasDecisionBannerContent(e,t);return n&&o?Yg.processBannerDecisionParagraph(e,t):r?{htmlContent:Yg.processParagraph(e,t),messageType:a,dismissBanner:s}:Yg.processParagraph(e,t)})),So.registerHandler("@FORMAT",((e,t)=>{const n=t.getCurrentClassID(),r=bC(e,n);if(!r?.dynamicContents?.length)return null;const{dynamicContents:a}=r;for(let e=0;e<a.length-1;e+=1)if(cS.resolveWhen(a[e].when,t))return{pattern:a[e].content};return{pattern:a[a.length-1].content}})),So.registerHandler("@FILTERED_LIST",((e,t)=>{const n=e.substring(1,e.indexOf("[")),r=e.substring(e.indexOf("]")+2),a=e.substring(e.indexOf("[")+1,e.indexOf("]"));if(!t)return null;const{useCustomContext:s}=t;let o;return aS.isEmpty(s)?o=t.getValue(`.${n}`):(o=s,o=aS.getIn(o,n)),o&&r.length>0?(a&&(o=o.filter((e=>po(a,e)))),o.map((e=>aS.getIn(e,r)))):null})),So.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.[Mr.getDefaultQualifiedName("pyCountry")];return n?`${PCore.getDefaultQualifiedName("pyAddressForm")}_${n}`:PCore.getDefaultQualifiedName("pyAddressForm")})),So.registerHandler("@DATATYPE",((e,t)=>t.getValue(e))),So.registerHandler("@ATTACHMENT",((e,t,n)=>{let r;return r=n?cS.getLitePropertyValue(n):t.getValue(e),Vp.prepareAttachmentData(r)}));const xA=e=>{const t=e.lastIndexOf(".");return t<0?e:e.slice(t+1)};function wA(e,t){const n=e.authorContext;if("string"!=typeof n||!n)return!1;return(n.startsWith(".")?n.substring(1):n)===t}function MA(e,t){const n=e.config;if(!n?.name||"string"!=typeof n.name)return null;const r=t(n.name);return r?Array.isArray(r)?r.find((e=>e.classID===n.ruleClass))??null:r:null}function LA(e,t,n,r="root",a=[]){if(e.config&&function(e,t){const n="string"!=typeof(r=e.value)?null:r.startsWith("@")?r.replace(/^@\w+\s+\./,""):null;var r;return!!n&&n===t}(e.config,t)&&a.push({type:e?.type,config:e.config,path:r}),!e.children)return a;for(let s=0;s<e.children.length;s+=1){const o=e.children[s],i=`${r}.children[${s}]`,c="reference"===o.type?MA(o,n):o;c&&LA(c,t,n,i,a)}return a}So.registerHandler("@FL",((e,t)=>{const n=(e=>e.startsWith(".")?e.slice(1):e)(e),r=t.getFieldMetadata(n);return r&&r.label?t.getLocalizationService(r.localeReference).getLocalizedText(r.label):xA(n)})),So.registerHandler("@DEFERRED",((e,t)=>{const n=t.getFieldMetadata(e);return n?.isDeclarativeTarget?{isDeferred:!0,propertyName:e}:t.getValue(e)})),So.registerHandler("@GENAICOACH",((e,t)=>TC(e,t.getCurrentClassID()))),So.registerHandler("@AIAGENT",((e,t)=>{const n=PC(e,t.getCurrentClassID());if(n)return n;const r=t.getComponentConfig();if(r){const n=r?.coaches?.find((t=>t?.config?.coach?.substring(9)===e&&t?.config?.ruleNamespace))?.config;if(n?.label){const r={label:n.label};t.resolveConfigProps({label:n.label},r);const a=r.label;return{insName:PA.getFeatureMap()?.isNamespaceEnabled&&e.includes(Fr.DOUBLE_UNDERSCORE_STRING)?e:`${n.ruleNamespace}${Fr.DOUBLE_UNDERSCORE_STRING}${e}`,label:t.getLocalizedValue(a),type:"agent"}}}return null})),So.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),r=t.getContextName(),a=t.getPageReference();Cg.registerForRefresh("PROP_CHANGE",t.getActionsApi().refreshCaseView.bind(t.getActionsApi(),n,"",a,{autoDetectRefresh:!0,preserveClientChanges:!1,refreshFor:`${a.replace("caseInfo.content","")}${e}`,resetForm:!0}),`${a}${e}`,`${r}/${a}`,r)})),So.registerHandler("@DW",((e,t,n)=>{let r;const a=`${Fr.CONTEXT_DATA}.${Fr.SUMMARY_OF_DYNAMIC_WHENS}.${e}`;if(n){const{context:e}=n??{};r=HC(a,null,e)}else r=t.getValue(a);return!0===r||"true"===r})),So.registerHandler("@CA",((e,t,n)=>n?cS.getLitePropertyValue(n):t.getValue(e)));const UA=new Set(["autocomplete","dropdown"]),FA=["displayAs","hideLabel","linkReference","localeReference","matchPosition","referenceType","selectionMode"];function jA(e,t,n){const r=t.config,a=function(e){const t=e.config??{},n={};return FA.forEach((e=>{void 0!==t[e]&&(n[e]=t[e])})),void 0===t.contextClass&&void 0===t.targetObjectClass||(n.contextClass=t.contextClass??t.targetObjectClass),void 0!==t.referenceList&&(n.referenceList=t.referenceList),n.parameters=t.parameters,n}(e),s=function(e){const t=e.inheritedProps;return Array.isArray(t)?t.reduce(((e,t)=>("object"!=typeof t||null===t||Array.isArray(t)||"prop"in t&&"string"==typeof t.prop&&"value"in t&&(e[t.prop]=t.value),e)),{}):{}}(n),o={...r??{},...a,...s};return"AutoComplete"===t.type&&void 0!==a.referenceList&&(o.datasource=a.referenceList),o}function kA(e,t,n,r){try{if(!e.name||"string"!=typeof e.name)return null;const t=r(e.name);let a;if(Array.isArray(t))a=t;else{if(!t)return null;a=[t]}const s=a.find((t=>t.classID===e.ruleClass));if(!s||!function(e){const t=e.config;return!!t&&"DataReference"===t.template&&"string"==typeof t.displayAs&&UA.has(t.displayAs.toLowerCase())}(s))return null;const o=function(e){const t=e?.children;return Array.isArray(t)&&t.length>0?t[0]:null}(s);return o?{type:o.type,config:jA(s,o,e),path:n}:null}catch{return null}}function VA(e,t,n,r="root",a=[]){if(e.config&&wA(e.config,t)){const t=kA(e.config,e.type,r,n);t&&a.push(t)}if(!e.children)return a;for(let s=0;s<e.children.length;s+=1){const o=e.children[s],i=`${r}.children[${s}]`,c="reference"!==o.type||o.config&&wA(o.config,t)?o:MA(o,n);c&&VA(c,t,n,i,a)}return a}function BA(e,t,n){const r=PA.getInlineEditActionViews(t),a=function(e,t){if(!e||"object"!=typeof e)return null;if(Array.isArray(e))return e.find((e=>e.classID===t))??null;return e}(n(r&&r.length>0?r[0]:Mr.getDefaultQualifiedName("pyEdit")),t);if(!a)return[];const s=LA(a,e,n,"root");return s.length>0?s:VA(a,e,n)}const GA={},WA={},HA={};let qA=0,YA=!1;const zA={},KA={},QA={},JA={},XA={},ZA={},eC={},tC={},nC={},rC={},aC={},sC=(e={},t={})=>{0!==Object.keys(t).length?Object.keys(e).forEach((n=>{const r=e[n],a=t[n];a?((e,t,n,r)=>{const a=Array.isArray(n)?n:[n];(Array.isArray(r)?r:[r]).forEach((e=>{const t=a.findIndex((t=>t.classID===e.classID));if(-1===t)a.push(e);else{const n={isDeclarativeTarget:!1},r={...a[t],...n,...e};a[t]=r}})),t[e]=1===a.length?a[0]:a})(n,t,a,r):t[n]=r})):aS.copy(e,t)},oC=(e,t="")=>{if(!e)return null;const n=KA[e];if(!n)return null;if(!t)return aS.deepClone(n);let r;return r=Array.isArray(n)?n.find((e=>e.classID.toLowerCase()===t.toLowerCase()||e.associationClassID?.toLowerCase()===t.toLowerCase()))||null:n.classID.toLowerCase()===t.toLowerCase()||n.associationClassID?.toLowerCase()===t.toLowerCase()||("Page"===n.type||"Page List"===n.type)&&n?.pageClass?.toLowerCase()===t.toLowerCase()?n:null,r?aS.deepClone(r):null},iC=e=>(rC[e]||(rC[e]=new RA),rC[e]),cC=(e,t)=>(aC[e]||(aC[e]=t()),aC[e]),lC=(e,t,n,r=[])=>{if(!t||!e)return null;if(!e.includes(".")){let a;const s=oC(e,t);return r.length&&(a=r.join(".")),{...s,embeddedType:n,category:a}}const[a,...s]=e.split("."),o=oC(a,t);return o&&r.push(o.label),lC(s.join("."),o?.pageClass,o?.type,r)},dC=e=>{0!==Object.keys(e).length&&(sC(e,HA),YA&&(qA+=1))},uC=()=>qA,pC=()=>{YA=!0},hC=()=>{YA=!1},fC=e=>{sC(e,zA)},gC=e=>{(e=>{e.views&&Object.keys(e.views).length>0&&(sC(e.views,HA),YA&&(qA+=1)),e.navigations&&sC(e.navigations,zA),e.personalizations&&sC(e.personalizations,JA),e.insights&&sC(e.insights,XA),e.paragraphs&&sC(e.paragraphs,GA),e.formats&&sC(e.formats,WA),e.dataTypes&&sC(e.dataTypes,ZA),e.datapages&&sC(e.datapages,eC),e.genAICoaches&&sC(e.genAICoaches,tC),e.AIAgents&&sC(e.AIAgents,nC)})(e),(e=>{const t=e.fields||{};Object.keys(t).forEach((n=>{const r=t[n];if(Array.isArray(r)){if(r.forEach((t=>{e.datapages&&t.datasource&&"DataPage"===t.datasource.tableType&&(t.datasource.mode=e.datapages?.[t.datasource.name].mode);const r=tm(Xg,n,t.definedOnClassID??t.classID);t.localeReference=r})),1===r.length){const[e]=r;t[n]=e}}else e.datapages&&r?.datasource&&"DataPage"===r.datasource.tableType&&(r.datasource.mode=e.datapages[r.datasource.name].mode)}))})(e);const{datapages:t={}}=e;Object.keys(t).forEach((e=>{QA[e]=t[e]})),sC(e.fields,KA)},mC=e=>HA[e],yC=(e,t)=>{const n=HA[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},EC=e=>zA[e],IC=e=>e in QA?QA[e]:null,AC=e=>e in JA?JA[e]:null,CC=e=>e in XA?XA[e]:null,SC=e=>{const t={};return Object.keys(KA).forEach((n=>{const r=KA[n];let a;Array.isArray(r)?a=r.find((t=>e===t.classID)):e===r.classID&&(a=r),a&&(t[n]=aS.deepClone(a))})),t},_C=(e,t)=>{const n=oC(e,t),r=n?.datasource?.parameters;return r?aS.deepClone(r):null},NC=(e,t)=>{let n=null;const r=GA[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?aS.deepClone(n):null},bC=(e,t)=>{let n=null;const r=WA[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?aS.deepClone(n):null},TC=(e,t)=>{let n=null;const r=tC[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?aS.deepClone(n):null},PC=(e,t)=>{let n=null;const r=nC[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?aS.deepClone(n):null},OC=e=>{if(e in ZA){const{savableDataPage:t}=ZA[e];return t}return null},DC=e=>{const t=eC[e];if(!t)return null;const{classID:n,isAlternateKeyStorage:r,parameters:a}=t;if(r)return a.map((e=>({keyName:e.name,isAlternateKeyStorage:r,linkedField:e.linkedField})));const s=ZA[n];return s?s.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:r}))):[]},vC=e=>{if(e in ZA){const{lookupDataPage:t}=ZA[e];return t}return null},RC=e=>{if(Object.hasOwn(ZA,e)){const{lookupDataPageInfo:t}=ZA[e];return t}return null},$C=(e,t)=>{const n=e.split("."),r=n.pop(),a=new Am({options:{pageReference:`${n.join(".")}`,context:t}}),s=oC(r,a.getCurrentClassID())?.additionalInformation;if(!s?.includes("@PARAGRAPH"))return s;const o=No.trimAnnotation(s);return Yg.processParagraph(o,a)},xC=(e,t)=>{const n=e.split("."),r=n.pop(),a=new Am({options:{pageReference:`${n.join(".")}`,context:t}}),s=oC(r,a.getCurrentClassID()),o={};return a._classID=a.getCurrentClassID(),a.resolveConfigProps(s,o),o},wC=(e,t)=>BA(e,t,mC);class MC{constructor(){this.name="CascadeManager",this.cascadeSubscribers={},this.cascadeResetSubscribers={},this.listChangeSubscribers=[]}registerResetDependencies(e,t,n,r,a,s="singleRecord"){if(!e||!n||!r?.length)return;const o=n.startsWith(".")?`${t}.${n.substring(1)}`:n,i=this.cascadeResetSubscribers[e]||{},c=this._handlePageReference(t,n,a);r.forEach((e=>{if(!e)return;let t=e.startsWith(".")?e.substring(1):e;if(t=aS.getFullPropertyReference([c,t]),t in i){const e=i[t];e.find((e=>e.propertyName===o))||e.push({propertyName:o,mode:s})}else i[t]=[{propertyName:o,mode:s}]})),Object.keys(i).length>0&&(this.cascadeResetSubscribers[e]=i)}deregisterResetDependencies(e,t,n,r,a){if(!e||!n||!r?.length)return;const s=n.startsWith(".")?`${t}.${n.substring(1)}`:n,o=this.cascadeResetSubscribers[e]||{},i=this._handlePageReference(t,n,a);r.forEach((e=>{if(e){let t=e.startsWith(".")?e.substring(1):e;if(t=aS.getFullPropertyReference([i,t]),t in o){const e=o[t];aS.removeExistingDependentProperty(e,s)}}})),Object.keys(o).length>0&&(this.cascadeResetSubscribers[e]=o)}getResetDependencies(e,t){return this.cascadeResetSubscribers[e]?.[t]||[]}purgeResetDependencies(e){e&&this.cascadeResetSubscribers[e]&&delete this.cascadeResetSubscribers[e]}registerFields(e,t,n,r,a){this.cascadeSubscribers[e]=this.cascadeSubscribers[e]||{},n?.forEach((n=>{this.cascadeSubscribers[e][`${t}${n}`]=this.cascadeSubscribers[e][`${t}${n}`]||{};const s=this.cascadeSubscribers[e][`${t}${n}`];if(!s[a]){s[a]=r;const o=HC(n,t,e);s.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,r,a){const s=MC._getFieldsForList(e,t,n);s.length>0&&(this.registerFields(e,t,s,r,a),Af.enableCascade(e))}unRegisterListField(e,t,n,r){const a=MC._getFieldsForList(e,t,n);a.length>0&&this.unRegisterFields(e,t,a,r)}static _getFieldsForList(e,t,n){const r=[],a=oC(n,HC("classID",t,e));return a&&!Array.isArray(a)&&a.datasource&&a.datasource.parameters&&Object.values(a.datasource.parameters).forEach((e=>{if(No.isProperty(e)){const t=No.trimAnnotation(e);r.push(t)}})),r}unRegisterFields(e,t,n,r){this.cascadeSubscribers[e]&&n?.forEach((n=>{if(!this.cascadeSubscribers[e][`${t}${n}`])return;const a=this.cascadeSubscribers[e][`${t}${n}`];a[r]&&delete a[r]}))}triggerCascade(e,t,n,r){let a=!1;this.cascadeSubscribers[e]&&this.cascadeSubscribers[e][t]&&(Object.keys(this.cascadeSubscribers[e][t]).forEach((s=>{const o=this.cascadeSubscribers[e][t];"previousValue"!==s&&o.previousValue!==n&&(a=!0,r?r.add(o[s]):o[s](t,n))})),a&&(this.cascadeSubscribers[e][t].previousValue=n))}purgeCascadeFields(e){delete this.cascadeSubscribers[e]}handleServerChanges(e,t=[],n=[]){if(!e)return;const r=new Set;n.forEach((t=>{const n=HC(t,"",e);this.triggerCascade(e,t,n,r)})),r.forEach((e=>{e()})),0!==this.listChangeSubscribers.length&&0!==t.length&&t.forEach((t=>{this.listChangeSubscribers.forEach((n=>{const r=HC(t,"",e);n(e,t,r)}))}))}_updateChangedProperties(e,t,n,r,a,s,o,i){const c=n&&i.some((e=>r.startsWith(e)));if(e!==t||c){const e=r.lastIndexOf("."),t=r.substring(0,e),i=r.substring(e),c=pu.getMessages({type:"error",property:i,context:a,pageReference:t});if(c?.length>0&&o.push(r),!n)return;s.push(r)}}isChangedListPropertyExist(e){let t=!0;return 0!==this.listChangeSubscribers.length&&aS.isValidPageListProperty(e)||(t=!1),t}_getServerProperties(e,t,n,r,a,s,o){if("object"!=typeof e){a.push(n.replace(/\.(\d+)/g,"[$1]"));const i=this.isChangedListPropertyExist(n);n=n.replace(/\.(\d+)/g,"[$1]");const c=HC(n,"",t);if(void 0===c&&!e&&0!==e)return;return void this._updateChangedProperties(c,e,i,n,t,r,s,o)}const i=Object.keys(e??{});for(let c=0,l=i.length;c<l;c+=1){const l=i[c],d=`${n}.${l}`;if(Array.isArray(e[l])){const n=HC(d,"",t);n&&n?.length===e[l].length||o.push(d.replace(/\.(\d+)/g,"[$1]"))}this._getServerProperties(e[l],t,d,r,a,s,o)}}getServerProperties(e,t,n=Fr.CASE_INFO.CASE_INFO_CONTENT){const r=[],a=[],s=[],o=aS.getIn(e,n);return o&&t?(this._getServerProperties(o,t,n,r,s,a,[]),{changedListProperty:r,leafProperty:s,changedPropertyWithError:a}):{changedListProperty:r,leafProperty:s,changedPropertyWithError:a}}_handlePageReference(e,t,n){let r=e;if("Page"===n&&t.startsWith(".")&&t.slice(1).includes(".")){r=`${e}${t.substring(0,t.lastIndexOf("."))}`}return r}registerForListChanges(e=(()=>{})){this.listChangeSubscribers.push(e)}unRegisterForListChanges(){this.listChangeSubscribers=[]}}const LC=new MC;let UC=null;const FC=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),jC=e=>{UC=e},kC=()=>UC,VC=e=>{if(!e)return;let t=[],n=[],r=[];if(Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:r}=LC.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),UC?.dispatch(e),!Array.isArray(e)&&"MERGE_DATA"===e.type){if(r.length&&!e.payload.skipValidation){r.map((e=>{const t=e.lastIndexOf(".");return{property:e.substring(t),pageReference:e.substring(0,t)}})).forEach((({property:t,pageReference:n})=>{pu.clearMessages({type:"error",property:t,pageReference:n,context:e.payload.context});const r=Zd.getFieldReferenceForProperty(e.payload.context,`${n}${t}`);if(r){const e=cS.resolveContextTreeNodeProps(r.props);zp.validate(e.componentName?.toLowerCase(),e.propertyName,cS.getLitePropertyValue(e,e.propertyName),e)}}))}LC.handleServerChanges(e.payload.context,t,n)}},BC=e=>kC()?.getState().data?.[e],GC=()=>kC()?.getState().data[Fr.SHARED],WC=(e,t,n)=>{if(!(r=e)||r.startsWith('"')||r.startsWith("'"))return(e=>e&&e.trim().substring(1,e.length-1))(e);var r;const a=e?.startsWith(".")?t+e:e,s=FC(a);return aS.getIn(n,s)},HC=(e,t,n)=>WC(e,t,BC(n)),qC=(e,t,n)=>WC(t,e?`${Fr.CONTEXT_DATA}.${e}`:`${Fr.CONTEXT_DATA}`,BC(n)),YC=(e,t,n)=>((e,t,n)=>{const r=FC(`${t}.${n}`);return aS.getIn(e,r)})(BC(n),`${Fr.CONTEXT_DATA}.${e}`,t),zC=e=>{const{context:t}=e,n=kC()?.getState().data[t];if(n)return ha;const{action:r}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(r)?Oa:ha},KC=(e,t)=>{const n=FC(t);return aS.deleteIn(e,n)},QC=e=>!Array.isArray(e)&&"object"==typeof e,JC=(e,t=[],n=[])=>{Array.isArray(t)&&t.length>0&&t.forEach((t=>{t.allowMultiple?t.allowMultiple&&!n.includes(t.path)&&aS.setIn(e,t.path,[]):aS.setIn(e,t.path,{})})),n.length>0&&aS.rearrangeProperties(n,e)},XC=(e,t,n={})=>{const{isArrayDeepMerge:r,propertiesToReplace:a=[],propertiesToReArrange:s=[]}=n;Array.isArray(e)&&!t&&(t=[]),JC(e,a,s);const o=(e,t)=>{if(QC(e)&&null!==t&&"string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)return Array.isArray(t)?t:Rr(e,t,o);if(Array.isArray(e)&&null!==t&&Array.isArray(t)){if(r)return Rr(e,t,o);{const n=t.length;if(void 0===r&&n===e.length)return Rr(e,t,o)}}return""===t&&e&&"object"==typeof e?e:t};return o(e,t)},ZC=(e,t,n,r={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:a}=r,s=FC(t);if("object"==typeof n){const t=XC(aS.getIn(e,s),n,{isArrayDeepMerge:a});return aS.setIn(e,s,t)}return aS.setIn(e,s,n)},eS=(e,t,n)=>{const r=FC(t);return aS.setIn(e,r,n)},tS=()=>{const e=ls,{promise:t,actionMgrID:n}=Th.actionManagerPromise(e);return VC({type:e,payload:{actionMgrID:n}}),t},nS=e=>{const t=kC()?.getState();return!!t?.data?.[e]};class rS{static mergeDeep(e,t){return Rr(t,e)}static hasIn(e,t){return Un(e,t)}static getIn(e,t,n){return Fn(e,t,n)}static setIn(e,t,n){return Wn(e,t,n)}static deleteIn(e,t){return xn(e,t)}static isObjectEmpty(e){return!e||0===Object.entries(e).length}static isEmpty(e){return xr(e)}static deepClone(e={}){return JSON.parse(JSON.stringify(e))}static copy(e,t){Object.keys(e).forEach((n=>{t[n]=e[n]}))}static isPropertyRef(e){if(!e||!e.includes("."))return!1;for(let t=0;t<e.length;t+=1)if(" @#$%=!<>/\\".includes(e[t]))return!1;return!0}static isValidPropertyReference(e){return"string"==typeof e&&(""===e||""!==e.trim())}static isWhenExist(e){const t=["visibility","disabled","readOnly","required"];let n=!1;for(const r of Object.keys(e)){const a=e[r];a&&"object"==typeof a&&!Array.isArray(a)?n=n||rS.isWhenExist(a):t.includes(r)&&"string"==typeof a&&a?.startsWith("@W ")&&(n=!0)}return n||"multirecordlist"!==e?.type||"Editable"!==e?.renderMode||(n=Object.keys(e?.allowActions??{}).some((t=>"string"==typeof e?.allowActions?.[t]&&e.allowActions[t]?.startsWith("@W ")))),n}static getWhenNames(e){const t=["visibility","disabled","readOnly","required"];let n="";const r=new Set;if(e&&Object.keys(e).forEach((a=>{const s=e[a];t.includes(a)&&"string"==typeof s&&s.startsWith("@W ")&&(n=No.trimAnnotation(s),r.add(n))})),"multirecordlist"===e?.type&&"Editable"===e?.renderMode){const t=e?.allowActions??{};Object.keys(t).forEach((e=>{"string"==typeof t[e]&&t[e]?.startsWith("@W ")&&(n=No.trimAnnotation(t[e]),r.add(n))}))}return[...r]}static isExpressionExist(e){const t=["disabled","visibility","readOnly","required"];let n=!1;for(const r of Object.keys(e))t.includes(r)&&"string"==typeof e[r]&&e[r]?.startsWith("@E ")&&(n=!0);return n}static buildDataObject(e,t){let n={};const r=n;if(t.indexOf(".")>0){t.split(".").forEach((e=>{if(e.includes("[")){const[t]=e.split("[");n[t]=[],n=n[t],e=e.substring(e.indexOf("[")+1,e.lastIndexOf("]"))}n[e]={},n=n[e]}))}else n[t]={},n=n[t];return Object.keys(e).forEach((t=>{let r=t;t.startsWith(".")&&(r=t.substring(1)),n[r]=e[t]})),r}static buildObject=(e,t,n)=>{if(void 0===n)return;const r=e.split(".");let a=0;for(;a<r.length-1;a+=1){const e=r[a];e?.toString().length&&!t[e]&&(t[e]={}),t[e]&&(t=t[e])}"object"==typeof n?(t[r[a]]||(t[r[a]]=Array.isArray(n)?[]:{}),XC(t[r[a]],n,{isArrayDeepMerge:!0})):t[r[a]]=n};static getHashedString(e){return(0,ln.crc32)(e).toString(16)}static getPropertyName(e){if(e){const t=e.startsWith("@P"),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getPropertyNameFromDependency(e){return"string"==typeof e?e:e.propertyName}static isValidJson(e){try{return JSON.parse(e)}catch(e){return console.error("not a Valid JSON",e),!1}}static isEqual(e,t){return Xt(e,t)}static isContains(e,t){const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(e[n[r]]&&rS.isEqual(e[n[r]],t))return!0;return!1}static removeExistingDependentProperty(e,t){const n=e.findIndex((e=>e.propertyName===t));n>=0&&e.splice(n,1)}static getFullPropertyReference(e){return Array.isArray(e)?e.filter((e=>!!e)).join("."):""}static iterateLeafNodes(e,t){const n=(e,r=[])=>{Object.entries(e).forEach((([a,s])=>{r.push(Array.isArray(e)?Number(a):a),Array.isArray(s)?s.forEach(((e,t)=>{r.push(t),n(e,r),r.pop()})):"object"==typeof s?n(s,r):t(r.slice(),s),r.pop()}))};n(e)}static resolveStringBooleans(e){const t=["required","readOnly","visibility"];return Object.keys(e).forEach((n=>{t.includes(n)&&"string"==typeof e[n]&&(e[n]="true"===e[n])})),e}static generateUniqueID(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();const e="undefined"!=typeof performance&&"function"==typeof performance.now?performance.now().toString(36).replace(".",""):Math.random().toString(36).slice(2);return`${Date.now().toString(36)}${e}`}static unflatten(e){const t={};return Object.entries(e).forEach((([e,n])=>{const r=e.split(".");let a;r.reduce(((e,t,s)=>(a=e[t]?e[t]:Number.isNaN(Number(r[s+1]))?r.length-1===s?n:{}:[],e[t]=a,e[t])),t)})),t}static flatten(e,t,n){t||(t=""),Array.isArray(e)?e.forEach(((e,r)=>{rS.flatten(e,`${t}[${r}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((r=>{const a=t?`${t}.${r}`:r;rS.flatten(e[r],a,n)})):n[t]=e}static buildInstructionPageReference(e,t){const n=e.startsWith(Fr.OBJECT_INFO.OBJECT_INFO)?`${e}${t}`.replace(Fr.OBJECT_INFO.OBJECT_INFO_CONTENT,""):`${e}${t}`.replace(Fr.CASE_INFO.CASE_INFO_CONTENT,"").replace(Fr.DATA_INFO.DATA_INFO_CONTENT,"");return ep.formatPageReference(n)}static convertPageRefToClipboardPageNotation(e){return e.replace(/\[\d+\]/g,(e=>e.replace(/\d+/g,(e=>`${parseInt(e,10)+1}`)).replace("[","(").replace("]",")")))}static convertClipboardPageToPageRefNotation(e){return e.replace(/\(\d+\)/g,(e=>e.replace(/\d+/g,(e=>""+(parseInt(e,10)-1))).replace("(","[").replace(")","]")))}static segmentsMatch=(e,t)=>{const n=e.split("."),r=t.split(".");return n.length===r.length&&n.every(((e,t)=>{if(e===r[t])return!0;if(e.endsWith("()")){const n=e.slice(0,-2),a=r[t];return a.startsWith(n)&&/^\[\d+\]$/.test(a.slice(n.length))}return!1}))};static isString(e){return"string"==typeof e}static rejectPendingActions(e){return e.forEach((e=>e.payload.actionMgrID&&Th.rejectActionByID(e.payload.actionMgrID))),!0}static isValidAnnotation(e){const t=new Set(["@DATASOURCE","@ACTIVE_CASES","@ADDRESS","@ASSOCIATED","@ATTACHMENT","@CASE","@FILTERED_LIST","@PARAGRAPH","@P","@ROUTING_INFO","@USER","@W","@E","@SHARED","@CA"]),n=e.indexOf(" "),r=e.substring(0,n);return t.has(r)}static trimDotForProperty(e){return"string"==typeof e&&e.startsWith(".")?e.substring(1):e}static decodeHtmlEntities(e){if("undefined"!=typeof document){const t=document.createElement("textarea");return t.innerHTML=e,t.value}let t=e;return Object.entries({"&":"&","<":"<",">":">",""":'"',"'":"'","'":"'","/":"/","/":"/"}).forEach((([e,n])=>{t=t.split(e).join(n)})),t=t.replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(parseInt(t,10)))),t=t.replace(/&#x([a-f\d]+);/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))),t}static convertObjectWithStringToBoolean(e){if(e&&!Array.isArray(e)&&"object"==typeof e)return Object.keys(e).forEach((t=>{let n;const r=e[t];"string"==typeof r?n="true"===r||"false"!==r&&r:"object"==typeof r?(n=r,rS.convertObjectWithStringToBoolean(r)):n=r,e[t]=n})),e}static rearrangeProperties(e,t){e.forEach((e=>{let n=rS.getIn(t,e);if(!n)return;const r=Object.hasOwn(n,Mr.getDefaultQualifiedName("pyCount"));if(r&&(n=n.pxResults),!n)return;const a=n.filter((e=>!e.error)),s=n.filter((e=>e.error));rS.setIn(t,r?`${e}.pxResults`:e,[...a,...s])}))}static getETag(e){if(!e)return;let t=e;const n=t?.split("/")||[],r=["workarea","modal","actionarea"],a=n.findIndex((e=>r.some((t=>e.startsWith(t)))));return-1!==a&&(t=n.slice(0,a+1).join("/")),kC()?.getState()?.data[t]?.caseInfo?.headers?.etag}static PAGELIST_PATH_REGEX=/^(?!.*\.\.)(?!\d)\w+(\.\w+)*\.\d+(\.\w+)+$/;static isValidPageListProperty(e){return rS.PAGELIST_PATH_REGEX.test(e)}static generateDataPageHashWithParameters(e,t,n){const r=[];let a="";const s=n.getPageReference(),o=n.getContextName();Object.keys(e).forEach((t=>{const n=e[t];let a=No.isProperty(n)?HC(`.${No.getPropertyName(n)}`,s,o):n;null!=a&&""!==a||(a=Fr.NULL_STRING),r.push(a)}));let i=t;const c=r.join(Fr.HASH_DELIMITER);return c&&(a=rS.getHashedString(c),i=t+Fr.UNDERSCORE_STRING+a),i}static parsePegaDateTimeToTimestamp(e){if(!e)return null;const t=e.replace(" GMT","").match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})\.(\d{3})$/);if(!t){const t=new Date(e).getTime();return Number.isNaN(t)?null:t}const[,n,r,a,s,o,i,c]=t.map(Number);return new Date(n,r-1,a,s,o,i,c).getTime()}static formatToUTCDate(e,t){if(!e)return e;const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const r=(e,t=2)=>String(e).padStart(t,"0"),a=n.getUTCFullYear(),s=r(n.getUTCMonth()+1),o=r(n.getUTCDate());if("Date"===t)return`${a}${s}${o}`;return`${a}${s}${o}T${r(n.getUTCHours())}${r(n.getUTCMinutes())}${r(n.getUTCSeconds())}.${r(n.getUTCMilliseconds(),3)} GMT`}static isLeafProperty(e){return Boolean(e)&&!e.includes(".")}static getMetadataType(e,t,n){const r=rS.isLeafProperty(e)?oC(e,t):n.getFieldMetadata(e);return Array.isArray(r)?r[0]?.type:r?.type}static toStringParameterValue(e){return"string"==typeof e?e:e instanceof Date?e.toISOString():null}static resolveParameterValue(e,t,n,r,a){if(n&&Object.hasOwn(n,e))return n[e];if(!Yh.isProperty(t))return t;const s=null!==a?Yh.getPropertyName(t):Yh.getLeafPropertyName(t);return r.getValue(`.${s}`)}static formatParameterValue(e,t,n,r,a){if(!Yh.isProperty(t))return e;const s=null!==r?Yh.getPropertyName(t):Yh.getLeafPropertyName(t);if(!s)return e;const o=rS.getMetadataType(s,a,n);if(!o)return e;const i=rS.toStringParameterValue(e);return"Date"===o?i?i.includes("T")?rS.formatToUTCDate(i,"Date"):rS.formatToUTCDate(`${i}T00:00:00Z`,"Date"):e:"DateTime"===o&&i?rS.formatToUTCDate(i,"DateTime"):e}static resolveAndFormatParameters(e,t,n,r,a){const s={};for(const o of Object.keys(e)){const i=e[o];if("string"!=typeof i)s[o]=i;else{const e=rS.resolveParameterValue(o,i,a,t,n);s[o]=rS.formatParameterValue(e,i,t,n,r)}}return s}static normalizePropertyRef(e){const t=e.replace(/\[\d+\]/g,"");return t.startsWith(".")?t.substring(1):t}static resolvePageClass(e,t){if(!t)return;const n=(e=this.normalizePropertyRef(e)).split(".");let r;r=n.length>1?n.slice(0,-1):n;let a=t;for(const e of r){const t=oC(e,a);if(!t)return;if(Array.isArray(t)&&t[0]?.pageClass?a=t[0].pageClass:!Array.isArray(t)&&t.pageClass&&(a=t.pageClass),!a)return}return a}static isNestedObject(e){return ur(e)&&!Array.isArray(e)}static pruneKeys=(e,t,n=!1)=>{if(!k(e))return e;const r=t instanceof Set?t:new Set(t);return n?(rS.isNestedObject(e)?Object.keys(e).forEach((t=>{const n=e[t];if(r.has(t)){const n=Object.getOwnPropertyDescriptor(e,t);n&&n.configurable?delete e[t]:Reflect.set(e,t,void 0)}else n&&(ur(n)||Array.isArray(n))&&rS.pruneKeys(n,r,!0)})):Array.isArray(e)&&e.forEach((e=>{(ur(e)||Array.isArray(e))&&rS.pruneKeys(e,r,!0)})),e):Array.isArray(e)?e.map((e=>ur(e)||Array.isArray(e)?rS.pruneKeys(e,r,!1):e)):rS.isNestedObject(e)?Object.keys(e).reduce(((t,n)=>{if(!r.has(n)){const a=e[n];t[n]=ur(a)||Array.isArray(a)?rS.pruneKeys(a,r,!1):a}return t}),{}):e}}const aS=rS,sS=Fr.SUMMARY_OF_LISTS,oS=Fr.SUMMARY_OF_WHEN_CONDITIONS;class iS{static updateData(e){Object.keys(e).forEach((t=>{VC(gS({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{VC(gS({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${oS}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){const n=this.resolveName(e,t);return EC("string"==typeof n?n:"")}static resolveView(e,t,n=""){const r=mC(this.resolveName(e,t));let a=[];if(Array.isArray(r)&&r.length>0){if(t&&r.length>1){if(n||(n=t.getValue(Fr.CLASS_ID)||""),!n)return;a=r.filter((e=>e[Fr.CLASSID]===n))}return 0===a.length?r[0]:a[0]}return r}static resolveName(e,t){return e&&"string"==typeof e&&e.startsWith("param.")?(e=e.substring(6),t.getContextDataValue(`.$parameters.${e}`)):(e&&"string"==typeof e&&e.startsWith("@")&&(e=No.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=No.trimAnnotation(t))||"string"==typeof t)?"number"==typeof t&&Number.isInteger(t)?`${e}[${t}]`:"string"==typeof t&&t.startsWith(".")?e+t:t:e}static getRuleClass(e,t,n){let r;if(t)r=t.startsWith(Fr.CLASS_ANNOTATION)?t.split(Fr.CLASS_ANNOTATION)[1].trim():this.resolveClassID(t,e.getPageReference(),e.getContextName(),e.getValue(Fr.CASE_INFO.CASE_INFO_CLASSID));else if(n?.authorContext){const t=e.getFieldMetadata(n.authorContext);if(t){const e=["refer","copy"].includes(t.dataRetrievalType),n="Page List"===t.type;r=e&&n?t.pageClass:t.classID}r||(r=n.ruleClass)}return r}static resolveReference(e,t){const{type:n}=e;let r;if("reference"===n){const{config:n}=e,a=n?.type,{ref:s,name:o,context:i}=n||{},c=this.getRuleClass(t,i,n);return t&&(t._ruleClass=c),"navigation"===a?r=this.resolveNavigation(s||o,t):"view"===a?r=this.resolveView(s||o,t,c||""):"widget"===a&&(r={type:"Widget",config:{name:o,ruleClass:c}}),r}return e}static resolvePropertyReference(e,t,n){return HC(t,e,n)}static getProperty(e,t,n){let r=this.resolvePropertyReference(t,e,n);if(null==r||0===r.length){const a=YC(`${t}.${sS}`,e,n);a&&(r=this.resolvePropertyReference(t,a,n))}return r}static getPropertyValue(e,t,n){return e=No.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=iS.getLitePropertyValue(t,"referencedUsers");if(Array.isArray(n)){const t=n.find((t=>t.UserID===e));if(t)return{userId:t.UserID,UserName:t.UserName}}return n?.[e]}static getLitePropertyValue(e,t){if(!e)return;const{useCustomContext:n,propertyName:r,hasSuggestions:a,pageReference:s,context:o}=e;let i=t||r||"";return n?(i=i.startsWith(".")?i.substring(1):i,i.split(".").reduce(((e,t)=>e?.[t]??void 0),n)):a&&i===r?iS.getPropertyValue(i,s,o?`${o}/${Fr.SUGGESTION}`:void 0):iS.getPropertyValue(i,s,o||void 0)}static _handlePropString(e,t,n,r,a){n.startsWith("@")?e[t]=No.handleAnnotation(n,r,a):e[t]=n}static _resolveProps(e,t,n){e&&Object.keys(e).forEach((r=>{const a=e[r];"string"==typeof a?this._handlePropString(e,r,a,t,n):Array.isArray(a)?a.forEach((r=>{this._resolveProps("object"==typeof r?r:e[r],t,n)})):"object"==typeof a&&this._resolveProps(e[r],t,n)}))}static resolveProps(e,t,n){return e&&t?(aS.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(aS.mergeDeep(e,t),this._resolveProps(t,void 0,e),aS.resolveStringBooleans(t)):t}static resolvePropertyPageClass(e,t){const n=aS.resolvePageClass(e,t),r=e.substring(e.lastIndexOf(".")+1),a=oC(r,n);let s;if(a)return s=Array.isArray(a)?a[0]?.pageClass:a.pageClass,s}static resolveClassID(e,t,n,r){const a=No.trimAnnotation(e);let s=a.startsWith(".")?`${t}${a}`:a;for(;s;){const e=HC(Fr.CLASS_ID,s,n);if(e)return e;if(r){const e=this.resolvePropertyPageClass(a,r);if(e)return e}const t=s.lastIndexOf(".");if(-1===t)break;s=s.substring(0,t)}return null}}const cS=iS;const lS=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}},dS=lS;const uS=class{static#f=[];static#g=!1;static getActionHandlers=(e,t,n)=>{const r=[];return{mouseenter:"hover",change:"onChange",blur:"onBlur"}[n]!==t||e.forEach((e=>{const t=dS.getHandler(e.action),{config:n}=e;r.push({handler:t,config:n})})),r};static isEditable=e=>{const{tagName:t}=e;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t||"DATETIME"===t};static isNonKeyInput=e=>{const{tagName:t,type:n}=e;return"SELECT"===t||"checkbox"===n||"radio"===n};static#m=(e,t,n)=>{for(let r=0;r<e.length;r+=1){const a=e[r],s={actionHandler:a.handler,component:t,eventType:n,config:a.config};this.#f.push(s)}};static buildActionObject=(e,t)=>{const n={...e};return n.context="Browser"===PA.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=Th.getNextActionMgrId(),n};static#y=e=>{const t=e.actionHandler,n=e.component,{config:r}=e,a={};cS.resolveProps(r,a,n),t&&(t(e.eventType,a,n),this.#E())};static#E=()=>{if(!this.#g){if(0===this.#f.length)return;const e=this.#f.shift();if(!e)return;this.#y(e),e.config&&"true"===e.config.parallel&&this.#f.length>0&&this.#E()}};static#I=()=>{this.#E()};static#A=(e,t,n)=>{this.#m(e,t,n),this.#I()};static getFullRef=e=>{const t=e.getPageReference(),n=e.getComponentConfig().value;return cS.getContextPath(t,n)};static#C(e,t){const n=e.getComponentConfig().behaviours||[];for(let r=0;r<n.length;r+=1){const{behaviour:a,actions:s}=n[r];if(s){const n=this.getActionHandlers(s,a,t);n&&n.length>0&&this.#A(n,e,t)}}}static changeHandler=(e,t)=>{const n=e.getStateProps().value,r=e.getContextName();ou({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,property:n,pageReference:e.getPageReference(),context:r});if(!("Browser"===PA.getRuntime()?"nativeEvent"in t&&t.nativeEvent instanceof Event||t instanceof Event:"nativeEvent"in t&&!!t.nativeEvent||t instanceof Event)&&"value"in t&&(null===t.value||"prop"in t&&void 0!==t.prop)){if("object"==typeof(a=t)&&null!==a){const n=e.getPageReference(),a=e.getStateProps();for(const e of Object.keys(t)){const s=a[e],o=t[e];VC({type:Xr,payload:{reference:cS.getContextPath(n,s),value:o,context:r}}),VC({type:ea,payload:{reference:cS.getContextPath(n,s),value:o,context:r}})}}}else{let n,{target:a}=t;null===a&&t&&"auxiliaryTarget"in t&&t.auxiliaryTarget&&(a=t.auxiliaryTarget),n=void 0===a?"value"in t?t.value:void 0:"value"in a?a.value:a.innerText;const s=this.getFullRef(e);VC({type:Xr,payload:{reference:s,value:n,context:r}}),void 0!==a&&this.isEditable(a)&&!this.isNonKeyInput(a)||VC({type:ea,payload:{reference:s,pageReference:e.getPageReference(),value:n,context:r,propertyName:e.getComponentConfig().value,classID:e.getValue(Fr.CLASS_ID)}})}var a};static blurHandler=(e,t)=>{let{target:n}=t;null===n&&t&&"auxiliaryTarget"in t&&(n=t.auxiliaryTarget);const{value:r,validationValue:a}=n,s=this.getFullRef(e),o=e.getContextName();n.clearMessages&&ou({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,property:e.getStateProps().value,pageReference:e.getPageReference(),context:o}),this.isEditable(n)&&(e.getValidationApi().validate("validationValue"in n?a:r),e.isInsideList()&&e.getListActions().updateProperty(e.getStateProps().value,r),this.isNonKeyInput(n)||VC({type:ea,payload:{reference:s,pageReference:e.getPageReference(),value:r,context:o,propertyName:e.getComponentConfig().value,classID:e.getValue(Fr.CLASS_ID)}}))};static eventHandler=(e,t)=>{const{type:n}=t;switch(n){case"change":this.changeHandler(e,t);break;case"blur":this.blurHandler(e,t)}n&&this.#C(e,n)};static pause=()=>{this.#g=!0};static resume=()=>{this.#g=!1,this.#E()};static isQueueEmpty=()=>0===this.#f.length;static clearQueue=()=>{this.#f=[]};static getActionsQueue=()=>this.#f;static EVENTS_MAP={click:"onClick",change:"onChange",hover:"onMouseEnter",blur:"onBlur"}},pS="CREATE_WORK",hS=e=>({type:pS,payload:e});const fS=(e,t,n,r,a="")=>{const s=[];Object.keys(e).forEach((o=>{"object"==typeof e[o]&&o.includes("[")?function(e,t,n,r,a,s,o){const i=r.substring(0,r.indexOf("[")),c=r.substring(r.indexOf("[")+1,r.indexOf("]"));let l=t[i];const d=`${aS.trimDotForProperty(a)}.${i}`;o.includes(d)&&Object.hasOwn(l,Mr.getDefaultQualifiedName("pyCount"))&&(l=l.pxResults),Array.isArray(l)&&(l?.splice(+c,1,e[r]),s.push(i),n.add(`${a}.${r}`))}(e,t,n,o,a,s,r):e[o]&&"object"==typeof e[o]?(t[o]||(t[o]=Array.isArray(e[o])?[]:{}),fS(e[o],t[o],n,r,`${a}.${o}`)):t[o]=e[o]})),function(e,t,n){Object.keys(e).forEach((r=>{(Array.isArray(e[r])&&!n.includes(r)||!Array.isArray(e[r])&&!Object.hasOwn(t,r))&&delete e[r]}))}(t,e,s)},gS=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:r=[],propertiesToReArrange:a=[]}=t,{context:s,data:o,isArrayDeepMerge:i,preserveClientChanges:c=!1}=e,l=tI(s,!0),d=BC(s);let u={};if(d&&o){u=JSON.parse(JSON.stringify(d));const e=JSON.parse(JSON.stringify(o));a.length>0&&aS.rearrangeProperties(a,u);const t=new Set;fS(l,u,t,a),((e,t,n)=>{const r=new Set;e.forEach((e=>{e=aS.trimDotForProperty(e);const[a,s,o]=kd(e);if(a&&s&&o&&!r.has(`${a}.${s}`)){const e=aS.getIn(n,`${a}.${s}`)||[];Array.isArray(e)&&e.forEach(((e,n)=>{n!==+o&&aS.setIn(t,`${a}.${s}[${n}]`,e)})),r.add(`${a}.${s}`)}}))})(t,u,e)}!function(e,t){const n=aS.getIn(e,Fr.REFERENCED_USERS);let r;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return r=aS.getIn(t,Fr.REFERENCED_USERS,{}),void aS.setIn(e,Fr.REFERENCED_USERS,{...r,...n});r=aS.getIn(t,Fr.REFERENCED_USERS,[]);const a=new Map;for(const e of[...r,...n])if(a.has(e.UserID)){const t=a.get(e.UserID);a.set(e.UserID,{...t,...e})}else a.set(e.UserID,e);n.length=0;for(const e of a.values())n.push(e)}}(o,d);const p=aS.getIn(e?.data,Fr.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID),h=zy.isExternalObject(p),f=h?{[Fr.OBJECT_INFO.OBJECT_INFO]:{[Fr.CONTENT]:{...u[Fr.OBJECT_INFO.OBJECT_INFO]?.[Fr.CONTENT]}}}:{[Fr.CASE_INFO.CASE_INFO]:{[Fr.CONTENT]:{...u[Fr.CASE_INFO.CASE_INFO]?.[Fr.CONTENT]}}},g=h?Fr.OBJECT_INFO.OBJECT_INFO_CONTENT:Fr.CASE_INFO.CASE_INFO_CONTENT;let m=o;return c?(n.forEach((e=>{const t=`${g}.${e}`;aS.deleteIn(f,t)})),m=XC(o,f,{isArrayDeepMerge:i??!0})):((e,t)=>{const n=QE[e]||{};Object.keys(n).forEach((e=>{aS.hasIn(t,e)&&(n[e].value=aS.getIn(t,e))}))})(s,o),{type:Ca,payload:{...e,data:m,...r.length>0?{propertiesToReplace:r}:null,...a.length>0?{propertiesToReArrange:a}:null}}},mS=e=>({type:"SHOW_HARNESS",payload:e}),yS=e=>({type:ta,payload:e}),ES=e=>({type:na,payload:e}),IS=e=>({type:"ADD_WORK",payload:e}),AS=e=>({type:pa,payload:e}),CS=e=>({type:Ta,payload:e}),SS=e=>({type:Pa,payload:e}),_S=e=>({type:Oa,payload:e}),NS=e=>({type:va,payload:e}),bS=e=>({type:Ra,payload:e}),TS=e=>({type:wa,payload:e}),PS=e=>({type:La,payload:e}),OS=e=>({type:Ma,payload:e}),DS=e=>{const{containerItemID:t}=e;e.suggestionContexts=kI(t);const n=e?.data?.caseInfo?.content,r=Object.keys(n||{}).length>0;return e.propertiesToReplace||(e.propertiesToReplace=r?zy.getPropertiesToReplace(t):[]),{type:Fa,payload:e}},vS=e=>{const{context:t}=e;return{type:oa,payload:{context:t}}},RS=e=>{const{context:t}=e;return{type:ia,payload:{context:t}}},$S=e=>({type:ja,payload:e}),xS=e=>({type:Ua,payload:e}),wS=e=>({type:is,payload:e}),MS=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=MI(n)),e.context=r,e.deleteContext=!eA(n),e.childContainers=FI(n),e.childContainersContexts=jI(n),e.transientItems=tA([...e.childContainersContexts,n]),e.suggestionContexts=kI(n),n===t&&(e.caseID=HC(Fr.CASE_INFO.CASE_INFO_ID,"",t)||HC(Fr.OBJECT_INFO.OBJECT_INFO_ID,"",t),e.RemoteSystemID=HC(Fr.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Da,payload:e}},LS=e=>{const{containerItemID:t}=e;return e.transientItems=tA([...jI(t),t]),{type:xa,payload:e}},US=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:$a,payload:e}},FS=e=>{const{context:t,containerItemID:n}=e;let r=t;if(r||(r=MI(n)),e.context=r,e.childContainers=FI(n),e.childContainersContexts=jI(n),e.transientItems=tA([...e.childContainersContexts,n]),e.suggestionContexts=kI(n),n===t){e.caseID=HC(Fr.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=HC(Fr.CASE_INFO.REMOTESYSTEMID,"",t);const n=HC(Fr.CASE_INFO.CASE_INFO_CLASSNAME,"",t);Vr.isTraditionalRemoteCase(n)&&(e.skipReleaseLockRequest=!0)}return{type:ka,payload:e}},jS=e=>({type:fa,payload:e}),kS=e=>({type:ya,payload:e}),VS=e=>({type:Na,payload:e}),BS=(e,...t)=>(uS.resume(),e(...t)),GS=(e,t,n,r,a)=>({type:ba,payload:{msg:e,err:t,context:n,formFields:r,actionMgrID:a}}),WS=e=>({type:us,payload:e}),HS=e=>({type:ps,payload:e}),qS=e=>({type:hs,payload:e}),YS=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),zS=e=>({type:da,payload:e}),KS=e=>({type:Xr,payload:e}),QS="add",JS="replace",XS=["portal","noPortal","preview","debug","devtool","activeTab","contextParam","lang"];let ZS="",e_="Home",t_="",n_=!0;const r_=e=>(n_=e,n_),a_=()=>n_,s_=(e,t,n)=>bA.getSemanticURL(e,t,n),o_=(e,t)=>bA.getRestEndPoint(e,t),i_=(e,t)=>{let n=an();const r=o_(e,t);return r?(r.restApi?.startsWith("/")||(r.restApi=`/${r.restApi}`),n?.endsWith("/")&&(n=n.substring(0,n.length-1)),r.restApi=n+r.restApi,r):{}},c_=(e,t,n)=>{const{root:r,resources:a}=e,{views:s}=a,{config:o}=r,i=QS;let c="";if(n)c=n;else{const e=s[o.name];let t=e;Array.isArray(e)&&e.length>0&&([t]=e);c=t.config.urlPath}const l=c.match(Nf);if(l){const e=aS.getIn(t,o.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},l_=(e,t)=>{const n=`${e}/${t}`;if(!("EMBED"===PA.getRenderingMode()))return n;const r=bA.getRoutingInfo()?.authServiceAlias;if(!r)return n;const a=encodeURIComponent(r);let s;try{s=new URL(n)}catch{return n}const o=s.pathname.split("/").filter(Boolean),i=o.findIndex((e=>"app"===e.toLowerCase()));if(i<0)return n;"prauth"!==o[i-1]?.toLowerCase()&&o.splice(i,0,"PRAuth");const c=o.findIndex((e=>"app"===e.toLowerCase()))+2;return c!==o.length&&o[c]===a||o.splice(c,0,a),s.pathname=`/${o.join("/")}`,s.toString().replace(/\/$/,"")},d_=(e,t,n,r)=>{let a,s;a=Tf(t)?l_(e,t):e;const o=Tf(n?.pxURLPath||"");o&&(a=`${a}/${o}`);try{s=new URL(a).searchParams,a=a.includes("?")?a.split("?")[0]:a}catch(e){return console.log("Invalid url",e),""}const i=a.split("/"),c=i[i.length-1],l=new URLSearchParams("undefined"==typeof window?"":window.location.search);if($f()?(a=((e,t,n,r,a)=>{const s=bA.getStaticRoutePage(),o=e_?.toLowerCase(),i=s?.toLowerCase(),c=r?.toLowerCase();return i!==o&&c!==o||a.has("noPortal")?e:l_(t,n)})(a,e,t,c,l),bA.setStaticRoutePage("")):c.toLowerCase()!==e_.toLowerCase()||l.has("noPortal")||(a=l_(e,t)),!bA.isDefaultPortal()){const e=bA.getPortalName();l.has("portal")?l.set("portal",e):l.append("portal",e)}s=((e,t,n)=>{for(const[n,r]of t.entries())!e.has(n)&&XS.includes(n)&&e.append(n,r);n&&!e.has("lang")&&e.append("lang",n);const r=bA.getRoutingInfo()?.embedQueryParams;if(r)for(const[t,n]of Object.entries(r))e.has(t)||e.append(t,String(n));return e})(s,l,r);const d=Of(s.toString());return d&&(a+=`?${d}`),a},u_=(e,{urlPathObjParam:t,infoParam:n,optionsParam:r,queryParam:a},s=!1,o)=>{let i,c,l;if(!1===window.PCore.getBehaviorOverride("dynamicSemanticUrl"))return;if(s)i=t,c=n,l=r;else{const{uiResources:n,data:r}=e;({options:l}=e),i=t&&t.pxURLPath&&bf(t.pxURLPath)?c_(n,r,t.pxURLPath):t||c_(n,r),c=bA.getEndPointInfo(i.pxURLPath),i.pxURLPath=c.urlPath}let d=d_(ZS,bA.getApplicationPath(),i,o);const{title:u}=((e,t,n)=>{if(e=(e=>{let t=e.split(" ");return t=t.map((e=>e.charAt(0).toUpperCase()+e.slice(1))),t.join(" ")})(e=e&&""!==e?e:bA.getApplicationName()),n===`${ZS}/${t}/`)return{title:e};const r=new URL(n).pathname.replace(`${t}/`,""),a=r.split("/");return/\d/.test(r)?{title:`${e} - ${a[a.length-1]}`}:{title:`${e} - ${a[0]}`}})(t_,bA.getApplicationPath(),d),p=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(c,{...l,title:u});i?.historyAction===QS?((e,t,n)=>{if("undefined"!=typeof window)try{window.history.pushState(e,t,n),window.scrollTo(0,0)}catch(e){throw new Error("Error- Unable to Add to Browser History")}})(p,u,d):i?.historyAction===JS&&(a&&(d+=`?${a}`),((e,t,n)=>{if("undefined"!=typeof window)try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(p,u,d))},p_=(e,t)=>{let n=null;e.directUrlUpdation&&(n={historyAction:QS,pxURLPath:""},n.pxURLPath=e.semanticURL),u_(e,{urlPathObjParam:n,infoParam:null,optionsParam:null},!1,t)},h_=(e,t)=>{p_(e,t)},f_=(e,t)=>{const n={pxURLPath:e};return d_(ZS,bA.getApplicationPath(),n,t)},g_=e=>{const{uiResources:t}=e;a_()&&(e.directUrlUpdation||(e=>{if(e&&e.root){const{root:t}=e,{resources:n}=e,{views:r}=n,a=t.config,s=a.type,o=a.name;if("VIEW"===s.toUpperCase()){const e=r[o];let t=e;Array.isArray(e)&&e.length>0&&([t]=e);const n=t.config;if(n.type){const e=n.type;return!(!n.urlPath||"PAGE"!==e.toUpperCase())}}return!1}return!1})(t))&&p_(e)},m_=e=>{const t={routeEndpoint:e.routeEndpoint,requestType:e.requestType,payload:e.payload,routeKey:e.routeKey,options:null};return e.options&&(t.options=e.options),t},y_=(e,t,n)=>{const{caseClassName:r,workID:a}=e.payload,{containerName:s,context:o}=t,{RemoteClassGroup:i,RemoteSystemID:c,name:l}=Vr.getRemoteCase(r),d={...e,headers:{RemoteSystemID:c},className:r,isTraditionalRemoteCase:Vr.isTraditionalRemoteCase(r),isRemoteCase:Vr.isRemoteCase(r),action:vs,viewName:jr,gadgetId:zy.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${a}`,containerName:s,name:l};VC(u.showPage(d))};let E_=!1;const I_=async e=>{if(E_)return void(E_=!1);const t=(e=>"ui-navigation"===e.state?.type?(gu.publish(Ur.PUB_SUB_EVENTS.URL_NAVIGATION,e.state),null):e.state?e.state.stateObj:null)(e);if(t){const e=hA(),n=$I(`${e}/primary`);if(n&&zI(n)){const e=$A().getLocaleValue(ZE,"Messages");if(!await Zm.confirm(e))return E_=!0,void window.history.go(1)}Vr.isRemoteCase(t.payload?.caseClassName)?y_({...t},t.options):VC(u.showHistory(m_(t)))}},A_=()=>bA.getApplicationPath()!==CA(),C_=e=>{const{acName:t,context:n,defaultViewLabel:r,ruleName:a,className:s}=e,o=((e,t)=>{const n=bA.getRoutingInfo();if($f()&&Object.values(n?.routes??{}).find((n=>n?.payload?.pageClass===t&&n?.payload?.page===e)))return e;const r=e.split(" ").join(""),a=e.split(" ").join("-").toLowerCase(),s=(e=>{const t=e.replace(/(?=[A-Z][a-z])/g,"-").toLowerCase();return t.startsWith("-")?t.substring(1):t})(e);return n?.routes?.[r]?r:n?.routes?.[a]?a:n?.routes?.[s]?s:e})(a||r,s);(e=>{e_=e})(o),bA.setDefaultRoute(o),bA.setDefaultClassName(s);const i=Hr(t,n),c=js(t,n),l=(()=>{const e=PA.getIsExtraCallRequiredForDefaultHome();return!0===e||"true"===e})(),d={historyAction:JS,pxURLPath:""};let p,h=null;const f={acName:c,context:i,actionConfig:{context:i}};if(l||!l&&A_()){const t=vf(SA());PA.shouldUseURLParams()&&(h=t.includes("?")?t.split("?")[1]:null),p=Rf(t,f),d.pxURLPath=p.urlPath,void 0!==p.payload?.pageClass&&(p.payload.pageClass=kC()?.getState()?.data?.app?.pyPortal?.classID);const n="showHistory",r={routeEndpoint:p.routeEndpoint,requestType:p.requestType,payload:p.payload,options:f,routeKey:p.routeKey};g=p?.payload?.caseClassName,g&&Vr.isRemoteCase(g)&&(Vr.isTraditionalRemoteCase(g)||Vr.isRemoteCaseVersionDifferent(g))?y_(r,e,f.context):VC(u[n](m_(r)))}else p=bA.getEndPointInfo(e_),d.pxURLPath="";var g;u_(null,{urlPathObjParam:d,infoParam:p,optionsParam:f,queryParam:h},!0)},S_=(e,t=!1)=>{var n;ZS=e.domain,!1===t&&a_()&&(n=I_,"undefined"!=typeof window&&window.addEventListener("popstate",(e=>n(e))),"undefined"!=typeof window&&(window.onbeforeunload=()=>null)),bA.init(e,e_)},__=e=>{(e=>{"undefined"!=typeof window&&(window.document.title=e)})(e)},N_=e=>{for(const t of e)XS.includes(t)||XS.push(t)};var b_=Symbol.for("immer-nothing"),T_=Symbol.for("immer-draftable"),P_=Symbol.for("immer-state");function O_(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var D_=Object,v_=D_.getPrototypeOf,R_="constructor",$_="prototype",x_="configurable",w_="enumerable",M_="writable",L_="value",U_=e=>!!e&&!!e[P_];function F_(e){return!!e&&(V_(e)||Y_(e)||!!e[T_]||!!e[R_]?.[T_]||z_(e)||K_(e))}var j_=D_[$_][R_].toString(),k_=new WeakMap;function V_(e){if(!e||!Q_(e))return!1;const t=v_(e);if(null===t||t===D_[$_])return!0;const n=D_.hasOwnProperty.call(t,R_)&&t[R_];if(n===Object)return!0;if(!J_(n))return!1;let r=k_.get(n);return void 0===r&&(r=Function.toString.call(n),k_.set(n,r)),r===j_}function B_(e,t,n=!0){if(0===G_(e)){(n?Reflect.ownKeys(e):D_.keys(e)).forEach((n=>{t(n,e[n],e)}))}else e.forEach(((n,r)=>t(r,n,e)))}function G_(e){const t=e[P_];return t?t.type_:Y_(e)?1:z_(e)?2:K_(e)?3:0}var W_=(e,t,n=G_(e))=>2===n?e.has(t):D_[$_].hasOwnProperty.call(e,t),H_=(e,t,n=G_(e))=>2===n?e.get(t):e[t],q_=(e,t,n,r=G_(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n};var Y_=Array.isArray,z_=e=>e instanceof Map,K_=e=>e instanceof Set,Q_=e=>"object"==typeof e,J_=e=>"function"==typeof e,X_=e=>"boolean"==typeof e;var Z_=e=>e.copy_||e.base_,eN=e=>e.modified_?e.copy_:e.base_;function tN(e,t){if(z_(e))return new Map(e);if(K_(e))return new Set(e);if(Y_(e))return Array[$_].slice.call(e);const n=V_(e);if(!0===t||"class_only"===t&&!n){const t=D_.getOwnPropertyDescriptors(e);delete t[P_];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const a=n[r],s=t[a];!1===s[M_]&&(s[M_]=!0,s[x_]=!0),(s.get||s.set)&&(t[a]={[x_]:!0,[M_]:!0,[w_]:s[w_],[L_]:e[a]})}return D_.create(v_(e),t)}{const t=v_(e);if(null!==t&&n)return{...e};const r=D_.create(t);return D_.assign(r,e)}}function nN(e,t=!1){return aN(e)||U_(e)||!F_(e)||(G_(e)>1&&D_.defineProperties(e,{set:rN,add:rN,clear:rN,delete:rN}),D_.freeze(e),t&&B_(e,((e,t)=>{nN(t,!0)}),!1)),e}var rN={[L_]:function(){O_(2)}};function aN(e){return null===e||!Q_(e)||D_.isFrozen(e)}var sN="MapSet",oN="Patches",iN="ArrayMethods",cN={};function lN(e){const t=cN[e];return t||O_(0),t}var dN,uN=e=>!!cN[e];var pN=()=>dN;function hN(e,t){t&&(e.patchPlugin_=lN(oN),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fN(e){gN(e),e.drafts_.forEach(yN),e.drafts_=null}function gN(e){e===dN&&(dN=e.parent_)}var mN=e=>dN={drafts_:[],parent_:dN,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:uN(sN)?lN(sN):void 0,arrayMethodsPlugin_:uN(iN)?lN(iN):void 0};function yN(e){const t=e[P_];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function EN(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[P_].modified_&&(fN(t),O_(4)),F_(e)&&(e=IN(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[P_].base_,e,t)}else e=IN(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&nN(t,n)}(t,e,!0),fN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==b_?e:void 0}function IN(e,t){if(aN(t))return t;const n=t[P_];if(!n){return TN(t,e.handledSet_,e)}if(!CN(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;){t.pop()(e)}NN(n,e)}return n.copy_}function AN(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var CN=(e,t)=>e.scope_===t,SN=[];function _N(e,t,n,r){const a=Z_(e),s=e.type_;if(void 0!==r){if(H_(a,r,s)===t)return void q_(a,r,n,s)}if(!e.draftLocations_){const t=e.draftLocations_=new Map;B_(a,((e,n)=>{if(U_(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}}))}const o=e.draftLocations_.get(t)??SN;for(const e of o)q_(a,e,n,s)}function NN(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const r=n.getPath(e);r&&n.generatePatches_(e,r,t)}AN(e)}}function bN(e,t,n){const{scope_:r}=e;if(U_(n)){const a=n[P_];CN(a,r)&&a.callbacks_.push((function(){$N(e);const r=eN(a);_N(e,n,r,t)}))}else F_(n)&&e.callbacks_.push((function(){const a=Z_(e);3===e.type_?a.has(n)&&TN(n,r.handledSet_,r):H_(a,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&TN(H_(e.copy_,t,e.type_),r.handledSet_,r)}))}function TN(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||U_(e)||t.has(e)||!F_(e)||aN(e)||(t.add(e),B_(e,((r,a)=>{if(U_(a)){const t=a[P_];if(CN(t,n)){const n=eN(t);q_(e,r,n,e.type_),AN(t)}}else F_(a)&&TN(a,t,n)}))),e}var PN={get(e,t){if(t===P_)return e;let n=e.scope_.arrayMethodsPlugin_;const r=1===e.type_&&"string"==typeof t;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const a=Z_(e);if(!W_(a,t,e.type_))return function(e,t,n){const r=vN(t,n);return r?L_ in r?r[L_]:r.get?.call(e.draft_):void 0}(e,a,t);const s=a[t];if(e.finalized_||!F_(s))return s;if(r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return s;if(s===DN(e.base_,t)||function(e,t,n){if(1!==e.type_||!e.allIndicesReassigned_||e.assigned_?.get(t)||!F_(n)||n[P_])return!1;return e.baseRefs_.has(n)}(e,t,s)){$N(e);const n=1===e.type_?+t:t,r=xN(e.scope_,s,e,n);return e.copy_[n]=r}return s},has:(e,t)=>t in Z_(e),ownKeys:e=>Reflect.ownKeys(Z_(e)),set(e,t,n){const r=vN(Z_(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=DN(Z_(e),t),o=r?.[P_];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(((a=n)===(s=r)?0!==a||1/a==1/s:a!=a&&s!=s)&&(void 0!==n||W_(e.base_,t,e.type_)))return!0;$N(e),RN(e)}var a,s;return e.copy_[t]===n&&(void 0!==n||W_(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),bN(e,t,n)),!0},deleteProperty:(e,t)=>($N(e),void 0!==DN(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),RN(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Z_(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[M_]:!0,[x_]:1!==e.type_||"length"!==t,[w_]:r[w_],[L_]:n[t]}:r},defineProperty(){O_(11)},getPrototypeOf:e=>v_(e.base_),setPrototypeOf(){O_(12)}},ON={};for(let e in PN){let t=PN[e];ON[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function DN(e,t){const n=e[P_];return(n?Z_(n):e)[t]}function vN(e,t){if(!(t in e))return;let n=v_(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=v_(n)}}function RN(e){e.modified_||(e.modified_=!0,e.parent_&&RN(e.parent_))}function $N(e){e.copy_||(e.assigned_=new Map,e.copy_=tN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}ON.deleteProperty=function(e,t){return ON.set.call(this,e,t,void 0)},ON.set=function(e,t,n){return PN.set.call(this,e[0],t,n,e[0])};function xN(e,t,n,r){const[a,s]=z_(t)?lN(sN).proxyMap_(t,n):K_(t)?lN(sN).proxySet_(t,n):function(e,t){const n=Y_(e),r={type_:n?1:0,scope_:t?t.scope_:pN(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=r,s=PN;n&&(a=[r],s=ON);const{revoke:o,proxy:i}=Proxy.revocable(a,s);return r.draft_=i,r.revoke_=o,[i,r]}(t,n);return(n?.scope_??pN()).drafts_.push(a),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&void 0!==r?function(e,t,n){e.callbacks_.push((function(r){const a=t;if(!a||!CN(a,r))return;r.mapSetPlugin_?.fixSetContents(a);const s=eN(a);_N(e,a.draft_??a,s,n),NN(a,r)}))}(n,s,r):s.callbacks_.push((function(e){e.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:t}=e;s.modified_&&t&&t.generatePatches_(s,[],e)})),a}function wN(e){if(!F_(e)||aN(e))return e;const t=e[P_];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=tN(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=tN(e,!0);return B_(n,((e,t)=>{q_(n,e,wN(t))}),r),t&&(t.finalized_=!1),n}globalThis.Iterator;var MN=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(J_(e)&&!J_(t)){const n=t;t=e;const r=this;return function(e=n,...a){return r.produce(e,(e=>t.call(this,e,...a)))}}let r;if(J_(t)||O_(6),void 0===n||J_(n)||O_(7),F_(e)){const a=mN(this),s=xN(a,e,void 0);let o=!0;try{r=t(s),o=!1}finally{o?fN(a):gN(a)}return hN(a,n),EN(r,a)}if(!e||!Q_(e)){if(r=t(e),void 0===r&&(r=e),r===b_&&(r=void 0),this.autoFreeze_&&nN(r,!0),n){const t=[],a=[];lN(oN).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:a}),n(t,a)}return r}O_(1)},this.produceWithPatches=(e,t)=>{if(J_(e))return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},X_(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),X_(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),X_(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){F_(e)||O_(8),U_(e)&&(e=function(e){U_(e)||O_(10);return wN(e)}(e));const t=mN(this),n=xN(t,e,void 0);return n[P_].isManual_=!0,gN(t),n}finishDraft(e,t){const n=e&&e[P_];n&&n.isManual_||O_(9);const{scope_:r}=n;return hN(r,t),EN(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=lN(oN).applyPatches_;return U_(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},LN=MN.produce;function UN(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var FN=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),jN=()=>Math.random().toString(36).substring(7).split("").join("."),kN={INIT:`@@redux/INIT${jN()}`,REPLACE:`@@redux/REPLACE${jN()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${jN()}`};function VN(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function BN(e,t,n){if("function"!=typeof e)throw new Error(UN(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(UN(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(UN(1));return n(BN)(e,t)}let r=e,a=t,s=new Map,o=s,i=0,c=!1;function l(){o===s&&(o=new Map,s.forEach(((e,t)=>{o.set(t,e)})))}function d(){if(c)throw new Error(UN(3));return a}function u(e){if("function"!=typeof e)throw new Error(UN(4));if(c)throw new Error(UN(5));let t=!0;l();const n=i++;return o.set(n,e),function(){if(t){if(c)throw new Error(UN(6));t=!1,l(),o.delete(n),s=null}}}function p(e){if(!VN(e))throw new Error(UN(7));if(void 0===e.type)throw new Error(UN(8));if("string"!=typeof e.type)throw new Error(UN(17));if(c)throw new Error(UN(9));try{c=!0,a=r(a,e)}finally{c=!1}return(s=o).forEach((e=>{e()})),e}p({type:kN.INIT});return{dispatch:p,subscribe:u,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw new Error(UN(10));r=e,p({type:kN.REPLACE})},[FN]:function(){const e=u;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(UN(11));function n(){const e=t;e.next&&e.next(d())}n();return{unsubscribe:e(n)}},[FN](){return this}}}}}function GN(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const a=t[r];0,"function"==typeof e[a]&&(n[a]=e[a])}const r=Object.keys(n);let a;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:kN.INIT}))throw new Error(UN(12));if(void 0===n(void 0,{type:kN.PROBE_UNKNOWN_ACTION()}))throw new Error(UN(13))}))}(n)}catch(e){a=e}return function(e={},t){if(a)throw a;let s=!1;const o={};for(let a=0;a<r.length;a++){const i=r[a],c=n[i],l=e[i],d=c(l,t);if(void 0===d){t&&t.type;throw new Error(UN(14))}o[i]=d,s=s||d!==l}return s=s||r.length!==Object.keys(e).length,s?o:e}}function WN(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function HN(e){return({dispatch:t,getState:n})=>r=>a=>"function"==typeof a?a(t,n,e):r(a)}var qN=HN(),YN=HN,zN="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?WN:WN.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function KN(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(sb(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return VN(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var QN=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function JN(e){return F_(e)?LN(e,(()=>{})):e}var XN="RTK_autoBatch",ZN=e=>t=>{setTimeout(t,e)},eb=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let a=!0,s=!1,o=!1;const i=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?(l=window.requestAnimationFrame,d=100,e=>{let t=!1;const n=()=>{t||(t=!0,cancelAnimationFrame(r),clearTimeout(a),e())},r=l(n),a=setTimeout(n,d)}):ZN(10):"callback"===e.type?e.queueNotification:ZN(e.timeout);var l,d;const u=()=>{o=!1,s&&(s=!1,i.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>a&&e()));return i.add(e),()=>{t(),i.delete(e)}},dispatch(e){try{return a=!e?.meta?.[XN],s=!a,s&&(o||(o=!0,c(u))),r.dispatch(e)}finally{a=!0}}})};function tb(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:a=!0}=e??{};let s=new QN;return t&&("boolean"==typeof t?s.push(qN):s.push(YN(t.extraArgument))),s},{reducer:n,middleware:r,devTools:a=!0,duplicateMiddlewareCheck:s=!0,preloadedState:o,enhancers:i}=e||{};let c,l;if("function"==typeof n)c=n;else{if(!VN(n))throw new Error(sb(1));c=GN(n)}l="function"==typeof r?r(t):t();let d=WN;a&&(d=zN({trace:!1,..."object"==typeof a&&a}));const u=function(...e){return t=>(n,r)=>{const a=t(n,r);let s=()=>{throw new Error(UN(15))};const o={getState:a.getState,dispatch:(e,...t)=>s(e,...t)},i=e.map((e=>e(o)));return s=WN(...i)(a.dispatch),{...a,dispatch:s}}}(...l),p=(e=>function(t){const{autoBatch:n=!0}=t??{};let r=new QN(e);return n&&r.push(eb("object"==typeof n?n:void 0)),r})(u);return BN(c,o,d(..."function"==typeof i?i(p):p()))}function nb(e){const t={},n=[];let r;const a={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(sb(28));if(r in t)throw new Error(sb(29));return t[r]=n,a},addAsyncThunk:(e,r)=>(r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),a),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),a),addDefaultCase:e=>(r=e,a)};return e(a),[t,n,r]}function rb(e,t){let n,[r,a,s]=nb(t);if("function"==typeof e)n=()=>JN(e());else{const t=JN(e);n=()=>t}function o(e=n(),t){let o=[r[t.type],...a.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===o.filter((e=>!!e)).length&&(o=[s]),o.reduce(((e,n)=>{if(n){if(U_(e)){const r=n(e,t);return void 0===r?e:r}if(F_(e))return LN(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return o.getInitialState=n,o}var{assign:ab}=Object;function sb(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const ob=e=>{let t=new Set,n=t;const r=()=>{t===n&&(t=new Set(t))},a=e=>{let n=!0;return r(),t.add(e),()=>{n&&(r(),t.delete(e),n=!1)}},s=()=>{const e=Array.from(t);n=t,e.forEach((e=>e()))};return(...t)=>{const n=e(...t);let r=!1,o=!1;const i=e=>Array.isArray(e)?e.map(i):n.dispatch(e);return n.subscribe((()=>{o?r=!0:s()})),{...n,dispatch:e=>{const t=o;t||(r=!1,o=!0);const n=i(e),a=r&&!t;return t||(r=!1,o=!1),a&&s(),n},subscribe:a}}},ib=(e,t)=>{const{data:{shared:n={}}={},context:r}=t;((e,t)=>{og.updateDataPageStore(t),Object.keys(t).forEach((n=>{aS.getIn(e,[Fr.SHARED,n])?Object.keys(t[n]).forEach((r=>{aS.setIn(e,[Fr.SHARED,n,r],t[n][r])})):aS.setIn(e,[Fr.SHARED,n],t[n])}))})(e,n),r&&aS.deleteIn(e,[r,"shared"])},cb=(e,t,n=!1)=>{const{context:r,caseViewMode:a=(n?void 0:Fr.PERFORM_MODE),containerName:s}=t;s!==mI.WORKAREA&&a&&aS.setIn(e,[r,"context_data","caseViewMode"],a)},lb=(e,t)=>{const{context:n}=t;aS.setIn(e,[n,"context_data","actionType"],t.actionType),aS.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},db=e=>null!==e&&"object"==typeof e,ub=(e,t=[])=>{t.forEach((t=>aS.deleteIn(e,t)))},pb=(e,t=[])=>{t.forEach((t=>aS.deleteIn(e,t)))},hb=(e,t=[])=>{t.forEach((t=>{aS.deleteIn(e,t)}))},fb=(e,t,n={})=>{const{deleteAssignmentSpecificResources:r=!0,doDeleteConfirmationDetails:a=!0,skipMergeAssignmentsAndActions:s=!0}=n;aS.deleteIn(e,[t,"nextAssignmentInfo"]),s&&(aS.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"availableActions"]),aS.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"availableProcesses"]),aS.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"assignments"])),aS.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"activeActionID"]),aS.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"childCases"]),a&&(aS.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"confirmationLinks"]),aS.deleteIn(e,[t,"caseMessages"])),r&&(aS.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"actionButtons"]),aS.deleteIn(e,[t,Fr.CASE_INFO.CASE_INFO,"navigation"]))},gb=rb({},(e=>{e.addCase(Oa,((e,t)=>{if(!t.payload.data||e[t.payload.context])return;t.payload.doDeleteCaseSummary&&fb(e,t.payload.context);const{target:n}=t.payload;n&&(n.includes(Fr.WORKAREA)||n.includes(Fr.MODAL))?e[t.payload.context]=t.payload.data:e[t.payload.containerItemID]=t.payload.data,cb(e,t.payload),lb(e,t.payload),ib(e,t.payload),((e,t)=>{const{context:n}=t;aS.deleteIn(e,[n,"context_data","blocking_action_counter"]),aS.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload)})).addCase(Fa,((e,t)=>{t.payload.doDeleteCaseSummary&&fb(e,t.payload.context,{deleteAssignmentSpecificResources:t.payload.deleteAssignmentSpecificResources});const{target:n,propertiesToReplace:r=[]}=t.payload;if(n&&(n.includes(Fr.WORKAREA)||n.includes(Fr.MODAL))){const n=e[t.payload.context];db(n)&&(e[t.payload.context]=XC(n,t.payload.data,{propertiesToReplace:[...r]}))}else{const n=e[t.payload.containerItemID];db(n)&&(e[t.payload.containerItemID]=XC(n,t.payload.data,{propertiesToReplace:[...r]}))}(t.payload.actionType||t.payload.assignmentID)&&lb(e,t.payload),cb(e,t.payload),ib(e,t.payload),pb(e,t.payload.suggestionContexts)})).addCase(Da,((e,t)=>{const{childContainersContexts:n=[]}=t.payload;((e,t)=>{const{containerItemID:n,context:r,deleteContext:a}=t;a&&aS.deleteIn(e,[r]),aS.deleteIn(e,[n])})(e,t.payload),hb(e,n),ub(e,t.payload.transientItems),pb(e,t.payload.suggestionContexts)})).addCase(Pa,((e,t)=>{const{containerItems:n}=t.payload;Array.isArray(n)?n.forEach((t=>{aS.deleteIn(e,[t])})):aS.deleteIn(e,[n])})).addCase(ja,((e,t)=>{const{context:n,contextToBeRemoved:r,data:a,childContainersContextsToBeRemoved:s}=t.payload;fb(e,t.payload.context),cb(e,t.payload);const o=e[n],i=e[r];if(!db(o)||!db(i))return;const c=XC(o,i);db(c)&&(e[n]=XC(c,a),aS.deleteIn(e,[r]),hb(e,s),ib(e,t.payload))})).addCase(ka,((e,t)=>{const{context:n,pulseReplace:r=!0,childContainersContexts:a=[]}=t.payload;let{data:s}=t.payload;const o=aS.getIn(e[n],"pulse");let i=aS.getIn(e[n],"OperatorID"),c=aS.getIn(e[n],"pxRequestor");c&&s.pxRequestor&&(c=aS.mergeDeep(c,s.pxRequestor)),i&&s.OperatorID&&(i=aS.mergeDeep(i,s.OperatorID)),!r&&o&&(s=ZC(s,"pulse",o),s=ZC(s,"OperatorID",i),s=ZC(s,"pxRequestor",c)),aS.setIn(e,n,s),cb(e,t.payload),ib(e,t.payload),hb(e,a),ub(e,t.payload.transientItems),pb(e,t.payload.suggestionContexts)})).addCase(fs,((e,t)=>{const{context:n,doDeleteConfirmationDetails:r=!0,skipMergeAssignmentsAndActions:a=!0}=t.payload;fb(e,n,{doDeleteConfirmationDetails:r,skipMergeAssignmentsAndActions:a})})).addCase(va,((e,t)=>{const{transientItemID:n,data:r}=t.payload;aS.setIn(e,n,r)})).addCase($a,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>aS.deleteIn(e,t)))})).addCase(xa,((e,t)=>{const{transientItems:n}=t.payload;n.forEach((t=>aS.deleteIn(e,t)))})).addCase(Ra,((e,t)=>{const{transientItemID:n,data:r}=t.payload;XC(aS.getIn(e,n),r)})).addCase(wa,((e,t)=>{const{transientItemID:n,data:r}=t.payload;XC(aS.getIn(e,n),r)})).addCase(Ma,((e,t)=>{const{transientItemID:n,data:r}=t.payload;Object.keys(r??{}).forEach((t=>{aS.deleteIn(e,[n,t])}))})).addCase(La,((e,t)=>{const{transientItemID:n,data:r}=t.payload;aS.deleteIn(e,n),aS.setIn(e,n,r)})).addCase(da,((e,t)=>{const{key:n,value:r}=t.payload;aS.setIn(e,`${Fr.SHARED}.${n}`,r)})).addCase(Ga,((e,t)=>{const{context:n,data:r}=t.payload;return aS.setIn(e,n,r)}))}));function mb(e){if("object"==typeof e&&null!==e&&"payload"in e&&"object"==typeof e.payload&&null!==e.payload){const t=e.payload.context;return"string"==typeof t?t:void 0}}const yb=KN(ms),Eb=rb({},(e=>{e.addCase(Ca,((e,t)=>{const{propertiesToReplace:n=[],propertiesToReArrange:r=[],uiRootReference:a="",interestPath:s}=t.payload,o=a&&"string"==typeof t.payload.context?`${t.payload.context}.${a}`:t.payload.context,i="string"==typeof o?FC(o):[],c={isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n],propertiesToReArrange:[...r]};if(a&&i.length)aS.setIn(e,i,XC(aS.getIn(e,i),aS.getIn(t.payload.data,FC(a)),c));else if(s){const a=aS.getIn(e[t.payload.context],s),o=aS.getIn(t.payload.data,s),i=XC(a,o,{isArrayDeepMerge:!0}),c=aS.getIn(t.payload.data.context_data,s);JC(e[t.payload.context],[...n],[...r]),aS.setIn(e[t.payload.context],s,i),e[t.payload.context]&&c&&aS.setIn(e[t.payload.context].context_data,s,XC(aS.getIn(e[t.payload.context].context_data,s),c,{isArrayDeepMerge:!0}))}else e[t.payload.context]=XC(e[t.payload.context],t.payload.data,c);cb(e,t.payload,!0),ib(e,t.payload)})).addCase(Xr,((e,t)=>{const{context:n,reference:r,value:a,isArrayDeepMerge:s}=t.payload;ZC(e[n],r,a,{isArrayDeepMerge:s})})).addCase(Zr,((e,t)=>{const{context:n,reference:r,value:a}=t.payload;eS(e[n],r,a)})).addCase(Sa,((e,t)=>{KC(e[t.payload.context],t.payload.reference)})).addCase(oa,((e,t)=>{aS.setIn(e[t.payload.context],"context_data.isLoading",!0)})).addCase(ia,((e,t)=>{aS.setIn(e[t.payload.context],"context_data.isLoading",!1)})).addCase(ca,((e,t)=>{const n=mb(t);n&&(e[n]||(e[n]={}),aS.setIn(e[n],"context_data.isOffline",!0))})).addCase(la,((e,t)=>{const n=mb(t);n&&(e[n]||(e[n]={}),aS.setIn(e[n],"context_data.isOffline",!1))})).addCase(us,((e,t)=>{const{data:n}=t.payload;ib(e,{data:{shared:n}})})).addCase(ps,((e,t)=>{const{dataPagesToBeRemoved:n=[]}=t.payload;n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:r}=t;aS.deleteIn(e.shared,[n,r]);const a=aS.getIn(e.shared,[n]);a&&0===Object.keys(a).length&&aS.deleteIn(e.shared,[n])}))})).addCase(gs,((e,t)=>{const n=aS.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);t.payload.isInitiateBlockingAction?aS.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):aS.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1)})).addCase(yb,((e,t)=>{e.locale=aS.getIn(t.payload,"locale","")}))})),Ib=/\[(\d+)\]$/gi,Ab=/(\d+)/gi,Cb=/\[\d+\]$/,Sb=(e,t,n,r=[Fr.CONTEXT_DATA,Fr.CASE_INFO.CASE_INFO,Fr.CONTENT])=>{const a=aS.getIn(t,r);if(a){const t=cu(a,[],[]);for(const a of t)aS.setIn(e[n],[...r,...a],{})}},_b=(e,t,n,r)=>{const{property:a,pageReference:s,category:o,type:i,subType:c}=r.payload,l=aS.getIn(e[t],n);if(l&&o===Fr.CASEMESSAGES)aS.setIn(e[t],tu(a,s,o),"");else if(l&&l.length>0&&Array.isArray(l)){let r;r=c?l.filter((e=>!(e.type===i&&e.subType===c))):l.filter((e=>e.type!==i)),n&&n.length>0&&aS.setIn(e[t],tu(a,s,o),r)}},Nb=(e,t)=>{const{property:n,pageReference:r,category:a,isListEntry:s,deletingIndex:o,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return Sb(e,i,c),e;const l=tu(n,r,a,s);if(Number.isInteger(o)){aS.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=aS.getIn(e[c],t)||{};const r=(d=Object.keys(n),[...d].sort(((e,t)=>{const n=e.match(Ib),r=t.match(Ib);if(!n&&!r)return e.localeCompare(t);if(!n&&r)return-1;if(n?.length&&r?.length){const e=n[0].match(Ab),t=r[0].match(Ab);if(e?.length&&t?.length)return parseInt(e[0],10)-parseInt(t[0],10)}return 1})));n=r.map((e=>n[e])),n.forEach(((n,a)=>{const s=r[a].match(Ib);if(s?.length){const i=parseInt(s[0].match(Ab)[0],10);i>o&&(aS.deleteIn(e[c],t.concat(r[a])),aS.setIn(e[c],t.concat(r[a].replace(Cb,`[${i-1}]`)),n))}}))}else aS.setIn(e[c],l,{});var d;return e};function bb(e,t){const n=aS.getIn(e,t);return void 0!==n?.dataInfo?.content}const Tb=(e,t)=>{const n=aS.getIn(e,t);return!0===zy.isObjectCaseType(n?.objectInfo?.objectTypeID)};function Pb(e,t){let n=eu.FIELD_MESSAGES_PATH;return bb(e,t)?n=eu.DATA_OBJECT_FIELD_MESSAGES_PATH:Tb(e,t)&&(n=eu.OBJECT_FIELD_MESSAGES_PATH),n}const Ob=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const r=aS.getIn(n,Fr.ERROR_FIELD_IN_PAGE).slice(1),a=aS.getIn(n,Fr.ERROR_IN_PAGE_IDENTIFIER).slice(1);if(a){let s="caseInfo.content";bb(e,t)?s="dataInfo.content":Tb(e,t)&&(s="objectInfo.content");let o=r?`${s}.${r}`:s;o=o.replace(/\(/g,"[").replace(/\)/g,"]");const i=tu(a,o,Fr.PROPERTY),c=aS.getIn(e[t],`${o}.classID`),l=oC(a,c),d=PA.getLocale()??"en-US",u=new nm(d,l?.localeReference),p={type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...l?.label&&{fieldLabel:u.getLocalizedText(l.label)}},h=aS.getIn(e[t],i,[]);if(aS.isContains(h,p))return;aS.setIn(e[t],i,[...h,p])}})(e,t,n)}))};function Db(e,t){const{err:n,formFields:r}=t.payload;let{context:a}=t.payload;const{fieldErrors:s,pageErrors:o}=((e,t)=>{const n=new Map(t.map(((e,t)=>[e,t]))),r=e=>n.get((e=>{const t=(e.erroneousInputOutputFieldInPage||"").replace(/^\./,""),n=(e.erroneousInputOutputIdentifier||"").replace(/^\./,"");return t?`${t}.${n}`:n})(e))??Number.MAX_SAFE_INTEGER,a=e.slice().sort(((e,t)=>r(e)-r(t))),s=[],o=[];for(const e of a)ly(e,t,s,o);return{fieldErrors:o,pageErrors:s}})(n.errorDetails,r),i=Pb(e,a);if(aS.setIn(e,[a,...i],{}),aS.setIn(e,[a,...eu.PAGE_MESSAGES_PATH],[]),s.forEach((t=>{const n=aS.getIn(t,Fr.ERROR_FIELD_IN_PAGE);if(n){const t=n.slice(1);if(t){const n=function(e){let t=null;const n=e.lastIndexOf(".");return n<0?null:(t=e.substring(0,n),t?`caseInfo.content.${t}`.replace(/\(/g,"[").replace(/\)/g,"]"):t)}(t);if(!n)return!1;const r=t.substring(t.lastIndexOf(".")+1),s=tu(r,n,Fr.PROPERTY);aS.setIn(e,[a,...s],[])}}})),s.length>0&&Ob(e,a,s),o.length>0){const t=(e=>{const t=[];return e.forEach((e=>{const n=e.erroneousInputOutputFieldInPage?.replace(/^\./,"");t.push({type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue,...n&&{fieldInPage:n}})})),t})(o);e[a]||(a=Fr.APP.APP),aS.setIn(e,[a,...eu.PAGE_MESSAGES_PATH],t)}else a.includes&&a.includes(mI.WORKAREA)&&(a=Wr(a)),aS.deleteIn(e,[a,...eu.PAGE_MESSAGES_PATH]);return e}const vb=rb({},(e=>{e.addCase(ba,((e,t)=>t.payload.err.errorDetails&&(t.payload.err.errorClassification===Ur.VALIDATION_FAIL||t.payload.err.errorClassification===Ur.INVALID_INPUTS||(t.payload.err?.displayButtonsOnErrors?.length??0)>0)?Db(e,t):e)).addCase(Fa,((e,t)=>{const{context:n}=t.payload,r=[n,...Pb(e,n)],a=[n,...eu.PAGE_MESSAGES_PATH];if(aS.setIn(e,r,{}),aS.setIn(e,a,[]),n&&n.includes(mI.WORKAREA)){const t=[Qr(n),...eu.PAGE_MESSAGES_PATH];aS.setIn(e,t,[])}})).addCase(cs,((e,t)=>{const{isListEntry:n,clearAll:r,context:a}=t.payload;return r?(aS.deleteIn(e,[a,Fr.CONTEXT_DATA]),e):n?Nb(e,t):((e,t)=>{const{property:n,pageReference:r,category:a,isListEntry:s,stateObj:o}=t.payload,{context:i}=t.payload;let c=i;if(o)return Sb(e,o,i),e;const l=tu(n,r,a,s);return a===Fr.PAGE&&i?.includes(mI.WORKAREA)&&(c=Wr(i)),_b(e,c,l,t),_b(e,i,l,t),e})(e,t)})).addCase(is,((e,t)=>{const{messages:n,property:r,pageReference:a,context:s,category:o}=t.payload,i=tu(r,a,o);n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&aS.setIn(e[s],tu(r,a,o),n)}))})),Rb=(e,t,n,r,a)=>{aS.setIn(e[t],[...n,r],a)},$b=[Eb,gb,vb,rb({},(e=>{e.addCase(hs,((e,t)=>{const{instruction:n,actions:r,context:a,referenceList:s,listIndex:o,groupIndex:i,listMoveToIndex:c,content:l={}}=t.payload,d=FC(s);switch(n){case Fr.LIST_ACTIONS.ADD:Rb(e,a,d,i,l);break;case Fr.LIST_ACTIONS.INSERT:Rb(e,a,d,o,l);break;case Fr.LIST_ACTIONS.UPDATE:((e,t,n,r,a)=>{const s=XC(aS.getIn(e[t],[...n,r],{}),a);aS.setIn(e[t],[...n,r],s)})(e,a,d,o??i,l);break;case Fr.LIST_ACTIONS.DELETE:((e,t,n,r,a)=>{const s=aS.getIn(e[t],n,[]);"string"==typeof r?delete s[r]:s.splice(r,1),aS.setIn(e[t],n,s),Zd.deleteListNode(t,[a],s.length)})(e,a,d,o??i,s);break;case Fr.LIST_ACTIONS.MOVE:((e,t,n,r,a)=>{const s=aS.getIn(e[t],[...n,r],{}),o=aS.getIn(e[t],n,[]);o.splice(r,1),o.splice(a,0,s),aS.setIn(e[t],n,o),au(e,t,n?.join("."),r,a)})(e,a,d,o,c);break;case Fr.LIST_ACTIONS_TYPE.SELECT_DESELECT:((e,t,n,r)=>{const a=aS.getIn(e[t],n)||[];r.forEach((e=>{const{instruction:r,content:s,listIndex:o}=e;if(r===Fr.LIST_ACTIONS.SELECT){a[o]=s;const e=n?.join(".");gp(t,e)}else delete a[o]})),aS.setIn(e[t],n,a.filter(Boolean))})(e,a,d,r);break;case Fr.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{aS.setIn(e[t],n,[])})(e,a,d);break;case Fr.LIST_ACTIONS.REPLACE:((e,t,n,r)=>{aS.setIn(e[t],n,r)})(e,a,d,l);break;case Fr.LIST_ACTIONS.DELETEPAGE:((e,t,n)=>{aS.setIn(e[t],n,{})})(e,a,d)}}))}))],xb=(e,t)=>(e||(e=jb().data),t.type===ls?jb().data:($b.forEach((n=>{e=n(e,t)})),e)),wb={},Mb=(e,t=[])=>{t.forEach((t=>{aS.deleteIn(e,[t])}))},Lb=(e,t)=>{const{type:n,payload:r}=t,a=n===Fa,{target:s,context:o,semanticURL:i="",root:c,containerItemID:l,childContainers:d,flowName:u,resourceType:p="",key:h="",clearView:f=!1}=r;return c?aS.setIn(e,[s,"items",l,"view"],c):f&&aS.deleteIn(e,[s,"items",l,"view"]),o&&aS.setIn(e,[s,"items",l,"context"],o),u&&aS.setIn(e,[s,"items",l,"flowName"],u),(!a||a&&h)&&aS.setIn(e,[s,"items",l,"key"],h.trim()),((e,t,n,r)=>{""===e&&aS.deleteIn(t,[n,"items",r,"key"])})(h,e,s,l),(!a||a&&i)&&aS.setIn(e,[s,"items",l,"semanticURL"],i),(!a||a&&p)&&aS.setIn(e,[s,"items",l,"resourceType"],p),Mb(e,d),e},Ub=rb(wb,(e=>{e.addCase(ls,(()=>wb)).addCase(Ta,((e,t)=>{const{context:n,name:r,type:a,actionMgrID:s}=t.payload,o=`${n}/${r}`;if(Th.resolveActionByID(s,null,!1),e[o])return e;aS.setIn(e,[o],{type:a,accessedOrder:[],items:{}})})).addCase(Ba,((e,t)=>{const{containerName:n,childContainers:r=[]}=t.payload;aS.deleteIn(e,[n]),r.forEach((t=>{aS.deleteIn(e,[t])}))})).addCase(Pa,((e,t)=>{const{context:n,name:r,actionMgrID:a,childContainers:s}=t.payload,o=`${n}/${r}`;Th.resolveActionByID(a,null,!1),aS.setIn(e,[o,"accessedOrder"],[]),aS.setIn(e,[o,"items"],{}),Array.isArray(s)&&s.forEach((t=>{aS.deleteIn(e,[t])}))})).addCase(Oa,((e,t)=>{const{target:n,context:r,isInCreateStage:a,isBulkAction:s,semanticURL:o,root:i,containerItemID:c,actionMgrID:l,key:d,flowName:u,resourceType:p,actionName:h,isMinimizable:f,showProgress:g,progressMessage:m,modalOptions:y,resourceStatus:E,actionID:I,isMultiRecordData:A,acTertiary:C,parentContext:S,heading:_,isTraditionalRemoteCase:N,readOnly:b,referenceList:T,subscriptName:P,subscriptFieldName:O,pageGroupName:D,isPageGroup:v,index:R,isDeleteConfirmation:$,workId:x,caseTypeID:w,className:M,keys:L,enableBackNavigation:U}=t.payload,F=e[n],j=F&&F.type,k=F&&F.accessedOrder||[],V=F&&F.items||{};if(e[n]&&"single"===j&&k.length>0)return Lb(e,t);const B={accessedOrder:[...k,c],items:{...V,[c]:{view:i,semanticURL:o,key:d,flowName:u,readOnly:b,context:r,isInCreateStage:a,resourceType:p,actionName:h,isMinimizable:f,...s&&{isBulkAction:s},showProgress:g,progressMessage:m,modalOptions:y,isTraditionalRemoteCase:N,resourceStatus:E,referenceList:T,subscriptName:P,subscriptFieldName:O,pageGroupName:D,isPageGroup:v,index:R,...I&&{actionID:I},...C&&{acTertiary:C},...A&&{isMultiRecordData:A},...S&&{parentContext:S},...$&&{isDeleteConfirmation:$,workId:x,caseTypeID:w,className:M,keys:L,enableBackNavigation:U},heading:_}}};Th.resolveActionByID(l,null,!1),e[n]=Rr(e[n],B)})).addCase(Fa,((e,t)=>{const{actionMgrID:n,data:r}=t.payload;try{Lb(e,t),Th.resolveActionByID(n,r,!1)}catch{Th.rejectActionByID(n,!1)}})).addCase(ka,((e,t)=>((e,t)=>{const{actionMgrID:n,data:r,target:a,containerItemID:s}=t.payload;let o=e;try{const i=e&&e[a]?.type;let c=e&&e[a]?.accessedOrder||[];c="single"===i?c.length>0?c:[...c,s]:c.includes(s)?c:[...c,s],aS.setIn(e,[a,"items",s,"transientItems"],[]),aS.setIn(e,[a,"accessedOrder"],c),o=Lb(e,t),Th.resolveActionByID(n,r,!1)}catch{Th.rejectActionByID(n,!1)}return o})(e,t))).addCase(Ua,((e,t)=>{const{target:n,containerItemID:r,actionMgrID:a}=t.payload;try{const t=aS.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));t.push(r),aS.setIn(e,[n,"accessedOrder"],t),Th.resolveActionByID(a,null,!1)}catch{Th.rejectActionByID(a,!1)}})).addCase(ja,((e,t)=>{const{target:n,containerItemID:r,actionMgrID:a,childContainers:s}=t.payload;try{const t=aS.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));aS.setIn(e,[n,"accessedOrder"],t),aS.deleteIn(e,[n,"items",r]),Mb(e,s),Th.resolveActionByID(a,null,!1)}catch{Th.rejectActionByID(a,!1)}})).addCase(Da,((e,t)=>{const{target:n,containerItemID:r,actionMgrID:a,childContainers:s}=t.payload;try{const t=aS.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));aS.setIn(e,[n,"accessedOrder"],t),aS.deleteIn(e,[n,"items",r]),Mb(e,s),Th.resolveActionByID(a,null,!1)}catch{Th.rejectActionByID(a,!1)}})).addCase(va,((e,t)=>{const{transientItemID:n,target:r,contextName:a}=t.payload,s=aS.getIn(e,[r,"items",a,"transientItems"])??[];aS.setIn(e,[r,"items",a,"transientItems"],[...s,n])})).addCase(xa,((e,t)=>{const{target:n,containerItemID:r}=t.payload;aS.deleteIn(e,[n,"items",r,"transientItems"])})).addCase($a,((e,t)=>{const{target:n,transientItemID:r,containerItemID:a}=t.payload,s=(aS.getIn(e,[n,"items",a,"transientItems"])??[]).filter((e=>e!==r));aS.setIn(e,[n,"items",a,"transientItems"],s)}))}));let Fb={};const jb=()=>Fb,kb=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,r=n[Fr.CONTEXT_DATA]||e[Fr.CONTEXT_DATA];Fb={data:{locale:PA.getLocale(),[Fr.APP.APP]:{...t,[Fr.CONTEXT_DATA]:r}},containers:{}}})(e),{data:xb,containers:Ub}),Vb=(e,t=!1)=>e===Fr.ACTION?t?Ng.REFRESH_CASE_DATA:Ng.REFRESH_ASSIGNMENT_DATA:Ng.REFRESH_CASE_VIEW,Bb=(e,t,n)=>{const r=[];t&&n&&r.push({page:t,actionID:n});let a=e;for(;a;){const e=cS.getPropertyValue(Fr.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,"",a);if(!e?.isMultiRecordData||e.editType!==Fr.ACTION||!e.interestPage||!e.interestPageActionID)break;e.interestPage!==t&&r.unshift({page:e.interestPage,actionID:e.interestPageActionID}),a=e.parentContext}return r},Gb=e=>{const{context:t}=e;let n={...ay(t).content,contextData:!1};const r=Py(t);aS.isEmpty(r)||(n=Ty(r,n));const a=Vb(e.editType,e.isLocalAction),{restApi:s,reqType:o}=i_(a,{ID:e.isLocalAction||e.editType!==Fr.ACTION?e.ID:e.assignmentID,actionID:e.actionID,viewID:e.viewID});let i=s;return e.editType===Fr.ACTION&&(i+=`?operation=${e.operationFlag}`,n.interestPageActionID=e.interestPageActionID,PA.getFeatureMap()?.pyEnableOptimisationForEmbedTable&&(n.actionIdArrayToBeProcessed=Bb(t,e.interestPage,e.interestPageActionID))),n.interestPage=e.interestPage,wd(Wu(i,{method:o,body:n,headers:e.headers},t)).pipe(Xh((t=>({actionInPayload:e,response:t.data,headers:ry(t.headers)}))),hf(": Error occurred during ajax call : ",t))},Wb={},{VIEW:Hb,FIELD:qb}=Fr.CONTEXT_TREE_NODE_TYPES,Yb=(e,t,n)=>{const r=t.value.data[n]?.objectInfo?.headers,a=t.value.data[n]?.caseInfo?.headers;return!zy.shouldUseUnifiedHandling()&&e&&r?r:a},zb=e=>Mu[e]>0&&Wb[e],Kb=(e,t)=>{const{caseWideAction:n,caseViewAction:r,fieldsWithDeclarativeTargets:a,fieldsWithWhen:s,isViewsWithWhen:o,interestPage:i,options:c,isMultiRecordData:l,editType:d,isLocalAction:u,interestPageActionID:p,context:h}=e,{optionalPayload:f}=c;f&&(t.content={...f});let g={},m={...t},y=Ng.REFRESH;if(r||l&&d===Fr.ACTION){const t=Vb(d,u);l&&d===Fr.ACTION&&(m.interestPageActionID=p,PA.getFeatureMap()?.pyEnableOptimisationForEmbedTable&&(m.actionIdArrayToBeProcessed=Bb(h))),g=i_(t,e),m={...m,interestPage:i}}else o?g=((e,t)=>{const{isObjectType:n,isExternalObject:r,actionID:a,context:s,isExternalCase:o,casetypeID:i}=e,c=Fr.getDefaultQualifiedName(Fr.VIEW_NAMES.OBJECT_CREATE_VIEW);if(t||n&&EE(s)){let t=r&&a===c?Ng.REFRESH_EXTERNAL_OBJECT:Ng.REFRESH_CASE_DATA;const n=zy.shouldUseUnifiedHandling();return r&&a===c&&n&&(t=Ng.REFRESH_EXTERNAL_CASE_DATA),i_(t,e)}return i_(o&&i&&a===c?Ng.REFRESH_EXTERNAL_CASE_DATA:Ng.REFRESH_ASSIGNMENT_DATA,e)})(e,n):(a.length>0||s.length>0)&&({restAPI:g,requestBody:m,requestType:y}=((e,t,n,r,a)=>(a={...a,calculations:{fields:t,whens:n}},{restAPI:i_(r?Ng.RECALCULATE_CASE_DATA:Ng.RECALCULATE_ASSIGNMENT_DATA,e),requestBody:a,requestType:Ng.RECALCULATE}))(e,a,s,n,m));return{restAPI:g,requestBody:m,requestType:y}},Qb=[(e,t)=>e.pipe(df(Ng.REFRESH_DATA,Ps),Xh((e=>e.payload)),cf((e=>!Jm(e?.options?.actionMgrID))),Zh((e=>{const{context:n,contextData:r,options:a,isObjectType:s}=e,{propertyName:o="",classID:i="",isObjectWideAction:c,skipPayloadGeneration:l}=a,d=l?{content:{}}:ay(n,{skipUUID:!1,isObjectWideAction:c});let u=[],p=[],h=!1;PA.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:u=[],whens:p=[]}=NE(n)),h=p.some((e=>e.type===Hb))):h=!0;const f=p.filter((e=>e.type===qb)),g=aS.getPropertyName(o),m=g?g.split("."):[],y=m.pop(),E=m.join("."),I=[];E&&((e,t,n,r,a)=>{const s=oC(e,t);if(!s||"copy"!==s.dataRetrievalType)return;const o=aS.getIn(n,`content.content.${e}`);if(!o||"object"!=typeof o)return;(r?Object.keys(o).filter((e=>e!==r)):Object.keys(o)).length>0&&a.push(e)})(E,i,d,y,I),e.serverPrecedenceFields=I;let A={...d.content,contextData:r};const C=Py(n);aS.isEmpty(C)||(A=Ty(C,A));const S=Kb({...e,fieldsWithDeclarativeTargets:u,fieldsWithWhen:f,isViewsWithWhen:h},A);$g.registerBlockingAction(n).catch((()=>{}));const{restAPI:_,requestBody:N,requestType:b}=S;(e={...e,requestType:b}).requestType=b;const{reqType:T,restApi:P}=_,O={...Yb(s,t,n)};O&&!O.etag&&e.isMultiRecordData&&e.editType===Fr.ACTION&&(O.etag=aS.getETag(e.context));return wd(((e,t)=>{const{context:n}=e;(e=>{const{reqHeaders:t}=e;t&&(e.headers=e.headers||{},t.etag&&(e.headers["if-match"]=t.etag))})(e);const r=(e=>{const{ID:t,actionID:n,context:r}=e;return`${t}.${r}.${n}`})(t);if(t.interestPage&&(e.interestPage=t.interestPage),zb(r)){const t=[];for(let n=0;n<Wb[r].length;){const a=Wb[r][n],s=_E(a,e);if("CANCEL_REFRESH"===s){const e=new Error;return e.code="ERR_CANCELED",Promise.reject(e)}!0===s&&(t.push(n),a.cancelConfig?.cancel()),n+=1}t.forEach((e=>{Wb[r].splice(e,1)}))}const a=Yu();return e.signal=a.token,e.cancelConfig=a,Wb[r]?Wb[r].push(e):Wb[r]=[e],gu.publish(Ur.PUB_SUB_EVENTS.ON_REFRESH_START,{context:n}),Wu(e.url,e,n,{cancelContext:r}).then((e=>(delete Wb[r],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete Wb[r],e}))})({reqHeaders:O,context:n,method:T,body:N,url:CE(e,P)},e)).pipe(Xh((t=>{const r=((e,t,n)=>{const r=zy.shouldUseUnifiedHandling(),a=zy.isObjectCaseType(t)||n;if(r||!a)return e;const s=aS.getIn(e?.data,Ur.OBJECT_INFO.OBJECT_INFO_CONTENT_CLASS_ID);return zy.isExternalObject(s)?e:Lr.transformCaseData(e)})(t?.data,a?.classID,s);return a?.resetForm&&Zd.removeContextTreeNode(n),{response:{...r},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:ry(t.headers)}})),hf(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),Zh((async e=>{if(e&&e.type===ba)return $g.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),"ERR_CANCELED"===e.payload?.err?.code?[]:(gu.publish(Fr.ON_REFRESH_ERROR,{context:e.payload?.context}),dy(e));const{actionConfig:t,response:n,actionMgrID:r}=e,{context:a,serverPrecedenceFields:s,requestType:o}=t,i=Oh.getTargetViewContainerName(Wa),c=js(i,a),l={acName:c,context:a},d=sm(n,{[Ur.STOPMERGEACTIONS]:!0,[Ur.ACTIONS.DELETEAVIALACTIONS]:!0});d.directUrlUpdation=!1,o===Ng.REFRESH&&await oy(d,t,l);const u=sy(d,{target:c,context:a});t.interestPage&&(u.interestPath=`caseInfo.content${aS.convertClipboardPageToPageRefNotation(t.interestPage)}`),u.isArrayDeepMerge=t.options?.isArrayDeepMerge,u.preserveClientChanges=void 0===t.options?.preserveClientChanges||t.options.preserveClientChanges;const p=zy.getPropertiesToReArrange(a),h=BS(gS,u,{serverPrecedenceFields:s,propertiesToReArrange:p}),f=h.payload?.data?.pageInstructions;return f?.length>0&&(delete h.payload?.data?.pageInstructions,Ry.mergeServerPageInstructions(a,f)),VC(h),Th.resolveActionByID(r,u),gu.publish(Ur.PUB_SUB_EVENTS.ON_REFRESH_COMPLETE,{context:a}),$g.deRegisterBlockingAction(a).catch((()=>{})),[]})))],Jb=[e=>e.pipe(df(ds),Zh((async e=>{const{context:t}=e.payload,n={},r={},a=Object.keys(e.payload.datapages).map((a=>{const s=e.payload.datapages[a];if(s.mode===Fr.READONLY&&s?.refreshStrategy){const{timeoutSecs:e="",type:t=""}=s?.refreshStrategy||{},n=GC()[s.name];if(n&&a in n){const r=n[a],{loadTime:s}=r;if(!Sf.isTimeElapsed(s,e,t))return}}return Sf.getData(s.name,{dataViewParameters:s.dataViewParameters},t).then((e=>{const t=s.mode===Fr.READONLY?r:n;t[s.name]?t[s.name][a]={pxResults:e.data.data,parameters:s.dataViewParameters,loadTime:e.data?.fetchDateTime}:t[s.name]={[a]:{pxResults:e.data.data,parameters:s.dataViewParameters,loadTime:e.data?.fetchDateTime}}})).catch((()=>{}))}));await Promise.allSettled(a);const s=[];return Object.keys(n).length&&s.push(gS({context:t,data:n})),Object.keys(r).length&&s.push(WS({data:r,context:t})),VC(s),[]})))];class Xb{static OPEN_ASSIGNMENT_ACTION="openAssignment";static DIRTY_POPUP_C11N="displayDirtyPopupFromConstellation";static HANDLE_INFINITY_DISCARD="handleDiscardInInfinity";static OPEN_ASSIGNMENT_MODAL="openAssignmentInModal";static DISPLAY_DIRTY_POPUP="displayDirtyPopup";static LOAD_PREVIEW="loadPreview";static UPDATE_COEXISTENCE_DRILLDOWN_CASE="updateCoexistenceDrilldownCase";static OPEN_WORK_ITEM="openWorkItem";static OPEN_WORK_BY_HANDLE="openWorkByHandle";static GET_NEXT_WORK_ACTION="getNextWork";static CLOSE_CONTAINER_ACTION="closeContainer";static CANCEL_CASE="cancelCase";static CREATE_WORK="createWork";constructor(){this.broadcastChannel=null,this.callback=null,this.isReverseCoexistenceCase=!1,this.broadcastEventToIframe=!1,this.isDirtyDialogActive=!1,this.onCreateCallback=null,this.openAssignmentParams=null}getGlobalObject=()=>n.g;getUniqueId=()=>this.getGlobalObject().uniqueId;setUniqueId=()=>{this.getGlobalObject().uniqueId=(new Date).getTime()};initBroadcastChannel=()=>{this.setUniqueId(),this.broadcastChannel=new BroadcastChannel("coexistence"),this.broadcastChannel.onmessage=e=>{const{uniqueId:t}=e.data;if(t===this.getUniqueId())switch(e.data.action){case Xb.DISPLAY_DIRTY_POPUP:this.displayDirtyPopup(e);break;case Xb.LOAD_PREVIEW:this.loadPreview(e);break;case Xb.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case Xb.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case Xb.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case Xb.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case Xb.CLOSE_CONTAINER_ACTION:this.closeContainer(e);break;case Xb.CANCEL_CASE:this.handleCaseCancel();break;case Xb.CREATE_WORK:this.createWork(e)}}};displayDirtyPopup=e=>{this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?(gu.publish(Fr.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this))};handleCaseCancel=()=>{const e=FI(Ur.APP.APP),t=e[e.length-1],n=$I(t),r=BC(n)?.caseInfo?.ID;if(r&&n&&Cm({}).getPConnect().getActionsApi().getDescendants(r,n),jm(n)){const e=IA(n);e&&Cm({}).getPConnect().getActionsApi().getDescendants(r,e)}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){Cm({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=`${Ur.APP.APP}${Fr.FORWARD_SLASH_STRING}${Ur.PRIMARY}`;if(!0!==VI(e))return;const t=Mr.getDefaultQualifiedName("Data-Portal"),n=Mr.getDefaultQualifiedName("pyHome"),r=Cm({isRoot:!0}),a=PCore.getStore()?.getState().data.app?.pyPortal?.pyPrimaryNavPages;let s;Array.isArray(a)&&a[0]&&(s=a[0]);const o=s?.pyClassName||t,i=s?.pyRuleName||n;r.getPConnect().getActionsApi().showPage(i,o)};closeContainer=e=>{const{uniqueId:t}=e.data;t===this.getUniqueId()&&this.navigateToDefaultPage()};updateCoexistenceDrilldownCase=e=>{const{key:t,caseClassName:n,actionApi:r,caseLabel:a,uniqueId:s}=e.data;if(s!==this.getUniqueId())return;let o=r;r===Xb.OPEN_WORK_ITEM&&(o=Xb.OPEN_WORK_BY_HANDLE),bA.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:o,name:a});Cm({}).getPConnect().getActionsApi().updateRecents(n,t.substring(t.lastIndexOf(" ")+1),a,t)};openAssignment=e=>{const{pzInsKey:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){if(this.onCreateCallback&&this.openAssignmentParams&&(t&&this.openAssignmentParams[0]&&this.openAssignmentParams[0].payload&&this.openAssignmentParams[0].payload.data?this.openAssignmentParams[0].payload.data.caseInfo.assignments[0].ID=t:this.openAssignmentParams[0]&&this.openAssignmentParams[0].payload&&this.openAssignmentParams[0].payload.data&&(this.openAssignmentParams[0].payload.data.caseInfo.content.coexistenceAction="openWorkByHandle"),t)){Cm({}).getPConnect().getActionsApi().openAssignment(t,n,{containerName:Ur.PRIMARY,context:Ur.APP.APP})}this.onCreateCallback=null,this.openAssignmentParams=null}};getNextWork=e=>{const{uniqueId:t}=e.data;if(t===this.getUniqueId()){const e=`${Ur.APP.APP}${Fr.FORWARD_SLASH_STRING}${Ur.PRIMARY}`;Cm({meta:{},options:{context:LI(e)}}).getPConnect().getActionsApi().getNextWork()}};openWorkByHandle=e=>{const{key:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){const e=`${Ur.APP.APP}${Fr.FORWARD_SLASH_STRING}${Ur.PRIMARY}`;Cm({meta:{},options:{context:LI(e)}}).getPConnect().getActionsApi().openWorkByHandle(t,n)}};createWork=e=>{const{strClassName:t,uniqueId:n,strFlowParams:r,caseInitProperties:a}=e.data;if(n===this.getUniqueId()){const e=`${Ur.APP.APP}${Fr.FORWARD_SLASH_STRING}${Ur.PRIMARY}`,n=Cm({meta:{},options:{context:LI(e)}}),s=new URLSearchParams((a+r).slice(1)),o=this.setStartingFields(s);n.getPConnect().getActionsApi().createWork(t,{startingFields:o})}};setStartingFields=e=>{const t={};return e.forEach(((e,n)=>{n&&(t[n]=e)})),t};destroyBroadcastChannel=()=>{this.getBroadCastChannel()?.close(),this.broadcastChannel=null};subscribeEvents=()=>{this.setReverseCoexistenceCaseLoaded(!0),gu.subscribe(Ur.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),gu.subscribe(Ur.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{gu.unsubscribeAllWithEventType(Ur.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),gu.unsubscribeAllWithEventType(Ur.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD),this.setReverseCoexistenceCaseLoaded(!1),this.isDirtyDialogActive=!1};init=(e=!0)=>{null===this.broadcastChannel&&this.initBroadcastChannel(),e&&this.subscribeEvents()};destroy=()=>{this.destroyBroadcastChannel(),this.unsubscribeEvents()};setCallBackFunction=e=>{this.callback=e};setReverseCoexistenceCaseLoaded=e=>{this.isReverseCoexistenceCase=e};setIsDirtyDialogActive=e=>{this.isDirtyDialogActive=e};getBroadCastChannel=()=>this.broadcastChannel;getCallBackFunction=()=>this.callback;isReverseCoexistenceCaseLoaded=()=>this.isReverseCoexistenceCase;postDirtyPopupMessage=({callBackFunction:e})=>{this.broadcastChannel?.postMessage({action:Xb.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:Xb.HANDLE_INFINITY_DISCARD,uniqueId:this.getUniqueId()}),this.broadcastEventToIframe=!1):(this.callback?.call(this),this.callback=null),this.isDirtyDialogActive=!1};postCreateCaseMessage=(e,t,n)=>{null===this.broadcastChannel&&this.init(!1),this.broadcastChannel?.postMessage({action:Xb.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const Zb=new Xb,eT="nextAssignmentInfo",tT="nextAssignmentInfo.context",nT=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Fr.MODAL:t||Oh.getTargetViewContainerName(Qa)},rT=async(e,t)=>{if(VI(e))return{continueExecution:!0,removeActionPayload:{},dirtyCheckPerformed:!1};return{...await my(e,t),dirtyCheckPerformed:!0}},aT=e=>{if(zy.shouldUseUnifiedHandling()&&!PA.isInfinityRuntime())return e?.uiResources?.root?.config?.name===Mr.getDefaultQualifiedName("pzCreateDetails")||!1;const t=aS.getIn(e,[Fr.DATA,Fr.CASE_INFO.CASE_INFO]);return Qy(t)&&Jy(PA.getOperatorIdentifier(),t)},sT=(e,t)=>{const{class:n,context:r,viewType:a=ty.PAGE}=e,{removeActionPayload:s}=t;let o=e?.pageName?e?.pageName:PA.getDefaultCasePage();return e.isTraditionalUICase&&(o=Mr.getDefaultQualifiedName("pyDetails")),wd(Zp.createCase(n,{...e,pageName:o,viewType:a,context:r})).pipe(Xh((({response:t,headers:n})=>(Lr.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:s}))),hf("Error occurred during ajax call at createWork Epic : ",r))},oT=e=>{gu.publish(Fr.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},iT=e=>{gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},cT=e=>{gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_VIEW_OPENED_AFTER_CREATE,e)},lT=e=>{let t,n=0,r=[],a={},s=!1,o=!1;return e.pipe(df(pS),ff(100),Xh((e=>(({actionMgrID:n}=e.payload),e.payload))),Zh((e=>{const{context:r}=e;if(t=e.class,o=!1,zy.isExternalCaseType(t)&&(ou({context:r,stateObj:BC(r),clearContextMessages:!0}),!Gy(r))){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Th.rejectActionByID(n,!0,e),pf()}const a=nT(e),i=js(a,r);return s=Gm(t),wd(rT(i,{loadingContext:r})).pipe(Zh((({continueExecution:t,removeActionPayload:r,dirtyCheckPerformed:a})=>t?(o=a,e.isTraditionalUICase=s,sT(e,{removeActionPayload:r})):(Th.rejectActionByID(n),uf))))})),Zh((async e=>{if(e?.type===ba)return e.payload.context=((e,t)=>zy.isExternalCaseType(e)&&t?t:hA())(t,e.payload.context),r.push(dy(e)),r;const{actionInPayload:i,response:c,headers:l,removeActionPayload:d}=e,u=zy.isExternalCaseType(i.class);let p=aT(c);(i.renderInline||PA.getDefaultCasePage()||s)&&(p=!1),aS.setIn(c.data,Ur.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const h=nT({...i,isInCreateStage:p}),f=js(h,i.context),g=hy(f,h,i.context),{openCaseViewAfterCreate:m}=i;if(!o&&((e,t,n)=>!Pm(e)&&VI(t)&&(n??!0))(h,f,m)){const{continueExecution:e}=await my(f,{loadingContext:i.context});if(!e)return Th.rejectActionByID(n),r}const y=i?.openCaseViewAfterCreate??!0,E=sm(c);if(!y&&!p&&!(e=>BI(e)&&PA.isOpenCasePageAfterCreateInMultiDocEnabled())(f)){const e=Lm(c),{businessID:t,caseType:n,resolvedURL:s,caseTypeName:o}=Uh(c);return a={caseId:t,label:o,href:s},oT(a),iT({caseId:t,assignmentId:e,caseType:n,ID:Mm(E)}),u&&Fm(i),r}const I=String($m(Mm(E)));let A=s_("createWork",{caseClassName:xm(E)});A=A.replace(/{.+?}/,I),E.semanticURL=A,Nh.setComponentCache(I,xu.addDebugHeaders(i.debugInfo)),((e,t)=>{const n=aT(e),{skipBrowserSemanticUrlUpdate:r=!1,isTraditionalUICase:a}=t,s=a&&!Wm();aS.setIn(e,["directUrlUpdation"],(!n||s)&&!r)})(E,i);const C={acName:f,context:g},S=Qm(g);await oy(E,i,C);const _={target:f,context:g,containerItemID:g,headers:l,semanticURL:A,isInCreateStage:p,isMinimizable:p,caseViewMode:E.confirmationNote?Fr.REVIEW_MODE:Fr.PERFORM_MODE,currentCaseViewMode:S,assignmentContext:aS.getIn(E,tT),nextAssignmentInfo:aS.getIn(E,eT),resourceType:Ur.CASE,openCaseViewAfterCreate:i.openCaseViewAfterCreate,modalOptions:i.modalOptions,debugInfo:i.debugInfo};km(_,E);const N=sy(E,_);py(N.data,i.remoteCaseMeta),s&&(delete N.data.caseInfo.actionButtons,N.data.caseInfo.content.coexistenceAction="openAssignment"),zy.setTraditionalGadgetId(N.data);const b=uy(f,N);return fy(b)&&Um(r,{removeActionPayload:d,target:f}),u&&Fm(i),r.push(b),Km(E,_),cT({caseId:I}),r})),Xh((()=>{const e=Wm(),t=Qy(aS.getIn(r[0]?.payload,"data.caseInfo"));return s&&e&&t?Zb.postCreateCaseMessage(r[0]?.payload?.nextAssignmentInfo?.ID,by,r):by(r),Bm(r,n),a={},r=[],r})))},{RESOURCE_TYPES:dT}=Ur,uT=(e,t)=>{const{containerItemID:n,context:r,actionMgrID:a,isInCreateStage:s,isModalAction:o}=t;if(s&&o){const t=bm(n),s=js(t,r);e.push(BS(xS,{containerItemID:n,target:s,actionMgrID:a}))}},pT=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:r,isInCreateStage:a,isProcessAction:s}=t,o=MI(n),i=`${o?.includes("root")?Fr.APP.ROOT:Fr.APP.APP}/${mI.MODAL}`;e.push(BS(MS,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:r,isInCreateStage:a,isProcessAction:s}))},hT=e=>HC(".openCaseViewAfterCreate",Fr.CONTEXT_DATA,e)??!0,fT=async(e,{translatedDXAPIResponse:t,actionInPayload:n},r,a,s)=>{const{caseID:o}=n,i=(c=t,aS.getIn(c,_m.NEXT_ASSIGNMENT_INFO_ID,Fr.EMPTY_STRING));var c;const l=a?$h(t):xm(t),{caseViewMode:d,headers:u,semanticURL:p,actionMgrID:h,directUrlUpdation:f,key:g,flowName:m,resourceType:y}=r,E=QI(n?.context),I=CI(E,n?.context)?.acTertiary;Object.assign(s,{caseId:o,assignmentId:i,caseType:l,isSubmitFromBlendedUI:I}),pT(e,{...n,skipReleaseLockRequest:!0});const A=`${n?.containerItemID.includes("root")?Fr.APP.ROOT:Fr.APP.APP}/${mI.PRIMARY}`,C=hy(A,mI.PRIMARY),S=xu.getCoreHeadersFromContext(n.context)||!1,_=sy(t,{target:A,context:C,containerItemID:C,caseViewMode:d,headers:u,semanticURL:p,key:g,flowName:m,resourceType:y,directUrlUpdation:f,debugInfo:S&&S.debugInfo&&{debugId:S.debugInfo[Fr.COREHEADER_APP_DEBUG_ID]},shouldUpdateCaseActionsInParentContext:!0});if(VI(A)){const t=BC(C),a=Mm({data:t}),[,s]=a?a.split(" "):[],o=`You will lose unsaved changes for ${s}. Do you want to continue?`;if(!hT(n.context))return e;{const{continueExecution:t}=await my(A,{dirtyMessage:o});if(!t)return r.directUrlUpdation=!1,Th.rejectActionByID(h),pf();_.currentCaseViewMode=Qm(_?.context),e.push(BS(FS,_)),n.__deferCaseActionsPayload=_}}else{if(!((e,t)=>BI(e)&&(hT(t)||PA.isOpenCasePageAfterCreateInMultiDocEnabled()))(A,n.context))return e;e.push(BS(_S,_))}return t.directUrlUpdation=f,t.semanticURL=p,await oy(t,{..._,acName:A},{acName:A,context:C}),e},gT=(e,{isModalAction:t,target:n,transientItemID:r})=>{if(t){const t=e.find((({type:e})=>e===ka));t?.payload&&(n=t.payload.target,r=t.payload.containerItemID)}const a=LS({target:n,containerItemID:r});a.payload.transientItems.length&&e.push(a)},mT=e=>/^app\/preview_[0-9]*/g.test(e),yT=(e,t)=>{const n=Wr(e);return!mT(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},ET=e=>{if(!hT(e.context)){let t;const n=e?.caseTypeID,r=e?.caseTypeName;return t=e.businessID?e.businessID:e.workID,{caseID:t,caseTypeID:n,caseTypeName:r}}return{}},IT=(e,t,n,r)=>{const{data:a,caseViewMode:s}=t,o={data:a,caseViewMode:s,context:n};if(aS.setIn(o.data,["context_data","caseViewMode"],s),e.push({type:fs,payload:{context:n}}),r){const t={data:Lr.transformObjectToCase(a),caseViewMode:s,context:n};e.push(BS(gS,t))}e.push(BS(gS,o))},AT=async(e,t,n,r,a,s,o,i,c,l)=>{const{headers:d}=c,u=l?Fr.OBJECT_INFO.OBJECT_INFO:Fr.CASE_INFO.CASE_INFO;if(e){if("object"!=typeof c?.response?.uiResources?.root){const t=(e,t)=>{const n=e.findIndex((e=>e.ID===t));if(-1!==n){const[t]=e.splice(n,1);e.unshift(t)}return e},n=BC(e),r=c?.response?.data?.caseInfo?.assignments??[],a=n?.caseInfo?.assignments??[],s=Qm(e)===Fr.PERFORM_MODE,o=r[0]?.ID!==a[0]?.ID,i=r.length>0&&a.length>0;s&&o&&i&&c?.response?.data?.caseInfo?.assignments&&(c.response.data.caseInfo.assignments=t(r,a[0]?.ID))}const p=VI(QI(e));let h=!1;const f=QI(n),g=II(f),m=$I(f);m&&g?.items?.[m]?.key===c?.actionInPayload?.caseID&&(h=!0),pT(a,{...r,skipReleaseLockRequest:!0});const y=bm(e),E={target:QI(e),containerItemID:e,context:e,containerName:y};t.doDeleteCaseSummary=r.doDeleteCaseSummary;const I=Qr(n),A=BC(I),C=BC(r.context),S=A[u]?.ID,_=C[u]?.ID,N=BC(e)?.caseInfo?.ID;if(p&&S===_||!p&&(""===o||E.containerItemID.includes(Fr.WORKAREA)&&t.caseViewMode===Fr.REVIEW_MODE&&N===t.data?.caseInfo?.ID||!s&&t.root&&0===Object.keys(t.root).length&&N===t.data?.caseInfo?.ID))if((void 0===t?.data[u]?.content||void 0!==t.data[u].content&&"object"==typeof t.data[u].content&&0===Object.keys(t.data[u].content).length)&&(t.root=void 0,delete t.data?.caseMessages),e.includes(Fr.WORKAREA)&&t.caseViewMode===Fr.REVIEW_MODE&&((e,t)=>{const n=e?.assignmentID,r=t?.data?.caseInfo?.assignments??[],a=r[0]?.ID;return n!==a})(r,i)&&(t.flowName=" ",t.clearView=!0,t.root?.config?.name!==Fr.PY_CONFIRM&&(t.root=void 0)),e.includes(Fr.ACTIONAREA))a.push(BS(gS,{...t,key:o,resourceType:"",...E}));else{const e=CI(E.target,E.containerItemID);e?.resourceType!==dT.PAGE&&a.push(BS(DS,{...t,key:o,resourceType:"",...E}))}else if(s){const s=QI(e),i=PI(s,o);if(i)E.target=s,E.context=i,E.containerItemID=i,a.push(BS(DS,{...t,key:o,resourceType:"",...E}));else{const e=FI(n)[0];if(r.target=e,r.context=hy(e,Fr.WORKAREA,n),r?.context){r.containerItemID=r.context,a.push(BS(_S,{...r,...t}));const n=r.containerItemID;a.push(BS(xS,{parentContainerTarget:e,containerItemID:n}))}}}if(r.target=QI(e),r.containerName=bm(e),r.context=e,r.containerItemID=e,r.shouldUpdateCaseActionsInParentContext=!0,aS.setIn(t,"acName",E.target),await oy(i,t),r.__deferCaseActionsPayload=r,h&&(n.includes(Fr.WORKAREA)&&jm(n)&&(n=Qr(n)),IT(a,t,n,l)),!s&&t.caseViewMode===Fr.PERFORM_MODE){const t=((e,t)=>{const n=QI(e);return PI(n,t)})(e,o),n={data:{[u]:{headers:d}},context:t};a.push(BS(gS,n)),a.push(cE(((e,t=!1,n=!1)=>{const r=Th.getNextActionMgrId();return{ID:cS.getPropertyValue(Ur.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:cS.getPropertyValue(Ur.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:r}}})(t)))}}else{pT(a,r);let e=!1;const o=QI(n),i=II(o),d=$I(o);if(d&&i?.items?.[d]?.key===c?.actionInPayload?.caseID&&(e=!0),s){const e=FI(n)[0];r.target=e,r.context=hy(e,Fr.WORKAREA,n),r.containerItemID=r.context,a.push(BS(_S,{...r,...t}));const s=r.containerItemID;a.push(BS(xS,{parentContainerTarget:e,containerItemID:s}))}e&&IT(a,t,n,l)}},CT=async(e,t,n,r,a,s,o)=>{const i=s?"objectInfo":"caseInfo";((e,t,n)=>{if(t.isProcessAction&&(pT(n,{...t,skipReleaseLockRequest:!0}),e)){const r=`${t?.containerItemID.includes("root")?Fr.APP.ROOT:Fr.APP.APP}/${mI.PRIMARY}`,a=hy(r,mI.PRIMARY),s={insKey:e.ID,className:e.content.classID,context:a,acTargetName:Fr.PRIMARY,isChild:!0},o={type:pa,payload:{...s}};n.push(o)}})(e.data[i].parentCaseInfo,t,a);const c=e?.data[i]?.parentCaseInfo?.ID;if(c){const n=QI(t?.context),r=CI(n,t?.context)?.parentContext,a=QI(r);t?.isProcessAction&&bI(a,c)&&gA(r,e?.data[i]?.lastUpdateTime)}n.resourceType=dT.CASE,n.directUrlUpdation=!0,t.isProcessAction||await fT(a,{translatedDXAPIResponse:r,actionInPayload:t},n,s,o)},ST=async(e,t,n,r,a)=>{e.doDeleteCaseSummary=t.doDeleteCaseSummary,e.caseViewMode===Fr.REVIEW_MODE&&(e.flowName=" ",e.clearView=!0);const{containerItemID:s}=t;VI(QI(s))||aS.setIn(e.data,["context_data","caseViewMode"],e.caseViewMode);const o=zy.getPropertiesToReplace(s);a.push(BS(DS,{...e,...r,propertiesToReplace:o})),aS.setIn(e,"acName",r.target),await oy(n,e),((e,t,n)=>{const{containerItemID:r}=t,a=MI(r),{data:s,caseViewMode:o}=n;if(a&&jm(r)){const n=Qr(a),i={data:s,caseViewMode:o,context:n};aS.setIn(i.data,["context_data","caseViewMode"],o),e.push({type:fs,payload:{context:n}});const c=zy.getPropertiesToReplace(r);e.push(BS(gS,i,{propertiesToReplace:c})),t.shouldUpdateCaseActionsInParentContext=!0,t.__deferCaseActionsPayload=t}})(a,t,e)},_T=async(e,t,n,r,a,s,o,i,c,l={})=>{const{isCaseWideAction:d,isInCreateStage:u,containerItemID:p}=e,h=Wr(e.context),f=wm(a,c),g=c?$h(a):xm(a),m=u&&!f&&!d,y=FI(h)[0],E=y?$I(y):h,I=bm(p),A=MI(p),C=Object.freeze({target:e.target,containerItemID:p,context:A,containerName:I});m&&!mT(e.context)?await CT(i,e,t,a,s,c,l):yT(e.context,E)?await AT(E,t,h,e,s,n,r,a,o,c):!d&&!c||yT(e.context,E)?await ST(t,e,a,C,s):(pT(s,e),((e,t,n)=>{const{containerItemID:r,caseID:a}=t;if(r&&/^app\/preview_[0-9]*/g.test(r)){const{caseClassName:t}=n,s=Wr(r),o=MI(s);e.push(BS(yS,{containerItemID:s,context:o,container:mI.PREVIEW,containerName:mI.PREVIEW,caseId:a,viewName:Ur.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(s,e,{caseClassName:g}))},NT=(e,t,n)=>{const{isModalAction:r,isCaseWideAction:a,caseID:s}=t,o=yT(t.context,n),i=e?.data?.caseInfo?.stages,c=e?.data?.caseInfo?.stageID;Tg({caseID:s,isModalAction:r,isModalLaunchedFromPrimaryValue:o,isCaseWideAction:a,stages:i,stageID:c})},bT=e=>{const t=e?.payload?.err?.errorDetails,n=e?.payload?.context;t?.forEach((e=>{e[Fr.ERROR_FIELD_IN_PAGE]=e[Fr.ERROR_FIELD_IN_PAGE].replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`));const t=e[Fr.ERROR_FIELD_IN_PAGE].slice(1),r=e[Fr.ERROR_IN_PAGE_IDENTIFIER],a=r.startsWith(".")?r.slice(1):r;if(a){let s=t?`caseInfo.content.${t}`:"caseInfo.content";s=Fr.getProperty(s.replace(/\(/g,"[").replace(/\)/g,"]"));const o=tu(a,s,Fr.PROPERTY),i={type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};Zd.mutateField(n,s,o[o.length-1],{messages:[i],type:Ur.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:r})}}))},TT=e=>{const t=BC("app")?.pyPortal?.pyPrimaryNavPages,n=Array.isArray(t)?t[0]:null;return n?(vy.clearChangedProperties(e),[{type:na,payload:{className:n.pyClassName,containerName:Fr.PRIMARY,context:Fr.APP.APP,pageReference:"pyPortal",viewName:n.pyRuleName,skipSemanticUrl:""}}]):[]},PT=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Fr.MODAL:t||Oh.getTargetViewContainerName(ws)},OT=e=>e?.uiResources?.root?.config?.name===Mr.getDefaultQualifiedName("pzCreateDetails")||!1,DT=(e,t)=>{const n=OT(e),{skipBrowserSemanticUrlUpdate:r=!1}=t;aS.setIn(e,["directUrlUpdation"],!n&&!r)},vT=e=>e.confirmationNote?Fr.REVIEW_MODE:Fr.PERFORM_MODE,RT=(e,t)=>{let n;return n=!e.renderInline&&!PA.getDefaultCasePage()&&OT(t),n},$T=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Fr.MODAL:t||Oh.getTargetViewContainerName(Us)},xT=(e,t)=>{const{class:n,context:r,viewType:a=ty.PAGE}=e,{removeActionPayload:s}=t,o=e?.pageName?e?.pageName:PA.getDefaultCasePage();return wd(Zp.createCase(n,{...e,pageName:o,viewType:a,context:r,retrieveActionViewForNewObject:!0})).pipe(Xh((({response:t,headers:n})=>(Lr.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:s}))),hf("Error occurred during ajax call at createObject Epic : ",r))},wT="CREATE_EXTERNAL_CASE",MT=e=>{let t=0,n=[],r=!1;return e.pipe(df(wT),ff(100),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>{const{context:n}=e,a=$T(e),s=js(a,n);return r=!1,wd(rT(s,{loadingContext:n})).pipe(Zh((({continueExecution:n,removeActionPayload:a,dirtyCheckPerformed:s})=>n?(r=s,xT(e,{removeActionPayload:a})):(Th.rejectActionByID(t),uf))))})),Zh((async e=>{if(e&&e.type===ba)return e.payload.context=hA(),n.push(dy(e)),n;const{actionInPayload:a,response:s,headers:o,removeActionPayload:i}=e,c=RT(a,s);aS.setIn(s.data,Fr.getProperty(Fr.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const l=$T({...a,isInCreateStage:c}),d=js(l,a.context),u=hy(d,l,a.context);if(!r&&!Pm(l)&&VI(d)){const{continueExecution:e}=await my(d,{loadingContext:a.context});if(!e)return Th.rejectActionByID(t),n}const p=sm(s);let h=s_(Os,{caseClassName:xm(p)});h=h.replace(/{.+?}/,String($m(Mm(p)))),p.semanticURL=h,DT(p,a);const f={acName:d,context:u};await oy(p,a,f);const g={target:d,context:u,headers:o,semanticURL:h,caseViewMode:vT(p),containerItemID:u,isInCreateStage:c,isMinimizable:c,assignmentContext:aS.getIn(p,tT),nextAssignmentInfo:aS.getIn(p,eT),resourceType:Ur.RESOURCE_TYPES.CASE,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo,isExternalCaseCreationFlow:!0};km(g,p);const m=sy(p,g),y=uy(d,m);return fy(y)&&Um(n,{removeActionPayload:i,target:d}),n.push(y),Sy(n),n})),Xh((()=>(by(n),Bm(n,t),n=[],n))))},{RESOURCE_TYPES:LT}=Ur,UT=(e,t={})=>{const{viewType:n,containerName:r,targetContainerName:a,isChild:s}=e,o=Rm(t);return(e=>{if(e){const{stageID:t,stages:n=[]}=e,r=n.length;for(let e=0;e<r;e+=1)if(n[e].ID===t)return"manual"===n[e].transitionType}return!1})(o)&&e?.stageID===o.stageID?ty.PAGE:n||(!Tm(r)&&!Tm(a)||s?ty.PAGE:ty.FORM)},FT=(e,t,n,r,a)=>{if(Um(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=$I(t);let r=null;return n&&(r=CI(t,n)),r?.key===e&&BI(t)})(r.key,n))r.context=LI(n),r.containerItemID=r.context,e.push(BS(FS,r));else if((a?.isChild||a?.isRemote)&&a?.isMultiDoc){const t=QI(a.context);r.target=t,r.context=a.context,r.containerItemID=a.context,e.push(BS(FS,r))}else{const t=QI(r.context),n=PI(t,r.key);n?(r.target=t,r.context=n,r.containerItemID=n,e.push(BS(FS,r))):e.push(BS(_S,r))}},jT=(e,t,n,r,a,s,o)=>{VI(t)&&GI(t)?((e,t,n,r,a)=>{UT(e,t)===ty.FORM?(n.caseViewMode=r||Fr.PERFORM_MODE,a.push(BS(DS,n))):a.push(BS(FS,n))})(r,a,e,s,n):FT(n,o,t,e,r)},kT=(e,t,n)=>{if(!(e&&t&&(e=>{const{inlineViewType:t,caseTypeID:n,RedirectURL:r}=e;if(t&&t.toLowerCase().includes("remote"))return!1;const a=Vr.getRemoteCaseClassBySourceClass(n)??n;return!Vr.isRemoteCase(a)&&!!r})(t)&&t.RedirectURL))return!1;try{const e=new URL(t.RedirectURL);if("https:"===e.protocol)return globalThis.open(e.href,"_blank","noopener,noreferrer"),Th.resolveActionByID(n),!0}catch{}return!1},VT=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:r,context:a,isGetNextWork:s,doNotMergeMessagesForStatusCode:o})=>{const i=zy.appendExcludeQueryParamToUrl(e);return Wu(i,{method:t,headers:{"if-match":n&&n.etag,...n,...r&&{...xu.addDebugHeaders(r)}}},a,{doNotMergeHttpMessagesForStatusCode:s?o:""})},BT=(e,t)=>{const n=UT(e),{headers:r,context:a,assignmentID:s,isGetNextWork:o,debugInfo:i,isOpenStage:c,stageID:l,caseID:d,jsActionQueryParams:u,isLastStepInCreateStage:p}=e;let h,f;({restApi:h,reqType:f}=o?i_("getNextWork",{viewType:n}):c?i_("openStage",{caseID:d,stageID:l}):i_(Ka,{assignmentID:s,viewType:n}));const{removeActionPayload:g}=t,m=PA.getDefaultCasePage();let y="",E=e.pageName;e.isTraditionalUICase&&(E=Mr.getDefaultQualifiedName("pyDetails")),y=m?`${h}?viewType=${n}&pageName=${m}`:E?`${h}?viewType=${n}&pageName=${E}`:`${h}?viewType=${n}`,u&&Object.keys(u).forEach((e=>{y+=`&${e}=${u[e]}`}));const I=(e=>{let t=e?.headers??{};return e?.isRemote&&(t=ry(t,e.remoteClassName)),t})(e);return wd(VT({restUrl:y,reqType:f,requestHeaders:I,debugInfo:i,context:a,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"})).pipe(Xh((e=>{if(PA.isCoexistenceAppOfType(Fr.APP_TYPE.UIKIT)&&!p){return Qy(e.data.data.caseInfo)?e:(y=E?y.replaceAll(E,Mr.getDefaultQualifiedName("pyDetails")):y,PA.setDefaultCasePage(Mr.getDefaultQualifiedName("pyDetails")),{isReloadWithDifferentViewTypeRequired:!0,restUrl:y})}return e})),Zh((e=>e?.isReloadWithDifferentViewTypeRequired?VT({restUrl:y,reqType:f,requestHeaders:I,debugInfo:i,context:a,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"}):nf(e))),Xh((t=>{const{key:a,flowName:o}=cy(s);return Lr.analyseResponse(t),{response:{...t.data,key:a,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:g,headers:ry({...r,...t.headers})}})),hf("Error occurred during ajax call at openAssignment Epic : ",a))},{RESOURCE_TYPES:GT}=Ur,WT=e=>{const t="Browser"===PA.getRuntime();let n=0,r=[];const a=[];let s=!1,o=!1;return e.pipe(df(kh),Xh((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),Zh((e=>{s=e.isGetNextWork;const{context:t}=e;let r;r=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?ty.FORM:UT(e),e.viewType=r;const a=Nm(Ka,e),i=js(a,t),{activate:c,activateContainerActionPayload:l}=Ey(GT.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return nf({type:Ua,activateContainerActionPayload:l,actionInPayload:e});const d=$I(i);let u;return u=l?.isParallelAssignment?Promise.resolve({continueExecution:!0,removeActionPayload:{}}):d?my(i,{loadingContext:t}):Promise.resolve({continueExecution:!0,removeActionPayload:{}}),wd(u).pipe(Zh((({continueExecution:t,removeActionPayload:r})=>t?(o=Gm(e.className),e.isTraditionalUICase=o,PA.isWSSPortal()&&(e.headers={...e.headers,[Fr.X_ORIGIN_CHANNEL]:"WSS"}),BT(e,{removeActionPayload:r})):(Th.rejectActionByID(n),uf))))})),Zh((async e=>{if(e?.type===ba){if(s){const{payload:t}=e,{err:n}=t,r=n.response.status;a.push({status:Number(r)})}return r.push(dy(e)),r}const{type:t,actionInPayload:i,response:c,viewType:l,headers:d,removeActionPayload:u,activateContainerActionPayload:p}=e;if("openStage"===c?.redirectInfo?.jsAction){const e=c?.redirectInfo?.stageID,t=kh,n=c?.data?.caseInfo?.ID;i.isOpenStage=!0,i.stageID=e,i.jsActionQueryParams=c?.redirectInfo?.jsActionQueryParams;const a={type:t,payload:{...i,caseID:n,headers:d}};return r.push(a),r}if(kT(s,c?.data?.caseInfo,n))return r;const{context:h,caseViewMode:f,debugInfo:g}=i,m=c?.data?.caseInfo?.assignments?.find((e=>e.ID===i.assignmentID));i.caseViewMode=((e,t)=>e&&"false"===String(e.canPerform)?Fr.REVIEW_MODE:t??Fr.PERFORM_MODE)(m,f);const y=c?.data?.caseInfo?.caseTypeID;o=Gm(y),i.isTraditionalUICase=o;let E=((e,t)=>{const n=Rm(e);let r;r=!PA.getDefaultCasePage()&&Qy(n);const{isChild:a,containerName:s,isTraditionalUICase:o}=t,i=a&&r,c=r&&!t.isActionFromToDoList;return!i&&!c||o||t.renderInline?s||Nm(Ka,t):Fr.MODAL})(c,i);o&&(E=i.containerName??E);const I=js(E,h);if(t===Ua)return await(async(e,t,n)=>{const{semanticURL:r,containerItemID:a,isParallelAssignment:s,insKey:o}=t,{target:i,actionInPayload:c}=n,{skipBrowserSemanticUrlUpdate:l=!1}=c,d=MI(a);await oy({directUrlUpdation:!l,semanticURL:r},c,{acName:i,target:i,context:d}),e.push(BS(xS,{containerItemID:a,target:i,isParallelAssignment:s,insKey:o,resourceType:LT.CASE,context:d,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(r,p,{actionInPayload:i,target:I}),r;const A=c?.data?.caseInfo?.content,C=c?.data?.caseInfo?.ID,S=c?.uiResources?.root?.config?.name,_=c?.uiResources?.root?.config?.context;A&&!A[Mr.getDefaultQualifiedName("pyViewName")]&&S&&"page"!==i.viewType&&(aS.setIn(A,Mr.getDefaultQualifiedName("pyViewName"),S),aS.setIn(A,Mr.getDefaultQualifiedName("pyViewContext"),_));const N=sm(c);((e,t)=>{const n=Rm(e),r=Mm(e),a=Qy(n),{skipBrowserSemanticUrlUpdate:s=!1,viewType:o,isTraditionalUICase:i}=t,c=i&&!Wm(),l=o===ty.PAGE&&(!a||c)&&!s,{caseTypeID:d}=n;if(l){const t=s_(za,{caseClassName:d}).replace(/{.+?}/,String($m(r)));e.semanticURL=t,e.directUrlUpdation=!0}})(N,i);const b=hy(I,E,h),T={...i.debugInfo,debugId:i.debugInfo?.debugId??xu.getCoreHeadersFromContext(h)?.debugInfo?.[Fr.COREHEADER_APP_DEBUG_ID]};T.debugId&&Nh.setComponentCache(C,xu.addDebugHeaders(T));const P={acName:I,target:I,context:b};await oy(N,i,P);const O={target:I,context:b,containerItemID:b,headers:d,parentContext:Wr(i?.context),isMinimizable:Qy(aS.getIn(N,"data.caseInfo")),doDeleteCaseSummary:i.doDeleteCaseSummary,acTertiary:i.acTertiary,resourceType:Ur.ASSIGNMENT,debugInfo:g,shouldUpdateCaseActionsInParentContext:!0,caseID:C};km(O,N,{skipFlowNameUpdate:i?.caseViewMode===Fr.REVIEW_MODE});const D=sy(N,O);var v;return py(D.data,i.remoteCaseMeta),i.isProcessAction&&(D.data.isProcessAction=i.isProcessAction),((e,t)=>{e&&(delete t.data.caseInfo.actionButtons,t.data.caseInfo.content.coexistenceAction="openAssignment")})(o,D),zy.setTraditionalGadgetId(D.data),((e,t)=>{e.acTertiary&&(t.data.caseInfo.isFirstAssignment=e.acTertiary)})(i,D),D.caseViewMode=i.caseViewMode,jT(D,I,r,i,c,f,u),((e,t)=>{if(e=Vr.getRemoteCaseClassBySourceClass(e)??e,Vr.isRemoteCase(e)){const{RemoteClassName:n,RemoteSystemID:r,name:a}=Vr.getRemoteCase(e);if(t.headers?.RemoteSystemID||Th.setRemoteCaseHeaderByContext(t,r),Vr.isTraditionalRemoteCase(e)||Vr.getRemoteAppPlatformVersion(r)){t.assignmentID=t.assignments?.[0]?.ID;const r={className:e,name:a,action:Ds,remoteClassName:n};Th.setTraditionalRemoteCaseParams(t,r)}}})(y,D.data.caseInfo),l===ty.FORM&&jm(D.containerItemID)&&(D.skipMergeAssignmentsAndActions=!1,Ny(D,r,_)),Km(N,O),v={actionInContext:h,assignmentID:i.assignmentID,caseKey:D.key},gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,v),r})),Xh((()=>{const e=n,t=Wm(),s=Qy(aS.getIn(r[0]?.payload,"data.caseInfo"));return o&&t&&s?Zb.postCreateCaseMessage(r[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,VC,r):VC(r),Bm(r,e,a),r[0]?.payload?.isParallelAssignment&&VC({type:kh,payload:{...r[0].payload,isParallelCall:!0}}),r=[],r})))};const HT=(e,t)=>{const{insKey:n,headers:r,context:a,debugInfo:s,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:PA.getDefaultCasePage(),l=i_(za,{caseID:n,params:{pageName:c}});let{restApi:d}=l;const{reqType:u}=l;return"none"===o&&(d=`${d?.split("viewType")[0]}viewType=none`),d=zy.appendExcludeQueryParamToUrl(d),wd(Wu(d,{method:u,headers:{...r,...s&&{...xu.addDebugHeaders(s)}}},a)).pipe(Xh((t=>(Lr.analyseResponse(t),{response:t.data,actionInPayload:e,headers:ry({...r,...t.headers}),removeActionPayload:i}))),hf("Error occurred during ajax call at openWorkByHandle Epic : ",a))},qT="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:YT}=Ur,zT=async(e,t,n)=>{const r=t?.containerItemID||null,a=r&&FI(r)[0]?$I(FI(r)[0]):r,s=a||r,o=MI(s)||s,i=QI(o)||QI(s),c=o?Qm(o):void 0,l=a?BC(a)?.caseInfo?.ID:void 0,d=e?.insKey;if(!(o&&s&&c===Fr.REVIEW_MODE&&a!==r&&l&&d&&l===d))return;let u;try{u=await(p=HT({...e,context:o,viewType:"none"},{removeActionPayload:void 0}),f="object"==typeof h,new Promise((function(e,t){var n=new cd({next:function(t){e(t),n.unsubscribe()},error:t,complete:function(){f?e(h.defaultValue):t(new vl)}});p.subscribe(n)})))}catch(e){return}var p,h,f;if(!u||Dm(u.type))return;const g=sm(u.response),m=[{path:Fr.CASE_INFO.ASSIGNMENTS,allowMultiple:!0}],y={...g?.data,caseInfo:{...g?.data?.caseInfo??{},assignments:g?.data?.caseInfo?.assignments??[]}};n.push(BS(FS,{containerItemID:s,target:i,context:o,data:y,caseViewMode:Fr.REVIEW_MODE,isArrayDeepMerge:!0,propertiesToReplace:m}))},KT=async(e,t,n)=>{const{actionInPayload:r,activateContainerActionPayload:a,type:s,response:o,removeActionPayload:i,headers:c}=e,{context:l,skipBrowserSemanticUrlUpdate:d,debugInfo:u}=r,p=Nm(za,r),h=js(p,l);if(Om(s))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:r},actionInPayload:a,actionInPayload:{context:s,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=Nm(za,a),l=js(c,s),d=MI(r);await oy({directUrlUpdation:!o,semanticURL:n},a,{acName:l,containerName:c,target:l,context:d}),e.push(BS(xS,{containerItemID:r,target:l,context:d,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:a,actionInPayload:r}),await zT(r,a,t);else{const a=hy(h,p,l,{buildNew:!0}),s=sm(o),f=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:r}=t,a=Mm(e),s=n?r:xm(e);let o=s_(za,{caseClassName:s},{id:t?.insKey});return o=o?.replace("{workID}",String($m(a)))?.replace("{id}",t?.insKey),o})(s,r);s.semanticURL=f,s.directUrlUpdation=!d;const g={acName:h,context:a};await oy(s,r,g);const m=sy(s,{target:h,context:a,containerItemID:a,semanticURL:f,headers:c,debugInfo:u});m.caseViewMode=Fr.REVIEW_MODE,m.resourceType=YT.CASE,py(m.data,r.remoteCaseMeta),n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle",m.data.caseID=m.data.caseInfo.ID),zy.setTraditionalGadgetId(m.data),km(m,s,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=Qm(e?.actionInPayload?.context);const y=uy(h,m);i.containerItemID&&fy(y)&&t.push(BS(MS,{containerItemID:i.containerItemID,target:h})),t.push(y),Km(s,m)}const f=r.insKey;Og({caseKey:f,actionInContext:l})},QT=e=>{let t=0,n=[],r=!1;return e.pipe(df(qT),Xh((e=>(({actionMgrID:t,isAutoRedirection:r=!1}=e.payload),e.payload))),Zh((e=>{const{context:n,isChild:a,viewType:s}=e,o=Nm(za,e),i=js(o,n);let{activate:c,activateContainerActionPayload:l}=Ey(YT.CASE,i,e);const d=VI(i);if(!c&&!d&&e.insKey&&i){const t=((e,t)=>{const n=PI(e,t);if(!n)return null;const r=CI(e,n);if(r?.resourceType!==YT.ASSIGNMENT||"string"!=typeof r?.context||""===r.context)return null;const a="string"==typeof r.semanticURL?r.semanticURL.trim():"";return a?{target:e,containerItemID:n,semanticURL:a,insKey:t}:null})(i,e.insKey);t&&(c=!0,l=t)}const u=c&&!a&&"none"!==s;return wd("none"===s||u?Promise.resolve({continueExecution:!0,removeActionPayload:void 0}):my(i,{loadingContext:n})).pipe(Zh((({continueExecution:n,removeActionPayload:a})=>n?u?(Oy(l),nf({type:Ua,activateContainerActionPayload:l,actionInPayload:e})):(r&&Nh.setComponentCache("redirectionInProgress",!0),HT(e,{removeActionPayload:a})):(Th.rejectActionByID(t),uf))))})),Zh((async e=>{if(e&&Dm(e.type))return n.push(dy(e)),n;const t=BC(e?.actionInPayload?.context),r=Gm(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=sm(e?.response),a={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:fs,payload:{context:a.context,doDeleteConfirmationDetails:!1}}),r&&a.data.caseInfo?.content&&(a.data.caseInfo.content.coexistenceAction="openWorkByHandle",a.data.caseID=a.data.caseInfo.ID),py(a.data,e.actionInPayload.remoteCaseMeta),zy.setTraditionalGadgetId(a.data),n.push(BS(gS,a));const s=QI(e?.actionInPayload?.context),o=bm(e?.actionInPayload?.context),i=Object.freeze({target:s,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:o});if(jm(e?.actionInPayload?.context)){const t=sy(e?.response,{...i});Ny({...t,isArrayDeepMerge:!0},n)}e.actionInPayload.shouldUpdateCaseActionsInParentContext=!0,e.actionInPayload.containerItemID=e?.actionInPayload?.context,e.actionInPayload.caseID=e?.actionInPayload?.insKey,Km(t,e?.actionInPayload)}}else await KT(e,n,r);return n})),Xh((()=>(r&&Nh.setComponentCache("redirectionInProgress",!1),VC(n),Bm(n,t),n=[],n))))},JT="FINISH_ASSIGNMENT",XT=(e,t)=>{const{assignmentID:n,actionID:r,caseID:a,context:s,additionalHeaders:o={},outcome:i,jsActionQueryParams:c,headers:l}=e,{state$:d}=t,u=(e=>{const{isModalAction:t,viewType:n,isInCreateStage:r,isCaseWideAction:a}=e;return t&&r&&!a?ty.PAGE:n||ty.FORM})(e),p=(e=>{const{isCaseWideAction:t,caseTypeID:n}=e;return zy.shouldUseUnifiedHandling()?t||zy.isObjectCaseType(n)?rs:Ja:t?rs:Ja})(e),h={assignmentID:n,actionID:r,caseID:a,viewType:u};let{restApi:f}=i_(p,h);const{reqType:g}=i_(p,h);u&&!f?.includes("viewType=")&&(f=f?.includes("?")?`${f}&viewType=${u}`:`${f}?viewType=${u}`),i&&!f?.includes("outcome")&&(f=f?.includes("?")?`${f}&outcome=${i}`:`${f}?outcome=${i}`),f=oE(c,f),f=zy.appendExcludeQueryParamToUrl(f),e.viewType=u;const{content:m}=ay(s),y=d.value.data[s]?.caseInfo?.headers||{},{etag:E}=y,I={"if-match":E,...l,...o};return wd(Wu(f,{method:g,body:m,headers:I},s)).pipe(Xh((t=>{const{data:n,headers:r}=t;return Lr.analyseResponse(n),{response:n,actionInPayload:e,headers:ry({...I,...r})}})),hf("Error occurred during ajax call at finishAssignment Epic : ",s))},ZT=e=>{gu.publish(Fr.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,e)},eP=e=>{gu.publish(Fr.PUB_SUB_EVENTS.ERROR_ON_FINISH_ASSIGNMENT,e)},{RESOURCE_TYPES:tP}=Ur,nP=e=>{const t=kC()?.getState()?.data,n=t?Object.keys(t).find((e=>e.includes(Fr.WORKAREA))):void 0;return/^app\/primary(_\d+)?$/.test(e)&&!n},rP=(e,t)=>{let n,r=0,a=[],s={},o="",i={},c=!1,l=!1;return e.pipe(df(JT),Zh((e=>{let d,u;const p=PA.isCoexistenceAppOfType(Fr.APP_TYPE.UIKIT);if(({actionMgrID:r}=e.payload),o=e.payload.context,ou({context:o,stateObj:BC(o),clearContextMessages:!0}),!Gy(o)||uu(o)){const t={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Th.rejectActionByID(r,!0,t),$g.handleDeferredActionCompletion(e.payload.context).then((()=>{eP({errorType:Ur.ERROR_TYPE.CLIENT})})),nf([])}return nf(e.payload).pipe(Zh((e=>{Nh.setComponentCache("lastActionID",e?.actionID),uT(a,e);const n={...e};return XT(n,{state$:t})})),Zh((async e=>{if(e&&e.type===ba){iE(e);const t=dy(e);return a.push(t),a}Ig.clearContextedCache(o);const{headers:t,actionInPayload:h,response:f}=e,{containerItemID:g,context:m=MI(g),isModalAction:y,isInCreateStage:E}=h;c=h.isCaseWideAction,l=h.isProcessAction;const I=QI(g);h.target=I;const A=bm(g),C=Object.freeze({target:h.target,containerItemID:g,context:m,containerName:A});aS.setIn(f.data,Fr.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),aS.setIn(f.data,Fr.CASE_INFO_IS_LOCAL_ACTION,!1),f?.uiResources?.root?.config?.name&&"page"!==h.viewType&&aS.setIn(f.data,Fr.CASE_INFO.VIEW_NAME,f?.uiResources?.root?.config?.name),ZT({submitResponse:f});let S=sm(f,{[Ur.STOPMERGEACTIONS]:!f.nextAssignmentInfo});const _=xm(S),N=Wr(h.context),b=FI(N)[0]?$I(FI(N)[0]):N,T=wm(S),P=E&&!T;!y||E||yT(h.context,b)||(S=Cy(S,BC(g)));const O=sy(S,{headers:t,actionMgrID:r,directUrlUpdation:!1,isActiveWorkAreaPrimaryAndWorkareaAbsent:nP(b||"")});Vm(O.data,h),O.caseClassName=_,O.resourceType=tP.ASSIGNMENT,O.headers=t;const D=S?.uiResources?.root;if("AutoClose"===D?.type){const e=kC()?.getState()?.data?.[C.context]?.caseInfo,{ID:t,name:n,content:r}=e;return a=await(async e=>{const{target:t,containerItemID:n,context:r}=e,a=LI("app/primary"),s=CI(t,n)?.parentContext,o=Boolean(t)&&BI(t),i=BI("app/primary");if(o&&s!==Fr.APP.APP){if(await JI(n,{skipDirtyCheck:!0}),0===_I(t).length)return TT(r)}else{if(!a||!i||s)return TT(r);await JI(a,{skipDirtyCheck:!0,eventName:"Dismiss case"})}return[]})(h),v={ID:t,caseName:n,content:r,status:Rm(S).status},gu.publish(Fr.PUB_SUB_EVENTS.DISPLAY_CASE_SUBMITTED_TOASTER,v),a}var v;let R,$;const x=S?.data?.caseInfo?.assignments?.some((e=>e.ID===h.assignmentID)),w=((e,t)=>{const{assignmentID:n}=t;return e?.data?.caseInfo?.assignments?.some((e=>e.ID===n&&"true"===e?.canPerform))})(S,h),M=((e,t,n,r,a)=>{let s;const o=QI(t);s=BI(o)?PI(o,n.data?.caseInfo?.ID):$I(o);let i=!0;if(e&&s){const e=cS.getPropertyValue(Ur.CASE_INFO.ASSIGNMENTACTION_ID,"",s),t=cS.getPropertyValue(Ur.CASE_INFO.ASSIGNMENT_ID,"",s);if(e){const r=n?.data?.caseInfo?.assignments?.find((e=>e.ID===t)),a=r?.actions;a&&!a.some((t=>t?.ID===e))&&(i=!1)}}return r&&e&&i&&qC(null,Fr.CASE_VIEW_MODE_PROP,s)===Fr.PERFORM_MODE&&a})(x,b,S,y,w),L=h?.actionID===Ur.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(S?.data?.nextAssignmentInfo&&!L)O.caseViewMode=Fr.PERFORM_MODE,R=Mm(S),$=!0;else if(M&&!L)S?.confirmationNote&&S?.uiResources?.root?.config?.name===Fr.PY_CONFIRM?O.caseViewMode=Fr.REVIEW_MODE:O.caseViewMode=Fr.PERFORM_MODE,R=Mm(S),O.flowName=" ",O.deleteAssignmentSpecificResources=!1,$=!1;else{O.caseViewMode=Fr.REVIEW_MODE,aS.setIn(O.data,"context_data.caseViewMode",Fr.REVIEW_MODE);const e=VI(QI(b)),t=(e=>{if(e){const{stageID:t,stages:n=[]}=e,r=n.length;for(let e=0;e<r;e+=1)if(n[e].ID===t)return"resolution"===n[e].transitionType}return!1})(S?.data?.caseInfo);R=!S?.confirmationNote||!t&&S?.uiResources?.root?.config?.name!==Fr.PY_CONFIRM||e?"":Mm(S),$=!1}const U=Mm(S);km(O,S,{skipFlowNameUpdate:O?.caseViewMode===Fr.REVIEW_MODE||M});const F=s_("createWork",{caseClassName:_}).replace(/{.+?}/,String($m(U)));if(S.semanticURL=F,O.semanticURL=F,y?(await _T(h,O,$,R,S,a,e,f,!1,i),P&&(s=ET(h))):E&&p&&!T?(PA.setDefaultCasePage(Fr.PY_DETAILS),await(async(e,t,n)=>{const r={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:mI.PRIMARY,targetContainerName:mI.PRIMARY,viewType:ty.PAGE,isLastStepInCreateStage:!0,context:n},a={type:ya,payload:{...r}};t.push(a)})(f,a,Wr(m))):await ST(O,h,S,C,a),b?.includes(Fr.ACTIONAREA)&&m===b){dI(m);const e=BC(b);a=[{type:Ia,payload:{actionID:e.caseInfo.activeActionID,context:b,containerItemID:g,target:QI(b),actionMgrID:Th.getNextActionMgrId(),containerName:Fr.ACTIONAREA,localActionType:Ur.LOCAL_ACTION_TYPE.CASE_WIDE,caseID:e.caseInfo.ID}}]}if(Ym(e,a),$g.handleDeferredActionCompletion(o).catch((()=>{})),NT(O,h,b),!S?.data?.nextAssignmentInfo){const e=((e,t)=>{const{isCaseWideAction:n,assignmentID:r,actionID:a}=t;return{isCaseWideAction:n,caseID:Mm(e),assignmentID:n?null:r,actionID:a||null}})(S,h);Pg({...e,containerItemID:g})}return gT(a,{transientItemID:g,target:I,isModalAction:y}),d=S,u=h,n=h,a})),Xh((()=>{const t=a.find((e=>e.type===ba));var p;if(t?($g.handleDeferredActionCompletion(o).then((()=>{eP({errorType:Ur.ERROR_TYPE.SERVER})})).catch((()=>{})),bT(t),Th.rejectActionByID(r)):Th.resolveActionByID(r,s),i?.caseId&&(p=i,gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,p)),by(a),zm()&&d&&u&&Km(d,u.__deferCaseActionsPayload??u),!t&&(c||l)){const t=e.payload.caseID;Dg(t),(e=>{gu.publish(Fr.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0})}return!t&&n&&(e=>{gu.publish(Fr.PUB_SUB_EVENTS.EVENT_FINISH_ASSIGNMENT_DONE,e)})(n),a=[],s={},i={},a})))})))},aP="CANCEL_ASSIGNMENT",sP=e=>{const t={},{routeKey:n,isModalAction:r,caseID:a,context:s,RemoteSystemID:o}=e;o&&(t.RemoteSystemID=o);const i=n||"releaseAssignmentLock",{restApi:c,reqType:l}=i_(i,{ID:a,caseID:a,viewType:ty.PAGE}),d=Nh.getComponentCache(a),u=d&&"object"==typeof d?d:{},p=zy.appendExcludeQueryParamToUrl(c);return wd(Wu(p,{method:l,headers:{...t,...u}},s,{includeRemoteSystemIdIfPresent:!!o})).pipe(Xh((t=>(Nh.resetComponentCache(a),r?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:ry(t.headers)}))),hf(": Error occurred during ajax call at release lock request : ",s))},oP=(e,t)=>{const{isModalAction:n}=t;return sP({routeKey:"cancelAssignment",isModalAction:n,...e})},iP=e=>{let t=0,n=[];return e.pipe(df(aP),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>{const{isModalAction:n}=e;e.context||(e.context=MI(e.containerItemID));const{context:r}=e,a=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?mI.MODAL:bm(n)})(e),s=js(a,r);return wd(my(s,{loadingContext:r})).pipe(Zh((({continueExecution:r})=>r?(e.RemoteSystemID=Vr.getRemoteHeaderByContext(e.context)??void 0,wd(oP(e,{isModalAction:n}))):(Th.rejectActionByID(t),uf))))})),Zh((e=>{if(e&&e.type===ba)return n.push(dy(e)),wd([n]);const{actionInPayload:r,response:a}=e,{containerItemID:s,isModalAction:o,isInCreateStage:i}=r;a?.data.caseInfo&&(a.data.caseInfo.availableProcesses=a.data.caseInfo.availableProcesses??[]);const c=QI(s),l=MI(s),d={target:o?`${Fr.APP.APP}/${Fr.MODAL}`:c,containerItemID:s,caseViewMode:o?Fr.PERFORM_MODE:Fr.REVIEW_MODE,context:l,actionMgrID:t,key:Mm(a),skipReleaseLockRequest:!1};return i&&n.push(BS(DS,d)),!o&&jm(s)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:r,referencedUsers:a,response:s}=t,o=Wr(n),i=MI(o);let c=!1;const l=s?.data?.caseInfo;l&&(c=Object.prototype.hasOwnProperty.call(l,"assignments"),l.assignments??=[]);const d={context:i,data:{...s.data,referencedUsers:a,context_data:{caseViewMode:r}}},u=[];c&&u.push({path:Fr.CASE_INFO.ASSIGNMENTS,allowMultiple:!0}),u.length>0?e.push(BS(gS,d,{propertiesToReplace:u})):e.push(BS(gS,d))})(n,{childContainerItemID:s,caseViewMode:Fr.REVIEW_MODE,referencedUsers:a?.data.referencedUsers,response:a}),d.skipReleaseLockRequest=!0,e.actionInPayload.shouldUpdateCaseActionsInParentContext=!0,Km(e?.response,e?.actionInPayload),n.push(BS(MS,d)),wd([n])})),Xh((()=>(VC(n),Bm(n,t),n=[],n))))},cP="NAVIGATE_TO_STEP",lP=(e,t)=>{const{ID:n,stepID:r,containerItemID:a,context:s=MI(a),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:r,viewType:o?ty.PAGE:ty.FORM},{restApi:l,reqType:d}=i_("navigateToStep",c),{content:u}=ay(s),p=i.value.data[s].caseInfo.headers,h=zy.appendExcludeQueryParamToUrl(l);return wd(Wu(`${h}`,{method:d,body:u,headers:{"if-match":p&&p.etag}},s)).pipe(Xh((t=>({response:t.data,actionInPayload:e,headers:ry({...p,...t.headers})}))),hf("Error occurred during ajax call at navigateToStep Epic : ",s))},{RESOURCE_TYPES:dP}=Ur,uP=(e,t)=>{let n=0,r=[];return e.pipe(df(cP),Jh((e=>{let a,s;return({actionMgrID:n}=e.payload),nf(e.payload).pipe(Zh((e=>(du(e.context),lP(e,{state$:t})))),Zh((async e=>{if(e&&Dm(e.type))return r.push(dy(e)),r;const{actionInPayload:t,response:n,headers:o}=e,{containerItemID:i,context:c=MI(i),isModalAction:l}=t;Ig.clearContextedCache(t.context);const d=QI(i),u=bm(i),p=Object.freeze({target:d,containerItemID:i,context:c,containerName:u}),h=n?.data?.caseInfo?.content,f=n?.uiResources?.root?.config?.name,g=n?.uiResources?.root?.config?.context;h&&!h[Mr.getDefaultQualifiedName("pyViewName")]&&f&&"page"!==t.viewType&&(aS.setIn(h,Mr.getDefaultQualifiedName("pyViewName"),f),aS.setIn(h,Mr.getDefaultQualifiedName("pyViewContext"),g)),a=sm(n);const m={acName:d,...p};await oy(a,t,m),s=sy(a,{...p,headers:o}),n?.nextAssignmentInfo||(s.caseViewMode=Fr.REVIEW_MODE),Ym(e,r),s.doDeleteCaseSummary=t.doDeleteCaseSummary,s.resourceType=dP.ASSIGNMENT,s.caseID=Mm(a),km(s,a),Vm(s.data,t);const y=a.data?.caseInfo?.stages,E=a.data?.caseInfo?.stageID;if(Tg({caseID:Mm(a),isModalAction:l,stages:y,stageID:E}),jm(i)){const e=zy.getPropertiesToReplace(i);Ny(s,r,"",{propertiesToReplace:e})}return r.push(BS(DS,s)),s.shouldUpdateCaseActionsInParentContext=!0,r})),Xh((()=>(VC(r),a&&s&&Km(a,s),Bm(r,n),r=[],r))))})))},pP=e=>{const{caseID:t,context:n}=e,{restApi:r,reqType:a}=i_(Za,{ID:t});return wd(Wu(r,{method:a},n)).pipe(Xh((t=>(Lr.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:ry(t.headers)}))),hf(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},hP=e=>{gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},fP=(e,t)=>{let n,r=0,a=[];return e.pipe(df(Vh),Xh((e=>(({actionMgrID:r,caseType:n}=e.payload),e.payload))),Zh((e=>e.ignoreCaseDeletion?nf({actionInPayload:e}):pP(e))),Zh((async e=>{if(e&&Dm(e.type)){const{payload:t}=e,n=dy({...e,...t,actionMgrID:r});return a.push(n),a}const{actionInPayload:n}=e,{context:s,isModalAction:o}=n,i=o?mI.MODAL:mI.PRIMARY,c=js(i,s);if(!o&&c){const e={acName:c,target:c,context:s},r=t.value.containers[c],{semanticURL:a}=(e=>{const{accessedOrder:t,items:n}=e;if(t&&t.length>1){const e=n[t[t.length-2]],{semanticURL:r}=e;if(r)return e}return{semanticURL:""}})(r);await oy({directUrlUpdation:!0,semanticURL:a},n,e)}if(n.isProcessAction&&n.parentCaseInfo){const e={insKey:n.parentCaseInfo.ID,className:n.parentCaseInfo.content.classID,context:n.parentContext,acTargetName:Fr.PRIMARY,isChild:!0},t={type:pa,payload:{...e}};a.push(t)}const l={target:c,containerItemID:s,context:s,caseDeleted:!0};return a.push(BS(MS,l)),a})),Xh((()=>(VC(a),Bm(a,r)===Fr.PROMISE_VALUE.RESOLVE&&hP({caseType:n}),a=[],a))))};function gP(e,t){return Bl(t)?Zh(e,t,1):Zh(e,1)}const mP=(e,t)=>{const{assignmentID:n,actionID:r,context:a}=e,{restApi:s,reqType:o}=i_("save",{assignmentID:n,actionID:r}),{content:i}=ay(a),c=t.value.data[a]?.caseInfo?.headers,l=zy.appendExcludeQueryParamToUrl(s);return wd(Wu(l,{method:o,body:i,headers:{"if-match":c&&c.etag}},a)).pipe(Xh((t=>({response:t.data,actionInPayload:e,headers:ry(t.headers)}))),hf(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",a))},yP=(e,t=!1)=>{const{action:n,state$:r,actionMgrID:a}=e,s=!0===n.payload.autosave;let o=[];return nf(n.payload).pipe(Zh((e=>mP(e,r))),gP((e=>{if(e&&Dm(e.type))return nf(e);const{containerItemID:t}=e&&e.actionInPayload,r=Wr(t),a=QI(r),i=II(a),c=FI(r)[0];let l=c?$I(c):r;!VI(QI(l))&&({containerItemID:l}=AI(l,e.actionInPayload.caseID,c));const d=$I(a);n.payload.canUpdateAvailableActions&&am(e.response);const u=Vr.getRemoteHeaderByContext(e.actionInPayload.context),p={...e.actionInPayload,RemoteSystemID:null===u?void 0:u};if(l&&o.push(BS(gS,{context:l,data:{caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}})),i?.items?.[d]?.key===e?.actionInPayload?.caseID){const n={context:r,data:{...e.response.data,caseInfo:{...e.response.data?.caseInfo||{},headers:e.headers}}},a=zy.getPropertiesToReplace(t);o.push(BS(gS,n,{propertiesToReplace:a}))}return s||o.push(BS(DS,{context:t})),Ym(e,o),sP(p)})),Zh((async n=>{if(n&&Dm(n.type)){const{payload:t}=n,r=dy({...n,...t,actionMgrID:a});o.push(r);const s=e.action.payload.modalLoadingContainer;if(s){const e=s.context,{context_data:t}=BC(e)||{};t?.isLoading&&JI(e)}return o}const{actionInPayload:r,response:i}=n,{context:c,containerName:l}=r,d={target:js(l,c),containerItemID:c,context:c};return r.shouldUpdateCaseActionsInParentContext=!0,Km(i,r),t||s||o.push(BS(MS,d)),o})),Xh((()=>{var e;return VC(o),Bm(o,a),s||(e={context:n.payload.context,assignmentID:n.payload.assignmentID},gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.SAVE_ASSIGNMENT_COMPLETE,e)),t||(o=[]),$g.isDeferredActionInProgress(n.payload.context)&&$g.handleDeferredActionCompletion(n.payload.context),o})))},EP=(e,t)=>{let n,r=0;return e.pipe(df(Bh),Jh((e=>{const{saveOnly:a}=e.payload;({actionMgrID:r,caseType:n}=e.payload);return yP({action:e,state$:t,actionMgrID:r,caseType:n},a)})))},IP=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",gu.unsubscribe(Fr.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,r="expressLocalActionSubmit",gu.subscribe(Fr.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,r)}var n,r},{LOCAL_ACTION_TYPE:AP}=Fr,{RESOURCE_TYPES:CP}=Ur,SP=(e,t)=>{const{actionID:n,assignmentID:r,caseID:a,context:s,openActionType:o,modalLoadingContainer:i,headers:c}=e,{isProcessAction:l}=t,d=l?ts:(e=>{const t=e.localActionType?.toLowerCase();return t===AP.CASE_WIDE||t===AP.EXPRESS||t&&e.isPromotedAction?ns:es})(e),u=ty.FORM,{reqType:p}=i_(d,{caseID:a,ID:r,actionID:n,viewType:u});let{restApi:h}=i_(d,{caseID:a,ID:r,actionID:n,viewType:u});e.actionType=d===ns?Fr.CASE:Fr.ASSIGNMENT,h&&!h.includes("viewType=")&&(h=h.includes("?")?`${h}&viewType=${u}`:`${h}?viewType=${u}`),h=zy.appendExcludeQueryParamToUrl(h);const f=i?.context??s;return wd(Wu(h,{method:p,headers:c},f)).pipe(Xh((t=>({response:t.data,actionInPayload:e,headers:ry(t.headers,"",e.headers)}))),hf(`: Error occurred during ajax call at ${o} Epic : `,f))},_P=(e,t)=>{const{isProcessAction:n}=t,r=n?ts:es;e.openActionType=r;let a;if("modal"===Nm(r,e)){if(!mu.isOnline()||e.isAppOffline)return Th.rejectActionByID(e.actionMgrID),Promise.resolve();a=FI(e.contextName)[0]?FI(e.contextName)[0]:QI(e.contextName);const n=a?$I(a):e.contextName,r=MI(n),s=Nm(e.openActionType,e),o=js(s,e.context),i=Kr(e.context,Hr(s,e.context));if(VC(_S({target:o,context:i,containerItemID:i,key:e.caseID,caseViewMode:Fr.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:Fr.CASE_INFO.CASE_INFO_CONTENT,type:"view"}},data:{key:e.caseID,caseInfo:{ID:e.caseID}},headers:{...e.headers}})),VC(vS({context:i})),e.modalLoadingContainer={target:o,context:i},!FI(e.contextName)[0])return SP(e,t);if(!e.continueExecution)return SP(e,t);if(!cI(r))return SP(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return wd([Gh(e.saveActionPayload)]).pipe(Zh((e=>(e=>{let t,n=0;const r=[],a={value:kC()?.getState()};return nf(e).pipe(df(Bh),Jh((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:n,caseType:t}=e.payload),!s){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Th.rejectActionByID(n,!0,e),nf([])}return yP({action:e,state$:a,actionMgrID:n,caseType:t,actionsOut:r},!0)})))})(e))),Zh((n=>1===n.length&&Dm(n[0].type)?wd(my(a,{loadingContext:e.context})).pipe(Zh((({continueExecution:n})=>n?SP(e,t):(Th.rejectActionByID(e.actionMgrID),uf)))):SP(e,t))),Xh((e=>e)))}return SP(e,t)},NP=async(e,t,{headers:n,actionInPayload:r})=>{const{context:a,actionName:s,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c,skipMergeAssignmentsAndActions:l}=r,d=sm(e),u=Nm(o,r),p=c?.target??js(u,a);let h,f,g=!1;!GI(p)||BI(p)&&!bI(p,e.data.caseInfo.ID)?(f=Hr(u,a),Pm(u)&&(f=Kr(a,f)),h=f,g=!0):(h=BI(p)?PI(p,e.data.caseInfo.ID):$I(p),f=MI(h));const m={acName:p,target:p,containerName:u,context:f};await oy(d,r,m),(void 0===d?.data?.caseInfo?.content||void 0!==d.data.caseInfo.content&&"object"==typeof d.data.caseInfo.content&&0===Object.keys(d.data.caseInfo.content).length)&&delete d.data?.caseMessages;const y=d.uiResources?.root;let E;E=y?Fr.PERFORM_MODE:Fr.REVIEW_MODE;const I=sy(d,{target:p,context:f,containerItemID:h,caseViewMode:E,doDeleteCaseSummary:i,headers:n,actionName:s,isMinimizable:!1,isInCreateStage:Pm(u),resourceType:CP.ASSIGNMENT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,assignmentID:r.assignmentID,actionType:r.actionType,skipMergeAssignmentsAndActions:l});let A;if(y&&km(I,d),Pm(u)&&delete I.doDeleteCaseSummary,r.openActionType===as&&(I.isBulkAction=!0,I.data.caseInfo.actionButtons.main[0].jsAction="async"===r.runningMode?"submitBulkActionAsync":"submitBulkAction",I.data.caseInfo.actionButtons.secondary[0].jsAction="cancelBulkAction",I.data.caseInfo.cases=r.selectedList,I.data.caseInfo.isAssignment=r.isAssignment),A=g?_S:r.isProcessAction||(e=>e.containerItemID?.includes(Fr.ACTIONAREA)&&e.context?.includes(Fr.ACTIONAREA))(r)?FS:DS,I.data.context_data.isProcessAction=r.isProcessAction,t.push(BS(A,I)),g||t.push(BS(RS,I)),g){const a=FI(r.contextName),s=PI(a,e.data.caseInfo.ID);if(s){const e={data:{caseInfo:{headers:n}},context:s};t.push(BS(gS,e))}}h!==$I(p)&&t.push(BS(xS,{target:p,containerItemID:h})),jm(h)&&!c?.context&&Ny(I,t);const C="other"===I.nextAssignmentInfo?.context;!r.isProcessAction||Gm(I.nextAssignmentInfo?.className)||C||Ym({response:d,actionInPayload:{...r,containerItemID:h}},t),I.caseViewMode===Fr.REVIEW_MODE&&t.push(BS(MS,I)),I.shouldUpdateCaseActionsInParentContext=!0;return aS.getIn(e.data,["caseInfo","isLocalAction"])||Km(d,I),t},bP="OPEN_LOCAL_ACTION",TP=(e,t)=>_P(e,t),PP=e=>{let t=0,n=[];return e.pipe(df(bP),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),cf((()=>!Jm(t))),Zh((e=>TP(e,{actionMgrID:t}))),Zh((async e=>{if(!e)return uf;if(Dm(e.type)){const t=dy(e);n.push(t);const{context_data:r}=BC(e.payload.context)||{};return r?.isLoading&&n.push(BS(RS,e.payload)),n}const{actionInPayload:t,headers:r,response:a}=e,{actionID:s}=t;aS.setIn(a,"data.caseInfo.activeActionID",s);return(e=>{gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,e)})(aS.getIn(a,"data.caseInfo.ID")),aS.setIn(a.data,Fr.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&aS.setIn(a.data,Fr.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await NP(a,n,{headers:r,actionInPayload:t}),IP(t),n})),Xh((()=>(VC(n),Bm(n,t),n=[],n))))},OP=e=>{const{actionID:t,context:n,openActionType:r,caseTypeID:a,bulkContextID:s="",bulkContextType:o=""}=e,i=as,{reqType:c,restApi:l}=i_(i,{caseTypeID:a,actionID:t,bulkContextID:s,bulkContextType:o});return wd(Wu(l,{method:c},n)).pipe(Xh((t=>({response:t.data,actionInPayload:e,headers:ry(t.headers)}))),hf(`: Error occurred during ajax call at ${r} Epic : `,n))},DP=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",gu.unsubscribe(Fr.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,r="bulkActionSubmit",gu.subscribe(Fr.PUB_SUB_EVENTS.EVENT_BULKACTION,n,r)}var n,r},vP="OPEN_BULK_ACTION",RP=e=>{let t=0,n=[];return e.pipe(df(vP),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>((e,t)=>{const{context:n}=e,{actionMgrID:r}=t;e.openActionType=as;const a=Nm(as,e),s=js(a,n);return wd(my(s,{loadingContext:n})).pipe(Zh((({continueExecution:t})=>t?OP(e):(Th.rejectActionByID(r),uf))))})(e,{actionMgrID:t}))),Zh((async e=>{if(e&&Dm(e.type??"")){const t=dy(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:a}=e,{actionID:s}=t;return aS.setIn(a,"data.caseInfo.activeActionID",s),await NP(a,n,{headers:r,actionInPayload:t}),DP(t),n})),Xh((()=>(1===n.length&&Dm(n[0].type)?Th.rejectActionByID(t):Th.resolveActionByID(t),VC(n),n=[],n))))};var $P=Array.isArray,xP=Object.getPrototypeOf,wP=Object.prototype,MP=Object.keys;function LP(e){if(1===e.length){var t=e[0];if($P(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&xP(r)===wP){var n=MP(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var UP=Array.isArray;function FP(e){return Xh((function(t){return function(e,t){return UP(t)?e.apply(void 0,Ul([],Ll(t))):e(t)}(e,t)}))}function jP(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return Bl(tf(e))?e.pop():void 0}(e),r=LP(e),a=r.args,s=r.keys,o=new gd((function(e){var t=a.length;if(t)for(var n=new Array(t),r=t,o=t,i=function(t){var i=!1;Nd(a[t]).subscribe(Od(e,(function(e){i||(i=!0,o--),n[t]=e}),(function(){return r--}),void 0,(function(){r&&i||(o||e.next(s?function(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}(s,n):n),e.complete())})))},c=0;c<t;c++)i(c);else e.complete()}));return n?o.pipe(FP(n)):o}const kP=e=>{const{actionID:t,context:n,cases:r,classID:a,isAssignment:s}=e,{content:o}=ay(n,{nonEmptyAndChangedData:!0});let i=5;try{const e=Hg.getSharedState(Mr.getQualifiedNameForComplexRuleReferences("D_pySingleExecutionBulkActionsMeta.D_pySingleExecutionBulkActionsMeta.pxResults"));e?.find((e=>e[Mr.getDefaultQualifiedName("pyClassName")]===a))?.pyList.split(",").includes(t)&&(i=1)}catch(e){console.error('Failed to fetch to "D_pySingleExecutionBulkActionsMeta" DP response',e)}const c=r.map((e=>({ID:e}))),l=c.length/i,d=s?"performAssignmentBulkAction":ss,{reqType:u,restApi:p}=i_(d,{actionID:t}),h=[],f=c.length;for(let t=0;t<f;t+=l){const r=c.slice(t,t+l);s?o.assignments=r:o.cases=r,r.length&&h.push(wd(Wu(p,{method:u,body:o},n)).pipe(Xh((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:ry({...r})}})),hf("Error occurred during ajax call at submitbulkaction Epic : ",n)))}return jP(h)},VP=e=>{gu.publish(Fr.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},BP="SUBMIT_BULK_ACTION",GP=e=>{let t,n=0,r=[],a="";return e.pipe(df(BP),Jh((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:n}=e.payload),!s){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Th.rejectActionByID(n,!0,e),nf([])}return nf(e.payload).pipe(Zh((e=>(t=e,kP(t)))),Zh((e=>{let n=0,s=0;const o=[],{containerItemID:i,context:c}=t;return e.forEach((e=>{const{response:t}=e;n+=Number(t.successCount),s+=Number(t.failureCount),s&&t.results.forEach((e=>{"200"!==e.status&&e.error&&e.error.errorDetails&&e.error.errorDetails.forEach((t=>{o.push({ID:e.BusinessID,message:t.localizedValue})}))}))})),a=`${n} record(s) updated`,VP({submitResponse:e}),t.target="HYBRID"===PA.getRenderingMode()?QI(i):`${Fr.APP.APP}/${mI.MODAL}`,r.push(BS(MS,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),s&&r.push(BS(wS,{messages:[{type:"error",message:1===s?"1 record failed to update":`${s} records failed to update`,errorDetails:o,showHeader:!1}],context:Wr(c)||c,category:"HTTP",showHeader:!1})),r})),Xh((()=>(Th.resolveActionByID(n,a),VC(r),r=[],r))))})))},WP=e=>{const{actionID:t,context:n,cases:r}=e,{content:a}=ay(n,{nonEmptyAndChangedData:!0});a.cases=r.map((e=>({ID:e})));const s=ss,{reqType:o,restApi:i}=i_(s,{actionID:t,runningMode:"async"});return wd(Wu(i,{method:o,body:a},n)).pipe(Xh((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:ry({...r})}})),hf("Error occurred during ajax call at submitbulkactionasync Epic : ",n))},HP=e=>{gu.publish(Fr.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},qP="SUBMIT_BULK_ACTION_ASYNC",YP=e=>{let t,n=0,r=[],a={};return e.pipe(df(qP),Jh((e=>{const{isFormValid:s}=e.payload;if(({actionMgrID:n}=e.payload),!s){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Th.rejectActionByID(n,!0,e),nf([])}return nf(e.payload).pipe(Jh((e=>(t=e,WP(t)))),Xh((e=>{const{containerItemID:n,context:s}=t,{response:o}=e;return a={caseID:o.caseID,caseTypeID:"BackgroundJob"},HP({submitResponse:o}),t.target=`${Fr.APP.APP}/${mI.MODAL}`,r.push(BS(MS,{containerItemID:n,context:s,target:t.target,skipReleaseLockRequest:!0})),r})),Xh((()=>(Th.resolveActionByID(n,a),VC(r),r=[],r))))})))},zP=(e,t)=>_P(e,t),KP=e=>{let t=0,n=[];return e.pipe(df(jh),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>{const n=Nm(ts,e),r=js(n,e.context);return wd(my(r,{loadingContext:e.context})).pipe(Zh((({continueExecution:n})=>n?(du(e.context),zP(e,{actionMgrID:t,isProcessAction:!0})):(Th.rejectActionByID(e.actionMgrID),uf))))})),Zh((async e=>{if(e&&Dm(e.type)){const t=dy(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:a}=e;return await NP(a,n,{headers:r,actionInPayload:t}),n})),Xh((()=>(by(n),Bm(n,t),n=[],n))))},QP=e=>{let t=0,n=[];return e.pipe(df(Da,ka),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>{const{containerItemID:t,caseID:n,context:r,caseDeleted:a,skipReleaseLockRequest:s,currentCaseViewMode:o,isProcessAction:i,isInCreateStage:c,deleteWork:l}=e,d=o===Fr.PERFORM_MODE,u=n&&d;return l?nf([]):i&&c?sP(e):t!==r||a||s||!u?t?.includes(Fr.MODAL)&&Qm(IA(t))===Fr.REVIEW_MODE?sP(e):nf([]):sP(e)})),Zh((e=>(e&&Dm(e.type)&&n.push(dy(e)),n))),Xh((()=>(VC(n),Bm(n,t),n=[],n))))};var JP=function(e){function t(t,n){return e.call(this)||this}return $l(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(ql),XP={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=XP.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,Ul([e,t],Ll(n))):setInterval.apply(void 0,Ul([e,t],Ll(n)))},clearInterval:function(e){var t=XP.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},ZP=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return $l(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,a=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(a,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(a,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),XP.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&XP.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Hl(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(JP),eO={now:function(){return(eO.delegate||Date).now()},delegate:void 0},tO=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=eO.now,e}(),nO=new(function(e){function t(t,n){void 0===n&&(n=tO.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return $l(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(tO))(ZP),rO=nO;function aO(e,t,n){void 0===e&&(e=0),void 0===n&&(n=rO);var r=-1;return null!=t&&(ef(t)?n=t:r=t),new gd((function(t){var a,s=(a=e)instanceof Date&&!isNaN(a)?+e-n.now():e;s<0&&(s=0);var o=0;return n.schedule((function(){t.closed||(t.next(o++),0<=r?this.schedule(void 0,r):t.complete())}),s)}))}function sO(e,t){return void 0===e&&(e=0),void 0===t&&(t=nO),e<0&&(e=0),aO(e,e,t)}function oO(e){return Pd((function(t,n){var r=!1,a=null,s=null,o=function(){if(null==s||s.unsubscribe(),s=null,r){r=!1;var e=a;a=null,n.next(e)}};t.subscribe(Od(n,(function(t){null==s||s.unsubscribe(),r=!0,a=t,s=Od(n,o,Zl),Nd(e(t)).subscribe(s)}),(function(){o(),n.complete()}),void 0,(function(){a=s=null})))}))}const iO=(e,t,n,r,a)=>{if(a!==Fr.RESOURCE_STATUS.CREATE)return;Ry.isStateMachineExist(e,t,n)||Ry.setStateMachine(e,n,t,new lp(n,t,e));Ry.getStateMachine(e,t,n).insert({},"string"==typeof r?r:r+1,!0,{isDefault:!0})},cO=(e,t,n,r,a)=>{"string"==typeof t&&e.data?.caseInfo?.content&&n&&("CREATE"===r||"UPDATE"===r)&&(e.data.caseInfo.content[a][t][n]=t)},lO=e=>{const t=!e.isLocalAction&&e.editType===Fr.ACTION;return{...t?{}:{activeActionID:e.actionID},assignments:[{ID:e.assignmentID,...t?{actions:[{ID:e.actionID}]}:{}}]}},dO=e=>{let t=0,n=[],r="";return e.pipe(df(_s),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>Gb(e))),Zh((async e=>{if(e&&e.type===ba)return n.push(dy(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:a,headers:s}=e,o=t.containerName,i=js(o,t.context);let c=hy(i,o,t.context);c=Kr(t.context,c);const{pageReference:l,targetProperty:d,index:u,subscriptFieldName:p,pageGroupName:h,actionType:f,isPageGroup:g}=t,m=l?.startsWith(Ur.OBJECT_INFO.OBJECT_INFO);let y=null;m?(y=Lr.transformCaseData(a),y.uiResources.root.config.context=`${l}${d}[${u}]`):y=a;const E=sm(y);E.key=t.ID,E.data?.caseInfo?(E.data.caseInfo.ID=t.ID,cO(E,u,p,f,h)):E.data?.objectInfo&&(E.data.objectInfo.ID=t.ID);const{interestPageActionID:I,editType:A,isLocalAction:C,actionID:S}=t,_={isMultiRecordData:!0,viewName:t.viewID,parentContext:t.context,interestPage:t.interestPage,interestPageActionID:I,editType:A,isLocalAction:C,actionID:S};E.uiResources.context_data.modalView=_;const N=BC(t.context)?.context_data?.caseInfo,b=`${t.pageReference}${t.targetProperty}`,T=nu(N,b,t.index);E.uiResources.context_data.caseInfo={...E.uiResources.context_data.caseInfo,content:aS.mergeDeep(E.uiResources.context_data.caseInfo?.content,T?.content)};const P=cS.getProperty(Fr.CASE_INFO.REMOTESYSTEMID,"",t.context),O={acName:i,context:c};await oy(E,t,O);const D={target:i,context:c,containerItemID:c,headers:s,index:u,subscriptFieldName:p,pageGroupName:h,isPageGroup:g};P&&(D.headers={...D.headers,RemoteSystemID:P});const v=sy(E,D);v.resourceStatus=t.actionType,v.isMultiRecordData=!0,v.readOnly=t.readOnly,v.parentContext=t.context,v.heading=t.heading,v.data.caseInfo&&A===Fr.ACTION&&(v.data.caseInfo={...v.data.caseInfo,...lO(t),isLocalAction:t.isLocalAction}),v.clearStateMachine=!1;const R=uy(i,v);r=c,n.push(R);let $={changedListProperty:[],leafProperty:[]};return A===Fr.ACTION&&(Ry.registerForServerChanges(),$=LC.getServerProperties(v.data,c)),{actionsOut:n,actionInPayload:t,serverProps:$}})),Xh((({actionInPayload:e,serverProps:a={changedListProperty:[],leafProperty:[]}})=>{if(vm(n)?Th.rejectActionByID(t):Th.resolveActionByID(t),e.skipPageInstructions||iO(r,e.pageReference,e.targetProperty,e.index,e.actionType),VC(n),n=[],e.editType===Fr.ACTION){LC.handleServerChanges(r,a.changedListProperty,a.leafProperty),Ry.unRegisterForServerChanges();const t=Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT)+aS.convertClipboardPageToPageRefNotation(e.interestPage);e.columns.forEach((n=>{const a=No.trimAnnotation(n.config.value),s=HC(a,t,r),o=oC(a.startsWith(".")?a.split(".").pop():a,n.config.classID);Zd.addFieldNode(r,t,e.viewID,a,s,{isDeclarativeTarget:!!o?.isDeclarativeTarget,context:r,propertyName:a,pageReference:t,value:n.config.value,isInsideList:/\[\d+\]/.test(t)||/\[\d+\]/.test(a)})}))}return n})))},uO=e=>{const{context:t}=e;let n={...ay(t).content,contextData:!1};const r=Py(t);aS.isEmpty(r)||(n=Ty(r,n));const a=((e,t=!1)=>e===Fr.ACTION?t?Ng.REFRESH_CASE_DATA:Ng.REFRESH_ASSIGNMENT_DATA:Ng.REFRESH_CASE_VIEW)(e.editType,e.isLocalAction),{restApi:s,reqType:o}=i_(a,{ID:e.isLocalAction||e.editType!==Fr.ACTION?e.ID:e.assignmentID,actionID:e.actionID,viewID:e.viewID});let i=s;return e.editType===Fr.ACTION&&(i+=`?operation=${e.operationFlag}`,n.interestPageActionID=e.interestPageActionID),n.interestPage=e.interestPage,wd(Wu(i,{method:o,body:n,headers:e.headers},t)).pipe(Xh((t=>({actionInPayload:e,response:t.data,headers:ry(t.headers)}))),hf(": Error occurred during getEmbeddedDataView request : ",t))},pO=(e,t,n)=>"string"==typeof n?`${e}${t}.${n}`:`${e}${t}[${n}]`,hO=(e,t,n,r,a)=>{const s=e.data?.caseInfo?.content;if(s){const e=((e,t,n)=>{const r=(e,t)=>{if((e=>"object"==typeof e&&null!==e)(e))return e[t]},a=t.replace(/^\./,"").split(".");let s=e;for(const e of a)s=r(s,e);return"string"==typeof n?r(s,n)??null:Array.isArray(s)?s[n]??null:null})(s,r,a);e&&VC(KS({context:t,reference:n,value:e}))}const o=e.uiResources?.context_data;o&&VC(KS({context:t,reference:Fr.CONTEXT_DATA,value:o}))},fO=e=>{let t=0,n=[];return e.pipe(df(Ns),Xh((e=>{const{payload:n}=e;return({actionMgrID:t}=n),n})),Zh((e=>uO(e))),gP((async e=>{const t={rootView:null,data:null,uiResources:null,containerContext:null};if(e?.type===ba)return n.push(dy(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0},responseData:t};const{actionInPayload:r,response:a,headers:s}=e,{pageReference:o,targetProperty:i,index:c,containerName:l}=r,d=o?.startsWith(Ur.OBJECT_INFO.OBJECT_INFO),{context:u,containerContext:p,target:h}=(e=>{const{containerName:t,context:n}=e;if(!t)return{context:n,containerContext:null,target:null};const r=js(t,n),a=hy(r,t,n)||t,s=Kr(n,a);return{context:s,containerContext:s,target:r}})(r),f=((e,t,n,r,a)=>{if(a){const a=Lr.transformCaseData(e);return a.uiResources.root.config.context=pO(t,n,r),a}return e})(a,o,i,c,d),g=sm(f);g.key=r.ID;const m=pO(o,i,c),y=l?{acName:h,context:u}:{context:u};if(await oy(g,r,y),l&&h){const e=sy(g,{target:h,context:u,containerItemID:u,headers:s,index:c});e.resourceStatus=r.actionType,e.isMultiRecordData=!0,e.readOnly=r.readOnly,e.parentContext=r.context,e.clearStateMachine=!1;const t=uy(h,e);n.push(t)}else hO(g,u,m,i,c);const E=g.uiResources?.root||null;return E?.config&&(E.config.context=m),t.rootView=E,t.data=g.data,t.uiResources=g.uiResources,t.containerContext=p,{actionsOut:n,actionInPayload:r,responseData:t}})),Xh((({actionsOut:e,responseData:r})=>{vm(e)?Th.rejectActionByID(t):Th.resolveActionByID(t,r);return n=[],e})))},gO=e=>{let t,n="",r=[];return e.pipe(df(bs),Jh((e=>{t=e.payload;const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const t={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Th.rejectActionByID(n,!0,t),$g.handleDeferredActionCompletion(e.payload.context),nf([])}return nf(e.payload).pipe(Zh((e=>(t=e,Gb(t)))),Zh((async e=>((e,t)=>{if(e&&"action"===t.editType&&e.type!==ba){const{context:n,pageReference:r}=t,a={context:n},{response:s}=e,o=r?.startsWith(Ur.OBJECT_INFO.OBJECT_INFO);let i=null;o?(i=Lr.transformCaseData(s),i.uiResources.root.config.context=r):i=s;const c=sm(i);c.key=t.ID,c.data?.caseInfo?c.data.caseInfo.ID=t.ID:c.data?.objectInfo&&(c.data.objectInfo.ID=t.ID);const l=sy(c,a);l.skipValidation=!0;const d=BS(gS,l);Ry.registerForServerChangesSync(),VC(d),Ry.unRegisterForServerChanges()}return e})(e,t))),Zh((async e=>{if(e&&e.type===ba){const t=dy(e);return r.push(t),r}const{containerItemID:n,context:a,pageReference:s,interestPage:o}=t,i=o?.replace(/\(\d+\)$/,"");return((e,t,n,r,a)=>{yp(e).forEach((e=>{const s=a&&"replace"===e.instruction.toLowerCase()?aS.convertClipboardPageToPageRefNotation(a):aS.convertClipboardPageToPageRefNotation(e.target);Ry.isStateMachineExist(t,n,s)||Ry.setStateMachine(t,s,n,new lp(s,n,t));const o=Ry.getStateMachine(t,n,s);switch(e.instruction.toLowerCase()){case"insert":o.insert(e.content,e.listIndex,r,{encryptedContent:e.encryptedContent});break;case"update":o.update(e.content,e.listIndex??e.groupIndex,r,{encryptedContent:e.encryptedContent});break;case"delete":e.listIndex?o.delete(e.listIndex,r):e.groupIndex?o.delete(e.groupIndex,r):o.deletePage();break;case"replace":o.replacePage(e.content,r,a?e.target:void 0,a?n:void 0,e.encryptedContent);break;case"move":o.move(e.listIndex,e.listMoveToIndex);break;case"add":o.insert(e.content,e.groupIndex,r,{encryptedContent:e.encryptedContent});break;case"delete all":o.deleteAll()}}))})(a,t.parentContext,s.startsWith(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT)?Fr.getProperty(Ur.OBJECT_INFO.OBJECT_INFO_CONTENT):Fr.getProperty(Ur.CASE_INFO.CASE_INFO_CONTENT),!1,i),r.push(BS(MS,{containerItemID:n,context:a,target:t.target,skipReleaseLockRequest:!0})),r})),Xh((()=>{if(vm(r))Th.rejectActionByID(n),$g.handleDeferredActionCompletion(t.context);else{Th.resolveActionByID(n),$g.handleDeferredActionCompletion(t.context);const{pageReference:r}=e.payload,a=cS.getPropertyValue(Fr.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,r,t.parentContext);a?((e,t)=>{const{pageReference:n,isMultiRecordData:r}=t,a=cS.getPropertyValue(Fr.getProperty(Ur.CASE_INFO.CASE_INFO_ID),n,e.parentContext),s=cS.getPropertyValue(Fr.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,e.parentContext),o=cS.getPropertyValue(Ur.CASE_INFO.ASSIGNMENT_ID,n,e.parentContext),i=cS.getPropertyValue(Fr.CONTEXT_DATA_MODAL_VIEW.CONTEXT_DATA_MODAL_VIEW,n,e.parentContext),{interestPage:c,interestPageActionID:l,actionID:d,isLocalAction:u}=i,p=e.pageReference.substring(0,e.pageReference?.lastIndexOf(".")).replace(Fr.getProperty(Fr.CASE_INFO.CASE_INFO_CONTENT),"");"action"===i.editType?pE(a,o,d,e.parentContext,c,l,u,r,i.editType):uE(a,s,e.parentContext,p,{})})(t,{isMultiRecordData:a,pageReference:r}):IE(t.parentContext,Fr.getProperty(Fr.CASE_INFO.CASE_INFO_CONTENT),{})}return VC(r),r=[],r})))})))},mO=e=>{const{caseID:t,headers:n,debugInfo:r,context:a}=e,s=i_("getDescendants",{caseID:t}),{restApi:o}=s,{reqType:i}=s;return wd(Wu(o,{method:i,headers:{...n,...r&&{...xu.addDebugHeaders(r)}}},a)).pipe(Xh((t=>({actionInPayload:e,response:t.data,headers:ry({...n,...t.headers})}))),hf("Error ocurred during ajax call at getDescendants Epic : ",a))},yO=e=>{let t=0,n=[];return e.pipe(df(_g),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>mO(e))),Zh((async e=>{if(e&&Dm(e.type))return n.push(dy(e)),n;const{actionInPayload:t,response:r}=e,a={};aS.setIn(a,"caseInfo.childCases",r?.childCases??[]),r?.uiResources?.resources&&gC(r.uiResources.resources),r?.uiResources?.components&&await yh(r.uiResources.components),r?.uiResources?.localeReferences&&aS.setIn(a,"localeReferences",r.uiResources.localeReferences),r?.uiResources?.childCases_context_data&&aS.setIn(a,"childCases_context_data",r.uiResources.childCases_context_data);const s={data:a,context:t?.context};return n.push(BS(gS,s)),n})),Xh((()=>(VC(n),Bm(n,t),n=[],n))))},EO=e=>{let t,n="",r=[],a={};return e.pipe(df(Ts),Jh((e=>{t=e.payload;const{isFormValid:s}=e.payload;return({actionMgrID:n}=e.payload),s?nf(e.payload).pipe(Zh((e=>(t=e,nf({})))),Zh((async()=>{const{containerItemID:e}=t,s=BC(e),o=e,i=s?.dataInfo.content;delete i.classID;const c=Wr(o),l=FI(c).length,d=FI(c)[l-1]?$I(FI(c)[l-1]):c,u=QI(e),p=CI(u,e)||{},h=p?.referenceList?.replaceAll(".",""),f=p?.subscriptName,g=BC(d),m={containerItemID:d,data:{...g,caseInfo:{content:{...i}}}};r.push(BS(DS,m)),((e,t,n)=>{cI(t)&&e.push(BS(MS,{containerItemID:n,skipReleaseLockRequest:!0}))})(r,o,e);const y=(({itemData:e,workareaContainerData:t,subscriptData:n,pageGroupName:r,activeWorkArea:a,subscriptFieldName:s,actionMgrID:o,containerItemID:i})=>{const c={referenceList:e?.referenceList,ID:t?.caseInfo?.ID,index:n[s],containerName:Ur.MODAL,pageReference:Ur.CASE_INFO.CASE_INFO_CONTENT,viewID:Ur.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW,skipSemanticUrl:!0,actionType:Ur.RESOURCE_STATUS.CREATE,interestPage:`.${r}.${n[s]??""}`,targetProperty:`.${r??""}`,pageGroupName:r,context:a??"",subscriptFieldName:s};return{type:_s,payload:{isInCreateStage:!1,isModalAction:!0,parentContext:"",target:"",...c,actionMgrID:o,containerItemID:i,doDeleteCaseSummary:!1,isFormValid:!0}}})({itemData:p,workareaContainerData:g,subscriptData:i,pageGroupName:h,activeWorkArea:d,subscriptFieldName:f,actionMgrID:n,containerItemID:e});return r.push(y),a=i,r})),Xh((()=>(Th.resolveActionByID(n,a),VC(r),r=[],r)))):(((e,t)=>{const n={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};Th.rejectActionByID(e,!0,n),$g.handleDeferredActionCompletion(t)})(n,e.payload.context),nf([]))})))},IO=[lT,MT,WT,QT,PP,RP,GP,YP,KP,rP,uP,iP,QP,EP,fP,e=>e.pipe(df(Xa),oO((()=>sO(100))),Xh((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:r,isProcessAction:a,isDataObject:s,skipReleaseLockRequest:o,isInCreateStage:i,containerItemID:c,context:l}=e.payload;return Th.resolveActionByID(t),gu.publish(Fr.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:r,hideDelete:!a&&n,isDataObject:s,skipReleaseLockRequest:o,isInCreateStage:i,containerItemID:l||c}),[]}))),e=>e.pipe(df(Va),oO((()=>sO(100))),Xh((e=>{const{actionMgrID:t,context:n,containerName:r,containerItemID:a}=e.payload,s=js(r,n);return Th.resolveActionByID(t),VC(BS(xS,{containerItemID:a,target:s,doDeleteCaseSummary:!1})),[]}))),dO,fO,gO,yO,EO];function AO(){return Pd((function(e,t){e.subscribe(Od(t,Zl))}))}const{RESOURCE_TYPES:CO}=Ur,SO="pyCasePreview",_O=(e,t)=>{const n=zy.isObjectCaseType(e.caseClassName);if(e.key&&!n){const n=QI(e?.context),r=PI(n,e.key),a=e?.context;(r||e.updateData||(e=>{const t=kC();if(!e)return!1;const n=Wr(e),r=QI(n),a=QI(e);if(!r||!a)return!1;const s=CI(r,n),o=CI(a,e);if(!s||!o)return!1;const{key:i}=s;let{key:c}=o;return c||(c=t?.getState().data?.[e]?.caseInfo?.ID),!(!i||!c||i===c)})(a))&&t.actionsOut.push(BS(gS,e))}else t.actionsOut.push(BS(gS,e))},NO=[e=>e.pipe(df(ta),Xh((e=>e.payload)),cf((e=>!Jm(e.actionMgrID))),Zh((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===mI.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=js(mI.PREVIEW,e.context),n=hy(t,mI.PREVIEW,e.context,{buildNew:!0}),r=decodeURI(e.caseId);VC(_S({...e,context:n,target:t,containerItemID:n,key:r,caseViewMode:Fr.REVIEW_MODE,root:{type:"reference",config:{context:Fr.getProperty(Fr.CASE_INFO.CASE_INFO_CONTENT),name:e.viewName,type:"view"}},data:{key:r,caseInfo:{ID:r,progress:!0,error:!1,caseTypeID:e.caseClassName,content:{classID:e.caseClassName}}}})),e.viewLoadingContainer={target:t,context:n}}const n={};if(t.RemoteSystemID)n.RemoteSystemID=t.RemoteSystemID;else if(Vr.isRemoteCase(t.caseClassName)){const{RemoteSystemID:e}=Vr.getRemoteCase(t.caseClassName);n.RemoteSystemID=e}const{restApi:r,reqType:a}=((e,t)=>{let n=i_("loadView",t);e.viewContext===CO.PAGE&&(n=i_(Wa,{page:e.viewName,pageClass:e.pageClass}));const r=Mr.getDefaultQualifiedName(SO);return e.containerName===mI.PREVIEW&&Boolean(e.caseId)&&e.viewContext!==CO.PAGE&&(e.viewName===r||e.viewName===SO)&&(n=i_(za,{caseID:e.caseId,params:{pageName:r}})),n})(e,t);return wd(Wu(zy.appendExcludeQueryParamToUrl(r),{method:a,headers:n},e.context)).pipe(Xh((t=>{const n=decodeURI(e.caseId);let r="";return"string"==typeof t.data?t.data?r=JSON.parse(t.data):(console.error("response data is empty!!"),r={}):r=t.data,{response:{...r,key:n},actionConfig:e,headers:ry(t.headers),rootView:aS.getIn(r,Fr.ROOT)}})),hf(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),Zh((async e=>{const t={};if(e?.type===ba){if(t.actionsOut=dy(e),e?.payload?.context?.includes(mI.PREVIEW)){const n={...BC(e.payload.context),caseInfo:{progress:!1,error:!0}},r=js(mI.PREVIEW,e.payload.context);t.actionsOut=BS(DS,{key:n.key,target:r,containerName:mI.PREVIEW,context:e.payload.context,containerItemID:e.payload.context,data:n})}return t}try{t.actionMgrID=e?.actionConfig?.actionMgrID,t.rootView=e?.rootView;const{actionConfig:n,response:r,headers:a}=e;e?.actionConfig?.skipAssignmentsUpdate&&(delete r?.data?.caseInfo?.assignments,delete r?.data?.caseInfo?.availableActions,delete r?.data?.caseInfo?.availableProcesses);const{containerItemID:s,containerName:o}=n,{target:i,context:c}=(e=>{const{containerName:t,updateData:n,viewLoadingContainer:r}=e,a=t||Oh.getTargetViewContainerName(Wa),s=r?.target??js(a,e.context);return{target:s,context:r?.context??(t===mI.PREVIEW&&n?e.context:hy(s,a,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let d={};d=sm(r),d.directUrlUpdation=!1,await oy(d,n,l);const u={...n,target:i,context:c,containerItemID:s||c,headers:a},p=sy(d,u);if(p.resourceType=CO.CASE,n.viewName===Fr.PY_CONFIRM&&(p.caseViewMode=Fr.REVIEW_MODE,aS.setIn(p.data,["context_data","caseViewMode"],Fr.REVIEW_MODE)),o&&!p.updateData){p.caseViewMode=Fr.REVIEW_MODE,aS.setIn(p.data,["context_data","caseViewMode"],p.caseViewMode);const e=QI(p?.context);((e,t,n,r,a)=>{e&&a===mI.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,Km(n,n),r.actionsOut=BS(DS,{...n,containerName:a})):e?(r.actionsOut=[],r.actionsOut.push(BS(xS,{target:t,containerItemID:e}))):r.actionsOut=BS(_S,{...n,containerName:a})})(PI(e,p.key),e,p,t,o)}else{p.preserveClientChanges=!0,t.actionsOut=[],o===mI.PREVIEW&&t.actionsOut.push({type:fs,payload:{context:c,skipMergeAssignmentsAndActions:!1}});const{viewName:e}=n;e===Mr.getDefaultQualifiedName(SO)&&Km(p,p),_O(p,t)}}catch(e){console.error(e),t.rootView={type:"error",payload:e}}const{caseId:n,context:r,viewName:a}=e.actionConfig;return a===Mr.getDefaultQualifiedName(SO)&&(e=>{gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:r}),t})),Xh((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(Th.resolveActionByID(n,e),Lr.setNeedsMapping(!1),t)))),e=>{let t=0,n=[];return e.pipe(df(na),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>{gu.publish(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:r,viewName:a,className:s,skipSemanticUrl:o=!1,containerName:i=Oh.getTargetViewContainerName(Wa)}=e,c=n&&{...xu.addDebugHeaders(n)},l=js(i,r);let d="";if(!o){const{semanticURL:t,activate:n,activateContainerActionPayload:r}=Ay(a,s,l);if(d=t,n)return Oy(r),nf({type:Ua,activateContainerActionPayload:r,actionConfig:e})}return wd($I(l)?my(l,{loadingContext:r}):Promise.resolve({continueExecution:!0,removeActionPayload:{}})).pipe(Zh((({continueExecution:n,removeActionPayload:i})=>{if(!n)return Th.rejectActionByID(t),uf;const{restApi:l,reqType:u}=i_(Wa,{page:a,pageClass:s});return wd(Wu(l,{method:u,headers:c},r)).pipe(Xh((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:d,semanticURL:d},actionConfig:e,headers:ry(t.headers),removeActionPayload:i,skipSemanticUrl:o}})),hf(": Error ocurred during ajax call at showPage Epic : ",e.context))})))})),Zh((async e=>{const t={};if(t.actionManagerID=e?.actionConfig?.actionMgrID,e&&e.type===ba)return n.push(dy(e)),t;let{type:r}=e;const{actionConfig:a,skipSemanticUrl:s}=e,o=a.containerName||Oh.getTargetViewContainerName(na),i=js(o,a.context);gu.publish(Ur.PUB_SUB_EVENTS.EVENT_PREVIEW_DISMISS,{pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),gu.publish(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className});const{remoteCasePayload:c,updatedType:l}=((e,t,n,r)=>{let a={},s=e;if(n.isRemoteCase){a={...n};const e=PI(r,a.insKey);e&&(t.activateContainerActionPayload={containerItemID:e},s=Ua)}return{remoteCasePayload:a,updatedType:s}})(r,e,a,i);if(r=l??r,a.isDeferLoaded){const{response:r,headers:o={}}=e,{isCreateDataObject:c,context:l}=a,d=sm(r,{isCreateDataObject:c});d.directUrlUpdation=!s;const u={acName:i,context:l};await oy(d,a,u);const p=sy(d,{containerItemID:l,target:i,headers:o,context:l});t.rootView=aS.getIn(d,Fr.ROOT),n.push(BS(gS,p))}else if(r===Ua){const{activateContainerActionPayload:{semanticURL:t,containerItemID:r}}=e,s={acName:i,context:MI(r)};a.isTraditionalRemoteCase||await oy({directUrlUpdation:!0,semanticURL:t},a,s,!0),n.push(BS(xS,{target:i,containerItemID:r}))}else{const t=hy(i,o,a.context),{response:r,headers:l={},removeActionPayload:d}=e,u=sm(r,{isCreateDataObject:a.isCreateDataObject});u.directUrlUpdation=!s;const p={acName:i,context:t},h=Qm(t);await oy(u,a,p);const f={target:i,context:t,containerItemID:t,headers:l,debugInfo:a.debugInfo,currentCaseViewMode:h,referenceList:a?.referenceListStr,subscriptName:a?.subscriptName},g=sy(u,f);g.resourceType=Ur.PAGE,a.isCreateDataObject&&(g.resourceType=Ur.RESOURCE_TYPES.DATA,g.resourceStatus=Ur.RESOURCE_STATUS.CREATE,delete g.data.caseInfo,g.referenceList=a.referenceListStr,g.subscriptName=a.subscriptName),((e,t,n)=>{e.isRemoteCase&&(n.resourceType=Ur.CASE,n.key=zy.getRemoteCaseKey(t.assignmentID,t.insKey),n.data.caseInfo={...n.data.caseInfo,...t,classID:t.className,target:n.target,containerItemID:n.containerItemID,caseTypeID:t.className,content:{pyLabel:t.name,pyID:$m(zy.getRemoteCaseKey(t.assignmentID,t.insKey))}},py(n.data,t.remoteCaseMeta),n.isTraditionalRemoteCase=e.isTraditionalRemoteCase||!1,n.className=t.className)})(a,c,g),g.data??={},g.data.traditionalGadgetId=zy.getUniqueGadgetId();const m=uy(i,g);d.containerItemID&&fy(m)&&n.push(BS(MS,{containerItemID:d.containerItemID,target:i})),n.push(m)}return gu.publish(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:i,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),t})),Xh((({actionManagerID:e=0,rootView:t})=>{Th.resolveActionByID(e,t),VC(n),n=[]})),AO())}],bO=(e,t,n)=>{const{context:r,pageName:a,dataContext:s,dataContextParameters:o,semanticURL:i,skipSemanticUrl:c,RemoteSystemID:l}=e,{removeActionPayload:d}=t,{restApi:u,reqType:p,body:h}=i_(Ha,{pageName:a,dataContext:s,dataContextParameters:o}),f={};return f.RemoteSystemID=l,wd(Wu(u,{method:p,headers:f,body:h},r)).pipe(Xh((t=>({response:{...t.data,key:i,semanticURL:i},actionConfig:e,headers:ry(t.headers),removeActionPayload:d,skipSemanticUrl:c}))),hf("Error occurred during ajax call at showData Epic : ",e.context,String(n)))},{RESOURCE_TYPES:TO}=Ur,PO=e=>{const{dataViewName:t,context:n,dataViewParameters:r}=e,a={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(r))},{restApi:s,reqType:o}=i_("deleteDataObject",a);return wd(Wu(s,{method:o},n)).pipe(Xh((t=>({response:t.data,actionInPayload:e}))),hf("Error occurred during ajax call at deleteDataObject Epic",n))},OO=e=>{const{dataViewID:t,dataViewParameters:n,context:r}=e,a={data_view_ID:t},{restApi:s,reqType:o}=i_("getDataObjectActions",a);return wd(Wu(s,{method:o,body:{dataViewParameters:n}},r)).pipe(Xh((e=>({...e.data}))),hf("Error occurred during ajax call at GET data object actions : ",e.context))},DO=[e=>{let t,n=0,r=[];return e.pipe(df(ra),gP((e=>(({actionMgrID:n}=e.payload),nf(e.payload).pipe(Zh((e=>((e,t)=>{const{context:n,pageName:r,dataContext:a,dataContextParameters:s,skipSemanticUrl:o=!1,isDeferLoaded:i=!1,parentAction:c="",resourceType:l,containerName:d,RemoteSystemID:u}=e,p=js(d,n);let h="";const f={context:n,pageName:r,dataContext:a,dataContextParameters:s,semanticURL:h,skipSemanticUrl:o,containerName:d,isDeferLoaded:i,parentAction:c,resourceType:l,RemoteSystemID:u};if(!o){h=s_(Ha,{pageName:r,dataViewName:a},s),f.semanticURL=h;const{activate:o,activateContainerActionPayload:i}=Ey(TO.PAGE,p,{semanticURL:h});return o?nf({type:Ua,activateContainerActionPayload:i,actionConfig:e}):wd(my(p,{loadingContext:n})).pipe(Zh((({continueExecution:e,removeActionPayload:n})=>e?bO(f,{removeActionPayload:n},t):(Th.rejectActionByID(t),uf))))}return bO(f,{removeActionPayload:{}},t)})(e,n))),Zh((async e=>{if(e&&e.type===ba)return r.push(dy(e)),r;const{type:n,actionConfig:a,headers:s,response:o,skipSemanticUrl:i}=e;t=aS.getIn(o,Fr.ROOT);const{containerName:c,parentAction:l,resourceType:d}=a,u=js(c,a.context);let p;const h=Qm(a?.context);if(a.isDeferLoaded){p=sm(o),p.directUrlUpdation=!i;const t={acName:u,context:a.context};await oy(p,a,t);const n={target:u,headers:s,context:a.context,containerItemID:e.containerItemID},c=sy(p,n);return r=BS(gS,c),r}if(n===Ua){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,s={acName:u,context:MI(n)};await oy({directUrlUpdation:!0,semanticURL:t},a,s,!0),r.push(BS(xS,{target:u,containerItemID:n,resourceType:TO.DATA}))}else if("DATA"===d&&l===Ss){const{context:e}=a,t=o?.data,n={context:e,data:t};r.push(BS(gS,n))}else{const t=hy(u,c,a.context),{removeActionPayload:n}=e;p=sm(o),p.directUrlUpdation=!i;const l={acName:u,context:t};await oy(p,a,l);const d=sy(p,{target:u,context:t,containerItemID:t,headers:s,currentCaseViewMode:h});d.resourceType=TO.DATA;const f=uy(u,d);n.containerItemID&&fy(f)&&r.push(BS(MS,{containerItemID:n.containerItemID,target:u})),Sy(r),r.push(f)}return r})),Xh((()=>(Th.resolveActionByID(n,t),VC(r),r=[],r))))))))},e=>{let t=0,n=[];return e.pipe(df(ys),ff(100),Jh((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Th.rejectActionByID(t,!0,e),nf([])}return nf(e.payload).pipe(Zh((e=>gf(e))),Zh((async e=>{if(e&&e.type===ba){const{payload:r}=e,a=dy({...e,...r,actionMgrID:t});return n.push(a),{actionsOut:n,data:void 0}}const{actionInPayload:r}=e,{containerItemID:a,isModalAction:s}=r,o=s?mI.MODAL:mI.PRIMARY,i={target:js(o,a),containerItemID:a,context:a};return n.push(BS(MS,i)),{actionsOut:n,data:e?.response}})),Xh((({data:e})=>(1===n.length&&Dm(n[0].type)?Th.rejectActionByID(t):Th.resolveActionByID(t,e),VC(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(df(Is),ff(100),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>mf(e))),Zh((async e=>{if(e&&e.type===ba){const{payload:r}=e,a=dy({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r,response:a,headers:s={}}=e,{containerName:o,readOnly:i,actionName:c}=r,l=js(o,r.context),d=hy(l,o,r.context),u={acName:l,context:d};if(a?.data?.dataInfo){const{dataInfo:e}=a.data;e.dataContext||=r.dataLookUp,e.dataContextParameters||=r.requestPayload}await oy(a,r,u);const p=sy(a,{target:l,context:d,containerItemID:d,headers:s});return p.resourceType=Ur.RESOURCE_TYPES.DATA,p.resourceStatus=Ur.RESOURCE_STATUS.UPDATE,p.readOnly=i,p.actionName=c,p.key=JSON.stringify(r.requestPayload),n.push(BS(_S,p)),n})),Xh((()=>(1===n.length&&Dm(n[0].type)?Th.rejectActionByID(t):Th.resolveActionByID(t),VC(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(df(As),ff(100),Jh((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Th.rejectActionByID(t,!0,e),nf([])}return nf(e.payload).pipe(Zh((e=>yf(e))),Zh((async e=>{if(e&&e.type===ba){const{payload:r}=e,a=dy({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r}=e,{containerItemID:a,isModalAction:s}=r,o=s?mI.MODAL:mI.PRIMARY,i={target:js(o,a),containerItemID:a,context:a};return n.push(BS(MS,i)),n})),Xh((()=>(1===n.length&&Dm(n[0].type)?Th.rejectActionByID(t):Th.resolveActionByID(t),VC(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(df(Es),ff(100),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>PO(e))),Zh((async e=>{if(e&&e.type===ba){const{payload:r}=e,a=dy({...e,...r,actionMgrID:t});return n.push(a),n}return[]})),Xh((()=>(1===n.length&&Dm(n[0].type)?Th.rejectActionByID(t):Th.resolveActionByID(t),VC(n),n=[],n))))},e=>{let t=0,n=[];let r={};return e.pipe(df(_a),ff(100),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>OO(e))),Zh((async e=>e&&e.type===ba?(n.push(dy(e)),n):(r=e,[]))),Xh((()=>(1===n.length&&Dm(n[0].type)?Th.rejectActionByID(t):Th.resolveActionByID(t,r),VC(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(df(Cs),ff(100),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>Ef(e))),Zh((async e=>{if(e&&e.type===ba){const{payload:r}=e,a=dy({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r,response:a,headers:s={}}=e,{containerName:o,actionID:i,context:c,actionName:l}=r,d=js(o,r.context);let u=Hr(o,c);u=Kr(c,u);const p={target:d,context:u,containerItemID:u,headers:s,resourceType:Ur.RESOURCE_TYPES.DATA,resourceStatus:Ur.RESOURCE_STATUS.OPEN_FLOW_ACTION,key:JSON.stringify(r.dataViewParameters),actionID:i,actionName:l};if(a?.data?.dataInfo){const{dataInfo:e}=a.data;e.dataContext||=r.lookupDatapage,e.dataContextParameters||=r.dataViewParameters}const h={acName:d,context:c};await oy(a,r,h);const f=sy(a,p);return n.push(BS(_S,f)),n})),Xh((()=>(1===n.length&&Dm(n[0].type)?Th.rejectActionByID(t):Th.resolveActionByID(t),VC(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(df(Ss),ff(100),Jh((e=>{const{isFormValid:r}=e.payload;({actionMgrID:t}=e.payload);const a=e.payload.context;if(!r){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Th.rejectActionByID(t,!0,e),nf([])}return ou({context:a,stateObj:BC(a),clearContextMessages:!0}),nf(e.payload).pipe(Zh((e=>If(e))),Zh((async e=>{if(e&&e.type===ba){iE(e,"dataObject");const{payload:r}=e,a=dy({...e,...r,actionMgrID:t});return n.push(a),n}const{actionInPayload:r,response:a,headers:s={}}=e,{containerName:o,containerItemID:i,resourceType:c,key:l}=r,d=js(o,r.context),u={acName:d,context:r.context};await oy(a,r,u);const p={key:l,target:d,resourceType:c,containerItemID:i,headers:s,context:r.context};return n=((e,t,n,r)=>{const{resourceType:a,key:s,containerItemID:o}=r,i=sy(n,t);i.resourceType=a||Ur.RESOURCE_TYPES.DATA;const c=Qr(o);e.push(BS(MS,i));const l=HC(".dataContext","dataInfo",c),d=HC(".dataContextParameters","dataInfo",c),u={context:c,skipSemanticUrl:!0,resourceType:a,parentAction:Ss,dataContext:l,dataContextParameters:d},p=l&&d&&s_(Ha,{pageName:Fr.PY_DETAILS,dataViewName:l},d)||"";if(o?.includes(Fr.PREVIEW)){const t={type:ra,payload:{pageName:Fr.VIEW_NAMES.PY_DATA_PREVIEW,container:Fr.PREVIEW,containerName:Fr.PREVIEW,...u}};e.push(t)}else if(a!==Fr.PAGE&&s===p&&o?.includes(Fr.PRIMARY)){const t={type:ra,payload:{pageName:Fr.VIEW_NAMES.PY_DETAILS,containerName:"",...u}};e.push(t)}return e})(n,p,a,{key:l,resourceType:c,containerItemID:i}),n})),Xh((()=>(1===n.length&&Dm(n[0].type)?Th.rejectActionByID(t):Th.resolveActionByID(t),VC(n),n=[],n))))})))}];function vO(e,t){return void 0===t&&(t=nO),Pd((function(n,r){var a=null,s=null,o=null,i=function(){if(a){a.unsubscribe(),a=null;var e=s;s=null,r.next(e)}};function c(){var n=o+e,s=t.now();if(s<n)return a=this.schedule(void 0,n-s),void r.add(a);i()}n.subscribe(Od(r,(function(n){s=n,o=t.now(),a||(a=t.schedule(c,e),r.add(a))}),(function(){i(),r.complete()}),void 0,(function(){s=a=null})))}))}const{RESOURCE_TYPES:{CASE:RO,DATA:$O,OBJECT:xO}}=Ur;let wO=[],MO=!1,LO=!1,UO=null,FO=null;const jO={},kO=[e=>e.pipe(df(Na),vO(200),Xh((e=>e.payload)),Zh((e=>{LO=!1,gu.subscribe(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{LO=!0}));const t=yu.getPreviewMode()&&xu.addDebugHeaders({debugId:aS.generateUniqueID()});jO.dataContext=e.payload.dataViewName,jO.dataContextParameters=e.payload.dataViewKeys;const{context:n,requestType:r,routeKey:a}=e;let{routeEndpoint:s}=e;s&&(s.indexOf("viewType={viewType}")>0?s=s.replace("{viewType}","page"):s.indexOf('viewType=""')>0&&(s=s.replace('viewType=""','viewType="page"'))),MO=a===Ms,MO&&Lr.setNeedsMapping(!0);const o=an()+s,i=e.options.context;let c;const l={},d=e?.payload?.caseClassName;if(Vr.isRemoteCase(d)){const{RemoteSystemID:e}=Vr.getRemoteCase(d);l.RemoteSystemID=e}if(PA.isWSSPortal()&&(l[Fr.X_ORIGIN_CHANNEL]="WSS"),"POST"===r){c=e.payload,s.indexOf("viewType=")<0&&(s=`${s}?viewType=page`);let i;switch(_y(a)){case RO:case xO:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case $O:i=jO;break;default:i=c}return wd(Wu(o,{method:r,body:i,headers:{...l,...t}},n)).pipe(Xh((t=>({response:{...t.data},payload:e,headers:ry(t.headers,"",l)}))),hf(": Error occurred during ajax call at historyEpic : ",e))}return wd(Wu(zy.appendExcludeQueryParamToUrl(o),{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(Xh((n=>({response:n.data,payload:e,headers:{...ry(n.headers),...t}}))),Md((r=>{if(a===os){const n={messages:[{type:"error",message:r.response.data.errorDetails[0].localizedValue}],category:"PAGE"};Nh.setComponentCache("assignments-launchAssignment-Error",n);const a=vf(SA()),s=bA.getEndPointInfo(a.split("/assignments")[0]),o=an()+s.routeEndpoint;return e={...e,routeKey:za,resetSemanticURL:!0},wd(Wu(o,{method:s.reqType,headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(Xh((n=>({response:n.data,payload:e,headers:{...ry(n.headers),...t}}))))}return nf(GS(": Error occurred during ajax call at historyEpic : ",r,n))})))})),Zh((async e=>{if(LO)return wO;if(gu.subscribe(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{LO=!0})),e&&e.type===ba)return dy(e);const{headers:t={},response:n,payload:r}=e,a=sm(n,{[Ur.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),s=r.options.acName,o=VI(s)&&GI(s)?$I(s):e.payload.options.context,i=o;t.RemoteSystemID=r?.payload?.RemoteSystemID,FO={target:s,context:o,containerItemID:i,headers:t,debugInfo:{debugId:t[Fr.COREHEADER_APP_DEBUG_ID]}};let c=r?.payload?.pageClass;const l=r?.payload?.page,d=MO?Ms:za,u=MO?r.payload.objectID:r.payload.workID,p=MO?"{objectID}":"{workID}";let h=MO?`objects/${u}`:"";r?.payload?.caseName&&u&&(h=s_(d,{caseName:e.payload.payload.caseName}),h=h?.replace(p,u)||"",c=r?.payload?.caseClassName),(r?.routeKey===os||r?.resetSemanticURL)&&((e,t)=>{const n=Mm(t);let r=s_(za,{caseClassName:xm(t)},{id:n});r=r?.replace("{workID}",String($m(n))).replace("{id}",String($m(n))),g_({directUrlUpdation:!0,semanticURL:r,options:{}})})(0,a),((e,t)=>{const n=t?.data?.caseInfo;e===os&&n?.caseTypeID&&n?.content&&Gm(n.caseTypeID)&&(n.content.coexistenceAction=Ka)})(r?.routeKey,a),(e=>{const t=e?.data?.caseInfo;if(!t)return;const{ID:n,caseTypeID:r}=t;n&&r&&Gm(r)&&(e.data.caseID=n)})(a),gu.publish(Ur.PUB_SUB_EVENTS.EVENT_PREVIEW_DISMISS,{pageName:l,pageClass:c}),gu.publish(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:l,pageClass:c});const f=aS.getIn(a,Fr.COMPONENTS);f&&await yh(f),Jp(a,r.options.actionConfig,!0),gu.publish(Ur.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:s,pageName:l,pageClass:c});let g=sy(a,FO);return g=((e,t,n)=>{if(e===ey.CASE||e===ey.OBJECT||e===ey.ASSIGNMENT){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:r}=cy(t.caseInfo.assignments[0].ID);n.key=e||t.caseInfo.ID,n.flowName=r}else n.flowName="",n.key=t?.caseInfo?.ID||t?.objectInfo?.ID||t.semanticURL;n.resourceType=e,n.semanticURL=t.semanticURL,e===ey.ASSIGNMENT?(n.caseViewMode=Fr.PERFORM_MODE,n.resourceType=ey.CASE):n.caseViewMode=Fr.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})(_y(e.payload.routeKey),{...n.data,semanticURL:h,caseViewMode:Fr.REVIEW_MODE},g),g.data.traditionalGadgetId=zy.getUniqueGadgetId(),wO.push(uy(s,g)),UO=a,((e,t)=>{let n=Nh.getComponentCache("assignments-launchAssignment-Error")||{};n&&"object"==typeof n&&Object.keys(n).length>0&&(n={...n,context:e},t.push(BS(wS,n)),Nh.resetComponentCache("assignments-launchAssignment-Error"))})(o,wO),wO})),Xh((()=>(LO||VC(wO),UO&&FO&&Km(UO,FO),wO=[],MO=!1,LO=!1,FO=null,UO=null,wO))),hf("Error occurred"))],VO=[e=>{let t=0;return e.pipe(df(ls),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Xh((()=>{const e=kC()?.getState(),n=jb();return Xt(e,n)&&t>0?Th.resolveActionByID(t,{}):Th.rejectActionByID(t),[]})),AO())}],BO=[e=>{let t=0,n=[];return e.pipe(df(aa),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:r}=e;let a,s="";n||(s=s_(qa,{insightID:"{insightID}"}),s=s.replace("{insightID}",r),a=bA.getEndPointInfo(s));const{restApi:o,reqType:i}=i_(qa,{...a?.payload||[],insightID:r});return wd(Wu(o,{method:i},t)).pipe(Xh((t=>{let r={};return r="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...r,key:s,semanticURL:s},actionConfig:e,skipSemanticUrl:n}})),hf(": Error occurred during ajax call at showPage Epic : ",e.context))})),Zh((async e=>{if(e&&e.type===ba)return n.push(dy(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,a=Oh.getTargetViewContainerName(na),s=js(a,t.context),o=hy(s,a,t.context),{response:i}=e,c=sm(i);c.directUrlUpdation=!r;const l={acName:s,context:o},d=!r,u=r;await oy(c,t,l,d,u);const p=sy(c,{target:s,context:o,containerItemID:o});p.resourceType=Ur.PAGE;const h=uy(s,p);return n.push(h),n})),Xh((()=>{Th.resolveActionByID(t),VC(n),n=[]})),AO())}],GO=[e=>{let t=0,n=[];return e.pipe(df(sa),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:r}=e;let a="";n||(a=s_(Ya,{dashboardID:r}),a=a.replace("{dashboardID}",r));const{restApi:s,reqType:o}=i_(Ya,{dashboardID:r});return wd(Wu(s,{method:o},t)).pipe(Xh((t=>{let r={};return r="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...r,key:a,semanticURL:a},actionConfig:e,skipSemanticUrl:n}})),hf(": Error occurred during ajax call at showPage Epic : ",e.context))})),Zh((async e=>{if(e&&e.type===ba)return n.push(dy(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,a=Oh.getTargetViewContainerName(na),s=js(a,t.context),o=hy(s,a,t.context),{response:i}=e,c=sm(i);c.directUrlUpdation=!r;const l={acName:s,context:o},d=!r,u=r;await oy(c,t,l,d,u);const p=sy(c,{target:s,context:o,containerItemID:o});p.resourceType=Ur.PAGE;const h=uy(s,p);return n.push(h)})),Xh((()=>{Th.resolveActionByID(t),VC(n),n=[]})),AO())}],WO=(e,t)=>{const{class:n,context:r,viewType:a=ty.PAGE}=e,{removeActionPayload:s}=t,o=e?.pageName?e?.pageName:PA.getDefaultCasePage();return wd(Zp.createCase(n,{...e,pageName:o,viewType:a,context:r})).pipe(Xh((({response:t,headers:n})=>(Lr.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:s}))),hf("Error occurred during ajax call at createObject Epic : ",r))},HO="CREATE_OBJECT",qO=e=>{let t,n=0,r=[],a={};let s=!1;return e.pipe(df(HO),ff(100),Jh((e=>{if(({actionMgrID:n}=e.payload),zy.isExternalObject(e.payload.class)&&!Gy(e.payload.context)){const e={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Th.rejectActionByID(n,!0,e),nf([])}return nf(e.payload).pipe(Zh((e=>{const{context:r}=e;t=e.class;const a=PT(e),o=js(a,r);return s=!1,wd(rT(o,{loadingContext:r})).pipe(Zh((({continueExecution:t,removeActionPayload:r,dirtyCheckPerformed:a})=>t?(s=a,WO(e,{removeActionPayload:r})):(Th.rejectActionByID(n),uf))))})),Zh((async e=>{if(e&&e.type===ba)return e.payload.context=((e,t)=>zy.isExternalObject(e)&&t?t:hA())(t,e.payload.context),r.push(dy(e)),r;const{actionInPayload:o,response:i,headers:c,removeActionPayload:l}=e,d=RT(o,i);aS.setIn(i.data,Fr.getProperty(Fr.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const u=PT({...o,isInCreateStage:d}),p=js(u,o.context),h=hy(p,u,o.context);if(((e,t)=>{zy.isExternalObject(e.class)&&(e.containerItemID=e.context,pT(t,e))})(o,r),!s&&((e,t,n)=>!Pm(e)&&VI(t)&&!zy.isExternalObject(n))(u,p,t)){const{continueExecution:e}=await my(p,{loadingContext:o.context});if(!e)return Th.rejectActionByID(n),r}if(((e,t)=>!e&&!t)(o?.openCaseViewAfterCreate??!0,d)){const{businessID:e,caseType:t,resolvedURL:n}=Uh(i);return a={id:e,label:t,href:n},oT(a),iT({caseId:e,caseType:t}),r}(e=>{zy.isExternalObject(e.class)&&oT({content:$A().getLocaleValue("Successfully submitted!","Assignment")})})(o);const f=sm(i),g=String($m(xh(f)));let m=s_(ws,{caseClassName:$h(f)});m=m.replace(/{.+?}/,g),f.semanticURL=m,Nh.setComponentCache(g,xu.addDebugHeaders(o.debugInfo)),DT(f,o);const y={acName:p,context:h};await oy(f,o,y);const E={target:p,context:h,headers:c,semanticURL:m,caseViewMode:vT(f),containerItemID:h,isInCreateStage:d,isMinimizable:d,assignmentContext:aS.getIn(f,tT),nextAssignmentInfo:aS.getIn(f,eT),resourceType:Ur.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:o.openCaseViewAfterCreate,modalOptions:o.modalOptions,debugInfo:o.debugInfo};wh(E,f);const I=sy(f,E),A=uy(p,I);return((e,t,n)=>{if(fy(e)){const{removeActionPayload:e,target:r}=t;Um(n,{removeActionPayload:e,target:r})}})(A,{removeActionPayload:l,target:p},r),r.push(A),r})),Xh((()=>(by(r),Bm(r,n),setTimeout((()=>(e=>{zy.isExternalObject(e)&&Lr.setNeedsMapping(!1)})(t))),a={},r=[],r))))})))},YO=(e,t)=>{const{assignmentID:n,actionID:r,caseID:a,context:s,additionalHeaders:o={},jsActionQueryParams:i}=e,{state$:c}=t,l=ty.PAGE,d="executeObjectWideAction",u={assignmentID:n,actionID:r,viewType:l,objectID:a};let{restApi:p}=i_(d,u);const{reqType:h}=i_(d,u);l&&!p?.includes("viewType=")&&(p=p?.includes("?")?`${p}&viewType=${l}`:`${p}?viewType=${l}`),p=oE(i,p),e.viewType=l;const{content:f}=ay(s,{isObjectWideAction:!0}),g=c.value.data[s]?.objectInfo?.headers||{},{etag:m}=g,y={"if-match":m,...o};return wd(Wu(p,{method:h,body:f,headers:y},s)).pipe(Xh((t=>{const{data:n,headers:r}=t;return Lr.analyseResponse(t.data),{actionInPayload:e,response:n,headers:ry({...y,...r})}})),hf("Error occurred during ajax call at executeObjectWideAction Epic : ",s))},zO=(e,t)=>{const{isCaseWideAction:n}=t;return{isCaseWideAction:n,caseID:xh(e)}},{RESOURCE_TYPES:KO}=Ur,QO=(e,t)=>{let n=0,r=[],a={},s="";return e.pipe(df(Rs),Jh((e=>{if(({actionMgrID:n}=e.payload),s=e.payload.context,ou({context:s,stateObj:BC(s),clearContextMessages:!0}),!Gy(s)){const t={type:Ur.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return Th.rejectActionByID(n,!0,t),$g.handleDeferredActionCompletion(e.payload.context),nf([])}return nf(e.payload).pipe(Zh((e=>{uT(r,e);const n={...e};return YO(n,{state$:t})})),Zh((async e=>{if(e?.type===ba){const t=dy(e);return r.push(t),r}Ig.clearContextedCache(s);const{headers:t,actionInPayload:o,response:i}=e,{containerItemID:c,isModalAction:l,isInCreateStage:d}=o,u=QI(c);o.target=u,aS.setIn(i.data,Fr.OBJECT_INFO_IS_LOCAL_ACTION,!1),ZT({submitResponse:i});let p=sm(i,{[Ur.STOPMERGEACTIONS]:!i.nextAssignmentInfo});const h=$h(p),f=Wr(o.context),g=FI(f)[0]?$I(FI(f)[0]):f,m=(e=>{const t=Mh(e);return Qy(t)&&Jy(PA.getOperatorIdentifier(),t)})(p),y=d&&!m;!l||d||yT(o.context,g)||(p=Cy(p,BC(c)));const E=sy(p,{headers:t,actionMgrID:n,directUrlUpdation:!1});((e,t)=>{const{attachmentsExist:n}=t;n&&aS.setIn(e,Ur.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),aS.setIn(e,Ur.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())})(E.data,o),E.caseClassName=h,E.resourceType=KO.ASSIGNMENT,E.headers=t;const I=xh(p);wh(E,p);const A=s_(ws,{caseClassName:h}).replace(/{.+?}/,String($m(I)));p.semanticURL=A,E.semanticURL=A,await _T(o,E,!1,I,p,r,e,i,!0),y&&(a=ET(o),iT({caseId:o.caseID,caseType:o.caseTypeID,assignmentId:o.assignmentID})),((e,t)=>{const n=$h(e?.response),r=Mh(e?.response),{caseTypeID:a}=r,s=PA.getFeatureMap();(s?.deferUpdateCaseSummaryView??!Object.hasOwn(s,Fr.DEFER_UPDATE_CASESUMMARY_VIEW))&&a&&yC(Fr.CASESUMMARY_VIEW_NAME,a)&&Hm(t,e?.actionInPayload,e?.response,{caseClassName:n})})(e,r),$g.handleDeferredActionCompletion(s),NT(E,o,g);const C=zO(p,o);return Pg({...C,containerItemID:c}),gT(r,{transientItemID:c,target:u,isModalAction:l}),r})),Xh((()=>{const e=r.find((e=>e.type===ba));return e?($g.handleDeferredActionCompletion(s),bT(e),Th.rejectActionByID(n)):Th.resolveActionByID(n,a),by(r),Lr.setNeedsMapping(!1),r=[],a={},r})))})))},JO=(e,t)=>{const{insKey:n,headers:r,context:a,debugInfo:s,viewType:o}=e,{removeActionPayload:i}=t,c=e.pageName?e.pageName:Fr.VIEW_NAMES.PY_DETAILS,l=i_(Ms,{objectID:n,params:{pageName:c}});let{restApi:d}=l;const{reqType:u}=l;return"none"===o&&(d=`${d?.split("viewType")[0]}viewType=none`),wd(Wu(d,{method:u,headers:{...r,...s&&{...xu.addDebugHeaders(s)}}},a)).pipe(Xh((t=>(Lr.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:ry({...r,...t.headers}),removeActionPayload:i}))),hf("Error occurred during ajax call at getObject Epic : ",a))},XO="GET_OBJECT",{RESOURCE_TYPES:ZO}=Ur,eD=async(e,t)=>{const{actionInPayload:n,activateContainerActionPayload:r,type:a,response:s,removeActionPayload:o,headers:i}=e,{context:c,skipBrowserSemanticUrlUpdate:l,debugInfo:d}=n,u=Nm(Ms,n),p=js(u,c);if(Om(a))await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:r},actionInPayload:a,actionInPayload:{context:s,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=Nm(Ms,a),l=js(c,s),d=MI(r);await oy({directUrlUpdation:!o,semanticURL:n},a,{acName:l,containerName:c,target:l,context:d}),e.push(BS(xS,{containerItemID:r,target:l,context:d,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:r,actionInPayload:n});else{const e=hy(p,u,c,{buildNew:!0}),r=sm(s),a=(e=>{const t=xh(e),n=$h(e);let r=s_(Ms,{objectClassName:n});return r=r?.replace("{objectID}",String($m(t))),r})(r);r.semanticURL=a,r.directUrlUpdation=!l;const h={acName:p,context:e};await oy(r,n,h);const f=sy(r,{target:p,context:e,containerItemID:e,semanticURL:a,headers:i,debugInfo:d});f.caseViewMode=Fr.REVIEW_MODE,f.resourceType=ZO.OBJECT,wh(f,r);const g=uy(p,f);o.containerItemID&&fy(g)&&t.push(BS(MS,{containerItemID:o.containerItemID,target:p})),t.push(g)}const h=n.insKey;Og({caseKey:h,actionInContext:c})},tD="OPEN_OBJECT_ACTION",nD=e=>{const{actionID:t,caseID:n,context:r,openActionType:a,modalLoadingContainer:s}=e,o=ty.FORM,i=i_(Ls,{objectID:n,actionID:t,viewType:o}),{reqType:c}=i;let{restApi:l}=i;e.actionType=Fr.RESOURCE_TYPES.OBJECT,l&&!l.includes("viewType=")&&(l=l.includes("?")?`${l}&viewType=${o}`:`${l}?viewType=${o}`);const d=s?.context??r;return wd(Wu(l,{method:c,headers:{}},d)).pipe(Xh((t=>(Lr.analyseResponse(t.data),{response:t.data,actionInPayload:e,headers:ry(t.headers)}))),hf(`: Error occurred during ajax call at ${a} Epic : `,d))},rD=async(e,t,{headers:n,actionInPayload:r})=>{const{context:a,actionName:s,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=r,l=sm(e,{info:Ur.OBJECT_INFO.OBJECT_INFO}),d=Nm(o,r),u=c?.target??js(d,a),{context:p,containerItemID:h,isNewContainerItem:f}=((e,t,n,r)=>{let a,s,o=!1;const i=BI(e);return!GI(e)||i&&!bI(e,r)?(s=Hr(t,n),Pm(t)&&(s=Kr(n,s)),a=s,o=!0):(a=i?PI(e,r):$I(e),s=MI(a)),{context:s,containerItemID:a,isNewContainerItem:o}})(u,d,a,e.data.objectInfo.ID),g={acName:u,target:u,containerName:d,context:p};await oy(l,r,g);const m=l.uiResources?.root,y=(e=>e?Fr.PERFORM_MODE:Fr.REVIEW_MODE)(m),E=sy(l,{target:u,context:p,containerItemID:h,caseViewMode:y,doDeleteCaseSummary:i,headers:n,actionName:s,isMinimizable:!1,isInCreateStage:Pm(d),resourceType:Ur.RESOURCE_TYPES.OBJECT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,actionType:r.actionType});if(m&&wh(E,l),Pm(d)&&delete E.doDeleteCaseSummary,t.push(BS((e=>e?_S:DS)(f),E)),f||t.push(BS(RS,E)),f){const a=FI(r.contextName),s=PI(a,e.data.objectInfo.ID);if(s){const e={data:{objectInfo:{headers:n}},context:s};t.push(BS(gS,e))}}return h!==$I(u)&&t.push(BS(xS,{target:u,containerItemID:h})),Lh(h)&&!c?.context&&Ny(E,t),t},aD=e=>{e.openActionType=Ls;if(Nm(e.openActionType,e)===Fr.MODAL){const t=Nm(e.openActionType,e),n=js(t,e.context),r=Kr(e.context,Hr(t,e.context));return VC(_S({target:n,context:r,containerItemID:r,key:e.caseID,caseViewMode:Fr.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:Fr.getProperty(Fr.CASE_INFO.CASE_INFO_CONTENT),type:"view"}},data:{key:e.caseID,objectInfo:{ID:e.caseID}}})),VC(vS({context:r})),e.modalLoadingContainer={target:n,context:r},nD(e)}return nD(e)},sD=e=>{const{containerName:t,isInCreateStage:n}=e;return n?Fr.MODAL:t||Oh.getTargetViewContainerName(Us)},oD=(e,t)=>{const{class:n,context:r,viewType:a=ty.PAGE}=e,{removeActionPayload:s}=t,o=e?.pageName?e?.pageName:PA.getDefaultCasePage();return wd(Zp.createCase(n,{...e,pageName:o,viewType:a,context:r,retrieveActionViewForNewObject:!0})).pipe(Xh((({response:t,headers:n})=>(Lr.analyseResponse(t),{response:t,actionInPayload:e,headers:n,removeActionPayload:s}))),hf("Error occurred during ajax call at createObject Epic : ",r))},iD="CREATE_EXTERNAL_OBJECT",cD=e=>{const{workId:t,context:n,isExternalCase:r}=e,a=r?Za:"deleteWork",{restApi:s,reqType:o}=i_(a,{ID:t});return wd(Wu(s,{method:o},n)).pipe(Xh((t=>({response:t.data,actionInPayload:e,headers:ry(t.headers)}))),hf("Error occurred during ajax call at deleteWork Epic : ",n))},lD=e=>{gu.publish(Fr.PUB_SUB_EVENTS.WORK_EVENTS.WORK_DELETED,e)},dD=((...e)=>(t,n)=>new gd((r=>{const a=e.map((e=>e(t,n).subscribe(r)));return()=>{a.forEach((e=>e.unsubscribe()))}})))(...Qb,...IO,...NO,...kO,...DO,...Jb,...VO,...BO,...GO,...[qO,e=>{let t=0,n=[];return e.pipe(df(XO),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>{const{context:n,isChild:r,viewType:a}=e,s=Nm(Ms,e),o=js(s,n);return wd("none"!==a?my(o,{loadingContext:n}):Promise.resolve({continueExecution:!0,removeActionPayload:void 0})).pipe(Zh((({continueExecution:n,removeActionPayload:s})=>{if(!n)return Th.rejectActionByID(t),uf;const{activate:i,activateContainerActionPayload:c}=Ey(ZO.OBJECT,o,e);return i&&!r&&"none"!==a?nf({type:Ua,activateContainerActionPayload:c,actionInPayload:e}):JO(e,{removeActionPayload:s})})))})),Zh((async e=>{if(e&&Dm(e.type))return n.push(dy(e)),n;if("none"===e?.actionInPayload?.viewType){const t=BC(e?.actionInPayload?.context);if(t?.context_data?.caseViewMode!==Fr.PERFORM_MODE){const t=sm(e?.response),r={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:fs,payload:{context:r.context,doDeleteConfirmationDetails:!1}}),n.push(BS(gS,r));const a=QI(e?.actionInPayload?.context),s=bm(e?.actionInPayload?.context),o=Object.freeze({target:a,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:s});if(Lh(e?.actionInPayload?.context)){const t=sy(e?.response,{...o});Ny({...t,isArrayDeepMerge:!0},n)}}}else await eD(e,n);return n})),Xh((()=>(VC(n),Bm(n,t),n=[],n))))},QO,e=>{let t=0,n=[];return e.pipe(df(tD),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>aD(e))),Zh((async e=>{if(Dm(e.type)){const t=dy(e);n.push(t);const r=BC(e.payload.context);return r?.context_data?.isLoading&&n.push(BS(RS,e.payload)),n}const{actionInPayload:t,headers:r,response:a}=e,{actionID:s}=t;return aS.setIn(a,"data.objectInfo.activeActionID",s),aS.setIn(a.data,Fr.getProperty(Fr.OBJECT_INFO_IS_LOCAL_ACTION),!0),t.refreshConditions&&aS.setIn(a.data,Fr.getProperty(Fr.CASE_INFO_REFRESH_CONDITIONS),t.refreshConditions),await rD(a,n,{headers:r,actionInPayload:t}),IP(t),n})),Xh((()=>(VC(n),Bm(n,t),n=[],n))))},e=>{let t=0,n=[],r=!1;return e.pipe(df(iD),ff(100),Xh((e=>(({actionMgrID:t}=e.payload),e.payload))),Zh((e=>{const{context:n}=e,a=sD(e),s=js(a,n);return r=!1,wd(rT(s,{loadingContext:n})).pipe(Zh((({continueExecution:n,removeActionPayload:a,dirtyCheckPerformed:s})=>n?(r=s,oD(e,{removeActionPayload:a})):(Th.rejectActionByID(t),uf))))})),Zh((async e=>{if(e&&e.type===ba)return e.payload.context=hA(),n.push(dy(e)),n;const{actionInPayload:a,response:s,headers:o,removeActionPayload:i}=e,c=RT(a,s);aS.setIn(s.data,Fr.getProperty(Fr.CASE_INFO.IS_FIRST_ASSIGNMENT),!0);const l=sD({...a,isInCreateStage:c}),d=js(l,a.context),u=hy(d,l,a.context);if(!r&&!Pm(l)&&VI(d)){const{continueExecution:e}=await my(d,{loadingContext:a.context});if(!e)return Th.rejectActionByID(t),n}const p=sm(s);let h=s_(Us,{caseClassName:$h(p)});h=h.replace(/{.+?}/,String($m(xh(p)))),p.semanticURL=h,DT(p,a);const f={acName:d,context:u};await oy(p,a,f);const g={target:d,context:u,headers:o,semanticURL:h,caseViewMode:vT(p),containerItemID:u,isInCreateStage:c,isMinimizable:c,assignmentContext:aS.getIn(p,tT),nextAssignmentInfo:aS.getIn(p,eT),resourceType:Ur.RESOURCE_TYPES.OBJECT,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo,isExternalObjectCreationFlow:!0};wh(g,p);const m=sy(p,g),y=uy(d,m);return fy(y)&&Um(n,{removeActionPayload:i,target:d}),n.push(y),n})),Xh((()=>(by(n),Bm(n,t),n=[],n))))},e=>{let t,n=0,r=[];return e.pipe(df(Wh),Xh((e=>(({actionMgrID:n,caseTypeID:t}=e.payload),e.payload))),Zh((e=>{if(!e.skipDeleteConfirmation&&!e.ignoreWorkDeletion){const r=mI.MODAL,a=js(r,e.context),s=Kr(e.context,Hr(r,e.context));return VC([BS(_S,{target:a,context:s,containerItemID:s,containerName:r,isDeleteConfirmation:!0,actionName:"Delete",workId:e.workId,caseTypeID:t,className:e.className,keys:e.keys,...e.enableBackNavigation&&{enableBackNavigation:!0},data:{caseInfo:{caseTypeID:t}}})]),Th.resolveActionByID(n),uf}return e.ignoreWorkDeletion?nf({actionInPayload:e}):cD(e)})),Zh((async e=>{if(e&&Dm(e.type)){const{payload:t}=e;return r.push(dy({...e,...t,actionMgrID:n})),r}const{actionInPayload:t}=e,{context:a}=t;if(oT({content:$A().getLocaleValue("Deleted successfully!","Messages")}),a?.includes(Fr.PREVIEW)&&r.push(BS(SS,YI({context:Fr.APP.APP,name:Fr.PREVIEW}))),a?.includes(Fr.MODAL)){const e=mI.MODAL,t=js(e,a),n=CI(t,a);n?.enableBackNavigation&&window?.history?.back()}return r})),Xh((()=>(VC(r),Bm(r,n)===Fr.PROMISE_VALUE.RESOLVE&&lD({caseTypeID:t}),r=[],r))))}]),uD=()=>e=>t=>{const{type:n="",payload:r={}}=t||{},{category:a,context:s,transientItemID:o}=r;"HTTP"!==a&&[Oa,Fa,Da,ka,Ra,La].includes(n)&&(wy(s||o),Zd.removeContextTreeNode(s||o),n!==Oa&&n!==Da||-1===r?.target?.indexOf("modal")||gu.publish(Ur.PUB_SUB_EVENTS.PEGA_EMBED_CUSTOM,n)),e(t)},pD={},hD=e=>{const t=aS.getIn(pD,[Fr.CONTEXT,e],[]),n=[];t.forEach((t=>{const r=t.substr(0,t.lastIndexOf("_")),a=aS.getIn(pD,[r,t],[]),s=a&&a.length>0&&a.indexOf(e);if(s>-1&&a.splice(s,1),!a||a&&0===a.length){aS.deleteIn(pD,[r,t]);const e=aS.getIn(pD,[r]);e&&0===Object.keys(e).length&&aS.deleteIn(pD,[r]),n.push({dataPageName:r,dataPageNameWithHash:t})}})),aS.deleteIn(pD,[Fr.CONTEXT,e]);const r=aS.getIn(pD,[Fr.CONTEXT]);(!r||r&&0===Object.keys(r).length)&&aS.deleteIn(pD,[Fr.CONTEXT]),n.length>0&&VC(HS({dataPagesToBeRemoved:n}))},fD=(e={},t)=>{Object.keys(e).forEach((n=>{const r=aS.getIn(e,[n],{});Object.keys(r).forEach((e=>{((e,t,n)=>{const r=aS.getIn(pD,[Fr.CONTEXT,n]);if(aS.getIn(pD,[e])){const r=aS.getIn(pD,[e,t],[]);aS.setIn(pD,[e,t],[...new Set([...r,n])])}else aS.setIn(pD,[e,t],[n]);r?aS.setIn(pD,[Fr.CONTEXT,n],[...new Set([...r,t])]):aS.setIn(pD,[Fr.CONTEXT,n],[t])})(n,e,t)}))}))},gD=()=>e=>t=>{(Array.isArray(t)?t:[t]).forEach((e=>{const{payload:{data:t={},context:n=null,childContainersContexts:r=[]}={},type:a}=e;if(((e,t)=>{t&&t.length>0&&(e===ka||e===Da)&&t.forEach((e=>{hD(e)}))})(a,r),a===Oa||a===Ca||a===us){const e=a===us?t:t.shared;fD(e,n)}else a===ka?(hD(n),fD(t.shared,n)):a===Da&&hD(n)})),e(t)},{PUB_SUB_EVENTS:mD}=Ur,yD=e=>t=>n=>{const{type:r,payload:{target:a,containerItemID:s,context:o,deleteContext:i,childContainersContexts:c=[],containerInfo:{newAccessedOrder:l,containerType:d}={newAccessedOrder:new Array,containerType:""},eventName:u}={}}=n;r===Da&&((e,t,n,r,a,s)=>{const{resourceType:o,key:i,context:c}=aS.getIn(e.getState(),["containers",t,"items",n])||{},l={resourceType:o,key:i,context:c,containerItemID:n,...void 0!==r?{eventName:r}:{}};gu.publish(mD.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,l),t===`${Ur.APP.APP}/${Fr.PRIMARY}`&&s===Fr.CONTAINER_TYPE.MULTIPLE&&gu.publish(mD.CONTAINER_EVENTS.CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM,{key:i,newAccessedOrder:a})})(e,a,s,u,l,d),((e,t)=>{t&&t.length>0&&(e===ka||e===Da)&&t.forEach((e=>{e&&Sg.cleanCaches(e)}))})(r,c),o&&(r===ka||r===Da&&i)&&Sg.cleanCaches(o),t(n)},ED=e=>e===`${Fr.APP.APP}/${Fr.MODAL}`,ID=(e,t,n,r,a)=>{var s;e&&t&&(ED(a)?(s={caseId:e,caseClass:n,context:r||""},gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_CASE_MODAL_OPEN,s)):(e=>{gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,e)})({caseId:e,caseClass:n,context:r||""}))},AD=(e,t)=>{var n;e&&(ED(t)?(n={caseId:e,caseClass:"",context:""},gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_CASE_MODAL_CLOSE,n)):(e=>{gu.publish(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,e)})({caseId:e}))},CD=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t){const{type:e,payload:n}=t,{target:r,key:a,context:s,data:o}=n||{};if((e=>e===`${Fr.APP.APP}/${Fr.PRIMARY}`)(r)||ED(r)){const t=o?.caseInfo?.ID,n=s||"",i=HC(Fr.CASE_INFO.CASE_INFO_ID,"",n)||"",c=o?.caseInfo?.caseTypeID||"";e!==ka&&e!==Da||AD(i,r),e!==Oa&&e!==ka||ID(a,!!t,c,n,r)}}e(t)},SD=()=>e=>t=>{const{payload:{context:n=null,transientItemID:r=null,clearStateMachine:a=!0}={},type:s}=t;n&&(s===Oa||s===Fa||s===ka||s===Da)&&a&&(Ep(n),mp(n)),r&&s===wa&&(Ep(r),mp(r)),e(t)},_D=e=>aS.getIn(e,Fr.CASE_INFO.ASSIGNMENT_ID),ND=e=>{Object.keys(ag.subscribers).forEach((t=>{"COACH_UPDATE"===ag.subscribers[t].filter.matcher&&ag.subscribers[t].filter.criteria?.caseId===e&&ag.unsubscribe(t)}))},bD=(e,t)=>{if(n=t.target,n?.toString().includes(Fr.MODAL))return;var n;const{context:r,data:a,resourceType:s,caseID:o}=t;e===Oa?((e,t,n)=>{if(n===Fr.RESOURCE_TYPES.ASSIGNMENT){const n=_D(t),r=aS.getIn(t,["caseInfo","ID"]);n&&r&&vg({actionInContext:e,assignmentID:n,caseKey:r})}else if(n===Fr.RESOURCE_TYPES.CASE&&e?.includes("workarea")){const n=aS.getIn(t,["caseInfo","ID"]),r=_D(t);n&&r&&vg({actionInContext:e,assignmentID:r,caseKey:n})}})(r,a,s):e===Fa?((e,t,n)=>{if(n!==Fr.RESOURCE_TYPES.ASSIGNMENT)return;const r=_D(BC(e)),a=_D(t),s=aS.getIn(t,["caseInfo","ID"]);r&&r!==a&&Rg({actionInContext:e,assignmentID:r,caseKey:s}),a&&s&&vg({actionInContext:e,assignmentID:a,caseKey:s})})(r,a,s):e===Da&&o?((e,t)=>{if(e?.includes("workarea")){const n=_D(BC(e));n&&Rg({actionInContext:e,assignmentID:n,caseKey:t})}else ND(t)})(r,o):e===ka&&o&&((e,t,n,r)=>{if(e?.includes("workarea")){const t=_D(BC(e));t&&Rg({actionInContext:e,assignmentID:t,caseKey:r})}else ND(r);if(n===Fr.RESOURCE_TYPES.ASSIGNMENT){const n=_D(t);n&&vg({actionInContext:e,assignmentID:n,caseKey:r})}})(r,a,s,o)},TD=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t){const{type:e,payload:r}=t;"object"==typeof(n=r)&&null!==n&&bD(e,r)}var n;e(t)},PD=[fa,ma,Ea,"DELETE_CASE_IN_CREATE_STAGE",Ia,Aa],OD=new Set([Oa,ka,Fa,Da,ga,_s,ea,hs,...PD]),DD=(e,t)=>{if(!(e=>{const t=e?.data?.caseInfo?.settings?.autoSave;if(null!=t)return Boolean(t);const n=e?.containerItemID??e?.context;if(n){const e=HC("caseInfo.settings.autoSave",null,n);if(null!=e)return Boolean(e)}return!1})(t))return!1;const n=t.containerItemID||e,r=t.target||QI(n),a=CI(r,n),s=t.resourceType||a?.resourceType,o=t.key||a?.key;return s===Fr.RESOURCE_TYPES.ASSIGNMENT&&Boolean(o)},vD=(e,t,n)=>{e===Oa||e===ka||e===Fa&&t.data?(GE(n)&&WE(n),e===ka&&HE(n),DD(n,t)&&((e,t)=>{0===DE.size&&"undefined"!=typeof document&&(document.addEventListener("pointerdown",kE,{passive:!0}),document.addEventListener("keydown",VE,{passive:!0}),document.addEventListener("input",BE,{capture:!0,passive:!0})),DE.set(e,t)})(n,{containerName:t.containerName??""})):e===Da&&(GE(n)&&WE(n),HE(n))},RD=(e,t)=>{if(e!==Da||!t.includes(Fr.MODAL))return;const n=Qr(t),r=`${n}/`;for(const e of wE)(e===n||e.startsWith(r))&&zE(e)},$D=(e,t,n)=>{e!==ga?e!==_s?PD.includes(e)&&qE(n):(e=>{qE(e),wE.add(e)})(n):t.autosave||qE(n)},xD=()=>e=>t=>{if(t&&"object"==typeof t&&"type"in t&&"payload"in t&&"string"==typeof t.type&&OD.has(t.type)&&("object"==typeof(n=t.payload)&&null!==n)){const{type:e,payload:n}=t,r=((e,t)=>e===Ia?t.saveActionPayload?.containerItemID:e===Aa?t.saveContainerItemID??t.context:t.containerItemID??t.context)(e,n);r&&(RD(e,r),vD(e,n,r),GE(r)&&(((e,t)=>{if(t.context)e===ea?(Hp(t.context,null),YE(t.context)):e!==hs||t?.isDefault||t?.skipDirtyValidation||YE(t.context)})(e,n),$D(e,n,r)))}var n;e(t)},wD=(()=>{const e=new af;let t=null,n=null;const r=r=>(n=r,t=new lf(e.asObservable(),r.getState()),n=>a=>{const s=n(a);var o;return t?.next(r.getState()),"object"==typeof(o=a)&&null!==o&&"type"in o&&"string"==typeof o.type&&e.next(a),s});return r.run=r=>{if(!t||!n)throw new Error("Epic middleware must be added to the store before calling run().");return r(e.asObservable(),t).subscribe((e=>{n?.dispatch(e)}))},r})(),MD=e=>{if(null!==kC())return void tS();const t=[pI.propertyChangeMiddleware,uD,gD,SD,wD,TD,xD,CD,yD],n=tb({reducer:kb(e),middleware:e=>e({serializableCheck:!1,thunk:!1}).concat(t),enhancers:e=>e().prepend(ob).concat(ob)});wD.run(dD),jC(n)},LD=["ar","arc","ckb","dv","fa","ha","he","khw","ks","ps","ur","yi"],UD=e=>LD.includes(e.split("-")[0])?"rtl":"ltr";const FD=async function(e){if(!e)return;const t=PA.getLocale();PA.setLocale(e);const n=PA.getLocale();if(n&&n!==t){if(N_(["lang"]),"undefined"!=typeof window){const e=new URL(window.location.href);e.searchParams.set("lang",n),window.history.replaceState(window.history.state,"",e.toString())}PA.isInfinityRuntime()&&await TA.loadLocaleBundle([n]),await DA(n),"undefined"!=typeof document&&(document.documentElement.lang=n,document.documentElement.dir=UD(n)),VC({type:ms,payload:{locale:n}}),gu.publish(Fr.PUB_SUB_EVENTS.EVENT_LOCALE_CHANGED,{locale:n,previousLocale:t})}};class jD{static EDIT_OPEN="edit_open";static EDIT_CLOSE="edit_close";static VIEW_OPEN="view_open";static VIEW_CLOSE="view_close";static caseCollabSubIds={};static init(e){e&&(this.collabConfig=e)}static dispatchCollaboratorAction=(e,t,n,r,a)=>{VC({type:"LIST_ACTION",payload:{instruction:e,context:t,referenceList:r,listIndex:n,content:a,skipDirtyValidation:!0}})};static handleCaseCollaboratorsUpdate(e,t){const n=t?.message??{},[r,a]=Object.entries(n)[0];if(r===PA.getOperatorIdentifier())return;const s={ID:r,state:a},o=HC(Fr.CASE_INFO.CASE_INFO_COLLABORATORS,"",e)||[],i=o.findIndex((e=>e.ID===r));if(-1!==i)"closed"===a?this.dispatchCollaboratorAction("DELETE",e,i,Fr.CASE_INFO.CASE_INFO_COLLABORATORS,null):this.dispatchCollaboratorAction("REPLACE",e,null,`${Fr.CASE_INFO.CASE_INFO_COLLABORATORS}[${i}]`,s);else{if("closed"===a)return;this.dispatchCollaboratorAction("INSERT",e,o.length,Fr.CASE_INFO.CASE_INFO_COLLABORATORS,s)}}static subscribeToCollaborators(e,t){const n=ag.subscribe({matcher:"CASE_COLLABORATOR",criteria:{caseId:e}},(e=>this.handleCaseCollaboratorsUpdate(t,e)));this.caseCollabSubIds[e]=n}static unsubscribeToCollaborators(e){ag.unsubscribe(this.caseCollabSubIds[e]),delete this.caseCollabSubIds[e]}static publishCaseEvent(e,t){ag.publishMessage({filter:{matcher:"CASE_COLLABORATOR",criteria:{caseId:t}},message:e})}static subscribeToEvent(e,t,n){let r=null;if(e===Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN||e===Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE?r=e=>this.publishCaseEvent(t,e):e===Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD?r=e=>{const{caseId:t,context:n}=e;this.caseCollabSubIds[t]||this.subscribeToCollaborators(t,n)}:e===Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD&&(r=e=>{const{caseId:t}=e;this.caseCollabSubIds[t]&&this.unsubscribeToCollaborators(t)}),!r)throw new Error(`Unhandled eventKey: ${e}`);gu.subscribe(e,r,n)}static unsubscribeFromEvent(e,t){gu.unsubscribe(e,t)}static subscribeToCaseEvents(){jD.collabConfig?.appEnabled&&jD.collabConfig?.portalEnabled&&(this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,this.VIEW_OPEN,"case_view_open"),this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,this.VIEW_CLOSE,"case_view_close"),this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,this.EDIT_OPEN,"case_edit_open"),this.subscribeToEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,this.EDIT_CLOSE,"case_edit_close"))}static unsubscribeToCaseEvents(){jD.collabConfig?.appEnabled&&jD.collabConfig?.portalEnabled&&(this.unsubscribeFromEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_LOAD,"case_view_open"),this.unsubscribeFromEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_UNLOAD,"case_view_close"),this.unsubscribeFromEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_OPEN,"case_edit_open"),this.unsubscribeFromEvent(Fr.PUB_SUB_EVENTS.CASE_EVENTS.CASE_EDIT_CLOSE,"case_edit_close"))}}const kD=jD;const VD=new class{#S(e,t,n,r,a){let s=!1;return e.IncludeInURL&&void 0!==t&&(r[e.Key]=t,"portal"===e.Key&&t!==n&&(s=!0)),Array.isArray(e.IncludeInHeaders)&&void 0!==t&&e.IncludeInHeaders.forEach((n=>{a[n.Value]||(a[n.Value]=[]),a[n.Value].push(`${e.Key}=${t}`)})),s}#_(e,t,n){const r={},a={};let s=!1;return Array.isArray(e)&&e.forEach((e=>{const o=t[e.Key];this.#S(e,o,n,r,a)&&(s=!0)})),{urlParams:r,headerMap:a,isPortalChanged:s}}#N(e){const t=Nh.getComponentCache("lastActionID");return Xf.truncateNamespace(e)===Xf.truncateNamespace("string"==typeof t?t:(t??"").toString())}#b({message:e}){const{RequestContext:t,ActionName:n}=e;if(!this.#N(n))return;const r=JSON.parse(t),a=PA.environmentInfoObject?.requestContext,s=new URL(window.location.href).searchParams.get("portal"),{urlParams:o,headerMap:i,isPortalChanged:c}=this.#_(a,r,s);Nh.setURLParams(o),Object.entries(i).forEach((([e,t])=>{xu.registerHeader(e,t.join("; "))})),Nh.setComponentCache("lastActionID",""),c&&globalThis.location.reload()}subscribeToGlobalEvents(){const e=aS.generateUniqueID(),t={matcher:"SWITCH_REQUEST_CONTEXT",criteria:{UserID:PA.getOperatorIdentifier()||""}};ag.subscribe(t,this.#b.bind(this),void 0,e)}},BD={publishConstellationLoadedEvent:()=>{gu.publish(Fr.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const GD=new class{activateContainerItemOnSwitch(e){const t=`${Fr.APP.APP}/${Fr.PRIMARY}`,n={target:t,containerItemID:PI(t,e)};Cm({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${Fr.APP.APP}/${Fr.PRIMARY}`,n={target:t,containerItemID:PI(t,e)};Cm({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=Cm({meta:{type:"PreviewViewContainer",config:{name:Fr.PREVIEW}},options:{context:Fr.APP.APP,target:"root/hybrid_preview"}});n.getPConnect().getContainerManager().resetContainers({name:Fr.PRIMARY,context:Fr.APP.APP}),vI(Fr.APP.APP,Fr.PREVIEW)||n.getPConnect().getContainerManager().initializeContainers({type:"multiple",name:Fr.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){Cm({}).getPConnect().getContainerManager().resetContainers({name:Fr.PREVIEW,context:Fr.APP.APP})}isFormDirty(e){const t=`${Fr.APP.APP}/${Fr.PRIMARY}`,n=mA(t,e);return vy.isStateModified(n)}getEventUtils(){return BD}getBroadcastUtils(){return Zb}isTraditionalUICase(e){return Gm(e)}};const WD=class{static openCase(e,t=Ur.APP.APP,n={}){return n.renderInline=!0,n.pageName?(PA.setDefaultCasePage(Mr.getDefaultQualifiedName(n.pageName)),n.pageName=Mr.getDefaultQualifiedName(n.pageName)):(PA.setDefaultCasePage(Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n.pageName=Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n?.disableAssignmentHeader?PA.disableAssignmentHeader(n.disableAssignmentHeader):PA.disableAssignmentHeader(!1),Qf.openCase(e,t,Fr.PRIMARY,n)}static createCase(e,t=Ur.APP.APP,n={}){return n.renderInline=!0,n.pageName?(PA.setDefaultCasePage(Mr.getDefaultQualifiedName(n.pageName)),n.pageName=Mr.getDefaultQualifiedName(n.pageName)):(PA.setDefaultCasePage(Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n.pageName=Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n?.disableAssignmentHeader?PA.disableAssignmentHeader(n.disableAssignmentHeader):PA.disableAssignmentHeader(!1),Qf.createCase(e,t,Fr.PRIMARY,n)}static getNextWork(e=Ur.APP.APP,t={}){return t.renderInline=!0,t.pageName?(PA.setDefaultCasePage(Mr.getDefaultQualifiedName(t.pageName)),t.pageName=Mr.getDefaultQualifiedName(t.pageName)):(PA.setDefaultCasePage(Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),t.pageName=Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),t?.disableAssignmentHeader?PA.disableAssignmentHeader(t.disableAssignmentHeader):PA.disableAssignmentHeader(!1),Qf.getNextWork(e,Fr.PRIMARY,t)}static openAssignment(e,t=Ur.APP.APP,n={}){return n.renderInline=!0,n.pageName?(PA.setDefaultCasePage(Mr.getDefaultQualifiedName(n.pageName)),n.pageName=Mr.getDefaultQualifiedName(n.pageName)):(PA.setDefaultCasePage(Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n.pageName=Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),n?.disableAssignmentHeader?PA.disableAssignmentHeader(n.disableAssignmentHeader):PA.disableAssignmentHeader(!1),Qf.openAssignment(e,t,Fr.PRIMARY,n)}static openPage(e,t,n=Ur.APP.APP,r={}){const a=na;r?.defaultCasePage?(PA.setDefaultCasePage(Mr.getDefaultQualifiedName(r.defaultCasePage)),r.defaultCasePage=Mr.getDefaultQualifiedName(r.defaultCasePage)):PA.setDefaultCasePage(Mr.getDefaultQualifiedName(Fr.PY_DETAILS)),r?.disableAssignmentHeader?PA.disableAssignmentHeader(r.disableAssignmentHeader):PA.disableAssignmentHeader(!1);const s={viewName:e,className:t,acTargetName:Fr.PRIMARY,actionMgrID:Th.getNextActionMgrId(),context:n},{promise:o}=Th.actionManagerPromise(a,s.actionMgrID);return VC({type:a,payload:{...s}}),o}static getCurrentContextAPI(e,t=Ur.APP.APP){return Cm({meta:{config:{}},options:{context:t,pageReference:e,containerName:Fr.PRIMARY}}).getPConnect()}};function HD(e){if(!e||"*"===e||"null"===e)return"";try{const t=new URL(e);return"https:"!==t.protocol&&"http:"!==t.protocol||"null"===t.origin?"":t.origin}catch{return""}}function qD(e){if(e.contentRect)return{height:e.contentRect.height};const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize;return"blockSize"in t?{height:t.blockSize}:"height"in t&&"number"==typeof t.height?{height:t.height}:{height:0}}const YD=new class{gadgetName="";resize=!1;parentOrigin="";boundOnMessage=this.onMessage.bind(this);init(e){if("undefined"==typeof window)return;const{resizing:t,parentOrigin:n}=e;this.gadgetName=window.name,this.resize="stretch"===t,this.parentOrigin="",n?this.parentOrigin=HD(n):document.referrer?this.parentOrigin=HD(document.referrer):this.parentOrigin=HD(function(){try{const{ancestorOrigins:e}=window.location;if(e&&e.length>0)return e[0]??""}catch{}return""}());const r=document.getElementsByTagName("app-root")[0];r.classList.add("mashup"),window.parent!==window&&this.resize&&this._registerResizeObserver(r)}send(e){const{action:t,message:n}=e,r=JSON.stringify({gadgetName:this.gadgetName,action:t,message:n});window.parent.postMessage(r,this.parentOrigin||window.location.origin)}_registerResizeObserver(e){new ResizeObserver((e=>{for(const t of e){const e=qD(t);this.send({action:"resize",message:e})}})).observe(e)}_updateUrl(e){window.history.pushState({},"home",e),PCore.configureForBrowserBookmark({semanticURL:"",context:Fr.APP.ROOT,acName:"primary"})}onMessage(e){if(!this.parentOrigin||e.origin!==this.parentOrigin)return!1;if("string"!=typeof e.data)return!1;let t;try{t=JSON.parse(e.data)}catch{return!1}return"UpdateUrl"===t.action&&this._updateUrl(t.message.url),!0}getMessageHandler(){return this.boundOnMessage}};"undefined"!=typeof window&&window.addEventListener("message",YD.getMessageHandler(),!1);const zD={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},KD={type:"RootContainer",config:{renderingMode:"hybrid"},children:[{type:"HybridViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary",contextName:"app"},children:[]}]},QD="portal-less-styles";const JD=new class{createC11nEnv=e=>Cm(e);getContextUtils=()=>e;getRoutingManager=()=>t;getComponentsRegistry=()=>Co;getStateManager=()=>d;getActionCreators=()=>u;getStreamObservable=()=>s;getActionProcessor=()=>uS;getActionHandler=()=>dS;renderApp=(e,t)=>{const n={context:Fr.APP.APP},r={...aS.getIn(e,Fr.ROOT),options:n};MD(e),Jp(e,n,!0);const a=this.createC11nEnv({meta:r,isRoot:!0});gu.publish(Ur.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:a,domContainerID:t})};updateStoreWithUiRoot=async(e,t,n)=>{const{data:r,uiResources:a={}}=e,{root:s}=a,o=aS.getIn(a,Fr.CONTEXT_DATA),i=sm(e);await oy(i,{},{},!1,!0);const c={...r,[Fr.CONTEXT_DATA]:o};XI(s,t,c,n)};fetchEndPointResource=(e,t,n)=>{Wu(e,{method:"GET"},Fr.APP.ROOT).then((e=>{200===e.status&&this.updateStoreWithUiRoot(e.data,t,n)}))};loadComponent=async(e,t,n)=>{await yh(n);const r=this.createC11nEnv({meta:e,isRoot:!0});kC()||MD({}),gu.publish(Ur.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:r,domContainerID:t})};setStaticServerUrl=(e,t,n)=>{fh.initServer(e,t,n)};loadView=async(e,t,n=[])=>{nn();const r=sm(e),a=aS.getIn(r,Fr.VIEWS),s=aS.getIn(r,Fr.NAVIGATIONS),o=aS.getIn(r,Fr.COMPONENTS)||[];o.push(...n);const i=aS.getIn(r,Fr.STATIC_SERVER_URL),c=aS.getIn(r,Fr.APPLICATION_DATA);a&&dC(a),s&&fC(s),(e=>{e&&(t_=e.pyLabel)})(c),i&&fh.initServer(i),await yh(o,i),this.renderApp(r,t)};initAppShell=(e,t,n)=>{S_(e),Oh.buildActionTargetMap(t),nn(n)};initRoutingTable=(e,t)=>{S_(e,!0),nn(t)};setAppAlias=e=>{fh.setAppAlias(e)};getHomeRestApi=e=>{const t=an(),{restApi:n}=o_("home",{portalName:e});return`${t}${n}`};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(A_()&&!t){const t=CA(),r=bA.processUrl(t,!0),a=bA._getMatchedRouteInRoutingTable(r)||"",s=bA.getRoutingInfo(),o=bA.processUrl(t,!1).split("/"),i=o[o.length-1],c=s?.routes?.[a]?.payload?.caseID?.replace("{workID}",i).replace("{id}",i);n=bA.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=bA.getRestEndPoint("showView",{page:e,pageClass:t})||{}}catch(e){}return n})(e,t);return an()+n};loadRootComponent=async(e,t,n=[],r,a,s)=>{const{config:o}=t||{},i=o?.name;if(kC()||MD({}),s){const e=`${Fr.APP.ROOT}/${i}`;dA(e),lA().deleteContainerItem(e)}(lA().getContainerItems()||[]).length>1&&!i?.startsWith("hybrid_")&&"authoring-preview"!==i&&tS(),VC(gS({data:{},context:Fr.APP.ROOT}));const c=this.createC11nEnv({meta:t,options:{context:Fr.APP.ROOT,pageReference:"",target:`${Fr.APP.ROOT}/${i}`}}),l=c.getPConnect(),d=`${l.getContextName()}/${l.getContainerName()}`;$I(d)||"noPortal"===o?.renderingMode||l.getContainerManager().initializeContainers({type:"single"});const u=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference","URL",...n];await yh(u),gu.publish(Ur.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:c,domContainerID:e,componentName:"RootContainer",portalTarget:r,styleSheetTarget:a})};loadViewByName=(e,t,n,r)=>{let a=this.getViewRestApi(e,n);a===an()&&(a=this.getHomeRestApi(t)),this.fetchEndPointResource(a,r)};loadPortalView=(e,t)=>{const n=this.getHomeRestApi(e);this.fetchEndPointResource(n,t,!0)};configureForBrowserBookmark=e=>{C_(e)};checkIfSemanticURL=()=>A_();onPCoreReady=e=>{gu.subscribe(Ur.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{gu.subscribe(Ur.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{vp.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{on(e)};setFetchDefaultHeaders=e=>{Ku(e)};setFetchAuthInfo=e=>{Qu(e)};getCaseApi=()=>Qf;getMashupApi=()=>WD;enableAppRouting=e=>{r_(e)};initStore=()=>MD({});getBootstrapConfig=async(e,t)=>{const n=`${t.token_type} ${t.access_token}`;return fetch(`${e}/api/application/v2/data_views/D_pxBootstrapConfig`,{method:"GET",headers:new Headers({Authorization:n})}).then((e=>e.json()))};getBootstrapConfigViaSB=async(e,t,n)=>{const r=n?`?dataViewParameters=${encodeURIComponent(JSON.stringify({themeID:n}))}`:"";return Wu(`${e}/api/application/v2/data_views/D_pxBootstrapConfig${r}`,{method:"GET",headers:new Headers(t)}).then((e=>{if(e.data)return e.data;throw Error("D_pxBootstrapConfig load failed.",{cause:e.status})}))};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=Cm({meta:zD,options:{context:"root",pageReference:"",target:"root"}});return n.getPConnect().getContainerManager().initializeContainers({type:t,name:"primary",context:"app"}),{props:{getPConnect:n.getPConnect}}};loadMashup=async(e,t=!0)=>{if(t){const t=document.querySelector(e)??document.getElementsByTagName(e)[0],n=t?.parentNode;if(n&&!document.getElementById(QD)){const e=document.createElement("style");e.id=QD,e.textContent="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",n.appendChild(e)}}await this.loadRootComponent(e,zD,[Fr.LOAD_VIEW_STRING,"ViewContainer"]),globalThis.parent!==globalThis&&YD.init({resizing:"stretch"})};bootstrapWithAuthHeader=async(e,t,n=[],r,a)=>{const{customRendering:s=!1,onPCoreReadyCallback:o,staticContentServerUrl:i,dynamicSetCookie:c=!1,renderingMode:l,locale:d,envType:u,themeID:p,customCookies:h=!1,enableRouting:f}=e;let{restServerUrl:g,authInfo:m,authorizationHeader:y,appAlias:E,theme:I={}}=e,A=e.additionalHeaders?{...e.additionalHeaders}:{},C=null;const S=!y&&m&&!m.authType;if(m||(e.authInfo={},m=e.authInfo),(y&&0===Object.keys(m).length||h&&!S&&!m.authType)&&(m.authType="custom"),m.customCookies=h,!y&&m.tokenInfo?.access_token){const{tokenInfo:e}=m;y=`${e.token_type} ${e.access_token}`}if(m.tokenInfo?.csrf&&(A={...A,pzCTkn:m.tokenInfo.csrf}),E&&-1===E.indexOf("/")&&(E=`app/${E}`),"LAUNCHPAD"===u){A={...A,"X-Constellation-App":"Pega"},g=g.endsWith("/dx")?g:`${g}/dx`;const e=p?`?themeID=${p}`:"";globalThis.PCore&&(C=await this.getLPConfig(`${g}/api/application/v2/environmentInfo${e}`,y,A,h)),0===Object.keys(I).length&&C?.theme?.definition&&(I=JSON.parse(C.theme.definition).Theme)}else C=S?await this.preInitBootstrapConfig(e,E,A,p):await this.getBootstrapConfigExtended(E?`${g}/${E}`:`${g}`,y,A,p,h,d);const _=C?.pyConfigJSON?JSON.parse(C.pyConfigJSON):{...C};"LAUNCHPAD"===u&&await this.applyEnvironmentInfoResponse(_),_.restServerConfig=g,_.dynamicSemanticUrl=!1,_.dynamicSetCookie=c,_.enableRouting=!1,_.serviceConfig?Object.assign(_.serviceConfig,{contextPath:"",appAlias:E}):_.serviceConfig={contextPath:"",appAlias:E,staticContentServer:i,appStaticContentServer:"no-appstatic"},_.additionalHeaders={Authorization:y,...A},_.envType=u,_.dynamicLoadComponents=!s,_.dynamicSemanticUrl=!s,_.noHistory=!0,_.theme=I??{};const N=p&&_?.themeObject?_.themeObject:null;_.theme=N||I,_.renderingMode=l??_.renderingMode,_.locale=d||_.locale,e.semanticUrlArgs&&(_.semanticUrlArgs=e.semanticUrlArgs);const b=i||_.serviceConfig.staticContentServer;if(_.isSdk?(_.enableRouting=f,_.dynamicSemanticUrl=_.enableRouting,fh.initServer(i,"no-appstatic")):(_.serviceConfig.staticContentServer=b,_.serviceConfig.appStaticContentServer=_.serviceConfig.appStaticContentServer||"no-appstatic",fh.initServer(b,b)),"EMBED"===_.renderingMode&&m?.authentication_service&&"pega"!==m.authentication_service&&(_.routingInfo||(_.routingInfo={}),_.routingInfo.authServiceAlias=m.authentication_service),await nv.initCoreConfig(_),o&&gu.subscribe(Ur.PUB_SUB_EVENTS.EVENT_RENDER_APP,o,"renderAppCallback"),"LAUNCHPAD"===_.envType&&"EMBED"===_.renderingMode&&PA.setIsWebEmbed(!0),m&&["OAuth2.0","custom"].includes(m?.authType)&&this.setFetchAuthInfo(m),!s){const e=PA.environmentInfoObject?.pyInfinityStaticService;let s=null;if(e){const e=await og.getDataAsync("D_pxGetComponentLibraryListAndMap","",{});Array.isArray(e.data)&&e.data.length>0&&(s=e.data)}const o=new Promise((async(e,t)=>{try{const t=async()=>{await this.importReactRoot(),e(!0)};gu.subscribe("component-map-loaded",t),"ReactRoot"in Co.getLazyMap()&&e(!0)}catch(e){t(e)}}));await o,nv.initCoreContainers(),await this.loadRootContainerWithHybrid(t,n,r,a),s&&await Promise.all(s.map((({pyComponentMap:e,pxUpdateDateTime:t})=>fh.importCustomComponentMap(e,t))))}};loadRootContainerWithHybrid=(e,t=[],n,r)=>(t.push(Fr.CONTAINER_TYPE?.HYBRID||"HybridViewContainer",Fr.LOAD_VIEW_STRING),this.loadRootComponent(e,KD,t,n,r));getBootstrapConfigExtended=async(e,t,n,r,a,s)=>{const o={};r&&(o.themeID=r),s&&(o.locale=s);const i=`${e}/api/application/v2/data_views/D_pxBootstrapConfig${r||s?`?dataViewParameters=${encodeURIComponent(JSON.stringify(o))}`:""}`,c=t?{Authorization:t,...n}:n;return fetch(i,{method:"GET",headers:new Headers(c),credentials:t&&!a?"same-origin":"include"}).then((e=>{if(e.ok)return e.json();throw Error("D_pxBootstrapConfig load failed.",{cause:e.status})}))};getLPConfig=async(e,t,n,r)=>{const a=new Headers({...n,...t&&{Authorization:t}}),s=await fetch(e,{method:"GET",headers:a,credentials:t&&!r?"same-origin":"include"});if(!s.ok)throw new Error("environmentInfo load failed.",{cause:s.status});return s.json()};applyEnvironmentInfoResponse=async e=>{const{environmentInfo:t,pyCaseTypeList:n,theme:r,keyMapping:a}=e,{pxApplication:s,features:o,pxLocale:i}=t,c={simpleTable:{pageInstructionUUIDGeneration:!1},...o},l=Intl.DateTimeFormat().resolvedOptions().timeZone.toUpperCase(),d="ETC/UNKNOWN"===l?"America/New_York":l;e.environmentInfo={...t,pxApplication:{...s},features:c,pyCaseTypeList:n,pxLocale:{...i,pyTimeZone:d}},e.timezone=d;const u=Object.keys(e.environmentInfo);return{isEnvInfoValid:["pxOperator","pxLocale","pxApplication"].every((e=>u.includes(e))),theme:r,keyMapping:a,features:c}};importReactRoot=async()=>{const e=[];return Co.getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)};preInitBootstrapConfig=async(e,t,n,r)=>{const{restServerUrl:a,customRendering:s=!1,staticContentServerUrl:o,dynamicSetCookie:i=!1,authInfo:c,renderingMode:l,locale:d,timezone:u="America/New_York",envType:p,theme:h={}}=e,f=r??null,g={restServerUrl:a,restServerConfig:a,dynamicSetCookie:i,enableRouting:!1,serviceConfig:{contextPath:"",appAlias:t,staticContentServer:o,appStaticContentServer:"no-appstatic"},additionalHeaders:{...n},envType:p,dynamicLoadComponents:!s,dynamicSemanticUrl:!s,noHistory:!0,themeIDObj:f,theme:f||h,renderingMode:l,locale:d,timezone:u,tokens:{C11NB2S:""}};return fh.initServer(o,"no-appstatic"),await nv.init(g),c&&["OAuth2.0","custom"].includes(c?.authType)&&this.setFetchAuthInfo(c),this.getBootstrapConfigViaSB(t?`${a}/${t}`:`${a}`,n,r)}};const XD=class{constructor(e){this.appAlias=e.appAlias,this.appAliasWithoutServlet=e.appAliasWithoutServlet,this.googleMapKey=e.googleMapKey,this.staticContentServer=e.staticContentServer,this.appStaticContentServer=e.appStaticContentServer??null,this.contextPath=e.contextPath,this.messagingService=e.messagingService??null,this.reAuthUrl=e.reAuthUrl??null}};const ZD=class{constructor(e){this.routingInfo=e.routingInfo,this.actionModel=e.actionModel,this.additionalHeaders=e.additionalHeaders,this.tokens=e.tokens,this.semanticUrl=e.semanticUrl,this.queryParams=e.queryParams,this.noPortal=e.noPortal,this.portalTemplate=e.portalTemplate,this.timezone=e.timezone,this.noHistory=e.noHistory,this.viewName=e.viewName,this.theme=e.theme,this.fieldDefaults=e.fieldDefaults,this.restServerConfig=e.restServerConfig,this.dynamicLoadComponents=e.dynamicLoadComponents??!0,this.dynamicSemanticUrl=e.dynamicSemanticUrl??!0,this.enableRouting=e.enableRouting??!0,this.locale=e.locale,this.environmentInfo=e.environmentInfo,this.renderingMode=e.renderingMode??"FULL_PORTAL",this.remoteCaseMapping=e.remoteCaseMapping??{},this.envType=e.envType,this.serviceConfig=new XD(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false",this.enablePriorityAndUrgencyImprovements=e.enablePriorityAndUrgencyImprovements??!1,this.storePercentageAsDecimal=e.storeC11nPercentageAsDecimal??!1,this.collab=e.collab,this.requestContext=e.requestContext,this.pzencv1zzz=e.pzencv1zzz}},ev="@P .viewConfig";let tv=0;const nv=new class{async init(e){const t=new ZD(e);r_(t.enableRouting),MD({}),vp.updateFieldDefaults(t.fieldDefaults),vp.setFieldDefault("Percentage","storePercentageAsDecimal",t.storePercentageAsDecimal),this.#T(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl});const{appAliasWithoutServlet:n,appAlias:r,googleMapKey:a,staticContentServer:s,appStaticContentServer:o}=t.serviceConfig;fh.setAppAlias(n||r),on(a),fh.initServer(s,o,t.tokens.C11NB2S),Vr.setRemoteCaseMapping(t.remoteCaseMapping),kD.init(t.collab),kD.subscribeToCaseEvents(),Xf.subscribeToCaseEvents(),ag.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),t.initBroadcast&&GD.getBroadcastUtils().init(),xu.setDefaultHeaders(t.additionalHeaders),xu.setRequestContext(t.requestContext),"Infinity"===t.envType&&await this.loadEnvironmentInfoFromDataPage(t);const i={...t.environmentInfo,encCSRFToken:t.pzencv1zzz,renderingMode:t.renderingMode,...t.portalTemplate?{pyPortalTemplate:t.portalTemplate}:{}};i.pyCaseTypeList?.forEach((e=>{const t=e.pyWorkTypeImplementationClassName;t&&(e.localeReference=tm(Zg,t))})),i.features?.isNamespaceEnabled&&(t.additionalHeaders.Prefer="namespaced",xu.setDefaultHeaders(t.additionalHeaders)),this.configureTheme(t.theme),PA.setCookieComplianceMethod(t.cookieComplianceMethod),PA.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),PA.setEnablePriorityAndUrgencyImprovements(t.enablePriorityAndUrgencyImprovements),PA.setEnvironmentInfo(i);const c=new URLSearchParams(window.location.search).get("lang")||t.locale||navigator.language||"en-US";PA.setLocale(c),"undefined"!=typeof document&&(document.documentElement.lang=c,document.documentElement.dir=UD(c)),$A().setTimezone(t.timezone),Nh.init(),"Infinity"!==t.envType&&VD.subscribeToGlobalEvents(),t.initBroadcast&&GD.getBroadcastUtils().init(),await DA()}configureTheme=e=>{if(e){const t=e.light,n=e.dark;void 0!==t&&void 0!==n?(this.#P(t),this.#P(n,{type:"dark"})):PA.setTheme(e)}};getBootstrapConfig=async(e,t)=>{const n=`${t.token_type} ${t.access_token}`,r=`${e}/api/application/v2/data_views/${Mr.getDefaultQualifiedName("D_pxBootstrapConfig")}`;return(await fetch(r,{method:"GET",headers:new Headers({Authorization:n})})).json()};initCoreContainers=(e={})=>{const{containerType:t="single"}=e,n=Cm({meta:{type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo:"@ROUTING_INFO",name:"primary"}}]},options:{context:"root",pageReference:"",target:"root"}});return n.getPConnect().getContainerManager().initializeContainers({type:t,name:"primary",context:"app"}),{props:{getPConnect:n.getPConnect}}};importReactRoot=async()=>{const e=[];return JD.getComponentsRegistry().getComponent("ReactRoot")?.modules?.forEach((t=>{e.push(t())})),Promise.allSettled(e)};importDesignSystemComponentMap=async(e,t,n)=>{try{dh(e)}catch(e){return void console.error("Design system load blocked: untrusted or malformed URL",e)}try{await((e,t="true")=>new Promise(((n,r)=>{if("undefined"==typeof document)return void r(new Error("document is not available in this environment"));const a=document.createElement("script");a.type="text/javascript",a.src=e,a.async="true"===t,a.onload=()=>n(void 0),a.onerror=()=>r(new Error("Failed to load resource from Design System")),document.body.appendChild(a)})))(`${e}component/project/${t}/designsystems/${n}/componentsmap.js?v=${Date.now()}`)}catch(e){console.log(e)}};buildSemanticUrl=(e,t,n,r,a)=>{const s=new URLSearchParams(t),o="true"===n&&!!e,i=new URLSearchParams(window.location.search).get("lang");i&&!s.has("lang")&&s.set("lang",i);let c=null,l=null,d=null;if(e){const t=(e.startsWith("/")?e.substring(1):e).split("/");c=t[0]||null,l=t[1]||null,"assignments"===t[2]&&t[3]&&(d=t[3])}const u=[r];c&&u.push(c),l&&u.push(l),d&&u.push("assignments",d),o&&(s.has("noPortal")||s.append("noPortal","true"),l&&a&&s.append("view",a));const p=s.toString();return u.join("/")+(p?`?${p}`:"")};initCoreConfig=async e=>{const{routingInfo:t,serviceConfig:n,semanticUrl:r,queryParams:a,noPortal:s,noHistory:o,viewName:i,theme:c,restServerConfig:l,dynamicLoadComponents:d=!0,dynamicSemanticUrl:u=!0,renderingMode:p="FULL_PORTAL",envType:h,extras:f}=e,{appAlias:g,contextPath:m}=n,y=window.location,E=y.origin;let I=l??E;const A={};if(m&&(I+=m),g&&"LAUNCHPAD"!==h&&(I+=`/${g}`),e.restServerConfig=I,this.#O(),!0===u){const e=this.buildSemanticUrl(r,a,s,I,i);!o&&e&&"undefined"!=typeof window&&window.history.replaceState({},"home",e)}else if("HYBRID"!==p){const e=y.href,t=e.indexOf("?");t>0&&"undefined"!=typeof window&&window.history.pushState({},"home",e.substring(0,t)),A.dynamicSemanticUrl=!1}else console.log(`renderingMode :${p}`);!0!==d&&(A.dynamicLoadComponents=!1);let C=null;if(g){const e=g.indexOf("/app/");C=e>=0?g.substring(e+1):g}if((!1===A.dynamicSemanticUrl||!1===A.dynamicLoadComponents)&&PCore.setBehaviorOverrides(A),e.appAlias=C,c)if("object"==typeof c)e.theme=c;else try{e.theme=JSON.parse(c)}catch{e.theme={}}let S=y?`${y.protocol}//${y.host}`:t.domain;if("EMBED"===p)try{S=new URL(e.restServerConfig).origin}catch{}const _={...t,domain:S,searchParams:y?y.search:"",embedQueryParams:e.semanticUrlArgs};e.routingInfo=_,e.initBroadcast="true"===PA.environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||(e.renderingMode="EMBED"),f?.cspNonce&&(window.__webpack_nonce__=f.cspNonce),PA.setCaseLabelFirstInTitle(e.extras?.useDefaultBrowserTabTitle??!0),await this.init(e)};launchViewByName=async(e,t,n,r,a,s,o,i,c=[])=>{tv+=1;const l=i||`mashup${tv}`,d={type:"RootContainer",config:{viewConfig:ev,renderingMode:"view",name:l}};await JD.loadRootComponent(e,d,a,s,o),await this.loadCustomComponentLibrariesIfEnabled(c),JD.loadViewByName(t,n,r,l)};launchView=(e,t,n=[],r,a,s,o)=>{let i;tv+=1,i="hybrid"===o?`hybrid_${tv}`:o||`mashup${tv}`;const c={type:"RootContainer",config:{viewConfig:ev,renderingMode:"portal",name:i}};o===Fr.HYBRID&&bg.setRuntimeParam(Fr.HYRBID_ROOT_CONTAINERNAME,i),bg.setRuntimeParams(r),JD.loadRootComponent(e,c,n,a,s).then((()=>JD.updateStoreWithUiRoot(t,i,!1)))};launchPortal=async(e,t,n=`portal${tv+=1}`,r=[],a=[])=>{const s="LoadingComponent",o={type:"RootContainer",config:{viewConfig:ev,renderingMode:"portal",skeleton:s,name:n}},i=[...r,s];PA.isPortalLoaded=!0;try{return await JD.loadRootComponent(e,o,i),await this.loadCustomComponentLibrariesIfEnabled(a),JD.loadPortalView(t,n)}catch(e){throw console.error(`Failed to launch portal ${t}:`,e),e}};launchMashup=(e,t=!0,r=[])=>{const a={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfoAnnotation:"@ROUTING_INFO",name:"primary"}}]};if(t&&!document.getElementById("portal-less-styles")){const t=document.getElementsByTagName(e),n=t[0]?.parentNode;if(n){const e=document.createElement("style");e.id="portal-less-styles",e.textContent="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",n.appendChild(e)}}if((async()=>{await JD.loadRootComponent(e,a,[Fr.LOAD_VIEW_STRING,"ViewContainer"]),await this.loadCustomComponentLibrariesIfEnabled(r)})(),window.parent!==window){const e=fh.getStaticServerUrl();n(754)(`${e}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))}};loadEnvironmentInfoFromDataPage=async e=>{if("wss"===e.portalType&&(e.environmentInfo={...e.environmentInfo,features:{case:{createInModal:!1}}}),e.environmentInfo?.pyDataPages&&Array.isArray(e.environmentInfo.pyDataPages)){const t=e.environmentInfo.pyDataPages;setTimeout((()=>{this.loadDataPagesIntoEnvironmentInfo(t).catch((e=>{console.error("Error loading data pages into environment info:",e)}))}),Fr.PRIORITY.TRIVIAL)}};loadDataPagesIntoEnvironmentInfo=async e=>{if(!e?.length)return;const t=PA.environmentInfoObject;if(!t)return;const n=e.filter((({pyName:e,pyPath:t})=>!(!e||!t)||(console.warn("Invalid data page configuration: missing pyName or pyPath"),!1)));if(0===n.length)return;const r=await Promise.allSettled(n.map((async({pyName:e,pyPath:t})=>{try{return{pyPath:t,response:await og.getPageDataAsync(e,"",{})}}catch(t){return console.error(`Failed to load data page ${e}:`,t),null}}))),a=r.length;let s=!1;for(let e=0;e<a;e+=1){const n=r[e];if("fulfilled"===n.status&&n.value){const{pyPath:e,response:r}=n.value;this.setNestedProperty(t,e,r),s=!0}}s&&PA.setEnvironmentInfo(t)};#D(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}setNestedProperty(e,t,n){const r=t.startsWith(".")?t.slice(1):t;if(!r)return void("object"==typeof n&&null!==n&&Object.assign(e,n));const a=r.split("."),s=a.length;let o=e;for(let e=0;e<s-1;e+=1){const t=a[e],n=o[t];if(this.#D(n))o=n;else{const e={};o[t]=e,o=e}}o[a[s-1]]=n}start=async(e,t)=>{const{serviceConfig:{appStaticContentServer:n},ccV2LibId:r,environmentId:a,isAlternateDesignSystemEnabled:s,alternateDesignSystemName:o}=e;await this.initCoreConfig(e);const i=PA.environmentInfoObject?.pyC11nDXCBDevURL,c="true"===s&&"other"!==o,l=async()=>{await this.importReactRoot();const e=[];i?e.push(fh.importCustomComponentMap("")):r&&e.push(fh.importCustomComponentMap(r)),c&&e.push(this.importDesignSystemComponentMap(n,a,o)),e.length&&await Promise.all(e),t?.()},d=JD.getComponentsRegistry();if("ReactRoot"in d.getLazyMap())return!0;return d.getComponent("ReactRoot")?(await l(),!0):new Promise((e=>{gu.subscribeOnce("component-map-loaded",(async()=>{await l(),gu.unsubscribe("component-map-loaded","component-map-loaded-id"),e(!0)}),"component-map-loaded-id")}))};registerForDebugInfo=e=>{if(PA.setPreviewMode(),!e)return;const t=({debugInfo:t})=>{const n=t?.["X-Pega-App-Debug-ID"];n&&e.postMessage({appDebugID:n})};gu.subscribe("fetchSuccess",t,"fetchSuccess"),gu.subscribe("fetchFailure",t,"fetchFailure")};toggleTracerHeaders=e=>{e.addEventListener("message",(e=>{const t=e?.data?.enableTracer;t?yu.enableTracer():yu.disableTracer()}))};loadEnvironmentInfo=async e=>{const t="Android"===window.pms?.device.systemName;if(e.theme&&!t)try{const t=JSON.parse(e.theme.definition),n=t.Branding,r=t.Theme;PA.setBrandingInfo(n),PA.setTheme(r)}catch{PA.setBrandingInfo({}),PA.setTheme({})}if(e.darkTheme&&!t){const t={type:"dark"};try{const n=JSON.parse(e.darkTheme.definition);PA.setBrandingInfo(n.Branding,t),PA.setTheme(n.Theme,t)}catch{PA.setBrandingInfo({},t),PA.setTheme(void 0,t)}}e.keyMapping&&PA.setKeyMapping(e.keyMapping),PA.setCookieComplianceMethod(e.cookieComplianceMethod??"none")};async loadCustomComponentLibrariesIfEnabled(e){e?.length>0&&PA.environmentInfoObject?.pyInfinityStaticService&&await this.loadCustomComponentLibraries(e)}async loadCustomComponentLibraries(e){const t=e.map((e=>this.importSingleCustomComponent(e)));await Promise.all(t)}importSingleCustomComponent(e){return"object"==typeof e&&"pyComponentMap"in e?fh.importCustomComponentMap(e.pyComponentMap,e.pxUpdateDateTime):fh.importCustomComponentMap(e)}#T(e,t,n){S_(e),Oh.buildActionTargetMap(t),nn(n)}#O(){document.querySelectorAll('head link[rel~="icon"], head link[rel~="apple-touch-icon"]').forEach((e=>{e.setAttribute("href",e.href)}))}#P(e,t){if(null===e)return;if("object"==typeof e)return void PA.setTheme(e,t);let n;try{n=JSON.parse(e)}catch{return void PA.setTheme("dark"===t?.type?void 0:{},t)}PA.setTheme(n,t)}},rv={createViewRule:(e,t)=>{const{restApi:n,reqType:r}=i_("createViewRuleByID");return Wu(n,{method:r,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:r}=i_("getViewRuleByID",{ID:e});return Wu(n,{method:r},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:r,reqType:a}=i_("updateViewRuleByID",{ID:e});return Wu(r,{method:a,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:r}=i_("deleteViewRuleByID",{ID:e});return Wu(n,{method:r},t).then((e=>e.data))},getCalculatedFields:(e,t,n)=>{const{restApi:r,reqType:a}=i_("getCalculatedFieldsInViewByID",{caseID:e,viewID:t});return Wu(r,{method:a,body:{calculations:{fields:n}}}).then((e=>e.data))}},av={"Content-Type":"application/json"},sv={addCaseFollower:(e,t,n)=>{const r={caseID:e},a=JSON.stringify({users:t.map((e=>({ID:e})))});return th("addCaseFollower",{body:a,queryPayload:r,headers:av},n)},deleteCaseFollower:(e,t,n)=>th("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>th("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},ov={addRelatedCases:(e,t,n)=>{const r={caseID:e},a=JSON.stringify({cases:t});return th("addRelatedCases",{body:a,queryPayload:r},n)},removeRelatedCase:(e,t,n)=>th("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>th("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},iv="operatorDetails",cv={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=i_(iv,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return th(iv,{queryPayload:t})}return t?th("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):th(iv,{body:{dataViewParameters:{ID:e}}})}},lv="postCustomFeedMessages",dv={"Content-Type":"application/json"};const uv=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,r,a,s,o)=>{const i=s.getLocalizationService();o||(this.mentions=[]);let c="";r&&Array.isArray(r)&&r?.length>0&&(r.forEach((e=>{e.on&&(c=`${c}${e.id},`)})),""===c&&(c="ClearFilters"));let l="";o&&(l=s.getValue("pulse.pageLastEntry"));const d={filterForContext:"pyDataFeed"===t?encodeURIComponent(e):e,feedID:t,feedClass:n,filterBy:c,pageSize:10,olderThan:l};for(let e=0;e<a.length;e+=1)a[e].cancel();const u=ah();return a.push(u),th("getFeedMessages",{queryPayload:d,cancelTokenSource:u},s.getContextName()).then((async t=>{if(200!==t.status||!t.data)return s.reportError(`getFeeds call failed ${t.status}`,t.data),t;{a.pop();const n=[],c={};let l=!1,d=[];if(t?.data){if(d=Array.isArray(t.data.data.MessageTypes)&&t.data.data.MessageTypes.length?t.data.data.MessageTypes:[],t?.data?.data?.FeedList){const e=t.data.data.FeedList?.pxResults;Array.isArray(e)&&e?.length>0&&e.forEach(((e,t)=>{e.ID=""!==e.pzInsKey?e.pzInsKey:`message${t}`,n.push(e.ID),c[e.ID]=e,e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions),e?.pxResults&&Array.isArray(e?.pxResults)&&e.pxResults?.length>0&&e.pxResults.forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(...e.mentions)})),l||["pzPostDetails","pzPrivatePostDetails"].includes(e.pyMessageViewReference)||(l=!0)}))}if(l&&await om({uiResources:t.data.uiResources}),!r&&(r=[{id:"All",label:i.getLocalizedText("All"),on:!0,disabled:!1}],t?.data?.data?.FeedFilters)){const e=t.data.data.FeedFilters?.pxResults;let n=!0;if(e&&Array.isArray(e)&&e?.length>0){e.forEach((e=>{const t={id:e.pyFeedSourceReference,label:i.getLocalizedText(e.pyLabel),disabled:!1,on:"true"===e.pySelected};t.on||(n=!1),r.push(t)}));const t=r.find((e=>"All"===e.id));t&&(t.on=n)}}}if(o&&s.getValue("pulse.messageIDs")){let e=s.getValue("pulse.messages");e={...e,...c},Object.values(e).forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(e.mentions),e?.pxResults&&Array.isArray(e?.pxResults)&&e.pxResults?.length>0&&e.pxResults.forEach((e=>{e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0&&this.mentions.push(...e.mentions)}))}))}if(TI(s.getContextName())){s.updateState({pulse:{messages:o&&s.getValue("pulse.messageIDs")?{...s.getValue("pulse.messages"),...c}:c,messageIDs:o&&s.getValue("pulse.messageIDs")?[...s.getValue("pulse.messageIDs"),...n]:n,nextPageFirstEntry:t?.data?.nextPageFirstEntry||"",pageLastEntry:t?.data?.pageLastEntry||"",hideAttachment:t?.data?.hideAttachment||!1,postTypes:d,pulseContext:e}});const a=[...new Map(this.mentions.flat()?.map((e=>[e.mentionsID,e]))).values()].filter((e=>Object.hasOwn(e,"mentionsType"))).filter((e=>!e?.mentionsType?.toLowerCase().includes("user")));return{feedFilters:r,caseMentions:a}}}})).catch((e=>{if(!sh(e))return s.reportError(": Error occurred during ajax call at getFeeds API : ",e.response),e.response}))};postMessage=(e,t,n,r=[],a=!1,s=[])=>{const o={message:t,context:e,parentMessageId:a?e:"",attachments:r,pyRecipients:s.length?s:void 0},i=0===s.length?{body:JSON.stringify(o),headers:dv}:{body:JSON.stringify(o),queryPayload:{type:"PegaSocial-Post-Private"},headers:dv};return th(s.length?lv:"postFeedMessages",i,n.getContextName()).then((t=>{if((201===t.status||200===t.status)&&t.data){const s=t?.data;if(a){s.parentMessageID=e;const{pxResults:t,caseMentions:o}=this.buildMessageObject(s,a,n,r.length>0);return n.updateState({pulse:{messages:{[e]:{pxResults:t}}}}),o}const{messages:o,messageIDs:i,caseMentions:c}=this.buildMessageObject(s,a,n,r.length>0);return n.updateState({pulse:{messages:o,messageIDs:i}}),c}return n.reportError(`postMessage call failed with status ${t.status}`,t),""})).catch((e=>{throw n.reportError(": Error occurred during ajax call at postMessage API : ",e.response),e.response}))};postCustomMessage=(e,t,n)=>th(lv,{body:t,queryPayload:{type:e},headers:dv},n.getContextName()).then((async e=>{if(201===e.status&&e.data){const r=e.data.data,a={ID:r.ID,pzInsKey:r.ID,classID:r.classID,pyPostType:r.pyPostType,postedByUser:r.postedByUser,pyIsDeleteEnabled:r.pyIsDeleteEnabled,pyMessageViewReference:r.messageViewReference,pyFeed:{pyIconType:"user",pyCommentContext:r.pyCommentContext,pyPostedOn:r.postedTime,pyFeedTitle:r.postedByUser.name,pyIconReference:r.postedByUser.ID},...r.PostMessage};im(r.messageViewReference,n,t.context)||await om({uiResources:e.data.uiResources}),n.updateState({pulse:{messages:{[a.ID]:a,...n.getValue("pulse.messages")},messageIDs:[a.ID,...n.getValue("pulse.messageIDs")]}})}return n.reportError(`postCustomMessage call failed with status ${e.status}`,e),""})).catch((e=>{throw n.reportError(": Error occurred during ajax call at postCustomMessage API : ",e.response),e.response}));editMessage=({messageID:e,parentMessageID:t,message:n,pConnectObj:r,isReply:a=!1,recipients:s=[]})=>{const o=JSON.stringify({message:n,...s.length&&{pyRecipients:s}});return th("editFeedMessage",{queryPayload:{messageID:e},body:o,headers:dv},r.getContextName()).then((e=>{if(200===e?.status&&e?.data){const n=e?.data;if(a){n.parentMessageID=t;const{pxResults:e,caseMentions:s}=this.buildMessageObject(n,a,r,!1);return r.updateState({pulse:{messages:{[t]:{pxResults:e}}}}),s}const{messages:s,caseMentions:o}=this.buildMessageObject(n,a,r,!1);return r.updateState({pulse:{messages:s}}),o}return r.reportError(`editMessage call failed with status ${e.status}`,e),""})).catch((e=>{throw r.reportError(": Error occurred during ajax call at editMessage API : ",e.response),e.response}))};buildMessageObject=(e,t,n,r=!1)=>{const a={ID:e?.ID||"",classID:e?.classID||"PegaSocial-Message",tags:e?.tags||[],pyHasAttachment:r,pzInsKey:e?.ID||"",pyMessage:e?.message||"",mentions:e?.mentions||[],postedByUser:e?.postedByUser,pxCreateDateTime:e?.postedTime||"",pxUpdateDateTime:e?.updatedTime||"",parentMessageID:e?.parentMessageID||"",pyIsDeleteEnabled:e?.pyIsDeleteEnabled||!1,pyIsEdited:"string"==typeof e?.isEdited?"true"===e?.isEdited:e?.isEdited||!1,pyFeed:{pyPostedOn:e?.postedTime||"",pyFeedTitle:e?.postedByUser?.name||"",pyIconType:"user",pyCommentContext:e?.pyCommentContext||".pzInsKey",pyIconReference:"pi pi-case"},pyContext:"",pxIcon:"globe",pyMessageViewReference:e?.messageViewReference||"pzPostDetails",pyPostType:e?.pyPostType,pyRecipients:e?.pyRecipients?.length?e.pyRecipients:void 0},s=n.getValue("pulse.messages");if(t){let{pxResults:e=[]}=Object.values(s)?.find((e=>e?.ID===a?.parentMessageID))||{};const t=e?.findIndex((e=>e?.pzInsKey===a?.ID));if(-1!==t){const n=[...e];n[t]={...n[t],...a},e=n}else e=[...e,a];return{pxResults:e,messages:{},messageIDs:[],caseMentions:this.getCaseMentions(e)}}const o=n.getValue("pulse.messageIDs");if(o){const e=o.includes(a.ID)?{...s[a.ID],...a}:a,t={...s,[a.ID]:e};return{messages:t,messageIDs:o.includes(a.ID)?o:[a.ID,...o],caseMentions:this.getCaseMentions(Object.values(t))}}};getCaseMentions=e=>{const t=e?.filter((e=>e?.mentions&&Array.isArray(e?.mentions)&&e.mentions?.length>0))?.map((e=>e.mentions))?.concat(this.mentions);return[...new Map(t.flat()?.map((e=>[e.mentionsID,e]))).values()].filter((e=>Object.hasOwn(e,"mentionsType"))).filter((e=>!e?.mentionsType?.toLowerCase().includes("user")))};likeMessage=({pulseContext:e,likedBy:t,messageID:n,isReply:r,pConnectObj:a})=>{const s=t?"unlikeFeedMessages":"likeFeedMessages",o=JSON.stringify({ContextClass:e});th(s,{body:o,queryPayload:{pulseContext:e},headers:dv},a.getContextName()).then((s=>{if(200===s.status)if(r){const r=a.getValue(`pulse.messages.${n}`),s=r?.pxResults&&Array.isArray(r?.pxResults)&&r.pxResults?.length>0&&r.pxResults?.map((n=>{if((n={...n}).pzInsKey===e){let e=0,r=!1;const a=n.pyLikes?n?.pyLikes?.pxLikeCount:0;t?(e=a-1,r=!1):(e=a+1,r=!0),n.pyLikes={pxLikeCount:e,pxIsLiked:r}}return n}));a.updateState({pulse:{messages:{[n]:{pxResults:s}}}})}else{const r={...a.getValue(`pulse.messages.${n}`)},s=r.pyLikes?r.pyLikes.pxLikeCount:0;let o=0,i=!1;t?(o=s-1,i=!1):(o=s+1,i=!0),r.pyLikes={pxLikeCount:o,pxIsLiked:i},a.updateState({pulse:{messages:{[e]:r}}})}else a.reportError(`likeMessage call failed with status ${s.status}`,s)})).catch((e=>{a.reportError(": Error occurred during ajax call at likeMessage API : ",e.response.data)}))};deleteMessage=(e,t,n,r)=>{let a=e;t&&(a=n);th("deleteFeedMessage",{queryPayload:{messageID:a}},r.getContextName()).then((a=>{if(200===a.status)if(t){const t=r.getValue(`pulse.messages.${e}`),a=t?.pxResults&&Array.isArray(t?.pxResults)&&t.pxResults?.length>0&&t.pxResults?.filter((e=>e.pzInsKey!==n));r.updateState({pulse:{messages:{[e]:{pxResults:a}}}})}else{const t=r.getValue("pulse.messageIDs"),n=t&&Array.isArray(t)&&t?.length>0&&t?.filter((t=>t!==e)),a={...r.getValue("pulse.messages")};delete a[e],r.updateState({pulse:{messageIDs:n,messages:a}})}else r.reportError(`deleteMessage call failed with status ${a.status}`,a)})).catch((e=>{r.reportError(": Error occurred during ajax call at deleteMessage API : ",e.response)}))};getLikedUsers=(e,t)=>th("getFeedMessageLikes",{queryPayload:{messageID:e}},t.getContextName());getMentionSuggestions=(e,t)=>{const{pulseContext:n,searchFor:r,mentionsType:a,listSize:s=5}=e,o={pulseContext:n,searchFor:r,mentionsType:a,listSize:s};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const i=ah();return this.mentionsTagsCancelTokenSource.push(i),th("getMentionSuggestions",{queryPayload:o,cancelTokenSource:i},t.getContextName()).then((e=>(this.mentionsTagsCancelTokenSource=[],200===e.status&&e.data?e?.data:(t.reportError(`Get mention suggestions call failed ${e.status}`,e.data),[])))).catch((e=>{sh(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>th("getMentionTypes",{},e.getContextName());getPostTypeView=(e,t,n)=>th("getViewRuleByMessageType",{queryPayload:{type:e,contextID:n??""}},t.getContextName());getTagSuggestions=(e,t)=>{const{searchFor:n,listSize:r=5}=e,a={searchFor:n,listSize:r};for(let e=0;e<this.mentionsTagsCancelTokenSource.length;e+=1)this.mentionsTagsCancelTokenSource[e].cancel();const s=ah();return this.mentionsTagsCancelTokenSource.push(s),th("getTagSuggestions",{queryPayload:a,cancelTokenSource:s},t.getContextName()).then((e=>{this.mentionsTagsCancelTokenSource=[];let n=[];return 200===e.status&&e?.data?n=e?.data?.tags&&Array.isArray(e?.data?.tags)&&e.data.tags.length>0&&e.data.tags?.map((e=>`#${e}`)):t.reportError(`Get tag suggestions call failed ${e.status}`,e.data),n})).catch((e=>{sh(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},pv={getTaggedCases:(e,t)=>{const n={caseID:e,viewID:Mr.getDefaultQualifiedName("pyTaggedCases")};return th("loadView",{queryPayload:n},t.getContextName()).then((e=>e?.data)).catch((e=>{t.reportError(": Error occurred during ajax call at fetchTaggedcases API : ",e.response)}))},getTags:(e,t)=>th("getCaseTags",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.tagsList)).catch((e=>{t.reportError(": Error occurred during ajax call at fetchTags API : ",e.response)})),postTags:(e,t,n)=>{const r={caseID:e},a=JSON.stringify({tags:t});return th("addTagsToCase",{body:a,queryPayload:r},n.getContextName()).then((e=>e?.data?.results)).catch((e=>{n.reportError(": Error occurred during ajax call at postTags API : ",e.response)}))},removeTag:(e,t,n)=>th("deleteCaseTag",{queryPayload:{caseID:e,tagID:t}},n.getContextName()).catch((e=>{n.reportError(": Error occurred during ajax call at removeTag API : ",e.response)})),getTagsLandingPageURL:e=>{const t=Mr.getDefaultQualifiedName("D_pxGetTagsLandingPageURL");return og.getPageDataAsync(t,e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))}},hv=(e,t)=>{uA(t.getContextName(),e.etag),pA(t.getContextName(),e.etag)},fv={getParticipants:(e,t)=>th("getAllParticipants",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.data.content.pyParticipants)).catch((e=>{t.reportError(": Error occurred during ajax call at getParticipants API : ",e.response)})),getRoleView:(e,t,n)=>th("getParticipantRoleView",{queryPayload:{caseID:e,participant_roleID:t}},n.getContextName()).then((e=>e?.data)).catch((e=>{n.reportError(": Error occurred during ajax call at fetchTaggedcases API : ",e.response)})),getParticipantRoles:(e,t)=>th("getParticipantRoles",{queryPayload:{caseID:e}},t.getContextName()).then((e=>e?.data?.participant_roles)).catch((e=>{t.reportError(": Error occurred during ajax call at getParticipantRoles API : ",e.response)})),getParticipant:(e,t,n)=>th("getParticipant",{queryPayload:{caseID:e,participantID:t}},n.getContextName()).then((e=>e?.data)).catch((e=>{n.reportError(": Error occurred during ajax call at getParticipant API : ",e.response)})),createParticipant:async(e,t,n,r,a)=>{const s={caseID:e},o={...n,participantRoleID:t},i={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{th("createParticipant",{body:o,queryPayload:s,headers:i},r.getContextName()).then((t=>{hv(t.headers,r),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=Hy(a||r.getContextName());r.reportError(": Error occurred during ajax call at createParticipant API : ",{...e.response.data,formFields:n},a),t(e.response)}))}))},updateParticipant:async(e,t,n,r,a)=>{const s={caseID:e,participantID:t},o={"if-match":r.getCaseSummary().headers.etag};return new Promise(((e,t)=>{th("updateParticipant",{body:n,queryPayload:s,headers:o},r.getContextName()).then((t=>{hv(t.headers,r),e()})).catch((e=>{e.response.data.errorDetails?.forEach((e=>{e.erroneousInputOutputFieldInPage=e.erroneousInputOutputFieldInPage.replace(/\.pyWorkParty\([^)]*\)/,"")}));const n=Hy(a||r.getContextName());r.reportError(": Error occurred during ajax call at updateParticipant API : ",{...e.response.data,formFields:n},a),t(e.response)}))}))},deleteParticipant:(e,t,n)=>{const r={caseID:e,participantID:t},a={"if-match":n.getCaseSummary().headers.etag};return new Promise(((e,t)=>{th("deleteParticipant",{queryPayload:r,headers:a},n.getContextName()).then((t=>{hv(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function gv(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const mv="create",yv="update",Ev="delete";function Iv(e,t,n,r){const a=AC(t);if(a){switch(e){case mv:case yv:{const{markAsDefault:e,...t}=r;Object.entries(t).length>0&&(a.allPersonalizations[n]=t),e&&(a.defaultPersonalization=n);break}case Ev:delete a.allPersonalizations[n],a.defaultPersonalization===n&&(a.defaultPersonalization="");break;default:return null}return a}return null}const Av={},Cv=async e=>{const t=AC(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=gv(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:r}=i_("getUIListPersonalizations",{listID:e});return Wu(n,{method:r,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:gv(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},Sv=async(e,t,n)=>{const{restApi:r,reqType:a}=i_("createListPersonalization",{listID:e});return Iv(mv,e,t,n),Wu(r,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return Av[t]=n,e}))},_v=async(e,t,n)=>{const r=Av[t]||t;Iv(yv,e,t,n);const{restApi:a,reqType:s}=i_("updateListPersonalization",{listID:e,personalizationID:r})||{};return Wu(a,{method:s,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},Nv=async(e,t)=>{const n=Av[t]||t;Iv(Ev,e,t);const{restApi:r,reqType:a}=i_("deleteListPersonalization",{listID:e,personalizationID:n});return Wu(r,{method:a,body:{}}).then((e=>(Av[t]&&delete Av[t],e)))};const bv=function(e){return e?{createPersonalization:Sv.bind(null,e),updatePersonalization:_v.bind(null,e),deletePersonalization:Nv.bind(null,e),fetchPersonalizations:Cv.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},Tv="undefined"!=typeof window?window.sessionStorage:{getItem:()=>null,setItem:()=>{}},Pv="getDataObjects",Ov="getInsightByID",Dv=["LocalList","RemoteList","PromptList","DataPage"];let vv=null;const Rv=[];const $v={},xv=e=>Sf.getAppCacheKey(`PrimaryFields-${e}`);function wv(e){let t;return e[1].category?t=e[1].category:e[0].indexOf(":")>0&&(t=e[0].substring(0,e[0].indexOf(":"))),t}function Mv(e){return"object"==typeof e&&null!==e}function Lv(e){return{...e[1],fieldID:e[0],fieldType:e[1].fieldType||(e[1].isUserReference?"User reference":void 0),category:wv(e),classID:e[1].associationClassID?e[1].associationClassID:e[1].classID}}function Uv({data:e}){const t=(e,t)=>tm("FIELD",e,t),n="string"==typeof e.classID?e.classID:"",r=tm("CASE",n);e.classNameLocaleReference=r;const a=Array.isArray(e.fields)?e.fields:[];for(let e=0;e<a.length;e+=1){const n=a[e];if(Mv(n)){const e={nameLocaleReference:"INSIGHTS",categoryLocaleReference:"INSIGHTS",parentCategoryLocaleReference:"INSIGHTS"},a=n.definedOnClassIDs;if("string"==typeof a){const s=a.split(":").reverse(),o="string"==typeof n.fieldID?n.fieldID:"",i=o.split("!").pop()?.split(":").reverse()||[];s[0]&&i[0]&&(e.nameLocaleReference=t(i[0],s[0])),s[1]&&i[1]&&(e.categoryLocaleReference=t(i[1],s[1])),s[2]&&i[2]?e.parentCategoryLocaleReference=t(i[2],s[2]):n.parentCategory&&(e.parentCategoryLocaleReference=r)}Object.assign(n,e)}}return{data:e}}const Fv={getDataObjects:function(){const e=Sf.getAppCacheKey(Pv);if(Tv.getItem(e))return Promise.resolve(JSON.parse(`${Tv.getItem(e)}`));const{restApi:t,reqType:n}=i_(Pv,{}),r=Wu(t,{method:n});return r.then((t=>{Tv.setItem(e,JSON.stringify(t))})),r},getDataPageObjects:function(e=!0){if(vv)return vv;const t=Sf.getAppCacheKey("getDataPageObjects");if(e&&Tv.getItem(t))return Promise.resolve(JSON.parse(`${Tv.getItem(t)}`));const{restApi:n,reqType:r}=i_("getDataPages",{datapageRequestType:"explorable"});return vv=Wu(n,{method:r,datapageRequestType:"explorable"}),vv.then((e=>{vv=null,Tv.setItem(t,JSON.stringify(e))})),vv},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=IC(e);if(t&&t.classID){let e=SC(t.classID);const n=t.rdFields,r=(n&&!Array.isArray(n)?n.fields:void 0)?.filter((e=>e.indexOf(".")>0));if(r&&!aS.isEmpty(r)){const n=r.reduce(((e,n)=>{const r=lC(n,t.classID);var a;return r&&"type"in(a=r)&&"classID"in a&&(e[n]=r),e}),{});e={...e,...n}}if(e&&Object.keys(e).length>0){for(const t of Object.keys(e))e[t].type.startsWith("Page")?delete e[t]:e[t]?.datasource&&Dv.includes(e[t].datasource.tableType)&&(e[t].fieldType="Picklist");return{sourceFields:e,sourceMetadata:t}}}return{}}(e);if(t&&n&&Object.keys(n).length>0){const e={...t,fields:Object.entries(n).map(Lv)};if(Mv(r=e)&&"string"==typeof r.classID&&Array.isArray(r.fields)){const t=Uv({data:e});return Promise.resolve(t)}}}var r;const a={dataSource:e,columns:[],parameters:{},associationFilter:n,matchPosition:"",ignoreCase:!1};return Ig.init(a).then((({dataSourceMetaData:e})=>e?Uv({data:e}):{data:{classID:"",className:"",isQueryable:!1,fields:[]}}))},getDefaultColumns:function(e){const t=Sf.getAppCacheKey(`DefaultColumns_${Object.values(e).join("_")}`);if(Tv.getItem(t))return Promise.resolve(JSON.parse(`${Tv.getItem(t)}`));const n={dataViewName:Mr.getDefaultQualifiedName("D_pzGetDefaultColumns")},{restApi:r,reqType:a}=i_("getListData",n),s=Wu(r,{method:a,body:{dataViewParameters:e}});return s.then((e=>{Tv.setItem(t,JSON.stringify(e))})),s},getFieldsForDataSource:function(e,t,n){if(!t){const t=IC(e),n=Array.isArray(t?.rdFields)?t?.rdFields:t?.rdFields?.fields;return n?Promise.resolve({data:{data:n.map((e=>({pyFieldName:e})))}}):Promise.resolve({data:{data:[]}})}const r=Sf.getAppCacheKey(`RDColumns-${e}`);if(Tv.getItem(r))return Promise.resolve(JSON.parse(`${Tv.getItem(r)}`));const a=Sf.getData(Mr.getDefaultQualifiedName("D_pxFieldsForDataSource"),{dataViewParameters:{DataPageName:e}},n);return a.then((e=>{Tv.setItem(r,JSON.stringify(e))})),a},getPrimaryFieldsForDataSource:function(e="",t=""){const n=Sf.getAppCacheKey(`PFColumns-${e}${t}`);if(Tv.getItem(n))return Promise.resolve(JSON.parse(`${Tv.getItem(n)}`));const r=Sf.getData(Mr.getDefaultQualifiedName("D_pxGetInitialFieldsForDataSource"),{dataViewParameters:{DataPageName:e,ClassName:t}});return r.then((e=>{Tv.setItem(n,JSON.stringify(e))})),r},getPrimaryFieldsForInsights:async function(e,t,n,r){const{allClasses:a,promisesToAwait:s,classesToFetch:o,isTopLevelClassPresent:i,joinedClassesToFetch:c}=function(e,t){const n=[],r=[];let a=!1;const s=[],o=[];return e&&o.push(e),t&&t.length>0&&o.push(...t),o.forEach((t=>{const o=xv(t);if(Tv.getItem(o))return;const i=$v[t];i?r.push(i):(n.push(t),t===e?a=!0:s.push(t))})),{allClasses:o,promisesToAwait:r,classesToFetch:n,isTopLevelClassPresent:a,joinedClassesToFetch:s}}(e,n);return o.length&&s.push((async(e,t,n,r,a)=>{const s=Sf.getData(Mr.getDefaultQualifiedName("D_pxGetPrimaryFieldsForInsights"),{dataViewParameters:{...t&&{topLevelClassID:t},...r&&{joinedClassIDs:r.join(",")},...n&&{topLevelDataPageID:n}}},a).then((t=>{const n=t.data?.data||[],r={};e.forEach((e=>{r[e]=[]})),n.forEach((e=>{const t=e.classID,n=e[Mr.getDefaultQualifiedName("pyFieldName")];r[t].push(n)})),Object.entries(r).forEach((([e,t])=>{const n=xv(e);Tv.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete $v[e]}))}));return e.forEach((e=>{$v[e]=s})),s})(o,i?e:void 0,i?t:void 0,c.length>0?c:void 0,r)),Promise.allSettled(s).then((()=>{const e={};return a.forEach((t=>{const n=xv(t);if(Tv.getItem(n))try{e[t]=JSON.parse(`${Tv.getItem(n)}`)}catch{}})),{data:e}}))},getInsightIDs:function(){const{restApi:e,reqType:t}=i_("getInsightIDs");return Wu(e,{method:t})},getInsightByID:function(e){const t=CC(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:r,reqType:a}=i_(Ov,n);return Wu(r,{method:a})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:r}=i_(Ov,t);return Wu(n,{method:r})},loadClassResources:async e=>{const t=e.filter((e=>!Rv.includes(e)));if(0===t.length)return;const n={classIDs:e.join(",")},{restApi:r,reqType:a}=i_("getClassResources",n);return Wu(r,{method:a}).then((e=>{e.data.resources&&(Rv.push(...t),Kp(e.data.resources))}))},createInsight:function(e){const{restApi:t,reqType:n}=i_("createInsight");return Wu(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:r,reqType:a}=i_("updateInsight",n);let s;return"UpdateDateTime"in t&&(s=t.UpdateDateTime),Wu(r,{method:a,body:JSON.stringify(t),headers:{"if-match":s,"Content-Type":"application/json"}})},deleteInsight:function(e){const t={insightID:e},{restApi:n,reqType:r}=i_("deleteInsight",t);return Wu(n,{method:r})},exportToExcel:function(e){const{restApi:t,reqType:n}=i_("exportToExcel");return Wu(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=i_("exportToCSV");return Wu(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:r,reqType:a}=i_("scheduleInsight",n);return Wu(r,{method:a,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const r={insightID:e,scheduleID:t},{restApi:a,reqType:s}=i_("updateScheduledInsight",r);return Wu(a,{method:s,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:r,reqType:a}=i_("deleteScheduledInsight",n);return Wu(r,{method:a})},translateStrings:function(e){const{restApi:t,reqType:n}=i_("translateStrings");return Wu(t,{method:n,body:JSON.stringify(e)})}};const jv=new class{addRoutes=e=>{return t=e,void bA.addRoutes(t);var t}};const kv=class{static registerModule(e,t,n){n[e]=()=>t}};const Vv=class{static getCaseEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.CASE_EVENTS);static getDataEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.DATA_EVENTS);static getTransientEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.EVENT_TRANSIENT_ITEMS);static getBootstrapShellEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS);static getBulkProcessEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.EVENT_BULKACTION);static getLocalActionProcessEvent=()=>Object.freeze(Ur.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION)};const Bv=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},Gv={setTokens:e=>{Qu({tokenInfo:e}),Ku(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>gu.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Au(),getAuthInstance:e=>Iu.init(e),setAuthorizationHeader:e=>{Ku({Authorization:e}),setTimeout((()=>gu.publish("updateSession",{updateStatus:"success"})),0)}};const Wv=new class{getDebouncedSubject(e){return(new af).pipe(vO(e))}},Hv=(()=>{const e="[!#-'*+/0-9=?A-Z\\^_`a-z{|}~\\-]+",t="\\\\[\\x00-\\x7f]",n=`(?:${e}|${`"(?:[^\\r"\\\\\\x80-\\xff]|${t})*"`})`,r=`(?:${e}|${`\\[(?:[^\\r\\[\\]\\\\\\x80-\\xff]|${t})*\\]`})`;return new RegExp(`^${`${n}(?:\\.${n})*`}@${`${r}(?:\\.${r})*`}$`)})();const qv=(()=>{const e="[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+";return new RegExp(`^${`${`(?:${`${e}(?:\\.${e})*`}|"(?:[^\\x0d\\x22\\x5c]|\\\\[\\x00-\\x7f])+")`}@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}`}$`)})();zp.register("email",((e,{useRFC822Validation:t})=>{let n=null;const r=t?(a=e,Hv.test(a)):function(e){return qv.test(e)}(e);var a;return e&&!r&&(n="Enter a valid email address"),n})),zp.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t="Invalid number"),t})),zp.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?"Cannot be blank":null)),zp.register("url",(e=>{let t=null;return e&&!function(e){let t;try{t=new URL(e)}catch{return!1}return"http:"===t.protocol||"https:"===t.protocol||"ftp:"===t.protocol}(e)&&(t="Enter a valid url"),t})),setTimeout((()=>{const e="Enter a valid phone number";Promise.resolve().then(n.bind(n,816)).then((({parsePhoneNumberFromString:t})=>{zp.register("phone",(n=>{let r=null;n&&!/^\+?\d+$/.test(n)&&(r=e);const a=n?.startsWith("+");if(n&&a){const a=t(n);a&&a.isPossible()&&n===a.number||(r=e)}return r}))}))}),Fr.PRIORITY.TRIVIAL);const Yv=(e,t)=>{switch(t){case"invalid":return`Incorrect ${e}`;case"incomplete":return`Incomplete ${e}`;default:return null}};zp.register("datetime",(e=>Yv("date and time",e))),zp.register("date",(e=>Yv("date",e))),zp.register("time",(e=>Yv("time",e)));const zv=e=>{for(const t of e)if(t?.error)return"Error with one or more files";return null};zp.register("attachment",(e=>{let t=null;return e?("pyCount"in e&&Array.isArray(e.pxResults)?t=zv(e.pxResults):Array.isArray(e)?t=zv(e):"error"in e&&e.error&&(t="Error with one or more files"),t):t}));const Kv=()=>{const e={},t="undefined"!=typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0;t&&(e["user-timezone"]=t);const n="undefined"!=typeof navigator?navigator.language:void 0;return n&&(e["user-locale"]=n),e},Qv="createConversation",Jv="sendMessage",Xv="getConversations",Zv="getMessages",eR="createConversationForAgent",tR="sendMessageForAgent",nR="getCoach",rR=(e,t,n,r,a,s,o)=>{for(const e of o)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const i=ah();return o.push(i),th(e,{queryPayload:Xv===e?{assistantID:t,contextID:n,pageSize:r,pageIndex:a}:{agentID:t,contextID:n,pageSize:r,pageIndex:a},cancelTokenSource:i,headers:Kv()},s).then((e=>(o.pop(),e)))},aR=(e,t,n,r,a)=>{for(const e of a)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const s=ah();return a.push(s),th(e,{queryPayload:Zv===e?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},cancelTokenSource:s,headers:Kv()},r).then((e=>(a.pop(),e)))},sR=(e,t,n,r,a,s,o=!1)=>{for(const e of a)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const i=ah();return a.push(i),th(e,{body:JSON.stringify({contextID:t,executeStarterQuestion:!1,...s&&s.isManualConfirmationSupported&&{capabilities:{tools:{isManualConfirmationSupported:!0}}},...e===eR&&o&&{showAgentRecommendations:o}}),cancelTokenSource:i,queryPayload:e===Qv?{assistantID:n}:{agentID:n},headers:Kv()},r).then((e=>(a.pop(),e)))},oR=(e,t,n,r,a,s,o)=>{const i={...r&&{request:r},...o&&o.additionalInstruction&&{additionalInstruction:o.additionalInstruction},...o&&o.isManualConfirmationSupported&&{capabilities:{tools:{isManualConfirmationSupported:!0}}},...o&&o.toolsReviewed&&o.toolsReviewed.length>0&&{toolsReviewed:o.toolsReviewed},...s&&s?.length>0&&{attachments:s}};return th(e,{body:JSON.stringify(i),queryPayload:e===Jv?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},headers:Kv()},a)},iR=(e,t,n,r,a,s,o,i)=>{const c={...r&&{request:r},...o&&o.additionalInstruction&&{additionalInstruction:o.additionalInstruction},...s&&s.length>0&&{attachments:s},...o&&o.toolsReviewed&&o.toolsReviewed.length>0&&{toolsReviewed:o.toolsReviewed},capabilities:{stream:{isEnabled:!0},...o&&o.isManualConfirmationSupported&&{tools:{isManualConfirmationSupported:!0}}},...o&&o.questionnaire&&{questionnaire:o.questionnaire}},l=e===Jv?{assistantID:t,conversationID:n}:{agentID:t,conversationID:n},{restApi:d,reqType:u}=i_(e,l),p={method:u,headers:{Accept:"text/event-stream",...Kv()},body:JSON.stringify(c),responseType:"stream",adapter:"fetch",...i&&{signal:i.token}};return Wu(d,p,a)},cR=(e,t,n,r,a)=>{for(const e of r)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const s=ah();return r.push(s),th(e,{queryPayload:e===nR?{assistantID:t,...a&&{contextID:a}}:{agentID:t,...a&&{contextID:a}},cancelTokenSource:s},n).then((e=>(r.pop(),e))).catch((e=>{throw r.pop(),e}))},lR={createConversation:(e,t,n,r=[])=>sR(Qv,e,t,n,r),sendMessage:(e,t,n,r,a)=>a?.enableStreaming?iR(Jv,e,t,n,r,void 0,a):oR(Jv,e,t,n,r),createConversationForAgent:(e,t,n,r=[],a,s)=>sR(eR,e,t,n,r,a,s),sendMessageForAgent:(e,t,n,r,a,s)=>s?.enableStreaming?iR(tR,e,t,n,r,a,s,s.cancelTokenSource):oR(tR,e,t,n,r,a,s),getAgent:(e,t,n,r=[])=>cR("getAgent",e,t,r,n),getCoach:(e,t,n,r=[])=>cR(nR,e,t,r,n),likeAgentMessage:(e,t,n,r)=>{const a={queryPayload:{agentID:e,conversationID:t,messageID:n},headers:Kv()};return th("likeAgentMessage",a,r)},unLikeAgentMessage:(e,t,n,r,a="")=>{const s={queryPayload:{agentID:e,conversationID:t,messageID:n},body:JSON.stringify({feedbackText:a}),headers:Kv()};return th("dislikeAgentMessage",s,r)},getConversations:(e,t,n,r,a,s=[])=>rR(Xv,e,t,n,r,a,s),getConversationsForAgent:(e,t,n,r,a,s=[])=>rR("getConversationsForAgent",e,t,n,r,a,s),getMessages:(e,t,n,r=[])=>aR(Zv,e,t,n,r),getMessagesForAgent:(e,t,n,r=[])=>aR("getMessagesForAgent",e,t,n,r)};const dR=new class{async rewriteText(e){const{originalText:t,rewriteAction:n,additionalInstructions:r,context:a}=e,s=PA.isInfinityRuntime(),o=PA.getRewriteGenAIDP()??Mr.getDefaultQualifiedName("D_RewriteWithAI"),i={OriginalText:t,RewriteAction:n,AdditionalInstructions:r||""};try{let e,t;if(s){const t=await og.getPageDataAsync(o,a,i),n=Object.fromEntries(Object.entries(t)).pyResponseData;e="string"==typeof n?n:void 0}else{const n=(await og.getDataAsync(o,a,i)).data[0],r=n[Mr.getDefaultQualifiedName("Content")];e="string"==typeof r?r:void 0;const s=n[Mr.getDefaultQualifiedName("ErrorMessage")];t="string"==typeof s?s:void 0}return e?{success:!0,rewrittenText:e}:{success:!1,errorMessage:t||"AI rewrite failed: No rewritten text returned"}}catch(e){return{success:!1,errorMessage:e instanceof Error?e.message:"An unexpected error occurred during AI rewrite"}}}};const uR=class{classAccessMap=new Map;constructor(){const e=PA.getClassesAccessList();0!==e.length?this.classAccessMap=e.reduce(((e,t)=>(e.set(t.pyClassName,t.pyHasCreateAccess),e)),new Map):this.classAccessMap=PA.getCaseTypeList().reduce(((e,t)=>(e.set(t.pyWorkTypeImplementationClassName,t.hasCreateAccess??!0),e)),new Map)}hasCreateAccess(e){return this.classAccessMap.get(e)}static getInstance(){return this.instance||(this.instance=new this),this.instance}};const pR=class{static AUTOSAVE_SAVE_STATUS=TE;static isAutosaveEnabledForContext(e){return GE(e)}static subscribeAutosaveStatus(e,t){return((e,t)=>{let n=$E.get(e);return n||(n=new Set,$E.set(e,n)),n.add(t),()=>{const n=$E.get(e);n&&(n.delete(t),0===n.size&&$E.delete(e))}})(e,t)}static notifyChange(e,t,n){GE(e)&&(((e,t,n)=>{let r=xE.get(e);r||(r=new Map,xE.set(e,r)),r.set(t,n)})(e,t,n),YE(e))}};class hR{static behaviorOverrides={};getPersonalizationUtils=bv;constructor(){hR.behaviorOverrides={}}getPCoreVersion=()=>"26.1.2";onPCoreReady=e=>JD.onPCoreReady(e);onPCoreCleanup=e=>JD.onPCoreCleanup(e);getComponentsRegistry=()=>JD.getComponentsRegistry();checkIfSemanticURL=()=>JD.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(A_()){const e=bA.processUrl(CA(),!0);return!!bA._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>jv;getViewResources=()=>i;configureForBrowserBookmark=e=>JD.configureForBrowserBookmark(e);getStore=()=>kC();resetStore=()=>tS();getMessageManager=()=>pu;getCoexistenceManager=()=>GD;getStoreValue=(e,t,n)=>HC(e,t,n);getContainerUtils=()=>c;getAnnotationUtils=()=>Yh;getFieldUtils=()=>ep;getFieldDefaultUtils=()=>vp;getAssetLoader=()=>fh;getAttachmentUtils=()=>Vp;getViewRuleApi=()=>rv;getFeedUtils=()=>uv;getTagUtils=()=>pv;getGenAIAssistantUtils=()=>lR;getGenAIUtils=()=>dR;getStakeholderUtils=()=>fv;getUserApi=()=>cv;getCaseFollowerApi=()=>sv;getCaseUtils=()=>zy;getStateUtils=()=>Hg;getRelatedCasesApi=()=>ov;getDataApi=()=>Ig;getDataApiUtils=()=>Sf;getAnalyticsUtils=()=>Fv;getLocaleUtils=e=>{const t=e??PA.getLocale()??"en-US";return iC(t)};registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{hR.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{hR.behaviorOverrides[e]=t};getBehaviorOverrides=()=>hR.behaviorOverrides;getBehaviorOverride=e=>hR.behaviorOverrides[e];getAsynchronousUtils=()=>Wv;createPConnect=e=>Cm(e);getPubSubUtils=()=>gu;registerComponentCreator=e=>{Sm(e)};getConstants=()=>Object.freeze(Ur);getResolvedConstantValue=e=>Fr.getProperty(e);getEvents=()=>Vv;getRestClient=()=>o;getMashupApi=()=>WD;getEnvironmentInfo=()=>PA;switchLocale=e=>FD(e);getRuntimeParamsAPI=()=>bg;getSemanticUrlUtils=()=>vh;getRemoteCaseUtils=()=>Vr;getNavigationUtils=()=>Nh;registerModule=(e,t)=>kv.registerModule(e,t,this);getErrorHandler=()=>Bv;getFormUtils=()=>vy;getAutosaveUtils=()=>pR;getMessagingServiceManager=()=>ag;getMetadataUtils=()=>l;getDataPageUtils=()=>og;getDataTypeUtils=()=>qh;getCascadeManager=()=>LC;isDeepEqual=(e,t)=>Xt(e,t);getAuthUtils=()=>Gv;getDebugger=()=>yu;getDeferLoadManager=()=>Af;getExpressionEngine=()=>r;getActionsSequencer=()=>$g;getRefreshManager=()=>Cg;getInitialiser=()=>nv;getBootstrapUtils=()=>JD;getContextTreeManager=()=>Zd;getAccessPrivilege=()=>uR.getInstance();getObjectTransformer=()=>Lr;getAllStateMachines=(e,t,n)=>t&&n?Ry.getAllStateMachines(e,t,n):Ry.getAllStateMachinesByContext(e);isNamespaceEnabled=()=>Mr.isNamespaceEnabled();getQualifiedName=(e,t)=>Mr.getQualifiedName(e,t);getDefaultQualifiedName=e=>this.getQualifiedName(e,"PegaPlatform");getNameSpaceUtils=()=>Mr;getNetworkUtils=()=>mu;getMashupBridge=()=>p;getConfirmDialogService=()=>Zm}const fR=new hR;globalThis.PCore=fR})()})();
|
|
2
|
+
//# sourceMappingURL=constellation-core-react-native.js.map
|