text:
<?php
$lang['application_account_details'] = "Détails de votre compte";
$lang['application_action'] = "Action";
$lang['application_active'] = "Actif";
$lang['application_add_item'] = "Ajouter un article";
$lang['application_add_media'] = "Ajouter un média";
$lang['application_add_new_client'] = "Ajouter un client";
$lang['application_add_task'] = "Ajouter une tâche";
$lang['application_add_to_quick_access'] = "Ajouter à l'accès rapide";
$lang['application_address'] = "Adresse";
$lang['application_admin'] = "Administration";
$lang['application_all_clients'] = "Tous les clients";
$lang['application_all_invoices'] = "Toutes les factures";
$lang['application_invoice'] = "Facture";
$lang['application_all_items'] = "Tous les produits";
$lang['application_all_projects'] = "Tous les projets";
$lang['application_all_users'] = "Tous les utilisateurs";
$lang['application_always_make_backup'] = "Toujours faire une sauvegarde avant de mettre à jour !";
$lang['application_back'] = "Retour";
$lang['application_backup_database'] = "Sauvegarder la base de données";
$lang['application_backup_file_zip'] = "Sauvegarde de la base de données (fichier .zip)";
$lang['application_change_password'] = "Changer le mot de passe";
$lang['application_check_for_updates'] = "Vérifier les mises à jour";
$lang['application_city'] = "Ville";
$lang['application_client'] = "Client";
$lang['application_client_details'] = "Détails client";
$lang['application_client_id'] = "ID client";
$lang['application_client_reference'] = "Ref client";
$lang['application_clients'] = "Clients";
$lang['application_closed_projects'] = "Projets fermés";
$lang['application_company'] = "Entreprise";
$lang['application_company_name'] = "Nom de l'entreprise";
$lang['application_confirm_password'] = "Confirmez le mot de passe";
$lang['application_contact'] = "Contact";
$lang['application_contact_person'] = "Personne à contacter";
$lang['application_create_invoice'] = "Nouvelle facture";
$lang['application_create_item'] = "Nouvel article";
$lang['application_create_new_project'] = "Nouveau projet";
$lang['application_create_project'] = "Nouveau projet";
$lang['application_create_user'] = "Nouvel utilisateur";
$lang['application_created_on'] = "Créé le";
$lang['application_currency'] = "Devise";
$lang['application_dashboard'] = "Tableau de bord";
$lang['application_date'] = "Date";
$lang['application_date_format'] = "Format de la date";
$lang['application_deadline'] = "Date limite";
$lang['application_default_currency'] = "Devise par défaut";
$lang['application_default_invoice_terms'] = "Conditions de facturation";
$lang['application_default_terms'] = "Conditions par défaut";
$lang['application_delete'] = "Supprimer";
$lang['application_description'] = "Description";
$lang['application_domain'] = "Domaine";
$lang['application_done'] = "Effectué";
$lang['application_download'] = "Télécharger";
$lang['application_due_date'] = "Date d'échéance";
$lang['application_edit'] = "Éditer";
$lang['application_edit_client'] = "Éditer client";
$lang['application_edit_invoice'] = "Éditer facture";
$lang['application_edit_item'] = "Éditer article";
$lang['application_edit_media'] = "Éditer média";
$lang['application_edit_project'] = "Éditer projet";
$lang['application_edit_task'] = "Éditer tâche";
$lang['application_edit_this_project'] = "Éditer ce projet";
$lang['application_edit_user'] = "Éditer utilisateur";
$lang['application_email'] = "E-mail";
$lang['application_email_login_details'] = "Détails de connexion par e-mail";
$lang['application_file'] = "Fichier";
$lang['application_filename'] = "Nom du fichier";
$lang['application_from'] = "De";
$lang['application_full_name'] = "Nom complet";
$lang['application_hello'] = "Bienvenue";
$lang['application_hold'] = "En attente";
$lang['application_hours'] = "Heures";
$lang['application_hrs_qty'] = "Hrs/Qté";
$lang['application_inactive'] = "Inactif";
$lang['application_info'] = "Infos";
$lang['application_install'] = "Installer";
$lang['application_invoice_date'] = "Date de la facture";
$lang['application_invoice_details'] = "Détails de la facture";
$lang['application_invoice_id'] = "ID facture";
$lang['application_invoice_items'] = "Articles facturés";
$lang['application_invoice_mail_body'] = "Corps e-mail facture";
$lang['application_invoice_mail_subject'] = "Sujet e-mail facture";
$lang['application_invoice_number'] = "Numéro de facture";
$lang['application_invoices'] = "Factures";
$lang['application_issue_date'] = "Date d'émission";
$lang['application_item'] = "Article";
$lang['application_items'] = "Articles";
$lang['application_latest_messages'] = "Derniers messages";
$lang['application_loading'] = "Chargement en cours...";
$lang['application_login'] = "Connexion";
$lang['application_login_details'] = "Infos de connexion";
$lang['application_logo'] = "Logo";
$lang['application_media'] = "Média";
$lang['application_message'] = "Message";
$lang['application_minutes'] = "Minutes";
$lang['application_mobile'] = "Tél portable";
$lang['application_my_invoices'] = "Mes factures";
$lang['application_my_projects'] = "Mes projets";
$lang['application_name'] = "Nom";
$lang['application_no'] = "Inactif";
$lang['application_no_client_assigned'] = "Aucun client assigné";
$lang['application_no_items_yet'] = "Aucun article";
$lang['application_on'] = "Actif";
$lang['application_Open'] = "Ouvert";
$lang['application_open'] = "Ouvert";
$lang['application_open_invoices'] = "Factures ouvertes";
$lang['application_open_projects'] = "Projets en cours";
$lang['application_option'] = "Option";
$lang['application_outstanding_payments'] = "Paiements en attente";
$lang['application_overdue'] = "Date limite dépassée";
$lang['application_overview'] = "Récapitulatif";
$lang['application_Paid'] = "Payé";
$lang['application_paid_invoices'] = "Factures réglées";
$lang['application_password'] = "Mot de passe";
$lang['application_payments'] = "Paiements";
$lang['application_payments_received'] = "Paiements reçus";
$lang['application_phase'] = "Étape";
$lang['application_phases'] = "Étapes";
$lang['application_phone'] = "Téléphone";
$lang['application_post_message'] = "Écrire un message";
$lang['application_preview'] = "Prévisualiser le PDF";
$lang['application_previous_update_required'] = "Anciennes mises à jour requises !";
$lang['application_progress'] = "Progression";
$lang['application_project_details'] = "Détails du projet";
$lang['application_project_id'] = "ID du projet";
$lang['application_project_name'] = "Nom du projet";
$lang['application_projects'] = "Projets";
$lang['application_quantity_hours'] = "Qté/Heures";
$lang['application_quick_access'] = "Accès rapide";
$lang['application_reference_id'] = "ID référence";
$lang['application_release_date'] = "Date de lancement";
$lang['application_remove_from_quick_access'] = "Supprimer de l'accès rapide";
$lang['application_remove_item_from_invoice'] = "Supprimer l'article de la facture";
$lang['application_reset_default'] = "Réinitialiser";
$lang['application_reset_timer'] = "Réinitialiser le compteur";
$lang['application_restore_backup'] = "Restaurer la sauvegarde";
$lang['application_restore_database'] = "Restaurer la base de données";
$lang['application_restore_notice'] = "Important ! Toutes les données ajoutées après la version transmise seront supprimées !";
$lang['application_save'] = "Sauvegarder";
$lang['application_send_invoice_to_client'] = "Envoyer la facture au client";
$lang['application_Sent'] = "Envoyé";
$lang['application_sent_invoices'] = "Factures envoyées";
$lang['application_settings'] = "Paramètres";
$lang['application_short_tags'] = "Étiquettes";
$lang['application_show_login_details'] = "Voir les informations de connexion";
$lang['application_start_date'] = "Début du projet";
$lang['application_start_timer'] = "Démarrer le compteur";
$lang['application_statistics'] = "Statistiques";
$lang['application_status'] = "Statut";
$lang['application_stop_timer'] = "Arrêter le compteur";
$lang['application_street'] = "Rue";
$lang['application_sub_total'] = "Sous-total";
$lang['application_system_updates'] = "Mises à jour du système";
$lang['application_task_name'] = "Nom de la tâche";
$lang['application_tasks'] = "Tâches";
$lang['application_tax'] = "Taxe";
$lang['application_terms'] = "Conditions";
$lang['application_time_spent'] = "Temps passé";
$lang['application_total'] = "Total";
$lang['application_type'] = "Type";
$lang['application_unit_price'] = "Prix unitaire";
$lang['application_update'] = "Mise à jour";
$lang['application_upload_backup'] = "Transmettre un fichier de sauvegarde";
$lang['application_uploaded_by'] = "Transmis par";
$lang['application_uploaded_on'] = "Transmis le";
$lang['application_username'] = "Nom d'utilisateur";
$lang['application_users'] = "Utilisateurs";
$lang['application_value'] = "Valeur";
$lang['application_view_changelog'] = "Voir le journal des modifications";
$lang['application_write_a_message'] = "Écrire un message";
$lang['application_write_new_message'] = "Écrire un nouveau message";
$lang['application_yes'] = "Oui";
$lang['application_zip_code'] = "Code postal";
$lang['application_assets'] = "Objets";

$lang['application_quotations'] = "Devis";
$lang['application_quotation'] = "Devis";
$lang['application_all_qutations'] = "Tous les devis";
$lang['application_quotation_id'] = "ID";
$lang['application_worker'] = "Assigné à";
$lang['application_answers'] = "Questions";
$lang['application_quotation_details'] = "Devis détaillé";
$lang['application_quotation_add_client'] = "Ajouter aux clients";
$lang['application_personal_info'] = "Infos personnelles";
$lang['application_edit_quotation'] = "Éditer le devis";
$lang['application_New'] = "Nouveau";
$lang['application_Reviewed'] = "Vérifié";
$lang['application_Accepted'] = "Accepté";
$lang['application_view_quotation_form'] = "Voir le formulaire de devis";

$lang['application_write_message'] = "Écrire un nouveau message";
$lang['application_messages'] = "Messages";
$lang['application_message'] = "Message";
$lang['application_received'] = "Reçu";
$lang['application_subject'] = "Sujet";
$lang['application_to'] = "Pour";
$lang['application_new_messages'] = "Nouveaux messages";
$lang['application_write_messages'] = "Écrire un message";
$lang['application_edit_message'] = "Changer le statut du message";
$lang['application_replied_messages'] = "Messages traités";
$lang['application_read_messages'] = "Messages lus";
$lang['application_reply'] = "Répondre";
$lang['application_send'] = "Envoyer";
$lang['application_New'] = "Nouveau";
$lang['application_Read'] = "Lire";
$lang['application_Replied'] = "Répondu";

$lang['application_pay_via_paypal'] = "Payer par PayPal";
$lang['application_paypal'] = "PayPal";
$lang['application_paypal_currency'] = "Devise PayPal";
$lang['application_paypal_active'] = "Activer PayPal";
$lang['application_paypal_account'] = "Compte PayPal";

