package com.ss.android.ugc.aweme.ecommerce.address.widget;

import X.C4725Bo9;
import X.FhI;
import X.KEn;
import X.M12;
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.view.View;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.AccountService;

public final class PhoneInputView$1 implements View.OnClickListener {
    public final /* synthetic */ C4725Bo9 LIZ;
    public final /* synthetic */ Context LIZIZ;

    static {
        Covode.recordClassIndex(68312);
    }

    public PhoneInputView$1(C4725Bo9 bo9, Context context) {
        this.LIZ = bo9;
        this.LIZIZ = context;
    }

    public final void onClick(View view) {
        Activity activity;
        View.OnClickListener onCountryCodeClickListener = this.LIZ.getOnCountryCodeClickListener();
        if (onCountryCodeClickListener != null) {
            onCountryCodeClickListener.onClick(view);
        }
        KEn LJII = AccountService.LIZ().LJII();
        Context context = this.LIZIZ;
        while (true) {
            activity = null;
            if (context != null) {
                if (!(context instanceof Activity)) {
                    if (!(context instanceof ContextWrapper)) {
                        break;
                    }
                    context = ((ContextWrapper) context).getBaseContext();
                } else {
                    activity = (Activity) context;
                    break;
                }
            } else {
                break;
            }
        }
        LJII.openCountryListActivity(activity, new FhI(this) {
            public final /* synthetic */ PhoneInputView$1 this$0;

            static {
                Covode.recordClassIndex(68313);
            }

            public final void onExit() {
            }

            {
                this.this$0 = r1;
            }

            public final void onChanged(String str, String str2) {
                M12.LIZ(str, str2);
                this.this$0.LIZ.LIZ(str, str2);
                this.this$0.LIZ.getOnCountryCodeChangeListener().invoke();
            }
        });
    }
}
