{"version":3,"sources":["wwwroot/scripts/youli.upgradesubscription.js"],"names":["YouLi","UpgradeSubscription","ShowUpgradeDialog","message","returnURL","showPremiumTrip","tripId","$","html","upgradeLink","Common","Utils","AddParametersToURL","attr","toggleClass","modal","GoToUpgradePage","title","confirmTitle","confirmMessage","trialExpired","redirectURL","target","UI","ShowLoading","url","undefined","HideLoading","window","open","document","location"],"mappings":"AAAA,IAAAA,MAAAA,UACAA,MAAAC,oBAAAD,MAAAC,oBAAAD,MAAAC,uBAEA,SAAAD,GA+DAA,EAAAC,qBAAAD,EAAAC,oBA5DAD,EAAAC,oBAAAC,kBAAA,SAAAC,EAAAC,EAAAC,GAAA,EAAAC,EAAA,IACAC,EAAA,mBAAAC,KAAAL,GAEA,IAAAM,EAAA,wBACAL,IACAK,EAAAT,EAAAU,OAAAC,MAAAC,mBAAAH,EAAA,aAAAL,IAGAE,IACAG,EAAAT,EAAAU,OAAAC,MAAAC,mBAAAH,EAAA,UAAAH,IAGAC,EAAA,gBAAAM,KAAA,OAAAJ,GAEAF,EAAA,oCAAAO,YAAA,UAAAT,GACAE,EAAA,uCAAAO,YAAA,SAAAT,GAEAE,EAAA,yBAAAQ,MAAA,SAGAf,EAAAC,oBAAAe,gBAAA,SAAAC,EAAAd,EAAAe,EAAAC,EAAAC,EAAAC,EAAAf,EAAAgB,GAEAtB,EAAAU,OAAAa,GAAAC,cAGA,IAAAC,EAAA,wBAEAtB,IACAsB,EAAAzB,EAAAU,OAAAC,MAAAC,mBAAAa,EAAA,sBAAAR,GACAQ,EAAAzB,EAAAU,OAAAC,MAAAC,mBAAAa,EAAA,iBAAAtB,SAGAuB,IAAAR,IACAO,EAAAzB,EAAAU,OAAAC,MAAAC,mBAAAa,EAAA,4BAAAP,SAGAQ,IAAAP,IACAM,EAAAzB,EAAAU,OAAAC,MAAAC,mBAAAa,EAAA,8BAAAN,IAGAC,IACAK,EAAAzB,EAAAU,OAAAC,MAAAC,mBAAAa,EAAA,gBAAAL,IAGAC,IACAI,EAAAzB,EAAAU,OAAAC,MAAAC,mBAAAa,EAAA,aAAAJ,IAGAf,IACAmB,EAAAzB,EAAAU,OAAAC,MAAAC,mBAAAa,EAAA,UAAAnB,IAGAgB,GACAtB,EAAAU,OAAAa,GAAAI,cACAC,OAAAC,KAAAJ,EAAAH,IAGAQ,SAAAC,SAAAN,GA5DA,CAgEAzB","file":"youli.upgradesubscription.min.js","sourcesContent":["var YouLi = YouLi ? YouLi : {};\r\nYouLi.UpgradeSubscription = YouLi.UpgradeSubscription ? YouLi.UpgradeSubscription : {};\r\n\r\n(function (YouLi) {\r\n (function (UpgradeSubscription) {\r\n\r\n YouLi.UpgradeSubscription.ShowUpgradeDialog = function (message, returnURL, showPremiumTrip = false, tripId = \"\") {\r\n $(\"#UpgradeMessage\").html(message);\r\n\r\n var upgradeLink = \"/account/billingsetup\";\r\n if (returnURL) {\r\n upgradeLink = YouLi.Common.Utils.AddParametersToURL(upgradeLink, \"returnurl=\" + returnURL);\r\n }\r\n\r\n if (tripId) {\r\n upgradeLink = YouLi.Common.Utils.AddParametersToURL(upgradeLink, \"tripid=\" + tripId);\r\n }\r\n\r\n $(\"#UpgradeLink\").attr(\"href\", upgradeLink);\r\n\r\n $(\"#UpgradeAccountDialogTripPackage\").toggleClass(\"hidden\", !showPremiumTrip);\r\n $(\"#UpgradeAccountDialogNonTripPackage\").toggleClass(\"hidden\", showPremiumTrip);\r\n\r\n $(\"#UpgradeAccountDialog\").modal(\"show\");\r\n }\r\n\r\n YouLi.UpgradeSubscription.GoToUpgradePage = function (title, message, confirmTitle, confirmMessage, trialExpired, redirectURL, tripId, target) {\r\n\r\n YouLi.Common.UI.ShowLoading();\r\n\r\n // setup to redirect to the billing setup page\r\n var url = \"/account/billingsetup\";\r\n\r\n if (message) {\r\n url = YouLi.Common.Utils.AddParametersToURL(url, \"customMessageTitle=\" + title);\r\n url = YouLi.Common.Utils.AddParametersToURL(url, \"customMessage=\" + message);\r\n }\r\n\r\n if (confirmTitle !== undefined) {\r\n url = YouLi.Common.Utils.AddParametersToURL(url, \"upgradeconfirmationtitle=\" + confirmTitle);\r\n }\r\n\r\n if (confirmMessage !== undefined) {\r\n url = YouLi.Common.Utils.AddParametersToURL(url, \"upgradeconfirmationmessage=\" + confirmMessage);\r\n }\r\n\r\n if (trialExpired) {\r\n url = YouLi.Common.Utils.AddParametersToURL(url, \"trialexpired=\" + trialExpired);\r\n }\r\n\r\n if (redirectURL) {\r\n url = YouLi.Common.Utils.AddParametersToURL(url, \"returnurl=\" + redirectURL);\r\n }\r\n\r\n if (tripId) {\r\n url = YouLi.Common.Utils.AddParametersToURL(url, \"tripid=\" + tripId);\r\n }\r\n\r\n if (target) {\r\n YouLi.Common.UI.HideLoading();\r\n window.open(url, target);\r\n }\r\n else\r\n document.location = url;\r\n };\r\n\r\n }(YouLi.UpgradeSubscription ? YouLi.UpgradeSubscription : {}));\r\n}(YouLi ? YouLi : {}));"]}