$lang['application_lib'] = "";
$lang['application_close'] = "Fermer";
$lang['application_all'] = "Tous";
$lang['application_closed'] = "Fermé";
$lang['application_Reviewed'] = "Vérifié";
$lang['application_Accepted'] = "Accepté";
$lang['application_really_delete'] = "Êtes-vous sûr ?";
$lang['application_yes_im_sure'] = "Oui, je suis sûr";
$lang['application_no_messages'] = "Il n'y a pas encore de messages";
$lang['application_message_list_time'] = "g:i a";
$lang['application_message_list_date'] = "j/m";
$lang['application_date_time_format'] = "Format de l'heure";
$lang['application_select'] = "Sélectionner...";
$lang['application_reply'] = "Répondre ...";
$lang['application_messages_show_deleted'] = "Afficher les messages supprimés";
$lang['application_latest_media_comments'] = "Derniers commentaires";
$lang['application_assigned_to'] = "Assigné à";
$lang['application_assign_to'] = "Assigner à...";
$lang['application_not_assigned'] = "Non assigné";
$lang['application_assign_to_agents'] = "Assigner aux agents";
$lang['application_select_agents'] = "Sélectionner les agents ...";
$lang['application_save_and_add'] = "Sauvegarder & Ajouter un autre";
$lang['application_task_public'] = "Visible par le client";
$lang['application_media_details'] = "Détails des médias";
$lang['application_title'] = "Titre";
$lang['application_no_tasks_yet'] = "Il n'y a pas encore de tâches";
$lang['application_website'] = "Site Web";
$lang['application_category'] = "Catégorie";
$lang['application_discount'] = "Remise";
$lang['application_custom_item'] = "Ajouter un article personnalisé";
$lang['application_profile_picture'] = "Image de profil (max 180x180)";
$lang['application_templates'] = "Modèles";
$lang['application_logs'] = "Journaux";
$lang['application_updates'] = "Mises à jour";
$lang['application_refresh'] = "Actualiser";
$lang['application_clear'] = "Effacer";
$lang['application_invoice_email_template'] = "E-mail de facturation";
$lang['application_credentials_email_template'] = "E-mail de vérification des droits";
$lang['application_default_language'] = "Langue par défaut";
$lang['application_credentials_mail_subject'] = "Objet de l'e-mail de vérification des droits";
$lang['application_credentials_mail_body'] = "Corps de l'e-mail de vérification des droits";
$lang['application_download_counter'] = "Télécharger le compteur";
$lang['application_reset_password'] = "Réinitialiser le mot de passe";
$lang['application_go_to_login'] = "Aller à la connexion";
$lang['application_forgot_password'] = "Mot de passe oublié?";
$lang['application_identify_account'] = "Pour réinitialiser votre mot de passe, veuillez identifier votre compte.";
$lang['application_notification_new_message_subject'] = "Nouveau message";
$lang['application_notification_new_message'] = "Vous avez reçu un nouveau message.";
$lang['application_notification_project_assign_subject'] = "Mise à jour du projet";
$lang['application_notification_project_assign'] = "Le projet vous a été attribué.";
$lang['application_notification_quotation_subject'] = "Nouveau devis";
$lang['application_notification_quotation'] = "Un nouveau devis a été transmis.";
$lang['application_previous'] = "Précédent";
$lang['application_next'] = "Suivant";
$lang['application_module_access'] = "Permissions des modules";
$lang['application_quickaccess'] = "Accès rapide";
$lang['application_last_login'] = "Dernière connexion";
$lang['application_default_template'] = "Modèle";
$lang['application_user_online'] = "Utilisateurs en ligne";
$lang['application_mail_body'] = "Corps de l'e-mail";
$lang['application_pw_reset_email_template'] = "Réinitialisation du mot de passe";
$lang['application_pw_reset_link_email_template'] = "Confirmation de la réinitialisation du mot de passe";
$lang['application_notification_email_template'] = "Notifications";
$lang['application_recurring'] = "Facture récurrente";
$lang['application_subscriptions'] = "Abonnements";
$lang['application_frequency'] = "Fréquence";
$lang['application_weekly'] = "Hebdomadaire";
$lang['application_every_other_week'] = "Toutes les deux semaines";
$lang['application_monthly'] = "Tous les mois";
$lang['application_quarterly'] = "Trimestrielle";
$lang['application_semi_annually'] = "Semestrielle";
$lang['application_annually'] = "Annuelle";
$lang['application_create_subscription'] = "Nouvel un abonnement";
$lang['application_subscriptions'] = "Abonnements";
$lang['application_subscription'] = "Abonnement";
$lang['application_subscription_id'] = "ID de l'abonnement";
$lang['application_next_payment'] = "Prochain paiement";
$lang['application_end_date'] = "Date de fin";
$lang['application_Active'] = "Actif";
$lang['application_Inactive'] = "Inactif";
$lang['application_subscription_has_ended'] = "L'abonnement a pris fin";
$lang['application_new_invoice_required'] = "Nouvelle facture nécessaire";
$lang['application_subscribe_via_paypal'] = "S'abonner via PayPal";
$lang['application_edit_subscription'] = "Éditer l'abonnement";
$lang['application_subscription_details'] = "Détails de l'abonnement";
$lang['application_subscription_items'] = "Articles de l'abonnement";
$lang['application_new_invoice_needed'] = "Une nouvelle facture doit être créée.";
$lang['application_send_subscription_to_client'] = "Envoyer l'abonnement au client";
$lang['application_no_events_yet'] = "Il n'y a pas encore d'événements";
$lang['application_customize'] = "Personnaliser";
$lang['application_media_preview'] = "Aperçu";
$lang['application_useronline'] = "Utilisateurs en ligne";
$lang['application_no_company_assigned'] = "Aucune société assignée";
$lang['application_company_id'] = "ID de la société";
$lang['application_primary_contact'] = "Contact principal";
$lang['application_contacts'] = "Contacts";
$lang['application_company_details'] = "Détails de la société";
$lang['application_company'] = "Société";
$lang['application_companies'] = "Sociétés";
$lang['application_add_new_company'] = "Nouvelle société";
$lang['application_edit_company'] = "Editer société";
$lang['application_firstname'] = "Prénom";
$lang['application_lastname'] = "Nom de famille";
$lang['application_back_to_project'] = "Retour au projet";
$lang['application_files'] = "Fichiers";
$lang['application_cronjob'] = "Cronjob";
$lang['application_backup'] = "Sauvegarde";
$lang['application_no_backups'] = "Il n'y a pas encore de sauvegardes";
$lang['application_database_backups'] = "Sauvegardes de la base de données";
$lang['application_system_up_to_date'] = "Votre système est à jour";
$lang['application_client_has_no_contacts'] = "Ce client n'a pas de contacts !";
$lang['application_add_new_contact'] = "Ajouter un contact";
$lang['application_cronjob_help'] = "Cela active la fonctionnalité Cronjob si elle est correctement configurée. Veuillez vous référer à la documentation pour plus d'informations.";
$lang['application_cronjob_active'] = "Cronjob actif";
$lang['application_cronjob_address'] = "Lien vers le Cronjob";
$lang['application_cronjob_address_help'] = "Utilisez ce lien pour votre service Cronjob. Veuillez vous référer à la documentation pour plus d'informations.";
$lang['application_last_cronjob_run'] = "Dernier Cronjob exécuté";
$lang['application_autobackup'] = "Sauvegarde automatique de la base de données";
$lang['application_autobackup_help'] = "Crée une sauvegarde de base de données tous les 7 jours. Nécessite l'activation du Cronjob !";
$lang['application_cprojects'] = "Projets";
$lang['application_cinvoices'] = "Factures";
$lang['application_cmessages'] = "Messages";
$lang['application_csubscriptions'] = "Abonnements";
$lang['application_download_invoice'] = "Télécharger la facture";
$lang['application_notification_payment_processed_subject'] = "Paiement effectué";
$lang['application_notification_payment_processed'] = "Le paiement de la facture suivante a été effectué :";
$lang['application_notification_subscribed_subject'] = "Abonnement effectué";
$lang['application_notification_subscribed'] = "Le paiement de l'abonnement suivant a été effectué :";
$lang['application_paypal_ipn_address'] = "Lien IPN PayPal";
$lang['application_paypal_ipn_help'] = "Ajoutez ce lien à votre compte PayPal pour activer l'IPN.";
$lang['application_subscribed_via_paypal'] = "Abonné via PayPal";
$lang['application_ended'] = "Terminé";
$lang['application_no_contact_assigned'] = "Aucun contact associé";
$lang['application_events'] = "Evénements";
$lang['application_my_open_tasks'] = "Tâches ouvertes";
$lang['application_recent_messages'] = "Messages récents";

$lang['application_agents'] = "Agents";
$lang['application_no_data_yet'] = "Il n'y a pas encore de données !";
$lang['application_Jan'] = "Janvier";
$lang['application_Feb'] = "Février";
$lang['application_Mar'] = "Mars";
$lang['application_Apr'] = "Avril";
$lang['application_May'] = "Mai";
$lang['application_Jun'] = "Juin";
$lang['application_Jul'] = "Juillet";
$lang['application_Aug'] = "Août";
$lang['application_Sep'] = "Septembre";
$lang['application_Oct'] = "Octobre";
$lang['application_Nov'] = "Novembre";
$lang['application_Dec'] = "Décembre";
$lang['application_showing_from_to'] = "Affichage de _START_ à _END_ sur _TOTAL_ enregistrements";
$lang['application_showing_from_to_empty'] = "Affichage de 0 à 0 sur 0 enregistrements";
$lang['application_view'] = "Vue d'ensemble";
$lang['application_sent'] = "Envoyé";
$lang['application_paid'] = "Payé";

$lang['application_notification'] = "Notification";
$lang['application_credentials'] = "Droits";
$lang['application_pw_reset_link'] = "Lien de réinitialisation du mot de passe";
$lang['application_pw_reset'] = "Réinitialiser le mot de passe";

$lang['application_country'] = "Pays";
$lang['application_subscription_email_template'] = "E-mail d'abonnement";
$lang['application_client_online'] = "Clients en ligne";
$lang['application_ticket'] = "Ticket";
$lang['application_tickets'] = "Tickets";
$lang['application_ctickets'] = "Tickets";
$lang['application_create_new_ticket'] = "Nouveau ticket";
$lang['application_ticket_id'] = "ID de ticket";
$lang['application_queue'] = "File d'attente";
$lang['application_queues'] = "Files d'attente";
$lang['application_created'] = "Créé";
$lang['application_ticket_details'] = "Détails du ticket";
$lang['application_ticket_status_new'] = "Nouveau";
$lang['application_ticket_status_open'] = "Ouvrir";
$lang['application_ticket_status_onhold'] = "En attente";
$lang['application_ticket_status_inprogress'] = "En cours";
$lang['application_ticket_status_reopened'] = "Rouvert";
$lang['application_ticket_status_canceled'] = "Annulé";
$lang['application_ticket_status_closed'] = "Fermé";
$lang['application_owner'] = "Propriétaire";
$lang['application_assign'] = "Assigner";
$lang['application_note'] = "Note";
$lang['application_add_note'] = "Ajouter une note";
$lang['application_attachment'] = "Pièce-jointe";
$lang['application_notification_ticket_assign_subject'] = "Ticket assigné";
$lang['application_create_ticket'] = "Nouveau ticket";
$lang['application_quick_reply'] = "Réponse rapide...";
$lang['application_notify_client'] = "Notifier le client";
$lang['application_notify_agent'] = "Notifier l'agent";
$lang['application_note_visible_to_client'] = "Note visible pour le client";
$lang['application_closed'] = "Fermé";
$lang['application_closed_tickets'] = "Tickets fermés";
$lang['application_open_tickets'] = "Tickets ouverte";
$lang['application_imap'] = "IMAP";
$lang['application_pop'] = "POP";
$lang['application_imap_or_pop'] = "IMAP ou POP";
$lang['application_postmaster_active'] = "Activer l'e-mail des tickets";
$lang['application_postmaster_help'] = "Cela activera le script postmaster. Vous devrez ajouter le Cronjob postmaster !";
$lang['application_ssl'] = "SSL";
$lang['application_host'] = "Hôte";
$lang['application_port'] = "Port";
$lang['application_mailbox'] = "Boîte mail";
$lang['application_additional_flags'] = "Étiquettes supplémentaires";
$lang['application_imap_search'] = "Recherche IMAP";
$lang['application_imap_search_help'] = 'Recherche IMAP : http://php.net/manual/en/function.imap-search.php';
$lang['application_delete_from_mailbox'] = "Supprimer les e-mails du serveur après importation";
$lang['application_delete_from_mailbox_help'] = "Les e-mails seront supprimés de la boîte mail après avoir été importé.";
$lang['application_postmaster_address'] = "Lien vers le Cronjob postmaster";
$lang['application_last_postmaster_run'] = "Dernier postmaster lancé";
$lang['application_postmaster_test'] = "Tester les paramètres d'e-mail... (sauvegardez avant)";
$lang['application_ticket_default_owner'] = "Propriétaire des tickets par défaut";
$lang['application_ticket_default_queue'] = "File d'attente des tickets par défaut";
$lang['application_ticket_default_type'] = "Type de tickets par défaut";
$lang['application_ticket_default_status'] = "Statut des tickets par défaut";
$lang['application_types'] = "Types";
$lang['application_add_type'] = "Ajouter un type";
$lang['application_queues'] = "Files d'attente";
$lang['application_add_queue'] = "Ajouter une file d'attente";
$lang['application_my_tickets'] = "Mes tickets";
$lang['application_ticket_notification_email_template'] = "Notification des tickets";
$lang['application_ticket_notification'] = "Notification de ticket";

