"""
The MIT License (MIT)

Copyright (c) [2015-2025] [Andrew Annex]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

try:
    from ..utils.libspicehelper import libspice, load_cspice
except ImportError:  # fallback if executed outside package context
    from spiceypy.utils.libspicehelper import libspice, load_cspice

_ = load_cspice()
# Import the compiled module from the parent package level
# from spiceypy.cyice import cyice as _cyice
try:
    from spiceypy.cyice.cyice import (
        azlcpo,
        azlcpo_s,
        azlcpo_v,
        azlrec,
        azlrec_s,
        azlrec_v,
        b1900,
        b1950,
        ckgp,
        ckgp_s,
        ckgp_v,
        ckgpav,
        ckgpav_s,
        ckgpav_v,
        clight,
        conics,
        conics_s,
        conics_v,
        convrt,
        convrt_s,
        convrt_v,
        cyllat,
        cyllat_s,
        cyllat_v,
        cylrec,
        cylrec_s,
        cylrec_v,
        cylsph,
        cylsph_s,
        cylsph_v,
        deltet,
        deltet_s,
        deltet_v,
        dpr,
        et2lst,
        et2lst_s,
        et2lst_v,
        et2utc,
        et2utc_s,
        et2utc_v,
        etcal,
        etcal_s,
        etcal_v,
        evsgp4,
        evsgp4_s,
        evsgp4_v,
        failed,
        fovray,
        fovray_s,
        fovray_v,
        fovtrg,
        fovtrg_s,
        fovtrg_v,
        furnsh,
        getmsg,
        georec,
        georec_s,
        georec_v,
        getelm,
        getelm_s,
        getelm_v,
        halfpi,
        illumf,
        illumf_s,
        illumf_v,
        illumg,
        illumg_s,
        illumg_v,
        ilumin,
        ilumin_s,
        ilumin_v,
        j1900,
        j1950,
        j2000,
        j2100,
        jyear,
        latcyl,
        latcyl_v,
        latcyl_s,
        latrec,
        latrec_s,
        latrec_v,
        latsph,
        latsph_s,
        latsph_v,
        limbpt,
        limbpt_s,
        limbpt_v,
        lspcn,
        lspcn_s,
        lspcn_v,
        occult,
        occult_s,
        occult_v,
        oscelt,
        oscelt_s,
        oscelt_v,
        qcktrc,
        pgrrec,
        pgrrec_s,
        pgrrec_v,
        phaseq,
        phaseq_s,
        phaseq_v,
        pi,
        pxform,
        pxform_s,
        pxform_v,
        radrec,
        radrec_s,
        radrec_v,
        recazl,
        recazl_s,
        recazl_v,
        reccyl,
        reccyl_s,
        reccyl_v,
        recgeo,
        recgeo_s,
        recgeo_v,
        reclat,
        reclat_s,
        reclat_v,
        recpgr,
        recpgr_s,
        recpgr_v,
        recrad,
        recrad_s,
        recrad_v,
        recsph,
        recsph_s,
        recsph_v,
        reset,
        rpd,
        scdecd,
        scdecd_s,
        scdecd_v,
        sce2c,
        sce2c_s,
        sce2c_v,
        sce2s,
        sce2s_s,
        sce2s_v,
        scencd,
        scencd_s,
        scencd_v,
        scs2e,
        scs2e_s,
        scs2e_v,
        sct2e,
        sct2e_s,
        sct2e_v,
        sincpt,
        sincpt_s,
        sincpt_v,
        spd,
        sphcyl,
        sphcyl_s,
        sphcyl_v,
        sphlat,
        sphlat_s,
        sphlat_v,
        sphrec,
        sphrec_s,
        sphrec_v,
        spkapo,
        spkapo_s,
        spkapo_v,
        spkcpo,
        spkcpo_s,
        spkcpo_v,
        spkcpt,
        spkcpt_s,
        spkcpt_v,
        spkcvo,
        spkcvo_s,
        spkcvo_v,
        spkcvt,
        spkcvt_s,
        spkcvt_v,
        spkez,
        spkez_s,
        spkez_v,
        spkezp,
        spkezp_s,
        spkezp_v,
        spkezr,
        spkezr_s,
        spkezr_v,
        spkgeo,
        spkgeo_s,
        spkgeo_v,
        spkgps,
        spkgps_s,
        spkgps_v,
        spkpos,
        spkpos_s,
        spkpos_v,
        spkpvn,
        spkpvn_s,
        spkpvn_v,
        spkssb,
        spkssb_s,
        spkssb_v,
        srfrec,
        srfrec_s,
        srfrec_v,
        str2et,
        str2et_s,
        str2et_v,
        subpnt,
        subpnt_s,
        subpnt_v,
        subslr,
        subslr_s,
        subslr_v,
        sxform,
        sxform_s,
        sxform_v,
        tangpt,
        tangpt_s,
        tangpt_v,
        termpt,
        termpt_s,
        termpt_v,
        timout,
        timout_s,
        timout_v,
        trgsep,
        trgsep_s,
        trgsep_v,
        twopi,
        tyear,
        unitim,
        unitim_s,
        unitim_v,
        unload,
        utc2et,
        utc2et_s,
        utc2et_v,
        xfmsta,
        xfmsta_s,
        xfmsta_v,
    )

    __all__ = [
        "azlcpo",
        "azlcpo_s",
        "azlcpo_v" "azlrec",
        "azlrec_s",
        "azlrec_v",
        "b1900",
        "b1950",
        "ckgp",
        "ckgp_s",
        "ckgp_v",
        "ckgpav",
        "ckgpav_s",
        "ckgpav_v",
        "clight",
        "conics",
        "conics_s",
        "conics_v",
        "convrt",
        "convrt_s",
        "convrt_v",
        "cyllat",
        "cyllat_s",
        "cyllat_v",
        "cylrec",
        "cylrec_s",
        "cylrec_v",
        "cylsph",
        "cylsph_s",
        "cylsph_v",
        "deltet",
        "deltet_s",
        "deltet_v",
        "dpr",
        "et2lst",
        "et2lst_s",
        "et2lst_v",
        "et2utc",
        "et2utc_s",
        "et2utc_v",
        "etcal",
        "etcal_s",
        "etcal_v",
        "evsgp4",
        "evsgp4_s",
        "evsgp4_v",
        "failed",
        "fovray",
        "fovray_s",
        "fovray_v",
        "fovtrg",
        "fovtrg_s",
        "fovtrg_v",
        "furnsh",
        "getmsg",
        "georec",
        "georec_s",
        "georec_v",
        "getelm",
        "getelm_s",
        "getelm_v",
        "halfpi",
        "illumf",
        "illumf_s",
        "illumf_v",
        "illumg",
        "illumg_s",
        "illumg_v",
        "ilumin",
        "ilumin_s",
        "ilumin_v",
        "j1900",
        "j1950",
        "j2000",
        "j2100",
        "jyear",
        "latcyl",
        "latcyl_v",
        "latcyl_s",
        "latrec",
        "latrec_s",
        "latrec_v",
        "latsph",
        "latsph_s",
        "latsph_v",
        "limbpt",
        "limbpt_s",
        "limbpt_v",
        "lspcn",
        "lspcn_s",
        "lspcn_v",
        "occult",
        "occult_s",
        "occult_v",
        "oscelt",
        "oscelt_s",
        "oscelt_v",
        "qcktrc",
        "pgrrec",
        "pgrrec_s",
        "pgrrec_v",
        "phaseq",
        "phaseq_s",
        "phaseq_v",
        "pi",
        "pxform",
        "pxform_s",
        "pxform_v",
        "radrec",
        "radrec_s",
        "radrec_v",
        "recazl",
        "recazl_s",
        "recazl_v",
        "reccyl",
        "reccyl_s",
        "reccyl_v",
        "recgeo",
        "recgeo_s",
        "recgeo_v",
        "reclat",
        "reclat_s",
        "reclat_v",
        "recpgr",
        "recpgr_s",
        "recpgr_v",
        "recrad",
        "recrad_s",
        "recrad_v",
        "recsph",
        "recsph_s",
        "recsph_v",
        "reset" "rpd",
        "scdecd",
        "scdecd_s",
        "scdecd_v",
        "sce2c",
        "sce2c_s",
        "sce2c_v",
        "sce2s",
        "sce2s_s",
        "sce2s_v",
        "scencd",
        "scencd_s",
        "scencd_v",
        "scs2e",
        "scs2e_s",
        "scs2e_v",
        "sct2e",
        "sct2e_s",
        "sct2e_v",
        "sincpt",
        "sincpt_s",
        "sincpt_v",
        "spd",
        "sphcyl",
        "sphcyl_s",
        "sphcyl_v",
        "sphlat",
        "sphlat_s",
        "sphlat_v",
        "sphrec",
        "sphrec_s",
        "sphrec_v",
        "spkapo",
        "spkapo_s",
        "spkapo_v",
        "spkcpo",
        "spkcpo_s",
        "spkcpo_v",
        "spkcpt",
        "spkcpt_s",
        "spkcpt_v",
        "spkcvo",
        "spkcvo_s",
        "spkcvo_v",
        "spkcvt",
        "spkcvt_s",
        "spkcvt_v",
        "spkez",
        "spkez_s",
        "spkez_v",
        "spkezp",
        "spkezp_s",
        "spkezp_v",
        "spkezr",
        "spkezr_s",
        "spkezr_v",
        "spkgeo",
        "spkgeo_s",
        "spkgeo_v",
        "spkgps",
        "spkgps_s",
        "spkgps_v",
        "spkpos",
        "spkpos_s",
        "spkpos_v",
        "spkpvn",
        "spkpvn_s",
        "spkpvn_v",
        "spkssb",
        "spkssb_s",
        "spkssb_v",
        "srfrec",
        "srfrec_s",
        "srfrec_v",
        "str2et",
        "str2et_s",
        "str2et_v",
        "subpnt",
        "subpnt_s",
        "subpnt_v",
        "subslr",
        "subslr_s",
        "subslr_v",
        "sxform",
        "sxform_s",
        "sxform_v",
        "tangpt",
        "tangpt_s",
        "tangpt_v",
        "termpt",
        "termpt_s",
        "termpt_v",
        "timout",
        "timout_s",
        "timout_v",
        "trgsep",
        "trgsep_s",
        "trgsep_v",
        "twopi",
        "tyear",
        "unitim",
        "unitim_s",
        "unitim_v",
        "unload",
        "utc2et",
        "utc2et_s",
        "utc2et_v",
        "xfmsta",
        "xfmsta_s",
        "xfmsta_v",
    ]
except ImportError as ie:
    raise ImportError(
        "spiceypy.cyice is not available on this platform. "
        "Use the ctypes-based interface (spiceypy.spiceypy) instead."
    ) from ie
