{
  "version": 3,
  "sources": ["../../payment/quota_overview.tsx"],
  "sourcesContent": ["import * as React from \"react\"\nimport {observer} from \"mobx-react\"\nimport {LinearProgress} from \"@cling/lib.web.mdc\"\nimport {current_user} from \"../state/index\"\nimport {i18n} from \"@cling/lib.web.i18n\"\nimport {classNames} from \"@cling/lib.web.utils\"\nimport {board_resource} from \"@cling/lib.web.resources\"\nimport {CheckoutButton} from \"./checkout_button\"\nimport {board_quota_limits} from \"@cling/lib.shared.model/quota\"\n\ntype Props = {\n    title?: string\n    className?: string\n    hide_cling_pro_advertisement?: boolean\n    hide_tip?: boolean\n    hide_usage_counters?: boolean\n    on_checkout_dialog_open?: () => void\n}\n\nexport const QuotaOverview = observer(\n    ({\n        className,\n        title,\n        hide_cling_pro_advertisement,\n        hide_usage_counters,\n        hide_tip,\n        on_checkout_dialog_open,\n    }: Props) => {\n        const usage = board_resource.board_quota_usage\n        const show_upgrade_button =\n            !current_user.account_attributes.has_pro_features &&\n            // Needed for Obersee.\n            current_user.account_attributes.team_uids.length === 0\n        const limits = board_quota_limits(current_user.account_attributes)\n        return (\n            <div className={classNames(\"quota-overview\", className)}>\n                {title && <div className=\"quota-overview__title\">{title}</div>}\n                {!hide_usage_counters && (\n                    <>\n                        <div className=\"quota-overview-row\">\n                            <div className=\"quota-overview-row__title\">\n                                {i18n.boards_and_conversations}\n                            </div>\n                            <div className=\"quota-overview-row__progress\">\n                                <LinearProgress\n                                    max={limits.num_boards}\n                                    value={usage.num_boards}\n                                    className={classNames({\n                                        \"quota-overview-progress--warn\":\n                                            usage.num_boards / limits.num_boards >= 0.7,\n                                    })}\n                                />\n                            </div>\n                            <div className=\"quota-overview-row__value\">\n                                {i18n.number(usage.num_boards)} / {i18n.number(limits.num_boards)}\n                            </div>\n                        </div>\n                        <div className=\"quota-overview-row\">\n                            <div className=\"quota-overview-row__title\">{i18n.cards}</div>\n                            <div className=\"quota-overview-row__progress\">\n                                <LinearProgress\n                                    max={limits.num_cards}\n                                    value={usage.num_cards}\n                                    className={classNames({\n                                        \"quota-overview-progress--warn\":\n                                            usage.num_cards / limits.num_cards >= 0.7,\n                                    })}\n                                />\n                            </div>\n                            <div className=\"quota-overview-row__value\">\n                                {i18n.number(usage.num_cards)} / {i18n.number(limits.num_cards)}\n                            </div>\n                        </div>\n                        <div className=\"quota-overview-row\">\n                            <div className=\"quota-overview-row__title\">{i18n.storage}</div>\n                            <div className=\"quota-overview-row__progress\">\n                                <LinearProgress\n                                    max={limits.sum_blob_size}\n                                    value={usage.sum_blob_size}\n                                    className={classNames({\n                                        \"quota-overview-progress--warn\":\n                                            usage.sum_blob_size / limits.sum_blob_size >= 0.7,\n                                    })}\n                                />\n                            </div>\n                            <div className=\"quota-overview-row__value\">\n                                {i18n.format_file_size(usage.sum_blob_size)} /\n                                {i18n.format_file_size(limits.sum_blob_size)}\n                            </div>\n                        </div>\n                    </>\n                )}\n                {show_upgrade_button && (\n                    <>\n                        <CheckoutButton on_checkout_dialog_open={on_checkout_dialog_open} />\n                        {!hide_cling_pro_advertisement && (\n                            <div className=\"quota-overview__sub\">\n                                <div>{i18n.with_cling_pro}</div>\n                            </div>\n                        )}\n                        {!hide_tip && (\n                            <div className=\"quota-overview__tip\">\n                                {i18n.tip_dont_forget_to_empty_your_trashcan}\n                            </div>\n                        )}\n                    </>\n                )}\n            </div>\n        )\n    },\n)\n"],
  "mappings": "oTAAAA,IAmBO,IAAMC,EAAgBC,EACzB,CAAC,CACG,UAAAC,EACA,MAAAC,EACA,6BAAAC,EACA,oBAAAC,EACA,SAAAC,EACA,wBAAAC,CACJ,IAAa,CACT,IAAMC,EAAQC,EAAe,kBACvBC,EACF,CAACC,EAAa,mBAAmB,kBAEjCA,EAAa,mBAAmB,UAAU,SAAW,EACnDC,EAASC,EAAmBF,EAAa,kBAAkB,EACjE,OACIG,EAAC,OAAI,UAAWC,EAAW,iBAAkBb,CAAS,GACjDC,GAASW,EAAC,OAAI,UAAU,yBAAyBX,CAAM,EACvD,CAACE,GACES,EA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VG,EAAK,sCACV,CAER,CAER,CAER,CACJ",
  "names": ["init_compat_module", "QuotaOverview", "observer", "className", "title", "hide_cling_pro_advertisement", "hide_usage_counters", "hide_tip", "on_checkout_dialog_open", "usage", "board_resource", "show_upgrade_button", "current_user", "limits", "board_quota_limits", "_", "classNames", "k", "i18n", "LinearProgress", "CheckoutButton"]
}