$lang['application_notes'] = "Notes";
$lang['application_note'] = "Note";
$lang['application_unsaved'] = "Non enregistrée";
$lang['application_custom_quotations'] = "Devis personnalisés";
$lang['application_custom_quotation'] = "Devis personnalisé";
$lang['application_create_quotation'] = "Créer un nouveau formulaire de devis";
$lang['application_custom_quotation_forms'] = "Formulaire de devis personnalisé";

$lang['application_Years'] = "années";
$lang['application_Year'] = "année";
$lang['application_Months'] = "mois";
$lang['application_Month'] = "mois";
$lang['application_Weeks'] = "semaines";
$lang['application_Week'] = "semaine";
$lang['application_Days'] = "jours";
$lang['application_Day'] = "jour";
$lang['application_Hours'] = "heures";
$lang['application_Hour'] = "heure";
$lang['application_Minutes'] = "minutes";
$lang['application_Minute'] = "minute";
$lang['application_ago'] = "plus tôt";
$lang['application_and'] = "et";
$lang['application_myprofile'] = "Mon profil";
$lang['application_help'] = "Aide";
$lang['application_logout'] = "Déconnexion";
$lang['application_INBOX'] = "Boîte de réception";
$lang['application_Marked'] = "Marqué";
$lang['application_Deleted'] = "Supprimé";
$lang['application_calculate_progress'] = "Calculer la progression dans la tâche";
$lang['application_activities'] = "Activités";
$lang['application_new_media_subject'] = "Le fichier a été ajouté";
$lang['application_new_media_file_was_added'] = "Un nouveau fichier a été ajouté au projet :";
$lang['application_uploaded'] = "Transmis";
$lang['application_priority'] = "Priorité";
$lang['application_no_priority'] = "Aucune priorité";
$lang['application_low_priority'] = "Faible";
$lang['application_med_priority'] = "Moyenne";
$lang['application_high_priority'] = "Haute";
$lang['application_comments'] = "Commentaires";
$lang['application_project_created'] = "Projet créé";
$lang['application_project_has_been_created'] = "Le projet a été créé.";
$lang['application_new_comment'] = "Nouveau commentaire";
$lang['application_in_my_queue'] = "dans ma file d'attente";
$lang['application_assigned_to_me'] = "à traiter";
$lang['application_due_this_month'] = "attendues ce mois";
$lang['application_paid_this_month'] = "payées ce mois";
$lang['application_no_invoices_yet'] = "Il n'y a pas encore de factures !";
$lang['application_no_projects_yet'] = "Il n'y a pas encore de projets !";
$lang['application_province'] = "Département";
$lang['application_vat'] = "Numéro de TVA";
$lang['application_custom_tax'] = "Taxe personnalisée en % <small>(Laisser vide pour utiliser la TVA par défaut)</small>";
$lang['application_payments_closed'] = "Les paiements validés";
$lang['application_profile'] = "Profil";
$lang['application_assigned'] = "Mes tickets";
$lang['application_bulk_actions'] = "Actions multiples";
$lang['application_go_to_project'] = "Aller au projet";
$lang['application_ticket_number'] = "Nombre de tickets";
$lang['application_reply_back'] = "Répondre";
$lang['application_due'] = "attendu";
$lang['application_type_form_name_here'] = "Taper le nom du formulaire ici";
$lang['application_ticket_status_reopen'] = "Rouvrir";
$lang['application_media_uploaded'] = "Fichier transmis";
$lang['application_pay_with_credit_card'] = "Payer par carte de crédit";
$lang['application_update_available'] = "Mise à jour disponible";

$lang['application_timer_set'] = "Définir le compteur";
$lang['application_you_can_pay_with'] = "Vous pouvez payer avec";
$lang['application_card_number'] = "Numéro de la carte";
$lang['application_enter_without_spaces'] = "Entrez le numéro sans espaces ni tirets.";
$lang['application_expiration'] = "Expiration";
$lang['application_mark'] = "Marquer";
$lang['application_unmark'] = "Enlever";
$lang['application_started_on'] = "commencé le";
$lang['application_stripe'] = "Stripe";
$lang['application_stripe_active'] = "Activer Stripe";
$lang['application_stripe_public_key'] = "Clé publique Stripe";
$lang['application_stripe_private_key'] = "Clé privée Stripe";
$lang['application_credit_card'] = "Carte de crédit";
$lang['application_bank_transfer'] = "Virement bancaire";
$lang['application_bank_transfer_active'] = "Virement bancaire actif";
$lang['application_bank_transfer_details'] = "Détails du virement bancaire";

$lang['application_estimates'] = "estimations";
$lang['application_estimate'] = "Estimation";
$lang['application_cestimates'] = "estimations";
$lang['application_create_estimate'] = "Nouveau estimation";
$lang['application_estimate_details'] = "Estimation Détails";
$lang['application_estimate_id'] = "référence";
$lang['application_edit_estimate'] = "Modifier estimation";
$lang['application_send_estimate_to_client'] = "Envoyer estimation au client";
$lang['application_convert_to_invoice'] = "Convertir à facturer";
$lang['application_Invoiced'] = "Facturé";
$lang['application_invoiced'] = "facturé";
$lang['application_accepted'] = "Accepté";
$lang['application_Declined'] = "Refusé";
$lang['application_Revised'] = "révisée";
$lang['application_expenses'] = "Dépenses";
$lang['application_expense'] = "Dépenses";
$lang['application_create_expense'] = "nouvelle dépense";
$lang['application_expense_details'] = "Détails des dépenses";
$lang['application_expense_id'] = "référence";
$lang['application_edit_expense'] = "Modifier des dépenses";
$lang['application_payment'] = "paiement";
$lang['application_refund'] = "Remboursement";
$lang['application_linked_to_project'] = "Lié au projet";
$lang['application_rebill'] = "REPRELEVEMENT";
$lang['application_receipt_reference'] = "Réception de référence";
$lang['application_attachment_description'] = "Description de l'attachement";
$lang['application_tax_included'] = "TTC";
$lang['application_id'] = "ID";
$lang['application_HTML_Preview'] = "Aperçu HTML";
$lang['application_this_month'] = "Ce mois-ci";
$lang['application_show_expenses_from_agent'] = "En Agent";
$lang['application_owed_this_month'] = "Devait ce mois-ci";
$lang['application_owed_in'] = "dû en";
$lang['application_balance'] = "Balance";
$lang['application_rebilled_on_invoice'] = "refacturées sur facture";
$lang['application_created_by'] = "Créé par";
$lang['application_in'] = "In";
$lang['application_go_to_invoice'] = "Aller à la facture";
$lang['application_estimate_prefix'] = "Estimation Référence préfixe";
$lang['application_accept'] = "Accepter";
$lang['application_decline'] = "Refuser";
$lang['application_payment_date'] = "date de paiement";
$lang['application_estimate_email_template'] = "Estimation Email";
$lang['application_reason'] = "Raison";
$lang['application_Seconds'] = "secondes";
$lang['application_pay_invoice'] = "Paiement de facture";

$lang['application_money_format'] = "Format de l'argent";
$lang['application_currency_position'] = "position de change";
$lang['application_Overdue'] = "retard";
$lang['application_second_tax'] = "Deuxième impôt";
$lang['application_pdf_templates'] = "Templates PDF";
$lang['application_pdf_settings'] = "Paramètres PDF";
$lang['application_invoice_template'] = "Modèle de facture";
$lang['application_estimate_template'] = "Modèle estimation";
$lang['application_activate'] = "Activer";
$lang['application_in_use'] = "En utilisation";
$lang['application_pdf_path'] = "Utiliser le chemin absolut pour les images <small> (Désactivez cette option si l'image du logo ne figure pas sur PDF généré) </ small>";
$lang['application_pdf_font'] = "PDF police";
$lang['application_clients_can_register'] = "page d'inscription Activer";
$lang['application_you_dont_have_an_account'] = "Vous ne possède pas de compte?";
$lang['application_create_account'] = "Créer un compte";
$lang['application_enter_your_details_to_create_an_account'] = "Entrez vos informations dans le but de créer un compte.";
$lang['application_new_client_has_registered'] = "Nouveau client a créé un compte";
$lang['application_your_account_has_been_created'] = "Votre compte a été créé";
$lang['application_create_account_email_template'] = "Créer un compte";

$lang['application_api_login_id'] = "API ID de connexion";
$lang['application_api_transaction_key'] = "API Transaction ID";
$lang['application_authorize_active'] = "Activer Authorize.net";
$lang['application_your_credit_card_will_be_charged_for'] = "Votre carte de crédit sera débitée pour";
$lang['application_Canceled'] = "Annulé";
$lang['application_company_prefix'] = "préfixe d'entreprise";
$lang['application_invoice_prefix'] = "Facture préfixe";
$lang['application_project_prefix'] = "Projet préfixe";
$lang['application_quotation_prefix'] = "Devis préfixe";
$lang['application_subscription_prefix'] = "L'abonnement préfixe";
$lang['application_copy_project'] = "Copier le projet";
$lang['application_copy_tasks'] = "tâches de copie";

$lang['application_payment'] = "paiement";
$lang['application_add_payment'] = "Ajouter paiement";
$lang['application_cash'] = "Cash";
$lang['application_PartiallyPaid'] = "partiellement payé";
$lang['application_total_outstanding'] = "Outstanding";
$lang['application_payment_id'] = "ID de paiement";

redpajama_set_name: RedPajamaGithub


text:
#pragma once

#include "editor/commands/elementCommand.h"

namespace qReal {
namespace commands {

/// A base for all commands using concrete edge element instance on some scene
class EdgeElementCommand : public ElementCommand
{
public:
	EdgeElementCommand(const EditorViewScene *scene, const Id &id);
	EdgeElementCommand(const EditorView *view, const Id &id);
	virtual ~EdgeElementCommand();

protected:
	virtual bool reinitElement();

	EdgeElement *mEdge;
};

}
}


text:
using System;
using System.Collections.Generic;

using Microsoft.Ccr.Core;
using Microsoft.Dss.ServiceModel.Dssp;
using Microsoft.Dss.Core.Attributes;
using dssp = Microsoft.Dss.ServiceModel.Dssp;

namespace Microsoft.Robotics.Services.SimpleDashboard
{

    /// <summary>
    /// DSS Contract for SimpleDashboard
    /// </summary>
    static class Contract
    {
        /// <summary>
        /// The DSS Namespace for SimpleDashboard
        /// </summary>
        public const string Identifier = "http://schemas.microsoft.com/robotics/2006/01/simpledashboard.html";
    }

