The present application provides the compounds of formula (J), or pharmaceutically acceptable salts, isomers, tautomer, or a mixture thereof, wherein n, W, A′, B′, R1, R2, and R3 are described herein. The compounds are inhibitors to the activities of phosphatidylinositol 3-kinase (PI3K) and are useful for treating conditions mediated by one or more PI3K isoforms. The present application further provides pharmaceutical compositions that include a compound of formula (I), or pharmaceutically acceptable salts, isomers, tautomer, or mixture thereof, and methods of using these compounds and compositions for treating conditions mediated by one or more PI3K isoforms.