(1) If a witness required to enter into a recognizance to appear refuses to comply with the order, the trial court judge shall commit the witness to custody until she or he complies or she or he is legally discharged.
(2) If the trial court judge requires a witness to give security for her or his appearance and the witness is unable to give the security, the witness may apply to the court having jurisdiction to try the defendant for a reduction of the security.
(3) If it appears from examination on oath of the witness or any other person that the witness is unable to give security, the trial court judge or the court having jurisdiction to try the defendant shall make an order finding that fact, and the witness shall be detained pending application for her or his conditional examination. Within 3 days from the entry of the order, the witness shall be conditionally examined on application of the state or the defendant. The examination shall be by question and answer in the presence of the other party and counsel, and shall be transcribed by a court reporter or stenographer selected by the parties. At the completion of the examination the witness shall be discharged. The deposition of the witness may be introduced in evidence at the trial by the defendant, or, if the prosecuting attorney and the defendant and the defendant’s counsel agree, it may be admitted in evidence by stipulation. The deposition shall not be admitted on behalf of the state without the consent of the defendant.
(4) If a conditional examination is not made within 3 days, the witness shall be discharged.
(5) A witness detained for conditional examination shall be entitled to fees as a witness for the period of her or his commitment.