    /// <summary>
    /// The SimpleDashboard Operations Port
    /// </summary>
    class SimpleDashboardOperations : PortSet<DsspDefaultLookup, DsspDefaultDrop, Get, Replace>
    {
    }

    /// <summary>
    /// DSS Get Definition for SimpleDashboard
    /// </summary>
    class Get : Get<dssp.GetRequestType, PortSet<SimpleDashboardState, W3C.Soap.Fault>>
    {
        /// <summary>
        /// Default DSS Get Constructor
        /// </summary>
        public Get()
        {
        }

        /// <summary>
        /// DSS GetRequestType Constructor
        /// </summary>
        /// <param name="body"></param>
        public Get(dssp.GetRequestType body)
            : base(body)
        {
        }

    }

    /// <summary>
    /// DSS Replace Definition for SimpleDashboard
    /// </summary>
    class Replace : Replace<SimpleDashboardState, PortSet<dssp.DefaultReplaceResponseType, W3C.Soap.Fault>>
    {
        /// <summary>
        /// Default DSS Get Constructor
        /// </summary>
        public Replace()
        {
        }

        /// <summary>
        /// DSS SimpleDashboard StateType Constructor
        /// </summary>
        /// <param name="body"></param>
        public Replace(SimpleDashboardState body)
            : base(body)
        {
        }
    }

}


text:
// Copyright (C) 2017 History in Paderborn App - Universität Paderborn
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;
using PaderbornUniversity.SILab.Hip.Mobile.Shared.Helpers;
using PaderbornUniversity.SILab.Hip.Mobile.Shared.ServiceAccessLayer.ContentApiAccesses.Contracts;
using PaderbornUniversity.SILab.Hip.Mobile.Shared.ServiceAccessLayer.ContentApiDtos;

namespace PaderbornUniversity.SILab.Hip.Mobile.Shared.ServiceAccessLayer.ContentApiAccesses
{
    public class ExhibitsApiAccess : IExhibitsApiAccess
    {
        private readonly IContentApiClient contentApiClient;

        public ExhibitsApiAccess(IContentApiClient contentApiClient)
        {
            this.contentApiClient = contentApiClient;
        }

        public async Task<ExhibitsDto> GetExhibits()
        {
            return await GetExhibitsDto(null, null);
        }

        public async Task<ExhibitsDto> GetExhibits(DateTimeOffset timestamp)
        {
            return await GetExhibits(timestamp, null);
        }

        public async Task<ExhibitsDto> GetExhibits(IList<int> includeOnly)
        {
            return await GetExhibitsDto(null, includeOnly);
        }

        public async Task<ExhibitsDto> GetExhibits(DateTimeOffset timestamp, IList<int> includeOnly)
        {
            return await GetExhibitsDto(timestamp, includeOnly);
        }

        private async Task<ExhibitsDto> GetExhibitsDto(DateTimeOffset? timestamp, IList<int> includeOnly)
        {
            string requestPath = @"/Exhibits";
            requestPath += UriQueryBuilder.GetAdditionalParametersQuery(timestamp, includeOnly);

            string json = await contentApiClient.GetResponseFromUrlAsString(requestPath);
            if (json != null)
            {
                return JsonConvert.DeserializeObject<ExhibitsDto>(json);
            }

            return new ExhibitsDto { Items = new List<ExhibitDto>(), Total = 0 };
        }

        public async Task<IList<int>> GetIds()
        {
            string requestPath = @"/Exhibits/ids";
            string json = await contentApiClient.GetResponseFromUrlAsString(requestPath);

            return JsonConvert.DeserializeObject<IList<int>>(json);
        }
    }
}


text:
package https // import "golang.org/x/build/internal/https"

import (
	"context"
	"crypto/ecdsa"
	"crypto/elliptic"
	"crypto/rand"
	"crypto/tls"
	"crypto/x509"
	"crypto/x509/pkix"
	"flag"
	"fmt"
	"math/big"
	"net/http"
	"strings"
	"time"

	"cloud.google.com/go/storage"
	"golang.org/x/build/autocertcache"
	"golang.org/x/crypto/acme/autocert"
)

type Options struct {
	// Specifies the GCS bucket to use with AutocertAddr.
	AutocertBucket string
	// If non-empty, listen on this address and serve HTTPS using a Let's Encrypt cert stored in AutocertBucket.
	AutocertAddr string
	// If non-empty, listen on this address and serve HTTPS using a self-signed cert.
	SelfSignedAddr string
	// If non-empty, listen on this address and serve HTTP.
	HTTPAddr string
}

var DefaultOptions = &Options{}

// RegisterFlags registers flags that control DefaultOptions, which will be
// used with ListenAndServe below.
// Typical usage is to call RegisterFlags at the beginning of main, then
// ListenAndServe at the end.
func RegisterFlags(set *flag.FlagSet) {
	set.StringVar(&DefaultOptions.AutocertBucket, "autocert-bucket", "", "specifies the GCS bucket to use with autocert-addr")
	set.StringVar(&DefaultOptions.AutocertAddr, "listen-https-autocert", "", "if non-empty, listen on this address and serve HTTPS using a Let's Encrypt cert stored in autocert-bucket")
	set.StringVar(&DefaultOptions.SelfSignedAddr, "listen-https-selfsigned", "", "if non-empty, listen on this address and serve HTTPS using a self-signed cert")
	set.StringVar(&DefaultOptions.HTTPAddr, "listen-http", "", "if non-empty, listen on this address and serve HTTP")
}

// ListenAndServe runs the servers configured by DefaultOptions. It always
// returns a non-nil error.
func ListenAndServe(ctx context.Context, handler http.Handler) error {
	return ListenAndServeOpts(ctx, handler, DefaultOptions)
}

// ListenAndServeOpts runs the servers configured by opts. It always
// returns a non-nil error.
func ListenAndServeOpts(ctx context.Context, handler http.Handler, opts *Options) error {
	errc := make(chan error, 3)

	if opts.HTTPAddr != "" {
		server := &http.Server{Addr: opts.HTTPAddr, Handler: handler}
		defer server.Close()
		go func() { errc <- server.ListenAndServe() }()
	}

	if opts.AutocertAddr != "" {
		if opts.AutocertBucket == "" {
			return fmt.Errorf("must specify autocert-bucket with listen-https-autocert")
		}
		server, err := autocertServer(ctx, opts.AutocertBucket, opts.AutocertAddr, handler)
		if err != nil {
			return err
		}
		defer server.Close()
		go func() { errc <- server.ListenAndServeTLS("", "") }()
	}

	if opts.SelfSignedAddr != "" {
		server, err := selfSignedServer(opts.SelfSignedAddr, handler)
		if err != nil {
			return err
		}
		defer server.Close()
		go func() { errc <- server.ListenAndServeTLS("", "") }()
	}

	return <-errc
}

// autocertServer returns an http.Server that is configured to serve
// HTTPS on addr using a Let's Encrypt certificate cached in the GCS
// bucket specified by bucket.
func autocertServer(ctx context.Context, bucket, addr string, handler http.Handler) (*http.Server, error) {
	sc, err := storage.NewClient(ctx)
	if err != nil {
		return nil, fmt.Errorf("storage.NewClient: %v", err)
	}
	const hostSuffix = ".golang.org"
	m := autocert.Manager{
		Prompt: autocert.AcceptTOS,
		HostPolicy: func(ctx context.Context, host string) error {
			if !strings.HasSuffix(host, hostSuffix) {
				return fmt.Errorf("refusing to serve autocert on provided domain (%q), must have the suffix %q",
					host, hostSuffix)
			}
			return nil
		},
		Cache: autocertcache.NewGoogleCloudStorageCache(sc, bucket),
	}
	server := &http.Server{
		Addr:      addr,
		Handler:   handler,
		TLSConfig: m.TLSConfig(),
	}
	return server, nil
}

// selfSignedServer returns an http.Server that is configured to serve
// self-signed HTTPS on addr.
func selfSignedServer(addr string, handler http.Handler) (*http.Server, error) {
	priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
	if err != nil {
		return nil, err
	}

	serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
	serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
	if err != nil {
		return nil, fmt.Errorf("failed to generate serial number: %v", err)
	}
	template := &x509.Certificate{
		SerialNumber: serialNumber,
		Subject: pkix.Name{
			Organization: []string{"Go build system"},
		},
		NotBefore:   time.Now().Add(-time.Minute),
		NotAfter:    time.Now().Add(10 * 365 * 24 * time.Hour),
		KeyUsage:    x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
		ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
		IsCA:        true,
	}

	derBytes, err := x509.CreateCertificate(rand.Reader, template, template, &priv.PublicKey, priv)
	if err != nil {
		return nil, err
	}
	s := &http.Server{
		Addr:    addr,
		Handler: handler,
		TLSConfig: &tls.Config{
			Certificates: []tls.Certificate{{
				Certificate: [][]byte{derBytes},
				PrivateKey:  priv,
			}},
		},
	}
	return s, nil
}


text:
<?php

namespace kartik\file;

/**
 * Sortable asset bundle for FileInput Widget
 *
 * @author Kartik Visweswaran <kartikv2@gmail.com>
 * @since 1.0
 */
class SortableAsset extends BaseAsset
{
    /**
     * @inheritdoc
     */
    public function init()
    {
        $this->setupAssets('js', ['js/plugins/sortable']);
        parent::init();
    }
}


text:
@implementation ALPHANotioColorPalette

+ (instancetype)defaultPalette
{
    ALPHANotioColorPalette *palette = [[ALPHANotioColorPalette alloc] init];
    palette.headerFontFamily = @"GillSans";
    palette.headerFontSize = 14.0;
    palette.contentFontFamily = @"Menlo";
    palette.contentFontSize = 12.0;

    palette.mainColor = UIColorFromKey(@"#E46A6B");
    palette.accentColor = [UIColor whiteColor];
    palette.backgroundColor = UIColorFromKey(@"#EEEEEE");
    palette.contentColor = [UIColor whiteColor];
    palette.contentTintColor = UIColorFromKey(@"#6E6E6E");
    palette.textColor = UIColorFromKey(@"#3F3F3F");

    return palette;
}

@end


text:
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var common_1 = require('@angular/common');
var core_1 = require('@angular/core');
var async_1 = require('../src/facade/async');
var collection_1 = require('../src/facade/collection');
var exceptions_1 = require('../src/facade/exceptions');
var lang_1 = require('../src/facade/lang');
var instruction_1 = require('./instruction');
var route_lifecycle_reflector_1 = require('./lifecycle/route_lifecycle_reflector');
var route_registry_1 = require('./route_registry');
var _resolveToTrue = async_1.PromiseWrapper.resolve(true);
var _resolveToFalse = async_1.PromiseWrapper.resolve(false);
/**
 * The `Router` is responsible for mapping URLs to components.
 *
 * You can see the state of the router by inspecting the read-only field `router.navigating`.
 * This may be useful for showing a spinner, for instance.
 *
 * ## Concepts
 *
 * Routers and component instances have a 1:1 correspondence.
 *
 * The router holds reference to a number of {@link RouterOutlet}.
 * An outlet is a placeholder that the router dynamically fills in depending on the current URL.
 *
 * When the router navigates from a URL, it must first recognize it and serialize it into an
 * `Instruction`.
 * The router uses the `RouteRegistry` to get an `Instruction`.
 */
