{
    "tailapp": 2,
    "manifest": {
        "format": 2,
        "app_id": "pomodoro",
        "name": "Pomodoro",
        "version": 1,
        "schema": "tailapps/v0",
        "exported_at": 1795564611,
        "from": "gallery",
        "connections": [],
        "files": {
            "app.json": "8801ad891ddcb511ffa284f145b079e07a9549d08c8efd09254440a13f6b5d82"
        },
        "signature": "kzZmuJGW9P37p2ScTTTELPaYYrptytgkBg8oE723DpC80354UHLnBcZnpWJzaxRWQlyrncS44/6FM24fF+DbAQ==",
        "key_id": "gallery-1"
    },
    "app": {
        "schema": "tailapps/v0",
        "app": "pomodoro",
        "name": "Pomodoro",
        "description": "A focus timer with short and long breaks and a notification when each ends, on your Mac or iPhone. To share one timer, turn on \"Share the timer\" on each device, then Sync to My Devices.",
        "icon": "timer",
        "version": 5,
        "permissions": [
            "notify",
            "inbox:timer",
            "send:timer",
            "send:focus-light/focus"
        ],
        "state": {
            "phase": {
                "type": "text",
                "default": "work"
            },
            "status": {
                "type": "text",
                "default": "idle"
            },
            "ends_at": {
                "type": "number",
                "default": 0
            },
            "started_at": {
                "type": "number",
                "default": 0
            },
            "length": {
                "type": "number",
                "default": 1500
            },
            "left": {
                "type": "any",
                "default": null
            },
            "sessions": {
                "type": "number",
                "default": 0
            },
            "to_long": {
                "type": "number",
                "default": 4
            },
            "work_len": {
                "type": "number",
                "default": 1500
            },
            "short_len": {
                "type": "number",
                "default": 300
            },
            "long_len": {
                "type": "number",
                "default": 900
            },
            "long_after": {
                "type": "number",
                "default": 4
            },
            "auto": {
                "type": "bool",
                "default": true
            }
        },
        "sources": {
            "incoming": {
                "inbox": "timer",
                "on_receive": "heard"
            }
        },
        "cards": [
            {
                "id": "main",
                "layout": {
                    "column": [
                        {
                            "row": [
                                {
                                    "badge": "$phase | map:{work:'Focus', short:'Short break', long:'Long break'}",
                                    "tone": "$phase | map:{work:'accent', else:'good'}"
                                },
                                {
                                    "spacer": true
                                },
                                {
                                    "text": "{$sessions} of {$long_after} focus sessions",
                                    "size": "s",
                                    "emphasis": "subtle"
                                }
                            ],
                            "align": "center"
                        },
                        {
                            "row": [
                                {
                                    "progress": "$ends_at",
                                    "from": "$started_at",
                                    "style": "ring",
                                    "size": "l",
                                    "tone": "$phase | map:{work:'accent', else:'good'}",
                                    "when": "$status | map:{running:true, else:false}"
                                },
                                {
                                    "progress": 0,
                                    "style": "ring",
                                    "size": "l",
                                    "tone": "neutral",
                                    "when": "$status | map:{running:false, else:true}"
                                },
                                {
                                    "column": [
                                        {
                                            "column": [
                                                {
                                                    "timer": "$ends_at",
                                                    "mode": "until",
                                                    "size": "xl",
                                                    "on_end": "phase_over"
                                                },
                                                {
                                                    "text": "Left",
                                                    "size": "s",
                                                    "emphasis": "subtle"
                                                }
                                            ],
                                            "gap": "xs",
                                            "when": "$status | map:{running:true, else:false}"
                                        },
                                        {
                                            "stat": "$left | duration",
                                            "label": "Paused",
                                            "size": "xl",
                                            "when": "$status | map:{paused:true, else:false}"
                                        },
                                        {
                                            "column": [
                                                {
                                                    "stat": "$work_len | duration",
                                                    "label": "Ready",
                                                    "size": "xl",
                                                    "when": "$phase | map:{work:true, else:false}"
                                                },
                                                {
                                                    "stat": "$short_len | duration",
                                                    "label": "Ready",
                                                    "size": "xl",
                                                    "when": "$phase | map:{short:true, else:false}"
                                                },
                                                {
                                                    "stat": "$long_len | duration",
                                                    "label": "Ready",
                                                    "size": "xl",
                                                    "when": "$phase | map:{long:true, else:false}"
                                                }
                                            ],
                                            "when": "$status | map:{idle:true, else:false}"
                                        }
                                    ],
                                    "gap": "xs",
                                    "grow": true
                                }
                            ],
                            "align": "center",
                            "gap": "m"
                        },
                        {
                            "row": [
                                {
                                    "button": "Start",
                                    "on": "start",
                                    "style": "primary",
                                    "keys": "mod+return",
                                    "when": "$status | map:{idle:true, else:false}"
                                },
                                {
                                    "button": "Resume",
                                    "on": "start",
                                    "style": "primary",
                                    "keys": "mod+return",
                                    "when": "$status | map:{paused:true, else:false}"
                                },
                                {
                                    "button": "Pause",
                                    "on": "pause",
                                    "style": "primary",
                                    "keys": "mod+return",
                                    "when": "$status | map:{running:true, else:false}"
                                },
                                {
                                    "button": "Reset",
                                    "on": "reset",
                                    "style": "secondary",
                                    "disabled": "$status | map:{idle:true, else:false}"
                                },
                                {
                                    "spacer": true
                                },
                                {
                                    "button": "Skip",
                                    "on": "skip",
                                    "style": "plain"
                                }
                            ],
                            "align": "center",
                            "gap": "s"
                        },
                        {
                            "section": "Times",
                            "collapsible": true,
                            "collapsed": true,
                            "children": [
                                {
                                    "field": "Focus",
                                    "type": "slider",
                                    "bind": "$work_len",
                                    "min": 300,
                                    "max": 5400,
                                    "step": 300,
                                    "format": "duration"
                                },
                                {
                                    "field": "Short break",
                                    "type": "slider",
                                    "bind": "$short_len",
                                    "min": 60,
                                    "max": 1800,
                                    "step": 60,
                                    "format": "duration"
                                },
                                {
                                    "field": "Long break",
                                    "type": "slider",
                                    "bind": "$long_len",
                                    "min": 300,
                                    "max": 3600,
                                    "step": 300,
                                    "format": "duration"
                                },
                                {
                                    "field": "Long break after (focus sessions)",
                                    "type": "slider",
                                    "bind": "$long_after",
                                    "min": 2,
                                    "max": 8,
                                    "step": 1,
                                    "on_change": "every_changed"
                                },
                                {
                                    "field": "Start the next one by itself",
                                    "type": "toggle",
                                    "bind": "$auto"
                                },
                                {
                                    "button": "Start over from session 1",
                                    "on": "restart",
                                    "style": "plain",
                                    "confirm": "Stop the timer and start over from the first focus session?"
                                }
                            ]
                        }
                    ],
                    "gap": "m"
                }
            }
        ],
        "actions": {
            "start": {
                "steps": [
                    {
                        "if": "$status | map:{paused:true, else:false}",
                        "then": [
                            {
                                "set": {
                                    "ends_at": "$now",
                                    "started_at": "$now",
                                    "status": "running"
                                }
                            },
                            {
                                "increment": {
                                    "ends_at": "$left",
                                    "started_at": "$left"
                                }
                            },
                            {
                                "increment": {
                                    "started_at": "-$length"
                                }
                            },
                            {
                                "set": {
                                    "left": null
                                }
                            }
                        ],
                        "else": [
                            {
                                "set": {
                                    "started_at": "$now",
                                    "ends_at": "$now",
                                    "length": 0,
                                    "left": null,
                                    "status": "running"
                                }
                            },
                            {
                                "if": "$phase | map:{work:true, else:false}",
                                "then": [
                                    {
                                        "increment": {
                                            "ends_at": "$work_len",
                                            "length": "$work_len"
                                        }
                                    }
                                ]
                            },
                            {
                                "if": "$phase | map:{short:true, else:false}",
                                "then": [
                                    {
                                        "increment": {
                                            "ends_at": "$short_len",
                                            "length": "$short_len"
                                        }
                                    }
                                ]
                            },
                            {
                                "if": "$phase | map:{long:true, else:false}",
                                "then": [
                                    {
                                        "increment": {
                                            "ends_at": "$long_len",
                                            "length": "$long_len"
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "if": "$settings.share",
                        "then": [
                            {
                                "send": {
                                    "timer": {
                                        "status": "$status",
                                        "phase": "$phase",
                                        "ends_at": "$ends_at",
                                        "started_at": "$started_at",
                                        "length": "$length",
                                        "left": "$left",
                                        "sessions": "$sessions",
                                        "to_long": "$to_long",
                                        "long_after": "$long_after"
                                    }
                                }
                            }
                        ]
                    },
                    {
                        "if": "$settings.focus_light",
                        "then": [
                            {
                                "send": {
                                    "focus": {
                                        "status": "$status",
                                        "phase": "$phase",
                                        "ends_at": "$ends_at"
                                    }
                                },
                                "app": "focus-light"
                            }
                        ]
                    }
                ]
            },
            "pause": {
                "steps": [
                    {
                        "if": "$status | map:{running:true, else:false}",
                        "then": [
                            {
                                "set": {
                                    "left": "$ends_at"
                                }
                            },
                            {
                                "increment": {
                                    "left": "-$now"
                                },
                                "min": 0
                            },
                            {
                                "if": "$left | map:{0:true, else:false}",
                                "then": [
                                    {
                                        "if": "$phase | map:{work:true, else:false}",
                                        "then": [
                                            {
                                                "increment": {
                                                    "sessions": 1,
                                                    "to_long": -1
                                                },
                                                "min": 0
                                            },
                                            {
                                                "if": "$to_long | map:{0:true, else:false}",
                                                "then": [
                                                    {
                                                        "set": {
                                                            "phase": "long"
                                                        }
                                                    }
                                                ],
                                                "else": [
                                                    {
                                                        "set": {
                                                            "phase": "short"
                                                        }
                                                    }
                                                ]
                                            }
                                        ],
                                        "else": [
                                            {
                                                "if": "$phase | map:{long:true, else:false}",
                                                "then": [
                                                    {
                                                        "set": {
                                                            "sessions": 0,
                                                            "to_long": "$long_after"
                                                        }
                                                    }
                                                ]
                                            },
                                            {
                                                "set": {
                                                    "phase": "work"
                                                }
                                            }
                                        ]
                                    },
                                    {
                                        "set": {
                                            "ends_at": 0,
                                            "left": null,
                                            "status": "idle"
                                        }
                                    }
                                ],
                                "else": [
                                    {
                                        "set": {
                                            "ends_at": 0,
                                            "status": "paused"
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "if": "$settings.share",
                        "then": [
                            {
                                "send": {
                                    "timer": {
                                        "status": "$status",
                                        "phase": "$phase",
                                        "ends_at": "$ends_at",
                                        "started_at": "$started_at",
                                        "length": "$length",
                                        "left": "$left",
                                        "sessions": "$sessions",
                                        "to_long": "$to_long",
                                        "long_after": "$long_after"
                                    }
                                }
                            }
                        ]
                    },
                    {
                        "if": "$settings.focus_light",
                        "then": [
                            {
                                "send": {
                                    "focus": {
                                        "status": "$status",
                                        "phase": "$phase",
                                        "ends_at": "$ends_at"
                                    }
                                },
                                "app": "focus-light"
                            }
                        ]
                    }
                ]
            },
            "reset": {
                "steps": [
                    {
                        "set": {
                            "ends_at": 0,
                            "left": null,
                            "status": "idle"
                        }
                    },
                    {
                        "if": "$settings.share",
                        "then": [
                            {
                                "send": {
                                    "timer": {
                                        "status": "$status",
                                        "phase": "$phase",
                                        "ends_at": "$ends_at",
                                        "started_at": "$started_at",
                                        "length": "$length",
                                        "left": "$left",
                                        "sessions": "$sessions",
                                        "to_long": "$to_long",
                                        "long_after": "$long_after"
                                    }
                                }
                            }
                        ]
                    },
                    {
                        "if": "$settings.focus_light",
                        "then": [
                            {
                                "send": {
                                    "focus": {
                                        "status": "$status",
                                        "phase": "$phase",
                                        "ends_at": "$ends_at"
                                    }
                                },
                                "app": "focus-light"
                            }
                        ]
                    }
                ]
            },
            "skip": {
                "steps": [
                    {
                        "if": "$phase | map:{work:true, else:false}",
                        "then": [
                            {
                                "if": "$to_long | map:{0:true, else:false}",
                                "then": [
                                    {
                                        "set": {
                                            "phase": "long"
                                        }
                                    }
                                ],
                                "else": [
                                    {
                                        "set": {
                                            "phase": "short"
                                        }
                                    }
                                ]
                            }
                        ],
                        "else": [
                            {
                                "if": "$phase | map:{long:true, else:false}",
                                "then": [
                                    {
                                        "set": {
                                            "sessions": 0,
                                            "to_long": "$long_after"
                                        }
                                    }
                                ]
                            },
                            {
                                "set": {
                                    "phase": "work"
                                }
                            }
                        ]
                    },
                    {
                        "set": {
                            "ends_at": 0,
                            "left": null,
                            "status": "idle"
                        }
                    },
                    {
                        "if": "$settings.share",
                        "then": [
                            {
                                "send": {
                                    "timer": {
                                        "status": "$status",
                                        "phase": "$phase",
                                        "ends_at": "$ends_at",
                                        "started_at": "$started_at",
                                        "length": "$length",
                                        "left": "$left",
                                        "sessions": "$sessions",
                                        "to_long": "$to_long",
                                        "long_after": "$long_after"
                                    }
                                }
                            }
                        ]
                    },
                    {
                        "if": "$settings.focus_light",
                        "then": [
                            {
                                "send": {
                                    "focus": {
                                        "status": "$status",
                                        "phase": "$phase",
                                        "ends_at": "$ends_at"
                                    }
                                },
                                "app": "focus-light"
                            }
                        ]
                    }
                ]
            },
            "restart": {
                "steps": [
                    {
                        "set": {
                            "phase": "work",
                            "sessions": 0,
                            "to_long": "$long_after",
                            "ends_at": 0,
                            "left": null,
                            "status": "idle"
                        }
                    },
                    {
                        "if": "$settings.share",
                        "then": [
                            {
                                "send": {
                                    "timer": {
                                        "status": "$status",
                                        "phase": "$phase",
                                        "ends_at": "$ends_at",
                                        "started_at": "$started_at",
                                        "length": "$length",
                                        "left": "$left",
                                        "sessions": "$sessions",
                                        "to_long": "$to_long",
                                        "long_after": "$long_after"
                                    }
                                }
                            }
                        ]
                    },
                    {
                        "if": "$settings.focus_light",
                        "then": [
                            {
                                "send": {
                                    "focus": {
                                        "status": "$status",
                                        "phase": "$phase",
                                        "ends_at": "$ends_at"
                                    }
                                },
                                "app": "focus-light"
                            }
                        ]
                    }
                ]
            },
            "every_changed": {
                "steps": [
                    {
                        "set": {
                            "to_long": "$args.value"
                        }
                    },
                    {
                        "increment": {
                            "to_long": "-$sessions"
                        },
                        "min": 0
                    },
                    {
                        "if": "$settings.share",
                        "then": [
                            {
                                "send": {
                                    "timer": {
                                        "status": "$status",
                                        "phase": "$phase",
                                        "ends_at": "$ends_at",
                                        "started_at": "$started_at",
                                        "length": "$length",
                                        "left": "$left",
                                        "sessions": "$sessions",
                                        "to_long": "$to_long",
                                        "long_after": "$long_after"
                                    }
                                }
                            }
                        ]
                    }
                ]
            },
            "phase_over": {
                "steps": [
                    {
                        "if": "$status | map:{running:true, else:false}",
                        "then": [
                            {
                                "if": "$phase | map:{work:true, else:false}",
                                "then": [
                                    {
                                        "increment": {
                                            "sessions": 1,
                                            "to_long": -1
                                        },
                                        "min": 0
                                    },
                                    {
                                        "if": "$to_long | map:{0:true, else:false}",
                                        "then": [
                                            {
                                                "set": {
                                                    "phase": "long"
                                                }
                                            }
                                        ],
                                        "else": [
                                            {
                                                "set": {
                                                    "phase": "short"
                                                }
                                            }
                                        ]
                                    }
                                ],
                                "else": [
                                    {
                                        "if": "$phase | map:{long:true, else:false}",
                                        "then": [
                                            {
                                                "set": {
                                                    "sessions": 0,
                                                    "to_long": "$long_after"
                                                }
                                            }
                                        ]
                                    },
                                    {
                                        "set": {
                                            "phase": "work"
                                        }
                                    }
                                ]
                            },
                            {
                                "set": {
                                    "ends_at": 0,
                                    "left": null,
                                    "status": "idle"
                                }
                            },
                            {
                                "notify": {
                                    "title": "$phase | map:{work:'Break over', else:'Focus session done'}",
                                    "body": "$phase | map:{work:'Time to focus again.', short:'Take a short break.', long:'Take a long break, you earned it.'}"
                                }
                            },
                            {
                                "if": "$auto",
                                "then": [
                                    {
                                        "set": {
                                            "started_at": "$now",
                                            "ends_at": "$now",
                                            "length": 0,
                                            "left": null,
                                            "status": "running"
                                        }
                                    },
                                    {
                                        "if": "$phase | map:{work:true, else:false}",
                                        "then": [
                                            {
                                                "increment": {
                                                    "ends_at": "$work_len",
                                                    "length": "$work_len"
                                                }
                                            }
                                        ]
                                    },
                                    {
                                        "if": "$phase | map:{short:true, else:false}",
                                        "then": [
                                            {
                                                "increment": {
                                                    "ends_at": "$short_len",
                                                    "length": "$short_len"
                                                }
                                            }
                                        ]
                                    },
                                    {
                                        "if": "$phase | map:{long:true, else:false}",
                                        "then": [
                                            {
                                                "increment": {
                                                    "ends_at": "$long_len",
                                                    "length": "$long_len"
                                                }
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "if": "$settings.share",
                                "then": [
                                    {
                                        "send": {
                                            "timer": {
                                                "status": "$status",
                                                "phase": "$phase",
                                                "ends_at": "$ends_at",
                                                "started_at": "$started_at",
                                                "length": "$length",
                                                "left": "$left",
                                                "sessions": "$sessions",
                                                "to_long": "$to_long",
                                                "long_after": "$long_after"
                                            }
                                        },
                                        "alert": "$phase | map:{work:'Break over: time to focus', else:'Focus session done: take a break'}"
                                    }
                                ]
                            },
                            {
                                "if": "$settings.focus_light",
                                "then": [
                                    {
                                        "send": {
                                            "focus": {
                                                "status": "$status",
                                                "phase": "$phase",
                                                "ends_at": "$ends_at"
                                            }
                                        },
                                        "app": "focus-light"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            "heard": {
                "steps": [
                    {
                        "if": "$args.event.length",
                        "then": [
                            {
                                "set": {
                                    "status": "$args.event.status",
                                    "phase": "$args.event.phase",
                                    "ends_at": "$args.event.ends_at",
                                    "started_at": "$args.event.started_at",
                                    "length": "$args.event.length",
                                    "left": "$args.event.left",
                                    "sessions": "$args.event.sessions",
                                    "to_long": "$args.event.to_long",
                                    "long_after": "$args.event.long_after"
                                }
                            }
                        ]
                    }
                ]
            }
        },
        "views": {
            "menubar": {
                "icon": "timer",
                "label": "{$status | map:{paused:'Paused ', idle:'Ready', else:''}}{$ends_at | until}{$left | duration}",
                "label_tone": "$phase | map:{work:'accent', else:'good'}",
                "card": "main",
                "label_icon": "$status | map:{running:'timer', paused:'pause.circle', else:'timer'}"
            },
            "floating": {
                "card": "main",
                "pin": true,
                "width": "narrow"
            }
        },
        "style": {
            "accent": "#e5533d"
        },
        "settings": {
            "share": {
                "type": "toggle",
                "label": "Share the timer with my other devices",
                "default": false
            },
            "focus_light": {
                "type": "toggle",
                "label": "Tell Focus Light when I focus",
                "default": false,
                "platforms": [
                    "macos"
                ]
            }
        }
    },
    "app_json": "{\n  \"schema\": \"tailapps/v0\",\n  \"app\": \"pomodoro\",\n  \"name\": \"Pomodoro\",\n  \"description\": \"A focus timer with short and long breaks and a notification when each ends, on your Mac or iPhone. To share one timer, turn on \\\"Share the timer\\\" on each device, then Sync to My Devices.\",\n  \"icon\": \"timer\",\n  \"version\": 5,\n  \"permissions\": [\n    \"notify\",\n    \"inbox:timer\",\n    \"send:timer\",\n    \"send:focus-light/focus\"\n  ],\n  \"state\": {\n    \"phase\": {\n      \"type\": \"text\",\n      \"default\": \"work\"\n    },\n    \"status\": {\n      \"type\": \"text\",\n      \"default\": \"idle\"\n    },\n    \"ends_at\": {\n      \"type\": \"number\",\n      \"default\": 0\n    },\n    \"started_at\": {\n      \"type\": \"number\",\n      \"default\": 0\n    },\n    \"length\": {\n      \"type\": \"number\",\n      \"default\": 1500\n    },\n    \"left\": {\n      \"type\": \"any\",\n      \"default\": null\n    },\n    \"sessions\": {\n      \"type\": \"number\",\n      \"default\": 0\n    },\n    \"to_long\": {\n      \"type\": \"number\",\n      \"default\": 4\n    },\n    \"work_len\": {\n      \"type\": \"number\",\n      \"default\": 1500\n    },\n    \"short_len\": {\n      \"type\": \"number\",\n      \"default\": 300\n    },\n    \"long_len\": {\n      \"type\": \"number\",\n      \"default\": 900\n    },\n    \"long_after\": {\n      \"type\": \"number\",\n      \"default\": 4\n    },\n    \"auto\": {\n      \"type\": \"bool\",\n      \"default\": true\n    }\n  },\n  \"sources\": {\n    \"incoming\": {\n      \"inbox\": \"timer\",\n      \"on_receive\": \"heard\"\n    }\n  },\n  \"cards\": [\n    {\n      \"id\": \"main\",\n      \"layout\": {\n        \"column\": [\n          {\n            \"row\": [\n              {\n                \"badge\": \"$phase | map:{work:'Focus', short:'Short break', long:'Long break'}\",\n                \"tone\": \"$phase | map:{work:'accent', else:'good'}\"\n              },\n              {\n                \"spacer\": true\n              },\n              {\n                \"text\": \"{$sessions} of {$long_after} focus sessions\",\n                \"size\": \"s\",\n                \"emphasis\": \"subtle\"\n              }\n            ],\n            \"align\": \"center\"\n          },\n          {\n            \"row\": [\n              {\n                \"progress\": \"$ends_at\",\n                \"from\": \"$started_at\",\n                \"style\": \"ring\",\n                \"size\": \"l\",\n                \"tone\": \"$phase | map:{work:'accent', else:'good'}\",\n                \"when\": \"$status | map:{running:true, else:false}\"\n              },\n              {\n                \"progress\": 0,\n                \"style\": \"ring\",\n                \"size\": \"l\",\n                \"tone\": \"neutral\",\n                \"when\": \"$status | map:{running:false, else:true}\"\n              },\n              {\n                \"column\": [\n                  {\n                    \"column\": [\n                      {\n                        \"timer\": \"$ends_at\",\n                        \"mode\": \"until\",\n                        \"size\": \"xl\",\n                        \"on_end\": \"phase_over\"\n                      },\n                      {\n                        \"text\": \"Left\",\n                        \"size\": \"s\",\n                        \"emphasis\": \"subtle\"\n                      }\n                    ],\n                    \"gap\": \"xs\",\n                    \"when\": \"$status | map:{running:true, else:false}\"\n                  },\n                  {\n                    \"stat\": \"$left | duration\",\n                    \"label\": \"Paused\",\n                    \"size\": \"xl\",\n                    \"when\": \"$status | map:{paused:true, else:false}\"\n                  },\n                  {\n                    \"column\": [\n                      {\n                        \"stat\": \"$work_len | duration\",\n                        \"label\": \"Ready\",\n                        \"size\": \"xl\",\n                        \"when\": \"$phase | map:{work:true, else:false}\"\n                      },\n                      {\n                        \"stat\": \"$short_len | duration\",\n                        \"label\": \"Ready\",\n                        \"size\": \"xl\",\n                        \"when\": \"$phase | map:{short:true, else:false}\"\n                      },\n                      {\n                        \"stat\": \"$long_len | duration\",\n                        \"label\": \"Ready\",\n                        \"size\": \"xl\",\n                        \"when\": \"$phase | map:{long:true, else:false}\"\n                      }\n                    ],\n                    \"when\": \"$status | map:{idle:true, else:false}\"\n                  }\n                ],\n                \"gap\": \"xs\",\n                \"grow\": true\n              }\n            ],\n            \"align\": \"center\",\n            \"gap\": \"m\"\n          },\n          {\n            \"row\": [\n              {\n                \"button\": \"Start\",\n                \"on\": \"start\",\n                \"style\": \"primary\",\n                \"keys\": \"mod+return\",\n                \"when\": \"$status | map:{idle:true, else:false}\"\n              },\n              {\n                \"button\": \"Resume\",\n                \"on\": \"start\",\n                \"style\": \"primary\",\n                \"keys\": \"mod+return\",\n                \"when\": \"$status | map:{paused:true, else:false}\"\n              },\n              {\n                \"button\": \"Pause\",\n                \"on\": \"pause\",\n                \"style\": \"primary\",\n                \"keys\": \"mod+return\",\n                \"when\": \"$status | map:{running:true, else:false}\"\n              },\n              {\n                \"button\": \"Reset\",\n                \"on\": \"reset\",\n                \"style\": \"secondary\",\n                \"disabled\": \"$status | map:{idle:true, else:false}\"\n              },\n              {\n                \"spacer\": true\n              },\n              {\n                \"button\": \"Skip\",\n                \"on\": \"skip\",\n                \"style\": \"plain\"\n              }\n            ],\n            \"align\": \"center\",\n            \"gap\": \"s\"\n          },\n          {\n            \"section\": \"Times\",\n            \"collapsible\": true,\n            \"collapsed\": true,\n            \"children\": [\n              {\n                \"field\": \"Focus\",\n                \"type\": \"slider\",\n                \"bind\": \"$work_len\",\n                \"min\": 300,\n                \"max\": 5400,\n                \"step\": 300,\n                \"format\": \"duration\"\n              },\n              {\n                \"field\": \"Short break\",\n                \"type\": \"slider\",\n                \"bind\": \"$short_len\",\n                \"min\": 60,\n                \"max\": 1800,\n                \"step\": 60,\n                \"format\": \"duration\"\n              },\n              {\n                \"field\": \"Long break\",\n                \"type\": \"slider\",\n                \"bind\": \"$long_len\",\n                \"min\": 300,\n                \"max\": 3600,\n                \"step\": 300,\n                \"format\": \"duration\"\n              },\n              {\n                \"field\": \"Long break after (focus sessions)\",\n                \"type\": \"slider\",\n                \"bind\": \"$long_after\",\n                \"min\": 2,\n                \"max\": 8,\n                \"step\": 1,\n                \"on_change\": \"every_changed\"\n              },\n              {\n                \"field\": \"Start the next one by itself\",\n                \"type\": \"toggle\",\n                \"bind\": \"$auto\"\n              },\n              {\n                \"button\": \"Start over from session 1\",\n                \"on\": \"restart\",\n                \"style\": \"plain\",\n                \"confirm\": \"Stop the timer and start over from the first focus session?\"\n              }\n            ]\n          }\n        ],\n        \"gap\": \"m\"\n      }\n    }\n  ],\n  \"actions\": {\n    \"start\": {\n      \"steps\": [\n        {\n          \"if\": \"$status | map:{paused:true, else:false}\",\n          \"then\": [\n            {\n              \"set\": {\n                \"ends_at\": \"$now\",\n                \"started_at\": \"$now\",\n                \"status\": \"running\"\n              }\n            },\n            {\n              \"increment\": {\n                \"ends_at\": \"$left\",\n                \"started_at\": \"$left\"\n              }\n            },\n            {\n              \"increment\": {\n                \"started_at\": \"-$length\"\n              }\n            },\n            {\n              \"set\": {\n                \"left\": null\n              }\n            }\n          ],\n          \"else\": [\n            {\n              \"set\": {\n                \"started_at\": \"$now\",\n                \"ends_at\": \"$now\",\n                \"length\": 0,\n                \"left\": null,\n                \"status\": \"running\"\n              }\n            },\n            {\n              \"if\": \"$phase | map:{work:true, else:false}\",\n              \"then\": [\n                {\n                  \"increment\": {\n                    \"ends_at\": \"$work_len\",\n                    \"length\": \"$work_len\"\n                  }\n                }\n              ]\n            },\n            {\n              \"if\": \"$phase | map:{short:true, else:false}\",\n              \"then\": [\n                {\n                  \"increment\": {\n                    \"ends_at\": \"$short_len\",\n                    \"length\": \"$short_len\"\n                  }\n                }\n              ]\n            },\n            {\n              \"if\": \"$phase | map:{long:true, else:false}\",\n              \"then\": [\n                {\n                  \"increment\": {\n                    \"ends_at\": \"$long_len\",\n                    \"length\": \"$long_len\"\n                  }\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"if\": \"$settings.share\",\n          \"then\": [\n            {\n              \"send\": {\n                \"timer\": {\n                  \"status\": \"$status\",\n                  \"phase\": \"$phase\",\n                  \"ends_at\": \"$ends_at\",\n                  \"started_at\": \"$started_at\",\n                  \"length\": \"$length\",\n                  \"left\": \"$left\",\n                  \"sessions\": \"$sessions\",\n                  \"to_long\": \"$to_long\",\n                  \"long_after\": \"$long_after\"\n                }\n              }\n            }\n          ]\n        },\n        {\n          \"if\": \"$settings.focus_light\",\n          \"then\": [\n            {\n              \"send\": {\n                \"focus\": {\n                  \"status\": \"$status\",\n                  \"phase\": \"$phase\",\n                  \"ends_at\": \"$ends_at\"\n                }\n              },\n              \"app\": \"focus-light\"\n            }\n          ]\n        }\n      ]\n    },\n    \"pause\": {\n      \"steps\": [\n        {\n          \"if\": \"$status | map:{running:true, else:false}\",\n          \"then\": [\n            {\n              \"set\": {\n                \"left\": \"$ends_at\"\n              }\n            },\n            {\n              \"increment\": {\n                \"left\": \"-$now\"\n              },\n              \"min\": 0\n            },\n            {\n              \"if\": \"$left | map:{0:true, else:false}\",\n              \"then\": [\n                {\n                  \"if\": \"$phase | map:{work:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"increment\": {\n                        \"sessions\": 1,\n                        \"to_long\": -1\n                      },\n                      \"min\": 0\n                    },\n                    {\n                      \"if\": \"$to_long | map:{0:true, else:false}\",\n                      \"then\": [\n                        {\n                          \"set\": {\n                            \"phase\": \"long\"\n                          }\n                        }\n                      ],\n                      \"else\": [\n                        {\n                          \"set\": {\n                            \"phase\": \"short\"\n                          }\n                        }\n                      ]\n                    }\n                  ],\n                  \"else\": [\n                    {\n                      \"if\": \"$phase | map:{long:true, else:false}\",\n                      \"then\": [\n                        {\n                          \"set\": {\n                            \"sessions\": 0,\n                            \"to_long\": \"$long_after\"\n                          }\n                        }\n                      ]\n                    },\n                    {\n                      \"set\": {\n                        \"phase\": \"work\"\n                      }\n                    }\n                  ]\n                },\n                {\n                  \"set\": {\n                    \"ends_at\": 0,\n                    \"left\": null,\n                    \"status\": \"idle\"\n                  }\n                }\n              ],\n              \"else\": [\n                {\n                  \"set\": {\n                    \"ends_at\": 0,\n                    \"status\": \"paused\"\n                  }\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"if\": \"$settings.share\",\n          \"then\": [\n            {\n              \"send\": {\n                \"timer\": {\n                  \"status\": \"$status\",\n                  \"phase\": \"$phase\",\n                  \"ends_at\": \"$ends_at\",\n                  \"started_at\": \"$started_at\",\n                  \"length\": \"$length\",\n                  \"left\": \"$left\",\n                  \"sessions\": \"$sessions\",\n                  \"to_long\": \"$to_long\",\n                  \"long_after\": \"$long_after\"\n                }\n              }\n            }\n          ]\n        },\n        {\n          \"if\": \"$settings.focus_light\",\n          \"then\": [\n            {\n              \"send\": {\n                \"focus\": {\n                  \"status\": \"$status\",\n                  \"phase\": \"$phase\",\n                  \"ends_at\": \"$ends_at\"\n                }\n              },\n              \"app\": \"focus-light\"\n            }\n          ]\n        }\n      ]\n    },\n    \"reset\": {\n      \"steps\": [\n        {\n          \"set\": {\n            \"ends_at\": 0,\n            \"left\": null,\n            \"status\": \"idle\"\n          }\n        },\n        {\n          \"if\": \"$settings.share\",\n          \"then\": [\n            {\n              \"send\": {\n                \"timer\": {\n                  \"status\": \"$status\",\n                  \"phase\": \"$phase\",\n                  \"ends_at\": \"$ends_at\",\n                  \"started_at\": \"$started_at\",\n                  \"length\": \"$length\",\n                  \"left\": \"$left\",\n                  \"sessions\": \"$sessions\",\n                  \"to_long\": \"$to_long\",\n                  \"long_after\": \"$long_after\"\n                }\n              }\n            }\n          ]\n        },\n        {\n          \"if\": \"$settings.focus_light\",\n          \"then\": [\n            {\n              \"send\": {\n                \"focus\": {\n                  \"status\": \"$status\",\n                  \"phase\": \"$phase\",\n                  \"ends_at\": \"$ends_at\"\n                }\n              },\n              \"app\": \"focus-light\"\n            }\n          ]\n        }\n      ]\n    },\n    \"skip\": {\n      \"steps\": [\n        {\n          \"if\": \"$phase | map:{work:true, else:false}\",\n          \"then\": [\n            {\n              \"if\": \"$to_long | map:{0:true, else:false}\",\n              \"then\": [\n                {\n                  \"set\": {\n                    \"phase\": \"long\"\n                  }\n                }\n              ],\n              \"else\": [\n                {\n                  \"set\": {\n                    \"phase\": \"short\"\n                  }\n                }\n              ]\n            }\n          ],\n          \"else\": [\n            {\n              \"if\": \"$phase | map:{long:true, else:false}\",\n              \"then\": [\n                {\n                  \"set\": {\n                    \"sessions\": 0,\n                    \"to_long\": \"$long_after\"\n                  }\n                }\n              ]\n            },\n            {\n              \"set\": {\n                \"phase\": \"work\"\n              }\n            }\n          ]\n        },\n        {\n          \"set\": {\n            \"ends_at\": 0,\n            \"left\": null,\n            \"status\": \"idle\"\n          }\n        },\n        {\n          \"if\": \"$settings.share\",\n          \"then\": [\n            {\n              \"send\": {\n                \"timer\": {\n                  \"status\": \"$status\",\n                  \"phase\": \"$phase\",\n                  \"ends_at\": \"$ends_at\",\n                  \"started_at\": \"$started_at\",\n                  \"length\": \"$length\",\n                  \"left\": \"$left\",\n                  \"sessions\": \"$sessions\",\n                  \"to_long\": \"$to_long\",\n                  \"long_after\": \"$long_after\"\n                }\n              }\n            }\n          ]\n        },\n        {\n          \"if\": \"$settings.focus_light\",\n          \"then\": [\n            {\n              \"send\": {\n                \"focus\": {\n                  \"status\": \"$status\",\n                  \"phase\": \"$phase\",\n                  \"ends_at\": \"$ends_at\"\n                }\n              },\n              \"app\": \"focus-light\"\n            }\n          ]\n        }\n      ]\n    },\n    \"restart\": {\n      \"steps\": [\n        {\n          \"set\": {\n            \"phase\": \"work\",\n            \"sessions\": 0,\n            \"to_long\": \"$long_after\",\n            \"ends_at\": 0,\n            \"left\": null,\n            \"status\": \"idle\"\n          }\n        },\n        {\n          \"if\": \"$settings.share\",\n          \"then\": [\n            {\n              \"send\": {\n                \"timer\": {\n                  \"status\": \"$status\",\n                  \"phase\": \"$phase\",\n                  \"ends_at\": \"$ends_at\",\n                  \"started_at\": \"$started_at\",\n                  \"length\": \"$length\",\n                  \"left\": \"$left\",\n                  \"sessions\": \"$sessions\",\n                  \"to_long\": \"$to_long\",\n                  \"long_after\": \"$long_after\"\n                }\n              }\n            }\n          ]\n        },\n        {\n          \"if\": \"$settings.focus_light\",\n          \"then\": [\n            {\n              \"send\": {\n                \"focus\": {\n                  \"status\": \"$status\",\n                  \"phase\": \"$phase\",\n                  \"ends_at\": \"$ends_at\"\n                }\n              },\n              \"app\": \"focus-light\"\n            }\n          ]\n        }\n      ]\n    },\n    \"every_changed\": {\n      \"steps\": [\n        {\n          \"set\": {\n            \"to_long\": \"$args.value\"\n          }\n        },\n        {\n          \"increment\": {\n            \"to_long\": \"-$sessions\"\n          },\n          \"min\": 0\n        },\n        {\n          \"if\": \"$settings.share\",\n          \"then\": [\n            {\n              \"send\": {\n                \"timer\": {\n                  \"status\": \"$status\",\n                  \"phase\": \"$phase\",\n                  \"ends_at\": \"$ends_at\",\n                  \"started_at\": \"$started_at\",\n                  \"length\": \"$length\",\n                  \"left\": \"$left\",\n                  \"sessions\": \"$sessions\",\n                  \"to_long\": \"$to_long\",\n                  \"long_after\": \"$long_after\"\n                }\n              }\n            }\n          ]\n        }\n      ]\n    },\n    \"phase_over\": {\n      \"steps\": [\n        {\n          \"if\": \"$status | map:{running:true, else:false}\",\n          \"then\": [\n            {\n              \"if\": \"$phase | map:{work:true, else:false}\",\n              \"then\": [\n                {\n                  \"increment\": {\n                    \"sessions\": 1,\n                    \"to_long\": -1\n                  },\n                  \"min\": 0\n                },\n                {\n                  \"if\": \"$to_long | map:{0:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"set\": {\n                        \"phase\": \"long\"\n                      }\n                    }\n                  ],\n                  \"else\": [\n                    {\n                      \"set\": {\n                        \"phase\": \"short\"\n                      }\n                    }\n                  ]\n                }\n              ],\n              \"else\": [\n                {\n                  \"if\": \"$phase | map:{long:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"set\": {\n                        \"sessions\": 0,\n                        \"to_long\": \"$long_after\"\n                      }\n                    }\n                  ]\n                },\n                {\n                  \"set\": {\n                    \"phase\": \"work\"\n                  }\n                }\n              ]\n            },\n            {\n              \"set\": {\n                \"ends_at\": 0,\n                \"left\": null,\n                \"status\": \"idle\"\n              }\n            },\n            {\n              \"notify\": {\n                \"title\": \"$phase | map:{work:'Break over', else:'Focus session done'}\",\n                \"body\": \"$phase | map:{work:'Time to focus again.', short:'Take a short break.', long:'Take a long break, you earned it.'}\"\n              }\n            },\n            {\n              \"if\": \"$auto\",\n              \"then\": [\n                {\n                  \"set\": {\n                    \"started_at\": \"$now\",\n                    \"ends_at\": \"$now\",\n                    \"length\": 0,\n                    \"left\": null,\n                    \"status\": \"running\"\n                  }\n                },\n                {\n                  \"if\": \"$phase | map:{work:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"increment\": {\n                        \"ends_at\": \"$work_len\",\n                        \"length\": \"$work_len\"\n                      }\n                    }\n                  ]\n                },\n                {\n                  \"if\": \"$phase | map:{short:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"increment\": {\n                        \"ends_at\": \"$short_len\",\n                        \"length\": \"$short_len\"\n                      }\n                    }\n                  ]\n                },\n                {\n                  \"if\": \"$phase | map:{long:true, else:false}\",\n                  \"then\": [\n                    {\n                      \"increment\": {\n                        \"ends_at\": \"$long_len\",\n                        \"length\": \"$long_len\"\n                      }\n                    }\n                  ]\n                }\n              ]\n            },\n            {\n              \"if\": \"$settings.share\",\n              \"then\": [\n                {\n                  \"send\": {\n                    \"timer\": {\n                      \"status\": \"$status\",\n                      \"phase\": \"$phase\",\n                      \"ends_at\": \"$ends_at\",\n                      \"started_at\": \"$started_at\",\n                      \"length\": \"$length\",\n                      \"left\": \"$left\",\n                      \"sessions\": \"$sessions\",\n                      \"to_long\": \"$to_long\",\n                      \"long_after\": \"$long_after\"\n                    }\n                  },\n                  \"alert\": \"$phase | map:{work:'Break over: time to focus', else:'Focus session done: take a break'}\"\n                }\n              ]\n            },\n            {\n              \"if\": \"$settings.focus_light\",\n              \"then\": [\n                {\n                  \"send\": {\n                    \"focus\": {\n                      \"status\": \"$status\",\n                      \"phase\": \"$phase\",\n                      \"ends_at\": \"$ends_at\"\n                    }\n                  },\n                  \"app\": \"focus-light\"\n                }\n              ]\n            }\n          ]\n        }\n      ]\n    },\n    \"heard\": {\n      \"steps\": [\n        {\n          \"if\": \"$args.event.length\",\n          \"then\": [\n            {\n              \"set\": {\n                \"status\": \"$args.event.status\",\n                \"phase\": \"$args.event.phase\",\n                \"ends_at\": \"$args.event.ends_at\",\n                \"started_at\": \"$args.event.started_at\",\n                \"length\": \"$args.event.length\",\n                \"left\": \"$args.event.left\",\n                \"sessions\": \"$args.event.sessions\",\n                \"to_long\": \"$args.event.to_long\",\n                \"long_after\": \"$args.event.long_after\"\n              }\n            }\n          ]\n        }\n      ]\n    }\n  },\n  \"views\": {\n    \"menubar\": {\n      \"icon\": \"timer\",\n      \"label\": \"{$status | map:{paused:'Paused ', idle:'Ready', else:''}}{$ends_at | until}{$left | duration}\",\n      \"label_tone\": \"$phase | map:{work:'accent', else:'good'}\",\n      \"card\": \"main\",\n      \"label_icon\": \"$status | map:{running:'timer', paused:'pause.circle', else:'timer'}\"\n    },\n    \"floating\": {\n      \"card\": \"main\",\n      \"pin\": true,\n      \"width\": \"narrow\"\n    }\n  },\n  \"style\": {\n    \"accent\": \"#e5533d\"\n  },\n  \"settings\": {\n    \"share\": {\n      \"type\": \"toggle\",\n      \"label\": \"Share the timer with my other devices\",\n      \"default\": false\n    },\n    \"focus_light\": {\n      \"type\": \"toggle\",\n      \"label\": \"Tell Focus Light when I focus\",\n      \"default\": false,\n      \"platforms\": [\n        \"macos\"\n      ]\n    }\n  }\n}\n",
    "files": []
}