var Router = (function () {
    function Router(registry, parent, hostComponent, root) {
        this.registry = registry;
        this.parent = parent;
        this.hostComponent = hostComponent;
        this.root = root;
        this.navigating = false;
        /**
         * The current `Instruction` for the router
         */
        this.currentInstruction = null;
        this._currentNavigation = _resolveToTrue;
        this._outlet = null;
        this._auxRouters = new collection_1.Map();
        this._subject = new async_1.EventEmitter();
    }
    /**
     * Constructs a child router. You probably don't need to use this unless you're writing a reusable
     * component.
     */
    Router.prototype.childRouter = function (hostComponent) {
        return this._childRouter = new ChildRouter(this, hostComponent);
    };
    /**
     * Constructs a child router. You probably don't need to use this unless you're writing a reusable
     * component.
     */
    Router.prototype.auxRouter = function (hostComponent) { return new ChildRouter(this, hostComponent); };
    /**
     * Register an outlet to be notified of primary route changes.
     *
     * You probably don't need to use this unless you're writing a reusable component.
     */
    Router.prototype.registerPrimaryOutlet = function (outlet) {
        if (lang_1.isPresent(outlet.name)) {
            throw new exceptions_1.BaseException("registerPrimaryOutlet expects to be called with an unnamed outlet.");
        }
        if (lang_1.isPresent(this._outlet)) {
            throw new exceptions_1.BaseException("Primary outlet is already registered.");
        }
        this._outlet = outlet;
        if (lang_1.isPresent(this.currentInstruction)) {
            return this.commit(this.currentInstruction, false);
        }
        return _resolveToTrue;
    };
    /**
     * Unregister an outlet (because it was destroyed, etc).
     *
     * You probably don't need to use this unless you're writing a custom outlet implementation.
     */
    Router.prototype.unregisterPrimaryOutlet = function (outlet) {
        if (lang_1.isPresent(outlet.name)) {
            throw new exceptions_1.BaseException("registerPrimaryOutlet expects to be called with an unnamed outlet.");
        }
        this._outlet = null;
    };
    /**
     * Register an outlet to notified of auxiliary route changes.
     *
     * You probably don't need to use this unless you're writing a reusable component.
     */
    Router.prototype.registerAuxOutlet = function (outlet) {
        var outletName = outlet.name;
        if (lang_1.isBlank(outletName)) {
            throw new exceptions_1.BaseException("registerAuxOutlet expects to be called with an outlet with a name.");
        }
        var router = this.auxRouter(this.hostComponent);
        this._auxRouters.set(outletName, router);
        router._outlet = outlet;
        var auxInstruction;
        if (lang_1.isPresent(this.currentInstruction) &&
            lang_1.isPresent(auxInstruction = this.currentInstruction.auxInstruction[outletName])) {
            return router.commit(auxInstruction);
        }
        return _resolveToTrue;
    };
    /**
     * Given an instruction, returns `true` if the instruction is currently active,
     * otherwise `false`.
     */
    Router.prototype.isRouteActive = function (instruction) {
        var router = this;
        var currentInstruction = this.currentInstruction;
        if (lang_1.isBlank(currentInstruction)) {
            return false;
        }
        // `instruction` corresponds to the root router
        while (lang_1.isPresent(router.parent) && lang_1.isPresent(instruction.child)) {
            router = router.parent;
            instruction = instruction.child;
        }
        var reason = true;
        // check the instructions in depth
        do {
            if (lang_1.isBlank(instruction.component) || lang_1.isBlank(currentInstruction.component) ||
                currentInstruction.component.routeName != instruction.component.routeName) {
                return false;
            }
            if (lang_1.isPresent(instruction.component.params)) {
                collection_1.StringMapWrapper.forEach(instruction.component.params, function (value /** TODO #9100 */, key /** TODO #9100 */) {
                    if (currentInstruction.component.params[key] !== value) {
                        reason = false;
                    }
                });
            }
            currentInstruction = currentInstruction.child;
            instruction = instruction.child;
        } while (lang_1.isPresent(currentInstruction) && lang_1.isPresent(instruction) &&
            !(instruction instanceof instruction_1.DefaultInstruction) && reason);
        // ignore DefaultInstruction
        return reason && (lang_1.isBlank(instruction) || instruction instanceof instruction_1.DefaultInstruction);
    };
    /**
     * Dynamically update the routing configuration and trigger a navigation.
     *
     * ### Usage
     *
     * ```
     * router.config([
     *   { 'path': '/', 'component': IndexComp },
     *   { 'path': '/user/:id', 'component': UserComp },
     * ]);
     * ```
     */
    Router.prototype.config = function (definitions) {
        var _this = this;
        definitions.forEach(function (routeDefinition) { _this.registry.config(_this.hostComponent, routeDefinition); });
        return this.renavigate();
    };
    /**
     * Navigate based on the provided Route Link DSL. It's preferred to navigate with this method
     * over `navigateByUrl`.
     *
     * ### Usage
     *
     * This method takes an array representing the Route Link DSL:
     * ```
     * ['./MyCmp', {param: 3}]
     * ```
     * See the {@link RouterLink} directive for more.
     */
    Router.prototype.navigate = function (linkParams) {
        var instruction = this.generate(linkParams);
        return this.navigateByInstruction(instruction, false);
    };
    /**
     * Navigate to a URL. Returns a promise that resolves when navigation is complete.
     * It's preferred to navigate with `navigate` instead of this method, since URLs are more brittle.
     *
     * If the given URL begins with a `/`, router will navigate absolutely.
     * If the given URL does not begin with `/`, the router will navigate relative to this component.
     */
    Router.prototype.navigateByUrl = function (url, _skipLocationChange) {
        var _this = this;
        if (_skipLocationChange === void 0) { _skipLocationChange = false; }
        return this._currentNavigation = this._currentNavigation.then(function (_) {
            _this.lastNavigationAttempt = url;
            _this._startNavigating();
            return _this._afterPromiseFinishNavigating(_this.recognize(url).then(function (instruction) {
                if (lang_1.isBlank(instruction)) {
                    return false;
                }
                return _this._navigate(instruction, _skipLocationChange);
            }));
        });
    };
    /**
     * Navigate via the provided instruction. Returns a promise that resolves when navigation is
     * complete.
     */
    Router.prototype.navigateByInstruction = function (instruction, _skipLocationChange) {
        var _this = this;
        if (_skipLocationChange === void 0) { _skipLocationChange = false; }
        if (lang_1.isBlank(instruction)) {
            return _resolveToFalse;
        }
        return this._currentNavigation = this._currentNavigation.then(function (_) {
            _this._startNavigating();
            return _this._afterPromiseFinishNavigating(_this._navigate(instruction, _skipLocationChange));
        });
    };
    /** @internal */
    Router.prototype._settleInstruction = function (instruction) {
        var _this = this;
        return instruction.resolveComponent().then(function (_) {
            var unsettledInstructions = [];
            if (lang_1.isPresent(instruction.component)) {
                instruction.component.reuse = false;
            }
            if (lang_1.isPresent(instruction.child)) {
                unsettledInstructions.push(_this._settleInstruction(instruction.child));
            }
            collection_1.StringMapWrapper.forEach(instruction.auxInstruction, function (instruction, _ /** TODO #9100 */) {
                unsettledInstructions.push(_this._settleInstruction(instruction));
            });
            return async_1.PromiseWrapper.all(unsettledInstructions);
        });
    };
    /** @internal */
    Router.prototype._navigate = function (instruction, _skipLocationChange) {
        var _this = this;
        return this._settleInstruction(instruction)
            .then(function (_) { return _this._routerCanReuse(instruction); })
            .then(function (_) { return _this._canActivate(instruction); })
            .then(function (result) {
            if (!result) {
                return false;
            }
            return _this._routerCanDeactivate(instruction).then(function (result) {
                if (result) {
                    return _this.commit(instruction, _skipLocationChange).then(function (_) {
                        _this._emitNavigationFinish(instruction.component);
                        return true;
                    });
                }
            });
        });
    };
    Router.prototype._emitNavigationFinish = function (instruction) {
        async_1.ObservableWrapper.callEmit(this._subject, { status: 'success', instruction: instruction });
    };
    /** @internal */
    Router.prototype._emitNavigationFail = function (url) {
        async_1.ObservableWrapper.callEmit(this._subject, { status: 'fail', url: url });
    };
    Router.prototype._afterPromiseFinishNavigating = function (promise) {
        var _this = this;
        return async_1.PromiseWrapper.catchError(promise.then(function (_) { return _this._finishNavigating(); }), function (err) {
            _this._finishNavigating();
            throw err;
        });
    };
    /*
     * Recursively set reuse flags
     */
    /** @internal */
    Router.prototype._routerCanReuse = function (instruction) {
        var _this = this;
        if (lang_1.isBlank(this._outlet)) {
            return _resolveToFalse;
        }
        if (lang_1.isBlank(instruction.component)) {
            return _resolveToTrue;
        }
        return this._outlet.routerCanReuse(instruction.component).then(function (result) {
            instruction.component.reuse = result;
            if (result && lang_1.isPresent(_this._childRouter) && lang_1.isPresent(instruction.child)) {
                return _this._childRouter._routerCanReuse(instruction.child);
            }
        });
    };
    Router.prototype._canActivate = function (nextInstruction) {
        return canActivateOne(nextInstruction, this.currentInstruction);
    };
    Router.prototype._routerCanDeactivate = function (instruction) {
        var _this = this;
        if (lang_1.isBlank(this._outlet)) {
            return _resolveToTrue;
        }
        var next;
        var childInstruction = null;
        var reuse = false;
        var componentInstruction = null;
        if (lang_1.isPresent(instruction)) {
            childInstruction = instruction.child;
            componentInstruction = instruction.component;
            reuse = lang_1.isBlank(instruction.component) || instruction.component.reuse;
        }
        if (reuse) {
            next = _resolveToTrue;
        }
        else {
            next = this._outlet.routerCanDeactivate(componentInstruction);
        }
        // TODO: aux route lifecycle hooks
        return next.then(function (result) {
            if (result == false) {
                return false;
            }
            if (lang_1.isPresent(_this._childRouter)) {
                // TODO: ideally, this closure would map to async-await in Dart.
                // For now, casting to any to suppress an error.
                return _this._childRouter._routerCanDeactivate(childInstruction);
            }
            return true;
        });
    };
    /**
     * Updates this router and all descendant routers according to the given instruction
     */
    Router.prototype.commit = function (instruction, _skipLocationChange) {
        var _this = this;
        if (_skipLocationChange === void 0) { _skipLocationChange = false; }
        this.currentInstruction = instruction;
        var next = _resolveToTrue;
        if (lang_1.isPresent(this._outlet) && lang_1.isPresent(instruction.component)) {
            var componentInstruction = instruction.component;
            if (componentInstruction.reuse) {
                next = this._outlet.reuse(componentInstruction);
            }
            else {
                next =
                    this.deactivate(instruction).then(function (_) { return _this._outlet.activate(componentInstruction); });
            }
            if (lang_1.isPresent(instruction.child)) {
                next = next.then(function (_) {
                    if (lang_1.isPresent(_this._childRouter)) {
                        return _this._childRouter.commit(instruction.child);
                    }
                });
            }
        }
        var promises = [];
        this._auxRouters.forEach(function (router, name) {
            if (lang_1.isPresent(instruction.auxInstruction[name])) {
                promises.push(router.commit(instruction.auxInstruction[name]));
            }
        });
        return next.then(function (_) { return async_1.PromiseWrapper.all(promises); });
    };
    /** @internal */
    Router.prototype._startNavigating = function () { this.navigating = true; };
    /** @internal */
    Router.prototype._finishNavigating = function () { this.navigating = false; };
    /**
     * Subscribe to URL updates from the router
     */
    Router.prototype.subscribe = function (onNext, onError) {
        return async_1.ObservableWrapper.subscribe(this._subject, onNext, onError);
    };
    /**
     * Removes the contents of this router's outlet and all descendant outlets
     */
    Router.prototype.deactivate = function (instruction) {
        var _this = this;
        var childInstruction = null;
        var componentInstruction = null;
        if (lang_1.isPresent(instruction)) {
            childInstruction = instruction.child;
            componentInstruction = instruction.component;
        }
        var next = _resolveToTrue;
        if (lang_1.isPresent(this._childRouter)) {
            next = this._childRouter.deactivate(childInstruction);
        }
        if (lang_1.isPresent(this._outlet)) {
            next = next.then(function (_) { return _this._outlet.deactivate(componentInstruction); });
        }
        // TODO: handle aux routes
        return next;
    };
    /**
     * Given a URL, returns an instruction representing the component graph
     */
    Router.prototype.recognize = function (url) {
        var ancestorComponents = this._getAncestorInstructions();
        return this.registry.recognize(url, ancestorComponents);
    };
    Router.prototype._getAncestorInstructions = function () {
        var ancestorInstructions = [this.currentInstruction];
        var ancestorRouter = this;
        while (lang_1.isPresent(ancestorRouter = ancestorRouter.parent)) {
            ancestorInstructions.unshift(ancestorRouter.currentInstruction);
        }
        return ancestorInstructions;
    };
    /**
     * Navigates to either the last URL successfully navigated to, or the last URL requested if the
     * router has yet to successfully navigate.
     */
    Router.prototype.renavigate = function () {
        if (lang_1.isBlank(this.lastNavigationAttempt)) {
            return this._currentNavigation;
        }
        return this.navigateByUrl(this.lastNavigationAttempt);
    };
    /**
     * Generate an `Instruction` based on the provided Route Link DSL.
     */
    Router.prototype.generate = function (linkParams) {
        var ancestorInstructions = this._getAncestorInstructions();
        return this.registry.generate(linkParams, ancestorInstructions);
    };
    Router = __decorate([
        core_1.Injectable(),
        __metadata('design:paramtypes', [route_registry_1.RouteRegistry, Router, Object, Router])
    ], Router);
    return Router;
}());
exports.Router = Router;
var RootRouter = (function (_super) {
    __extends(RootRouter, _super);
    function RootRouter(registry, location, primaryComponent) {
        var _this = this;
        _super.call(this, registry, null, primaryComponent);
        this.root = this;
        this._location = location;
        this._locationSub = this._location.subscribe(function (change) {
            // we call recognize ourselves
            _this.recognize(change['url']).then(function (instruction) {
                if (lang_1.isPresent(instruction)) {
                    _this.navigateByInstruction(instruction, lang_1.isPresent(change['pop'])).then(function (_) {
                        // this is a popstate event; no need to change the URL
                        if (lang_1.isPresent(change['pop']) && change['type'] != 'hashchange') {
                            return;
                        }
                        var emitPath = instruction.toUrlPath();
                        var emitQuery = instruction.toUrlQuery();
                        if (emitPath.length > 0 && emitPath[0] != '/') {
                            emitPath = '/' + emitPath;
                        }
                        // We've opted to use pushstate and popState APIs regardless of whether you
                        // an app uses HashLocationStrategy or PathLocationStrategy.
                        // However, apps that are migrating might have hash links that operate outside
                        // angular to which routing must respond.
                        // Therefore we know that all hashchange events occur outside Angular.
                        // To support these cases where we respond to hashchanges and redirect as a
                        // result, we need to replace the top item on the stack.
                        if (change['type'] == 'hashchange') {
                            if (instruction.toRootUrl() != _this._location.path()) {
                                _this._location.replaceState(emitPath, emitQuery);
                            }
                        }
                        else {
                            _this._location.go(emitPath, emitQuery);
                        }
                    });
                }
                else {
                    _this._emitNavigationFail(change['url']);
                }
            });
        });
        this.registry.configFromComponent(primaryComponent);
        this.navigateByUrl(location.path());
    }
    RootRouter.prototype.commit = function (instruction, _skipLocationChange) {
        var _this = this;
        if (_skipLocationChange === void 0) { _skipLocationChange = false; }
        var emitPath = instruction.toUrlPath();
        var emitQuery = instruction.toUrlQuery();
        if (emitPath.length > 0 && emitPath[0] != '/') {
            emitPath = '/' + emitPath;
        }
        var promise = _super.prototype.commit.call(this, instruction);
        if (!_skipLocationChange) {
            if (this._location.isCurrentPathEqualTo(emitPath, emitQuery)) {
                promise = promise.then(function (_) { _this._location.replaceState(emitPath, emitQuery); });
            }
            else {
                promise = promise.then(function (_) { _this._location.go(emitPath, emitQuery); });
            }
        }
        return promise;
    };
    RootRouter.prototype.dispose = function () {
        if (lang_1.isPresent(this._locationSub)) {
            async_1.ObservableWrapper.dispose(this._locationSub);
            this._locationSub = null;
        }
    };
    RootRouter = __decorate([
        core_1.Injectable(),
        __param(2, core_1.Inject(route_registry_1.ROUTER_PRIMARY_COMPONENT)),
        __metadata('design:paramtypes', [route_registry_1.RouteRegistry, common_1.Location, lang_1.Type])
    ], RootRouter);
    return RootRouter;
}(Router));
exports.RootRouter = RootRouter;
var ChildRouter = (function (_super) {
    __extends(ChildRouter, _super);
    function ChildRouter(parent, hostComponent /** TODO #9100 */) {
        _super.call(this, parent.registry, parent, hostComponent, parent.root);
        this.parent = parent;
    }
    ChildRouter.prototype.navigateByUrl = function (url, _skipLocationChange) {
        if (_skipLocationChange === void 0) { _skipLocationChange = false; }
        // Delegate navigation to the root router
        return this.parent.navigateByUrl(url, _skipLocationChange);
    };
    ChildRouter.prototype.navigateByInstruction = function (instruction, _skipLocationChange) {
        if (_skipLocationChange === void 0) { _skipLocationChange = false; }
        // Delegate navigation to the root router
        return this.parent.navigateByInstruction(instruction, _skipLocationChange);
    };
    return ChildRouter;
}(Router));
function canActivateOne(nextInstruction, prevInstruction) {
    var next = _resolveToTrue;
    if (lang_1.isBlank(nextInstruction.component)) {
        return next;
    }
    if (lang_1.isPresent(nextInstruction.child)) {
        next = canActivateOne(nextInstruction.child, lang_1.isPresent(prevInstruction) ? prevInstruction.child : null);
    }
    return next.then(function (result) {
        if (result == false) {
            return false;
        }
        if (nextInstruction.component.reuse) {
            return true;
        }
        var hook = route_lifecycle_reflector_1.getCanActivateHook(nextInstruction.component.componentType);
        if (lang_1.isPresent(hook)) {
            return hook(nextInstruction.component, lang_1.isPresent(prevInstruction) ? prevInstruction.component : null);
        }
        return true;
    });
}
//# sourceMappingURL=router.js.map


text:
<?php

require __DIR__ . '/_init.php';

require_once(VENDOR_DIR . '/yiisoft/yii2/Yii.php');

$_SERVER['SCRIPT_FILENAME'] = YII_TEST_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = YII_TEST_ENTRY_URL;
$_SERVER['SERVER_NAME'] = 'localhost';

Yii::setAlias('@tests', dirname(__DIR__));
Yii::setAlias('@tests/app', '@tests/codeception/_app');
Yii::setAlias('@tests/codeception/config', '@tests/codeception/_config');
Yii::setAlias('@yii/debug', VENDOR_DIR . '/yiisoft/yii2-debug'); // needed for hhvm


text:
package com.intellij.structuralsearch;

import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
import com.intellij.psi.javadoc.PsiDocComment;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
import com.intellij.structuralsearch.impl.matcher.GlobalMatchingVisitor;
import com.intellij.structuralsearch.impl.matcher.MatcherImplUtil;
import com.intellij.structuralsearch.impl.matcher.PatternTreeContext;
import com.intellij.structuralsearch.plugin.replace.ReplaceOptions;
import com.intellij.structuralsearch.plugin.replace.ReplacementInfo;
import com.intellij.structuralsearch.plugin.replace.impl.ReplacementContext;
import com.intellij.structuralsearch.plugin.replace.impl.Replacer;
import com.intellij.structuralsearch.plugin.replace.impl.ReplacerUtil;
import com.intellij.util.IncorrectOperationException;
import com.siyeh.ig.psiutils.ImportUtils;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Eugene.Kudelevsky
 */
public class JavaReplaceHandler extends StructuralReplaceHandler {
  private final ReplacementContext myContext;
  private PsiCodeBlock codeBlock;

  public JavaReplaceHandler(ReplacementContext context) {
    this.myContext = context;
  }

  private PsiCodeBlock getCodeBlock() throws IncorrectOperationException {
    if (codeBlock == null) {
      codeBlock = (PsiCodeBlock)MatcherImplUtil.createTreeFromText(
        myContext.getOptions().getMatchOptions().getSearchPattern(),
        PatternTreeContext.Block,
        myContext.getOptions().getMatchOptions().getFileType(),
        myContext.getProject()
      )[0].getParent();
    }
    return codeBlock;
  }

  private static PsiElement findRealSubstitutionElement(PsiElement el) {
    if (el instanceof PsiIdentifier) {
      // matches are tokens, identifiers, etc
      el = el.getParent();
    }

    if (el instanceof PsiReferenceExpression &&
        el.getParent() instanceof PsiMethodCallExpression
      ) {
      // method
      el = el.getParent();
    }

    if (el instanceof PsiDeclarationStatement && ((PsiDeclarationStatement)el).getDeclaredElements()[0] instanceof PsiClass) {
      el = ((PsiDeclarationStatement)el).getDeclaredElements()[0];
    }
    return el;
  }

  private static boolean isListContext(PsiElement el) {
    final PsiElement parent = el.getParent();

    return parent instanceof PsiParameterList ||
           parent instanceof PsiExpressionList ||
           parent instanceof PsiCodeBlock ||
           parent instanceof PsiClass ||
           parent instanceof PsiIfStatement && (((PsiIfStatement)parent).getThenBranch() == el ||
                                                ((PsiIfStatement)parent).getElseBranch() == el) ||
           parent instanceof PsiLoopStatement && ((PsiLoopStatement)parent).getBody() == el;
  }

  @Nullable
  private PsiNamedElement getSymbolReplacementTarget(final PsiElement el)
    throws IncorrectOperationException {
    if (myContext.getOptions().getMatchOptions().getFileType() != StdFileTypes.JAVA) return null; //?
    final PsiStatement[] searchStatements = getCodeBlock().getStatements();
    if (searchStatements.length > 0 &&
        searchStatements[0] instanceof PsiExpressionStatement) {
      final PsiExpression expression = ((PsiExpressionStatement)searchStatements[0]).getExpression();

      if (expression instanceof PsiReferenceExpression &&
          ((PsiReferenceExpression)expression).getQualifierExpression() == null
        ) {
        // looks like symbol replacements, namely replace AAA by BBB, so lets do the best
        if (el instanceof PsiNamedElement) {
          return (PsiNamedElement)el;
        }
      }
    }

    return null;
  }

  private static PsiElement getMatchExpr(PsiElement replacement, PsiElement elementToReplace) {
    if (replacement instanceof PsiExpressionStatement &&
        !(replacement.getLastChild() instanceof PsiJavaToken) &&
        !(replacement.getLastChild() instanceof PsiComment)
      ) {
      // replacement is expression (and pattern should be so)
      // assert ...
      replacement = ((PsiExpressionStatement)replacement).getExpression();
    }
    else if (replacement instanceof PsiDeclarationStatement &&
             ((PsiDeclarationStatement)replacement).getDeclaredElements().length == 1 &&
             (elementToReplace instanceof PsiVariable || elementToReplace instanceof PsiClass)) {
      return ((PsiDeclarationStatement)replacement).getDeclaredElements()[0];
    }
    else if (replacement instanceof PsiBlockStatement && elementToReplace instanceof PsiCodeBlock) {
      return ((PsiBlockStatement)replacement).getCodeBlock();
    }

    return replacement;
  }

  private boolean isSymbolReplacement(final PsiElement el) throws IncorrectOperationException {
    return getSymbolReplacementTarget(el) != null;
  }

  /**
   * Copy all comments, doc comments, modifier lists and method bodies
   * that are present in matched nodes but not present in searched & replaced nodes
   */
  private void copyUnmatchedElements(final PsiElement original, final PsiElement replacement) {

    Map<String, String> newNameToSearchPatternNameMap = myContext.getNewName2PatternNameMap();

    Map<String, PsiNamedElement> originalNamedElements = Collector.collectNamedElements(original);
    Map<String, PsiNamedElement> replacedNamedElements = Collector.collectNamedElements(replacement);

    if (originalNamedElements.size() == 0 && replacedNamedElements.size() == 0) {
      Replacer.handleComments(original, replacement, myContext);
      return;
    }

    Map<String, PsiNamedElement> searchedNamedElements = Collector.collectNamedElements(getCodeBlock());

    for (String name : originalNamedElements.keySet()) {
      PsiNamedElement originalNamedElement = originalNamedElements.get(name);
      PsiNamedElement replacementNamedElement = replacedNamedElements.get(name);
      String key = newNameToSearchPatternNameMap.get(name);
      if (key == null) key = name;
      PsiNamedElement searchedNamedElement = searchedNamedElements.get(key);

      if (replacementNamedElement == null && originalNamedElements.size() == 1 && replacedNamedElements.size() == 1) {
        replacementNamedElement = replacedNamedElements.entrySet().iterator().next().getValue();
      }

      PsiElement comment = null;

      if (originalNamedElement instanceof PsiDocCommentOwner) {
        comment = ((PsiDocCommentOwner)originalNamedElement).getDocComment();
        if (comment == null) {
          PsiElement prevElement = originalNamedElement.getPrevSibling();
          if (prevElement instanceof PsiWhiteSpace) {
            prevElement = prevElement.getPrevSibling();
          }
          if (prevElement instanceof PsiComment) {
            comment = prevElement;
          }
        }
      }

      if (replacementNamedElement != null && searchedNamedElement != null) {
        Replacer.handleComments(originalNamedElement, replacementNamedElement, myContext);
      }

      if (comment != null && replacementNamedElement instanceof PsiDocCommentOwner &&
          !(replacementNamedElement.getFirstChild() instanceof PsiDocComment)
        ) {
        final PsiElement nextSibling = comment.getNextSibling();
        PsiElement prevSibling = comment.getPrevSibling();
        replacementNamedElement.addRangeBefore(
          prevSibling instanceof PsiWhiteSpace ? prevSibling : comment,
          nextSibling instanceof PsiWhiteSpace ? nextSibling : comment,
          replacementNamedElement.getFirstChild()
        );
      }

      if (originalNamedElement instanceof PsiModifierListOwner &&
          replacementNamedElement instanceof PsiModifierListOwner
        ) {
        PsiModifierList modifierList = ((PsiModifierListOwner)originalNamedElements.get(name)).getModifierList();

        if (searchedNamedElement instanceof PsiModifierListOwner) {
          PsiModifierList modifierListOfSearchedElement = ((PsiModifierListOwner)searchedNamedElement).getModifierList();
          final PsiModifierListOwner modifierListOwner = ((PsiModifierListOwner)replacementNamedElement);
          PsiModifierList modifierListOfReplacement = modifierListOwner.getModifierList();

          if (modifierListOfSearchedElement.getTextLength() == 0 &&
              modifierListOfReplacement.getTextLength() == 0 &&
              modifierList.getTextLength() > 0) {
            modifierListOfReplacement.replace(modifierList);
          } else if (modifierListOfSearchedElement.getTextLength() == 0 && modifierList.getTextLength() > 0) {
            final PsiModifierList copy = (PsiModifierList)modifierList.copy();
            for (String modifier : PsiModifier.MODIFIERS) {
              if (modifierListOfReplacement.hasExplicitModifier(modifier)) {
                copy.setModifierProperty(modifier, true);
              }
            }
            final PsiElement anchor = copy.getFirstChild();
            for (PsiAnnotation annotation : modifierListOfReplacement.getAnnotations()) {
              copy.addBefore(annotation, anchor);
            }
            modifierListOfReplacement.replace(copy);
          }
        }
      }

      if (originalNamedElement instanceof PsiMethod &&
          searchedNamedElement instanceof PsiMethod &&
          replacementNamedElement instanceof PsiMethod) {
        final PsiMethod searchedMethod = (PsiMethod)searchedNamedElement;
        final PsiMethod replacementMethod = (PsiMethod)replacementNamedElement;
        if (searchedMethod.getBody() == null && replacementMethod.getBody() == null) {
          final PsiMethod originalMethod = (PsiMethod)originalNamedElement;
          final PsiCodeBlock originalBody = originalMethod.getBody();
          if (originalBody != null) {
            replacementMethod.add(originalBody);
          }
        }
      }
    }
  }

  private PsiElement handleSymbolReplacement(PsiElement replacement, final PsiElement el) throws IncorrectOperationException {
    PsiNamedElement nameElement = getSymbolReplacementTarget(el);
    if (nameElement != null) {
      PsiElement oldReplacement = replacement;
      replacement = el.copy();
      ((PsiNamedElement)replacement).setName(oldReplacement.getText());
    }

    return replacement;
  }

  public void replace(final ReplacementInfo info, ReplaceOptions options) {
    PsiElement elementToReplace = info.getMatch(0);
    if (elementToReplace == null) {
      return;
    }
    elementToReplace = findRealSubstitutionElement(elementToReplace);
    final PsiElement elementParent = elementToReplace.getParent();
    String replacementToMake = info.getReplacement();
    final boolean listContext = isListContext(elementToReplace);

    if (elementToReplace instanceof PsiAnnotation && !replacementToMake.isEmpty() &&
        !StringUtil.startsWithChar(replacementToMake, '@')) {
      replacementToMake = "@" + replacementToMake;
    }

    final PsiElement[] statements = ReplacerUtil
      .createTreeForReplacement(replacementToMake, elementToReplace instanceof PsiMember && !isSymbolReplacement(elementToReplace) ?
                                                   PatternTreeContext.Class :
                                                   PatternTreeContext.Block, myContext);

    if (elementToReplace instanceof PsiAnnotation && statements.length == 1) {
      final PsiElement statement = statements[0];
      if (statement instanceof PsiDeclarationStatement) {
        final PsiDeclarationStatement declarationStatement = (PsiDeclarationStatement)statement;
        final PsiElement firstChild = declarationStatement.getFirstChild();
        if (firstChild instanceof PsiModifierList) {
          final PsiModifierList modifierList = (PsiModifierList)firstChild;
          for (PsiElement child : modifierList.getChildren()) {
            elementParent.addBefore(child, elementToReplace);
          }
        }
      }
      elementToReplace.delete();
      return;
    }
    if (listContext) {
      if (statements.length > 1) {
        final PsiElement replacement = elementParent.addRangeBefore(statements[0], statements[statements.length - 1], elementToReplace);
        copyUnmatchedElements(elementToReplace, replacement);
      }
      else if (statements.length == 1) {
        PsiElement replacement = getMatchExpr(statements[0], elementToReplace);
        if (elementToReplace instanceof PsiParameter && replacement instanceof PsiLocalVariable) {
          final PsiVariable variable = (PsiVariable)replacement;
          final PsiIdentifier identifier = variable.getNameIdentifier();
          assert identifier != null;
          final String text = variable.getText();

          // chop off unneeded semicolons & initializers
          final String parameterText = text.substring(0, identifier.getStartOffsetInParent() + identifier.getTextLength());
          replacement = JavaPsiFacade.getElementFactory(variable.getProject()).createParameterFromText(parameterText, variable);
        }

        copyUnmatchedElements(elementToReplace, replacement);
        replacement = handleSymbolReplacement(replacement, elementToReplace);

        if (replacement instanceof PsiTryStatement) {
          final PsiTryStatement tryStatement = (PsiTryStatement)replacement;
          final List<PsiElement> unmatchedElements = elementToReplace.getUserData(GlobalMatchingVisitor.UNMATCHED_ELEMENTS_KEY);
          if (unmatchedElements != null) {
            final PsiElement firstElement = unmatchedElements.get(0);
            if (firstElement instanceof PsiResourceList) addElementAfterAnchor(tryStatement, firstElement, tryStatement.getFirstChild());
            final PsiCatchSection[] catches = tryStatement.getCatchSections();
            final PsiElement anchor = catches.length == 0 ? tryStatement.getTryBlock() : catches[catches.length - 1];
            for (int i = unmatchedElements.size() - 1; i >= 0; i--) {
              final PsiElement element = unmatchedElements.get(i);
              if ((element instanceof PsiCatchSection)) addElementAfterAnchor(tryStatement, element, anchor);
            }
            final PsiElement lastElement = unmatchedElements.get(unmatchedElements.size() - 1);
            if (lastElement instanceof PsiCodeBlock) {
              final PsiElement finallyKeyword = PsiTreeUtil.skipSiblingsBackward(lastElement, PsiWhiteSpace.class);
              assert finallyKeyword != null;
              final PsiElement finallyAnchor = tryStatement.getLastChild();
              addElementAfterAnchor(tryStatement, lastElement, finallyAnchor);
              addElementAfterAnchor(tryStatement, finallyKeyword, finallyAnchor);
            }
          }
        }

        try {
          final PsiElement inserted = elementParent.addBefore(replacement, elementToReplace);

          if (replacement instanceof PsiComment &&
              (elementParent instanceof PsiIfStatement ||
               elementParent instanceof PsiLoopStatement
              )
            ) {
            elementParent.addAfter(createSemicolon(replacement), inserted);
          }
        }
        catch (IncorrectOperationException e) {
          elementToReplace.replace(replacement);
        }
      }
    }
    else if (statements.length > 0) {
      PsiElement replacement = ReplacerUtil.copySpacesAndCommentsBefore(elementToReplace, statements, replacementToMake, elementParent);

      replacement = getMatchExpr(replacement, elementToReplace);

      if (replacement instanceof PsiStatement &&
          !(replacement.getLastChild() instanceof PsiJavaToken) &&
          !(replacement.getLastChild() instanceof PsiComment)
        ) {
        // assert w/o ;
        final PsiElement prevLastChildInParent = replacement.getLastChild().getPrevSibling();

        if (prevLastChildInParent != null) {
          elementParent.addRangeBefore(replacement.getFirstChild(), prevLastChildInParent, elementToReplace);
        }
        else {
          elementParent.addBefore(replacement.getFirstChild(), elementToReplace);
        }

        elementToReplace.getNode().getTreeParent().removeChild(elementToReplace.getNode());
      }
      else {
        // preserve comments
        copyUnmatchedElements(elementToReplace, replacement);

        if (replacement instanceof PsiClass) {
          final PsiStatement[] searchStatements = getCodeBlock().getStatements();
          if (searchStatements.length > 0 &&
              searchStatements[0] instanceof PsiDeclarationStatement &&
              ((PsiDeclarationStatement)searchStatements[0]).getDeclaredElements()[0] instanceof PsiClass
            ) {
            final PsiClass replaceClazz = (PsiClass)replacement;
            final PsiClass queryClazz = (PsiClass)((PsiDeclarationStatement)searchStatements[0]).getDeclaredElements()[0];
            final PsiClass clazz = (PsiClass)elementToReplace;

            if (replaceClazz.getExtendsList().getTextLength() == 0 &&
                queryClazz.getExtendsList().getTextLength() == 0 &&
                clazz.getExtendsList().getTextLength() != 0
              ) {
              replaceClazz.addBefore(clazz.getExtendsList().getPrevSibling(), replaceClazz.getExtendsList()); // whitespace
              replaceClazz.getExtendsList().addRange(
                clazz.getExtendsList().getFirstChild(), clazz.getExtendsList().getLastChild()
              );
            }

            if (replaceClazz.getImplementsList().getTextLength() == 0 &&
                queryClazz.getImplementsList().getTextLength() == 0 &&
                clazz.getImplementsList().getTextLength() != 0
              ) {
              replaceClazz.addBefore(clazz.getImplementsList().getPrevSibling(), replaceClazz.getImplementsList()); // whitespace
              replaceClazz.getImplementsList().addRange(
                clazz.getImplementsList().getFirstChild(),
                clazz.getImplementsList().getLastChild()
              );
            }

            if (replaceClazz.getTypeParameterList().getTextLength() == 0 &&
                queryClazz.getTypeParameterList().getTextLength() == 0 &&
                clazz.getTypeParameterList().getTextLength() != 0
              ) {
              // skip < and >
              replaceClazz.getTypeParameterList().replace(
                clazz.getTypeParameterList()
              );
            }
          }
        }

        replacement = handleSymbolReplacement(replacement, elementToReplace);

        elementToReplace.replace(replacement);
      }
    }
    else {
      final PsiElement nextSibling = elementToReplace.getNextSibling();
      elementToReplace.delete();
      if (nextSibling instanceof PsiWhiteSpace && nextSibling.isValid()) {
        nextSibling.delete();
      }
    }

    if (listContext) {
      final int matchSize = info.getMatchesCount();

      for (int i = 0; i < matchSize; ++i) {
        PsiElement matchElement = info.getMatch(i);
        PsiElement element = findRealSubstitutionElement(matchElement);

        if (element == null) continue;
        PsiElement firstToDelete = element;
        PsiElement lastToDelete = element;
        PsiElement prevSibling = element.getPrevSibling();
        PsiElement nextSibling = element.getNextSibling();

        if (prevSibling instanceof PsiWhiteSpace) {
          firstToDelete = prevSibling;
          prevSibling = prevSibling.getPrevSibling();
        }
        else if (prevSibling == null && nextSibling instanceof PsiWhiteSpace) {
          lastToDelete = nextSibling;
        }

        if (element instanceof PsiExpression) {
          final PsiElement parent = element.getParent().getParent();
          if ((parent instanceof PsiCall || parent instanceof PsiAnonymousClass) && PsiUtil.isJavaToken(prevSibling, JavaTokenType.COMMA)) {
            firstToDelete = prevSibling;
          }
        }
        else if (element instanceof PsiParameter && PsiUtil.isJavaToken(prevSibling, JavaTokenType.COMMA)) {
          firstToDelete = prevSibling;
        }
        else if (element instanceof PsiField) {
          while (PsiUtil.isJavaToken(nextSibling, JavaTokenType.COMMA)) {
            lastToDelete = PsiTreeUtil.skipSiblingsForward(nextSibling, PsiWhiteSpace.class);
            nextSibling = PsiTreeUtil.skipSiblingsForward(lastToDelete, PsiWhiteSpace.class);
          }
        }

        element.getParent().deleteChildRange(firstToDelete, lastToDelete);
      }
    }
  }

  private static void addElementAfterAnchor(PsiElement parentElement, PsiElement element, PsiElement anchor) {
    parentElement.addAfter(element, anchor);
    final PsiElement sibling = element.getPrevSibling();
    if (sibling instanceof PsiWhiteSpace) parentElement.addAfter(sibling, anchor); // recycle whitespace
  }

  @Override
  public void postProcess(PsiElement affectedElement, ReplaceOptions options) {
    if (!affectedElement.isValid()) {
      return;
    }
    if (options.isToUseStaticImport()) {
      shortenWithStaticImports(affectedElement, 0, affectedElement.getTextLength());
    }
    if (options.isToShortenFQN()) {
      final JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(affectedElement.getProject());
      codeStyleManager.shortenClassReferences(affectedElement, 0, affectedElement.getTextLength());
    }
  }

  private static void shortenWithStaticImports(PsiElement affectedElement, int startOffset, int endOffset) {
    final int elementOffset = affectedElement.getTextOffset();
    final int finalStartOffset = startOffset + elementOffset;
    final int finalEndOffset = endOffset + elementOffset;
    final List<PsiJavaCodeReferenceElement> references = new ArrayList<>();
    final JavaRecursiveElementVisitor collector = new JavaRecursiveElementVisitor() {
      @Override
      public void visitReferenceElement(PsiJavaCodeReferenceElement reference) {
        final int offset = reference.getTextOffset();
        if (offset > finalEndOffset) {
          return;
        }
        super.visitReferenceElement(reference);
        if (offset + reference.getTextLength() < finalStartOffset) {
          return;
        }
        if (reference.getTypeParameters().length != 0) {
          return;
        }
        final PsiElement target = reference.resolve();
        if (!(target instanceof PsiMember)) {
          return;
        }
        final PsiMember member = (PsiMember)target;
        if (!member.hasModifierProperty(PsiModifier.STATIC)) {
          return;
        }
        if (reference.getQualifier() == null) {
          return;
        }
        references.add(reference);
      }
    };
    affectedElement.accept(collector);
    for (PsiJavaCodeReferenceElement expression : references) {
      final PsiElement target = expression.resolve();
      if (!(target instanceof PsiMember)) {
        continue;
      }
      final PsiMember member = (PsiMember)target;
      final PsiClass containingClass = member.getContainingClass();
      if (containingClass == null) {
        continue;
      }
      final String className = containingClass.getQualifiedName();
      if (className == null) {
        continue;
      }
      final String name = member.getName();
      if (name == null) {
        continue;
      }
      if (ImportUtils.addStaticImport(className, name, expression)) {
        final PsiElement qualifier = expression.getQualifier();
        if (qualifier != null) {
          qualifier.delete();
        }
      }
    }
  }

  @Nullable
  private static PsiElement createSemicolon(final PsiElement space) throws IncorrectOperationException {
    final PsiStatement text = JavaPsiFacade.getInstance(space.getProject()).getElementFactory().createStatementFromText(";", null);
    return text.getFirstChild();
  }

  private static class Collector extends JavaRecursiveElementWalkingVisitor {
    private final HashMap<String, PsiNamedElement> namedElements = new HashMap<>(1);

    public static  Map<String, PsiNamedElement> collectNamedElements(PsiElement context) {
      final Collector collector = new Collector();
      context.accept(collector);
      return collector.namedElements;
    }

    @Override
    public void visitClass(PsiClass aClass) {
      if (aClass instanceof PsiAnonymousClass) return;
      handleNamedElement(aClass);
    }

    private void handleNamedElement(final PsiNamedElement named) {
      String name = named.getName();

      assert name != null;

      if (StructuralSearchUtil.isTypedVariable(name)) {
        name = name.substring(1, name.length() - 1);
      }

      if (!namedElements.containsKey(name)) namedElements.put(name, named);
      named.acceptChildren(this);
    }

    @Override
    public void visitVariable(PsiVariable var) {
      handleNamedElement(var);
    }

    @Override
    public void visitMethod(PsiMethod method) {
      handleNamedElement(method);
    }
  }
}


text:
go-sat is a pure Go library for solving
[Boolean satisfiability problems (SAT)](https://en.wikipedia.org/wiki/Boolean_satisfiability_problem).

Solving SAT problems is at the core of a number of more difficult higher
level problems. From hardware/software verification, scheduling constraints,
version resolution, etc. many problems are reduced fully or partially to a
SAT problem.

Many existing SAT libraries exist that are efficient and easy to bind to
if using cgo is an option for you. This library aims to be a pure Go SAT
solver that requires no cgo.

It is highly unlikely that this library will ever be as fast as leading
SAT solvers in the field. If you require performance or are solving
hard SAT problems, you may want to consider wrapping an existing SAT solver
with cgo or via os/exec. However, having a pure Go SAT solver is useful
for easy cross-compilation in many real world cases.

## Features

The root package is `sat` which contains the SAT solver itself that can
solve a boolean formula.

In addition to the solver, this library contains a number of sub-packages
for working with SAT problems and formulas:

  * `cnf` - Data structure to represent and perform operations on a boolean
    formula in [conjunctive normal form](https://en.wikipedia.org/wiki/Conjunctive_normal_form).

  * `dimacs` - A parser for the [DIMACS CNF format](http://www.domagoj-babic.com/uploads/ResearchProjects/Spear/dimacs-cnf.pdf),
    a widely accepted format for boolean formulas in [CNF](https://en.wikipedia.org/wiki/Conjunctive_normal_form).

## Implementation and Performance

go-sat is a fairly standard CDCL (conflict-driven clause learning) solver.
The following ideas are present in go-sat:

  * [Unit propogation](https://en.wikipedia.org/wiki/Unit_propagation)
  * [Backjumping](https://en.wikipedia.org/wiki/Backjumping)
  * [Clause Learning](https://en.wikipedia.org/wiki/Conflict-Driven_Clause_Learning)
  * [Watched Literals](http://constraintmodelling.org/files/2015/07/GentJeffersonMiguelCP06.pdf)

Numerous improvements can easily be made to the solver that aren't yet
present: better decision literal selection, clause minimization, restart
heuristics, etc.

go-sat is still one or two orders of magnitude slower than leading SAT
solvers (such as Minisat, CryptoMinisat, Glucose, MapleSAT, etc.). I'd
love to narrow that gap and welcome any contributions towards that.

## Installation

go-sat is a standard Go library that can be installed and referenced using
standard `go get` and import paths. For example, the root `sat` package:

    go get github.com/mitchellh/go-sat

## Example

Below is a basic example of using `go-sat`.

Note that the solver itself requires the formula already be in
CNF (conjunctive normal form). The solver expects higher level packages
to convert high level boolean expressions to this form prior to using
the solver.

```
// Consider the example formula already in CNF.
//
// ( ¬x1 ∨ ¬x3 ∨ ¬x4 ) ∧ ( x2 ∨ x3 ∨ ¬x4 ) ∧
// ( x1 ∨ ¬x2 ∨ x4 ) ∧ ( x1 ∨ x3 ∨ x4 ) ∧ ( ¬x1 ∨ x2 ∨ ¬x3 )
// (¬x4)

// Represent each variable as an int where a negative value means negated
formula := cnf.NewFormulaFromInts([][]int{
	[]int{-1, -3, -4},
	[]int{2, 3, -4},
	[]int{1, -2, 4},
	[]int{1, 3, 4},
	[]int{-1, 2, -3},
	[]int{-4},
})

// Create a solver and add the formulas to solve
s := sat.New()
s.AddFormula(formula)

// For low level details on how a solution came to be:
// s.Trace = true
// s.Tracer = log.New(os.Stderr, "", log.LstdFlags)

// Solve it!
sat := s.Solve()

// Solution can be read from Assignments. The key is the variable
// (always positive) and the value is the value.
solution := s.Assignments()

fmt.Printf("Solved: %v\n", sat)
fmt.Printf("Solution:\n")
fmt.Printf("  x1 = %v\n", solution[1])
fmt.Printf("  x2 = %v\n", solution[2])
fmt.Printf("  x3 = %v\n", solution[3])
fmt.Printf("  x4 = %v\n", solution[4])
// Output:
// Solved: true
// Solution:
//   x1 = true
//   x2 = true
//   x3 = true
//   x4 = false
```

## Issues and Contributing

If you find an issue with this library, please report an issue. If you'd like,
we welcome any contributions. Fork this library and submit a pull request.

SAT solving is an intensely competitive and fast-moving area of research. As
advancements are made, I welcome any contributions or recommendations to
improve this solver.

## Thanks

Thanks to [Minisat](http://minisat.se/) for providing understandable
and efficient implementations of SAT solving concepts. go-sat translates many
of their data representations and algorithms directly due to the clarity
of their implementation.

Beyond Minisat, the SAT community is extremely active and filled with
a large array of interesting research papers. Thanks to the authors of
those papers for making your research public and the relentless dedication
of many to improve SAT solving.

I merely stood on the shoulders of prior work to implement a solver in Go,
and claim no credit for any ideas here.